diff options
author | Daniel Hahler <git@thequod.de> | 2020-01-10 05:20:41 +0100 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2020-01-10 05:20:41 +0100 |
commit | 1356d20e90c72f6342a7aa59f018757b0b2dd2b3 (patch) | |
tree | f8fa8901312c934e6577ef105b2039c673ea21ec /testing/test_pytester.py | |
parent | 1e28cb855d99f04c64944c28b014d35f6d3fdcdc (diff) | |
parent | 622995a50130824da120e81f31a048ac38966d06 (diff) | |
download | pytest-1356d20e90c72f6342a7aa59f018757b0b2dd2b3.tar.gz |
Merge master into features
Diffstat (limited to 'testing/test_pytester.py')
-rw-r--r-- | testing/test_pytester.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testing/test_pytester.py b/testing/test_pytester.py index 3dab13b4b..b747ac9ee 100644 --- a/testing/test_pytester.py +++ b/testing/test_pytester.py @@ -676,3 +676,25 @@ def test_run_result_repr(): repr(r) == "<RunResult ret=99 len(stdout.lines)=3" " len(stderr.lines)=4 duration=0.50s>" ) + + +def test_testdir_outcomes_with_multiple_errors(testdir): + p1 = testdir.makepyfile( + """ + import pytest + + @pytest.fixture + def bad_fixture(): + raise Exception("bad") + + def test_error1(bad_fixture): + pass + + def test_error2(bad_fixture): + pass + """ + ) + result = testdir.runpytest(str(p1)) + result.assert_outcomes(error=2) + + assert result.parseoutcomes() == {"error": 2} |