Pytest

Latest version: v8.2.0

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

Scan your dependencies

Page 17 of 33

3.7.3

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

Bug Fixes
---------

- :issue:`3033`: Fixtures during teardown can again use ``capsys`` and ``capfd`` to inspect output captured during tests.


- :issue:`3773`: Fix collection of tests from ``__init__.py`` files if they match the ``python_files`` configuration option.


- :issue:`3796`: Fix issue where teardown of fixtures of consecutive sub-packages were executed once, at the end of the outer
package.


- :issue:`3816`: Fix bug where ``--show-capture=no`` option would still show logs printed during fixture teardown.


- :issue:`3819`: Fix ``stdout/stderr`` not getting captured when real-time cli logging is active.


- :issue:`3843`: Fix collection error when specifying test functions directly in the command line using ``test.py::test`` syntax together with ``--doctest-modules``.


- :issue:`3848`: Fix bugs where unicode arguments could not be passed to ``testdir.runpytest`` on Python 2.


- :issue:`3854`: Fix double collection of tests within packages when the filename starts with a capital letter.



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

- :issue:`3824`: Added example for multiple glob pattern matches in ``python_files``.


- :issue:`3833`: Added missing docs for ``pytester.Testdir``.


- :issue:`3870`: Correct documentation for setuptools integration.



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

- :issue:`3826`: Replace broken type annotations with type comments.


- :issue:`3845`: Remove a reference to issue :issue:`568` from the documentation, which has since been
fixed.

3.7.2

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

Bug Fixes
---------

- :issue:`3671`: Fix ``filterwarnings`` not being registered as a builtin mark.


- :issue:`3768`, :issue:`3789`: Fix test collection from packages mixed with normal directories.


- :issue:`3771`: Fix infinite recursion during collection if a ``pytest_ignore_collect`` hook returns ``False`` instead of ``None``.


- :issue:`3774`: Fix bug where decorated fixtures would lose functionality (for example ``mock.patch``).


- :issue:`3775`: Fix bug where importing modules or other objects with prefix ``pytest_`` prefix would raise a ``PluginValidationError``.


- :issue:`3788`: Fix ``AttributeError`` during teardown of ``TestCase`` subclasses which raise an exception during ``__init__``.


- :issue:`3804`: Fix traceback reporting for exceptions with ``__cause__`` cycles.



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

- :issue:`3746`: Add documentation for ``metafunc.config`` that had been mistakenly hidden.

3.7.1

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

Bug Fixes
---------

- :issue:`3473`: Raise immediately if ``approx()`` is given an expected value of a type it doesn't understand (e.g. strings, nested dicts, etc.).


- :issue:`3712`: Correctly represent the dimensions of a numpy array when calling ``repr()`` on ``approx()``.

- :issue:`3742`: Fix incompatibility with third party plugins during collection, which produced the error ``object has no attribute '_collectfile'``.

- :issue:`3745`: Display the absolute path if ``cache_dir`` is not relative to the ``rootdir`` instead of failing.


- :issue:`3747`: Fix compatibility problem with plugins and the warning code issued by fixture functions when they are called directly.


- :issue:`3748`: Fix infinite recursion in ``pytest.approx`` with arrays in ``numpy<1.13``.


- :issue:`3757`: Pin pathlib2 to ``>=2.2.0`` as we require ``__fspath__`` support.


- :issue:`3763`: Fix ``TypeError`` when the assertion message is ``bytes`` in python 3.

3.7.0

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

Deprecations and Removals
-------------------------

- :issue:`2639`: ``pytest_namespace`` has been :ref:`deprecated <pytest.namespace deprecated>`.


- :issue:`3661`: Calling a fixture function directly, as opposed to request them in a test function, now issues a ``RemovedInPytest4Warning``. See :ref:`the documentation for rationale and examples <calling fixtures directly deprecated>`.



Features
--------

- :issue:`2283`: New ``package`` fixture scope: fixtures are finalized when the last test of a *package* finishes. This feature is considered **experimental**, so use it sparingly.


- :issue:`3576`: ``Node.add_marker`` now supports an ``append=True/False`` parameter to determine whether the mark comes last (default) or first.


- :issue:`3579`: Fixture ``caplog`` now has a ``messages`` property, providing convenient access to the format-interpolated log messages without the extra data provided by the formatter/handler.


- :issue:`3610`: New ``--trace`` option to enter the debugger at the start of a test.


- :issue:`3623`: Introduce ``pytester.copy_example`` as helper to do acceptance tests against examples from the project.



Bug Fixes
---------

- :issue:`2220`: Fix a bug where fixtures overridden by direct parameters (for example parametrization) were being instantiated even if they were not being used by a test.


- :issue:`3695`: Fix ``ApproxNumpy`` initialisation argument mixup, ``abs`` and ``rel`` tolerances were flipped causing strange comparison results.
Add tests to check ``abs`` and ``rel`` tolerances for ``np.array`` and test for expecting ``nan`` with ``np.array()``


- :issue:`980`: Fix truncated locals output in verbose mode.



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

- :issue:`3295`: Correct the usage documentation of ``--last-failed-no-failures`` by adding the missing ``--last-failed`` argument in the presented examples, because they are misleading and lead to think that the missing argument is not needed.



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

- :issue:`3519`: Now a ``README.md`` file is created in ``.pytest_cache`` to make it clear why the directory exists.

3.6.4

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

Bug Fixes
---------

- Invoke pytest using ``-mpytest`` so ``sys.path`` does not get polluted by packages installed in ``site-packages``. (:issue:`742`)


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

- Use ``smtp_connection`` instead of ``smtp`` in fixtures documentation to avoid possible confusion. (:issue:`3592`)


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

- Remove obsolete ``__future__`` imports. (:issue:`2319`)

- Add CITATION to provide information on how to formally cite pytest. (:issue:`3402`)

- Replace broken type annotations with type comments. (:issue:`3635`)

- Pin ``pluggy`` to ``<0.8``. (:issue:`3727`)

3.6.3

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

Bug Fixes
---------

- Fix ``ImportWarning`` triggered by explicit relative imports in
assertion-rewritten package modules. (:issue:`3061`)

- Fix error in ``pytest.approx`` when dealing with 0-dimension numpy
arrays. (:issue:`3593`)

- No longer raise ``ValueError`` when using the ``get_marker`` API. (:issue:`3605`)

- Fix problem where log messages with non-ascii characters would not
appear in the output log file.
(:issue:`3630`)

- No longer raise ``AttributeError`` when legacy marks can't be stored in
functions. (:issue:`3631`)


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

- The description above the example for ``pytest.mark.skipif`` now better
matches the code. (:issue:`3611`)


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

- Internal refactoring: removed unused ``CallSpec2tox ._globalid_args``
attribute and ``metafunc`` parameter from ``CallSpec2.copy()``. (:issue:`3598`)

- Silence usage of ``reduce`` warning in Python 2 (:issue:`3609`)

- Fix usage of ``attr.ib`` deprecated ``convert`` parameter. (:issue:`3653`)

Page 17 of 33

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.