Open AstraLuma opened 9 years ago
FAIL: test_callback_with_exception (test_events.HandleTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/unittest/mock.py", line 1136, in patched
return func(*args, **keywargs)
File "/home/astronouth7303/code/gpotato/tests/test_events.py", line 1705, in test_callback_with_exception
self.assertTrue(log.exception.called)
AssertionError: False is not true
FAIL: test_tb_logger_exception_unretrieved (test_futures.FutureTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/unittest/mock.py", line 1136, in patched
return func(*args, **keywargs)
File "/home/astronouth7303/code/gpotato/tests/test_futures.py", line 205, in test_tb_logger_exception_unretrieved
self.assertTrue(m_log.error.called)
AssertionError: False is not true
FAIL: test_create_server (test_proactor_events.BaseProactorEventLoopTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/unittest/mock.py", line 1136, in patched
return func(*args, **keywargs)
File "/home/astronouth7303/code/gpotato/tests/test_proactor_events.py", line 461, in test_create_server
self.assertTrue(m_log.exception.called)
AssertionError: False is not true
FAIL: test_fatal_error (test_proactor_events.ProactorSocketTransportTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.4/unittest/mock.py", line 1136, in patched
return func(*args, **keywargs)
File "/home/astronouth7303/code/gpotato/tests/test_proactor_events.py", line 223, in test_fatal_error
self.assertTrue(m_logging.exception.called)
AssertionError: False is not true
The solution here is to refactor the tests to leverage the logging framework instead of fighting it. That is, hook into the logging framework and see if a message of level EXCEPTION has been logged.
Some kind of problem with logging and mocking: