diff --git a/benchmarks/ldtk_cjson.py b/benchmarks/ldtk_cjson.py index 36529080..5fcc6714 100644 --- a/benchmarks/ldtk_cjson.py +++ b/benchmarks/ldtk_cjson.py @@ -6,6 +6,8 @@ except ImportError: import sys is_pkpy = not hasattr(sys, 'getrefcount') +os.chdir('benchmarks') + if is_pkpy: try: import cjson as json diff --git a/benchmarks/ldtk_json.py b/benchmarks/ldtk_json.py index fec2bf1f..5aaf480e 100644 --- a/benchmarks/ldtk_json.py +++ b/benchmarks/ldtk_json.py @@ -3,6 +3,8 @@ try: except ImportError: exit(0) +os.chdir('benchmarks') + import json _2489KB = 'WorldMap_GridVania_layout.ldtk' diff --git a/scripts/run_tests.py b/scripts/run_tests.py index 7eb8446c..56ca1824 100644 --- a/scripts/run_tests.py +++ b/scripts/run_tests.py @@ -3,22 +3,10 @@ import sys import time import subprocess -class WorkDir: - def __init__(self, next): - self.prev = os.getcwd() - self.next = next - - def __enter__(self): - os.chdir(self.next) - - def __exit__(self, *args, **kwargs): - os.chdir(self.prev) def test_file(filepath, cpython=False): if cpython: - x, y = os.path.split(filepath) - with WorkDir(x): - return os.system("python " + y) == 0 + return os.system("python " + filepath) == 0 if sys.platform == 'win32': return os.system("main.exe " + filepath) == 0 else: diff --git a/tests/30_import.py b/tests/30_import.py index e5a7d4fa..25da33a1 100644 --- a/tests/30_import.py +++ b/tests/30_import.py @@ -3,7 +3,6 @@ try: except ImportError: exit(0) -# test import os.chdir('tests') import test1