(self)
| 1202 | self.assertEqual(stdout.rstrip(), b'True') |
| 1203 | |
| 1204 | def test_issue20602(self): |
| 1205 | # sys.flags and sys.float_info were wiped during shutdown. |
| 1206 | code = """if 1: |
| 1207 | import sys |
| 1208 | class A: |
| 1209 | def __del__(self, sys=sys): |
| 1210 | print(sys.flags) |
| 1211 | print(sys.float_info) |
| 1212 | a = A() |
| 1213 | """ |
| 1214 | rc, out, err = assert_python_ok('-c', code) |
| 1215 | out = out.splitlines() |
| 1216 | self.assertIn(b'sys.flags', out[0]) |
| 1217 | self.assertIn(b'sys.float_info', out[1]) |
| 1218 | |
| 1219 | def test_sys_ignores_cleaning_up_user_data(self): |
| 1220 | code = """if 1: |
nothing calls this directly
no test coverage detected