Skip to content

test_namespace.py::test_aliases fails due to Plotly template in namespace #2550

@SpandanBhoiIITM

Description

@SpandanBhoiIITM

Describe the bug

While running the test suite locally using pytest, the test
tests/test_namespace.py::test_aliases fails.

The failure happens because Plotly templates exposed in the arviz
namespace (for example arviz_cetrino_template) originate from
plotly.graph_objs.layout._template instead of the arviz package.

Example:

import arviz as az
az.arviz_cetrino_template.module
'plotly.graph_objs.layout._template'

The test checks:
assert orig_lib.startswith("arviz")

so the assertion fails.

Possible solution could be excluding these template objects in the
test_aliases check similar to how from_netcdf and from_zarr
are handled.

Environment:
Python 3.12
pytest 9.0.2
ArviZ 1.0.0

Expected behaviour

No response

Steps to reproduce

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions