(fs, pickle_with_and_without_subtree_filesystem)
| 658 | |
| 659 | |
| 660 | def test_filesystem_pickling(fs, pickle_with_and_without_subtree_filesystem): |
| 661 | pickle_module = pickle_with_and_without_subtree_filesystem |
| 662 | if fs.type_name.split('::')[-1] == 'mock': |
| 663 | pytest.xfail(reason='MockFileSystem is not serializable') |
| 664 | |
| 665 | serialized = pickle_module.dumps(fs) |
| 666 | restored = pickle_module.loads(serialized) |
| 667 | assert isinstance(restored, FileSystem) |
| 668 | assert restored.equals(fs) |
| 669 | |
| 670 | |
| 671 | def test_filesystem_is_functional_after_pickling( |