diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2021-03-04 12:22:33 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2021-03-04 12:22:33 -0500 |
commit | 84008ab1ffbf2b2e6302e7368e4d763736cad832 (patch) | |
tree | 7eeaa55055efc8823ef409cf0371a3477df422bf | |
parent | 18eab965181ad46f66956fb0cbec9e1081e7971e (diff) | |
download | cpython-git-feature/42129-resources-namespace-packages.tar.gz |
Apply changes from importlib_resources 5.0.4feature/42129-resources-namespace-packages
-rw-r--r-- | Lib/test/test_importlib/test_reader.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Lib/test/test_importlib/test_reader.py b/Lib/test/test_importlib/test_reader.py index 7a02ecdc10..905d4fcdec 100644 --- a/Lib/test/test_importlib/test_reader.py +++ b/Lib/test/test_importlib/test_reader.py @@ -1,5 +1,6 @@ import os.path import sys +import pathlib import unittest from importlib import import_module @@ -9,7 +10,8 @@ from importlib.readers import MultiplexedPath, NamespaceReader class MultiplexedPathTest(unittest.TestCase): @classmethod def setUpClass(cls): - cls.folder = os.path.abspath(os.path.join(__file__, '..', 'namespacedata01')) + path = pathlib.Path(__file__).parent / 'namespacedata01' + cls.folder = str(path) def test_init_no_paths(self): with self.assertRaises(FileNotFoundError): @@ -83,9 +85,15 @@ class MultiplexedPathTest(unittest.TestCase): class NamespaceReaderTest(unittest.TestCase): + site_dir = str(pathlib.Path(__file__).parent) + @classmethod def setUpClass(cls): - sys.path.append(os.path.abspath(os.path.join(__file__, '..'))) + sys.path.append(cls.site_dir) + + @classmethod + def tearDownClass(cls): + sys.path.remove(cls.site_dir) def test_init_error(self): with self.assertRaises(ValueError): |