-
-
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
Using capsys in fixtures: AttributeError: 'CaptureFixture' object has no attribute '_capture' #2709
Comments
Hi @hroncok thanks for the report! To me it is a bug; if using |
@nicoddemus |
I'm deeply sorry, but I don't understand what are you trying to say. Could you please be a little bit more verbose? |
@hroncok |
@ApaDoctor I have a working fix, I will prepare a PR later today. Thanks for the interest, your question forced me to study the code and I ended up finding a solution. |
Thanks for fixing this. |
Recently, I had a workshop about parametric tests and fixtures in pytest. As one of the examples I tried to use the
capsys
fixture inside my own and failed. I wonder if it's a bug or documented behavior I couldn't find.First, working code
Broken code
Now I don't like multiple assertions in one test, so let's create a fixture and split it:
I think this should work. At least, it feels like a natural way of doing it. But it blows up:
Full output
System information
The text was updated successfully, but these errors were encountered: