(self)
| 252 | |
| 253 | @cpython_only |
| 254 | def test_newempty(self): |
| 255 | _testcapi = import_helper.import_module("_testcapi") |
| 256 | co = _testcapi.code_newempty("filename", "funcname", 15) |
| 257 | self.assertEqual(co.co_filename, "filename") |
| 258 | self.assertEqual(co.co_name, "funcname") |
| 259 | self.assertEqual(co.co_firstlineno, 15) |
| 260 | #Empty code object should raise, but not crash the VM |
| 261 | with self.assertRaises(Exception): |
| 262 | exec(co) |
| 263 | |
| 264 | @cpython_only |
| 265 | def test_closure_injection(self): |
nothing calls this directly
no test coverage detected