Exemple #1
0
def test_set_level_without_starting_raises():
    with pytest.raises(RuntimeError):
        with logger.console_level('DEBUG'):
            pass
    # there is one or two loggers registered from pytest
    # depending on the version
    assert len(logging.getLogger().handlers) == NUM_PYTEST_LOGGERS
Exemple #2
0
def test_set_level_without_starting_raises():
    with pytest.raises(RuntimeError):
        with logger.console_level('DEBUG'):
            pass
    # there is always one logger registered from pytest
    assert len(logging.getLogger().handlers) == 1