chore(project): 🗑️ remove temporary file, add todo reminder
remove the test_unicode.txt used for unicode reading tests. Todo reminder is for coverage score to improve in the future
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
D�claration
|
|
||||||
@@ -26,7 +26,7 @@ def _read_fixture(path: Path) -> str:
|
|||||||
return path.read_text(encoding="windows-1252")
|
return path.read_text(encoding="windows-1252")
|
||||||
if "\ufffd" not in contenu:
|
if "\ufffd" not in contenu:
|
||||||
return contenu
|
return contenu
|
||||||
return path.read_text(encoding="windows-1252")
|
return path.read_text(encoding="windows-1252") # TODO: improve coverage score
|
||||||
|
|
||||||
@pytest.mark.parametrize("name, pattern", N2_PATTERNS.items())
|
@pytest.mark.parametrize("name, pattern", N2_PATTERNS.items())
|
||||||
def test_pattern_matches_fixture(name, pattern):
|
def test_pattern_matches_fixture(name, pattern):
|
||||||
@@ -66,13 +66,13 @@ def test_patterns_do_not_overlap():
|
|||||||
"""
|
"""
|
||||||
fixtures_dir = FIXTURE_PATH
|
fixtures_dir = FIXTURE_PATH
|
||||||
for fixture in fixtures_dir.glob("CR_*.txt"):
|
for fixture in fixtures_dir.glob("CR_*.txt"):
|
||||||
line_list = [line for line in _read_fixture(fixture).splitlines() if line.strip()]
|
line_list = [line for line in _read_fixture(fixture).splitlines() if line.strip()] # TODO: improve coverage score
|
||||||
for line in line_list:
|
for line in line_list: # TODO: improve coverage score
|
||||||
matching = [
|
matching = [ # TODO: improve coverage score
|
||||||
name for name, raw in N2_PATTERNS.items()
|
name for name, raw in N2_PATTERNS.items()
|
||||||
if re.compile(raw).search(line)
|
if re.compile(raw).search(line)
|
||||||
]
|
]
|
||||||
assert len(matching) <= 1, (
|
assert len(matching) <= 1, ( # TODO: improve coverage score
|
||||||
f"Chevauchement détecté sur {fixture.name} : "
|
f"Chevauchement détecté sur {fixture.name} : "
|
||||||
f"{matching} match line : {line[:80]}"
|
f"{matching} match line : {line[:80]}"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user