Skip to content
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

Rename classes whose name starts with Test #411

Merged
merged 1 commit into from
Dec 21, 2016

Conversation

DRMacIver
Copy link
Member

This causes pytest warnings because they look like they're
supposed to be unittest tests, but they have an init which
stops them being picked up as such.

This causes pytest warnings because they look like they're
supposed to be unittest tests, but they have an __init__ which
stops them being picked up as such.
@alexwlchan
Copy link
Contributor

I'll check this fixes all the warnings when CI finishes.

Assuming these are the only outstanding warnings, can/should we add a flag to pytest to turn any pytest warnings into errors?

@DRMacIver
Copy link
Member Author

I started to say "That's a good idea, we should do that" then discovered that it's already supposed to be doing that. tox.ini (which pytest is supposed to pick up config from) adds the --strict flag, which is supposed to turn warnings into errors. I wonder what's going on?

@alexwlchan
Copy link
Contributor

Looks like the use of "warning" in the pytest docs doesn't mean what you might expect, this is a documentation bug: pytest-dev/pytest#1381

@DRMacIver
Copy link
Member Author

I see. Sigh.

In that case it looks like the answer is "No, we can't do that easily"?

@alexwlchan
Copy link
Contributor

Yep. At best, we can have pytest turn warnings emitted from the code under test into errors, but not those provided by pytest-warnings at the end of the test. 😕

It sounds like there might be plans afoot to change this in a future version of pytest, but nothing we can do right now: pytest-dev/pytest#1173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants