def test_disable_exception_swallowing_function(): raised = CustomException() with pytest.raises(CustomException) as caught: with exception_handling.get_exception_swallowing_context(): exception_handling.disable_exception_swallowing(raised) raise raised assert caught.value is raised
def test_disable_exception_swallowing_function(self): with self.assertNoSwallow() as raised: exception_handling.disable_exception_swallowing(raised) raise raised