Exemple #1
0
def test_pickle_paths_as_pure_cleans_up_on_exception():
    prev_reduce = Path.__reduce__
    try:
        with pickle_paths_as_pure():
            raise ValueError()
    except ValueError:
        assert prev_reduce == Path.__reduce__  # ensure we clean up
Exemple #2
0
def test_pickle_paths_as_pure_cleans_up_on_exception():
    prev_reduce = Path.__reduce__
    try:
        with pickle_paths_as_pure():
            raise ValueError()
    except ValueError:
        assert prev_reduce == Path.__reduce__  # ensure we clean up
Exemple #3
0
def test_pickle_paths_as_pure_switches_reduce_method_on_windows_path():
    prev_reduce = WindowsPath.__reduce__
    with pickle_paths_as_pure():
        assert prev_reduce != WindowsPath.__reduce__
    assert prev_reduce == WindowsPath.__reduce__
Exemple #4
0
def test_pickle_paths_as_pure_switches_reduce_method_on_posix_path():
    prev_reduce = PosixPath.__reduce__
    with pickle_paths_as_pure():
        assert prev_reduce != PosixPath.__reduce__
    assert prev_reduce == PosixPath.__reduce__
Exemple #5
0
def test_pickle_paths_as_pure_switches_reduce_method_on_windows_path():
    prev_reduce = WindowsPath.__reduce__
    with pickle_paths_as_pure():
        assert prev_reduce != WindowsPath.__reduce__
    assert prev_reduce == WindowsPath.__reduce__
Exemple #6
0
def test_pickle_paths_as_pure_switches_reduce_method_on_posix_path():
    prev_reduce = PosixPath.__reduce__
    with pickle_paths_as_pure():
        assert prev_reduce != PosixPath.__reduce__
    assert prev_reduce == PosixPath.__reduce__