Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pytest-dev/pytest
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: pytest-dev/pytest
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7.4.x
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
Loading
Showing with 1,237 additions and 334 deletions.
  1. +47 −17 .github/workflows/deploy.yml
  2. +32 −24 .github/workflows/test.yml
  3. +4 −0 .readthedocs.yml
  4. +10 −0 AUTHORS
  5. +1 −1 CONTRIBUTING.rst
  6. +5 −7 RELEASING.rst
  7. +0 −1 changelog/10831.bugfix.rst
  8. +0 −1 changelog/10872.improvement.rst
  9. +0 −2 changelog/10901.feature.rst
  10. +0 −5 changelog/10907.improvement.rst
  11. +0 −3 changelog/10940.improvement.rst
  12. +0 −1 changelog/10991.improvement.rst
  13. +0 −1 changelog/11005.improvement.rst
  14. +0 −1 changelog/11013.improvement.rst
  15. +0 −1 changelog/11031.trivial.rst
  16. +0 −3 changelog/11043.improvement.rst
  17. +0 −1 changelog/11068.bugfix.rst
  18. +0 −7 changelog/11081.improvement.rst
  19. +0 −3 changelog/11104.bugfix.rst
  20. +1 −0 changelog/12363.doc.rst
  21. +0 −1 changelog/1904.bugfix.rst
  22. +0 −1 changelog/7781.bugfix.rst
  23. +0 −3 changelog/8711.improvement.rst
  24. +0 −1 changelog/9146.doc.rst
  25. +1 −1 changelog/README.rst
  26. +5 −0 doc/en/announce/index.rst
  27. +49 −0 doc/en/announce/release-7.4.0.rst
  28. +20 −0 doc/en/announce/release-7.4.1.rst
  29. +18 −0 doc/en/announce/release-7.4.2.rst
  30. +19 −0 doc/en/announce/release-7.4.3.rst
  31. +20 −0 doc/en/announce/release-7.4.4.rst
  32. +4 −4 doc/en/builtin.rst
  33. +174 −0 doc/en/changelog.rst
  34. +3 −0 doc/en/conf.py
  35. +1 −1 doc/en/deprecations.rst
  36. +1 −1 doc/en/example/markers.rst
  37. +1 −1 doc/en/example/nonpython/conftest.py
  38. +2 −2 doc/en/example/simple.rst
  39. +1 −1 doc/en/getting-started.rst
  40. +2 −3 doc/en/how-to/assert.rst
  41. +12 −5 doc/en/how-to/cache.rst
  42. +1 −1 doc/en/how-to/fixtures.rst
  43. +1 −1 doc/en/how-to/output.rst
  44. +4 −4 doc/en/how-to/tmp_path.rst
  45. +2 −2 doc/en/how-to/unittest.rst
  46. +2 −1 doc/en/how-to/usage.rst
  47. +5 −3 doc/en/index.rst
  48. +1 −1 doc/en/reference/customize.rst
  49. +17 −5 doc/en/reference/plugin_list.rst
  50. +91 −69 doc/en/reference/reference.rst
  51. +15 −3 scripts/prepare-release-pr.py
  52. +17 −5 scripts/update-plugin-list.py
  53. +50 −18 src/_pytest/assertion/rewrite.py
  54. +1 −1 src/_pytest/assertion/util.py
  55. +5 −1 src/_pytest/cacheprovider.py
  56. +17 −8 src/_pytest/compat.py
  57. +13 −13 src/_pytest/config/__init__.py
  58. +1 −8 src/_pytest/config/findpaths.py
  59. +20 −0 src/_pytest/doctest.py
  60. +15 −8 src/_pytest/faulthandler.py
  61. +5 −1 src/_pytest/helpconfig.py
  62. +5 −4 src/_pytest/junitxml.py
  63. +2 −0 src/_pytest/logging.py
  64. +7 −1 src/_pytest/main.py
  65. +3 −1 src/_pytest/mark/structures.py
  66. +14 −9 src/_pytest/nodes.py
  67. +1 −1 src/_pytest/outcomes.py
  68. +30 −1 src/_pytest/pathlib.py
  69. +2 −2 src/_pytest/pytester.py
  70. +12 −10 src/_pytest/python.py
  71. +13 −12 src/_pytest/python_api.py
  72. +3 −0 testing/_py/test_local.py
  73. +35 −0 testing/acceptance_test.py
  74. +9 −0 testing/conftest.py
  75. +33 −23 testing/logging/test_fixture.py
  76. +17 −0 testing/python/approx.py
  77. +1 −1 testing/python/metafunc.py
  78. +55 −0 testing/test_assertrewrite.py
  79. +23 −0 testing/test_collection.py
  80. +21 −0 testing/test_doctest.py
  81. +30 −0 testing/test_junitxml.py
  82. +31 −0 testing/test_main.py
  83. +36 −1 testing/test_mark.py
  84. +2 −1 testing/test_parseopt.py
  85. +128 −8 testing/test_pathlib.py
  86. +8 −2 testing/test_pluginmanager.py
64 changes: 47 additions & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
name: deploy

on:
push:
tags:
# These tags are protected, see:
# https://github.com/pytest-dev/pytest/settings/tag_protection
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true
default: '1.2.3'


# Set permissions at the job level.
permissions: {}

jobs:

deploy:
if: github.repository == 'pytest-dev/pytest'

package:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }}
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
@@ -29,7 +26,19 @@ jobs:
persist-credentials: false

- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v1.5
uses: hynek/build-and-inspect-python-package@v1.5.3

deploy:
if: github.repository == 'pytest-dev/pytest'
needs: [package]
runs-on: ubuntu-latest
environment: deploy
timeout-minutes: 30
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v3

- name: Download Package
uses: actions/download-artifact@v3
@@ -38,14 +47,35 @@ jobs:
path: dist

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@v1.8.5

- name: Push tag
run: |
git config user.name "pytest bot"
git config user.email "pytestbot@gmail.com"
git tag --annotate --message=v${{ github.event.inputs.version }} ${{ github.event.inputs.version }} ${{ github.sha }}
git push origin ${{ github.event.inputs.version }}
release-notes:

# todo: generate the content in the build job
# the goal being of using a github action script to push the release data
# after success instead of creating a complete python/tox env
needs: [deploy]
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
password: ${{ secrets.pypi_token }}
fetch-depth: 0
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.7"
python-version: "3.10"

- name: Install tox
run: |
56 changes: 32 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -27,7 +27,19 @@ concurrency:
permissions: {}

jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v1.5.3

build:
needs: [package]

runs-on: ${{ matrix.os }}
timeout-minutes: 45
permissions:
@@ -38,17 +50,17 @@ jobs:
matrix:
name: [
"windows-py37",
"windows-py37-pluggy",
"windows-py38",
"windows-py38-pluggy",
"windows-py39",
"windows-py310",
"windows-py311",
"windows-py312",

"ubuntu-py37",
"ubuntu-py37-pluggy",
"ubuntu-py37-freeze",
"ubuntu-py38",
"ubuntu-py38-pluggy",
"ubuntu-py39",
"ubuntu-py310",
"ubuntu-py311",
@@ -60,7 +72,6 @@ jobs:
"macos-py310",
"macos-py312",

"docs",
"doctesting",
"plugins",
]
@@ -70,15 +81,15 @@ jobs:
python: "3.7"
os: windows-latest
tox_env: "py37-numpy"
- name: "windows-py37-pluggy"
python: "3.7"
os: windows-latest
tox_env: "py37-pluggymain-pylib-xdist"
- name: "windows-py38"
python: "3.8"
os: windows-latest
tox_env: "py38-unittestextras"
use_coverage: true
- name: "windows-py38-pluggy"
python: "3.8"
os: windows-latest
tox_env: "py38-pluggymain-pylib-xdist"
- name: "windows-py39"
python: "3.9"
os: windows-latest
@@ -101,10 +112,6 @@ jobs:
os: ubuntu-latest
tox_env: "py37-lsof-numpy-pexpect"
use_coverage: true
- name: "ubuntu-py37-pluggy"
python: "3.7"
os: ubuntu-latest
tox_env: "py37-pluggymain-pylib-xdist"
- name: "ubuntu-py37-freeze"
python: "3.7"
os: ubuntu-latest
@@ -113,6 +120,10 @@ jobs:
python: "3.8"
os: ubuntu-latest
tox_env: "py38-xdist"
- name: "ubuntu-py38-pluggy"
python: "3.8"
os: ubuntu-latest
tox_env: "py38-pluggymain-pylib-xdist"
- name: "ubuntu-py39"
python: "3.9"
os: ubuntu-latest
@@ -159,10 +170,6 @@ jobs:
os: ubuntu-latest
tox_env: "plugins"

- name: "docs"
python: "3.7"
os: ubuntu-latest
tox_env: "docs"
- name: "doctesting"
python: "3.7"
os: ubuntu-latest
@@ -175,6 +182,12 @@ jobs:
fetch-depth: 0
persist-credentials: false

- name: Download Package
uses: actions/download-artifact@v3
with:
name: Packages
path: dist

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
@@ -188,11 +201,13 @@ jobs:
- name: Test without coverage
if: "! matrix.use_coverage"
run: "tox -e ${{ matrix.tox_env }}"
shell: bash
run: tox run -e ${{ matrix.tox_env }} --installpkg `find dist/*.tar.gz`

- name: Test with coverage
if: "matrix.use_coverage"
run: "tox -e ${{ matrix.tox_env }}-coverage"
shell: bash
run: tox run -e ${{ matrix.tox_env }}-coverage --installpkg `find dist/*.tar.gz`

- name: Generate coverage report
if: "matrix.use_coverage"
@@ -206,10 +221,3 @@ jobs:
fail_ci_if_error: true
files: ./coverage.xml
verbose: true

check-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v1.5
4 changes: 4 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -9,6 +9,10 @@ python:
path: .
- requirements: doc/en/requirements.txt

sphinx:
configuration: doc/en/conf.py
fail_on_warning: true

build:
os: ubuntu-20.04
tools:
10 changes: 10 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -47,6 +47,7 @@ Ariel Pillemer
Armin Rigo
Aron Coyle
Aron Curzon
Arthur Richard
Ashish Kurmi
Aviral Verma
Aviv Palivoda
@@ -166,13 +167,16 @@ Ian Bicking
Ian Lesperance
Ilya Konstantinov
Ionuț Turturică
Isaac Virshup
Israel Fruchter
Itxaso Aizpurua
Iwan Briquemont
Jaap Broekhuizen
Jake VanderPlas
Jakob van Santen
Jakub Mitoraj
James Bourbeau
James Frost
Jan Balster
Janne Vanhala
Jason R. Coombs
@@ -229,6 +233,7 @@ Maho
Maik Figura
Mandeep Bhutani
Manuel Krebber
Marc Mueller
Marc Schlaich
Marcelo Duarte Trevisani
Marcin Bachry
@@ -320,6 +325,7 @@ Ronny Pfannschmidt
Ross Lawley
Ruaridh Williamson
Russel Winder
Ryan Puddephatt
Ryan Wooden
Saiprasad Kale
Samuel Colvin
@@ -334,11 +340,13 @@ Serhii Mozghovyi
Seth Junot
Shantanu Jain
Shubham Adep
Simon Blanchard
Simon Gomizelj
Simon Holesch
Simon Kerr
Skylar Downes
Srinivas Reddy Thatiparthy
Stefaan Lippens
Stefan Farmbauer
Stefan Scherfke
Stefan Zimmermann
@@ -370,7 +378,9 @@ Tomer Keren
Tony Narlock
Tor Colvin
Trevor Bekolay
Tushar Sadhwani
Tyler Goodlet
Tyler Smart
Tzu-ping Chung
Vasily Kuznetsov
Victor Maryama
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ Fix bugs
--------

Look through the `GitHub issues for bugs <https://github.com/pytest-dev/pytest/labels/type:%20bug>`_.
See also the `"status: easy" issues <https://github.com/pytest-dev/pytest/labels/status%3A%20easy>`_
See also the `"good first issue" issues <https://github.com/pytest-dev/pytest/labels/good%20first%20issue>`_
that are friendly to new contributors.

:ref:`Talk <contact>` to developers to find out how you can fix specific bugs. To indicate that you are going
12 changes: 5 additions & 7 deletions RELEASING.rst
Original file line number Diff line number Diff line change
@@ -133,14 +133,12 @@ Releasing

Both automatic and manual processes described above follow the same steps from this point onward.

#. After all tests pass and the PR has been approved, tag the release commit
in the ``release-MAJOR.MINOR.PATCH`` branch and push it. This will publish to PyPI::
#. After all tests pass and the PR has been approved, trigger the ``deploy`` job
in https://github.com/pytest-dev/pytest/actions/workflows/deploy.yml, using the ``release-MAJOR.MINOR.PATCH`` branch
as source.

git fetch upstream
git tag MAJOR.MINOR.PATCH upstream/release-MAJOR.MINOR.PATCH
git push upstream MAJOR.MINOR.PATCH

Wait for the deploy to complete, then make sure it is `available on PyPI <https://pypi.org/project/pytest>`_.
This job will require approval from ``pytest-dev/core``, after which it will publish to PyPI
and tag the repository.

#. Merge the PR. **Make sure it's not squash-merged**, so that the tagged commit ends up in the main branch.

1 change: 0 additions & 1 deletion changelog/10831.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/10872.improvement.rst

This file was deleted.

2 changes: 0 additions & 2 deletions changelog/10901.feature.rst

This file was deleted.

5 changes: 0 additions & 5 deletions changelog/10907.improvement.rst

This file was deleted.

3 changes: 0 additions & 3 deletions changelog/10940.improvement.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/10991.improvement.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/11005.improvement.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/11013.improvement.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/11031.trivial.rst

This file was deleted.

3 changes: 0 additions & 3 deletions changelog/11043.improvement.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/11068.bugfix.rst

This file was deleted.

7 changes: 0 additions & 7 deletions changelog/11081.improvement.rst

This file was deleted.

3 changes: 0 additions & 3 deletions changelog/11104.bugfix.rst

This file was deleted.

1 change: 1 addition & 0 deletions changelog/12363.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The documentation webpages now links to a canonical version to reduce outdated documentation in search engine results.
1 change: 0 additions & 1 deletion changelog/1904.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/7781.bugfix.rst

This file was deleted.

3 changes: 0 additions & 3 deletions changelog/8711.improvement.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/9146.doc.rst

This file was deleted.

Loading