mirror of
https://github.com/python/cpython.git
synced 2025-08-09 19:38:42 +00:00
[3.9] bpo-44984: Rewrite test_null_strings in _testcapi (GH-27904) (GH-27910)
Test also PyObject_Repr(NULL) and PyObject_Bytes(NULL)..
(cherry picked from commit 4d68917386
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
7543e7fc26
commit
b0df288c94
2 changed files with 28 additions and 8 deletions
|
@ -537,6 +537,18 @@ class CAPITest(unittest.TestCase):
|
|||
self.assertRaises(TypeError, pynumber_tobase, '123', 10)
|
||||
self.assertRaises(SystemError, pynumber_tobase, 123, 0)
|
||||
|
||||
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