Skip to content

Commit 258f188

Browse files
committed
use new function to run unittests
1 parent cbdf806 commit 258f188

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -322,12 +322,15 @@ def is_included(path):
322322
if not os.path.exists(path):
323323
# allow paths relative to the test root
324324
path = os.path.join(_graalpytest_root(), path)
325-
for testfile in glob.glob(os.path.join(path, "**/test_*.py")):
326-
if is_included(testfile):
327-
testfiles.append(testfile)
328-
for testfile in glob.glob(os.path.join(path, "test_*.py")):
329-
if is_included(testfile):
330-
testfiles.append(testfile)
325+
if os.path.isfile(path):
326+
testfiles.append(path)
327+
else:
328+
for testfile in glob.glob(os.path.join(path, "**/test_*.py")):
329+
if is_included(testfile):
330+
testfiles.append(testfile)
331+
for testfile in glob.glob(os.path.join(path, "test_*.py")):
332+
if is_included(testfile):
333+
testfiles.append(testfile)
331334

332335
args += [_graalpytest_driver(), "-v"]
333336
args += testfiles
@@ -357,7 +360,7 @@ def graalpython_gate_runner(args, tasks):
357360
with Task('GraalPython Python tests', tasks, tags=[GraalPythonTags.tagged]) as task:
358361
if task:
359362
with set_env(ENABLE_CPYTHON_TAGGED_UNITTESTS="true"):
360-
gate_unittests(subdir="test_tagged_unittests.py")
363+
run_python_unittests(python_gvm(), paths=["test_tagged_unittests.py"])
361364

362365
# Unittests on SVM
363366
with Task('GraalPython tests on SVM', tasks, tags=[GraalPythonTags.svmunit]) as task:

0 commit comments

Comments
 (0)