| 276 | |
| 277 | |
| 278 | def 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 | |
| 293 | def assert_orderings(backend, days_order, days_check, times_order, times_check): |