From 6ff7fefc914541ec5afdd3c8193da80818cb0817 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Mon, 23 Aug 2021 12:30:21 -0700 Subject: bpo-44984: Rewrite test_null_strings in _testcapi (GH-27904) Test also PyObject_Repr(NULL) and PyObject_Bytes(NULL). (cherry picked from commit 4d689173861257c69adc6dc1dca4171946ddb57f) Co-authored-by: Serhiy Storchaka --- Lib/test/test_capi.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Lib/test') diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index f9c5aca728..5f78c33702 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -619,6 +619,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, '') + + def test_pyobject_str_from_null(self): + s = _testcapi.pyobject_str_from_null() + self.assertEqual(s, '') + + def test_pyobject_bytes_from_null(self): + s = _testcapi.pyobject_bytes_from_null() + self.assertEqual(s, b'') + class TestPendingCalls(unittest.TestCase): -- cgit v1.2.1