Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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__
Exemplo n.º 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__
Exemplo n.º 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__
Exemplo n.º 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__