Prevent pytest from printing ConftestImportFailure traceback#7257
Prevent pytest from printing ConftestImportFailure traceback#7257asottile merged 4 commits intopytest-dev:masterfrom
Conversation
|
I moved the check to the correct position in the method and add |
bluetech
left a comment
There was a problem hiding this comment.
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? |
[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: ignoreto the two lines. Let me know what you think :)changelogfolder, with a name like<ISSUE NUMBER>.<TYPE>.rst