mirror of
https://github.com/python/cpython.git
synced 2025-08-09 11:29:45 +00:00
[3.12] gh-119064: Use os_helper.FakePath instead of pathlib.Path in tests (GH-119065) (GH-119088)
(cherry picked from commit 0152dc4ff5
)
This commit is contained in:
parent
ed395f5c0e
commit
33a9f0ce65
19 changed files with 116 additions and 128 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue