MCPcopy Create free account
hub / github.com/plotly/plotly.py / test_bad_facet_spacing_error

Function test_bad_facet_spacing_error

tests/test_optional/test_px/test_facets.py:110–130  ·  view source on GitHub ↗
(constructor)

Source from the content-addressed store, hash-verified

108
109
110def test_bad_facet_spacing_error(constructor):
111 df = bad_facet_spacing_df(constructor_func=constructor)
112 with pytest.raises(
113 ValueError, match="Use the facet_row_spacing argument to adjust this spacing."
114 ):
115 px.scatter(df, x="x", y="y", facet_row="category", facet_row_spacing=0.01001)
116 with pytest.raises(
117 ValueError, match="Use the facet_col_spacing argument to adjust this spacing."
118 ):
119 px.scatter(df, x="x", y="y", facet_col="category", facet_col_spacing=0.01001)
120 # Check error is not raised when the spacing is OK
121 try:
122 px.scatter(df, x="x", y="y", facet_row="category", facet_row_spacing=0.01)
123 except ValueError:
124 # Error shouldn't be raised, so fail if it is
125 assert False
126 try:
127 px.scatter(df, x="x", y="y", facet_col="category", facet_col_spacing=0.01)
128 except ValueError:
129 # Error shouldn't be raised, so fail if it is
130 assert False

Callers

nothing calls this directly

Calls 2

bad_facet_spacing_dfFunction · 0.85
scatterMethod · 0.80

Tested by

no test coverage detected