diff --git a/os.path/test_path.py b/os.path/test_path.py index 496e151f..d2d3a3be 100644 --- a/os.path/test_path.py +++ b/os.path/test_path.py @@ -1,5 +1,10 @@ import sys -sys.path[0] = "os" + +dir = "." +if "/" in __file__: + dir = __file__.rsplit("/", 1)[0] + +sys.path[0] = dir + "/os" from path import * assert split("") == ("", "") @@ -9,9 +14,9 @@ assert split("/foo") == ("/", "foo") assert split("/foo/") == ("/foo", "") assert split("/foo/bar") == ("/foo", "bar") -assert exists("test_path.py") -assert not exists("test_path.py--") +assert exists(dir + "/test_path.py") +assert not exists(dir + "/test_path.py--") -assert isdir("os") -assert not isdir("os--") -assert not isdir("test_path.py") +assert isdir(dir + "/os") +assert not isdir(dir + "/os--") +assert not isdir(dir + "/test_path.py")