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: 7.4.4
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: 8.0.0
Choose a head ref
Loading
Showing with 9,811 additions and 3,713 deletions.
  1. +1 −1 .github/workflows/backport.yml
  2. +64 −23 .github/workflows/deploy.yml
  3. +2 −2 .github/workflows/prepare-release-pr.yml
  4. +1 −1 .github/workflows/stale.yml
  5. +46 −48 .github/workflows/test.yml
  6. +12 −4 .github/workflows/update-plugin-list.yml
  7. +15 −13 .pre-commit-config.yaml
  8. +4 −0 .readthedocs.yml
  9. +28 −0 AUTHORS
  10. +13 −11 CONTRIBUTING.rst
  11. +2 −2 README.rst
  12. +5 −7 RELEASING.rst
  13. +0 −1 changelog/10831.bugfix.rst
  14. +0 −1 changelog/10872.improvement.rst
  15. +0 −2 changelog/10901.feature.rst
  16. +0 −5 changelog/10907.improvement.rst
  17. +0 −3 changelog/10940.improvement.rst
  18. +0 −1 changelog/10991.improvement.rst
  19. +0 −1 changelog/11005.improvement.rst
  20. +0 −1 changelog/11013.improvement.rst
  21. +0 −1 changelog/11031.trivial.rst
  22. +0 −3 changelog/11043.improvement.rst
  23. +0 −1 changelog/11068.bugfix.rst
  24. +0 −7 changelog/11081.improvement.rst
  25. +0 −3 changelog/11104.bugfix.rst
  26. +0 −1 changelog/1904.bugfix.rst
  27. +0 −1 changelog/7781.bugfix.rst
  28. +0 −3 changelog/8711.improvement.rst
  29. +0 −1 changelog/9146.doc.rst
  30. +1 −1 changelog/README.rst
  31. +8 −0 doc/en/announce/index.rst
  32. +49 −0 doc/en/announce/release-7.4.0.rst
  33. +20 −0 doc/en/announce/release-7.4.1.rst
  34. +18 −0 doc/en/announce/release-7.4.2.rst
  35. +19 −0 doc/en/announce/release-7.4.3.rst
  36. +20 −0 doc/en/announce/release-7.4.4.rst
  37. +26 −0 doc/en/announce/release-8.0.0.rst
  38. +82 −0 doc/en/announce/release-8.0.0rc1.rst
  39. +32 −0 doc/en/announce/release-8.0.0rc2.rst
  40. +2 −1 doc/en/backwards-compatibility.rst
  41. +16 −16 doc/en/builtin.rst
  42. +618 −30 doc/en/changelog.rst
  43. +44 −21 doc/en/conf.py
  44. +141 −7 doc/en/deprecations.rst
  45. +1 −1 doc/en/example/conftest.py
  46. +77 −0 doc/en/example/customdirectory.rst
  47. +28 −0 doc/en/example/customdirectory/conftest.py
  48. 0 doc/en/example/customdirectory/pytest.ini
  49. +6 −0 doc/en/example/customdirectory/tests/manifest.json
  50. +3 −0 doc/en/example/customdirectory/tests/test_first.py
  51. +3 −0 doc/en/example/customdirectory/tests/test_second.py
  52. +3 −0 doc/en/example/customdirectory/tests/test_third.py
  53. +1 −0 doc/en/example/index.rst
  54. +15 −15 doc/en/example/markers.rst
  55. +6 −7 doc/en/example/multipython.py
  56. +3 −3 doc/en/example/nonpython.rst
  57. +1 −1 doc/en/example/nonpython/conftest.py
  58. +50 −46 doc/en/example/parametrize.rst
  59. +15 −12 doc/en/example/pythoncollection.rst
  60. +16 −3 doc/en/example/reportingdemo.rst
  61. +65 −38 doc/en/example/simple.rst
  62. +1 −1 doc/en/explanation/anatomy.rst
  63. +1 −1 doc/en/explanation/fixtures.rst
  64. +2 −4 doc/en/funcarg_compare.rst
  65. +27 −3 doc/en/getting-started.rst
  66. +1 −1 doc/en/historical-notes.rst
  67. +117 −19 doc/en/how-to/assert.rst
  68. +19 −12 doc/en/how-to/cache.rst
  69. +1 −1 doc/en/how-to/capture-stdout-stderr.rst
  70. +1 −3 doc/en/how-to/capture-warnings.rst
  71. +2 −2 doc/en/how-to/doctest.rst
  72. +0 −4 doc/en/how-to/failures.rst
  73. +28 −28 doc/en/how-to/fixtures.rst
  74. +8 −1 doc/en/how-to/logging.rst
  75. +21 −4 doc/en/how-to/nose.rst
  76. +86 −20 doc/en/how-to/output.rst
  77. +2 −2 doc/en/how-to/parametrize.rst
  78. +5 −5 doc/en/how-to/tmp_path.rst
  79. +3 −3 doc/en/how-to/unittest.rst
  80. +19 −7 doc/en/how-to/usage.rst
  81. +35 −31 doc/en/how-to/writing_hook_functions.rst
  82. +1 −1 doc/en/how-to/writing_plugins.rst
  83. +4 −5 doc/en/index.rst
  84. +1 −1 doc/en/reference/customize.rst
  85. +3 −8 doc/en/reference/fixtures.rst
  86. +1,273 −539 doc/en/reference/plugin_list.rst
  87. +166 −83 doc/en/reference/reference.rst
  88. +2 −2 doc/en/requirements.txt
  89. +7 −3 pyproject.toml
  90. +1 −0 scripts/.gitignore
  91. +66 −0 scripts/generate-gh-release-notes.py
  92. +16 −3 scripts/prepare-release-pr.py
  93. +0 −102 scripts/publish-gh-release-notes.py
  94. +14 −11 scripts/release.py
  95. +4 −3 scripts/towncrier-draft-to-file.py
  96. +87 −23 scripts/update-plugin-list.py
  97. +2 −4 setup.cfg
  98. +0 −4 setup.py
  99. +88 −20 src/_pytest/_code/code.py
  100. +1 −2 src/_pytest/_code/source.py
  101. +675 −0 src/_pytest/_io/pprint.py
  102. +0 −49 src/_pytest/_io/saferepr.py
  103. +25 −9 src/_pytest/_io/terminalwriter.py
  104. +16 −6 src/_pytest/_py/path.py
  105. +15 −6 src/_pytest/assertion/__init__.py
  106. +70 −54 src/_pytest/assertion/rewrite.py
  107. +3 −2 src/_pytest/assertion/truncate.py
  108. +150 −65 src/_pytest/assertion/util.py
  109. +27 −29 src/_pytest/cacheprovider.py
  110. +37 −30 src/_pytest/capture.py
  111. +20 −77 src/_pytest/compat.py
  112. +175 −69 src/_pytest/config/__init__.py
  113. +34 −9 src/_pytest/config/argparsing.py
  114. +26 −13 src/_pytest/config/compat.py
  115. +1 −1 src/_pytest/config/exceptions.py
  116. +17 −15 src/_pytest/config/findpaths.py
  117. +3 −3 src/_pytest/debugging.py
  118. +6 −0 src/_pytest/deprecated.py
  119. +43 −37 src/_pytest/doctest.py
  120. +19 −12 src/_pytest/faulthandler.py
  121. +376 −333 src/_pytest/fixtures.py
  122. +11 −5 src/_pytest/helpconfig.py
  123. +41 −14 src/_pytest/hookspec.py
  124. +8 −5 src/_pytest/junitxml.py
  125. +5 −7 src/_pytest/legacypath.py
  126. +66 −36 src/_pytest/logging.py
  127. +299 −195 src/_pytest/main.py
  128. +10 −3 src/_pytest/mark/__init__.py
  129. +1 −8 src/_pytest/mark/expression.py
  130. +15 −4 src/_pytest/mark/structures.py
  131. +1 −1 src/_pytest/monkeypatch.py
  132. +64 −28 src/_pytest/nodes.py
  133. +5 −13 src/_pytest/outcomes.py
  134. +36 −21 src/_pytest/pathlib.py
  135. +41 −47 src/_pytest/pytester.py
  136. +243 −197 src/_pytest/python.py
  137. +56 −38 src/_pytest/python_api.py
  138. +59 −32 src/_pytest/recwarn.py
  139. +8 −6 src/_pytest/reports.py
  140. +31 −11 src/_pytest/runner.py
  141. +8 −10 src/_pytest/scope.py
  142. +17 −15 src/_pytest/setuponly.py
  143. +15 −11 src/_pytest/skipping.py
  144. +55 −33 src/_pytest/terminal.py
  145. +18 −14 src/_pytest/threadexception.py
  146. +19 −23 src/_pytest/tmpdir.py
  147. +10 −7 src/_pytest/unittest.py
  148. +19 −17 src/_pytest/unraisableexception.py
  149. +8 −3 src/_pytest/warning_types.py
  150. +27 −27 src/_pytest/warnings.py
  151. +2 −0 src/py.py
  152. +17 −6 src/pytest/__init__.py
  153. +16 −13 testing/_py/test_local.py
  154. +140 −8 testing/acceptance_test.py
  155. +157 −16 testing/code/test_excinfo.py
  156. +2 −7 testing/code/test_source.py
  157. +34 −4 testing/conftest.py
  158. +67 −10 testing/deprecated_test.py
  159. +2 −0 testing/example_scripts/collect/package_init_given_as_arg/pkg/__init__.py
  160. +1 −1 testing/example_scripts/collect/package_init_given_as_arg/pkg/test_foo.py
  161. +22 −0 testing/example_scripts/customdirectory/conftest.py
  162. 0 testing/example_scripts/customdirectory/pytest.ini
  163. +6 −0 testing/example_scripts/customdirectory/tests/manifest.json
  164. +3 −0 testing/example_scripts/customdirectory/tests/test_first.py
  165. +3 −0 testing/example_scripts/customdirectory/tests/test_second.py
  166. +3 −0 testing/example_scripts/customdirectory/tests/test_third.py
  167. +2 −1 testing/example_scripts/issue88_initial_file_multinodes/conftest.py
  168. +2 −2 testing/example_scripts/issue_519.py
  169. +406 −0 testing/io/test_pprint.py
  170. +0 −7 testing/io/test_saferepr.py
  171. +54 −25 testing/io/test_terminalwriter.py
  172. +51 −23 testing/logging/test_fixture.py
  173. +65 −6 testing/logging/test_reporting.py
  174. +9 −9 testing/plugins_integration/requirements.txt
  175. +40 −9 testing/python/approx.py
  176. +126 −17 testing/python/collect.py
  177. +54 −17 testing/python/fixtures.py
  178. +189 −47 testing/python/metafunc.py
  179. +398 −108 testing/test_assertion.py
  180. +72 −25 testing/test_assertrewrite.py
  181. +23 −13 testing/test_cacheprovider.py
  182. +130 −38 testing/test_collection.py
  183. +1 −1 testing/test_compat.py
  184. +172 −32 testing/test_config.py
  185. +22 −48 testing/test_conftest.py
  186. +20 −2 testing/test_doctest.py
  187. +2 −2 testing/test_entry_points.py
  188. +45 −26 testing/test_error_diffs.py
  189. +47 −0 testing/test_junitxml.py
  190. +3 −1 testing/test_legacypath.py
  191. +31 −0 testing/test_main.py
  192. +59 −17 testing/test_mark.py
  193. +6 −0 testing/test_nodes.py
  194. +17 −7 testing/test_nose.py
  195. +4 −3 testing/test_parseopt.py
  196. +141 −21 testing/test_pathlib.py
  197. +41 −3 testing/test_pluginmanager.py
  198. +0 −13 testing/test_pytester.py
  199. +7 −5 testing/test_python_path.py
  200. +144 −63 testing/test_recwarn.py
  201. +3 −3 testing/test_reports.py
  202. +56 −6 testing/test_runner.py
  203. +73 −10 testing/test_session.py
  204. +14 −15 testing/test_skipping.py
  205. +147 −23 testing/test_terminal.py
  206. +0 −6 testing/test_threadexception.py
  207. +1 −10 testing/test_unittest.py
  208. +6 −4 testing/test_unraisableexception.py
  209. +2 −1 testing/test_warnings.py
  210. +20 −13 tox.ini
