Skip to content

Prevent hiding underlying exception when ConfTestImportFailure is raised #7244

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

Merged
merged 2 commits into from
May 23, 2020

Conversation

DahlitzFlorian
Copy link
Member

@asottile the PR I mentioned in #7150. Let me know if I missed something. Thanks for your patience and your help on this, I really appreciate it!

  • Allow maintainers to push and squash when merging my commits. Please uncheck this if you prefer to squash the commits yourself.
  • Create a new changelog file in the changelog folder, with a name like <ISSUE NUMBER>.<TYPE>.rst
  • Add yourself to AUTHORS in alphabetical order (was done in PR Add note about --strict and --strict-markers to references #7240 and approved, but not yet merged)

@symonk
Copy link
Member

symonk commented May 22, 2020

Hey @DahlitzFlorian github is having some issue(s) right now which explains the fetch failures on CI :)

elif isinstance(excinfo.value, ConftestImportFailure):
# A config.ConftestImportFailure is not useful for post_mortem.
# Use the underlying exception instead:
return excinfo.value.excinfo[2]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! that was easy -- is there a way to demo this in a test?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fast feedback! Oh yeah, I will try to write a test for this today.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a look at test_debugging.py, there are tests there which interact with pdb directly. 👍

@DahlitzFlorian
Copy link
Member Author

Finally, I got a working test, which actually does test the change I submitted - never mind writing the test would be harder than the actual fix.

Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asottile asottile merged commit 45f5326 into pytest-dev:master May 23, 2020
@asottile asottile added needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch backported and removed needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch labels May 23, 2020
asottile added a commit that referenced this pull request May 23, 2020
[5.4.x] Merge pull request #7244 from DahlitzFlorian/fix-issue-7150
@DahlitzFlorian DahlitzFlorian deleted the fix-issue-7150 branch May 25, 2020 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants