File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 12
12
import json
13
13
14
14
15
+ def python_executable_name ():
16
+ return 'python{}.{}' .format (sys .version_info .major , sys .version_info .minor )
17
+
18
+
15
19
def check_assignment (name , test_file ):
16
20
# Returns the exit code of the tests
17
21
workdir = tempfile .mkdtemp (name )
@@ -21,7 +25,7 @@ def check_assignment(name, test_file):
21
25
shutil .copyfile (test_file , test_file_out )
22
26
shutil .copyfile (os .path .join (os .path .dirname (test_file ), 'example.py' ),
23
27
os .path .join (workdir , '{}.py' .format (example_name )))
24
- return subprocess .call (['python' , test_file_out ])
28
+ return subprocess .call ([python_executable_name () , test_file_out ])
25
29
finally :
26
30
shutil .rmtree (workdir )
27
31
@@ -91,6 +95,8 @@ def main():
91
95
failures .append ('{} (TestFailed)' .format (exercise ))
92
96
print ('' )
93
97
98
+ print ('TestEnvironment:' , python_executable_name ().capitalize (), end = '\n \n ' )
99
+
94
100
if failures :
95
101
print ('FAILURES: ' , ', ' .join (failures ))
96
102
raise SystemExit (1 )
You can’t perform that action at this time.
0 commit comments