aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_importlib/resources/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_importlib/resources/util.py')
-rw-r--r--Lib/test/test_importlib/resources/util.py17
1 files changed, 3 insertions, 14 deletions
diff --git a/Lib/test/test_importlib/resources/util.py b/Lib/test/test_importlib/resources/util.py
index eb2291f15de..1e72b91ff6b 100644
--- a/Lib/test/test_importlib/resources/util.py
+++ b/Lib/test/test_importlib/resources/util.py
@@ -3,7 +3,7 @@ import importlib
import io
import sys
import types
-from pathlib import Path, PurePath
+import pathlib
from . import data01
from . import zipdata01
@@ -94,7 +94,7 @@ class CommonTests(metaclass=abc.ABCMeta):
def test_pathlib_path(self):
# Passing in a pathlib.PurePath object for the path should succeed.
- path = PurePath('utf-8.file')
+ path = pathlib.PurePath('utf-8.file')
self.execute(data01, path)
def test_importing_module_as_side_effect(self):
@@ -102,17 +102,6 @@ class CommonTests(metaclass=abc.ABCMeta):
del sys.modules[data01.__name__]
self.execute(data01.__name__, 'utf-8.file')
- def test_non_package_by_name(self):
- # The anchor package cannot be a module.
- with self.assertRaises(TypeError):
- self.execute(__name__, 'utf-8.file')
-
- def test_non_package_by_package(self):
- # The anchor package cannot be a module.
- with self.assertRaises(TypeError):
- module = sys.modules['test.test_importlib.resources.util']
- self.execute(module, 'utf-8.file')
-
def test_missing_path(self):
# Attempting to open or read or request the path for a
# non-existent path should succeed if open_resource
@@ -144,7 +133,7 @@ class ZipSetupBase:
@classmethod
def setUpClass(cls):
- data_path = Path(cls.ZIP_MODULE.__file__)
+ data_path = pathlib.Path(cls.ZIP_MODULE.__file__)
data_dir = data_path.parent
cls._zip_path = str(data_dir / 'ziptestdata.zip')
sys.path.append(cls._zip_path)