Skip to content

Commit 551fa51

Browse files
committed
Remove newer test helpers
3.11+ has more granular platform support, mostly for WASI. Use the 3.10 idioms instead: - @symlink_test is a no-op on non-WASI platforms - can_chmod is approximated by "not win32" elsewhere in test_tarfile
1 parent 1924e21 commit 551fa51

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

Lib/test/test_tarfile.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3961,7 +3961,6 @@ def test_chmod_outside_dir(self):
39613961
st_mode = cc.outerdir.stat().st_mode
39623962
self.assertNotEqual(st_mode & 0o777, 0o777)
39633963

3964-
@symlink_test
39653964
@unittest.skipUnless(hasattr(os, 'chown'), "missing os.chown")
39663965
@unittest.skipUnless(hasattr(os, 'lchown'), "missing os.lchown")
39673966
@unittest.skipUnless(hasattr(os, 'geteuid'), "missing os.geteuid")
@@ -3997,7 +3996,6 @@ def test_chown_links_on_extract(self, link_type):
39973996
])
39983997
mock_lchown.assert_not_called()
39993998

4000-
@symlink_test
40013999
@unittest.skipUnless(hasattr(os, 'chown'), "missing os.chown")
40024000
@unittest.skipUnless(hasattr(os, 'lchown'), "missing os.lchown")
40034001
@unittest.skipUnless(hasattr(os, 'geteuid'), "missing os.geteuid")
@@ -4050,7 +4048,7 @@ def testing_filter(member, path):
40504048
with os_helper.temp_dir(tempdir), arc.open() as tar:
40514049
tar.extract("link", path=tempdir, filter=testing_filter)
40524050
path = tempdir / 'link'
4053-
if os_helper.can_chmod():
4051+
if sys.platform != 'win32':
40544052
self.assertFalse(path.stat().st_mode & stat.S_IWUSR)
40554053

40564054
def test_link_fallback_normalizes(self):

0 commit comments

Comments
 (0)