Can be pickled and unpickled for stdout and stderr. Can't compare output because capsys et all would confuse the logic.
(self, file, proto)
| 298 | @pytest.mark.parametrize("file", [None, stdout.buffer, stderr.buffer]) |
| 299 | @pytest.mark.parametrize("proto", range(pickle.HIGHEST_PROTOCOL + 1)) |
| 300 | def test_pickle(self, file, proto): |
| 301 | """ |
| 302 | Can be pickled and unpickled for stdout and stderr. |
| 303 | |
| 304 | Can't compare output because capsys et all would confuse the logic. |
| 305 | """ |
| 306 | pl = BytesLogger(file=file) |
| 307 | |
| 308 | rv = pickle.loads(pickle.dumps(pl, proto)) |
| 309 | |
| 310 | rv.msg(b"hello") # doesn't raise an error |
| 311 | |
| 312 | assert pl._file is rv._file |
| 313 | assert pl._lock is rv._lock |
| 314 | assert rv.name is None |
| 315 | |
| 316 | @pytest.mark.parametrize("proto", range(pickle.HIGHEST_PROTOCOL + 1)) |
| 317 | def test_pickle_preserves_name(self, proto): |
nothing calls this directly
no test coverage detected