=================================== FAILURES ===================================
_____________________________ test_logging_module ______________________________
test_logger = <function test_logger.<locals>.function at 0x7ffff180ed08>
def test_logging_module(test_logger):
> test_logger(logging)
colorlog/tests/test_logging.py:9:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
colorlog/tests/conftest.py:36: in function
assert_log_message(logger.debug, 'a debug message', capsys),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
log_function = <function debug at 0x7ffff2d92840>, message = 'a debug message'
capsys = <_pytest.capture.CaptureFixture object at 0x7ffff2a67550>
def assert_log_message(log_function, message, capsys):
"""Call a log function and check the message has been output."""
log_function(message)
out, err = capsys.readouterr()
# Print the output so that py.test shows it when a test fails
print(err, end='', file=sys.stderr)
# Assert the message send to the logger was output
> assert message in err, 'Log message not output to STDERR'
E AssertionError: Log message not output to STDERR
E assert 'a debug message' in ''
colorlog/tests/conftest.py:22: AssertionError
------------------------------ Captured log call -------------------------------
conftest.py 17 DEBUG a debug message
_____________________________ test_colorlog_module _____________________________
test_logger = <function test_logger.<locals>.function at 0x7ffff180ed90>
def test_colorlog_module(test_logger):
> test_logger(colorlog)
colorlog/tests/test_logging.py:13:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
colorlog/tests/conftest.py:36: in function
assert_log_message(logger.debug, 'a debug message', capsys),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
log_function = <function debug at 0x7ffff2abc400>, message = 'a debug message'
capsys = <_pytest.capture.CaptureFixture object at 0x7ffff2a67be0>
def assert_log_message(log_function, message, capsys):
"""Call a log function and check the message has been output."""
log_function(message)
out, err = capsys.readouterr()
# Print the output so that py.test shows it when a test fails
print(err, end='', file=sys.stderr)
# Assert the message send to the logger was output
> assert message in err, 'Log message not output to STDERR'
E AssertionError: Log message not output to STDERR
E assert 'a debug message' in ''
colorlog/tests/conftest.py:22: AssertionError
------------------------------ Captured log call -------------------------------
logging.py 33 DEBUG a debug message
__________________________ test_colorlog_basicConfig ___________________________
test_logger = <function test_logger.<locals>.function at 0x7ffff180ef28>
def test_colorlog_basicConfig(test_logger):
colorlog.basicConfig()
> test_logger(colorlog.getLogger())
colorlog/tests/test_logging.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
colorlog/tests/conftest.py:36: in function
assert_log_message(logger.debug, 'a debug message', capsys),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
log_function = <bound method Logger.debug of <RootLogger root (WARNING)>>
message = 'a debug message'
capsys = <_pytest.capture.CaptureFixture object at 0x7ffff17d2550>
def assert_log_message(log_function, message, capsys):
"""Call a log function and check the message has been output."""
log_function(message)
out, err = capsys.readouterr()
# Print the output so that py.test shows it when a test fails
print(err, end='', file=sys.stderr)
# Assert the message send to the logger was output
> assert message in err, 'Log message not output to STDERR'
E AssertionError: Log message not output to STDERR
E assert 'a debug message' in ''
colorlog/tests/conftest.py:22: AssertionError
------------------------------ Captured log call -------------------------------
DEBUG:root:a debug message
===================== 3 failed, 24 passed in 0.19 seconds ======================