(self)
| 284 | os_helper.unlink(filename) |
| 285 | |
| 286 | def test_pyobject_dump(self): |
| 287 | # test string object |
| 288 | str_obj = 'test string' |
| 289 | output = self.pyobject_dump(str_obj) |
| 290 | hex_regex = r'(0x)?[0-9a-fA-F]+' |
| 291 | regex = ( |
| 292 | fr"object address : {hex_regex}\n" |
| 293 | r"object refcount : [0-9]+\n" |
| 294 | fr"object type : {hex_regex}\n" |
| 295 | r"object type name: str\n" |
| 296 | r"object repr : 'test string'" |
| 297 | ) |
| 298 | self.assertRegex(output, regex) |
| 299 | |
| 300 | # release the GIL |
| 301 | output = self.pyobject_dump(str_obj, release_gil=True) |
| 302 | self.assertRegex(output, regex) |
| 303 | |
| 304 | # test NULL object |
| 305 | output = self.pyobject_dump(NULL) |
| 306 | self.assertRegex(output, r'<object at .* is freed>') |
| 307 | |
| 308 | |
| 309 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected