From ec0d4104d381c19f34255279c928637082ca80cd Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 21 Nov 2021 13:27:38 -0500 Subject: test(refactor): simplify the logic of writing subcover.pth --- tests/conftest.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index ca94e5d2..c8ca21f2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -105,10 +105,8 @@ def pytest_sessionstart(): if WORKER == "none": pth_dir = find_writable_pth_directory() assert pth_dir - pth_file = pth_dir / "subcover.pth" - if not pth_file.exists(): - pth_file.write_text("import coverage; coverage.process_startup()\n") - # pth_path is deleted by pytest_sessionfinish below. + (pth_dir / "subcover.pth").write_text("import coverage; coverage.process_startup()\n") + # subcover.pth is deleted by pytest_sessionfinish below. def pytest_sessionfinish(): -- cgit v1.2.1