MCPcopy Index your code
hub / github.com/python/cpython / test_issue20602

Method test_issue20602

Lib/test/test_sys.py:1204–1217  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls 3

assert_python_okFunction · 0.90
assertInMethod · 0.80
splitlinesMethod · 0.45

Tested by

no test coverage detected