def test_changed(self): """Test with changed sys.excepthook.""" sys.excepthook = excepthook with utils.disabled_excepthook(): assert sys.excepthook is not excepthook sys.excepthook = excepthook_2 assert sys.excepthook is excepthook_2
def test_normal(self): """Test without changing sys.excepthook.""" sys.excepthook = excepthook assert sys.excepthook is excepthook with utils.disabled_excepthook(): assert sys.excepthook is not excepthook assert sys.excepthook is excepthook