Skip to content

Commit

Permalink
Merge branch 'main' into py312-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
bluetech authored May 23, 2023
2 parents 8d44278 + 9e491f4 commit 8d22df0
Show file tree
Hide file tree
Showing 56 changed files with 1,019 additions and 370 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: close needs-information issues
on:
schedule:
- cron: "30 1 * * *"
workflow_dispatch:

jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/stale@v8
with:
debug-only: false
days-before-issue-stale: 14
days-before-issue-close: 7
only-labels: "status: needs information"
stale-issue-label: "stale"
stale-issue-message: "This issue is stale because it has been open for 14 days with no activity."
close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale."
days-before-pr-stale: -1
days-before-pr-close: -1
10 changes: 4 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
default_language_version:
python: "3.10"
repos:
- repo: https://github.com/psf/black
rev: 23.3.0
Expand All @@ -23,7 +21,7 @@ repos:
exclude: _pytest/(debugging|hookspec).py
language_version: python3
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.2
rev: v2.1.1
hooks:
- id: autoflake
name: autoflake
Expand All @@ -38,13 +36,13 @@ repos:
additional_dependencies:
- flake8-typing-imports==1.12.0
- flake8-docstrings==1.5.0
- repo: https://github.com/asottile/reorder_python_imports
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.9.0
hooks:
- id: reorder-python-imports
args: ['--application-directories=.:src', --py37-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.4.0
hooks:
- id: pyupgrade
args: [--py37-plus]
Expand All @@ -58,7 +56,7 @@ repos:
hooks:
- id: python-use-type-annotations
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.2.0
rev: v1.3.0
hooks:
- id: mypy
files: ^(src/|testing/)
Expand Down
5 changes: 5 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ Abdeali JK
Abdelrahman Elbehery
Abhijeet Kasurde
Adam Johnson
Adam Stewart
Adam Uhlir
Ahn Ki-Wook
Akiomi Kamakura
Alan Velasco
Alessio Izzo
Alex Jones
Alex Lambson
Alexander Johnson
Alexander King
Alexei Kozlenok
Expand Down Expand Up @@ -55,6 +58,7 @@ Benjamin Peterson
Bernard Pratz
Bob Ippolito
Brian Dorsey
Brian Larsen
Brian Maissy
Brian Okken
Brianna Laugher
Expand Down Expand Up @@ -304,6 +308,7 @@ Rafal Semik
Raquel Alegre
Ravi Chandra
Robert Holt
Roberto Aldera
Roberto Polli
Roland Puntaier
Romain Dorgueil
Expand Down
1 change: 1 addition & 0 deletions changelog/10169.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug where very long option names could cause pytest to break with ``OSError: [Errno 36] File name too long`` on some systems.
1 change: 1 addition & 0 deletions changelog/10831.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Terminal Reporting: Fixed bug when running in ``--tb=line`` mode where ``pytest.fail(pytrace=False)`` tests report ``None``.
1 change: 1 addition & 0 deletions changelog/10872.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update test log report annotation to named tuple and fixed inconsistency in docs for :hook:`pytest_report_teststatus` hook.
2 changes: 2 additions & 0 deletions changelog/10901.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Added :func:`ExceptionInfo.from_exception() <pytest.ExceptionInfo.from_exception>`, a simpler way to create an :class:`~pytest.ExceptionInfo` from an exception.
This can replace :func:`ExceptionInfo.from_exc_info() <pytest.ExceptionInfo.from_exc_info()>` for most uses.
5 changes: 5 additions & 0 deletions changelog/10907.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
When an exception traceback to be displayed is completely filtered out (by mechanisms such as ``__tracebackhide__``, internal frames, and similar), now only the exception string and the following message are shown:

"All traceback entries are hidden. Pass `--full-trace` to see hidden and internal frames.".

Previously, the last frame of the traceback was shown, even though it was hidden.
3 changes: 3 additions & 0 deletions changelog/10940.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Improved verbose output (``-vv``) of ``skip`` and ``xfail`` reasons by performing text wrapping while leaving a clear margin for progress output.

Added :func:`TerminalReporter.wrap_write() <pytest.TerminalReporter.wrap_write>` as a helper for that.
1 change: 1 addition & 0 deletions changelog/10987.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:confval:`testpaths` is now honored to load root ``conftests``.
1 change: 1 addition & 0 deletions changelog/10999.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The `monkeypatch` `setitem`/`delitem` type annotations now allow `TypedDict` arguments.
1 change: 1 addition & 0 deletions changelog/11005.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added underlying exception to cache provider path creation and write warning messages.
3 changes: 3 additions & 0 deletions changelog/8711.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:func:`_pytest.logging.LogCaptureFixture.set_level` and :func:`_pytest.logging.LogCaptureFixture.at_level`
will temporarily enable the requested ``level`` if ``level`` was disabled globally via
``logging.disable(LEVEL)``.
1 change: 1 addition & 0 deletions doc/en/announce/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Release announcements
:maxdepth: 2


release-7.3.1
release-7.3.0
release-7.2.2
release-7.2.1
Expand Down
18 changes: 18 additions & 0 deletions doc/en/announce/release-7.3.1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
pytest-7.3.1
=======================================

pytest 7.3.1 has just been released to PyPI.

This is a bug-fix release, being a drop-in replacement. To upgrade::

pip install --upgrade pytest

The full changelog is available at https://docs.pytest.org/en/stable/changelog.html.

Thanks to all of the contributors to this release:

* Ran Benita


Happy testing,
The pytest Development Team
2 changes: 2 additions & 0 deletions doc/en/backwards-compatibility.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,5 @@ pytest version min. Python version
5.0 - 6.1 3.5+
3.3 - 4.6 2.7, 3.4+
============== ===================

`Status of Python Versions <https://devguide.python.org/versions/>`__.
28 changes: 26 additions & 2 deletions doc/en/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,29 @@ with advance notice in the **Deprecations** section of releases.

.. towncrier release notes start
pytest 7.3.1 (2023-04-14)
=========================

Improvements
------------

- `#10875 <https://github.com/pytest-dev/pytest/issues/10875>`_: Python 3.12 support: fixed ``RuntimeError: TestResult has no addDuration method`` when running ``unittest`` tests.


- `#10890 <https://github.com/pytest-dev/pytest/issues/10890>`_: Python 3.12 support: fixed ``shutil.rmtree(onerror=...)`` deprecation warning when using :fixture:`tmp_path`.



Bug Fixes
---------

- `#10896 <https://github.com/pytest-dev/pytest/issues/10896>`_: Fixed performance regression related to :fixture:`tmp_path` and the new :confval:`tmp_path_retention_policy` option.


- `#10903 <https://github.com/pytest-dev/pytest/issues/10903>`_: Fix crash ``INTERNALERROR IndexError: list index out of range`` which happens when displaying an exception where all entries are hidden.
This reverts the change "Correctly handle ``__tracebackhide__`` for chained exceptions." introduced in version 7.3.0.


pytest 7.3.0 (2023-04-08)
=========================

Expand Down Expand Up @@ -82,6 +105,7 @@ Bug Fixes


- `#1904 <https://github.com/pytest-dev/pytest/issues/1904>`_: Correctly handle ``__tracebackhide__`` for chained exceptions.
NOTE: This change was reverted in version 7.3.1.



Expand Down Expand Up @@ -543,7 +567,7 @@ Breaking Changes
- `#7259 <https://github.com/pytest-dev/pytest/issues/7259>`_: The :ref:`Node.reportinfo() <non-python tests>` function first return value type has been expanded from `py.path.local | str` to `os.PathLike[str] | str`.

Most plugins which refer to `reportinfo()` only define it as part of a custom :class:`pytest.Item` implementation.
Since `py.path.local` is a `os.PathLike[str]`, these plugins are unaffacted.
Since `py.path.local` is an `os.PathLike[str]`, these plugins are unaffacted.

Plugins and users which call `reportinfo()`, use the first return value and interact with it as a `py.path.local`, would need to adjust by calling `py.path.local(fspath)`.
Although preferably, avoid the legacy `py.path.local` and use `pathlib.Path`, or use `item.location` or `item.path`, instead.
Expand Down Expand Up @@ -4043,7 +4067,7 @@ Removals
See our :ref:`docs <calling fixtures directly deprecated>` on information on how to update your code.


- :issue:`4546`: Remove ``Node.get_marker(name)`` the return value was not usable for more than a existence check.
- :issue:`4546`: Remove ``Node.get_marker(name)`` the return value was not usable for more than an existence check.

Use ``Node.get_closest_marker(name)`` as a replacement.

Expand Down
2 changes: 1 addition & 1 deletion doc/en/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@
# The scheme of the identifier. Typical schemes are ISBN or URL.
# epub_scheme = ''

# The unique identifier of the text. This can be a ISBN number
# The unique identifier of the text. This can be an ISBN number
# or the project homepage.
# epub_identifier = ''

Expand Down
17 changes: 17 additions & 0 deletions doc/en/explanation/goodpractices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,20 @@ See also `pypa/setuptools#1684 <https://github.com/pypa/setuptools/issues/1684>`

setuptools intends to
`remove the test command <https://github.com/pypa/setuptools/issues/931>`_.

Checking with flake8-pytest-style
---------------------------------

In order to ensure that pytest is being used correctly in your project,
it can be helpful to use the `flake8-pytest-style <https://github.com/m-burst/flake8-pytest-style>`_ flake8 plugin.

flake8-pytest-style checks for common mistakes and coding style violations in pytest code,
such as incorrect use of fixtures, test function names, and markers.
By using this plugin, you can catch these errors early in the development process
and ensure that your pytest code is consistent and easy to maintain.

A list of the lints detected by flake8-pytest-style can be found on its `PyPI page <https://pypi.org/project/flake8-pytest-style/>`_.

.. note::

flake8-pytest-style is not an official pytest project. Some of the rules enforce certain style choices, such as using `@pytest.fixture()` over `@pytest.fixture`, but you can configure the plugin to fit your preferred style.
2 changes: 1 addition & 1 deletion doc/en/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Install ``pytest``
.. code-block:: bash
$ pytest --version
pytest 7.3.0
pytest 7.3.1
.. _`simpletest`:

Expand Down
3 changes: 2 additions & 1 deletion doc/en/how-to/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ Pytest supports several ways to run and select tests from the command-line.

.. code-block:: bash
pytest -k "MyClass and not method"
pytest -k 'MyClass and not method'
This will run tests which contain names that match the given *string expression* (case-insensitive),
which can include Python operators that use filenames, class names and function names as variables.
The example above will run ``TestMyClass.test_something`` but not ``TestMyClass.test_method_simple``.
Use ``""`` instead of ``''`` in expression when running this on Windows

.. _nodeids:

Expand Down
7 changes: 3 additions & 4 deletions doc/en/index.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
:orphan:

..
.. sidebar:: Next Open Trainings
.. sidebar:: Next Open Trainings

- `Professional Testing with Python <https://python-academy.com/courses/python_course_testing.html>`_, via `Python Academy <https://www.python-academy.com/>`_, March 7th to 9th 2023 (3 day in-depth training), Remote
- `Professional Testing with Python <https://python-academy.com/courses/python_course_testing.html>`_, via `Python Academy <https://www.python-academy.com/>`_, March 5th to 7th 2024 (3 day in-depth training), Leipzig/Remote

Also see :doc:`previous talks and blogposts <talks>`.
Also see :doc:`previous talks and blogposts <talks>`.

.. _features:

Expand Down
Loading

0 comments on commit 8d22df0

Please sign in to comment.