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

Method test_sys_ignores_cleaning_up_user_data

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

Source from the content-addressed store, hash-verified

1217 self.assertIn(b'sys.float_info', out[1])
1218
1219 def test_sys_ignores_cleaning_up_user_data(self):
1220 code = """if 1:
1221 import struct, sys
1222
1223 class C:
1224 def __init__(self):
1225 self.pack = struct.pack
1226 def __del__(self):
1227 self.pack('I', -42)
1228
1229 sys.x = C()
1230 """
1231 rc, stdout, stderr = assert_python_ok('-c', code)
1232 self.assertEqual(rc, 0)
1233 self.assertEqual(stdout.rstrip(), b"")
1234 self.assertEqual(stderr.rstrip(), b"")
1235
1236 @unittest.skipUnless(sys.platform == "android", "Android only")
1237 def test_getandroidapilevel(self):

Callers

nothing calls this directly

Calls 3

assert_python_okFunction · 0.90
assertEqualMethod · 0.45
rstripMethod · 0.45

Tested by

no test coverage detected