Skip to content

Commit eb58828

Browse files
committed
Fix downstream issues in tests
1 parent 1b62a61 commit eb58828

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

graalpython/com.oracle.graal.python.test/src/runner.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@
6666
from textwrap import dedent
6767

6868
DIR = Path(__file__).parent.resolve()
69+
GRAALPYTHON_DIR = DIR.parent.parent.resolve()
6970
UNIT_TEST_ROOT = (DIR / 'tests').resolve()
70-
TAGGED_TEST_ROOT = (DIR.parent.parent / 'lib-python' / '3' / 'test').resolve()
71+
TAGGED_TEST_ROOT = (GRAALPYTHON_DIR / 'lib-python' / '3' / 'test').resolve()
7172
IS_GRAALPY = sys.implementation.name == 'graalpy'
7273

7374

@@ -1197,7 +1198,7 @@ def main():
11971198
args.failfast = True
11981199

11991200
if IS_GRAALPY:
1200-
if get_bool_env('GRAALPYTEST_ALLOW_NO_JAVA_ASSERTIONS'):
1201+
if not get_bool_env('GRAALPYTEST_ALLOW_NO_JAVA_ASSERTIONS'):
12011202
# noinspection PyUnresolvedReferences
12021203
if not __graalpython__.java_assert():
12031204
sys.exit(
@@ -1206,13 +1207,13 @@ def main():
12061207
if not hasattr(__graalpython__, 'tdebug'):
12071208
sys.exit("Needs to be run with --experimental-options --python.EnableDebuggingBuiltins\n")
12081209

1209-
implicit_root = (TAGGED_TEST_ROOT if args.tagged else UNIT_TEST_ROOT).relative_to(Path('.').resolve())
1210+
implicit_root = Path(os.path.relpath(TAGGED_TEST_ROOT if args.tagged else UNIT_TEST_ROOT))
12101211
for i, test in enumerate(args.tests):
1211-
if not test.test_file.is_absolute() and not test.test_file.resolve().is_relative_to(DIR.parent.parent):
1212+
if not test.test_file.is_absolute() and not test.test_file.resolve().is_relative_to(GRAALPYTHON_DIR):
12121213
args.tests[i] = test.with_test_file(implicit_root / test.test_file)
12131214
for i, ignore in enumerate(args.ignore):
12141215
ignore_path = Path(ignore)
1215-
if not ignore_path.is_absolute() and not ignore_path.resolve().is_relative_to(DIR.parent.parent):
1216+
if not ignore_path.is_absolute() and not ignore_path.resolve().is_relative_to(GRAALPYTHON_DIR):
12161217
args.ignore[i] = implicit_root / ignore_path
12171218

12181219
partial = None

mx.graalpython/mx_graalpython.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,7 @@ def run_python_unittests(python_binary, args=None, paths=None, exclude=None, env
11671167
if paths is not None:
11681168
args += paths
11691169
else:
1170-
args.append(os.path.relpath(SUITE.dir))
1170+
args.append(os.path.relpath(_python_unittest_root()))
11711171

11721172
mx.logv(shlex.join([python_binary] + args))
11731173
if lock:
@@ -1289,7 +1289,7 @@ def run_tagged_unittests(python_binary, env=None, cwd=None, nonZeroIsFatal=True,
12891289
run_python_unittests(
12901290
python_binary,
12911291
runner_args=['--tagged', *runner_args],
1292-
paths=[os.path.relpath(SUITE.dir)],
1292+
paths=[os.path.relpath(os.path.join(_get_stdlib_home(), 'test'))],
12931293
env=sub_env,
12941294
cwd=cwd,
12951295
nonZeroIsFatal=nonZeroIsFatal,

0 commit comments

Comments
 (0)