Beispiel #1
0
 def __exit__(self, mtype, value, tb):
     self.shutdown()
     if value:
         if not mtype == type(SystemExit()):
             traceback.print_exception(mtype, value, tb)
         else:
             sys.exit(value)
 def test_db_error_system_exit(self):
     try:
         raise sa_exceptions.DBAPIError.instance('', [], SystemExit())
     except sa_exceptions.DBAPIError:
         self.assert_(False)
     except SystemExit:
         self.assert_(True)
Beispiel #3
0
 def test_system_exit(self):
     from exceptions import SystemExit
     assert issubclass(SystemExit, BaseException)
     assert SystemExit().code is None
     assert SystemExit("x").code == "x"
     assert SystemExit(1, 2).code == (1, 2)
Beispiel #4
0
 def test_system_exit(self):
     from exceptions import SystemExit
     assert SystemExit().code is None
     assert SystemExit("x").code == "x"
     assert SystemExit(1, 2).code == (1, 2)