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
Prevent pytest from printing ConftestImportFailure traceback #7257
Conversation
I moved the check to the correct position in the method and add |
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.
Thanks for working on this @DahlitzFlorian.
I think the change make sense. Maybe there is a better place to handle this, but the way the code works now (conftests imported almost unintentionally in _gethookproxy
?), it seems like the best place.
I left a few comments.
Also, _pytest/config/__init__.py
already has some code to format ConftestImportFailure
exceptions raised during initial conftest loading (added by @nicoddemus in #4124). Can some of the code be shared?
Thanks for the feedback @bluetech! I applied the suggested changes. |
The code LGTM, just two things:
Also, did you see my comment about code sharing above? (It's OK if you don't want to dig into that) |
Thanks for the feedback!
|
The CI is gated on Python 3.5, i.e. the merge button is disabled if it is not passing. Looking at the CI logs, the issue is that the test asserts for
but on Python 3.5 it is
so one way to take care of it is to assert just for
Yes that's weird. I verified now that the |
Fixed the py35 build. |
@asottile What do you think about the patch? Can it be merged? |
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.
[5.4.x] Merge pull request #7257 from DahlitzFlorian/fix-issue-6956
Closes: #6956
@asottile I was not able to satisfy mypy so I added
# type: ignore
to the two lines. Let me know what you think :)changelog
folder, with a name like<ISSUE NUMBER>.<TYPE>.rst