-
-
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
sys.modules[None] gets pseudo module when pytest skip condition is string #2103
Comments
My feeling is that pytest shouldn't be adding a None key to sys.modules, but if that's a legitimate expectation to be had about sys.modules, then setuptools should be re-written to support this usage. Thoughts? |
Thanks a lot for taking the time to find a minimal example to replicate the issue!
I also find it weird. Decided to investigate a little, found the code that does that here. I think the intent is to keep the module object alive. I commented out that line and all tests pass both in py27 and py35, so we might either comment it out or perhaps don't use |
More info: that Removing it both py27 and py35 pass, as well as @jaraco's test. |
This code leaves None in sys.modules as a side effect but is no longer needed in the Python 3 versions we support. Fix pytest-dev#2103
Excellent. Thanks for this! |
This code leaves None in sys.modules as a side effect but is no longer needed in the Python 3 versions we support. See pytest-dev/pytest#2103 for the original report.
In pypa/setuptools#860, the test_sandbox tests started failing when another commit was made that invoked a pytest skip with a string expression, because that causes
sys.modules
to get a None key in that dict. This behavior can be minimally replicated thus:The text was updated successfully, but these errors were encountered: