diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-05-16 07:25:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-16 07:25:10 (GMT) |
commit | 0152dc4ff5534fa2948b95262e70ff6b202b9b99 (patch) | |
tree | cf311cb487a6f1956ab942d6356e5b5698659f85 /Lib/test/test_zipapp.py | |
parent | 0142a2292c3d3bfa56a987d576a9678be0f56931 (diff) | |
download | cpython-0152dc4ff5534fa2948b95262e70ff6b202b9b99.zip cpython-0152dc4ff5534fa2948b95262e70ff6b202b9b99.tar.gz cpython-0152dc4ff5534fa2948b95262e70ff6b202b9b99.tar.bz2 |
gh-119064: Use os_helper.FakePath instead of pathlib.Path in tests (GH-119065)
Diffstat (limited to 'Lib/test/test_zipapp.py')
-rw-r--r-- | Lib/test/test_zipapp.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_zipapp.py b/Lib/test/test_zipapp.py index f1c6b2d..00a5ed6 100644 --- a/Lib/test/test_zipapp.py +++ b/Lib/test/test_zipapp.py @@ -265,14 +265,15 @@ class ZipAppTest(unittest.TestCase): zipapp.create_archive(str(target), new_target, interpreter='python2.7') self.assertTrue(new_target.getvalue().startswith(b'#!python2.7\n')) - def test_read_from_pathobj(self): - # Test that we can copy an archive using a pathlib.Path object + def test_read_from_pathlike_obj(self): + # Test that we can copy an archive using a path-like object # for the source. source = self.tmpdir / 'source' source.mkdir() (source / '__main__.py').touch() - target1 = self.tmpdir / 'target1.pyz' - target2 = self.tmpdir / 'target2.pyz' + source = os_helper.FakePath(str(source)) + target1 = os_helper.FakePath(str(self.tmpdir / 'target1.pyz')) + target2 = os_helper.FakePath(str(self.tmpdir / 'target2.pyz')) zipapp.create_archive(source, target1, interpreter='python') zipapp.create_archive(target1, target2, interpreter='python2.7') self.assertEqual(zipapp.get_interpreter(target2), 'python2.7') |