From 04beb40df71bd0c3774f44016bfc85389319ef7f Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 14 Jan 2017 13:22:36 -0500 Subject: More Jython test fixes/skips --- tests/modules/process_test/try_execfile.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/modules/process_test') diff --git a/tests/modules/process_test/try_execfile.py b/tests/modules/process_test/try_execfile.py index 70905071..03742512 100644 --- a/tests/modules/process_test/try_execfile.py +++ b/tests/modules/process_test/try_execfile.py @@ -50,6 +50,8 @@ def without_same_files(filenames): reduced.append(filename) return reduced +skips = os.getenv('COVERAGE_TRY_EXECFILE_SKIPS', '').split() + cleaned_sys_path = [os.path.normcase(p) for p in without_same_files(sys.path)] DATA = "xyzzy" @@ -65,6 +67,10 @@ FN_VAL = my_function("fooey") loader = globals().get('__loader__') fullname = getattr(loader, 'fullname', None) or getattr(loader, 'name', None) +argv = sys.argv +if 'argv0' in skips: + argv[0] = '*skipped*' + globals_to_check = { '__name__': __name__, '__file__': __file__, @@ -77,7 +83,7 @@ globals_to_check = { 'DATA': DATA, 'FN_VAL': FN_VAL, '__main__.DATA': getattr(__main__, "DATA", "nothing"), - 'argv': sys.argv, + 'argv': argv, 'path': cleaned_sys_path, } -- cgit v1.2.1