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.2.0
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.2
Choose a head ref
Loading
Showing with 17,225 additions and 6,833 deletions.
  1. +3 −0 .gitblameignore → .git-blame-ignore-revs
  2. +6 −0 .github/dependabot.yml
  3. +1 −1 .github/workflows/backport.yml
  4. +70 −25 .github/workflows/deploy.yml
  5. +2 −2 .github/workflows/prepare-release-pr.yml
  6. +23 −0 .github/workflows/stale.yml
  7. +67 −45 .github/workflows/test.yml
  8. +14 −6 .github/workflows/update-plugin-list.yml
  9. +18 −43 .pre-commit-config.yaml
  10. +10 −3 .readthedocs.yml
  11. +59 −4 AUTHORS
  12. +13 −11 CONTRIBUTING.rst
  13. +2 −5 README.rst
  14. +5 −7 RELEASING.rst
  15. +3 −1 bench/bench.py
  16. +1 −0 bench/bench_argcomplete.py
  17. +1 −0 bench/skip.py
  18. +1 −0 bench/unit_test.py
  19. +0 −1 changelog/10012.deprecation.rst
  20. +0 −1 changelog/10150.bugfix.rst
  21. +0 −1 changelog/10196.trivial.rst
  22. +0 −5 changelog/10218.improvement.rst
  23. +0 −3 changelog/10313.trivial.rst
  24. +0 −1 changelog/10344.doc.rst
  25. +0 −1 changelog/10381.improvement.rst
  26. +0 −1 changelog/10382.bugfix.rst
  27. +0 −1 changelog/10396.deprecation.rst
  28. +0 −1 changelog/3426.improvement.rst
  29. +0 −4 changelog/4562.deprecation.rst
  30. +0 −1 changelog/7337.improvement.rst
  31. +0 −5 changelog/7792.bugfix.rst
  32. +0 −2 changelog/8508.improvement.rst
  33. +0 −2 changelog/8646.improvement.rst
  34. +0 −1 changelog/9159.bugfix.rst
  35. +0 −1 changelog/9248.doc.rst
  36. +0 −1 changelog/9291.doc.rst
  37. +0 −3 changelog/9741.improvement.rst
  38. +0 −1 changelog/9742.improvement.rst
  39. +0 −1 changelog/9823.improvement.rst
  40. +0 −1 changelog/9873.improvement.rst
  41. +0 −1 changelog/9877.bugfix.rst
  42. +0 −1 changelog/9883.improvement.rst
  43. +0 −10 changelog/9886.deprecation.rst
  44. +0 −1 changelog/9897.feature.rst
  45. +0 −1 changelog/9906.trivial.rst
  46. +0 −1 changelog/9910.trivial.rst
  47. +0 −1 changelog/9920.improvement.rst
  48. +0 −4 changelog/9984.trivial.rst
  49. +0 −1 changelog/9987.improvement.rst
  50. +1 −1 changelog/README.rst
  51. +2 −3 doc/en/_templates/slim_searchbox.html
  52. +16 −0 doc/en/announce/index.rst
  53. +93 −0 doc/en/announce/release-7.2.0.rst
  54. +25 −0 doc/en/announce/release-7.2.1.rst
  55. +25 −0 doc/en/announce/release-7.2.2.rst
  56. +130 −0 doc/en/announce/release-7.3.0.rst
  57. +18 −0 doc/en/announce/release-7.3.1.rst
  58. +21 −0 doc/en/announce/release-7.3.2.rst
  59. +49 −0 doc/en/announce/release-7.4.0.rst
  60. +20 −0 doc/en/announce/release-7.4.1.rst
  61. +18 −0 doc/en/announce/release-7.4.2.rst
  62. +19 −0 doc/en/announce/release-7.4.3.rst
  63. +20 −0 doc/en/announce/release-7.4.4.rst
  64. +26 −0 doc/en/announce/release-8.0.0.rst
  65. +82 −0 doc/en/announce/release-8.0.0rc1.rst
  66. +32 −0 doc/en/announce/release-8.0.0rc2.rst
  67. +21 −0 doc/en/announce/release-8.0.1.rst
  68. +18 −0 doc/en/announce/release-8.0.2.rst
  69. +4 −1 doc/en/backwards-compatibility.rst
  70. +41 −40 doc/en/builtin.rst
  71. +985 −29 doc/en/changelog.rst
  72. +48 −23 doc/en/conf.py
  73. +162 −49 doc/en/deprecations.rst
  74. +1 −0 doc/en/example/assertion/global_testmodule_config/conftest.py
  75. +1 −0 doc/en/example/assertion/test_failures.py
  76. +1 −1 doc/en/example/conftest.py
  77. +77 −0 doc/en/example/customdirectory.rst
  78. +28 −0 doc/en/example/customdirectory/conftest.py
  79. 0 doc/en/example/customdirectory/pytest.ini
  80. +6 −0 doc/en/example/customdirectory/tests/manifest.json
  81. +3 −0 doc/en/example/customdirectory/tests/test_first.py
  82. +3 −0 doc/en/example/customdirectory/tests/test_second.py
  83. +3 −0 doc/en/example/customdirectory/tests/test_third.py
  84. +1 −1 doc/en/example/fixtures/test_fixtures_order_dependencies.py
  85. +1 −0 doc/en/example/index.rst
  86. +20 −20 doc/en/example/markers.rst
  87. +15 −19 doc/en/example/multipython.py
  88. +3 −3 doc/en/example/nonpython.rst
  89. +2 −1 doc/en/example/nonpython/conftest.py
  90. +51 −47 doc/en/example/parametrize.rst
  91. +21 −15 doc/en/example/pythoncollection.rst
  92. +29 −19 doc/en/example/reportingdemo.rst
  93. +79 −51 doc/en/example/simple.rst
  94. +1 −0 doc/en/example/xfail_demo.py
  95. +1 −1 doc/en/explanation/anatomy.rst
  96. +1 −1 doc/en/explanation/fixtures.rst
  97. +23 −5 doc/en/explanation/goodpractices.rst
  98. +3 −3 doc/en/explanation/pythonpath.rst
  99. +5 −10 doc/en/funcarg_compare.rst
  100. +27 −3 doc/en/getting-started.rst
  101. +3 −5 doc/en/historical-notes.rst
  102. +117 −19 doc/en/how-to/assert.rst
  103. +21 −14 doc/en/how-to/cache.rst
  104. +1 −1 doc/en/how-to/capture-stdout-stderr.rst
  105. +31 −7 doc/en/how-to/capture-warnings.rst
  106. +2 −2 doc/en/how-to/doctest.rst
  107. +0 −4 doc/en/how-to/failures.rst
  108. +30 −33 doc/en/how-to/fixtures.rst
  109. +15 −1 doc/en/how-to/logging.rst
  110. +3 −6 doc/en/how-to/monkeypatch.rst
  111. +21 −4 doc/en/how-to/nose.rst
  112. +86 −21 doc/en/how-to/output.rst
  113. +2 −2 doc/en/how-to/parametrize.rst
  114. +10 −20 doc/en/how-to/skipping.rst
  115. +10 −8 doc/en/how-to/tmp_path.rst
  116. +5 −5 doc/en/how-to/unittest.rst
  117. +21 −8 doc/en/how-to/usage.rst
  118. +36 −31 doc/en/how-to/writing_hook_functions.rst
  119. +5 −9 doc/en/how-to/writing_plugins.rst
  120. +8 −6 doc/en/index.rst
  121. +1 −1 doc/en/reference/customize.rst
  122. +4 −9 doc/en/reference/fixtures.rst
  123. +3,563 −1,635 doc/en/reference/plugin_list.rst
  124. +284 −132 doc/en/reference/reference.rst
  125. +7 −3 doc/en/requirements.txt
  126. +1 −0 extra/get_issues.py
  127. +67 −3 pyproject.toml
  128. +1 −0 scripts/.gitignore
  129. +66 −0 scripts/generate-gh-release-notes.py
  130. +17 −4 scripts/prepare-release-pr.py
  131. +0 −102 scripts/publish-gh-release-notes.py
  132. +14 −11 scripts/release.py
  133. +8 −5 scripts/towncrier-draft-to-file.py
  134. +110 −28 scripts/update-plugin-list.py
  135. +7 −7 setup.cfg
  136. +0 −4 setup.py
  137. +2 −1 src/_pytest/__init__.py
  138. +5 −4 src/_pytest/_argcomplete.py
  139. +2 −0 src/_pytest/_code/__init__.py
  140. +257 −139 src/_pytest/_code/code.py
  141. +6 −5 src/_pytest/_code/source.py
  142. +675 −0 src/_pytest/_io/pprint.py
  143. +2 −52 src/_pytest/_io/saferepr.py
  144. +27 −12 src/_pytest/_io/terminalwriter.py
  145. +1 −1 src/_pytest/_io/wcwidth.py
  146. +2 −0 src/_pytest/_py/error.py
  147. +43 −25 src/_pytest/_py/path.py
  148. +17 −7 src/_pytest/assertion/__init__.py
  149. +119 −33 src/_pytest/assertion/rewrite.py
  150. +48 −25 src/_pytest/assertion/truncate.py
  151. +155 −68 src/_pytest/assertion/util.py
  152. +62 −45 src/_pytest/cacheprovider.py
  153. +231 −160 src/_pytest/capture.py
  154. +36 −85 src/_pytest/compat.py
  155. +298 −121 src/_pytest/config/__init__.py
  156. +37 −11 src/_pytest/config/argparsing.py
  157. +28 −15 src/_pytest/config/compat.py
  158. +1 −1 src/_pytest/config/exceptions.py
  159. +28 −22 src/_pytest/config/findpaths.py
  160. +7 −6 src/_pytest/debugging.py
  161. +8 −0 src/_pytest/deprecated.py
  162. +58 −51 src/_pytest/doctest.py
  163. +27 −22 src/_pytest/faulthandler.py
  164. +457 −384 src/_pytest/fixtures.py
  165. +1 −0 src/_pytest/freeze_support.py
  166. +18 −12 src/_pytest/helpconfig.py
  167. +60 −24 src/_pytest/hookspec.py
  168. +15 −14 src/_pytest/junitxml.py
  169. +10 −10 src/_pytest/legacypath.py
  170. +164 −46 src/_pytest/logging.py
  171. +319 −205 src/_pytest/main.py
  172. +21 −9 src/_pytest/mark/__init__.py
  173. +5 −4 src/_pytest/mark/expression.py
  174. +31 −16 src/_pytest/mark/structures.py
  175. +20 −19 src/_pytest/monkeypatch.py
  176. +86 −44 src/_pytest/nodes.py
  177. +1 −0 src/_pytest/nose.py
  178. +14 −19 src/_pytest/outcomes.py
  179. +4 −3 src/_pytest/pastebin.py
  180. +113 −59 src/_pytest/pathlib.py
  181. +51 −63 src/_pytest/pytester.py
  182. +1 −0 src/_pytest/pytester_assertions.py
  183. +296 −247 src/_pytest/python.py
  184. +68 −52 src/_pytest/python_api.py
  185. +74 −34 src/_pytest/recwarn.py
  186. +43 −25 src/_pytest/reports.py
  187. +49 −23 src/_pytest/runner.py
  188. +9 −10 src/_pytest/scope.py
  189. +19 −17 src/_pytest/setuponly.py
  190. +1 −1 src/_pytest/setupplan.py
  191. +23 −19 src/_pytest/skipping.py
  192. +10 −1 src/_pytest/stepwise.py
  193. +131 −60 src/_pytest/terminal.py
  194. +19 −15 src/_pytest/threadexception.py
  195. +2 −0 src/_pytest/timing.py
  196. +132 −27 src/_pytest/tmpdir.py
  197. +30 −20 src/_pytest/unittest.py
  198. +20 −18 src/_pytest/unraisableexception.py
  199. +13 −13 src/_pytest/warning_types.py
  200. +30 −30 src/_pytest/warnings.py
  201. +3 −0 src/py.py
  202. +20 −6 src/pytest/__init__.py
  203. +2 −0 src/pytest/__main__.py
  204. +81 −57 testing/_py/test_local.py
  205. +186 −40 testing/acceptance_test.py
  206. +1 −1 testing/code/test_code.py
  207. +285 −61 testing/code/test_excinfo.py
  208. +3 −8 testing/code/test_source.py
  209. +44 −13 testing/conftest.py
  210. +69 −12 testing/deprecated_test.py
  211. +2 −0 testing/example_scripts/acceptance/fixture_mock_integration.py
  212. +2 −0 testing/example_scripts/collect/package_init_given_as_arg/pkg/__init__.py
  213. +1 −1 testing/example_scripts/collect/package_init_given_as_arg/pkg/test_foo.py
  214. +22 −0 testing/example_scripts/customdirectory/conftest.py
  215. 0 testing/example_scripts/customdirectory/pytest.ini
  216. +6 −0 testing/example_scripts/customdirectory/tests/manifest.json
  217. +3 −0 testing/example_scripts/customdirectory/tests/test_first.py
  218. +3 −0 testing/example_scripts/customdirectory/tests/test_second.py
  219. +3 −0 testing/example_scripts/customdirectory/tests/test_third.py
  220. +2 −1 testing/example_scripts/issue88_initial_file_multinodes/conftest.py
  221. +2 −2 testing/example_scripts/issue_519.py
  222. +1 −0 testing/example_scripts/perf_examples/collect_stats/generate_folders.py
  223. +1 −0 testing/example_scripts/unittest/test_setup_skip.py
  224. +1 −0 testing/example_scripts/unittest/test_setup_skip_class.py
  225. +1 −0 testing/example_scripts/unittest/test_setup_skip_module.py
  226. +1 −0 testing/example_scripts/unittest/test_unittest_asynctest.py
  227. +3 −1 testing/freeze/create_executable.py
  228. +1 −0 testing/freeze/runtests_script.py
  229. +1 −0 testing/freeze/tox_run.py
  230. +406 −0 testing/io/test_pprint.py
  231. +5 −16 testing/io/test_saferepr.py
  232. +56 −27 testing/io/test_terminalwriter.py
  233. +1 −1 testing/io/test_wcwidth.py
  234. +166 −16 testing/logging/test_fixture.py
  235. +267 −57 testing/logging/test_reporting.py
  236. +12 −12 testing/plugins_integration/requirements.txt
  237. +57 −14 testing/python/approx.py
  238. +178 −52 testing/python/collect.py
  239. +150 −60 testing/python/fixtures.py
  240. +7 −6 testing/python/integration.py
  241. +212 −67 testing/python/metafunc.py
  242. +14 −1 testing/python/raises.py
  243. +3 −2 testing/test_argcomplete.py
  244. +441 −139 testing/test_assertion.py
  245. +352 −41 testing/test_assertrewrite.py
  246. +108 −43 testing/test_cacheprovider.py
  247. +36 −45 testing/test_capture.py
  248. +292 −73 testing/test_collection.py
  249. +4 −3 testing/test_compat.py
  250. +241 −69 testing/test_config.py
  251. +93 −87 testing/test_conftest.py
  252. +3 −6 testing/test_debugging.py
  253. +96 −71 testing/test_doctest.py
  254. +2 −2 testing/test_entry_points.py
  255. +47 −27 testing/test_error_diffs.py
  256. +2 −1 testing/test_faulthandler.py
  257. +18 −1 testing/test_findpaths.py
  258. +1 −1 testing/test_helpconfig.py
  259. +71 −38 testing/test_junitxml.py
  260. +4 −2 testing/test_legacypath.py
  261. +5 −4 testing/test_link_resolve.py
  262. +38 −11 testing/test_main.py
  263. +70 −30 testing/test_mark.py
  264. +1 −1 testing/test_mark_expression.py
  265. +1 −0 testing/test_meta.py
  266. +13 −8 testing/test_monkeypatch.py
  267. +9 −4 testing/test_nodes.py
  268. +38 −7 testing/test_nose.py
  269. +12 −9 testing/test_parseopt.py
  270. +1 −1 testing/test_pastebin.py
  271. +167 −41 testing/test_pathlib.py
  272. +43 −5 testing/test_pluginmanager.py
  273. +5 −20 testing/test_pytester.py
  274. +9 −7 testing/test_python_path.py
  275. +227 −66 testing/test_recwarn.py
  276. +29 −10 testing/test_reports.py
  277. +41 −12 testing/test_runner.py
  278. +4 −5 testing/test_runner_xunit.py
  279. +1 −1 testing/test_scope.py
  280. +80 −17 testing/test_session.py
  281. +1 −1 testing/test_setuponly.py
  282. +57 −33 testing/test_skipping.py
  283. +1 −1 testing/test_stash.py
  284. +78 −1 testing/test_stepwise.py
  285. +220 −69 testing/test_terminal.py
  286. +1 −7 testing/test_threadexception.py
  287. +169 −27 testing/test_tmpdir.py
  288. +15 −34 testing/test_unittest.py
  289. +7 −4 testing/test_unraisableexception.py
  290. +3 −2 testing/test_warning_types.py
  291. +25 −13 testing/test_warnings.py
  292. +26 −0 testing/typing_checks.py
  293. +33 −36 tox.ini
