|
16 | 16 |
|
17 | 17 | from test import support
|
18 | 18 | from test.support import script_helper
|
19 |
| -from test.support import warnings_helper |
20 | 19 |
|
21 | 20 | # Check for our compression modules.
|
22 | 21 | try:
|
@@ -2711,8 +2710,7 @@ def setUpClass(cls):
|
2711 | 2710 | tar.errorlevel = 0
|
2712 | 2711 | with ExitStack() as cm:
|
2713 | 2712 | if cls.extraction_filter is None:
|
2714 |
| - cm.enter_context(warnings.catch_warnings( |
2715 |
| - action="ignore", category=DeprecationWarning)) |
| 2713 | + cm.enter_context(warnings.catch_warnings()) |
2716 | 2714 | tar.extractall(cls.control_dir, filter=cls.extraction_filter)
|
2717 | 2715 | tar.close()
|
2718 | 2716 | cls.control_paths = set(
|
@@ -2842,8 +2840,8 @@ def test_list(self):
|
2842 | 2840 | for attr_names in ({'mtime'}, {'mode'}, {'uid'}, {'gid'},
|
2843 | 2841 | {'uname'}, {'gname'},
|
2844 | 2842 | {'uid', 'uname'}, {'gid', 'gname'}):
|
2845 |
| - with (self.subTest(attr_names=attr_names), |
2846 |
| - tarfile.open(tarname, encoding="iso8859-1") as tar): |
| 2843 | + with self.subTest(attr_names=attr_names), \ |
| 2844 | + tarfile.open(tarname, encoding="iso8859-1") as tar: |
2847 | 2845 | tio_prev = io.TextIOWrapper(io.BytesIO(), 'ascii', newline='\n')
|
2848 | 2846 | with support.swap_attr(sys, 'stdout', tio_prev):
|
2849 | 2847 | tar.list()
|
@@ -3034,7 +3032,7 @@ def expect_file(self, name, type=None, symlink_to=None, mode=None):
|
3034 | 3032 | if type is None and isinstance(name, str) and name.endswith('/'):
|
3035 | 3033 | type = tarfile.DIRTYPE
|
3036 | 3034 | if symlink_to is not None:
|
3037 |
| - got = (self.destdir / name).readlink() |
| 3035 | + got = pathlib.Path(os.readlink(self.destdir / name)) |
3038 | 3036 | expected = pathlib.Path(symlink_to)
|
3039 | 3037 | # The symlink might be the same (textually) as what we expect,
|
3040 | 3038 | # but some systems change the link to an equivalent path, so
|
@@ -3351,7 +3349,7 @@ def test_default_filter_warns(self):
|
3351 | 3349 | """Ensure the default filter warns"""
|
3352 | 3350 | with ArchiveMaker() as arc:
|
3353 | 3351 | arc.add('foo')
|
3354 |
| - with warnings_helper.check_warnings( |
| 3352 | + with support.check_warnings( |
3355 | 3353 | ('Python 3.14', DeprecationWarning)):
|
3356 | 3354 | with self.check_context(arc.open(), None):
|
3357 | 3355 | self.expect_file('foo')
|
|
0 commit comments