You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks! There is a comment in the pandas code that we don't use autouse because of perf. I'll see if I can track down the history there and see if I can reproduce the perf issue.
This was originally changed in pandas in pandas-dev/pandas#45667. It tried undoing that patch locally, seeing negligible differences in runtimes for the test suite. Will see what it looks like on the pandas CI in pandas-dev/pandas#57122.
It would be nice if an alternative to an autouse fixture could be used in the future as non-doctests don't need this fixture at all (which is probably +98% of tests in pandas).
The prior motivation for doing this dynamically was me being curious why in the durations output the last-ran unit test TEARDOWN could be one of the longest durations, and removing an autouse=True, doctest_namespace fixture was the culprit.
I believe this may be related to #3664.
In pandas, we dynamically add a marker for our doctests so that we don't need
import pandas as pd
andimport numpy as np
in every docstring.https://github.com/pandas-dev/pandas/blob/9008ee5810c09bc907b5fdc36fc3c1dff4a50c55/pandas/conftest.py#L191-L198
The
add_doctest_imports
fixture is here.https://github.com/pandas-dev/pandas/blob/9008ee5810c09bc907b5fdc36fc3c1dff4a50c55/pandas/conftest.py#L253-L259
With pytest 8.0.0, add_marker no longer has any effect. Is the intentional, and if so, is there an alternative?
The text was updated successfully, but these errors were encountered: