Pytest

Latest version: v8.2.2

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

Scan your dependencies

Page 22 of 33

3.0.6

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

* pytest no longer generates ``PendingDeprecationWarning`` from its own operations, which was introduced by mistake in version ``3.0.5`` (:issue:`2118`).
Thanks to :user:`nicoddemus` for the report and :user:`RonnyPfannschmidt` for the PR.


* pytest no longer recognizes coroutine functions as yield tests (:issue:`2129`).
Thanks to :user:`malinoff` for the PR.

* Plugins loaded by the ``PYTEST_PLUGINS`` environment variable are now automatically
considered for assertion rewriting (:issue:`2185`).
Thanks :user:`nicoddemus` for the PR.

* Improve error message when pytest.warns fails (:issue:`2150`). The type(s) of the
expected warnings and the list of caught warnings is added to the
error message. Thanks :user:`lesteve` for the PR.

* Fix ``pytester`` internal plugin to work correctly with latest versions of
``zope.interface`` (:issue:`1989`). Thanks :user:`nicoddemus` for the PR.

* Assert statements of the ``pytester`` plugin again benefit from assertion rewriting (:issue:`1920`).
Thanks :user:`RonnyPfannschmidt` for the report and :user:`nicoddemus` for the PR.

* Specifying tests with colons like ``test_foo.py::test_bar`` for tests in
subdirectories with ini configuration files now uses the correct ini file
(:issue:`2148`). Thanks :user:`pelme`.

* Fail ``testdir.runpytest().assert_outcomes()`` explicitly if the pytest
terminal output it relies on is missing. Thanks to :user:`eli-b` for the PR.

3.0.5

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

* Add warning when not passing ``option=value`` correctly to ``-o/--override-ini`` (:issue:`2105`).
Also improved the help documentation. Thanks to :user:`mbukatov` for the report and
:user:`lwm` for the PR.

* Now ``--confcutdir`` and ``--junit-xml`` are properly validated if they are directories
and filenames, respectively (:issue:`2089` and :issue:`2078`). Thanks to :user:`lwm` for the PR.

* Add hint to error message hinting possible missing ``__init__.py`` (:issue:`478`). Thanks :user:`DuncanBetts`.

* More accurately describe when fixture finalization occurs in documentation (:issue:`687`). Thanks :user:`DuncanBetts`.

* Provide ``:ref:`` targets for ``recwarn.rst`` so we can use intersphinx referencing.
Thanks to :user:`dupuy` for the report and :user:`lwm` for the PR.

* In Python 2, use a simple ``+-`` ASCII string in the string representation of ``pytest.approx`` (for example ``"4 +- 4.0e-06"``)
because it is brittle to handle that in different contexts and representations internally in pytest
which can result in bugs such as :issue:`2111`. In Python 3, the representation still uses ``±`` (for example ``4 ± 4.0e-06``).
Thanks :user:`kerrick-lyft` for the report and :user:`nicoddemus` for the PR.

* Using ``item.Function``, ``item.Module``, etc., is now issuing deprecation warnings, prefer
``pytest.Function``, ``pytest.Module``, etc., instead (:issue:`2034`).
Thanks :user:`nmundar` for the PR.

* Fix error message using ``approx`` with complex numbers (:issue:`2082`).
Thanks :user:`adler-j` for the report and :user:`nicoddemus` for the PR.

* Fixed false-positives warnings from assertion rewrite hook for modules imported more than
once by the ``pytest_plugins`` mechanism.
Thanks :user:`nicoddemus` for the PR.

* Remove an internal cache which could cause hooks from ``conftest.py`` files in
sub-directories to be called in other directories incorrectly (:issue:`2016`).
Thanks :user:`d-b-w` for the report and :user:`nicoddemus` for the PR.

* Remove internal code meant to support earlier Python 3 versions that produced the side effect
of leaving ``None`` in ``sys.modules`` when expressions were evaluated by pytest (for example passing a condition
as a string to ``pytest.mark.skipif``)(:issue:`2103`).
Thanks :user:`jaraco` for the report and :user:`nicoddemus` for the PR.

* Cope gracefully with a .pyc file with no matching .py file (:issue:`2038`). Thanks
:user:`nedbat`.

3.0.4

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

* Import errors when collecting test modules now display the full traceback (:issue:`1976`).
Thanks :user:`cwitty` for the report and :user:`nicoddemus` for the PR.

* Fix confusing command-line help message for custom options with two or more ``metavar`` properties (:issue:`2004`).
Thanks :user:`okulynyak` and :user:`davehunt` for the report and :user:`nicoddemus` for the PR.

