def test_scale_invlid(): with pytest.raises(ValueError) as exc: print(parse_scale('foo:bar')) assert str(exc.value) == 'Invalid scale "foo:bar".'
def test_scale(): assert parse_scale('foo:2') == ('foo', 2)