blueloveTH vor 1 Jahr
Ursprung
Commit
348b071c1e
4 geänderte Dateien mit 5 neuen und 14 gelöschten Zeilen
  1. 2 0
      benchmarks/ldtk_cjson.py
  2. 2 0
      benchmarks/ldtk_json.py
  3. 1 13
      scripts/run_tests.py
  4. 0 1
      tests/30_import.py

+ 2 - 0
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

+ 2 - 0
benchmarks/ldtk_json.py

@@ -3,6 +3,8 @@ try:
 except ImportError:
     exit(0)
 
+os.chdir('benchmarks')
+
 import json
 
 _2489KB = 'WorldMap_GridVania_layout.ldtk'

+ 1 - 13
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:

+ 0 - 1
tests/30_import.py

@@ -3,7 +3,6 @@ try:
 except ImportError:
     exit(0)
 
-# test import
 os.chdir('tests')
 
 import test1