-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add_marker with usefixtures no longer works with pytest 8.0.0 #11873
Comments
Very similar to #11759. Would the alternative described there of using an autouse fixture instead of the hook work for pandas? |
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 The prior motivation for doing this dynamically was me being curious why in the |
Sorry to ping here, but I'm trying to understand how your autouse fix in pandas works here. It seems as though no fixtures are called when running |
Pings are welcome!
pandas CI invokes doctests via: |
@rhshadrach That fixed my issues, thanks! Still hoping for a better workaround for the Cheers! |
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: