Skip to content

Commit

Permalink
check if isdir
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinMusgrave committed Dec 11, 2024
1 parent 7029b88 commit 6b61de6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/datasets/test_cars196.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ def test_CARS_196_dataloader(self):

@classmethod
def tearDownClass(cls):
if not cls.ALREADY_EXISTS:
if not cls.ALREADY_EXISTS and os.path.isdir(cls.CARS_196_ROOT):
shutil.rmtree(cls.CARS_196_ROOT)
2 changes: 1 addition & 1 deletion tests/datasets/test_cub.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ def test_CUB_dataloader(self):

@classmethod
def tearDownClass(cls):
if not cls.ALREADY_EXISTS:
if not cls.ALREADY_EXISTS and os.path.isdir(cls.CUB_ROOT):
shutil.rmtree(cls.CUB_ROOT)
2 changes: 1 addition & 1 deletion tests/datasets/test_inaturalist2018.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ def test_INaturalist2018_dataloader(self):

@classmethod
def tearDownClass(cls):
if not cls.ALREADY_EXISTS:
if not cls.ALREADY_EXISTS and os.path.isdir(cls.INATURALIST2018_ROOT):
shutil.rmtree(cls.INATURALIST2018_ROOT)
3 changes: 2 additions & 1 deletion tests/datasets/test_sop.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def test_SOP_dataloader(self):
self.assertTupleEqual(tuple(inputs.shape), (8, 3, 224, 224))
self.assertTupleEqual(tuple(labels.shape), (8,))

@unittest.skipUnless(TEST_DATASETS, "TEST_DATASETS is false")
@classmethod
def tearDownClass(cls):
if not cls.ALREADY_EXISTS:
if not cls.ALREADY_EXISTS and os.path.isdir(cls.SOP_ROOT):
shutil.rmtree(cls.SOP_ROOT)

0 comments on commit 6b61de6

Please sign in to comment.