Skip to content

Commit

Permalink
test: Cleanup directories conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Jul 20, 2024
1 parent 792f347 commit 03d5fc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion integration_tests/test_webservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from integration_tests import req

BASEDIR = os.path.realpath(".").replace("\\", "\\\\")
with (Path(__file__).absolute().parent.parent / "tests" / "quotesbot.egg").open("rb") as f:
with (Path(__file__).absolute().parent.parent / "tests" / "fixtures" / "quotesbot.egg").open("rb") as f:
EGG = f.read()


Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def root(request):
basedir = os.path.realpath(os.path.dirname(os.path.dirname(__file__)))
# Avoid accidentally deleting directories outside the project.
assert os.path.commonprefix((directory, basedir)) == basedir
shutil.rmtree(directory)
if os.path.exists(directory):
shutil.rmtree(directory)


@pytest.fixture()
Expand Down

0 comments on commit 03d5fc2

Please sign in to comment.