コード例 #1
0
ファイル: test_logger.py プロジェクト: jenshnielsen/Qcodes
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
コード例 #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