3 changes: 3 additions & 0 deletions .gitblameignore → .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -26,3 +26,6 @@ afc607cfd81458d4e4f3b1f3cf8cc931b933907e

# move argument parser to own file
c9df77cbd6a365dcb73c39618e4842711817e871

# Replace reorder-python-imports by isort due to black incompatibility (#11896)
8b54596639f41dfac070030ef20394b9001fe63c
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -9,3 +9,9 @@ updates:
allow:
- dependency-type: direct
- dependency-type: indirect
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
time: "03:00"
open-pull-requests-limit: 10
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@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true
95 changes: 70 additions & 25 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,101 @@
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:
package:
runs-on: ubuntu-latest
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }}
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v2.0.0

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@v4
with:
name: Packages
path: dist

- name: Publish package to PyPI
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@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

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

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

- name: Install dependencies
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install --upgrade build tox
pip install --upgrade tox
- name: Build package
- name: Generate release notes
run: |
python -m build
sudo apt-get install pandoc
tox -e generate-gh-release-notes -- ${{ github.event.inputs.version }} scripts/latest-release-notes.md
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
- name: Publish GitHub Release
uses: softprops/action-gh-release@v1
with:
user: __token__
password: ${{ secrets.pypi_token }}

- name: Publish GitHub release notes
env:
GH_RELEASE_NOTES_TOKEN: ${{ github.token }}
run: |
sudo apt-get install pandoc
tox -e publish-gh-release-notes
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@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

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

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@v9
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
Loading