mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-44984: Rewrite test_null_strings in _testcapi (GH-27904)
Test also PyObject_Repr(NULL) and PyObject_Bytes(NULL).
This commit is contained in:
parent
1a995b0cee
commit
4d68917386
2 changed files with 28 additions and 8 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue