Exemplo n.º 1
0
def test_requires_geos_doc_build(version, mocked_geos_version,
                                 sphinx_doc_build):
    """The requires_geos decorator always adapts the docstring."""
    wrapped = requires_geos(version)(func)

    assert wrapped.__doc__ == expected_docstring.format(version=version,
                                                        indent=" " * 4)
Exemplo n.º 2
0
def test_requires_geos_not_ok(version, mocked_geos_version):
    wrapped = requires_geos(version)(func)
    with pytest.raises(shapely.UnsupportedGEOSOperation):
        wrapped()

    assert wrapped.__doc__ == expected_docstring.format(version=version,
                                                        indent=" " * 4)
Exemplo n.º 3
0
def test_requires_geos_ok(version, mocked_geos_version):
    wrapped = requires_geos(version)(func)
    assert wrapped is func
Exemplo n.º 4
0
def test_requires_geos_method(version, mocked_geos_version, sphinx_doc_build):
    """The requires_geos decorator adjusts methods docstrings correctly"""
    wrapped = requires_geos(version)(SomeClass.func)

    assert wrapped.__doc__ == expected_docstring.format(version=version,
                                                        indent=" " * 8)