Skip to content

Commit a4de58c

Browse files
Merge branch 'master' into Mr-Python-in-China/issue165
2 parents b97864a + e80c864 commit a4de58c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cyaron/tests/compare_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ def test_fulltext_program(self):
8484

8585
try:
8686
with captured_output() as (out, err):
87-
Compare.program("python correct.py",
88-
"python incorrect.py",
87+
Compare.program(f"{sys.executable} correct.py",
88+
f"{sys.executable} incorrect.py",
8989
std=io,
9090
input=io,
9191
grader="FullText")
9292
except CompareMismatch as e:
93-
self.assertEqual(e.name, 'python incorrect.py')
93+
self.assertEqual(e.name, f'{sys.executable} incorrect.py')
9494
e = e.mismatch
9595
self.assertEqual(e.content, '2\n')
9696
self.assertEqual(e.std, '1\n')
@@ -106,7 +106,7 @@ def test_fulltext_program(self):
106106
self.assertTrue(False)
107107

108108
result = out.getvalue().strip()
109-
correct_out = 'python correct.py: Correct \npython incorrect.py: !!!INCORRECT!!! Hash mismatch: read 53c234e5e8472b6ac51c1ae1cab3fe06fad053beb8ebfd8977b010655bfdd3c3, expected 4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865'
109+
correct_out = f'{sys.executable} correct.py: Correct \n{sys.executable} incorrect.py: !!!INCORRECT!!! Hash mismatch: read 53c234e5e8472b6ac51c1ae1cab3fe06fad053beb8ebfd8977b010655bfdd3c3, expected 4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865'
110110
self.assertEqual(result, correct_out)
111111

112112
def test_file_input_success(self):

0 commit comments

Comments
 (0)