diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2021-08-23 18:05:07 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-23 18:05:07 (GMT) |
| commit | 4d689173861257c69adc6dc1dca4171946ddb57f (patch) | |
| tree | 999326f40ad54b91981b2c23cb6166c6a649bdd9 /Lib/test/test_capi.py | |
| parent | 1a995b0ceefdf7eb59963f3ab395c47d8da226e3 (diff) | |
| download | cpython-4d689173861257c69adc6dc1dca4171946ddb57f.zip cpython-4d689173861257c69adc6dc1dca4171946ddb57f.tar.gz cpython-4d689173861257c69adc6dc1dca4171946ddb57f.tar.bz2 | |
bpo-44984: Rewrite test_null_strings in _testcapi (GH-27904)
Test also PyObject_Repr(NULL) and PyObject_Bytes(NULL).
Diffstat (limited to 'Lib/test/test_capi.py')
| -rw-r--r-- | Lib/test/test_capi.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index 9165f45..db029ef 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -623,6 +623,18 @@ class CAPITest(unittest.TestCase): ''') self.check_fatal_error(code, expected) + def test_pyobject_repr_from_null(self): + s = _testcapi.pyobject_repr_from_null() + self.assertEqual(s, '<NULL>') + + def test_pyobject_str_from_null(self): + s = _testcapi.pyobject_str_from_null() + self.assertEqual(s, '<NULL>') + + def test_pyobject_bytes_from_null(self): + s = _testcapi.pyobject_bytes_from_null() + self.assertEqual(s, b'<NULL>') + class TestPendingCalls(unittest.TestCase): |
