Pytest

Latest version: v8.2.0

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

Scan your dependencies

Page 15 of 33

4.0.1

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

Bug Fixes
---------

- :issue:`3952`: Display warnings before "short test summary info" again, but still later warnings in the end.


- :issue:`4386`: Handle uninitialized exceptioninfo in repr/str.


- :issue:`4393`: Do not create ``.gitignore``/``README.md`` files in existing cache directories.


- :issue:`4400`: Rearrange warning handling for the yield test errors so the opt-out in 4.0.x correctly works.


- :issue:`4405`: Fix collection of testpaths with ``--pyargs``.


- :issue:`4412`: Fix assertion rewriting involving ``Starred`` + side-effects.


- :issue:`4425`: Ensure we resolve the absolute path when the given ``--basetemp`` is a relative path.



Trivial/Internal Changes
------------------------

- :issue:`4315`: Use ``pkg_resources.parse_version`` instead of ``LooseVersion`` in minversion check.


- :issue:`4440`: Adjust the stack level of some internal pytest warnings.

4.0.0

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

Removals
--------

- :issue:`3737`: **RemovedInPytest4Warnings are now errors by default.**

Following our plan to remove deprecated features with as little disruption as
possible, all warnings of type ``RemovedInPytest4Warnings`` now generate errors
instead of warning messages.

**The affected features will be effectively removed in pytest 4.1**, so please consult the
:std:doc:`deprecations` section in the docs for directions on how to update existing code.

In the pytest ``4.0.X`` series, it is possible to change the errors back into warnings as a stop
gap measure by adding this to your ``pytest.ini`` file:

.. code-block:: ini

[pytest]
filterwarnings =
ignore::pytest.RemovedInPytest4Warning

But this will stop working when pytest ``4.1`` is released.

**If you have concerns** about the removal of a specific feature, please add a
comment to :issue:`4348`.


- :issue:`4358`: Remove the ``::()`` notation to denote a test class instance in node ids.

Previously, node ids that contain test instances would use ``::()`` to denote the instance like this::

test_foo.py::Test::()::test_bar

The extra ``::()`` was puzzling to most users and has been removed, so that the test id becomes now::

test_foo.py::Test::test_bar

This change could not accompany a deprecation period as is usual when user-facing functionality changes because
it was not really possible to detect when the functionality was being used explicitly.

The extra ``::()`` might have been removed in some places internally already,
which then led to confusion in places where it was expected, e.g. with
``--deselect`` (:issue:`4127`).

Test class instances are also not listed with ``--collect-only`` anymore.



Features
--------

- :issue:`4270`: The ``cache_dir`` option uses ``$TOX_ENV_DIR`` as prefix (if set in the environment).

This uses a different cache per tox environment by default.



Bug Fixes
---------

- :issue:`3554`: Fix ``CallInfo.__repr__`` for when the call is not finished yet.

3.10.1

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

Bug Fixes
---------

- :issue:`4287`: Fix nested usage of debugging plugin (pdb), e.g. with pytester's ``testdir.runpytest``.


- :issue:`4304`: Block the ``stepwise`` plugin if ``cacheprovider`` is also blocked, as one depends on the other.


- :issue:`4306`: Parse ``minversion`` as an actual version and not as dot-separated strings.


- :issue:`4310`: Fix duplicate collection due to multiple args matching the same packages.


- :issue:`4321`: Fix ``item.nodeid`` with resolved symlinks.


- :issue:`4325`: Fix collection of direct symlinked files, where the target does not match ``python_files``.


- :issue:`4329`: Fix TypeError in report_collect with _collect_report_last_write.



Trivial/Internal Changes
------------------------

- :issue:`4305`: Replace byte/unicode helpers in test_capture with python level syntax.

3.10.0

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

Features
--------

- :issue:`2619`: Resume capturing output after ``continue`` with ``__import__("pdb").set_trace()``.

This also adds a new ``pytest_leave_pdb`` hook, and passes in ``pdb`` to the
existing ``pytest_enter_pdb`` hook.


- :issue:`4147`: Add ``--sw``, ``--stepwise`` as an alternative to ``--lf -x`` for stopping at the first failure, but starting the next test invocation from that test. See :ref:`the documentation <cache stepwise>` for more info.


- :issue:`4188`: Make ``--color`` emit colorful dots when not running in verbose mode. Earlier, it would only colorize the test-by-test output if ``--verbose`` was also passed.


- :issue:`4225`: Improve performance with collection reporting in non-quiet mode with terminals.

The "collecting …" message is only printed/updated every 0.5s.



Bug Fixes
---------

- :issue:`2701`: Fix false ``RemovedInPytest4Warning: usage of Session... is deprecated, please use pytest`` warnings.


- :issue:`4046`: Fix problems with running tests in package ``__init__.py`` files.


- :issue:`4260`: Swallow warnings during anonymous compilation of source.


- :issue:`4262`: Fix access denied error when deleting stale directories created by ``tmpdir`` / ``tmp_path``.


- :issue:`611`: Naming a fixture ``request`` will now raise a warning: the ``request`` fixture is internal and
should not be overwritten as it will lead to internal errors.

- :issue:`4266`: Handle (ignore) exceptions raised during collection, e.g. with Django's LazySettings proxy class.



Improved Documentation
----------------------

- :issue:`4255`: Added missing documentation about the fact that module names passed to filter warnings are not regex-escaped.



Trivial/Internal Changes
------------------------

- :issue:`4272`: Display cachedir also in non-verbose mode if non-default.


- :issue:`4277`: pdb: improve message about output capturing with ``set_trace``.

Do not display "IO-capturing turned off/on" when ``-s`` is used to avoid
confusion.


- :issue:`4279`: Improve message and stack level of warnings issued by ``monkeypatch.setenv`` when the value of the environment variable is not a ``str``.

3.9.3

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

Bug Fixes
---------

- :issue:`4174`: Fix "ValueError: Plugin already registered" with conftest plugins via symlink.


- :issue:`4181`: Handle race condition between creation and deletion of temporary folders.


- :issue:`4221`: Fix bug where the warning summary at the end of the test session was not showing the test where the warning was originated.


- :issue:`4243`: Fix regression when ``stacklevel`` for warnings was passed as positional argument on python2.



Improved Documentation
----------------------

- :issue:`3851`: Add reference to ``empty_parameter_set_mark`` ini option in documentation of ``pytest.mark.parametrize``



Trivial/Internal Changes
------------------------

- :issue:`4028`: Revert patching of ``sys.breakpointhook`` since it appears to do nothing.


- :issue:`4233`: Apply an import sorter (``reorder-python-imports``) to the codebase.


- :issue:`4248`: Remove use of unnecessary compat shim, six.binary_type

3.9.2

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

Bug Fixes
---------

- :issue:`2909`: Improve error message when a recursive dependency between fixtures is detected.


- :issue:`3340`: Fix logging messages not shown in hooks ``pytest_sessionstart()`` and ``pytest_sessionfinish()``.


- :issue:`3533`: Fix unescaped XML raw objects in JUnit report for skipped tests


- :issue:`3691`: Python 2: safely format warning message about passing unicode strings to ``warnings.warn``, which may cause
surprising ``MemoryError`` exception when monkey patching ``warnings.warn`` itself.


- :issue:`4026`: Improve error message when it is not possible to determine a function's signature.


- :issue:`4177`: Pin ``setuptools>=40.0`` to support ``py_modules`` in ``setup.cfg``


- :issue:`4179`: Restore the tmpdir behaviour of symlinking the current test run.


- :issue:`4192`: Fix filename reported by ``warnings.warn`` when using ``recwarn`` under python2.

Page 15 of 33

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.