summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_getargs2.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-07-10 20:26:06 (GMT)
committerGitHub <noreply@github.com>2020-07-10 20:26:06 (GMT)
commit4c8f09d7cef8c7aa07d5b5232b5b64f63819a743 (patch)
tree2d90e13b6dc939f019a6cafc45ea604cbb90f584 /Lib/test/test_getargs2.py
parent9650fe0197779b4dfded94be111e39c5810f098f (diff)
downloadcpython-4c8f09d7cef8c7aa07d5b5232b5b64f63819a743.zip
cpython-4c8f09d7cef8c7aa07d5b5232b5b64f63819a743.tar.gz
cpython-4c8f09d7cef8c7aa07d5b5232b5b64f63819a743.tar.bz2
bpo-36346: Make using the legacy Unicode C API optional (GH-21437)
Add compile time option USE_UNICODE_WCHAR_CACHE. Setting it to 0 makes the interpreter not using the wchar_t cache and the legacy Unicode C API.
Diffstat (limited to 'Lib/test/test_getargs2.py')
-rw-r--r--Lib/test/test_getargs2.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py
index d39ea56..0956019 100644
--- a/Lib/test/test_getargs2.py
+++ b/Lib/test/test_getargs2.py
@@ -976,6 +976,7 @@ class String_TestCase(unittest.TestCase):
buf = bytearray()
self.assertRaises(ValueError, getargs_et_hash, 'abc\xe9', 'latin1', buf)
+ @support.requires_legacy_unicode_capi
def test_u(self):
from _testcapi import getargs_u
self.assertEqual(getargs_u('abc\xe9'), 'abc\xe9')
@@ -985,6 +986,7 @@ class String_TestCase(unittest.TestCase):
self.assertRaises(TypeError, getargs_u, memoryview(b'memoryview'))
self.assertRaises(TypeError, getargs_u, None)
+ @support.requires_legacy_unicode_capi
def test_u_hash(self):
from _testcapi import getargs_u_hash
self.assertEqual(getargs_u_hash('abc\xe9'), 'abc\xe9')
@@ -994,6 +996,7 @@ class String_TestCase(unittest.TestCase):
self.assertRaises(TypeError, getargs_u_hash, memoryview(b'memoryview'))
self.assertRaises(TypeError, getargs_u_hash, None)
+ @support.requires_legacy_unicode_capi
def test_Z(self):
from _testcapi import getargs_Z
self.assertEqual(getargs_Z('abc\xe9'), 'abc\xe9')
@@ -1003,6 +1006,7 @@ class String_TestCase(unittest.TestCase):
self.assertRaises(TypeError, getargs_Z, memoryview(b'memoryview'))
self.assertIsNone(getargs_Z(None))
+ @support.requires_legacy_unicode_capi
def test_Z_hash(self):
from _testcapi import getargs_Z_hash
self.assertEqual(getargs_Z_hash('abc\xe9'), 'abc\xe9')