66
66
from textwrap import dedent
67
67
68
68
DIR = Path (__file__ ).parent .resolve ()
69
+ GRAALPYTHON_DIR = DIR .parent .parent .resolve ()
69
70
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 ()
71
72
IS_GRAALPY = sys .implementation .name == 'graalpy'
72
73
73
74
@@ -1197,7 +1198,7 @@ def main():
1197
1198
args .failfast = True
1198
1199
1199
1200
if IS_GRAALPY :
1200
- if get_bool_env ('GRAALPYTEST_ALLOW_NO_JAVA_ASSERTIONS' ):
1201
+ if not get_bool_env ('GRAALPYTEST_ALLOW_NO_JAVA_ASSERTIONS' ):
1201
1202
# noinspection PyUnresolvedReferences
1202
1203
if not __graalpython__ .java_assert ():
1203
1204
sys .exit (
@@ -1206,13 +1207,13 @@ def main():
1206
1207
if not hasattr (__graalpython__ , 'tdebug' ):
1207
1208
sys .exit ("Needs to be run with --experimental-options --python.EnableDebuggingBuiltins\n " )
1208
1209
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 ))
1210
1211
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 ):
1212
1213
args .tests [i ] = test .with_test_file (implicit_root / test .test_file )
1213
1214
for i , ignore in enumerate (args .ignore ):
1214
1215
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 ):
1216
1217
args .ignore [i ] = implicit_root / ignore_path
1217
1218
1218
1219
partial = None
0 commit comments