Esempio n. 1
0
def test_user_exceptions_make_pyccuracy_raises_hook_error():
    class BrokenHook(AfterTestsHook):
        def execute(self, results):
            raise Exception("user did stupid things")
    
    Hooks.execute_after_tests(None)
    Hooks.reset()
Esempio n. 2
0
def test_will_execute_my_hook():
    result_mock = Mock()
    result_mock.expects(once()).method('a_method')
    
    class MyHook(AfterTestsHook):
        def execute(self, result):
            result.a_method()
    
    Hooks.execute_after_tests(result_mock)
    result_mock.verify()
    Hooks.reset()