diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2021-12-19 02:28:49 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-19 02:28:49 (GMT) |
commit | 9b52920173735ac609664c6a3a3021d24a95a092 (patch) | |
tree | ffc7dc7dc01cddc6973bd9cf9e4cb649258365d1 /Lib/test/test_importlib/resources/util.py | |
parent | fe68486197cb26a69ecce9353271d91adf885cb5 (diff) | |
download | cpython-9b52920173735ac609664c6a3a3021d24a95a092.zip cpython-9b52920173735ac609664c6a3a3021d24a95a092.tar.gz cpython-9b52920173735ac609664c6a3a3021d24a95a092.tar.bz2 |
bpo-46125: Refactor tests to test traversable API directly. Includes changes from importlib_resources 5.4.0. (GH-30189)
Diffstat (limited to 'Lib/test/test_importlib/resources/util.py')
-rw-r--r-- | Lib/test/test_importlib/resources/util.py | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/Lib/test/test_importlib/resources/util.py b/Lib/test/test_importlib/resources/util.py index 7192632..11c8aa8 100644 --- a/Lib/test/test_importlib/resources/util.py +++ b/Lib/test/test_importlib/resources/util.py @@ -1,10 +1,8 @@ import abc -import contextlib import importlib import io import sys import types -import warnings from pathlib import Path, PurePath from .. import data01 @@ -69,13 +67,6 @@ def create_package(file=None, path=None, is_package=True, contents=()): ) -@contextlib.contextmanager -def suppress_known_deprecation(): - with warnings.catch_warnings(record=True) as ctx: - warnings.simplefilter('default', category=DeprecationWarning) - yield ctx - - class CommonTests(metaclass=abc.ABCMeta): """ Tests shared by test_open, test_path, and test_read. @@ -106,18 +97,6 @@ class CommonTests(metaclass=abc.ABCMeta): path = PurePath('utf-8.file') self.execute(data01, path) - def test_absolute_path(self): - # An absolute path is a ValueError. - path = Path(__file__) - full_path = path.parent / 'utf-8.file' - with self.assertRaises(ValueError): - self.execute(data01, full_path) - - def test_relative_path(self): - # A reative path is a ValueError. - with self.assertRaises(ValueError): - self.execute(data01, '../data01/utf-8.file') - def test_importing_module_as_side_effect(self): # The anchor package can already be imported. del sys.modules[data01.__name__] |