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

False-positive warning about assertion rewrite #2005

Closed
nicoddemus opened this issue Oct 17, 2016 · 3 comments
Closed

False-positive warning about assertion rewrite #2005

nicoddemus opened this issue Oct 17, 2016 · 3 comments
Assignees
Labels

Comments

@nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented Oct 17, 2016

Consider:

# contents of conftest.py
pytest_plugins = 'plugin1'

# contents of test_foo.py
pytest_plugins = 'plugin1'

def test():
   pass

# plugin1.py is an empty file

pytest-3.0.3 provides this warning:

WP1 None Modules are already imported so can not be re-written: plugin1

But this is a false positive; what happens is that the code which verifies that a module needs to be rewritten but is already imported doesn't remember that the file was already rewritten on import.

@nicoddemus nicoddemus self-assigned this Oct 17, 2016
@RonnyPfannschmidt
Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt commented Oct 17, 2016

this is a duplicate ^^

@RonnyPfannschmidt
Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt commented Oct 17, 2016

@nicoddemus
Copy link
Member Author

@nicoddemus nicoddemus commented Oct 17, 2016

Oh right. Do you mind if we close the other one? This one contains more information. 😁

nicoddemus added a commit to nicoddemus/pytest that referenced this issue Oct 19, 2016
nicoddemus added a commit to nicoddemus/pytest that referenced this issue Oct 19, 2016
nicoddemus added a commit to nicoddemus/pytest that referenced this issue Oct 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants