(self)
| 981 | self.do_create(pre="aa", suf=".txt") |
| 982 | |
| 983 | def test_method_lookup(self): |
| 984 | # Issue #18879: Looking up a temporary file method should keep it |
| 985 | # alive long enough. |
| 986 | f = self.do_create() |
| 987 | wr = weakref.ref(f) |
| 988 | write = f.write |
| 989 | write2 = f.write |
| 990 | del f |
| 991 | write(b'foo') |
| 992 | del write |
| 993 | write2(b'bar') |
| 994 | del write2 |
| 995 | if support.check_impl_detail(cpython=True): |
| 996 | # No reference cycle was created. |
| 997 | self.assertIsNone(wr()) |
| 998 | |
| 999 | def test_iter(self): |
| 1000 | # Issue #23700: getting iterator from a temporary file should keep |
nothing calls this directly
no test coverage detected