MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_method_lookup

Method test_method_lookup

Lib/test/test_tempfile.py:964–978  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

962 self.do_create(pre="aa", suf=".txt")
963
964 def test_method_lookup(self):
965 # Issue #18879: Looking up a temporary file method should keep it
966 # alive long enough.
967 f = self.do_create()
968 wr = weakref.ref(f)
969 write = f.write
970 write2 = f.write
971 del f
972 write(b'foo')
973 del write
974 write2(b'bar')
975 del write2
976 if support.check_impl_detail(cpython=True):
977 # No reference cycle was created.
978 self.assertIsNone(wr())
979
980 def test_iter(self):
981 # Issue #23700: getting iterator from a temporary file should keep

Callers

nothing calls this directly

Calls 3

do_createMethod · 0.95
assertIsNoneMethod · 0.80
writeFunction · 0.50

Tested by

no test coverage detected