diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-01-11 23:13:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-11 23:13:02 (GMT) |
commit | b902671d36da219efee16c8b183882dc93132898 (patch) | |
tree | e5fa22c7e34a494d9cac9deb8e1e188069e1033c /Lib/test | |
parent | 5c238225f60c33cf1931b1a8c9a3310192c716ae (diff) | |
download | cpython-b902671d36da219efee16c8b183882dc93132898.zip cpython-b902671d36da219efee16c8b183882dc93132898.tar.gz cpython-b902671d36da219efee16c8b183882dc93132898.tar.bz2 |
gh-81489: Use Unicode APIs for mmap tagname on Windows (GH-14133)
(cherry picked from commit b4d4aa9e8d61476267951c72321fadffc2d82227)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_mmap.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py index dfcf303..1867e8c 100644 --- a/Lib/test/test_mmap.py +++ b/Lib/test/test_mmap.py @@ -671,14 +671,16 @@ class MmapTests(unittest.TestCase): m2.close() m1.close() + with self.assertRaisesRegex(TypeError, 'tagname'): + mmap.mmap(-1, 8, tagname=1) + @cpython_only @unittest.skipUnless(os.name == 'nt', 'requires Windows') def test_sizeof(self): m1 = mmap.mmap(-1, 100) tagname = random_tagname() m2 = mmap.mmap(-1, 100, tagname=tagname) - self.assertEqual(sys.getsizeof(m2), - sys.getsizeof(m1) + len(tagname) + 1) + self.assertGreater(sys.getsizeof(m2), sys.getsizeof(m1)) @unittest.skipUnless(os.name == 'nt', 'requires Windows') def test_crasher_on_windows(self): |