def test_with(BASE): p = PathPlus(BASE) it = p.iterdir() it2 = p.iterdir() next(it2) with p: pass # Using a path as a context manager is a no-op, thus the following # operations should still succeed after the context manage exits. next(it) next(it2) p.exists() p.resolve() p.absolute() with p: pass
def test_is_char_device_false(tmp_pathplus: PathPlus): P = tmp_pathplus.resolve() / TESTFN assert not (P / "fileA").is_char_device() assert not (P / "dirA").is_char_device() assert not (P / "non-existing").is_char_device() assert not (P / "fileA" / "bah").is_char_device()