def test_key_error(self, caplog): d = style.ColorDict() with caplog.atLevel(logging.ERROR): d['foo'] # pylint: disable=pointless-statement records = caplog.records() assert len(records) == 1 assert records[0].message == 'No color defined for foo!'
def test_values(self, key, expected): d = style.ColorDict() d['foo'] = 'one' d['foo.fg'] = 'two' d['foo.bg'] = 'three' assert d[key] == expected
def test_qcolor(self): d = style.ColorDict() d['foo'] = QColor() with pytest.raises(TypeError): d['foo'] # pylint: disable=pointless-statement