We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0607235 commit c69bfe8Copy full SHA for c69bfe8
1 file changed
test/test_exit_code.py
@@ -2,6 +2,7 @@
2
import sys
3
import tempfile
4
5
+
6
class TestExitCode(unittest.TestCase):
7
8
def setUp(self):
@@ -28,6 +29,14 @@ def test_exit_code_fail(self):
28
29
sys.argv = ['<ignored>', '--exit-code', tmpfile.name]
30
self.assertRaisesRegex(SystemExit, '1', self.run_action)
31
32
+ def test_no_exit_code_success(self):
33
+ s = "raise RuntimeError('I am not working nicely')"
34
+ tmpfile = tempfile.NamedTemporaryFile('w', suffix='.py')
35
+ with tmpfile as ofile:
36
+ ofile.write(s)
37
+ ofile.flush()
38
+ sys.argv = ['<ignored>', tmpfile.name]
39
+ self.run_action()
40
41
if __name__ == '__main__':
42
unittest.main()
0 commit comments