Pytest

Latest version: v8.2.0

Safety actively analyzes 630217 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 23 of 33

2.9.1

==================

**Bug Fixes**

* Improve error message when a plugin fails to load.
Thanks :user:`nicoddemus` for the PR.

* Fix (:issue:`1178`):
``pytest.fail`` with non-ascii characters raises an internal pytest error.
Thanks :user:`nicoddemus` for the PR.

* Fix (:issue:`469`): junit parses report.nodeid incorrectly, when params IDs
contain ``::``. Thanks :user:`tomviner` for the PR (:pull:`1431`).

* Fix (:issue:`578`): SyntaxErrors
containing non-ascii lines at the point of failure generated an internal
py.test error.
Thanks :user:`asottile` for the report and :user:`nicoddemus` for the PR.

* Fix (:issue:`1437`): When passing in a bytestring regex pattern to parameterize
attempt to decode it as utf-8 ignoring errors.

* Fix (:issue:`649`): parametrized test nodes cannot be specified to run on the command line.

* Fix (:issue:`138`): better reporting for python 3.3+ chained exceptions

2.9.0

==================

**New Features**

* New ``pytest.mark.skip`` mark, which unconditionally skips marked tests.
Thanks :user:`MichaelAquilina` for the complete PR (:pull:`1040`).

* ``--doctest-glob`` may now be passed multiple times in the command-line.
Thanks :user:`jab` and :user:`nicoddemus` for the PR.

* New ``-rp`` and ``-rP`` reporting options give the summary and full output
of passing tests, respectively. Thanks to :user:`codewarrior0` for the PR.

* ``pytest.mark.xfail`` now has a ``strict`` option, which makes ``XPASS``
tests to fail the test suite (defaulting to ``False``). There's also a
``xfail_strict`` ini option that can be used to configure it project-wise.
Thanks :user:`rabbbit` for the request and :user:`nicoddemus` for the PR (:pull:`1355`).

* ``Parser.addini`` now supports options of type ``bool``.
Thanks :user:`nicoddemus` for the PR.

* New ``ALLOW_BYTES`` doctest option. This strips ``b`` prefixes from byte strings
in doctest output (similar to ``ALLOW_UNICODE``).
Thanks :user:`jaraco` for the request and :user:`nicoddemus` for the PR (:pull:`1287`).

* Give a hint on ``KeyboardInterrupt`` to use the ``--fulltrace`` option to show the errors.
Fixes :issue:`1366`.
Thanks to :user:`hpk42` for the report and :user:`RonnyPfannschmidt` for the PR.

* Catch ``IndexError`` exceptions when getting exception source location.
Fixes a pytest internal error for dynamically generated code (fixtures and tests)
where source lines are fake by intention.

**Changes**

* **Important**: `py.code <https://pylib.readthedocs.io/en/stable/code.html>`_ has been
merged into the ``pytest`` repository as ``pytest._code``. This decision
was made because ``py.code`` had very few uses outside ``pytest`` and the
fact that it was in a different repository made it difficult to fix bugs on
its code in a timely manner. The team hopes with this to be able to better
refactor out and improve that code.
This change shouldn't affect users, but it is useful to let users aware
if they encounter any strange behavior.

Keep in mind that the code for ``pytest._code`` is **private** and
**experimental**, so you definitely should not import it explicitly!

Please note that the original ``py.code`` is still available in
`pylib <https://pylib.readthedocs.io>`_.

* ``pytest_enter_pdb`` now optionally receives the pytest config object.
Thanks :user:`nicoddemus` for the PR.

* Removed code and documentation for Python 2.5 or lower versions,
including removal of the obsolete ``_pytest.assertion.oldinterpret`` module.
Thanks :user:`nicoddemus` for the PR (:pull:`1226`).

* Comparisons now always show up in full when ``CI`` or ``BUILD_NUMBER`` is
found in the environment, even when ``-vv`` isn't used.
Thanks :user:`The-Compiler` for the PR.