2 changes: 1 addition & 1 deletion .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ jobs:
pull-requests: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true
87 changes: 64 additions & 23 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,44 @@
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
- uses: actions/checkout@v4
with:
fetch-depth: 0
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.4

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@v4

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

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

- 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@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Download Package
uses: actions/download-artifact@v4
with:
password: ${{ secrets.pypi_token }}
name: Packages
path: dist

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

- name: Install tox
run: |
python -m pip install --upgrade pip
pip install --upgrade tox
- name: Publish GitHub release notes
env:
GH_RELEASE_NOTES_TOKEN: ${{ github.token }}
- name: Generate release notes
run: |
sudo apt-get install pandoc
tox -e publish-gh-release-notes
tox -e generate-gh-release-notes -- ${{ github.event.inputs.version }} scripts/latest-release-notes.md
- name: Publish GitHub Release
uses: softprops/action-gh-release@v1
with:
body_path: scripts/latest-release-notes.md
files: dist/*
tag_name: ${{ github.event.inputs.version }}
4 changes: 2 additions & 2 deletions .github/workflows/prepare-release-pr.yml
Original file line number Diff line number Diff line change
@@ -27,12 +27,12 @@ jobs:
pull-requests: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

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

2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ jobs:
permissions:
issues: write
steps:
- uses: actions/stale@v8
- uses: actions/stale@v9
with:
debug-only: false
days-before-issue-stale: 14
94 changes: 46 additions & 48 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@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v1.5.4

build:
needs: [package]

runs-on: ${{ matrix.os }}
timeout-minutes: 45
permissions:
@@ -37,48 +49,41 @@ jobs:
fail-fast: false
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-py38-freeze",
"ubuntu-py39",
"ubuntu-py310",
"ubuntu-py311",
"ubuntu-py312",
"ubuntu-pypy3",

"macos-py37",
"macos-py38",
"macos-py39",
"macos-py310",
"macos-py312",

"docs",
"doctesting",
"plugins",
]

include:
- name: "windows-py37"
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
@@ -96,23 +101,19 @@ jobs:
os: windows-latest
tox_env: "py312"

- name: "ubuntu-py37"
python: "3.7"
- name: "ubuntu-py38"
python: "3.8"
os: ubuntu-latest
tox_env: "py37-lsof-numpy-pexpect"
tox_env: "py38-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"
- name: "ubuntu-py38-pluggy"
python: "3.8"
os: ubuntu-latest
tox_env: "py37-freeze"
- name: "ubuntu-py38"
tox_env: "py38-pluggymain-pylib-xdist"
- name: "ubuntu-py38-freeze"
python: "3.8"
os: ubuntu-latest
tox_env: "py38-xdist"
tox_env: "py38-freeze"
- name: "ubuntu-py39"
python: "3.9"
os: ubuntu-latest
@@ -132,14 +133,14 @@ jobs:
tox_env: "py312"
use_coverage: true
- name: "ubuntu-pypy3"
python: "pypy-3.7"
python: "pypy-3.8"
os: ubuntu-latest
tox_env: "pypy3-xdist"

- name: "macos-py37"
python: "3.7"
- name: "macos-py38"
python: "3.8"
os: macos-latest
tox_env: "py37-xdist"
tox_env: "py38-xdist"
- name: "macos-py39"
python: "3.9"
os: macos-latest
@@ -155,28 +156,30 @@ jobs:
tox_env: "py312-xdist"

- name: "plugins"
python: "3.9"
python: "3.12"
os: ubuntu-latest
tox_env: "plugins"

- name: "docs"
python: "3.7"
os: ubuntu-latest
tox_env: "docs"
- name: "doctesting"
python: "3.7"
python: "3.8"
os: ubuntu-latest
tox_env: "doctesting"
use_coverage: true

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
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
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
check-latest: ${{ endsWith(matrix.python, '-dev') }}
@@ -188,11 +191,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 +211,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
16 changes: 12 additions & 4 deletions .github/workflows/update-plugin-list.yml
Original file line number Diff line number Diff line change
@@ -20,19 +20,27 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: "3.11"
cache: pip
- name: requests-cache
uses: actions/cache@v3
with:
path: ~/.cache/pytest-plugin-list/
key: plugins-http-cache-${{ github.run_id }} # Can use time based key as well
restore-keys: plugins-http-cache-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install packaging requests tabulate[widechars] tqdm
pip install packaging requests tabulate[widechars] tqdm requests-cache platformdirs
- name: Update Plugin List
run: python scripts/update-plugin-list.py
Loading