diff --git a/tests/test_per_category.py b/tests/test_per_category.py index 9c850ad..2f5683a 100644 --- a/tests/test_per_category.py +++ b/tests/test_per_category.py @@ -1,5 +1,5 @@ -from os import makedirs, listdir, rmdir -from os.path import exists, join +from os import makedirs, listdir +from os.path import join, dirname, realpath from shutil import rmtree from unittest import TestCase, main @@ -11,7 +11,9 @@ class PerCategoryTests(TestCase): def setUp(self): # Make expected directory structure - makedirs('../agp_processing/10-populated-templates/taxa') + currpath = dirname(realpath(__file__)) + self.dirpath = join(currpath, '../agp_processing/10-populated-templates/taxa') + makedirs(self.dirpath) self.path = agenv.paths['collapsed']['notrim']['1k'] agenv.paths['collapsed']['notrim']['1k'] = \ {'ag-biom': @@ -22,7 +24,7 @@ def setUp(self): '../tests/data/ag_testing/ag-oral-flossing.biom'} def tearDown(self): - rmtree('../agp_processing', ignore_errors=True) + rmtree(self.dirpath, ignore_errors=True) agenv.paths['collapsed']['notrim']['1k'] = self.path def test_cat_taxa_summaries(self):