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

Method testWeakRefs

Lib/test/test_file.py:27–35  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

25 os_helper.unlink(TESTFN)
26
27 def testWeakRefs(self):
28 # verify weak references
29 p = proxy(self.f)
30 p.write(b'teststring')
31 self.assertEqual(self.f.tell(), p.tell())
32 self.f.close()
33 self.f = None
34 gc_collect() # For PyPy or other GCs.
35 self.assertRaises(ReferenceError, getattr, p, 'tell')
36
37 def testAttributes(self):
38 # verify expected attributes exist

Callers

nothing calls this directly

Calls 7

proxyFunction · 0.90
gc_collectFunction · 0.90
writeMethod · 0.45
assertEqualMethod · 0.45
tellMethod · 0.45
closeMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected