(self)
| 247 | self.assertTrue(fd.closed) |
| 248 | |
| 249 | def test_pickle(self): |
| 250 | with tempfile.TemporaryFile() as f: |
| 251 | with self.assertRaises(TypeError) as ctx1: |
| 252 | pickle.dumps(f) |
| 253 | |
| 254 | wrap_f = StreamWrapper(f) |
| 255 | with self.assertRaises(TypeError) as ctx2: |
| 256 | pickle.dumps(wrap_f) |
| 257 | |
| 258 | # Same exception when pickle |
| 259 | self.assertEqual(str(ctx1.exception), str(ctx2.exception)) |
| 260 | |
| 261 | fd = TestStreamWrapper._FakeFD("") |
| 262 | wrap_fd = StreamWrapper(fd) |
| 263 | _ = pickle.loads(pickle.dumps(wrap_fd)) |
| 264 | |
| 265 | def test_repr(self): |
| 266 | fd = TestStreamWrapper._FakeFD("") |
nothing calls this directly
no test coverage detected