-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a cross-compat trick to squash chaining, stolen from pyparsing.py…
… (thanks PaulMcG)
- Loading branch information
Showing
10 changed files
with
45 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pytest_plugins = ("pytester", "pytest_raisin") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
def test_spurious_chaining_is_suppressed(testdir): | ||
testdir.makepyfile(""" | ||
import pytest | ||
def test_the_thing(): | ||
with pytest.raises(Exception("boom")): | ||
raise Exception("bang") | ||
""") | ||
result = testdir.runpytest() | ||
result.assert_outcomes(failed=1) | ||
result.stdout.fnmatch_lines([ | ||
"E * AssertionError: Exception args do not match!", | ||
"E * Actual: ('bang',)", | ||
"E * Expected: ('boom',)", | ||
]) | ||
text = result.stdout.str() | ||
assert "During handling of the above exception, another exception occurred" not in text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
pytest_plugins = ["pytester"] | ||
|
||
|
||
def test_using_exception_class(testdir): | ||
testdir.makepyfile(""" | ||
import pytest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2fb434c
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.
@ptmcg this greatly simplified the packaging - thanks again for the tip