def test_NamedAnchor_repr():
    import sys

    if sys.version_info >= (3, ):
        expected = "NamedAnchor(name='top', x=1.0, y=2.0)"
    else:
        expected = "NamedAnchor(name=u'top', x=1.0, y=2.0)"
    assert repr(NamedAnchor("top", 1.0, 2.0)) == expected
def test_NamedAnchor_invalid():
    with pytest.raises(ValueError, match="indexes must start from 1"):
        NamedAnchor("top_0", 1, 2)
def test_NamedAnchor_repr():
    expected = "NamedAnchor(name='top', x=1.0, y=2.0)"
    assert repr(NamedAnchor("top", 1.0, 2.0)) == expected