MCPcopy Index your code
hub / github.com/plotly/plotly.py / test_px_defaults

Function test_px_defaults

tests/test_optional/test_px/test_px.py:278–290  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

276
277
278def test_px_defaults():
279 px.defaults.labels = dict(x="hey x")
280 px.defaults.category_orders = dict(color=["b", "a"])
281 px.defaults.color_discrete_map = dict(b="red")
282 fig = px.scatter(x=[1, 2], y=[1, 2], color=["a", "b"])
283 try:
284 assert fig.data[0].name == "b"
285 assert fig.data[0].marker.color == "red"
286 assert fig.layout.xaxis.title.text == "hey x"
287 finally:
288 # reset defaults to prevent all other tests from failing if this one does
289 px.defaults.reset()
290 pio.templates.default = "plotly"
291
292
293def assert_orderings(backend, days_order, days_check, times_order, times_check):

Callers

nothing calls this directly

Calls 2

scatterMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected