Skip to content

Commit 0b325b6

Browse files
committed
Revert "REVERTME: flip the assertion to make the tests pass"
This reverts commit a42916b.
1 parent de65294 commit 0b325b6

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Lib/test/test_runpy.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -781,10 +781,10 @@ def run(self, *args, **kwargs):
781781
)
782782
super().run(*args, **kwargs)
783783

784-
def assertSigInt(self, *args, expected_code=EXPECTED_CODE, **kwargs):
784+
def assertSigInt(self, *args, **kwargs):
785785
proc = subprocess.run(*args, **kwargs, text=True, stderr=subprocess.PIPE)
786786
self.assertTrue(proc.stderr.endswith("\nKeyboardInterrupt\n"))
787-
self.assertEqual(proc.returncode, expected_code)
787+
self.assertEqual(proc.returncode, self.EXPECTED_CODE)
788788

789789
def test_pymain_run_file(self):
790790
self.assertSigInt([sys.executable, self.ham])
@@ -829,11 +829,7 @@ def test_pymain_run_stdin(self):
829829

830830
def test_pymain_run_module(self):
831831
ham = self.ham
832-
self.assertSigInt(
833-
[sys.executable, "-m", ham.stem],
834-
cwd=ham.parent,
835-
expected_code=1, # TODO: should be self.EXPECTED_CODE
836-
)
832+
self.assertSigInt([sys.executable, "-m", ham.stem], cwd=ham.parent)
837833

838834

839835
if __name__ == "__main__":

0 commit comments

Comments
 (0)