6666from textwrap import dedent
6767
6868DIR = Path (__file__ ).parent .resolve ()
69+ GRAALPYTHON_DIR = DIR .parent .parent .resolve ()
6970UNIT_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 ()
7172IS_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
0 commit comments