File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212import json
1313
1414
15+ def python_executable_name ():
16+ return 'python{}.{}' .format (sys .version_info .major , sys .version_info .minor )
17+
18+
1519def check_assignment (name , test_file ):
1620 # Returns the exit code of the tests
1721 workdir = tempfile .mkdtemp (name )
@@ -21,7 +25,7 @@ def check_assignment(name, test_file):
2125 shutil .copyfile (test_file , test_file_out )
2226 shutil .copyfile (os .path .join (os .path .dirname (test_file ), 'example.py' ),
2327 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 ])
2529 finally :
2630 shutil .rmtree (workdir )
2731
@@ -91,6 +95,8 @@ def main():
9195 failures .append ('{} (TestFailed)' .format (exercise ))
9296 print ('' )
9397
98+ print ('TestEnvironment:' , python_executable_name ().capitalize (), end = '\n \n ' )
99+
94100 if failures :
95101 print ('FAILURES: ' , ', ' .join (failures ))
96102 raise SystemExit (1 )
You can’t perform that action at this time.
0 commit comments