pymc icon indicating copy to clipboard operation
pymc copied to clipboard

`pymc.testing` attempts to import `pytest` but `pytest` is not in `pymc` install requirements

Open lucianopaz opened this issue 1 year ago • 2 comments

Describe the issue:

a41d5244b8ec78372751924ba0484ed02d57b2cb included the testing.py module at the root level of pymc. setup.py says that the install requires are taken from requirements.txt, and that file does not include pytest.

This makes from pymc.testing import anything fail unless you already have installed pytest. Should pymc raise some kind of informative message instead of saying ModuleNotFoundError: No module named 'pytest'?

Reproduceable code example:

from pymc import testing

Error message:

ModuleNotFoundError: No module named 'pytest'

PyMC version information:

pymc version: 5.11.0

Context for the issue:

No response

lucianopaz avatar Mar 26 '24 09:03 lucianopaz

Maybe we should import pytest locally, because not everything in there requires it. We are only using pytest for the pytest.warns feature

ricardoV94 avatar Mar 26 '24 09:03 ricardoV94

Yes, that's fine with me.

lucianopaz avatar Mar 26 '24 09:03 lucianopaz

I would like to take this (as part of the hackathon)

bomtall avatar Jun 15 '24 13:06 bomtall