* When loading plugins, import errors which contain non-ascii messages are now properly handled in Python 2 (:issue:`1998`).
Thanks :user:`nicoddemus` for the PR.

* Fixed cyclic reference when ``pytest.raises`` is used in context-manager form (:issue:`1965`). Also as a
result of this fix, ``sys.exc_info()`` is left empty in both context-manager and function call usages.
Previously, ``sys.exc_info`` would contain the exception caught by the context manager,
even when the expected exception occurred.
Thanks :user:`MSeifert04` for the report and the PR.

* Fixed false-positives warnings from assertion rewrite hook for modules that were rewritten but
were later marked explicitly by ``pytest.register_assert_rewrite``
or implicitly as a plugin (:issue:`2005`).
Thanks :user:`RonnyPfannschmidt` for the report and :user:`nicoddemus` for the PR.

* Report teardown output on test failure (:issue:`442`).
Thanks :user:`matclab` for the PR.

* Fix teardown error message in generated xUnit XML.
Thanks :user:`gdyuldin` for the PR.

* Properly handle exceptions in ``multiprocessing`` tasks (:issue:`1984`).
Thanks :user:`adborden` for the report and :user:`nicoddemus` for the PR.

* Clean up unittest TestCase objects after tests are complete (:issue:`1649`).
Thanks :user:`d-b-w` for the report and PR.

3.0.3

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

* The ``ids`` argument to ``parametrize`` again accepts ``unicode`` strings
in Python 2 (:issue:`1905`).
Thanks :user:`philpep` for the report and :user:`nicoddemus` for the PR.

* Assertions are now being rewritten for plugins in development mode
(``pip install -e``) (:issue:`1934`).
Thanks :user:`nicoddemus` for the PR.

* Fix pkg_resources import error in Jython projects (:issue:`1853`).
Thanks :user:`raquelalegre` for the PR.

* Got rid of ``AttributeError: 'Module' object has no attribute '_obj'`` exception
in Python 3 (:issue:`1944`).
Thanks :user:`axil` for the PR.

* Explain a bad scope value passed to ``fixture`` declarations or
a ``MetaFunc.parametrize()`` call.

* This version includes ``pluggy-0.4.0``, which correctly handles
``VersionConflict`` errors in plugins (:issue:`704`).
Thanks :user:`nicoddemus` for the PR.

3.0.2

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

* Improve error message when passing non-string ids to ``pytest.mark.parametrize`` (:issue:`1857`).
Thanks :user:`okken` for the report and :user:`nicoddemus` for the PR.

* Add ``buffer`` attribute to stdin stub class ``pytest.capture.DontReadFromInput``
Thanks :user:`joguSD` for the PR.

* Fix ``UnicodeEncodeError`` when string comparison with unicode has failed. (:issue:`1864`)
Thanks :user:`AiOO` for the PR.

* ``pytest_plugins`` is now handled correctly if defined as a string (as opposed as
a sequence of strings) when modules are considered for assertion rewriting.
Due to this bug, much more modules were being rewritten than necessary
if a test suite uses ``pytest_plugins`` to load internal plugins (:issue:`1888`).
Thanks :user:`jaraco` for the report and :user:`nicoddemus` for the PR (:pull:`1891`).

* Do not call tearDown and cleanups when running tests from
``unittest.TestCase`` subclasses with ``--pdb``
enabled. This allows proper post mortem debugging for all applications
which have significant logic in their tearDown machinery (:issue:`1890`). Thanks
:user:`mbyt` for the PR.

* Fix use of deprecated ``getfuncargvalue`` method in the internal doctest plugin.
Thanks :user:`ViviCoder` for the report (:issue:`1898`).

3.0.1

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

* Fix regression when ``importorskip`` is used at module level (:issue:`1822`).
Thanks :user:`jaraco` and :user:`The-Compiler` for the report and :user:`nicoddemus` for the PR.

* Fix parametrization scope when session fixtures are used in conjunction
with normal parameters in the same call (:issue:`1832`).
Thanks :user:`The-Compiler` for the report, :user:`Kingdread` and :user:`nicoddemus` for the PR.

* Fix internal error when parametrizing tests or fixtures using an empty ``ids`` argument (:issue:`1849`).
Thanks :user:`OPpuolitaival` for the report and :user:`nicoddemus` for the PR.

* Fix loader error when running ``pytest`` embedded in a zipfile.
Thanks :user:`mbachry` for the PR.


.. _release-3.0.0:

Page 22 of 33

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.