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