def test_parse(p, s): assert Permutation.parse(s) == p
def test_bad_parse(s): with pytest.raises(ValueError): Permutation.parse(s)