Pytest transient dependency

Hi,

I’ve noticed that since plotly have introduced ‘dash testing’ feature, the dash python package has a transient dependency on pytest.

It’s quite rare that python packages do that, because pytest (and testing library in general) introduce all sort of problems. For example in my case, having pytest as a transient dependency in my production code triggers some statement in sklearn that should only be called within a test environment:

And this then requires me to add to my production code all the test dependencies of sklearn.

I wonder if, in an ideal world, the dash testing library should be pulled out of dash and made available as a different package.

Thanks for reporting! Wasn’t aware that pytest wasn’t a “safe” dependency. I’ve logged an issue for further discussion among the development team here: https://github.com/plotly/dash/issues/804

Thanks.

I wouldn’t say it’s unsafe, but rather that it’s bad practice.