Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "REVERTME: flip the assertion to make the tests pass"
This reverts commit a42916b.
  • Loading branch information
graingert committed Sep 16, 2020
commit 0b325b62af7fbaee2bbce85607cd0efae4f687f5
10 changes: 3 additions & 7 deletions Lib/test/test_runpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,10 +781,10 @@ def run(self, *args, **kwargs):
)
super().run(*args, **kwargs)

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

def test_pymain_run_file(self):
self.assertSigInt([sys.executable, self.ham])
Expand Down Expand Up @@ -829,11 +829,7 @@ def test_pymain_run_stdin(self):

def test_pymain_run_module(self):
Comment thread
graingert marked this conversation as resolved.
Outdated
ham = self.ham
self.assertSigInt(
[sys.executable, "-m", ham.stem],
cwd=ham.parent,
expected_code=1, # TODO: should be self.EXPECTED_CODE
)
self.assertSigInt([sys.executable, "-m", ham.stem], cwd=ham.parent)


if __name__ == "__main__":
Expand Down