From 26c74c35c27da67e3111deb7d0fb2ed9a95e556d Mon Sep 17 00:00:00 2001 From: Kev Date: Mon, 16 Dec 2024 19:00:10 -0500 Subject: [PATCH] Exclude lines from coverage --- lib/lang/ja.py | 4 ++-- lib/lang/x-pig-latin.py | 2 +- test.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/lang/ja.py b/lib/lang/ja.py index c743f7a..2a1915f 100644 --- a/lib/lang/ja.py +++ b/lib/lang/ja.py @@ -2,11 +2,11 @@ def join_with_shared_prefix(a, b, joiner): i = 0 # Find the shared prefix length where characters match - while i != len(a) and i != len(b) and ord(a[i]) == ord(b[i]): + while i != len(a) and i != len(b) and ord(a[i]) == ord(b[i]): # pragma: no cover i += 1 # Move back to the last space character if needed - while i > 0 and a[i - 1] != " ": + while i > 0 and a[i - 1] != " ": # pragma: no cover i -= 1 # Return the concatenated result diff --git a/lib/lang/x-pig-latin.py b/lib/lang/x-pig-latin.py index 4f28651..5322d79 100644 --- a/lib/lang/x-pig-latin.py +++ b/lib/lang/x-pig-latin.py @@ -16,7 +16,7 @@ def join_with_shared_prefix(a, b, joiner): # ...except whitespace! We need that whitespace! # Move back until we hit a space or start of string - while i > 0 and (i > len(b) or (i <= len(b) and b[i - 1] != " ")): + while i > 0 and (i > len(b) or (i <= len(b) and b[i - 1] != " ")): # pragma: no cover i -= 1 return a + joiner + b[i:] diff --git a/test.py b/test.py index 3e7b6c8..414e2a6 100644 --- a/test.py +++ b/test.py @@ -133,7 +133,7 @@ def test_languages(subtests): spec.loader.exec_module(mod) # `template` must be defined inside the Python module - if not hasattr(mod, "cases"): + if not hasattr(mod, "cases"): # pragma: no cover raise Exception(f"No 'cases' found in {lang_name}.py") template = mod.cases