Skip to content

Commit

Permalink
Separate 'disk' concern of namespace tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Sep 12, 2023
1 parent 496acc1 commit 023d2c1
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions importlib_resources/tests/test_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,7 @@ def test_read_text_does_not_keep_open(self):
resources.files('data01').joinpath('utf-8.file').read_text(encoding='utf-8')


class ResourceFromNamespaceTest01(unittest.TestCase):
site_dir = str(pathlib.Path(__file__).parent)

@classmethod
def setUpClass(cls):
sys.path.append(cls.site_dir)

@classmethod
def tearDownClass(cls):
sys.path.remove(cls.site_dir)

class ResourceFromNamespaceTests:
def test_is_submodule_resource(self):
self.assertTrue(
resources.files(import_module('namespacedata01'))
Expand Down Expand Up @@ -207,5 +197,17 @@ def test_submodule_contents_by_name(self):
self.assertEqual(contents, {'binary.file', 'utf-8.file', 'utf-16.file'})


class ResourceFromNamespaceDiskTests(ResourceFromNamespaceTests, unittest.TestCase):
site_dir = str(pathlib.Path(__file__).parent)

@classmethod
def setUpClass(cls):
sys.path.append(cls.site_dir)

@classmethod
def tearDownClass(cls):
sys.path.remove(cls.site_dir)


if __name__ == '__main__':
unittest.main()

0 comments on commit 023d2c1

Please sign in to comment.