From 083c698196aa5228de9b6a8017d7b59be67a8d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Gioachini?= Date: Sun, 7 Sep 2025 20:51:51 -0300 Subject: [PATCH] refactor path reading Co-authored-by: Bruno Alla --- tests/test_cookiecutter_generation.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index a066208ec..0fceb4834 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -168,10 +168,9 @@ def check_paths(paths: Iterable[Path]): if is_binary(str(path)): continue - with path.open() as file: - for line in file: - match = RE_OBJ.search(line) - assert match is None, f"cookiecutter variable not replaced in {path}" + content = path.read_text() + match = RE_OBJ.search(content) + assert match is None, f"cookiecutter variable not replaced in {path}" @pytest.mark.parametrize("context_override", SUPPORTED_COMBINATIONS, ids=_fixture_id)