Fix ResourceWarning for unclosed files in test_cookiecutter_generation.py (#6020)

Co-authored-by: MauGx3 <225707+MauGx3@users.noreply.github.com>
Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
Maurício Gioachini 2025-09-08 10:18:49 -03:00 committed by GitHub
parent ff9ad66afc
commit 1f9f461581
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -168,9 +168,9 @@ def check_paths(paths: Iterable[Path]):
if is_binary(str(path)): if is_binary(str(path)):
continue continue
for line in path.open(): content = path.read_text()
match = RE_OBJ.search(line) match = RE_OBJ.search(content)
assert match is None, f"cookiecutter variable not replaced in {path}" assert match is None, f"cookiecutter variable not replaced in {path}"
@pytest.mark.parametrize("context_override", SUPPORTED_COMBINATIONS, ids=_fixture_id) @pytest.mark.parametrize("context_override", SUPPORTED_COMBINATIONS, ids=_fixture_id)