Skip to content

Commit

Permalink
Do not use rm -rf, was throwing error on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
martinghunt committed Jun 24, 2021
1 parent 9d4b0be commit 6a7e7f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/species_data_tests/test_data_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import os
import pytest
import shutil
import subprocess
import time

from mykrobe.species_data import DataDir
Expand All @@ -18,7 +17,8 @@ def test_data_dir():

# Create an empty data dir
temp_dir = "tmp.test_data_dir"
subprocess.check_output(f"rm -rf {temp_dir}", shell=True)
if os.path.exists(temp_dir):
shutil.rmtree(temp_dir)
ddir = DataDir(temp_dir)
assert ddir.manifest == {}
ddir.create_root()
Expand Down
4 changes: 2 additions & 2 deletions tests/species_data_tests/test_species_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
import os
import pytest
import shutil
import subprocess

from mykrobe.species_data import SpeciesDir


def test_species_dir():
temp_dir = "tmp.test_species_dir"
subprocess.check_output(f"rm -rf {temp_dir}", shell=True)
if os.path.exists(temp_dir):
shutil.rmtree(temp_dir)
with pytest.raises(FileNotFoundError):
sdir = SpeciesDir(temp_dir)
os.mkdir(temp_dir)
Expand Down

0 comments on commit 6a7e7f6

Please sign in to comment.