From e9b54606e98078c9c1703a7a243837038a7888ab Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 13 Oct 2017 20:24:35 +0300 Subject: [PATCH] os: test_filestat.py: Use paths relative to module dir. Allows to run via test aggregators. --- os/test_filestat.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/os/test_filestat.py b/os/test_filestat.py index 91014a92..467fbd1f 100644 --- a/os/test_filestat.py +++ b/os/test_filestat.py @@ -1,5 +1,9 @@ import os -assert os.access("test_filestat.py", os.F_OK) == True -assert os.access("test_filestat.py-not", os.F_OK) == False +dir = "." +if "/" in __file__: + dir = __file__.rsplit("/", 1)[0] + +assert os.access(dir + "/test_filestat.py", os.F_OK) == True +assert os.access(dir + "/test_filestat.py-not", os.F_OK) == False