-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
WIP: fix #4507 and ensure our modules have no warnings for general import #4510
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4510 +/- ##
==========================================
- Coverage 96.16% 93.14% -3.03%
==========================================
Files 117 118 +1
Lines 25864 25906 +42
Branches 2498 2500 +2
==========================================
- Hits 24873 24129 -744
- Misses 690 1437 +747
- Partials 301 340 +39
Continue to review full report at Codecov.
|
@RonnyPfannschmidt Will this also solve #1403? |
@johnthagen correct, its one of the warnings i sorted out |
@johnthagen wait, actually it isnt, i only contained that warning to the assertion module we will leave it in place until we drop python 2.7 support in the mainline as the implementation effort is a mess otherwise |
testing/test_own_modules.py
Outdated
|
||
|
||
def _get_modules(): | ||
for module in vars(_pytest).values(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RonnyPfannschmidt Do you think we could fix #1403 by using a warning filter? with warnings.catch_warnings():
warnings.filterwarnings('ignore', category=DeprecationWarning)
import imp |
I think the actual fix here needs to be to factor out usage of Looks like we have a few usages, all in the assertion module:
|
Python 2.7 has a small compatibility version of |
unfortunately it does not, |
importlib2 might be applicable |
Seems "use at your own risk beta" -- maybe not the best choice here? |
Yeah, looks like |
@RonnyPfannschmidt - can you paste It's also a machine-readable link between issues and related PRs that e.g. the refined github extension can pick up on, which means I can see whether a given issue has a currently-open PR that will resolve it 😄 Not a big deal, but I've found (and manually closed) a few orphan issues which stayed open long after the fixing PR was merged so we might as well use the tools to avoid that! |
pushed a merge will have to amend it later on |
@asottile the usage of |
you sure?
|
yeah definitely not:
|
@asottile https://travis-ci.org/pytest-dev/pytest/jobs/483565824#L313-L321 - definitively sure |
that's virtualenv's fault -- not stdlib: pypa/virtualenv#955 |
err -- pypa/virtualenv#555 looks like it's been fixed, upgrade |
# virtualenv bug | ||
"-W", "ignore:the imp:DeprecationWarning:distutils", | ||
"-c", "import " + module_name, | ||
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be combinded with the (very slow) testing/test_modimport.py
at least?
I would also like to run these kind of tests in a single CI job only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also needs # fmt: on
again.
@asottile @RonnyPfannschmidt any updates on this? does this requires a restart? |
i lost track of it, im currently still on my hiatus, but i'l take a look at making this work quickly this week |
51b40a3
to
61ef3e6
Compare
i got started on resolving the rebase artifacts, but right now its unlikely to finish before sometime next week |
Thanks for the update! |
main reason being that i currently do only public opensouce to do a bit of unpacking while the preps for the marriage on saturday are running ^^ |
Gratz! |
i started picking this one up again, i merged around a bit and will squash around soonish to deal with the fallout of this stuff |
@@ -10,7 +10,10 @@ | |||
from io import UnsupportedOperation | |||
from tempfile import TemporaryFile | |||
|
|||
import pytest | |||
from .config import hookimpl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious why the imports changed, maybe I missed this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removes the import cycle to pytest
Else we can't import parts of pytest without breaking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you show me what you mean -- like stacktrace or reproduction or whatnot, I'm not sure I understand (and I don't understand why it's necessary for this PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pytest imports from all over the place this preveting isolation, if everything triggers every import then I can't let it effectively tell me what is going on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last stack trace I had if this disappeared a few months ago in a terminal, perhaps I could recreate it when I'm back on that computer
I think a new warning has popped up today from
|
@asottile the communication around the super-seed leaves me personally with a bad after-taste, i'll reflect on that |
ah I mostly wanted to get this going again -- and wanted to see if I could find the import error -- no harm intended :( |
testing/test_meta.py ensures this already as a side effect (+ tests a few more (`__init__.py` files) and should have been combined with it right away [1]. 1: pytest-dev#4510 (comment) Ref: pytest-dev@eaa05531e Ref: pytest-dev@4d31ea831
closes #4507