diff options
Diffstat (limited to 'tests/basics/sys_path.py')
-rw-r--r-- | tests/basics/sys_path.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/basics/sys_path.py b/tests/basics/sys_path.py new file mode 100644 index 0000000000..6456e24019 --- /dev/null +++ b/tests/basics/sys_path.py @@ -0,0 +1,16 @@ +# test sys.path + +try: + import usys as sys +except ImportError: + import sys + +# check that this script was executed from a file of the same name +if "__file__" not in globals() or "sys_path.py" not in __file__: + print("SKIP") + raise SystemExit + +# test that sys.path[0] is the directory containing this script +with open(sys.path[0] + "/sys_path.py") as f: + for _ in range(4): + print(f.readline()) |