diff options
author | Ronny Pfannschmidt <opensource@ronnypfannschmidt.de> | 2018-05-18 10:19:46 +0200 |
---|---|---|
committer | Ronny Pfannschmidt <opensource@ronnypfannschmidt.de> | 2018-05-23 16:45:58 +0200 |
commit | 86fc31db8d3b5ae33d18be43efdf23ff6f2ce040 (patch) | |
tree | ae8ae2a58d26f99a5250b03f63db1099c9d04fbd /doc/en/assert.rst | |
parent | b60376dc289ceae886c7d54d3c5c4074d9969791 (diff) | |
download | pytest-86fc31db8d3b5ae33d18be43efdf23ff6f2ce040.tar.gz |
apply most other hooks and opt out of black reformating
Diffstat (limited to 'doc/en/assert.rst')
-rw-r--r-- | doc/en/assert.rst | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/doc/en/assert.rst b/doc/en/assert.rst index 4a852978e..a2c588d81 100644 --- a/doc/en/assert.rst +++ b/doc/en/assert.rst @@ -29,17 +29,17 @@ you will see the return value of the function call:: platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y rootdir: $REGENDOC_TMPDIR, inifile: collected 1 item - + test_assert1.py F [100%] - + ================================= FAILURES ================================= ______________________________ test_function _______________________________ - + def test_function(): > assert f() == 4 E assert 3 == 4 E + where 3 = f() - + test_assert1.py:5: AssertionError ========================= 1 failed in 0.12 seconds ========================= @@ -172,12 +172,12 @@ if you run this module:: platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y rootdir: $REGENDOC_TMPDIR, inifile: collected 1 item - + test_assert2.py F [100%] - + ================================= FAILURES ================================= ___________________________ test_set_comparison ____________________________ - + def test_set_comparison(): set1 = set("1308") set2 = set("8035") @@ -188,7 +188,7 @@ if you run this module:: E Extra items in the right set: E '5' E Use -v to get the full diff - + test_assert2.py:5: AssertionError ========================= 1 failed in 0.12 seconds ========================= @@ -209,7 +209,7 @@ the ``pytest_assertrepr_compare`` hook. .. autofunction:: _pytest.hookspec.pytest_assertrepr_compare :noindex: -As an example consider adding the following hook in a :ref:`conftest.py <conftest.py>` +As an example consider adding the following hook in a :ref:`conftest.py <conftest.py>` file which provides an alternative explanation for ``Foo`` objects:: # content of conftest.py @@ -241,14 +241,14 @@ the conftest file:: F [100%] ================================= FAILURES ================================= _______________________________ test_compare _______________________________ - + def test_compare(): f1 = Foo(1) f2 = Foo(2) > assert f1 == f2 E assert Comparing Foo instances: E vals: 1 != 2 - + test_foocompare.py:11: AssertionError 1 failed in 0.12 seconds |