(self)
| 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 |
nothing calls this directly
no test coverage detected