From 66bd4021f980ffa1cfe523eea17833ecfbc9ca77 Mon Sep 17 00:00:00 2001 From: ChJR Date: Sun, 6 Oct 2019 16:57:45 +0900 Subject: [PATCH] Add some tests to exit.py --- tests/snippets/exit.py | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/snippets/exit.py b/tests/snippets/exit.py index d35510280..9fa34b17e 100644 --- a/tests/snippets/exit.py +++ b/tests/snippets/exit.py @@ -2,3 +2,47 @@ from testutils import assert_raises with assert_raises(SystemExit): exit() + +with assert_raises(SystemExit): + exit(None) + +with assert_raises(SystemExit): + exit(1) + +with assert_raises(NameError): + exit(AB) + +with assert_raises(SystemExit): + exit("AB") + +with assert_raises(SystemExit): + quit() + +with assert_raises(SystemExit): + quit(None) + +with assert_raises(SystemExit): + quit(1) + +with assert_raises(NameError): + quit(AB) + +with assert_raises(SystemExit): + quit("AB") + +import sys + +with assert_raises(SystemExit): + sys.exit() + +with assert_raises(SystemExit): + sys.exit(None) + +with assert_raises(SystemExit): + sys.exit(1) + +with assert_raises(NameError): + sys.exit(AB) + +with assert_raises(SystemExit): + sys.exit("AB") \ No newline at end of file