bpo-37964: Make sure test works if TESTFN is in a non-ASCII directory. (GH-15568)

This commit is contained in:
Benjamin Peterson 2019-08-28 22:06:49 -07:00 committed by GitHub
parent b0caf32981
commit 465e5d5bcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -147,9 +147,9 @@ class TestFcntl(unittest.TestCase):
@unittest.skipIf(sys.platform != 'darwin', "F_GETPATH is only available on macos")
def test_fcntl_f_getpath(self):
self.f = open(TESTFN, 'wb')
abspath = os.path.abspath(TESTFN)
res = fcntl.fcntl(self.f.fileno(), fcntl.F_GETPATH, bytes(len(abspath)))
self.assertEqual(abspath, res.decode('utf-8'))
expected = os.path.abspath(TESTFN).encode('utf-8')
res = fcntl.fcntl(self.f.fileno(), fcntl.F_GETPATH, bytes(len(expected)))
self.assertEqual(expected, res)
def test_main():
run_unittest(TestFcntl)