def test_invalid_color_format(mocker, color):
    with pytest.raises(ValueError) as e:
        canon = canonicalize_color(color)
    assert str(e.value) == 'Unknown format for color "{}"'.format(color)
Example #2
0
def test_invalid_color_format(mocker: MockerFixture, color: str) -> None:
    with pytest.raises(ValueError) as e:
        canon = canonicalize_color(color)
    assert str(e.value) == f'Unknown format for color "{color}"'
def test_color_formats(mocker, color):
    canon = canonicalize_color(color)
    assert canon == '#fff'
Example #4
0
def test_color_formats(mocker: MockerFixture, color: str) -> None:
    canon = canonicalize_color(color)
    assert canon == "#fff"