diff options
author | Stefan Scherfke <stefan@sofa-rockers.org> | 2020-02-04 14:38:18 +0100 |
---|---|---|
committer | Stefan Scherfke <stefan@sofa-rockers.org> | 2020-02-10 21:12:37 +0100 |
commit | d59adc61f98c6d3d27c0417981c7355319fdacd1 (patch) | |
tree | 4f64f9eeb2ec2d87bee06ae8194bfadc664807ff /doc/en/example | |
parent | 4038d6c773106255136990b8e190e0daf0d4c0c7 (diff) | |
download | pytest-d59adc61f98c6d3d27c0417981c7355319fdacd1.tar.gz |
Reverse / fix meaning of "+/-" in error diffs
The convention is "assert result is expected". Pytest's error diffs now
reflect this. "-" means that sth. expected is missing in the result and
"+" means that there are unexpected extras in the result.
Fixes: #3333
Diffstat (limited to 'doc/en/example')
-rw-r--r-- | doc/en/example/reportingdemo.rst | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/doc/en/example/reportingdemo.rst b/doc/en/example/reportingdemo.rst index 1c06782f6..1ab0f9c82 100644 --- a/doc/en/example/reportingdemo.rst +++ b/doc/en/example/reportingdemo.rst @@ -81,8 +81,8 @@ Here is a nice run of several failures and how ``pytest`` presents things: def test_eq_text(self): > assert "spam" == "eggs" E AssertionError: assert 'spam' == 'eggs' - E - spam - E + eggs + E - eggs + E + spam failure_demo.py:45: AssertionError _____________ TestSpecialisedExplanations.test_eq_similar_text _____________ @@ -92,9 +92,9 @@ Here is a nice run of several failures and how ``pytest`` presents things: def test_eq_similar_text(self): > assert "foo 1 bar" == "foo 2 bar" E AssertionError: assert 'foo 1 bar' == 'foo 2 bar' - E - foo 1 bar + E - foo 2 bar E ? ^ - E + foo 2 bar + E + foo 1 bar E ? ^ failure_demo.py:48: AssertionError @@ -106,8 +106,8 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert "foo\nspam\nbar" == "foo\neggs\nbar" E AssertionError: assert 'foo\nspam\nbar' == 'foo\neggs\nbar' E foo - E - spam - E + eggs + E - eggs + E + spam E bar failure_demo.py:51: AssertionError @@ -122,9 +122,9 @@ Here is a nice run of several failures and how ``pytest`` presents things: E AssertionError: assert '111111111111...2222222222222' == '111111111111...2222222222222' E Skipping 90 identical leading characters in diff, use -v to show E Skipping 91 identical trailing characters in diff, use -v to show - E - 1111111111a222222222 + E - 1111111111b222222222 E ? ^ - E + 1111111111b222222222 + E + 1111111111a222222222 E ? ^ failure_demo.py:56: AssertionError |