1import geopandas
2
3import pytest
4
5
6def test_options():
7    assert "display_precision: " in repr(geopandas.options)
8
9    assert dir(geopandas.options) == ["display_precision", "use_pygeos"]
10
11    with pytest.raises(AttributeError):
12        geopandas.options.non_existing_option
13
14    with pytest.raises(AttributeError):
15        geopandas.options.non_existing_option = 10
16
17
18def test_options_display_precision():
19    assert geopandas.options.display_precision is None
20    geopandas.options.display_precision = 5
21    assert geopandas.options.display_precision == 5
22
23    with pytest.raises(ValueError):
24        geopandas.options.display_precision = "abc"
25
26    with pytest.raises(ValueError):
27        geopandas.options.display_precision = -1
28
29    geopandas.options.display_precision = None
30