From e7cd00ac920f3db2855becd75193d2241b84e56d Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 31 May 2019 09:01:05 -0700 Subject: [PATCH] Preparing release version 4.6.0 --- CHANGELOG.rst | 78 ++++++++++++++++++++++++ changelog/2064.bugfix.rst | 1 - changelog/4559.feature.rst | 1 - changelog/4908.bugfix.rst | 1 - changelog/4956.feature.rst | 1 - changelog/5036.bugfix.rst | 1 - changelog/5062.feature.rst | 1 - changelog/5063.feature.rst | 1 - changelog/5091.feature.rst | 1 - changelog/5250.doc.rst | 1 - changelog/5256.bugfix.rst | 1 - changelog/5257.bugfix.rst | 1 - changelog/5269.feature.rst | 1 - changelog/5278.bugfix.rst | 1 - changelog/5286.bugfix.rst | 1 - changelog/5311.feature.rst | 2 - changelog/5312.feature.rst | 1 - changelog/5330.bugfix.rst | 2 - changelog/5333.bugfix.rst | 1 - doc/en/announce/index.rst | 1 + doc/en/announce/release-4.6.0.rst | 43 ++++++++++++++ doc/en/example/parametrize.rst | 4 +- doc/en/example/reportingdemo.rst | 98 +++++++++++++++---------------- doc/en/warnings.rst | 2 +- 24 files changed, 174 insertions(+), 72 deletions(-) delete mode 100644 changelog/2064.bugfix.rst delete mode 100644 changelog/4559.feature.rst delete mode 100644 changelog/4908.bugfix.rst delete mode 100644 changelog/4956.feature.rst delete mode 100644 changelog/5036.bugfix.rst delete mode 100644 changelog/5062.feature.rst delete mode 100644 changelog/5063.feature.rst delete mode 100644 changelog/5091.feature.rst delete mode 100644 changelog/5250.doc.rst delete mode 100644 changelog/5256.bugfix.rst delete mode 100644 changelog/5257.bugfix.rst delete mode 100644 changelog/5269.feature.rst delete mode 100644 changelog/5278.bugfix.rst delete mode 100644 changelog/5286.bugfix.rst delete mode 100644 changelog/5311.feature.rst delete mode 100644 changelog/5312.feature.rst delete mode 100644 changelog/5330.bugfix.rst delete mode 100644 changelog/5333.bugfix.rst create mode 100644 doc/en/announce/release-4.6.0.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a1bcd1917..32267f4dd 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -18,6 +18,84 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 4.6.0 (2019-05-31) +========================= + +Important +--------- + +The ``4.6.X`` series will be the last series to support **Python 2 and Python 3.4**. + +For more details, see our `Python 2.7 and 3.4 support plan `__. + + +Features +-------- + +- `#4559 `_: Added the ``junit_log_passing_tests`` ini value which can be used to enable or disable logging of passing test output in the Junit XML file. + + +- `#4956 `_: pytester's ``testdir.spawn`` uses ``tmpdir`` as HOME/USERPROFILE directory. + + +- `#5062 `_: Unroll calls to ``all`` to full for-loops with assertion rewriting for better failure messages, especially when using Generator Expressions. + + +- `#5063 `_: Switch from ``pkg_resources`` to ``importlib-metadata`` for entrypoint detection for improved performance and import time. + + +- `#5091 `_: The output for ini options in ``--help`` has been improved. + + +- `#5269 `_: ``pytest.importorskip`` includes the ``ImportError`` now in the default ``reason``. + + +- `#5311 `_: Captured logs that are output for each failing test are formatted using the + ColoredLevelFormatter. + + +- `#5312 `_: Improved formatting of multiline log messages in Python 3. + + + +Bug Fixes +--------- + +- `#2064 `_: The debugging plugin imports the wrapped ``Pdb`` class (``--pdbcls``) on-demand now. + + +- `#4908 `_: The ``pytest_enter_pdb`` hook gets called with post-mortem (``--pdb``). + + +- `#5036 `_: Fix issue where fixtures dependent on other parametrized fixtures would be erroneously parametrized. + + +- `#5256 `_: Handle internal error due to a lone surrogate unicode character not being representable in Jython. + + +- `#5257 `_: Ensure that ``sys.stdout.mode`` does not include ``'b'`` as it is a text stream. + + +- `#5278 `_: Pytest's internal python plugin can be disabled using ``-p no:python`` again. + + +- `#5286 `_: Fix issue with ``disable_test_id_escaping_and_forfeit_all_rights_to_community_support`` option not working when using a list of test IDs in parametrized tests. + + +- `#5330 `_: Show the test module being collected when emitting ``PytestCollectionWarning`` messages for + test classes with ``__init__`` and ``__new__`` methods to make it easier to pin down the problem. + + +- `#5333 `_: Fix regression in 4.5.0 with ``--lf`` not re-running all tests with known failures from non-selected tests. + + + +Improved Documentation +---------------------- + +- `#5250 `_: Expand docs on use of ``setenv`` and ``delenv`` with ``monkeypatch``. + + pytest 4.5.0 (2019-05-11) ========================= diff --git a/changelog/2064.bugfix.rst b/changelog/2064.bugfix.rst deleted file mode 100644 index eba593fc5..000000000 --- a/changelog/2064.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -The debugging plugin imports the wrapped ``Pdb`` class (``--pdbcls``) on-demand now. diff --git a/changelog/4559.feature.rst b/changelog/4559.feature.rst deleted file mode 100644 index ff076aff5..000000000 --- a/changelog/4559.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Added the ``junit_log_passing_tests`` ini value which can be used to enable and disable logging passing test output in the Junit XML file. diff --git a/changelog/4908.bugfix.rst b/changelog/4908.bugfix.rst deleted file mode 100644 index 2513618a1..000000000 --- a/changelog/4908.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -The ``pytest_enter_pdb`` hook gets called with post-mortem (``--pdb``). diff --git a/changelog/4956.feature.rst b/changelog/4956.feature.rst deleted file mode 100644 index ab8357cda..000000000 --- a/changelog/4956.feature.rst +++ /dev/null @@ -1 +0,0 @@ -pytester's ``testdir.spawn`` uses ``tmpdir`` as HOME/USERPROFILE directory. diff --git a/changelog/5036.bugfix.rst b/changelog/5036.bugfix.rst deleted file mode 100644 index a9c266538..000000000 --- a/changelog/5036.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix issue where fixtures dependent on other parametrized fixtures would be erroneously parametrized. diff --git a/changelog/5062.feature.rst b/changelog/5062.feature.rst deleted file mode 100644 index e311d161d..000000000 --- a/changelog/5062.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Unroll calls to ``all`` to full for-loops for better failure messages, especially when using Generator Expressions. diff --git a/changelog/5063.feature.rst b/changelog/5063.feature.rst deleted file mode 100644 index 21379ef0a..000000000 --- a/changelog/5063.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Switch from ``pkg_resources`` to ``importlib-metadata`` for entrypoint detection for improved performance and import time. diff --git a/changelog/5091.feature.rst b/changelog/5091.feature.rst deleted file mode 100644 index 122c91f53..000000000 --- a/changelog/5091.feature.rst +++ /dev/null @@ -1 +0,0 @@ -The output for ini options in ``--help`` has been improved. diff --git a/changelog/5250.doc.rst b/changelog/5250.doc.rst deleted file mode 100644 index 1b4c564a0..000000000 --- a/changelog/5250.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Expand docs on use of ``setenv`` and ``delenv`` with ``monkeypatch``. diff --git a/changelog/5256.bugfix.rst b/changelog/5256.bugfix.rst deleted file mode 100644 index 4df83454e..000000000 --- a/changelog/5256.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Handle internal error due to a lone surrogate unicode character not being representable in Jython. diff --git a/changelog/5257.bugfix.rst b/changelog/5257.bugfix.rst deleted file mode 100644 index 520519088..000000000 --- a/changelog/5257.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Ensure that ``sys.stdout.mode`` does not include ``'b'`` as it is a text stream. diff --git a/changelog/5269.feature.rst b/changelog/5269.feature.rst deleted file mode 100644 index 6247bfd5c..000000000 --- a/changelog/5269.feature.rst +++ /dev/null @@ -1 +0,0 @@ -``pytest.importorskip`` includes the ``ImportError`` now in the default ``reason``. diff --git a/changelog/5278.bugfix.rst b/changelog/5278.bugfix.rst deleted file mode 100644 index 4fe70c7fd..000000000 --- a/changelog/5278.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Pytest's internal python plugin can be disabled using ``-p no:python`` again. diff --git a/changelog/5286.bugfix.rst b/changelog/5286.bugfix.rst deleted file mode 100644 index 1d6974b89..000000000 --- a/changelog/5286.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix issue with ``disable_test_id_escaping_and_forfeit_all_rights_to_community_support`` option doesn't work when using a list of test IDs in parametrized tests. diff --git a/changelog/5311.feature.rst b/changelog/5311.feature.rst deleted file mode 100644 index ae7ef99ac..000000000 --- a/changelog/5311.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -Captured logs that are output for each failing test are formatted using the -ColoredLevelFormatter. diff --git a/changelog/5312.feature.rst b/changelog/5312.feature.rst deleted file mode 100644 index bcd5a736b..000000000 --- a/changelog/5312.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Improved formatting of multiline log messages in python3. diff --git a/changelog/5330.bugfix.rst b/changelog/5330.bugfix.rst deleted file mode 100644 index 61c715552..000000000 --- a/changelog/5330.bugfix.rst +++ /dev/null @@ -1,2 +0,0 @@ -Show the test module being collected when emitting ``PytestCollectionWarning`` messages for -test classes with ``__init__`` and ``__new__`` methods to make it easier to pin down the problem. diff --git a/changelog/5333.bugfix.rst b/changelog/5333.bugfix.rst deleted file mode 100644 index ac1d79585..000000000 --- a/changelog/5333.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix regression with ``--lf`` not re-running all tests with known failures from non-selected tests. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 8b5ca7b0a..fa53441ce 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-4.6.0 release-4.5.0 release-4.4.2 release-4.4.1 diff --git a/doc/en/announce/release-4.6.0.rst b/doc/en/announce/release-4.6.0.rst new file mode 100644 index 000000000..373f5d66e --- /dev/null +++ b/doc/en/announce/release-4.6.0.rst @@ -0,0 +1,43 @@ +pytest-4.6.0 +======================================= + +The pytest team is proud to announce the 4.6.0 release! + +pytest is a mature Python testing tool with more than a 2000 tests +against itself, passing on many different interpreters and platforms. + +This release contains a number of bugs fixes and improvements, so users are encouraged +to take a look at the CHANGELOG: + + https://docs.pytest.org/en/latest/changelog.html + +For complete documentation, please visit: + + https://docs.pytest.org/en/latest/ + +As usual, you can upgrade from pypi via: + + pip install -U pytest + +Thanks to all who contributed to this release, among them: + +* Akiomi Kamakura +* Anthony Sottile +* Bruno Oliveira +* Daniel Hahler +* David Röthlisberger +* Evan Kepner +* Jeffrey Rackauckas +* MyComputer +* Nikita Krokosh +* Raul Tambre +* Thomas Hisch +* Tim Hoffmann +* Tomer Keren +* Victor Maryama +* danielx123 +* oleg-yegorov + + +Happy testing, +The Pytest Development Team diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index c3f825297..ef792afe7 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -436,7 +436,7 @@ Running it results in some skips if we don't have all the python interpreters in . $ pytest -rs -q multipython.py ...sss...sssssssss...sss... [100%] ========================= short test summary info ========================== - SKIPPED [15] $REGENDOC_TMPDIR/CWD/multipython.py:30: 'python3.4' not found + SKIPPED [15] $REGENDOC_TMPDIR/CWD/multipython.py:31: 'python3.4' not found 12 passed, 15 skipped in 0.12 seconds Indirect parametrization of optional implementations/imports @@ -494,7 +494,7 @@ If you run this with reporting for skips enabled: test_module.py .s [100%] ========================= short test summary info ========================== - SKIPPED [1] $REGENDOC_TMPDIR/conftest.py:11: could not import 'opt2' + SKIPPED [1] $REGENDOC_TMPDIR/conftest.py:11: could not import 'opt2': No module named 'opt2' =================== 1 passed, 1 skipped in 0.12 seconds ==================== You'll see that we don't have an ``opt2`` module and thus the second test run diff --git a/doc/en/example/reportingdemo.rst b/doc/en/example/reportingdemo.rst index 1371d9cfa..928c365ca 100644 --- a/doc/en/example/reportingdemo.rst +++ b/doc/en/example/reportingdemo.rst @@ -26,7 +26,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert param1 * 2 < param2 E assert (3 * 2) < 6 - failure_demo.py:20: AssertionError + failure_demo.py:21: AssertionError _________________________ TestFailing.test_simple __________________________ self = @@ -43,7 +43,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E + where 42 = .f at 0xdeadbeef>() E + and 43 = .g at 0xdeadbeef>() - failure_demo.py:31: AssertionError + failure_demo.py:32: AssertionError ____________________ TestFailing.test_simple_multiline _____________________ self = @@ -51,7 +51,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: def test_simple_multiline(self): > otherfunc_multi(42, 6 * 9) - failure_demo.py:34: + failure_demo.py:35: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ a = 42, b = 54 @@ -60,7 +60,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert a == b E assert 42 == 54 - failure_demo.py:15: AssertionError + failure_demo.py:16: AssertionError ___________________________ TestFailing.test_not ___________________________ self = @@ -73,7 +73,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E assert not 42 E + where 42 = .f at 0xdeadbeef>() - failure_demo.py:40: AssertionError + failure_demo.py:41: AssertionError _________________ TestSpecialisedExplanations.test_eq_text _________________ self = @@ -84,7 +84,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E - spam E + eggs - failure_demo.py:45: AssertionError + failure_demo.py:46: AssertionError _____________ TestSpecialisedExplanations.test_eq_similar_text _____________ self = @@ -97,7 +97,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E + foo 2 bar E ? ^ - failure_demo.py:48: AssertionError + failure_demo.py:49: AssertionError ____________ TestSpecialisedExplanations.test_eq_multiline_text ____________ self = @@ -110,7 +110,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E + eggs E bar - failure_demo.py:51: AssertionError + failure_demo.py:52: AssertionError ______________ TestSpecialisedExplanations.test_eq_long_text _______________ self = @@ -127,7 +127,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E + 1111111111b222222222 E ? ^ - failure_demo.py:56: AssertionError + failure_demo.py:57: AssertionError _________ TestSpecialisedExplanations.test_eq_long_text_multiline __________ self = @@ -147,7 +147,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E E ...Full output truncated (7 lines hidden), use '-vv' to show - failure_demo.py:61: AssertionError + failure_demo.py:62: AssertionError _________________ TestSpecialisedExplanations.test_eq_list _________________ self = @@ -158,7 +158,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E At index 2 diff: 2 != 3 E Use -v to get the full diff - failure_demo.py:64: AssertionError + failure_demo.py:65: AssertionError ______________ TestSpecialisedExplanations.test_eq_list_long _______________ self = @@ -171,7 +171,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E At index 100 diff: 1 != 2 E Use -v to get the full diff - failure_demo.py:69: AssertionError + failure_demo.py:70: AssertionError _________________ TestSpecialisedExplanations.test_eq_dict _________________ self = @@ -189,7 +189,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E E ...Full output truncated (2 lines hidden), use '-vv' to show - failure_demo.py:72: AssertionError + failure_demo.py:73: AssertionError _________________ TestSpecialisedExplanations.test_eq_set __________________ self = @@ -207,7 +207,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E E ...Full output truncated (2 lines hidden), use '-vv' to show - failure_demo.py:75: AssertionError + failure_demo.py:76: AssertionError _____________ TestSpecialisedExplanations.test_eq_longer_list ______________ self = @@ -218,7 +218,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E Right contains one more item: 3 E Use -v to get the full diff - failure_demo.py:78: AssertionError + failure_demo.py:79: AssertionError _________________ TestSpecialisedExplanations.test_in_list _________________ self = @@ -227,7 +227,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert 1 in [0, 2, 3, 4, 5] E assert 1 in [0, 2, 3, 4, 5] - failure_demo.py:81: AssertionError + failure_demo.py:82: AssertionError __________ TestSpecialisedExplanations.test_not_in_text_multiline __________ self = @@ -246,7 +246,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E E ...Full output truncated (2 lines hidden), use '-vv' to show - failure_demo.py:85: AssertionError + failure_demo.py:86: AssertionError ___________ TestSpecialisedExplanations.test_not_in_text_single ____________ self = @@ -259,7 +259,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E single foo line E ? +++ - failure_demo.py:89: AssertionError + failure_demo.py:90: AssertionError _________ TestSpecialisedExplanations.test_not_in_text_single_long _________ self = @@ -272,7 +272,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E head head foo tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail E ? +++ - failure_demo.py:93: AssertionError + failure_demo.py:94: AssertionError ______ TestSpecialisedExplanations.test_not_in_text_single_long_term _______ self = @@ -285,7 +285,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E head head fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffftail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail tail E ? ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - failure_demo.py:97: AssertionError + failure_demo.py:98: AssertionError ______________ TestSpecialisedExplanations.test_eq_dataclass _______________ self = @@ -306,7 +306,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E Differing attributes: E b: 'b' != 'c' - failure_demo.py:109: AssertionError + failure_demo.py:110: AssertionError ________________ TestSpecialisedExplanations.test_eq_attrs _________________ self = @@ -327,7 +327,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E Differing attributes: E b: 'b' != 'c' - failure_demo.py:121: AssertionError + failure_demo.py:122: AssertionError ______________________________ test_attribute ______________________________ def test_attribute(): @@ -339,7 +339,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E assert 1 == 2 E + where 1 = .Foo object at 0xdeadbeef>.b - failure_demo.py:129: AssertionError + failure_demo.py:130: AssertionError _________________________ test_attribute_instance __________________________ def test_attribute_instance(): @@ -351,7 +351,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E + where 1 = .Foo object at 0xdeadbeef>.b E + where .Foo object at 0xdeadbeef> = .Foo'>() - failure_demo.py:136: AssertionError + failure_demo.py:137: AssertionError __________________________ test_attribute_failure __________________________ def test_attribute_failure(): @@ -364,7 +364,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: i = Foo() > assert i.b == 2 - failure_demo.py:147: + failure_demo.py:148: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = .Foo object at 0xdeadbeef> @@ -373,7 +373,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > raise Exception("Failed to get attrib") E Exception: Failed to get attrib - failure_demo.py:142: Exception + failure_demo.py:143: Exception _________________________ test_attribute_multiple __________________________ def test_attribute_multiple(): @@ -390,7 +390,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E + and 2 = .Bar object at 0xdeadbeef>.b E + where .Bar object at 0xdeadbeef> = .Bar'>() - failure_demo.py:157: AssertionError + failure_demo.py:158: AssertionError __________________________ TestRaises.test_raises __________________________ self = @@ -400,7 +400,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > raises(TypeError, int, s) E ValueError: invalid literal for int() with base 10: 'qwe' - failure_demo.py:167: ValueError + failure_demo.py:168: ValueError ______________________ TestRaises.test_raises_doesnt _______________________ self = @@ -409,7 +409,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > raises(IOError, int, "3") E Failed: DID NOT RAISE - failure_demo.py:170: Failed + failure_demo.py:171: Failed __________________________ TestRaises.test_raise ___________________________ self = @@ -418,7 +418,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > raise ValueError("demo error") E ValueError: demo error - failure_demo.py:173: ValueError + failure_demo.py:174: ValueError ________________________ TestRaises.test_tupleerror ________________________ self = @@ -427,7 +427,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > a, b = [1] # NOQA E ValueError: not enough values to unpack (expected 2, got 1) - failure_demo.py:176: ValueError + failure_demo.py:177: ValueError ______ TestRaises.test_reinterpret_fails_with_print_for_the_fun_of_it ______ self = @@ -438,7 +438,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > a, b = items.pop() E TypeError: 'int' object is not iterable - failure_demo.py:181: TypeError + failure_demo.py:182: TypeError --------------------------- Captured stdout call --------------------------- items is [1, 2, 3] ________________________ TestRaises.test_some_error ________________________ @@ -449,7 +449,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > if namenotexi: # NOQA E NameError: name 'namenotexi' is not defined - failure_demo.py:184: NameError + failure_demo.py:185: NameError ____________________ test_dynamic_compile_shows_nicely _____________________ def test_dynamic_compile_shows_nicely(): @@ -464,14 +464,14 @@ Here is a nice run of several failures and how ``pytest`` presents things: sys.modules[name] = module > module.foo() - failure_demo.py:202: + failure_demo.py:203: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ def foo(): > assert 1 == 0 E AssertionError - <0-codegen 'abc-123' $REGENDOC_TMPDIR/assertion/failure_demo.py:199>:2: AssertionError + <0-codegen 'abc-123' $REGENDOC_TMPDIR/assertion/failure_demo.py:200>:2: AssertionError ____________________ TestMoreErrors.test_complex_error _____________________ self = @@ -485,9 +485,9 @@ Here is a nice run of several failures and how ``pytest`` presents things: > somefunc(f(), g()) - failure_demo.py:213: + failure_demo.py:214: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - failure_demo.py:11: in somefunc + failure_demo.py:12: in somefunc otherfunc(x, y) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ @@ -497,7 +497,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert a == b E assert 44 == 43 - failure_demo.py:7: AssertionError + failure_demo.py:8: AssertionError ___________________ TestMoreErrors.test_z1_unpack_error ____________________ self = @@ -507,7 +507,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > a, b = items E ValueError: not enough values to unpack (expected 2, got 0) - failure_demo.py:217: ValueError + failure_demo.py:218: ValueError ____________________ TestMoreErrors.test_z2_type_error _____________________ self = @@ -517,7 +517,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > a, b = items E TypeError: 'int' object is not iterable - failure_demo.py:221: TypeError + failure_demo.py:222: TypeError ______________________ TestMoreErrors.test_startswith ______________________ self = @@ -530,7 +530,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E + where False = ('456') E + where = '123'.startswith - failure_demo.py:226: AssertionError + failure_demo.py:227: AssertionError __________________ TestMoreErrors.test_startswith_nested ___________________ self = @@ -549,7 +549,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E + where '123' = .f at 0xdeadbeef>() E + and '456' = .g at 0xdeadbeef>() - failure_demo.py:235: AssertionError + failure_demo.py:236: AssertionError _____________________ TestMoreErrors.test_global_func ______________________ self = @@ -560,7 +560,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E + where False = isinstance(43, float) E + where 43 = globf(42) - failure_demo.py:238: AssertionError + failure_demo.py:239: AssertionError _______________________ TestMoreErrors.test_instance _______________________ self = @@ -571,7 +571,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E assert 42 != 42 E + where 42 = .x - failure_demo.py:242: AssertionError + failure_demo.py:243: AssertionError _______________________ TestMoreErrors.test_compare ________________________ self = @@ -581,7 +581,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E assert 11 < 5 E + where 11 = globf(10) - failure_demo.py:245: AssertionError + failure_demo.py:246: AssertionError _____________________ TestMoreErrors.test_try_finally ______________________ self = @@ -592,7 +592,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert x == 0 E assert 1 == 0 - failure_demo.py:250: AssertionError + failure_demo.py:251: AssertionError ___________________ TestCustomAssertMsg.test_single_line ___________________ self = @@ -607,7 +607,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E assert 1 == 2 E + where 1 = .A'>.a - failure_demo.py:261: AssertionError + failure_demo.py:262: AssertionError ____________________ TestCustomAssertMsg.test_multiline ____________________ self = @@ -626,7 +626,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: E assert 1 == 2 E + where 1 = .A'>.a - failure_demo.py:268: AssertionError + failure_demo.py:269: AssertionError ___________________ TestCustomAssertMsg.test_custom_repr ___________________ self = @@ -648,5 +648,5 @@ Here is a nice run of several failures and how ``pytest`` presents things: E assert 1 == 2 E + where 1 = This is JSON\n{\n 'foo': 'bar'\n}.a - failure_demo.py:281: AssertionError + failure_demo.py:282: AssertionError ======================== 44 failed in 0.12 seconds ========================= diff --git a/doc/en/warnings.rst b/doc/en/warnings.rst index dd10d94f4..8f8d6f3e1 100644 --- a/doc/en/warnings.rst +++ b/doc/en/warnings.rst @@ -400,7 +400,7 @@ defines an ``__init__`` constructor, as this prevents the class from being insta ============================= warnings summary ============================= test_pytest_warnings.py:1 - $REGENDOC_TMPDIR/test_pytest_warnings.py:1: PytestCollectionWarning: cannot collect test class 'Test' because it has a __init__ constructor + $REGENDOC_TMPDIR/test_pytest_warnings.py:1: PytestCollectionWarning: cannot collect test class 'Test' because it has a __init__ constructor (from: test_pytest_warnings.py) class Test: -- Docs: https://docs.pytest.org/en/latest/warnings.html