* ``--lf`` and ``--ff`` now support long names: ``--last-failed`` and
``--failed-first`` respectively.
Thanks :user:`MichaelAquilina` for the PR.

* Added expected exceptions to ``pytest.raises`` fail message.

* Collection only displays progress ("collecting X items") when in a terminal.
This avoids cluttering the output when using ``--color=yes`` to obtain
colors in CI integrations systems (:issue:`1397`).

**Bug Fixes**

* The ``-s`` and ``-c`` options should now work under ``xdist``;
``Config.fromdictargs`` now represents its input much more faithfully.
Thanks to :user:`bukzor` for the complete PR (:issue:`680`).

* Fix (:issue:`1290`): support Python 3.5's ` operator in assertion rewriting.
Thanks :user:`Shinkenjoe` for report with test case and :user:`tomviner` for the PR.

* Fix formatting utf-8 explanation messages (:issue:`1379`).
Thanks :user:`biern` for the PR.

* Fix :ref:`traceback style docs <how-to-modifying-python-tb-printing>` to describe all of the available options
(auto/long/short/line/native/no), with ``auto`` being the default since v2.6.
Thanks :user:`hackebrot` for the PR.

* Fix (:issue:`1422`): junit record_xml_property doesn't allow multiple records
with same name.

2.8.7

==================

- fix 1338: use predictable object resolution for monkeypatch

2.8.6

==================

- fix 1259: allow for double nodeids in junitxml,
this was a regression failing plugins combinations
like pytest-pep8 + pytest-flakes

- Workaround for exception that occurs in pyreadline when using
``--pdb`` with standard I/O capture enabled.
Thanks Erik M. Bray for the PR.

- fix 900: Better error message in case the target of a ``monkeypatch`` call
raises an ``ImportError``.

- fix 1292: monkeypatch calls (setattr, setenv, etc.) are now O(1).
Thanks David R. MacIver for the report and Bruno Oliveira for the PR.

- fix 1223: captured stdout and stderr are now properly displayed before
entering pdb when ``--pdb`` is used instead of being thrown away.
Thanks Cal Leeming for the PR.

- fix 1305: pytest warnings emitted during ``pytest_terminal_summary`` are now
properly displayed.
Thanks Ionel Maries Cristian for the report and Bruno Oliveira for the PR.

- fix 628: fixed internal UnicodeDecodeError when doctests contain unicode.
Thanks Jason R. Coombs for the report and Bruno Oliveira for the PR.

- fix 1334: Add captured stdout to jUnit XML report on setup error.
Thanks Georgy Dyuldin for the PR.

2.8.5

==================

- fix 1243: fixed issue where class attributes injected during collection could break pytest.
PR by Alexei Kozlenok, thanks Ronny Pfannschmidt and Bruno Oliveira for the review and help.

- fix 1074: precompute junitxml chunks instead of storing the whole tree in objects
Thanks Bruno Oliveira for the report and Ronny Pfannschmidt for the PR

- fix 1238: fix ``pytest.deprecated_call()`` receiving multiple arguments
(Regression introduced in 2.8.4). Thanks Alex Gaynor for the report and
Bruno Oliveira for the PR.

2.8.4

==================

- fix 1190: ``deprecated_call()`` now works when the deprecated
function has been already called by another test in the same
module. Thanks Mikhail Chernykh for the report and Bruno Oliveira for the
PR.

- fix 1198: ``--pastebin`` option now works on Python 3. Thanks
Mehdy Khoshnoody for the PR.

- fix 1219: ``--pastebin`` now works correctly when captured output contains
non-ascii characters. Thanks Bruno Oliveira for the PR.

- fix 1204: another error when collecting with a nasty __getattr__().
Thanks Florian Bruhin for the PR.

- fix the summary printed when no tests did run.
Thanks Florian Bruhin for the PR.
- fix 1185 - ensure MANIFEST.in exactly matches what should go to a sdist

- a number of documentation modernizations wrt good practices.
Thanks Bruno Oliveira for the PR.

Page 23 of 33

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.