--- /srv/rebuilderd/tmp/rebuilderdZa9nx9/inputs/python-pytest-doc_9.1.1-1~bpo13+1_all.deb +++ /srv/rebuilderd/tmp/rebuilderdZa9nx9/out/python-pytest-doc_9.1.1-1~bpo13+1_all.deb ├── file list │ @@ -1,3 +1,3 @@ │ -rw-r--r-- 0 0 0 4 2026-08-17 13:41:15.000000 debian-binary │ --rw-r--r-- 0 0 0 13700 2026-08-17 13:41:15.000000 control.tar.xz │ --rw-r--r-- 0 0 0 1430344 2026-08-17 13:41:15.000000 data.tar.xz │ +-rw-r--r-- 0 0 0 13696 2026-08-17 13:41:15.000000 control.tar.xz │ +-rw-r--r-- 0 0 0 1434448 2026-08-17 13:41:15.000000 data.tar.xz ├── control.tar.xz │ ├── control.tar │ │ ├── ./control │ │ │ @@ -1,13 +1,13 @@ │ │ │ Package: python-pytest-doc │ │ │ Source: pytest │ │ │ Version: 9.1.1-1~bpo13+1 │ │ │ Architecture: all │ │ │ Maintainer: Debian Python Team │ │ │ -Installed-Size: 17484 │ │ │ +Installed-Size: 17567 │ │ │ Depends: libjs-sphinxdoc (>= 8.1) │ │ │ Recommends: python3-pytest │ │ │ Section: doc │ │ │ Priority: optional │ │ │ Multi-Arch: foreign │ │ │ Homepage: https://pytest.org/ │ │ │ Description: Simple, powerful testing in Python - Documentation │ │ ├── ./md5sums │ │ │ ├── ./md5sums │ │ │ │┄ Files differ ├── data.tar.xz │ ├── data.tar │ │ ├── file list │ │ │ @@ -528,84 +528,84 @@ │ │ │ -rw-r--r-- 0 root (0) root (0) 22977 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/announce/release-9.0.2.html │ │ │ -rw-r--r-- 0 root (0) root (0) 23458 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/announce/release-9.0.3.html │ │ │ -rw-r--r-- 0 root (0) root (0) 25349 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/announce/release-9.1.0.html │ │ │ -rw-r--r-- 0 root (0) root (0) 22778 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/announce/release-9.1.1.html │ │ │ -rw-r--r-- 0 root (0) root (0) 25784 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/announce/sprint2016.html │ │ │ -rw-r--r-- 0 root (0) root (0) 32321 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/backwards-compatibility.html │ │ │ -rw-r--r-- 0 root (0) root (0) 33569 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/builtin.html │ │ │ --rw-r--r-- 0 root (0) root (0) 201372 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/changelog.html.gz │ │ │ +-rw-r--r-- 0 root (0) root (0) 202583 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/changelog.html.gz │ │ │ -rw-r--r-- 0 root (0) root (0) 28301 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/contact.html │ │ │ -rw-r--r-- 0 root (0) root (0) 62954 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/contents.html │ │ │ -rw-r--r-- 0 root (0) root (0) 70808 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/contributing.html │ │ │ --rw-r--r-- 0 root (0) root (0) 181025 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/deprecations.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 182341 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/deprecations.html │ │ │ -rw-r--r-- 0 root (0) root (0) 22406 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/development_guide.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/example/ │ │ │ -rw-r--r-- 0 root (0) root (0) 32925 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/example/customdirectory.html │ │ │ -rw-r--r-- 0 root (0) root (0) 33926 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/example/index.html │ │ │ --rw-r--r-- 0 root (0) root (0) 75670 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/example/markers.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 76151 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/example/markers.html │ │ │ -rw-r--r-- 0 root (0) root (0) 37449 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/example/nonpython.html │ │ │ -rw-r--r-- 0 root (0) root (0) 91051 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/example/parametrize.html │ │ │ -rw-r--r-- 0 root (0) root (0) 47887 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/example/pythoncollection.html │ │ │ -rw-r--r-- 0 root (0) root (0) 50252 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/example/reportingdemo.html │ │ │ -rw-r--r-- 0 root (0) root (0) 97429 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/example/simple.html │ │ │ -rw-r--r-- 0 root (0) root (0) 29375 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/example/special.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/explanation/ │ │ │ -rw-r--r-- 0 root (0) root (0) 25837 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/explanation/anatomy.html │ │ │ -rw-r--r-- 0 root (0) root (0) 27286 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/explanation/ci.html │ │ │ --rw-r--r-- 0 root (0) root (0) 36355 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/explanation/fixtures.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 36745 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/explanation/fixtures.html │ │ │ -rw-r--r-- 0 root (0) root (0) 40248 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/explanation/flaky.html │ │ │ --rw-r--r-- 0 root (0) root (0) 54303 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/explanation/goodpractices.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 54426 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/explanation/goodpractices.html │ │ │ -rw-r--r-- 0 root (0) root (0) 24086 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/explanation/index.html │ │ │ --rw-r--r-- 0 root (0) root (0) 42938 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/explanation/pythonpath.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 45145 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/explanation/pythonpath.html │ │ │ -rw-r--r-- 0 root (0) root (0) 32202 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/explanation/types.html │ │ │ -rw-r--r-- 0 root (0) root (0) 41090 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/funcarg_compare.html │ │ │ --rw-r--r-- 0 root (0) root (0) 42832 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/getting-started.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 43092 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/getting-started.html │ │ │ -rw-r--r-- 0 root (0) root (0) 49830 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/historical-notes.html │ │ │ -rw-r--r-- 0 root (0) root (0) 33330 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/history.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/ │ │ │ --rw-r--r-- 0 root (0) root (0) 83243 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/assert.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 84854 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/assert.html │ │ │ -rw-r--r-- 0 root (0) root (0) 24940 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/bash-completion.html │ │ │ -rw-r--r-- 0 root (0) root (0) 44029 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/cache.html │ │ │ -rw-r--r-- 0 root (0) root (0) 39386 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/capture-stdout-stderr.html │ │ │ --rw-r--r-- 0 root (0) root (0) 72881 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/capture-warnings.html │ │ │ --rw-r--r-- 0 root (0) root (0) 46571 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/doctest.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 74195 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/capture-warnings.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 47559 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/doctest.html │ │ │ -rw-r--r-- 0 root (0) root (0) 25680 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/existingtestsuite.html │ │ │ --rw-r--r-- 0 root (0) root (0) 36263 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/failures.html │ │ │ --rw-r--r-- 0 root (0) root (0) 175980 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/fixtures.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 37312 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/failures.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 176111 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/fixtures.html │ │ │ -rw-r--r-- 0 root (0) root (0) 27878 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/index.html │ │ │ --rw-r--r-- 0 root (0) root (0) 54171 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/logging.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 54413 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/logging.html │ │ │ -rw-r--r-- 0 root (0) root (0) 32835 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/mark.html │ │ │ --rw-r--r-- 0 root (0) root (0) 67819 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/monkeypatch.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 67963 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/monkeypatch.html │ │ │ -rw-r--r-- 0 root (0) root (0) 86948 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/output.html │ │ │ -rw-r--r-- 0 root (0) root (0) 46953 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/parametrize.html │ │ │ -rw-r--r-- 0 root (0) root (0) 39498 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/plugins.html │ │ │ -rw-r--r-- 0 root (0) root (0) 60400 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/skipping.html │ │ │ -rw-r--r-- 0 root (0) root (0) 33934 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/subtests.html │ │ │ --rw-r--r-- 0 root (0) root (0) 39111 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/tmp_path.html │ │ │ --rw-r--r-- 0 root (0) root (0) 46202 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/unittest.html │ │ │ --rw-r--r-- 0 root (0) root (0) 41021 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/usage.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 39500 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/tmp_path.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 47175 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/unittest.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 41268 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/usage.html │ │ │ -rw-r--r-- 0 root (0) root (0) 56542 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/writing_hook_functions.html │ │ │ --rw-r--r-- 0 root (0) root (0) 62689 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/writing_plugins.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 62808 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/writing_plugins.html │ │ │ -rw-r--r-- 0 root (0) root (0) 30927 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/how-to/xunit_setup.html │ │ │ -rw-r--r-- 0 root (0) root (0) 31234 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 24390 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/license.html │ │ │ -rw-r--r-- 0 root (0) root (0) 16533 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/objects.inv │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/proposals/ │ │ │ -rw-r--r-- 0 root (0) root (0) 35659 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/proposals/parametrize_with_fixtures.html │ │ │ -rw-r--r-- 0 root (0) root (0) 22408 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/py-modindex.html │ │ │ -rw-r--r-- 0 root (0) root (0) 22125 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/recwarn.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/reference/ │ │ │ --rw-r--r-- 0 root (0) root (0) 51343 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/reference/customize.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 51616 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/reference/customize.html │ │ │ -rw-r--r-- 0 root (0) root (0) 25457 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/reference/exit-codes.html │ │ │ --rw-r--r-- 0 root (0) root (0) 85511 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/reference/fixtures.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 85765 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/reference/fixtures.html │ │ │ -rw-r--r-- 0 root (0) root (0) 23795 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/reference/index.html │ │ │ -rw-r--r-- 0 root (0) root (0) 626087 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/reference/plugin_list.html │ │ │ --rw-r--r-- 0 root (0) root (0) 986172 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/reference/reference.html │ │ │ +-rw-r--r-- 0 root (0) root (0) 1057242 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/reference/reference.html │ │ │ -rw-r--r-- 0 root (0) root (0) 22192 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/search.html │ │ │ --rw-r--r-- 0 root (0) root (0) 555743 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/searchindex.js │ │ │ +-rw-r--r-- 0 root (0) root (0) 555729 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/searchindex.js │ │ │ -rw-r--r-- 0 root (0) root (0) 24590 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/sponsor.html │ │ │ -rw-r--r-- 0 root (0) root (0) 30739 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/talks.html │ │ │ -rw-r--r-- 0 root (0) root (0) 25992 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/tidelift.html │ │ │ -rw-r--r-- 0 root (0) root (0) 22850 2026-08-17 13:41:15.000000 ./usr/share/doc/python-pytest-doc/html/yieldfixture.html │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-08-17 13:41:15.000000 ./usr/share/doc/python3-pytest/ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2026-08-17 13:41:15.000000 ./usr/share/doc-base/ │ │ │ -rw-r--r-- 0 root (0) root (0) 325 2026-08-17 13:41:15.000000 ./usr/share/doc-base/python-pytest-doc.pytest │ │ ├── ./usr/share/doc/python-pytest-doc/html/changelog.html.gz │ │ │ ├── changelog.html │ │ │ │ @@ -352,15 +352,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Improvements in existing functionality

│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │

pytest 9.0.3 (2026-04-07)

│ │ │ │
│ │ │ │

Bug fixes

│ │ │ │
    │ │ │ │ -
  • #12444: Fixed pytest.approx() which now correctly takes into account Mapping keys order to compare them.

  • │ │ │ │ +
  • #12444: Fixed pytest.approx() which now correctly takes into account Mapping keys order to compare them.

  • │ │ │ │
  • #13634: Blocking a conftest.py file using the -p no: option is now explicitly disallowed.

    │ │ │ │

    Previously this resulted in an internal assertion failure during plugin loading.

    │ │ │ │

    Pytest now raises a clear UsageError explaining that conftest files are not plugins and cannot be disabled via -p.

    │ │ │ │
  • │ │ │ │
  • #13734: Fixed crash when a test raises an exceptiongroup with __tracebackhide__ = True.

  • │ │ │ │
  • #14195: Fixed an issue where non-string messages passed to unittest.TestCase.subTest() were not printed.

  • │ │ │ │
  • #14343: Fixed use of insecure temporary directory (CVE-2025-71176).

  • │ │ │ │ @@ -608,15 +608,15 @@ │ │ │ │ def test_py_files_contain_docstring(subtests: pytest.Subtests) -> None: │ │ │ │ for path in Path.cwd().glob("*.py"): │ │ │ │ with subtests.test(path=str(path)): │ │ │ │ assert contains_docstring(path) │ │ │ │ │ │ │ │ │ │ │ │

    Each assert failure or error is caught by the context manager and reported individually, giving a clear picture of all files that are missing a docstring.

    │ │ │ │ -

    In addition, unittest.TestCase.subTest() is now also supported.

    │ │ │ │ +

    In addition, unittest.TestCase.subTest() is now also supported.

    │ │ │ │

    This feature was originally implemented as a separate plugin in pytest-subtests, but since then has been merged into the core.

    │ │ │ │
    │ │ │ │

    Note

    │ │ │ │

    This feature is experimental and will likely evolve in future releases. By that we mean that we might change how subtests are reported on failure, but the functionality and how to use it are stable.

    │ │ │ │
    │ │ │ │ │ │ │ │
  • #13743: Added support for native TOML configuration files.

    │ │ │ │ @@ -758,15 +758,15 @@ │ │ │ │ See monkeypatch.syspath_prepend with legacy namespace packages for details.

  • │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

Bug fixes

│ │ │ │
    │ │ │ │
  • #13445: Made the type annotations of pytest.skip() and friends more spec-complaint to have them work across more type checkers.

  • │ │ │ │ -
  • #13537: Fixed a bug in which ExceptionGroup with only Skipped exceptions in teardown was not handled correctly and showed as error.

  • │ │ │ │ +
  • #13537: Fixed a bug in which ExceptionGroup with only Skipped exceptions in teardown was not handled correctly and showed as error.

  • │ │ │ │
  • #13598: Fixed possible collection confusion on Windows when short paths and symlinks are involved.

  • │ │ │ │
  • #13716: Fixed a bug where a nonsensical invocation like pytest x.py[a] (a file cannot be parametrized) was silently treated as pytest x.py. This is now a usage error.

  • │ │ │ │
  • #13722: Fixed a misleading assertion failure message when using pytest.approx() on mappings with differing lengths.

  • │ │ │ │
  • #13773: Fixed the static fixture closure calculation to properly consider transitive dependencies requested by overridden fixtures.

  • │ │ │ │
  • #13816: Fixed pytest.approx() which now returns a clearer error message when comparing mappings with different keys.

  • │ │ │ │
  • #13849: Hidden .pytest.ini files are now picked up as the config file even if empty. │ │ │ │ This was an inconsistency with non-hidden pytest.ini.

  • │ │ │ │ @@ -807,15 +807,15 @@ │ │ │ │
│ │ │ │
│ │ │ │

pytest 8.4.2 (2025-09-03)

│ │ │ │
│ │ │ │

Bug fixes

│ │ │ │
    │ │ │ │
  • #13478: Fixed a crash when using console_output_style with times and a module is skipped.

  • │ │ │ │ -
  • #13530: Fixed a crash when using pytest.approx() and decimal.Decimal instances with the decimal.FloatOperation trap set.

  • │ │ │ │ +
  • #13530: Fixed a crash when using pytest.approx() and decimal.Decimal instances with the decimal.FloatOperation trap set.

  • │ │ │ │
  • #13549: No longer evaluate type annotations in Python 3.14 when inspecting function signatures.

    │ │ │ │

    This prevents crashes during module collection when modules do not explicitly use from __future__ import annotations and import types for annotations within a if TYPE_CHECKING: block.

    │ │ │ │
  • │ │ │ │
  • #13559: Added missing int and float variants to the Literal type annotation of the type parameter in pytest.Parser.addini().

  • │ │ │ │
  • #13563: pytest.approx() now only imports numpy if NumPy is already in sys.modules. This fixes unconditional import behavior introduced in 8.4.0.

  • │ │ │ │
│ │ │ │
│ │ │ │ @@ -874,15 +874,15 @@ │ │ │ │
    │ │ │ │
  • #10839: Requesting an asynchronous fixture without a pytest_fixture_setup hook that resolves it will now give a DeprecationWarning. This most commonly happens if a sync test requests an async fixture. This should have no effect on a majority of users with async tests or fixtures using async pytest plugins, but may affect non-standard hook setups or autouse=True. For guidance on how to work around this warning see sync test depending on async fixture.

  • │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │

New features

│ │ │ │
    │ │ │ │ -
  • #11538: Added pytest.RaisesGroup as an equivalent to pytest.raises() for expecting ExceptionGroup. Also adds pytest.RaisesExc which is now the logic behind pytest.raises() and used as parameter to pytest.RaisesGroup. RaisesGroup includes the ability to specify multiple different expected exceptions, the structure of nested exception groups, and flags for emulating except*. See Assertions about expected exception groups and docstrings for more information.

  • │ │ │ │ +
  • #11538: Added pytest.RaisesGroup as an equivalent to pytest.raises() for expecting ExceptionGroup. Also adds pytest.RaisesExc which is now the logic behind pytest.raises() and used as parameter to pytest.RaisesGroup. RaisesGroup includes the ability to specify multiple different expected exceptions, the structure of nested exception groups, and flags for emulating except*. See Assertions about expected exception groups and docstrings for more information.

  • │ │ │ │
  • #12081: Added capteesys to capture AND pass output to next handler set by --capture=.

  • │ │ │ │
  • #12504: pytest.mark.xfail() now accepts pytest.RaisesGroup for the raises parameter when you expect an exception group. You can also pass a pytest.RaisesExc if you e.g. want to make use of the check parameter.

  • │ │ │ │
  • #12713: New --force-short-summary option to force condensed summary output regardless of verbosity level.

    │ │ │ │

    This lets users still see condensed summary output of failures for quick reference in log files from job outputs, being especially useful if non-condensed output is very verbose.

    │ │ │ │
  • │ │ │ │
  • #12749: pytest traditionally collects classes/functions in the test module namespace even if they are imported from another file.

    │ │ │ │

    For example:

    │ │ │ │ @@ -961,27 +961,27 @@ │ │ │ │
  • │ │ │ │
  • #12943: If a test fails with an exceptiongroup with a single exception, the contained exception will now be displayed in the short test summary info.

  • │ │ │ │
  • #12958: A number of unraisable enhancements:

    │ │ │ │
      │ │ │ │
    • Set the unraisable hook as early as possible and unset it as late as possible, to collect the most possible number of unraisable exceptions.

    • │ │ │ │
    • Call the garbage collector just before unsetting the unraisable hook, to collect any straggling exceptions.

    • │ │ │ │
    • Collect multiple unraisable exceptions per test phase.

    • │ │ │ │ -
    • Report the tracemalloc allocation traceback (if available).

    • │ │ │ │ -
    • Avoid using a generator based hook to allow handling StopIteration in test failures.

    • │ │ │ │ +
    • Report the tracemalloc allocation traceback (if available).

    • │ │ │ │ +
    • Avoid using a generator based hook to allow handling StopIteration in test failures.

    • │ │ │ │
    • Report the unraisable exception as the cause of the pytest.PytestUnraisableExceptionWarning exception if raised.

    • │ │ │ │
    • Compute the repr of the unraisable object in the unraisable hook so you get the latest information if available, and should help with resurrection of the object.

    • │ │ │ │
    │ │ │ │
  • │ │ │ │
  • #13010: pytest.approx() now can compare collections that contain numbers and non-numbers mixed.

  • │ │ │ │
  • #13016: A number of threadexception enhancements:

    │ │ │ │
      │ │ │ │
    • Set the excepthook as early as possible and unset it as late as possible, to collect the most possible number of unhandled exceptions from threads.

    • │ │ │ │
    • Collect multiple thread exceptions per test phase.

    • │ │ │ │ -
    • Report the tracemalloc allocation traceback (if available).

    • │ │ │ │ -
    • Avoid using a generator based hook to allow handling StopIteration in test failures.

    • │ │ │ │ +
    • Report the tracemalloc allocation traceback (if available).

    • │ │ │ │ +
    • Avoid using a generator based hook to allow handling StopIteration in test failures.

    • │ │ │ │
    • Report the thread exception as the cause of the pytest.PytestUnhandledThreadExceptionWarning exception if raised.

    • │ │ │ │
    • Extract the name of the thread object in the excepthook which should help with resurrection of the thread.

    • │ │ │ │
    │ │ │ │
  • │ │ │ │
  • #13031: An empty parameter set as in pytest.mark.parametrize([], ids=idfunc) will no longer trigger a call to idfunc with internal objects.

  • │ │ │ │
  • #13115: Allows supplying ExceptionGroup[Exception] and BaseExceptionGroup[BaseException] to pytest.raises to keep full typing on ExceptionInfo:

    │ │ │ │
    with pytest.raises(ExceptionGroup[Exception]) as exc_info:
    │ │ │ │ @@ -1002,15 +1002,15 @@
    │ │ │ │  

    Previously, at step 3, pytest would start from the beginning, forgetting the previously failed test.

    │ │ │ │

    This change however might cause issues if the --stepwise mode is used far apart in time, as the state might get stale, so the internal state will be reset automatically in case the test suite changes (for now only the number of tests are considered for this, we might change/improve this on the future).

    │ │ │ │
  • │ │ │ │
  • New --stepwise-reset/--sw-reset flag, allowing the user to explicitly reset the stepwise state and restart the workflow from the beginning.

  • │ │ │ │
│ │ │ │ │ │ │ │
  • #13308: Added official support for Python 3.14.

  • │ │ │ │ -
  • #13380: Fix ExceptionGroup traceback filtering to exclude pytest internals.

  • │ │ │ │ +
  • #13380: Fix ExceptionGroup traceback filtering to exclude pytest internals.

  • │ │ │ │
  • #13415: The author metadata of the BibTex example is now correctly formatted with last names following first names. │ │ │ │ An example of BibLaTex has been added. │ │ │ │ BibTex and BibLaTex examples now clearly indicate that what is cited is software.

    │ │ │ │

    -- by @willynilly

    │ │ │ │
  • │ │ │ │
  • #13420: Improved test collection performance by optimizing path resolution used in FSCollector.

  • │ │ │ │
  • #13457: The error message about duplicate parametrization no longer displays an internal stack trace.

  • │ │ │ │ @@ -1052,15 +1052,15 @@ │ │ │ │
  • #11067: The test report is now consistent regardless if the test xfailed via pytest.mark.xfail or pytest.fail().

    │ │ │ │

    Previously, xfailed tests via the marker would have the string "reason: " prefixed to the message, while those xfailed via the function did not. The prefix has been removed.

    │ │ │ │
  • │ │ │ │
  • #12008: In #11220, an unintended change in reordering was introduced by changing the way indices were assigned to direct params. More specifically, before that change, the indices of direct params to metafunc's callspecs were assigned after all parametrizations took place. Now, that change is reverted.

  • │ │ │ │
  • #12863: Fix applying markers, including pytest.mark.parametrize when placed above @staticmethod or @classmethod.

  • │ │ │ │
  • #12929: Handle StopIteration from test cases, setup and teardown correctly.

  • │ │ │ │
  • #12938: Fixed --durations-min argument not respected if -vv is used.

  • │ │ │ │ -
  • #12946: Fixed missing help for pdb commands wrapped by pytest -- by @adamchainz.

  • │ │ │ │ +
  • #12946: Fixed missing help for pdb commands wrapped by pytest -- by @adamchainz.

  • │ │ │ │
  • #12981: Prevent exceptions in pytest.Config.add_cleanup() callbacks preventing further cleanups.

  • │ │ │ │
  • #13047: Restore pytest.approx() handling of equality checks between bool and numpy.bool_ types.

    │ │ │ │

    Comparing bool and numpy.bool_ using pytest.approx() accidentally changed in version 8.3.4 and 8.3.5 to no longer match:

    │ │ │ │
    >>> import numpy as np
    │ │ │ │  >>> from pytest import approx
    │ │ │ │  >>> [np.True_, np.True_] == pytest.approx([True, True])
    │ │ │ │  False
    │ │ │ │ @@ -1144,15 +1144,15 @@
    │ │ │ │  
    │ │ │ │

    pytest 8.3.5 (2025-03-02)

    │ │ │ │
    │ │ │ │

    Bug fixes

    │ │ │ │
      │ │ │ │
    • #11777: Fixed issue where sequences were still being shortened even with -vv verbosity.

    • │ │ │ │
    • #12888: Fixed broken input when using Python 3.13+ and a libedit build of Python, such as on macOS or with uv-managed Python binaries from the python-build-standalone project. This could manifest e.g. by a broken prompt when using Pdb, or seeing empty inputs with manual usage of input() and suspended capturing.

    • │ │ │ │ -
    • #13026: Fixed AttributeError crash when using --import-mode=importlib when top-level directory same name as another module of the standard library.

    • │ │ │ │ +
    • #13026: Fixed AttributeError crash when using --import-mode=importlib when top-level directory same name as another module of the standard library.

    • │ │ │ │
    • #13053: Fixed a regression in pytest 8.3.4 where, when using --import-mode=importlib, a directory containing py file with the same name would cause an ImportError

    • │ │ │ │
    • #13083: Fixed issue where pytest could crash if one of the collected directories got removed during collection.

    • │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    Improved documentation

    │ │ │ │
      │ │ │ │ @@ -1171,15 +1171,15 @@ │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    pytest 8.3.4 (2024-12-01)

    │ │ │ │
    │ │ │ │

    Bug fixes

    │ │ │ │
      │ │ │ │ -
    • #12592: Fixed KeyError crash when using --import-mode=importlib in a directory layout where a directory contains a child directory with the same name.

    • │ │ │ │ +
    • #12592: Fixed KeyError crash when using --import-mode=importlib in a directory layout where a directory contains a child directory with the same name.

    • │ │ │ │
    • #12818: Assertion rewriting now preserves the source ranges of the original instructions, making it play well with tools that deal with the AST, like executing.

    • │ │ │ │
    • #12849: ANSI escape codes for colored output now handled correctly in pytest.fail() with pytrace=False.

    • │ │ │ │
    • #9353: pytest.approx() now uses strict equality when given booleans.

    • │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    Improved documentation

    │ │ │ │ @@ -1256,15 +1256,15 @@ │ │ │ │

    Some history:

    │ │ │ │

    With pytest 8.0, -rx or -ra would not only turn on summary reports for xfail, but also report the tracebacks for xfail results. This caused issues with some projects that utilize xfail, but don't want to see all of the xfail tracebacks.

    │ │ │ │

    This change detaches xfail tracebacks from -rx, and now we turn on xfail tracebacks with --xfail-tb. With this, the default -rx/ -ra behavior is identical to pre-8.0 with respect to xfail tracebacks. While this is a behavior change, it brings default behavior back to pre-8.0.0 behavior, which ultimately was considered the better course of action.

    │ │ │ │

    -- by @okken

    │ │ │ │
  • │ │ │ │
  • #12281: Added support for keyword matching in marker expressions.

    │ │ │ │

    Now tests can be selected by marker keyword arguments. │ │ │ │ -Supported values are int, (unescaped) str, bool & None.

    │ │ │ │ +Supported values are int, (unescaped) str, bool & None.

    │ │ │ │

    See marker examples for more information.

    │ │ │ │

    -- by @lovetheguitar

    │ │ │ │
  • │ │ │ │
  • #12567: Added --no-fold-skipped command line option.

    │ │ │ │

    If this option is set, then skipped tests in short summary are no longer grouped │ │ │ │ by reason but all tests are printed individually with their nodeid in the same │ │ │ │ way as other statuses.

    │ │ │ │ @@ -1273,15 +1273,15 @@ │ │ │ │ │ │ │ │
  • │ │ │ │
    │ │ │ │

    Improvements in existing functionality

    │ │ │ │
      │ │ │ │
    • #12469: The console output now uses the "third-party plugins" terminology, │ │ │ │ replacing the previously established but confusing and outdated │ │ │ │ -reference to setuptools │ │ │ │ +reference to setuptools │ │ │ │ -- by @webknjaz.

    • │ │ │ │
    • #12544, #12545: Python virtual environment detection was improved by │ │ │ │ checking for a pyvenv.cfg file, ensuring reliable detection on │ │ │ │ various platforms -- by @zachsnickers.

    • │ │ │ │
    • #2871: Do not truncate arguments to functions in output when running with -vvv.

    • │ │ │ │
    • #389: The readability of assertion introspection of bound methods has been enhanced │ │ │ │ -- by @farbodahm, @webknjaz, @obestwalter, @flub │ │ │ │ @@ -1323,27 +1323,27 @@ │ │ │ │

      │ │ │ │

      Bug fixes

      │ │ │ │
        │ │ │ │
      • #11706: Fixed reporting of teardown errors in higher-scoped fixtures when using --maxfail or --stepwise.

        │ │ │ │

        Originally added in pytest 8.0.0, but reverted in 8.0.2 due to a regression in pytest-xdist. │ │ │ │ This regression was fixed in pytest-xdist 3.6.1.

        │ │ │ │
      • │ │ │ │ -
      • #11797: pytest.approx() now correctly handles Sequence-like objects.

      • │ │ │ │ +
      • #11797: pytest.approx() now correctly handles Sequence-like objects.

      • │ │ │ │
      • #12204, #12264: Fixed a regression in pytest 8.0 where tracebacks get longer and longer when multiple │ │ │ │ tests fail due to a shared higher-scope fixture which raised -- by @bluetech.

        │ │ │ │

        Also fixed a similar regression in pytest 5.4 for collectors which raise during setup.

        │ │ │ │

        The fix necessitated internal changes which may affect some plugins:

        │ │ │ │
          │ │ │ │
        • FixtureDef.cached_result[2] is now a tuple (exc, tb) │ │ │ │ instead of exc.

        • │ │ │ │
        • SetupState.stack failures are now a tuple (exc, tb) │ │ │ │ instead of exc.

        • │ │ │ │
        │ │ │ │
      • │ │ │ │ -
      • #12275: Fixed collection error upon encountering an abstract class, including abstract unittest.TestCase subclasses.

      • │ │ │ │ +
      • #12275: Fixed collection error upon encountering an abstract class, including abstract unittest.TestCase subclasses.

      • │ │ │ │
      • #12328: Fixed a regression in pytest 8.0.0 where package-scoped parameterized items were not correctly reordered to minimize setups/teardowns in some cases.

      • │ │ │ │
      • #12424: Fixed crash with assert testcase is not None assertion failure when re-running unittest tests using plugins like pytest-rerunfailures. Regressed in 8.2.2.

      • │ │ │ │
      • #12472: Fixed a crash when returning category "error" or "failed" with a custom test status from pytest_report_teststatus hook -- @pbrezina.

      • │ │ │ │
      • #12505: Improved handling of invalid regex patterns in pytest.raises(match=r'...') by providing a clear error message.

      • │ │ │ │
      • #12580: Fixed a crash when using the cache class on Windows and the cache directory was created concurrently.

      • │ │ │ │
      • #6962: Parametrization parameters are now compared using == instead of is (is is still used as a fallback if the parameter does not support ==). │ │ │ │ This fixes use of parameters such as lists, which have a different id but compare equal, causing fixtures to be re-computed instead of being cached.

      • │ │ │ │ @@ -1351,15 +1351,15 @@ │ │ │ │
      │ │ │ │
      │ │ │ │
      │ │ │ │

      Improved documentation

      │ │ │ │
        │ │ │ │
      • #12153: Documented using PYTEST_VERSION to detect if code is running from within a pytest run.

      • │ │ │ │
      • #12469: The external plugin mentions in the documentation now avoid mentioning │ │ │ │ -setuptools entry-points as the concept is │ │ │ │ +setuptools entry-points as the concept is │ │ │ │ much more generic nowadays. Instead, the terminology of "external", │ │ │ │ "installed", or "third-party" plugins (or packages) replaces that.

        │ │ │ │

        -- by @webknjaz

        │ │ │ │
      • │ │ │ │
      • #12577: CI and BUILD_NUMBER environment variables role is described in │ │ │ │ the reference doc. They now also appear when doing pytest -h │ │ │ │ -- by @MarcBresson.

      • │ │ │ │ @@ -1477,19 +1477,19 @@ │ │ │ │
      │ │ │ │
    │ │ │ │
    │ │ │ │

    pytest 8.2.0 (2024-04-27)

    │ │ │ │
    │ │ │ │

    Breaking Changes

    │ │ │ │
      │ │ │ │ -
    • #12089: pytest now requires that unittest.TestCase subclasses can be instantiated freely using MyTestCase('runTest').

      │ │ │ │ +
    • #12089: pytest now requires that unittest.TestCase subclasses can be instantiated freely using MyTestCase('runTest').

      │ │ │ │

      If the class doesn't allow this, you may see an error during collection such as AttributeError: 'MyTestCase' object has no attribute 'runTest'.

      │ │ │ │

      Classes which do not override __init__, or do not access the test method in __init__ using getattr or similar, are unaffected.

      │ │ │ │

      Classes which do should take care to not crash when "runTest" is given, as is shown in unittest.TestCases's implementation. │ │ │ │ -Alternatively, consider using setUp instead of __init__.

      │ │ │ │ +Alternatively, consider using setUp instead of __init__.

      │ │ │ │

      If you run into this issue using tornado.AsyncTestCase, please see issue 12263.

      │ │ │ │

      If you run into this issue using an abstract TestCase subclass, please see issue 12275.

      │ │ │ │

      Historical note: the effect of this change on custom TestCase implementations was not properly considered initially, this is why it was done in a minor release. We apologize for the inconvenience.

      │ │ │ │
    • │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │ @@ -1516,19 +1516,19 @@ │ │ │ │

    See Read arguments from file for details.

    │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │

    Improvements

    │ │ │ │
      │ │ │ │ -
    • #11523: pytest.importorskip() will now issue a warning if the module could be found, but raised ImportError instead of ModuleNotFoundError.

      │ │ │ │ +
    • #11523: pytest.importorskip() will now issue a warning if the module could be found, but raised ImportError instead of ModuleNotFoundError.

      │ │ │ │

      The warning can be suppressed by passing exc_type=ImportError to pytest.importorskip().

      │ │ │ │

      See pytest.importorskip default behavior regarding ImportError for details.

      │ │ │ │
    • │ │ │ │ -
    • #11728: For unittest-based tests, exceptions during class cleanup (as raised by functions registered with TestCase.addClassCleanup) are now reported instead of silently failing.

    • │ │ │ │ +
    • #11728: For unittest-based tests, exceptions during class cleanup (as raised by functions registered with TestCase.addClassCleanup) are now reported instead of silently failing.

    • │ │ │ │
    • #11777: Text is no longer truncated in the short test summary info section when -vv is given.

    • │ │ │ │
    • #12112: Improved namespace packages detection when consider_namespace_packages is enabled, covering more situations (like editable installs).

    • │ │ │ │
    • #9502: Added PYTEST_VERSION environment variable which is defined at the start of the pytest session and undefined afterwards. It contains the value of pytest.__version__, and among other things can be used to easily check if code is running from within a pytest run.

    • │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    Bug Fixes

    │ │ │ │ @@ -1575,27 +1575,27 @@ │ │ │ │
  • #11653: Added the new verbosity_test_cases configuration option for fine-grained control of test execution verbosity. │ │ │ │ See Fine-grained verbosity for more details.

  • │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │

    Improvements

    │ │ │ │
      │ │ │ │ -
    • #10865: pytest.warns() now validates that warnings.warn() was called with a str or a Warning. │ │ │ │ -Currently in Python it is possible to use other types, however this causes an exception when warnings.filterwarnings() is used to filter those warnings (see CPython #103577 for a discussion). │ │ │ │ +

    • #10865: pytest.warns() now validates that warnings.warn() was called with a str or a Warning. │ │ │ │ +Currently in Python it is possible to use other types, however this causes an exception when warnings.filterwarnings() is used to filter those warnings (see CPython #103577 for a discussion). │ │ │ │ While this can be considered a bug in CPython, we decided to put guards in pytest as the error message produced without this check in place is confusing.

    • │ │ │ │
    • #11311: When using --override-ini for paths in invocations without a configuration file defined, the current working directory is used │ │ │ │ as the relative directory.

      │ │ │ │ -

      Previously this would raise an AssertionError.

      │ │ │ │ +

      Previously this would raise an AssertionError.

      │ │ │ │
    • │ │ │ │ -
    • #11475: --import-mode=importlib now tries to import modules using the standard import mechanism (but still without changing sys.path), falling back to importing modules directly only if that fails.

      │ │ │ │ +
    • #11475: --import-mode=importlib now tries to import modules using the standard import mechanism (but still without changing sys.path), falling back to importing modules directly only if that fails.

      │ │ │ │

      This means that installed packages will be imported under their canonical name if possible first, for example app.core.models, instead of having the module name always be derived from their path (for example .env310.lib.site_packages.app.core.models).

      │ │ │ │
    • │ │ │ │
    • #11801: Added the iter_parents() helper method on nodes. │ │ │ │ It is similar to listchain, but goes from bottom to top, and returns an iterator, not a list.

    • │ │ │ │ -
    • #11850: Added support for sys.last_exc for post-mortem debugging on Python>=3.12.

    • │ │ │ │ +
    • #11850: Added support for sys.last_exc for post-mortem debugging on Python>=3.12.

    • │ │ │ │
    • #11962: In case no other suitable candidates for configuration file are found, a pyproject.toml (even without a [tool.pytest.ini_options] table) will be considered as the configuration file and define the rootdir.

    • │ │ │ │
    • #11978: Add --log-file-mode option to the logging plugin, enabling appending to log-files. This option accepts either "w" or "a" and defaults to "w".

      │ │ │ │

      Previously, the mode was hard-coded to be "w" which truncates the file before logging.

      │ │ │ │
    • │ │ │ │
    • #12047: When multiple finalizers of a fixture raise an exception, now all exceptions are reported as an exception group. │ │ │ │ Previously, only the first exception was reported.

    • │ │ │ │
    │ │ │ │ @@ -1662,15 +1662,15 @@ │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    pytest 8.0.1 (2024-02-16)

    │ │ │ │
    │ │ │ │

    Bug Fixes

    │ │ │ │
      │ │ │ │ -
    • #11875: Correctly handle errors from getpass.getuser() in Python 3.13.

    • │ │ │ │ +
    • #11875: Correctly handle errors from getpass.getuser() in Python 3.13.

    • │ │ │ │
    • #11879: Fix an edge case where ExceptionInfo._stringify_exception could crash pytest.raises().

    • │ │ │ │
    • #11906: Fix regression with pytest.warns() using custom warning subclasses which have more than one parameter in their __init__.

    • │ │ │ │
    • #11907: Fix a regression in pytest 8.0.0 whereby calling pytest.skip() and similar control-flow exceptions within a pytest.warns() block would get suppressed instead of propagating.

    • │ │ │ │
    • #11929: Fix a regression in pytest 8.0.0 whereby autouse fixtures defined in a module get ignored by the doctests in the module.

    • │ │ │ │
    • #11937: Fix a regression in pytest 8.0.0 whereby items would be collected in reverse order in some circumstances.

    • │ │ │ │
    │ │ │ │
    │ │ │ │ @@ -1840,15 +1840,15 @@ │ │ │ │ <Package zzz> │ │ │ │ <Module test_zzz.py> │ │ │ │ <Function test_it> │ │ │ │ │ │ │ │ │ │ │ │

    Code/plugins which rely on a specific shape of the collection tree might need to update.

    │ │ │ │ │ │ │ │ -
  • #11676: The classes Node, Collector, Item, File, FSCollector are now marked abstract (see abc).

    │ │ │ │ +
  • #11676: The classes Node, Collector, Item, File, FSCollector are now marked abstract (see abc).

    │ │ │ │

    We do not expect this change to affect users and plugin authors, it will only cause errors when the code is already wrong or problematic.

    │ │ │ │
  • │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │

    Other breaking changes

    │ │ │ │

    These are breaking changes where deprecation was not possible.

    │ │ │ │ @@ -1916,15 +1916,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │

    Additional Support For Exception Groups and __notes__

    │ │ │ │

    These changes improve pytest's support for exception groups.

    │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │

    Custom Directory collectors

    │ │ │ │ @@ -1949,16 +1949,16 @@ │ │ │ │
    │ │ │ │

    Other Improvements

    │ │ │ │
      │ │ │ │
    • #11216: If a test is skipped from inside an xunit setup fixture, the test summary now shows the test location instead of the fixture location.

    • │ │ │ │
    • #11314: Logging to a file using the --log-file option will use --log-level, --log-format and --log-date-format as fallback │ │ │ │ if --log-file-level, --log-file-format and --log-file-date-format are not provided respectively.

    • │ │ │ │
    • #11610: Added the LogCaptureFixture.filtering() context manager which │ │ │ │ -adds a given logging.Filter object to the caplog fixture.

    • │ │ │ │ -
    • #11447: pytest.deprecated_call() now also considers warnings of type FutureWarning.

    • │ │ │ │ +adds a given logging.Filter object to the caplog fixture.

      │ │ │ │ +
    • #11447: pytest.deprecated_call() now also considers warnings of type FutureWarning.

    • │ │ │ │
    • #11600: Improved the documentation and type signature for pytest.mark.xfail's condition param to use False as the default value.

    • │ │ │ │
    • #7469: FixtureDef is now exported as pytest.FixtureDef for typing purposes.

    • │ │ │ │
    • #11353: Added typing to PytestPluginManager.

    • │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │ @@ -2006,15 +2006,15 @@ │ │ │ │
    │ │ │ │
    │ │ │ │

    pytest 7.4.4 (2023-12-31)

    │ │ │ │
    │ │ │ │

    Bug Fixes

    │ │ │ │
      │ │ │ │
    • #11140: Fix non-string constants at the top of file being detected as docstrings on Python>=3.8.

    • │ │ │ │ -
    • #11572: Handle an edge case where sys.stderr and sys.__stderr__ might already be closed when Fault Handler is tearing down.

    • │ │ │ │ +
    • #11572: Handle an edge case where sys.stderr and sys.__stderr__ might already be closed when Fault Handler is tearing down.

    • │ │ │ │
    • #11710: Fixed tracebacks from collection errors not getting pruned.

    • │ │ │ │
    • #7966: Removed unhelpful error message from assertion rewrite mechanism when exceptions are raised in __iter__ methods. Now they are treated un-iterable instead.

    • │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    Improved Documentation

    │ │ │ │
      │ │ │ │ @@ -2025,15 +2025,15 @@ │ │ │ │
      │ │ │ │

      pytest 7.4.3 (2023-10-24)

      │ │ │ │
      │ │ │ │

      Bug Fixes

      │ │ │ │
        │ │ │ │
      • #10447: Markers are now considered in the reverse mro order to ensure base class markers are considered first -- this resolves a regression.

      • │ │ │ │
      • #11239: Fixed := in asserts impacting unrelated test cases.

      • │ │ │ │ -
      • #11439: Handled an edge case where sys.stderr might already be closed when Fault Handler is tearing down.

      • │ │ │ │ +
      • #11439: Handled an edge case where sys.stderr might already be closed when Fault Handler is tearing down.

      • │ │ │ │
      │ │ │ │
      │ │ │ │
      │ │ │ │
      │ │ │ │

      pytest 7.4.2 (2023-09-07)

      │ │ │ │
      │ │ │ │

      Bug Fixes

      │ │ │ │ @@ -2184,15 +2184,15 @@ │ │ │ │ the hidden text. The line number shown has also been fixed.

      │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    Bug Fixes

    │ │ │ │
      │ │ │ │
    • #10743: The assertion rewriting mechanism now works correctly when assertion expressions contain the walrus operator.

    • │ │ │ │ -
    • #10765: Fixed tmp_path fixture always raising OSError on emscripten platform due to missing os.getuid().

    • │ │ │ │ +
    • #10765: Fixed tmp_path fixture always raising OSError on emscripten platform due to missing os.getuid().

    • │ │ │ │
    • #1904: Correctly handle __tracebackhide__ for chained exceptions. │ │ │ │ NOTE: This change was reverted in version 7.3.1.

    • │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    Improved Documentation

    │ │ │ │
      │ │ │ │ @@ -2285,44 +2285,44 @@ │ │ │ │ │ │ │ │
    • #10381: The --no-showlocals flag has been added. This can be passed directly to tests to override --showlocals declared through addopts.

    • │ │ │ │
    • #3426: Assertion failures with strings in NFC and NFD forms that normalize to the same string now have a dedicated error message detailing the issue, and their utf-8 representation is expressed instead.

    • │ │ │ │
    • #8508: Introduce multiline display for warning matching via pytest.warns() and │ │ │ │ enhance match comparison for pytest.ExceptionInfo.match() as returned by pytest.raises().

    • │ │ │ │
    • #8646: Improve pytest.raises(). Previously passing an empty tuple would give a confusing │ │ │ │ error. We now raise immediately with a more helpful message.

    • │ │ │ │ -
    • #9741: On Python 3.11, use the standard library's tomllib to parse TOML.

      │ │ │ │ +
    • #9741: On Python 3.11, use the standard library's tomllib to parse TOML.

      │ │ │ │

      tomli is no longer a dependency on Python 3.11.

      │ │ │ │
    • │ │ │ │
    • #9742: Display assertion message without escaped newline characters with -vv.

    • │ │ │ │
    • #9823: Improved error message that is shown when no collector is found for a given file.

    • │ │ │ │
    • #9873: Some coloring has been added to the short test summary.

    • │ │ │ │
    • #9883: Normalize the help description of all command-line options.

    • │ │ │ │
    • #9920: Display full crash messages in short test summary info, when running in a CI environment.

    • │ │ │ │
    • #9987: Added support for hidden configuration file by allowing .pytest.ini as an alternative to pytest.ini.

    • │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    Bug Fixes

    │ │ │ │
      │ │ │ │ -
    • #10150: sys.stdin now contains all expected methods of a file-like object when capture is enabled.

    • │ │ │ │ +
    • #10150: sys.stdin now contains all expected methods of a file-like object when capture is enabled.

    • │ │ │ │
    • #10382: Do not break into pdb when raise unittest.SkipTest() appears top-level in a file.

    • │ │ │ │
    • #7792: Marks are now inherited according to the full MRO in test classes. Previously, if a test class inherited from two or more classes, only marks from the first super-class would apply.

      │ │ │ │

      When inheriting marks from super-classes, marks from the sub-classes are now ordered before marks from the super-classes, in MRO order. Previously it was the reverse.

      │ │ │ │

      When inheriting marks from super-classes, the pytestmark attribute of the sub-class now only contains the marks directly applied to it. Previously, it also contained marks from its super-classes. Please note that this attribute should not normally be accessed directly; use Node.iter_markers instead.

      │ │ │ │
    • │ │ │ │
    • #9159: Showing inner exceptions by forcing native display in ExceptionGroups even when using display options other than --tb=native. A temporary step before full implementation of pytest-native display for inner exceptions in ExceptionGroups.

    • │ │ │ │
    • #9877: Ensure caplog.get_records(when) returns current/correct data after invoking caplog.clear().

    • │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    Improved Documentation

    │ │ │ │
      │ │ │ │
    • #10344: Update information on writing plugins to use pyproject.toml instead of setup.py.

    • │ │ │ │
    • #9248: The documentation is now built using Sphinx 5.x (up from 3.x previously).

    • │ │ │ │ -
    • #9291: Update documentation on how pytest.warns() affects DeprecationWarning.

    • │ │ │ │ +
    • #9291: Update documentation on how pytest.warns() affects DeprecationWarning.

    • │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    Trivial/Internal Changes

    │ │ │ │
      │ │ │ │
    • #10313: Made _pytest.doctest.DoctestItem export pytest.DoctestItem for │ │ │ │ type check and runtime purposes. Made _pytest.doctest use internal APIs │ │ │ │ @@ -2410,30 +2410,30 @@ │ │ │ │

      Improvements

      │ │ │ │
        │ │ │ │
      • #5192: Fixed test output for some data types where -v would show less information.

        │ │ │ │

        Also, when showing diffs for sequences, -q would produce full diffs instead of the expected diff.

        │ │ │ │
      • │ │ │ │
      • #9362: pytest now avoids specialized assert formatting when it is detected that the default __eq__ is overridden in attrs or dataclasses.

      • │ │ │ │
      • #9536: When -vv is given on command line, show skipping and xfail reasons in full instead of truncating them to fit the terminal width.

      • │ │ │ │ -
      • #9644: More information about the location of resources that led Python to raise ResourceWarning can now │ │ │ │ -be obtained by enabling tracemalloc.

        │ │ │ │ +
      • #9644: More information about the location of resources that led Python to raise ResourceWarning can now │ │ │ │ +be obtained by enabling tracemalloc.

        │ │ │ │

        See Resource Warnings for more information.

        │ │ │ │
      • │ │ │ │
      • #9678: More types are now accepted in the ids argument to @pytest.mark.parametrize. │ │ │ │ Previously only str, float, int and bool were accepted; │ │ │ │ now bytes, complex, re.Pattern, Enum and anything with a __name__ are also accepted.

      • │ │ │ │ -
      • #9692: pytest.approx() now raises a TypeError when given an unordered sequence (such as set).

        │ │ │ │ +
      • #9692: pytest.approx() now raises a TypeError when given an unordered sequence (such as set).

        │ │ │ │

        Note that this implies that custom classes which only implement __iter__ and __len__ are no longer supported as they don't guarantee order.

        │ │ │ │
      • │ │ │ │
      │ │ │ │
    │ │ │ │
    │ │ │ │

    Bug Fixes

    │ │ │ │
      │ │ │ │ -
    • #8242: The deprecation of raising unittest.SkipTest to skip collection of │ │ │ │ +

    • #8242: The deprecation of raising unittest.SkipTest to skip collection of │ │ │ │ tests during the pytest collection phase is reverted - this is now a supported │ │ │ │ feature again.

    • │ │ │ │
    • #9493: Symbolic link components are no longer resolved in conftest paths. │ │ │ │ This means that if a conftest appears twice in collection tree, using symlinks, it will be executed twice. │ │ │ │ For example, given

      │ │ │ │
      │ │ │ │

      tests/real/conftest.py │ │ │ │ @@ -2442,15 +2442,15 @@ │ │ │ │

      │ │ │ │

      running pytest tests now imports the conftest twice, once as tests/real/conftest.py and once as tests/link/conftest.py. │ │ │ │ This is a fix to match a similar change made to test collection itself in pytest 6.0 (see #6523 for details).

      │ │ │ │
    • │ │ │ │
    • #9626: Fixed count of selected tests on terminal collection summary when there were errors or skipped modules.

      │ │ │ │

      If there were errors or skipped modules on collection, pytest would mistakenly subtract those from the selected count.

      │ │ │ │
    • │ │ │ │ -
    • #9645: Fixed regression where --import-mode=importlib used together with PYTHONPATH or pythonpath would cause import errors in test suites.

    • │ │ │ │ +
    • #9645: Fixed regression where --import-mode=importlib used together with PYTHONPATH or pythonpath would cause import errors in test suites.

    • │ │ │ │
    • #9708: pytester now requests a monkeypatch fixture instead of creating one internally. This solves some issues with tests that involve pytest environment variables.

    • │ │ │ │
    • #9730: Malformed pyproject.toml files now produce a clearer error message.

    • │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    pytest 7.0.1 (2022-02-11)

    │ │ │ │ @@ -2582,20 +2582,20 @@ │ │ │ │
  • _pytest._code.ExceptionInfo

  • │ │ │ │
  • _pytest.config.argparsing.Parser

  • │ │ │ │
  • _pytest.config.argparsing.OptionGroup

  • │ │ │ │
  • _pytest.pytester.HookRecorder

  • │ │ │ │ │ │ │ │

    These constructors have always been considered private, but now issue a deprecation warning, which may become a hard error in pytest 8.

    │ │ │ │ │ │ │ │ -
  • #8242: Raising unittest.SkipTest to skip collection of tests during the │ │ │ │ +

  • #8242: Raising unittest.SkipTest to skip collection of tests during the │ │ │ │ pytest collection phase is deprecated. Use pytest.skip() instead.

    │ │ │ │ -

    Note: This deprecation only relates to using unittest.SkipTest during test │ │ │ │ +

    Note: This deprecation only relates to using unittest.SkipTest during test │ │ │ │ collection. You are probably not doing that. Ordinary usage of │ │ │ │ -unittest.SkipTest / unittest.TestCase.skipTest() / │ │ │ │ -unittest.skip() in unittest test cases is fully supported.

    │ │ │ │ +unittest.SkipTest / unittest.TestCase.skipTest() / │ │ │ │ +unittest.skip() in unittest test cases is fully supported.

    │ │ │ │
    │ │ │ │

    Note

    │ │ │ │

    This deprecation has been reverted in pytest 7.1.0.

    │ │ │ │
    │ │ │ │
  • │ │ │ │
  • #8315: Several behaviors of Parser.addoption are now │ │ │ │ scheduled for removal in pytest 8 (deprecated since pytest 2.4.0):

    │ │ │ │ @@ -2633,19 +2633,19 @@ │ │ │ │

    Features

    │ │ │ │
      │ │ │ │
    • #5196: Tests are now ordered by definition order in more cases.

      │ │ │ │

      In a class hierarchy, tests from base classes are now consistently ordered before tests defined on their subclasses (reverse MRO order).

      │ │ │ │
    • │ │ │ │
    • #7132: Added two environment variables PYTEST_THEME and PYTEST_THEME_MODE to let the users customize the pygments theme used.

    • │ │ │ │
    • #7259: Added cache.mkdir(), which is similar to the existing cache.makedir(), │ │ │ │ -but returns a pathlib.Path instead of a legacy py.path.local.

      │ │ │ │ +but returns a pathlib.Path instead of a legacy py.path.local.

      │ │ │ │

      Added a paths type to parser.addini(), │ │ │ │ as in parser.addini("mypaths", "my paths", type="paths"), │ │ │ │ which is similar to the existing pathlist, │ │ │ │ -but returns a list of pathlib.Path instead of legacy py.path.local.

      │ │ │ │ +but returns a list of pathlib.Path instead of legacy py.path.local.

      │ │ │ │
    • │ │ │ │
    • #7469: The types of objects used in pytest's API are now exported so they may be used in type annotations.

      │ │ │ │

      The newly-exported types are:

      │ │ │ │
        │ │ │ │
      • pytest.Config for Config.

      • │ │ │ │
      • pytest.Mark for marks.

      • │ │ │ │
      • pytest.MarkDecorator for mark decorators.

      • │ │ │ │ @@ -2664,15 +2664,15 @@ │ │ │ │
      • pytest.CollectReport for the CollectReport type used in various hooks.

      • │ │ │ │
      │ │ │ │

      Constructing most of them directly is not supported; they are only meant for use in type annotations. │ │ │ │ Doing so will emit a deprecation warning, and may become a hard-error in pytest 8.0.

      │ │ │ │

      Subclassing them is also not supported. This is not currently enforced at runtime, but is detected by type-checkers such as mypy.

      │ │ │ │
    • │ │ │ │
    • #7856: --import-mode=importlib now works with features that │ │ │ │ -depend on modules being on sys.modules, such as pickle and dataclasses.

    • │ │ │ │ +depend on modules being on sys.modules, such as pickle and dataclasses.

      │ │ │ │
    • #8144: The following hooks now receive an additional pathlib.Path argument, equivalent to an existing py.path.local argument:

      │ │ │ │
        │ │ │ │
      • pytest_ignore_collect - The collection_path parameter (equivalent to existing path parameter).

      • │ │ │ │
      • pytest_collect_file - The file_path parameter (equivalent to existing path parameter).

      • │ │ │ │
      • pytest_pycollect_makemodule - The module_path parameter (equivalent to existing path parameter).

      • │ │ │ │
      • pytest_report_header - The start_path parameter (equivalent to existing startdir parameter).

      • │ │ │ │
      • pytest_report_collectionfinish - The start_path parameter (equivalent to existing startdir parameter).

      • │ │ │ │ @@ -2695,35 +2695,35 @@ │ │ │ │ new attribute being path) is the opposite of the situation for hooks │ │ │ │ (the old argument being path).

        │ │ │ │

        This is an unfortunate artifact due to historical reasons, which should be │ │ │ │ resolved in future versions as we slowly get rid of the py │ │ │ │ dependency (see #9283 for a longer discussion).

        │ │ │ │ │ │ │ │ │ │ │ │ -
      • #8421: pytest.approx() now works on Decimal within mappings/dicts and sequences/lists.

      • │ │ │ │ +
      • #8421: pytest.approx() now works on Decimal within mappings/dicts and sequences/lists.

      • │ │ │ │
      • #8606: pytest invocations with --fixtures-per-test and --fixtures have been enriched with:

        │ │ │ │
          │ │ │ │
        • Fixture location path printed with the fixture name.

        • │ │ │ │
        • First section of the fixture's docstring printed under the fixture name.

        • │ │ │ │
        • Whole of fixture's docstring printed under the fixture name using --verbose option.

        • │ │ │ │
        │ │ │ │
      • │ │ │ │
      • #8761: New pytest.version_tuple attribute, which makes it simpler for users to do something depending on the pytest version (such as declaring hooks which are introduced in later versions).

      • │ │ │ │
      • #8789: Switch TOML parser from toml to tomli for TOML v1.0.0 support in pyproject.toml.

      • │ │ │ │
      • #8920: Added pytest.Stash, a facility for plugins to store their data on Config and Nodes in a type-safe and conflict-free manner. │ │ │ │ See Storing data on items across hook functions for details.

      • │ │ │ │
      • #8953: RunResult method assert_outcomes() now accepts a │ │ │ │ warnings argument to assert the total number of warnings captured.

      • │ │ │ │ -
      • #8954: --debug flag now accepts a str file to route debug logs into, remains defaulted to pytestdebug.log.

      • │ │ │ │ +
      • #8954: --debug flag now accepts a str file to route debug logs into, remains defaulted to pytestdebug.log.

      • │ │ │ │
      • #9023: Full diffs are now always shown for equality assertions of iterables when │ │ │ │ CI or BUILD_NUMBER is found in the environment, even when -v isn't │ │ │ │ used.

      • │ │ │ │
      • #9113: RunResult method assert_outcomes() now accepts a │ │ │ │ deselected argument to assert the total number of deselected tests.

      • │ │ │ │ -
      • #9114: Added pythonpath setting that adds listed paths to sys.path for the duration of the test session. If you currently use the pytest-pythonpath or pytest-srcpaths plugins, you should be able to replace them with built-in pythonpath setting.

      • │ │ │ │ +
      • #9114: Added pythonpath setting that adds listed paths to sys.path for the duration of the test session. If you currently use the pytest-pythonpath or pytest-srcpaths plugins, you should be able to replace them with built-in pythonpath setting.

      • │ │ │ │
      │ │ │ │
  • │ │ │ │
    │ │ │ │

    Improvements

    │ │ │ │
      │ │ │ │
    • #7480: A deprecation scheduled to be removed in a major version X (e.g. pytest 7, 8, 9, ...) now uses warning category PytestRemovedInXWarning, │ │ │ │ a subclass of PytestDeprecationWarning, │ │ │ │ @@ -2746,15 +2746,15 @@ │ │ │ │ │ │ │ │

    • │ │ │ │
    • #8403: By default, pytest will truncate long strings in assert errors so they don't clutter the output too much, │ │ │ │ currently at 240 characters by default.

      │ │ │ │

      However, in some cases the longer output helps, or is even crucial, to diagnose a failure. Using -v will │ │ │ │ now increase the truncation threshold to 2400 characters, and -vv or higher will disable truncation entirely.

      │ │ │ │
    • │ │ │ │ -
    • #8509: Fixed issue where unittest.TestCase.setUpClass() is not called when a test has / in its name since pytest 6.2.0.

      │ │ │ │ +
    • #8509: Fixed issue where unittest.TestCase.setUpClass() is not called when a test has / in its name since pytest 6.2.0.

      │ │ │ │

      This refers to the path part in pytest node IDs, e.g. TestClass::test_it in the node ID tests/test_file.py::TestClass::test_it.

      │ │ │ │

      Now, instead of assuming that the test name does not contain /, it is assumed that test path does not contain ::. We plan to hopefully make both of these work in the future.

      │ │ │ │
    • │ │ │ │
    • #8803: It is now possible to add colors to custom log levels on cli log.

      │ │ │ │

      By using add_color_level from a pytest_configure hook, colors can be added:

      │ │ │ │
      logging_plugin = config.pluginmanager.get_plugin('logging-plugin')
      │ │ │ │  logging_plugin.log_cli_handler.formatter.add_color_level(logging.INFO, 'cyan')
      │ │ │ │ @@ -2774,15 +2774,15 @@
      │ │ │ │  
        │ │ │ │
      • #7124: Fixed an issue where __main__.py would raise an ImportError when --doctest-modules was provided.

      • │ │ │ │
      • #8061: Fixed failing staticmethod test cases if they are inherited from a parent test class.

      • │ │ │ │
      • #8192: testdir.makefile now silently accepts values which don't start with . to maintain backward compatibility with older pytest versions.

        │ │ │ │

        pytester.makefile now issues a clearer error if the . is missing in the ext argument.

        │ │ │ │
      • │ │ │ │
      • #8258: Fixed issue where pytest's faulthandler support would not dump traceback on crashes │ │ │ │ -if the faulthandler module was already enabled during pytest startup (using │ │ │ │ +if the faulthandler module was already enabled during pytest startup (using │ │ │ │ python -X dev -m pytest for example).

      • │ │ │ │
      • #8317: Fixed an issue where illegal directory characters derived from getpass.getuser() raised an OSError.

      • │ │ │ │
      • #8367: Fix Class.from_parent so it forwards extra keyword arguments to the constructor.

      • │ │ │ │
      • #8377: The test selection options pytest -k and pytest -m now support matching │ │ │ │ names containing forward slash (/) characters.

      • │ │ │ │
      • #8384: The @pytest.mark.skip decorator now correctly handles its arguments. When the reason argument is accidentally given both positional and as a keyword (e.g. because it was confused with skipif), a TypeError now occurs. Before, such tests were silently skipped, and the positional argument ignored. Additionally, reason is now documented correctly as positional or keyword (rather than keyword-only).

      • │ │ │ │
      • #8394: Use private names for internal fixtures that handle classic setup/teardown so that they don't show up with the default --fixtures invocation (but they still show up with --fixtures -v).

      • │ │ │ │ @@ -2947,16 +2947,16 @@ │ │ │ │
      │ │ │ │
    │ │ │ │
    │ │ │ │

    Features

    │ │ │ │
      │ │ │ │
    • #5299: pytest now warns about unraisable exceptions and unhandled thread exceptions that occur in tests on Python>=3.8. │ │ │ │ See Warning about unraisable exceptions and unhandled thread exceptions for more information.

    • │ │ │ │ -
    • #7425: New pytester fixture, which is identical to testdir but its methods return pathlib.Path when appropriate instead of py.path.local.

      │ │ │ │ -

      This is part of the movement to use pathlib.Path objects internally, in order to remove the dependency to py in the future.

      │ │ │ │ +
    • #7425: New pytester fixture, which is identical to testdir but its methods return pathlib.Path when appropriate instead of py.path.local.

      │ │ │ │ +

      This is part of the movement to use pathlib.Path objects internally, in order to remove the dependency to py in the future.

      │ │ │ │

      Internally, the old pytest.Testdir is now a thin wrapper around Pytester, preserving the old interface.

      │ │ │ │
    • │ │ │ │
    • #7695: A new hook was added, pytest_markeval_namespace which should return a dictionary. │ │ │ │ This dictionary will be used to augment the "global" variables available to evaluate skipif/xfail/xpass markers.

      │ │ │ │

      Pseudo example

      │ │ │ │

      conftest.py:

      │ │ │ │
      def pytest_markeval_namespace():
      │ │ │ │ @@ -3000,33 +3000,33 @@
      │ │ │ │  
    • pytest.MonkeyPatch for the monkeypatch fixture.

    • │ │ │ │
    • pytest.WarningsRecorder for the recwarn fixture.

    • │ │ │ │
    │ │ │ │

    Constructing them is not supported (except for MonkeyPatch); they are only meant for use in type annotations. │ │ │ │ Doing so will emit a deprecation warning, and may become a hard-error in pytest 8.0.

    │ │ │ │

    Subclassing them is also not supported. This is not currently enforced at runtime, but is detected by type-checkers such as mypy.

    │ │ │ │ │ │ │ │ -
  • #7527: When a comparison between namedtuple instances of the same type fails, pytest now shows the differing field names (possibly nested) instead of their indexes.

  • │ │ │ │ -
  • #7615: Node.warn now permits any subclass of Warning, not just PytestWarning.

  • │ │ │ │ +
  • #7527: When a comparison between namedtuple instances of the same type fails, pytest now shows the differing field names (possibly nested) instead of their indexes.

  • │ │ │ │ +
  • #7615: Node.warn now permits any subclass of Warning, not just PytestWarning.

  • │ │ │ │
  • #7701: Improved reporting when using --collected-only. It will now show the number of collected tests in the summary stats.

  • │ │ │ │
  • #7710: Use strict equality comparison for non-numeric types in pytest.approx() instead of │ │ │ │ -raising TypeError.

    │ │ │ │ +raising TypeError.

    │ │ │ │

    This was the undocumented behavior before 3.7, but is now officially a supported feature.

    │ │ │ │
  • │ │ │ │
  • #7938: New --sw-skip argument which is a shorthand for --stepwise-skip.

  • │ │ │ │
  • #8023: Added 'node_modules' to default value for norecursedirs.

  • │ │ │ │ -
  • #8032: doClassCleanups (introduced in unittest in Python and 3.8) is now called appropriately.

  • │ │ │ │ +
  • #8032: doClassCleanups (introduced in unittest in Python and 3.8) is now called appropriately.

  • │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │

    Bug Fixes

    │ │ │ │
      │ │ │ │
    • #4824: Fixed quadratic behavior and improved performance of collection of items using autouse fixtures and xunit fixtures.

    • │ │ │ │
    • #7758: Fixed an issue where some files in packages are getting lost from --lf even though they contain tests that failed. Regressed in pytest 5.4.0.

    • │ │ │ │
    • #7911: Directories created by by tmp_path and tmpdir are now considered stale after 3 days without modification (previous value was 3 hours) to avoid deleting directories still in use in long running test suites.

    • │ │ │ │ -
    • #7913: Fixed a crash or hang in pytester.spawn when the readline module is involved.

    • │ │ │ │ +
    • #7913: Fixed a crash or hang in pytester.spawn when the readline module is involved.

    • │ │ │ │
    • #7951: Fixed handling of recursive symlinks when collecting tests.

    • │ │ │ │
    • #7981: Fixed symlinked directories not being followed during collection. Regressed in pytest 6.1.0.

    • │ │ │ │
    • #8016: Fixed only one doctest being collected when using pytest --doctest-modules path/to/an/__init__.py.

    • │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    Improved Documentation

    │ │ │ │ @@ -3123,17 +3123,17 @@ │ │ │ │

    Improvements

    │ │ │ │
      │ │ │ │
    • #6681: Internal pytest warnings issued during the early stages of initialization are now properly handled and can filtered through filterwarnings or --pythonwarnings/-W.

      │ │ │ │

      This also fixes a number of long standing issues: #2891, #7620, #7426.

      │ │ │ │
    • │ │ │ │
    • #7572: When a plugin listed in required_plugins is missing or an unknown config key is used with --strict-config, a simple error message is now shown instead of a stacktrace.

    • │ │ │ │
    • #7685: Added two new attributes rootpath and inipath to Config. │ │ │ │ -These attributes are pathlib.Path versions of the existing rootdir and inifile attributes, │ │ │ │ +These attributes are pathlib.Path versions of the existing rootdir and inifile attributes, │ │ │ │ and should be preferred over them when possible.

    • │ │ │ │ -
    • #7780: Public classes which are not designed to be inherited from are now marked @final. │ │ │ │ +

    • #7780: Public classes which are not designed to be inherited from are now marked @final. │ │ │ │ Code which inherits from these classes will trigger a type-checking (e.g. mypy) error, but will still work in runtime. │ │ │ │ Currently the final designation does not appear in the API Reference but hopefully will in the future.

    • │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    Bug Fixes

    │ │ │ │
      │ │ │ │ @@ -3312,15 +3312,15 @@ │ │ │ │ supported Python 3 implementations which do not provide it.

      │ │ │ │
    • #7040: -k no longer matches against the names of the directories outside the test session root.

      │ │ │ │

      Also, pytest.Package.name is now just the name of the directory containing the package's │ │ │ │ __init__.py file, instead of the full path. This is consistent with how the other nodes │ │ │ │ are named, and also one of the reasons why -k would match against any directory containing │ │ │ │ the test suite.

      │ │ │ │
    • │ │ │ │ -
    • #7122: Expressions given to the -m and -k options are no longer evaluated using Python's eval(). │ │ │ │ +

    • #7122: Expressions given to the -m and -k options are no longer evaluated using Python's eval(). │ │ │ │ The format supports or, and, not, parenthesis and general identifiers to match against. │ │ │ │ Python constants, keywords or other operators are no longer evaluated differently.

    • │ │ │ │
    • #7135: Pytest now uses its own TerminalWriter class instead of using the one from the py library. │ │ │ │ Plugins generally access this class through TerminalReporter.writer, TerminalReporter.write() │ │ │ │ (and similar methods), or _pytest.config.create_terminal_writer().

      │ │ │ │

      The following breaking changes were made:

      │ │ │ │
        │ │ │ │ @@ -3405,15 +3405,15 @@ │ │ │ │
      • --no-summary: disables the final test summary, including warnings.

      • │ │ │ │
      │ │ │ │
    • │ │ │ │
    • #6856: A warning is now shown when an unknown key is read from a config INI file.

      │ │ │ │

      The --strict-config flag has been added to treat these warnings as errors.

      │ │ │ │
    • │ │ │ │
    • #6906: Added --code-highlight command line option to enable/disable code highlighting in terminal output.

    • │ │ │ │ -
    • #7245: New --import-mode=importlib option that uses importlib to import test modules.

      │ │ │ │ +
    • #7245: New --import-mode=importlib option that uses importlib to import test modules.

      │ │ │ │

      Traditionally pytest used __import__ while changing sys.path to import test modules (which │ │ │ │ also changes sys.modules as a side-effect), which works but has a number of drawbacks, like requiring test modules │ │ │ │ that don't live in packages to have unique names (as they need to reside under a unique name in sys.modules).

      │ │ │ │

      --import-mode=importlib uses more fine-grained import mechanisms from importlib which don't │ │ │ │ require pytest to change sys.path or sys.modules at all, eliminating much of the drawbacks │ │ │ │ of the previous mode.

      │ │ │ │

      We intend to make --import-mode=importlib the default in future versions, so users are encouraged │ │ │ │ @@ -3469,15 +3469,15 @@ │ │ │ │

    • │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    Bug Fixes

    │ │ │ │
      │ │ │ │
    • #1120: Fix issue where directories from tmpdir are not removed properly when multiple instances of pytest are running in parallel.

    • │ │ │ │ -
    • #4583: Prevent crashing and provide a user-friendly error when a marker expression (-m) invoking of eval() raises any exception.

    • │ │ │ │ +
    • #4583: Prevent crashing and provide a user-friendly error when a marker expression (-m) invoking of eval() raises any exception.

    • │ │ │ │
    • #4677: The path shown in the summary report for SKIPPED tests is now always relative. Previously it was sometimes absolute.

    • │ │ │ │
    • #5456: Fix a possible race condition when trying to remove lock files used to control access to folders │ │ │ │ created by tmp_path and tmpdir.

    • │ │ │ │
    • #6240: Fixes an issue where logging during collection step caused duplication of log │ │ │ │ messages to stderr.

    • │ │ │ │
    • #6428: Paths appearing in error messages are now correct in case the current working directory has │ │ │ │ changed since the start of the session.

    • │ │ │ │ @@ -3485,29 +3485,29 @@ │ │ │ │
    • #6871: Fix crash with captured output when using capsysbinary.

    • │ │ │ │
    • #6909: Revert the change introduced by #6330, which required all arguments to @pytest.mark.parametrize to be explicitly defined in the function signature.

      │ │ │ │

      The intention of the original change was to remove what was expected to be an unintended/surprising behavior, but it turns out many people relied on it, so the restriction has been reverted.

      │ │ │ │
    • │ │ │ │
    • #6910: Fix crash when plugins return an unknown stats while using the --reportlog option.

    • │ │ │ │
    • #6924: Ensure a unittest.IsolatedAsyncioTestCase is actually awaited.

    • │ │ │ │
    • #6925: Fix TerminalRepr instances to be hashable again.

    • │ │ │ │ -
    • #6947: Fix regression where functions registered with unittest.TestCase.addCleanup() were not being called on test failures.

    • │ │ │ │ +
    • #6947: Fix regression where functions registered with unittest.TestCase.addCleanup() were not being called on test failures.

    • │ │ │ │
    • #6951: Allow users to still set the deprecated TerminalReporter.writer attribute.

    • │ │ │ │
    • #6956: Prevent pytest from printing ConftestImportFailure traceback to stdout.

    • │ │ │ │
    • #6991: Fix regressions with --lf filtering too much since pytest 5.4.

    • │ │ │ │
    • #6992: Revert "tmpdir: clean up indirection via config for factories" #6767 as it breaks pytest-xdist.

    • │ │ │ │
    • #7061: When a yielding fixture fails to yield a value, report a test setup error instead of crashing.

    • │ │ │ │
    • #7076: The path of file skipped by @pytest.mark.skip in the SKIPPED report is now relative to invocation directory. Previously it was relative to root directory.

    • │ │ │ │
    • #7110: Fixed regression: asyncbase.TestCase tests are executed correctly again.

    • │ │ │ │
    • #7126: --setup-show now doesn't raise an error when a bytes value is used as a parametrize │ │ │ │ parameter when Python is called with the -bb flag.

    • │ │ │ │
    • #7143: Fix pytest.File.from_parent so it forwards extra keyword arguments to the constructor.

    • │ │ │ │
    • #7145: Classes with broken __getattribute__ methods are displayed correctly during failures.

    • │ │ │ │
    • #7150: Prevent hiding the underlying exception when ConfTestImportFailure is raised.

    • │ │ │ │
    • #7180: Fix _is_setup_py for files encoded differently than locale.

    • │ │ │ │ -
    • #7215: Fix regression where running with --pdb would call unittest.TestCase.tearDown() for skipped tests.

    • │ │ │ │ +
    • #7215: Fix regression where running with --pdb would call unittest.TestCase.tearDown() for skipped tests.

    • │ │ │ │
    • #7253: When using pytest.fixture on a function directly, as in pytest.fixture(func), │ │ │ │ if the autouse or params arguments are also passed, the function is no longer │ │ │ │ ignored, but is marked as a fixture.

    • │ │ │ │
    • #7360: Fix possibly incorrect evaluation of string expressions passed to pytest.mark.skipif and pytest.mark.xfail, │ │ │ │ in rare circumstances where the exact same string is used but refers to different global values.

    • │ │ │ │
    • #7383: Fixed exception causes all over the codebase, i.e. use raise new_exception from old_exception when wrapping an exception.

    • │ │ │ │
    │ │ │ │ @@ -3668,15 +3668,15 @@ │ │ │ │
  • #5991: Fix interaction with --pdb and unittests: do not use unittest's TestCase.debug().

  • │ │ │ │
  • #6334: Fix summary entries appearing twice when f/F and s/S report chars were used at the same time in the -r command-line option (for example -rFf).

    │ │ │ │

    The upper case variants were never documented and the preferred form should be the lower case.

    │ │ │ │
  • │ │ │ │
  • #6409: Fallback to green (instead of yellow) for non-last items without previous passes with colored terminal progress indicator.

  • │ │ │ │
  • #6454: --disable-warnings is honored with -ra and -rA.

  • │ │ │ │
  • #6497: Fix bug in the comparison of request key with cached key in fixture.

    │ │ │ │ -

    A construct if key == cached_key: can fail either because == is explicitly disallowed, or for, e.g., NumPy arrays, where the result of a == b cannot generally be converted to bool. │ │ │ │ +

    A construct if key == cached_key: can fail either because == is explicitly disallowed, or for, e.g., NumPy arrays, where the result of a == b cannot generally be converted to bool. │ │ │ │ The implemented fix replaces == with is.

    │ │ │ │
  • │ │ │ │
  • #6557: Make capture output streams .write() method return the same return value from original streams.

  • │ │ │ │
  • #6566: Fix EncodedFile.writelines to call the underlying buffer's writelines method.

  • │ │ │ │
  • #6575: Fix internal crash when faulthandler starts initialized │ │ │ │ (for example with PYTHONFAULTHANDLER=1 environment variable set) and faulthandler_timeout defined │ │ │ │ in the configuration file.

  • │ │ │ │ @@ -3774,19 +3774,19 @@ │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │

    Bug Fixes

    │ │ │ │
      │ │ │ │
    • #5914: pytester: fix no_fnmatch_line() when used after positive matching.

    • │ │ │ │
    • #6082: Fix line detection for doctest samples inside │ │ │ │ -python:property docstrings, as a workaround to │ │ │ │ +property docstrings, as a workaround to │ │ │ │ python/cpython#61648.

    • │ │ │ │
    • #6254: Fix compatibility with pytest-parallel (regression in pytest 5.3.0).

    • │ │ │ │ -
    • #6255: Clear the sys.last_traceback, sys.last_type │ │ │ │ -and sys.last_value attributes by deleting them instead │ │ │ │ +

    • #6255: Clear the sys.last_traceback, sys.last_type │ │ │ │ +and sys.last_value attributes by deleting them instead │ │ │ │ of setting them to None. This better matches the behaviour of │ │ │ │ the Python standard library.

    • │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    pytest 5.3.0 (2019-11-19)

    │ │ │ │ @@ -3809,32 +3809,32 @@ │ │ │ │

    Each line of the report log contains a self contained JSON object corresponding to a testing event, │ │ │ │ such as a collection or a test result report. The file is guaranteed to be flushed after writing │ │ │ │ each line, so systems can read and process events in real-time.

    │ │ │ │

    The plugin is meant to replace the --resultlog option, which is deprecated and meant to be removed │ │ │ │ in a future release. If you use --resultlog, please try out pytest-reportlog and │ │ │ │ provide feedback.

    │ │ │ │ │ │ │ │ -
  • #4730: When sys.pycache_prefix (Python 3.8+) is set, it will be used by pytest to cache test files changed by the assertion rewriting mechanism.

    │ │ │ │ +
  • #4730: When sys.pycache_prefix (Python 3.8+) is set, it will be used by pytest to cache test files changed by the assertion rewriting mechanism.

    │ │ │ │

    This makes it easier to benefit of cached .pyc files even on file systems without permissions.

    │ │ │ │
  • │ │ │ │
  • #5515: Allow selective auto-indentation of multiline log messages.

    │ │ │ │

    Adds command line option --log-auto-indent, config option │ │ │ │ log_auto_indent and support for per-entry configuration of │ │ │ │ -indentation behavior on calls to python:logging.log().

    │ │ │ │ +indentation behavior on calls to logging.log().

    │ │ │ │

    Alters the default for auto-indention from "on" to "off". This │ │ │ │ restores the older behavior that existed prior to v4.6.0. This │ │ │ │ reversion to earlier behavior was done because it is better to │ │ │ │ activate new features that may lead to broken tests explicitly │ │ │ │ rather than implicitly.

    │ │ │ │
  • │ │ │ │
  • #5914: testdir learned two new functions, no_fnmatch_line() and │ │ │ │ no_re_match_line().

    │ │ │ │

    The functions are used to ensure the captured text does not match the given │ │ │ │ pattern.

    │ │ │ │ -

    The previous idiom was to use python:re.match():

    │ │ │ │ +

    The previous idiom was to use re.match():

    │ │ │ │
    result = testdir.runpytest()
    │ │ │ │  assert re.match(pat, result.stdout.str()) is None
    │ │ │ │  
    │ │ │ │
    │ │ │ │

    Or the in operator:

    │ │ │ │
    result = testdir.runpytest()
    │ │ │ │  assert text in result.stdout.str()
    │ │ │ │ @@ -4225,15 +4225,15 @@
    │ │ │ │  
    │ │ │ │

    Features

    │ │ │ │
      │ │ │ │
    • #3457: New pytest_assertion_pass │ │ │ │ hook, called with context information when an assertion passes.

      │ │ │ │

      This hook is still experimental so use it with caution.

      │ │ │ │
    • │ │ │ │ -
    • #5440: The faulthandler standard library │ │ │ │ +

    • #5440: The faulthandler standard library │ │ │ │ module is now enabled by default to help users diagnose crashes in C modules.

      │ │ │ │

      This functionality was provided by integrating the external │ │ │ │ pytest-faulthandler plugin into the core, │ │ │ │ so users should remove that plugin from their requirements if used.

      │ │ │ │

      For more information see the docs: Fault Handler.

      │ │ │ │
    • │ │ │ │
    • #5452: When warnings are configured as errors, pytest warnings now appear as originating from pytest. instead of the internal _pytest.warning_types. module.

    • │ │ │ │ @@ -4832,15 +4832,15 @@ │ │ │ │
    • #4681: Ensure tmp_path is always a real path.

    • │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │

    Trivial/Internal Changes

    │ │ │ │
      │ │ │ │
    • #4643: Use a.item() instead of the deprecated np.asscalar(a) in pytest.approx.

      │ │ │ │ -

      np.asscalar has been deprecated in numpy 1.16..

      │ │ │ │ +

      np.asscalar has been deprecated in numpy 1.16..

      │ │ │ │
    • │ │ │ │
    • #4657: Copy saferepr from pylib

    • │ │ │ │
    • #4668: The verbose word for expected failures in the teststatus report changes from xfail to XFAIL to be consistent with other test outcomes.

    • │ │ │ │
    │ │ │ │
    │ │ │ │
  • │ │ │ │
    │ │ │ │ @@ -4953,15 +4953,15 @@ │ │ │ │

    Because the assert_called_with method of mock objects already executes an assertion.

    │ │ │ │

    This warning will not be issued when None is explicitly checked. An assertion like:

    │ │ │ │
    assert variable is None
    │ │ │ │  
    │ │ │ │
    │ │ │ │

    will not issue the warning.

    │ │ │ │ │ │ │ │ -
  • #3632: Richer equality comparison introspection on AssertionError for objects created using attrs or dataclasses (Python 3.7+, backported to 3.6).

  • │ │ │ │ +
  • #3632: Richer equality comparison introspection on AssertionError for objects created using attrs or dataclasses (Python 3.7+, backported to 3.6).

  • │ │ │ │
  • #4278: CACHEDIR.TAG files are now created inside cache directories.

    │ │ │ │

    Those files are part of the Cache Directory Tagging Standard, and can │ │ │ │ be used by backup or synchronization programs to identify pytest's cache directory as such.

    │ │ │ │
  • │ │ │ │
  • #4292: pytest.outcomes.Exit is derived from SystemExit instead of KeyboardInterrupt. This allows us to better handle pdb exiting.

  • │ │ │ │
  • #4371: Updated the --collect-only option to display test descriptions when ran using --verbose.

  • │ │ │ │
  • #4386: Restructured ExceptionInfo object construction and ensure incomplete instances have a repr/str.

  • │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -116,15 +116,15 @@ │ │ │ │ │ a different instance than the test methods use, leading to unexpected │ │ │ │ │ behavior. Use @classmethod decorator instead -- by _@_y_a_s_t_c_h_e_r. │ │ │ │ │ See _#_1_0_8_1_9 and _#_1_4_0_1_1. │ │ │ │ │ * _#_1_2_8_8_2: Calling _r_e_q_u_e_s_t_._g_e_t_f_i_x_t_u_r_e_v_a_l_u_e_(_) during teardown to request a │ │ │ │ │ fixture that was not already requested is now deprecated and will become │ │ │ │ │ an error in pytest 10. │ │ │ │ │ See _r_e_q_u_e_s_t_._g_e_t_f_i_x_t_u_r_e_v_a_l_u_e_(_)_ _d_u_r_i_n_g_ _f_i_x_t_u_r_e_ _t_e_a_r_d_o_w_n for details. │ │ │ │ │ - * _#_1_3_4_0_9: Using non-Collection iterables (such as generators, iterators, or │ │ │ │ │ + * _#_1_3_4_0_9: Using non-_C_o_l_l_e_c_t_i_o_n iterables (such as generators, iterators, or │ │ │ │ │ custom iterable objects) for the argvalues parameter in │ │ │ │ │ _@_p_y_t_e_s_t_._m_a_r_k_._p_a_r_a_m_e_t_r_i_z_e and _m_e_t_a_f_u_n_c_._p_a_r_a_m_e_t_r_i_z_e is now deprecated. │ │ │ │ │ These iterables get exhausted after the first iteration, leading to tests │ │ │ │ │ getting unexpectedly skipped in cases such as running _p_y_t_e_s_t_._m_a_i_n_(_) │ │ │ │ │ multiple times, using class-level parametrize decorators, or collecting │ │ │ │ │ tests multiple times. │ │ │ │ │ See _N_o_n_-_C_o_l_l_e_c_t_i_o_n_ _i_t_e_r_a_b_l_e_s_ _i_n_ _@_p_y_t_e_s_t_._m_a_r_k_._p_a_r_a_m_e_t_r_i_z_e for details and │ │ │ │ │ @@ -163,16 +163,16 @@ │ │ │ │ │ * _#_1_4_0_2_3: Added --report-chars long CLI option. │ │ │ │ │ * _#_1_4_3_7_1: Added _-_-_m_a_x_-_w_a_r_n_i_n_g_s command-line option and _m_a_x___w_a_r_n_i_n_g_s │ │ │ │ │ configuration option to fail the test run when the number of warnings │ │ │ │ │ exceeds a given threshold -- by _@_m_i_k_e_t_h_e_m_a_n. │ │ │ │ │ * _#_6_7_5_7: Added the _a_s_s_e_r_t_i_o_n___t_e_x_t___d_i_f_f___s_t_y_l_e configuration option, allowing │ │ │ │ │ string equality failures to be rendered as separate Left: and Right: │ │ │ │ │ blocks instead of ndiff output. │ │ │ │ │ - * _#_8_3_9_5: Added support for datetime and timedelta comparisons with │ │ │ │ │ - _p_y_t_e_s_t_._a_p_p_r_o_x_(_). An explicit abs or rel tolerance as a timedelta is │ │ │ │ │ + * _#_8_3_9_5: Added support for _d_a_t_e_t_i_m_e and _t_i_m_e_d_e_l_t_a comparisons with │ │ │ │ │ + _p_y_t_e_s_t_._a_p_p_r_o_x_(_). An explicit abs or rel tolerance as a _t_i_m_e_d_e_l_t_a is │ │ │ │ │ required and relative tolerance is not supported for datetime comparisons │ │ │ │ │ -- by _@_h_a_m_z_a_-_m_o_b_e_e_n. │ │ │ │ │ ******** IImmpprroovveemmeennttss iinn eexxiissttiinngg ffuunnccttiioonnaalliittyy_?¶ ******** │ │ │ │ │ * _#_1_1_2_2_5: pytest.warns() now shows "Regex pattern did not match" instead of │ │ │ │ │ "DID NOT WARN" when warnings were emitted but the match pattern did not │ │ │ │ │ match. │ │ │ │ │ * _#_1_1_2_9_5: Improved output of --fixtures-per-test by excluding internal- │ │ │ │ │ @@ -232,18 +232,18 @@ │ │ │ │ │ potentially be released more promptly. │ │ │ │ │ * _#_1_3_7_8_4: Fixed capteesys producing doubled output when used with -- │ │ │ │ │ capture=no (-s). │ │ │ │ │ * _#_1_3_8_1_7: Fixed a secondary AttributeError masking the original error when │ │ │ │ │ an option argument fails to initialize. │ │ │ │ │ * _#_1_3_8_8_4: Fixed rare internal IndexError caused by builtins.compile being │ │ │ │ │ overridden in client code. │ │ │ │ │ - * _#_1_3_8_8_5: Fixed autouse fixtures defined inside a unittest.TestCase class │ │ │ │ │ - running even when the class is decorated with unittest.skip() or │ │ │ │ │ - unittest.skipIf() -- regression since pytest 8.1.0. │ │ │ │ │ - * _#_1_3_9_1_7: unittest.SkipTest is no longer considered an interactive │ │ │ │ │ + * _#_1_3_8_8_5: Fixed autouse fixtures defined inside a _u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e class │ │ │ │ │ + running even when the class is decorated with _u_n_i_t_t_e_s_t_._s_k_i_p_(_) or │ │ │ │ │ + _u_n_i_t_t_e_s_t_._s_k_i_p_I_f_(_) -- regression since pytest 8.1.0. │ │ │ │ │ + * _#_1_3_9_1_7: _u_n_i_t_t_e_s_t_._S_k_i_p_T_e_s_t is no longer considered an interactive │ │ │ │ │ exception, i.e. _p_y_t_e_s_t___e_x_c_e_p_t_i_o_n___i_n_t_e_r_a_c_t is no longer called for it. │ │ │ │ │ * _#_1_3_9_6_3: Fixed subtests running with _p_y_t_e_s_t_-_x_d_i_s_t when their contexts │ │ │ │ │ contain objects that are not JSON-serializable. │ │ │ │ │ Fixes _p_y_t_e_s_t_-_d_e_v_/_p_y_t_e_s_t_-_x_d_i_s_t_#_1_2_7_3. │ │ │ │ │ * _#_1_4_0_0_4: Fixed conftest.py fixture scoping when _t_e_s_t_p_a_t_h_s points outside │ │ │ │ │ of the _r_o_o_t_d_i_r. │ │ │ │ │ Previously, fixtures from nested conftest.py files would incorrectly leak │ │ │ │ │ @@ -344,15 +344,15 @@ │ │ │ │ │ main branch moves on. │ │ │ │ │ ******** MMiisscceellllaanneeoouuss iinntteerrnnaall cchhaannggeess_?¶ ******** │ │ │ │ │ * _#_1_4_5_8_2: Improved the recursion traceback test to exercise all requested │ │ │ │ │ traceback styles. │ │ │ │ │ ********** ppyytteesstt 99..00..33 ((22002266--0044--0077))_?¶ ********** │ │ │ │ │ ******** BBuugg ffiixxeess_?¶ ******** │ │ │ │ │ * _#_1_2_4_4_4: Fixed _p_y_t_e_s_t_._a_p_p_r_o_x_(_) which now correctly takes into account │ │ │ │ │ - Mapping keys order to compare them. │ │ │ │ │ + _M_a_p_p_i_n_g keys order to compare them. │ │ │ │ │ * _#_1_3_6_3_4: Blocking a conftest.py file using the -p no: option is now │ │ │ │ │ explicitly disallowed. │ │ │ │ │ Previously this resulted in an internal assertion failure during plugin │ │ │ │ │ loading. │ │ │ │ │ Pytest now raises a clear UsageError explaining that conftest files are │ │ │ │ │ not plugins and cannot be disabled via -p. │ │ │ │ │ * _#_1_3_7_3_4: Fixed crash when a test raises an exceptiongroup with │ │ │ │ │ @@ -432,15 +432,15 @@ │ │ │ │ │ def test_py_files_contain_docstring(subtests: pytest.Subtests) -> None: │ │ │ │ │ for path in Path.cwd().glob("*.py"): │ │ │ │ │ with subtests.test(path=str(path)): │ │ │ │ │ assert contains_docstring(path) │ │ │ │ │ Each assert failure or error is caught by the context manager and │ │ │ │ │ reported individually, giving a clear picture of all files that are │ │ │ │ │ missing a docstring. │ │ │ │ │ - In addition, unittest.TestCase.subTest() is now also supported. │ │ │ │ │ + In addition, _u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e_._s_u_b_T_e_s_t_(_) is now also supported. │ │ │ │ │ This feature was originally implemented as a separate plugin in _p_y_t_e_s_t_- │ │ │ │ │ _s_u_b_t_e_s_t_s, but since then has been merged into the core. │ │ │ │ │ Note │ │ │ │ │ This feature is experimental and will likely evolve in future releases. │ │ │ │ │ By that we mean that we might change how subtests are reported on │ │ │ │ │ failure, but the functionality and how to use it are stable. │ │ │ │ │ * _#_1_3_7_4_3: Added support for nnaattiivvee TTOOMMLL ccoonnffiigguurraattiioonn ffiilleess. │ │ │ │ │ @@ -598,15 +598,15 @@ │ │ │ │ │ when the prepended path contains legacy namespace packages (those using │ │ │ │ │ pkg_resources.declare_namespace()). Users should migrate to native │ │ │ │ │ namespace packages (_PP_EE_PP_ _44_22_00). See _m_o_n_k_e_y_p_a_t_c_h_._s_y_s_p_a_t_h___p_r_e_p_e_n_d_ _w_i_t_h_ _l_e_g_a_c_y │ │ │ │ │ _n_a_m_e_s_p_a_c_e_ _p_a_c_k_a_g_e_s for details. │ │ │ │ │ ******** BBuugg ffiixxeess_?¶ ******** │ │ │ │ │ * _#_1_3_4_4_5: Made the type annotations of _p_y_t_e_s_t_._s_k_i_p_(_) and friends more spec- │ │ │ │ │ complaint to have them work across more type checkers. │ │ │ │ │ - * _#_1_3_5_3_7: Fixed a bug in which ExceptionGroup with only Skipped exceptions │ │ │ │ │ + * _#_1_3_5_3_7: Fixed a bug in which _E_x_c_e_p_t_i_o_n_G_r_o_u_p with only Skipped exceptions │ │ │ │ │ in teardown was not handled correctly and showed as error. │ │ │ │ │ * _#_1_3_5_9_8: Fixed possible collection confusion on Windows when short paths │ │ │ │ │ and symlinks are involved. │ │ │ │ │ * _#_1_3_7_1_6: Fixed a bug where a nonsensical invocation like pytest x.py[a] (a │ │ │ │ │ file cannot be parametrized) was silently treated as pytest x.py. This is │ │ │ │ │ now a usage error. │ │ │ │ │ * _#_1_3_7_2_2: Fixed a misleading assertion failure message when using │ │ │ │ │ @@ -647,16 +647,16 @@ │ │ │ │ │ ******** MMiisscceellllaanneeoouuss iinntteerrnnaall cchhaannggeess_?¶ ******** │ │ │ │ │ * _#_1_3_8_3_0: Configuration overrides (-o/--override-ini) are now processed │ │ │ │ │ during startup rather than during _c_o_n_f_i_g_._g_e_t_i_n_i_(_). │ │ │ │ │ ********** ppyytteesstt 88..44..22 ((22002255--0099--0033))_?¶ ********** │ │ │ │ │ ******** BBuugg ffiixxeess_?¶ ******** │ │ │ │ │ * _#_1_3_4_7_8: Fixed a crash when using _c_o_n_s_o_l_e___o_u_t_p_u_t___s_t_y_l_e with times and a │ │ │ │ │ module is skipped. │ │ │ │ │ - * _#_1_3_5_3_0: Fixed a crash when using _p_y_t_e_s_t_._a_p_p_r_o_x_(_) and decimal.Decimal │ │ │ │ │ - instances with the decimal.FloatOperation trap set. │ │ │ │ │ + * _#_1_3_5_3_0: Fixed a crash when using _p_y_t_e_s_t_._a_p_p_r_o_x_(_) and _d_e_c_i_m_a_l_._D_e_c_i_m_a_l │ │ │ │ │ + instances with the _d_e_c_i_m_a_l_._F_l_o_a_t_O_p_e_r_a_t_i_o_n trap set. │ │ │ │ │ * _#_1_3_5_4_9: No longer evaluate type annotations in Python 3.14 when │ │ │ │ │ inspecting function signatures. │ │ │ │ │ This prevents crashes during module collection when modules do not │ │ │ │ │ explicitly use from __future__ import annotations and import types for │ │ │ │ │ annotations within a if TYPE_CHECKING: block. │ │ │ │ │ * _#_1_3_5_5_9: Added missing int and float variants to the Literal type │ │ │ │ │ annotation of the type parameter in _p_y_t_e_s_t_._P_a_r_s_e_r_._a_d_d_i_n_i_(_). │ │ │ │ │ @@ -704,19 +704,19 @@ │ │ │ │ │ commonly happens if a sync test requests an async fixture. This should │ │ │ │ │ have no effect on a majority of users with async tests or fixtures using │ │ │ │ │ async pytest plugins, but may affect non-standard hook setups or │ │ │ │ │ autouse=True. For guidance on how to work around this warning see _s_y_n_c │ │ │ │ │ _t_e_s_t_ _d_e_p_e_n_d_i_n_g_ _o_n_ _a_s_y_n_c_ _f_i_x_t_u_r_e. │ │ │ │ │ ******** NNeeww ffeeaattuurreess_?¶ ******** │ │ │ │ │ * _#_1_1_5_3_8: Added _p_y_t_e_s_t_._R_a_i_s_e_s_G_r_o_u_p as an equivalent to pytest.raises() for │ │ │ │ │ - expecting ExceptionGroup. Also adds _p_y_t_e_s_t_._R_a_i_s_e_s_E_x_c which is now the │ │ │ │ │ + expecting _E_x_c_e_p_t_i_o_n_G_r_o_u_p. Also adds _p_y_t_e_s_t_._R_a_i_s_e_s_E_x_c which is now the │ │ │ │ │ logic behind pytest.raises() and used as parameter to _p_y_t_e_s_t_._R_a_i_s_e_s_G_r_o_u_p. │ │ │ │ │ RaisesGroup includes the ability to specify multiple different expected │ │ │ │ │ exceptions, the structure of nested exception groups, and flags for │ │ │ │ │ - emulating except*. See _A_s_s_e_r_t_i_o_n_s_ _a_b_o_u_t_ _e_x_p_e_c_t_e_d_ _e_x_c_e_p_t_i_o_n_ _g_r_o_u_p_s and │ │ │ │ │ + emulating _e_x_c_e_p_t_*. See _A_s_s_e_r_t_i_o_n_s_ _a_b_o_u_t_ _e_x_p_e_c_t_e_d_ _e_x_c_e_p_t_i_o_n_ _g_r_o_u_p_s and │ │ │ │ │ docstrings for more information. │ │ │ │ │ * _#_1_2_0_8_1: Added _c_a_p_t_e_e_s_y_s to capture AND pass output to next handler set by │ │ │ │ │ --capture=. │ │ │ │ │ * _#_1_2_5_0_4: _p_y_t_e_s_t_._m_a_r_k_._x_f_a_i_l_(_) now accepts _p_y_t_e_s_t_._R_a_i_s_e_s_G_r_o_u_p for the raises │ │ │ │ │ parameter when you expect an exception group. You can also pass a │ │ │ │ │ _p_y_t_e_s_t_._R_a_i_s_e_s_E_x_c if you e.g. want to make use of the check parameter. │ │ │ │ │ * _#_1_2_7_1_3: New --force-short-summary option to force condensed summary │ │ │ │ │ @@ -822,31 +822,31 @@ │ │ │ │ │ * _#_1_2_9_5_8: A number of _u_n_r_a_i_s_a_b_l_e enhancements: │ │ │ │ │ o Set the unraisable hook as early as possible and unset it as late │ │ │ │ │ as possible, to collect the most possible number of unraisable │ │ │ │ │ exceptions. │ │ │ │ │ o Call the garbage collector just before unsetting the unraisable │ │ │ │ │ hook, to collect any straggling exceptions. │ │ │ │ │ o Collect multiple unraisable exceptions per test phase. │ │ │ │ │ - o Report the tracemalloc allocation traceback (if available). │ │ │ │ │ - o Avoid using a generator based hook to allow handling StopIteration │ │ │ │ │ + o Report the _t_r_a_c_e_m_a_l_l_o_c allocation traceback (if available). │ │ │ │ │ + o Avoid using a generator based hook to allow handling _S_t_o_p_I_t_e_r_a_t_i_o_n │ │ │ │ │ in test failures. │ │ │ │ │ o Report the unraisable exception as the cause of the │ │ │ │ │ _p_y_t_e_s_t_._P_y_t_e_s_t_U_n_r_a_i_s_a_b_l_e_E_x_c_e_p_t_i_o_n_W_a_r_n_i_n_g exception if raised. │ │ │ │ │ o Compute the repr of the unraisable object in the unraisable hook so │ │ │ │ │ you get the latest information if available, and should help with │ │ │ │ │ resurrection of the object. │ │ │ │ │ * _#_1_3_0_1_0: _p_y_t_e_s_t_._a_p_p_r_o_x_(_) now can compare collections that contain numbers │ │ │ │ │ and non-numbers mixed. │ │ │ │ │ * _#_1_3_0_1_6: A number of _t_h_r_e_a_d_e_x_c_e_p_t_i_o_n enhancements: │ │ │ │ │ o Set the excepthook as early as possible and unset it as late as │ │ │ │ │ possible, to collect the most possible number of unhandled │ │ │ │ │ exceptions from threads. │ │ │ │ │ o Collect multiple thread exceptions per test phase. │ │ │ │ │ - o Report the tracemalloc allocation traceback (if available). │ │ │ │ │ - o Avoid using a generator based hook to allow handling StopIteration │ │ │ │ │ + o Report the _t_r_a_c_e_m_a_l_l_o_c allocation traceback (if available). │ │ │ │ │ + o Avoid using a generator based hook to allow handling _S_t_o_p_I_t_e_r_a_t_i_o_n │ │ │ │ │ in test failures. │ │ │ │ │ o Report the thread exception as the cause of the │ │ │ │ │ _p_y_t_e_s_t_._P_y_t_e_s_t_U_n_h_a_n_d_l_e_d_T_h_r_e_a_d_E_x_c_e_p_t_i_o_n_W_a_r_n_i_n_g exception if raised. │ │ │ │ │ o Extract the name of the thread object in the excepthook which │ │ │ │ │ should help with resurrection of the thread. │ │ │ │ │ * _#_1_3_0_3_1: An empty parameter set as in pytest.mark.parametrize([], │ │ │ │ │ ids=idfunc) will no longer trigger a call to idfunc with internal │ │ │ │ │ @@ -877,15 +877,15 @@ │ │ │ │ │ internal state will be reset automatically in case the test suite │ │ │ │ │ changes (for now only the number of tests are considered for this, │ │ │ │ │ we might change/improve this on the future). │ │ │ │ │ o New --stepwise-reset/--sw-reset flag, allowing the user to │ │ │ │ │ explicitly reset the stepwise state and restart the workflow from │ │ │ │ │ the beginning. │ │ │ │ │ * _#_1_3_3_0_8: Added official support for Python 3.14. │ │ │ │ │ - * _#_1_3_3_8_0: Fix ExceptionGroup traceback filtering to exclude pytest │ │ │ │ │ + * _#_1_3_3_8_0: Fix _E_x_c_e_p_t_i_o_n_G_r_o_u_p traceback filtering to exclude pytest │ │ │ │ │ internals. │ │ │ │ │ * _#_1_3_4_1_5: The author metadata of the BibTex example is now correctly │ │ │ │ │ formatted with last names following first names. An example of BibLaTex │ │ │ │ │ has been added. BibTex and BibLaTex examples now clearly indicate that │ │ │ │ │ what is cited is software. │ │ │ │ │ -- by _@_w_i_l_l_y_n_i_l_l_y │ │ │ │ │ * _#_1_3_4_2_0: Improved test collection performance by optimizing path │ │ │ │ │ @@ -937,15 +937,15 @@ │ │ │ │ │ metafunc's callspecs were assigned after all parametrizations took place. │ │ │ │ │ Now, that change is reverted. │ │ │ │ │ * _#_1_2_8_6_3: Fix applying markers, including _p_y_t_e_s_t_._m_a_r_k_._p_a_r_a_m_e_t_r_i_z_e when │ │ │ │ │ placed above @staticmethod or @classmethod. │ │ │ │ │ * _#_1_2_9_2_9: Handle StopIteration from test cases, setup and teardown │ │ │ │ │ correctly. │ │ │ │ │ * _#_1_2_9_3_8: Fixed --durations-min argument not respected if -vv is used. │ │ │ │ │ - * _#_1_2_9_4_6: Fixed missing help for pdb commands wrapped by pytest -- by │ │ │ │ │ + * _#_1_2_9_4_6: Fixed missing help for _p_d_b commands wrapped by pytest -- by │ │ │ │ │ _@_a_d_a_m_c_h_a_i_n_z. │ │ │ │ │ * _#_1_2_9_8_1: Prevent exceptions in _p_y_t_e_s_t_._C_o_n_f_i_g_._a_d_d___c_l_e_a_n_u_p_(_) callbacks │ │ │ │ │ preventing further cleanups. │ │ │ │ │ * _#_1_3_0_4_7: Restore _p_y_t_e_s_t_._a_p_p_r_o_x_(_) handling of equality checks between bool │ │ │ │ │ and numpy.bool_ types. │ │ │ │ │ Comparing bool and numpy.bool_ using _p_y_t_e_s_t_._a_p_p_r_o_x_(_) accidentally changed │ │ │ │ │ in version 8.3.4 and 8.3.5 to no longer match: │ │ │ │ │ @@ -1017,15 +1017,15 @@ │ │ │ │ │ * _#_1_1_7_7_7: Fixed issue where sequences were still being shortened even with │ │ │ │ │ -vv verbosity. │ │ │ │ │ * _#_1_2_8_8_8: Fixed broken input when using Python 3.13+ and a libedit build of │ │ │ │ │ Python, such as on macOS or with uv-managed Python binaries from the │ │ │ │ │ python-build-standalone project. This could manifest e.g. by a broken │ │ │ │ │ prompt when using Pdb, or seeing empty inputs with manual usage of input │ │ │ │ │ () and suspended capturing. │ │ │ │ │ - * _#_1_3_0_2_6: Fixed AttributeError crash when using --import-mode=importlib │ │ │ │ │ + * _#_1_3_0_2_6: Fixed _A_t_t_r_i_b_u_t_e_E_r_r_o_r crash when using --import-mode=importlib │ │ │ │ │ when top-level directory same name as another module of the standard │ │ │ │ │ library. │ │ │ │ │ * _#_1_3_0_5_3: Fixed a regression in pytest 8.3.4 where, when using --import- │ │ │ │ │ mode=importlib, a directory containing py file with the same name would │ │ │ │ │ cause an ImportError │ │ │ │ │ * _#_1_3_0_8_3: Fixed issue where pytest could crash if one of the collected │ │ │ │ │ directories got removed during collection. │ │ │ │ │ @@ -1035,15 +1035,15 @@ │ │ │ │ │ ******** CCoonnttrriibbuuttoorr--ffaacciinngg cchhaannggeess_?¶ ******** │ │ │ │ │ * _#_1_3_1_1_2: Fixed selftest failures in test_terminal.py with Pygments >= │ │ │ │ │ 2.19.0 │ │ │ │ │ * _#_1_3_2_5_6: Support for Towncrier versions released in 2024 has been re- │ │ │ │ │ enabled when building Sphinx docs -- by _@_w_e_b_k_n_j_a_z. │ │ │ │ │ ********** ppyytteesstt 88..33..44 ((22002244--1122--0011))_?¶ ********** │ │ │ │ │ ******** BBuugg ffiixxeess_?¶ ******** │ │ │ │ │ - * _#_1_2_5_9_2: Fixed KeyError crash when using --import-mode=importlib in a │ │ │ │ │ + * _#_1_2_5_9_2: Fixed _K_e_y_E_r_r_o_r crash when using --import-mode=importlib in a │ │ │ │ │ directory layout where a directory contains a child directory with the │ │ │ │ │ same name. │ │ │ │ │ * _#_1_2_8_1_8: Assertion rewriting now preserves the source ranges of the │ │ │ │ │ original instructions, making it play well with tools that deal with the │ │ │ │ │ AST, like _e_x_e_c_u_t_i_n_g. │ │ │ │ │ * _#_1_2_8_4_9: ANSI escape codes for colored output now handled correctly in │ │ │ │ │ _p_y_t_e_s_t_._f_a_i_l_(_) with pytrace=False. │ │ │ │ │ @@ -1113,26 +1113,26 @@ │ │ │ │ │ tracebacks with --xfail-tb. With this, the default -rx/ -ra behavior is │ │ │ │ │ identical to pre-8.0 with respect to xfail tracebacks. While this is a │ │ │ │ │ behavior change, it brings default behavior back to pre-8.0.0 behavior, │ │ │ │ │ which ultimately was considered the better course of action. │ │ │ │ │ -- by _@_o_k_k_e_n │ │ │ │ │ * _#_1_2_2_8_1: Added support for keyword matching in marker expressions. │ │ │ │ │ Now tests can be selected by marker keyword arguments. Supported values │ │ │ │ │ - are int, (unescaped) str, bool & None. │ │ │ │ │ + are _i_n_t, (unescaped) _s_t_r, _b_o_o_l & _N_o_n_e. │ │ │ │ │ See _m_a_r_k_e_r_ _e_x_a_m_p_l_e_s for more information. │ │ │ │ │ -- by _@_l_o_v_e_t_h_e_g_u_i_t_a_r │ │ │ │ │ * _#_1_2_5_6_7: Added --no-fold-skipped command line option. │ │ │ │ │ If this option is set, then skipped tests in short summary are no longer │ │ │ │ │ grouped by reason but all tests are printed individually with their │ │ │ │ │ nodeid in the same way as other statuses. │ │ │ │ │ -- by _@_p_b_r_e_z_i_n_a │ │ │ │ │ ******** IImmpprroovveemmeennttss iinn eexxiissttiinngg ffuunnccttiioonnaalliittyy_?¶ ******** │ │ │ │ │ * _#_1_2_4_6_9: The console output now uses the "third-party plugins" │ │ │ │ │ terminology, replacing the previously established but confusing and │ │ │ │ │ - outdated reference to setuptools -- by _@_w_e_b_k_n_j_a_z. │ │ │ │ │ + outdated reference to _s_e_t_u_p_t_o_o_l_s -- by _@_w_e_b_k_n_j_a_z. │ │ │ │ │ * _#_1_2_5_4_4, _#_1_2_5_4_5: Python virtual environment detection was improved by │ │ │ │ │ checking for a pyvenv.cfg file, ensuring reliable detection on various │ │ │ │ │ platforms -- by _@_z_a_c_h_s_n_i_c_k_e_r_s. │ │ │ │ │ * _#_2_8_7_1: Do not truncate arguments to functions in output when running with │ │ │ │ │ -vvv. │ │ │ │ │ * _#_3_8_9: The readability of assertion introspection of bound methods has │ │ │ │ │ been enhanced -- by _@_f_a_r_b_o_d_a_h_m, _@_w_e_b_k_n_j_a_z, _@_o_b_e_s_t_w_a_l_t_e_r, _@_f_l_u_b and │ │ │ │ │ @@ -1175,25 +1175,25 @@ │ │ │ │ │ XML report. │ │ │ │ │ ******** BBuugg ffiixxeess_?¶ ******** │ │ │ │ │ * _#_1_1_7_0_6: Fixed reporting of teardown errors in higher-scoped fixtures when │ │ │ │ │ using --maxfail or --stepwise. │ │ │ │ │ Originally added in pytest 8.0.0, but reverted in 8.0.2 due to a │ │ │ │ │ regression in pytest-xdist. This regression was fixed in pytest-xdist │ │ │ │ │ 3.6.1. │ │ │ │ │ - * _#_1_1_7_9_7: _p_y_t_e_s_t_._a_p_p_r_o_x_(_) now correctly handles Sequence-like objects. │ │ │ │ │ + * _#_1_1_7_9_7: _p_y_t_e_s_t_._a_p_p_r_o_x_(_) now correctly handles _S_e_q_u_e_n_c_e-like objects. │ │ │ │ │ * _#_1_2_2_0_4, _#_1_2_2_6_4: Fixed a regression in pytest 8.0 where tracebacks get │ │ │ │ │ longer and longer when multiple tests fail due to a shared higher-scope │ │ │ │ │ fixture which raised -- by _@_b_l_u_e_t_e_c_h. │ │ │ │ │ Also fixed a similar regression in pytest 5.4 for collectors which raise │ │ │ │ │ during setup. │ │ │ │ │ The fix necessitated internal changes which may affect some plugins: │ │ │ │ │ o FixtureDef.cached_result[2] is now a tuple (exc, tb) instead of │ │ │ │ │ exc. │ │ │ │ │ o SetupState.stack failures are now a tuple (exc, tb) instead of exc. │ │ │ │ │ - * _#_1_2_2_7_5: Fixed collection error upon encountering an abstract class, │ │ │ │ │ + * _#_1_2_2_7_5: Fixed collection error upon encountering an _a_b_s_t_r_a_c_t class, │ │ │ │ │ including abstract unittest.TestCase subclasses. │ │ │ │ │ * _#_1_2_3_2_8: Fixed a regression in pytest 8.0.0 where package-scoped │ │ │ │ │ parameterized items were not correctly reordered to minimize setups/ │ │ │ │ │ teardowns in some cases. │ │ │ │ │ * _#_1_2_4_2_4: Fixed crash with assert testcase is not None assertion failure │ │ │ │ │ when re-running unittest tests using plugins like pytest-rerunfailures. │ │ │ │ │ Regressed in 8.2.2. │ │ │ │ │ @@ -1210,15 +1210,15 @@ │ │ │ │ │ cached. │ │ │ │ │ * _#_7_1_6_6: Fixed progress percentages (the [ 87%] at the edge of the screen) │ │ │ │ │ sometimes not aligning correctly when running with pytest-xdist -n. │ │ │ │ │ ******** IImmpprroovveedd ddooccuummeennttaattiioonn_?¶ ******** │ │ │ │ │ * _#_1_2_1_5_3: Documented using _P_Y_T_E_S_T___V_E_R_S_I_O_N to detect if code is running from │ │ │ │ │ within a pytest run. │ │ │ │ │ * _#_1_2_4_6_9: The external plugin mentions in the documentation now avoid │ │ │ │ │ - mentioning setuptools entry-points as the concept is much more generic │ │ │ │ │ + mentioning _s_e_t_u_p_t_o_o_l_s_ _e_n_t_r_y_-_p_o_i_n_t_s as the concept is much more generic │ │ │ │ │ nowadays. Instead, the terminology of "external", "installed", or "third- │ │ │ │ │ party" plugins (or packages) replaces that. │ │ │ │ │ -- by _@_w_e_b_k_n_j_a_z │ │ │ │ │ * _#_1_2_5_7_7: CI and BUILD_NUMBER environment variables role is described in │ │ │ │ │ the reference doc. They now also appear when doing pytest -h -- by │ │ │ │ │ _@_M_a_r_c_B_r_e_s_s_o_n. │ │ │ │ │ ******** CCoonnttrriibbuuttoorr--ffaacciinngg cchhaannggeess_?¶ ******** │ │ │ │ │ @@ -1305,23 +1305,23 @@ │ │ │ │ │ of the expected rwxr-xr-x. │ │ │ │ │ ******** TTrriivviiaall//IInntteerrnnaall CChhaannggeess_?¶ ******** │ │ │ │ │ * _#_1_2_3_3_3: pytest releases are now attested using the recent _A_r_t_i_f_a_c_t │ │ │ │ │ _A_t_t_e_s_t_a_t_i_o_n support from GitHub, allowing users to verify the provenance │ │ │ │ │ of pytest's sdist and wheel artifacts. │ │ │ │ │ ********** ppyytteesstt 88..22..00 ((22002244--0044--2277))_?¶ ********** │ │ │ │ │ ******** BBrreeaakkiinngg CChhaannggeess_?¶ ******** │ │ │ │ │ - * _#_1_2_0_8_9: pytest now requires that unittest.TestCase subclasses can be │ │ │ │ │ + * _#_1_2_0_8_9: pytest now requires that _u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e subclasses can be │ │ │ │ │ instantiated freely using MyTestCase('runTest'). │ │ │ │ │ If the class doesn't allow this, you may see an error during collection │ │ │ │ │ such as AttributeError: 'MyTestCase' object has no attribute 'runTest'. │ │ │ │ │ Classes which do not override __init__, or do not access the test method │ │ │ │ │ in __init__ using getattr or similar, are unaffected. │ │ │ │ │ Classes which do should take care to not crash when "runTest" is given, │ │ │ │ │ as is shown in _u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e_s_'_s_ _i_m_p_l_e_m_e_n_t_a_t_i_o_n. Alternatively, │ │ │ │ │ - consider using setUp instead of __init__. │ │ │ │ │ + consider using _s_e_t_U_p instead of __init__. │ │ │ │ │ If you run into this issue using tornado.AsyncTestCase, please see _i_s_s_u_e │ │ │ │ │ _1_2_2_6_3. │ │ │ │ │ If you run into this issue using an abstract TestCase subclass, please │ │ │ │ │ see _i_s_s_u_e_ _1_2_2_7_5. │ │ │ │ │ Historical note: the effect of this change on custom TestCase │ │ │ │ │ implementations was not properly considered initially, this is why it was │ │ │ │ │ done in a minor release. We apologize for the inconvenience. │ │ │ │ │ @@ -1345,21 +1345,21 @@ │ │ │ │ │ ******** FFeeaattuurreess_?¶ ******** │ │ │ │ │ * _#_1_1_8_7_1: Added support for reading command line arguments from a file │ │ │ │ │ using the prefix character @, like e.g.: pytest @tests.txt. The file must │ │ │ │ │ have one argument per line. │ │ │ │ │ See _R_e_a_d_ _a_r_g_u_m_e_n_t_s_ _f_r_o_m_ _f_i_l_e for details. │ │ │ │ │ ******** IImmpprroovveemmeennttss_?¶ ******** │ │ │ │ │ * _#_1_1_5_2_3: _p_y_t_e_s_t_._i_m_p_o_r_t_o_r_s_k_i_p_(_) will now issue a warning if the module │ │ │ │ │ - could be found, but raised ImportError instead of ModuleNotFoundError. │ │ │ │ │ + could be found, but raised _I_m_p_o_r_t_E_r_r_o_r instead of _M_o_d_u_l_e_N_o_t_F_o_u_n_d_E_r_r_o_r. │ │ │ │ │ The warning can be suppressed by passing exc_type=ImportError to │ │ │ │ │ _p_y_t_e_s_t_._i_m_p_o_r_t_o_r_s_k_i_p_(_). │ │ │ │ │ See _p_y_t_e_s_t_._i_m_p_o_r_t_o_r_s_k_i_p_ _d_e_f_a_u_l_t_ _b_e_h_a_v_i_o_r_ _r_e_g_a_r_d_i_n_g_ _I_m_p_o_r_t_E_r_r_o_r for │ │ │ │ │ details. │ │ │ │ │ * _#_1_1_7_2_8: For unittest-based tests, exceptions during class cleanup (as │ │ │ │ │ - raised by functions registered with TestCase.addClassCleanup) are now │ │ │ │ │ + raised by functions registered with _T_e_s_t_C_a_s_e_._a_d_d_C_l_a_s_s_C_l_e_a_n_u_p) are now │ │ │ │ │ reported instead of silently failing. │ │ │ │ │ * _#_1_1_7_7_7: Text is no longer truncated in the short test summary info │ │ │ │ │ section when -vv is given. │ │ │ │ │ * _#_1_2_1_1_2: Improved namespace packages detection when │ │ │ │ │ _c_o_n_s_i_d_e_r___n_a_m_e_s_p_a_c_e___p_a_c_k_a_g_e_s is enabled, covering more situations (like │ │ │ │ │ editable installs). │ │ │ │ │ * _#_9_5_0_2: Added _P_Y_T_E_S_T___V_E_R_S_I_O_N environment variable which is defined at the │ │ │ │ │ @@ -1398,36 +1398,36 @@ │ │ │ │ │ defaulting to False. │ │ │ │ │ If set to True, pytest will attempt to identify modules that are part of │ │ │ │ │ _n_a_m_e_s_p_a_c_e_ _p_a_c_k_a_g_e_s when importing modules. │ │ │ │ │ * _#_1_1_6_5_3: Added the new _v_e_r_b_o_s_i_t_y___t_e_s_t___c_a_s_e_s configuration option for fine- │ │ │ │ │ grained control of test execution verbosity. See _F_i_n_e_-_g_r_a_i_n_e_d_ _v_e_r_b_o_s_i_t_y │ │ │ │ │ for more details. │ │ │ │ │ ******** IImmpprroovveemmeennttss_?¶ ******** │ │ │ │ │ - * _#_1_0_8_6_5: pytest.warns() now validates that warnings.warn() was called with │ │ │ │ │ + * _#_1_0_8_6_5: pytest.warns() now validates that _w_a_r_n_i_n_g_s_._w_a_r_n_(_) was called with │ │ │ │ │ a str or a Warning. Currently in Python it is possible to use other │ │ │ │ │ - types, however this causes an exception when warnings.filterwarnings() is │ │ │ │ │ + types, however this causes an exception when _w_a_r_n_i_n_g_s_._f_i_l_t_e_r_w_a_r_n_i_n_g_s_(_) is │ │ │ │ │ used to filter those warnings (see _C_P_y_t_h_o_n_ _#_1_0_3_5_7_7 for a discussion). │ │ │ │ │ While this can be considered a bug in CPython, we decided to put guards │ │ │ │ │ in pytest as the error message produced without this check in place is │ │ │ │ │ confusing. │ │ │ │ │ * _#_1_1_3_1_1: When using --override-ini for paths in invocations without a │ │ │ │ │ configuration file defined, the current working directory is used as the │ │ │ │ │ relative directory. │ │ │ │ │ - Previously this would raise an AssertionError. │ │ │ │ │ + Previously this would raise an _A_s_s_e_r_t_i_o_n_E_r_r_o_r. │ │ │ │ │ * _#_1_1_4_7_5: _-_-_i_m_p_o_r_t_-_m_o_d_e_=_i_m_p_o_r_t_l_i_b now tries to import modules using the │ │ │ │ │ - standard import mechanism (but still without changing sys.path), falling │ │ │ │ │ + standard import mechanism (but still without changing _s_y_s_._p_a_t_h), falling │ │ │ │ │ back to importing modules directly only if that fails. │ │ │ │ │ This means that installed packages will be imported under their canonical │ │ │ │ │ name if possible first, for example app.core.models, instead of having │ │ │ │ │ the module name always be derived from their path (for example │ │ │ │ │ .env310.lib.site_packages.app.core.models). │ │ │ │ │ * _#_1_1_8_0_1: Added the _i_t_e_r___p_a_r_e_n_t_s_(_) helper method on nodes. It is similar to │ │ │ │ │ _l_i_s_t_c_h_a_i_n, but goes from bottom to top, and returns an iterator, not a │ │ │ │ │ list. │ │ │ │ │ - * _#_1_1_8_5_0: Added support for sys.last_exc for post-mortem debugging on │ │ │ │ │ + * _#_1_1_8_5_0: Added support for _s_y_s_._l_a_s_t___e_x_c for post-mortem debugging on │ │ │ │ │ Python>=3.12. │ │ │ │ │ * _#_1_1_9_6_2: In case no other suitable candidates for configuration file are │ │ │ │ │ found, a pyproject.toml (even without a [tool.pytest.ini_options] table) │ │ │ │ │ will be considered as the configuration file and define the rootdir. │ │ │ │ │ * _#_1_1_9_7_8: Add --log-file-mode option to the logging plugin, enabling │ │ │ │ │ appending to log-files. This option accepts either "w" or "a" and │ │ │ │ │ defaults to "w". │ │ │ │ │ @@ -1481,15 +1481,15 @@ │ │ │ │ │ version of a path (for example c:\PROGRA~1\tests). │ │ │ │ │ * _#_1_1_9_5_3: Fix an IndexError crash raising from getstatementrange_ast. │ │ │ │ │ * _#_1_2_0_2_1: Reverted a fix to --maxfail handling in pytest 8.0.0 because it │ │ │ │ │ caused a regression in pytest-xdist whereby session fixture teardowns may │ │ │ │ │ get executed multiple times when the max-fails is reached. │ │ │ │ │ ********** ppyytteesstt 88..00..11 ((22002244--0022--1166))_?¶ ********** │ │ │ │ │ ******** BBuugg FFiixxeess_?¶ ******** │ │ │ │ │ - * _#_1_1_8_7_5: Correctly handle errors from getpass.getuser() in Python 3.13. │ │ │ │ │ + * _#_1_1_8_7_5: Correctly handle errors from _g_e_t_p_a_s_s_._g_e_t_u_s_e_r_(_) in Python 3.13. │ │ │ │ │ * _#_1_1_8_7_9: Fix an edge case where ExceptionInfo._stringify_exception could │ │ │ │ │ crash pytest.raises(). │ │ │ │ │ * _#_1_1_9_0_6: Fix regression with pytest.warns() using custom warning │ │ │ │ │ subclasses which have more than one parameter in their __init__. │ │ │ │ │ * _#_1_1_9_0_7: Fix a regression in pytest 8.0.0 whereby calling _p_y_t_e_s_t_._s_k_i_p_(_) │ │ │ │ │ and similar control-flow exceptions within a pytest.warns() block would │ │ │ │ │ get suppressed instead of propagating. │ │ │ │ │ @@ -1645,15 +1645,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Code/plugins which rely on a specific shape of the collection tree might │ │ │ │ │ need to update. │ │ │ │ │ * _#_1_1_6_7_6: The classes _N_o_d_e, _C_o_l_l_e_c_t_o_r, _I_t_e_m, _F_i_l_e, _F_S_C_o_l_l_e_c_t_o_r are now │ │ │ │ │ - marked abstract (see abc). │ │ │ │ │ + marked abstract (see _a_b_c). │ │ │ │ │ We do not expect this change to affect users and plugin authors, it will │ │ │ │ │ only cause errors when the code is already wrong or problematic. │ │ │ │ │ ****** OOtthheerr bbrreeaakkiinngg cchhaannggeess_?¶ ****** │ │ │ │ │ These are breaking changes where deprecation was not possible. │ │ │ │ │ * _#_1_1_2_8_2: Sanitized the handling of the default parameter when defining │ │ │ │ │ configuration options. │ │ │ │ │ Previously if default was not supplied for _p_a_r_s_e_r_._a_d_d_i_n_i and the │ │ │ │ │ @@ -1720,15 +1720,15 @@ │ │ │ │ │ making everything else verbose, this is for you. │ │ │ │ │ See _F_i_n_e_-_g_r_a_i_n_e_d_ _v_e_r_b_o_s_i_t_y for more details. │ │ │ │ │ For plugin authors, _c_o_n_f_i_g_._g_e_t___v_e_r_b_o_s_i_t_y can be used to retrieve the │ │ │ │ │ verbosity level for a specific verbosity type. │ │ │ │ │ ****** AAddddiittiioonnaall SSuuppppoorrtt FFoorr EExxcceeppttiioonn GGrroouuppss aanndd ____nnootteess_____?¶ ****** │ │ │ │ │ These changes improve pytest's support for exception groups. │ │ │ │ │ * _#_1_0_4_4_1: Added _E_x_c_e_p_t_i_o_n_I_n_f_o_._g_r_o_u_p___c_o_n_t_a_i_n_s_(_), an assertion helper that │ │ │ │ │ - tests if an ExceptionGroup contains a matching exception. │ │ │ │ │ + tests if an _E_x_c_e_p_t_i_o_n_G_r_o_u_p contains a matching exception. │ │ │ │ │ See _A_s_s_e_r_t_i_o_n_s_ _a_b_o_u_t_ _e_x_p_e_c_t_e_d_ _e_x_c_e_p_t_i_o_n_ _g_r_o_u_p_s for an example. │ │ │ │ │ * _#_1_1_2_2_7: Allow pytest.raises() match argument to match against PEP-678 │ │ │ │ │ __notes__. │ │ │ │ │ ****** CCuussttoomm DDiirreeccttoorryy ccoolllleeccttoorrss_?¶ ****** │ │ │ │ │ * _#_7_7_7_7: Added a new hook _p_y_t_e_s_t___c_o_l_l_e_c_t___d_i_r_e_c_t_o_r_y, which is called by │ │ │ │ │ filesystem-traversing collector nodes, such as _p_y_t_e_s_t_._S_e_s_s_i_o_n, _p_y_t_e_s_t_._D_i_r │ │ │ │ │ and _p_y_t_e_s_t_._P_a_c_k_a_g_e, to create a collector node for a sub-directory. It is │ │ │ │ │ @@ -1744,17 +1744,17 @@ │ │ │ │ │ * _#_1_1_2_1_6: If a test is skipped from inside an _x_u_n_i_t_ _s_e_t_u_p_ _f_i_x_t_u_r_e, the test │ │ │ │ │ summary now shows the test location instead of the fixture location. │ │ │ │ │ * _#_1_1_3_1_4: Logging to a file using the --log-file option will use --log- │ │ │ │ │ level, --log-format and --log-date-format as fallback if --log-file- │ │ │ │ │ level, --log-file-format and --log-file-date-format are not provided │ │ │ │ │ respectively. │ │ │ │ │ * _#_1_1_6_1_0: Added the _L_o_g_C_a_p_t_u_r_e_F_i_x_t_u_r_e_._f_i_l_t_e_r_i_n_g_(_) context manager which │ │ │ │ │ - adds a given logging.Filter object to the _c_a_p_l_o_g fixture. │ │ │ │ │ + adds a given _l_o_g_g_i_n_g_._F_i_l_t_e_r object to the _c_a_p_l_o_g fixture. │ │ │ │ │ * _#_1_1_4_4_7: pytest.deprecated_call() now also considers warnings of type │ │ │ │ │ - FutureWarning. │ │ │ │ │ + _F_u_t_u_r_e_W_a_r_n_i_n_g. │ │ │ │ │ * _#_1_1_6_0_0: Improved the documentation and type signature for │ │ │ │ │ _p_y_t_e_s_t_._m_a_r_k_._x_f_a_i_l's condition param to use False as the default value. │ │ │ │ │ * _#_7_4_6_9: _F_i_x_t_u_r_e_D_e_f is now exported as pytest.FixtureDef for typing │ │ │ │ │ purposes. │ │ │ │ │ * _#_1_1_3_5_3: Added typing to _P_y_t_e_s_t_P_l_u_g_i_n_M_a_n_a_g_e_r. │ │ │ │ │ ******** BBuugg FFiixxeess_?¶ ******** │ │ │ │ │ * _#_1_0_7_0_1: _p_y_t_e_s_t_._W_a_r_n_i_n_g_s_R_e_c_o_r_d_e_r_._p_o_p_(_) will return the most-closely- │ │ │ │ │ @@ -1799,29 +1799,29 @@ │ │ │ │ │ previous spelling INCOVATION_DIR remains as an alias. │ │ │ │ │ * _#_1_1_6_3_8: Fixed the selftests to pass correctly if FORCE_COLOR, NO_COLOR or │ │ │ │ │ PY_COLORS is set in the calling environment. │ │ │ │ │ ********** ppyytteesstt 77..44..44 ((22002233--1122--3311))_?¶ ********** │ │ │ │ │ ******** BBuugg FFiixxeess_?¶ ******** │ │ │ │ │ * _#_1_1_1_4_0: Fix non-string constants at the top of file being detected as │ │ │ │ │ docstrings on Python>=3.8. │ │ │ │ │ - * _#_1_1_5_7_2: Handle an edge case where sys.stderr and sys.__stderr__ might │ │ │ │ │ + * _#_1_1_5_7_2: Handle an edge case where _s_y_s_._s_t_d_e_r_r and _s_y_s_._____s_t_d_e_r_r____ might │ │ │ │ │ already be closed when _F_a_u_l_t_ _H_a_n_d_l_e_r is tearing down. │ │ │ │ │ * _#_1_1_7_1_0: Fixed tracebacks from collection errors not getting pruned. │ │ │ │ │ * _#_7_9_6_6: Removed unhelpful error message from assertion rewrite mechanism │ │ │ │ │ when exceptions are raised in __iter__ methods. Now they are treated un- │ │ │ │ │ iterable instead. │ │ │ │ │ ******** IImmpprroovveedd DDooccuummeennttaattiioonn_?¶ ******** │ │ │ │ │ * _#_1_1_0_9_1: Updated documentation to refer to hyphenated options: replaced -- │ │ │ │ │ junitxml with --junit-xml and --collectonly with --collect-only. │ │ │ │ │ ********** ppyytteesstt 77..44..33 ((22002233--1100--2244))_?¶ ********** │ │ │ │ │ ******** BBuugg FFiixxeess_?¶ ******** │ │ │ │ │ * _#_1_0_4_4_7: Markers are now considered in the reverse mro order to ensure │ │ │ │ │ base class markers are considered first -- this resolves a regression. │ │ │ │ │ * _#_1_1_2_3_9: Fixed := in asserts impacting unrelated test cases. │ │ │ │ │ - * _#_1_1_4_3_9: Handled an edge case where sys.stderr might already be closed │ │ │ │ │ + * _#_1_1_4_3_9: Handled an edge case where _s_y_s_._s_t_d_e_r_r might already be closed │ │ │ │ │ when _F_a_u_l_t_ _H_a_n_d_l_e_r is tearing down. │ │ │ │ │ ********** ppyytteesstt 77..44..22 ((22002233--0099--0077))_?¶ ********** │ │ │ │ │ ******** BBuugg FFiixxeess_?¶ ******** │ │ │ │ │ * _#_1_1_2_3_7: Fix doctest collection of functools.cached_property objects. │ │ │ │ │ * _#_1_1_3_0_6: Fixed bug using --importmode=importlib which would cause package │ │ │ │ │ __init__.py files to be imported more than once in some cases. │ │ │ │ │ * _#_1_1_3_6_7: Fixed bug where user_properties where not being saved in the │ │ │ │ │ @@ -1956,16 +1956,16 @@ │ │ │ │ │ github.com/hylang/hy>__. │ │ │ │ │ * _#_6_2_6_7: The full output of a test is no longer truncated if the truncation │ │ │ │ │ message would be longer than the hidden text. The line number shown has │ │ │ │ │ also been fixed. │ │ │ │ │ ******** BBuugg FFiixxeess_?¶ ******** │ │ │ │ │ * _#_1_0_7_4_3: The assertion rewriting mechanism now works correctly when │ │ │ │ │ assertion expressions contain the walrus operator. │ │ │ │ │ - * _#_1_0_7_6_5: Fixed _t_m_p___p_a_t_h fixture always raising OSError on emscripten │ │ │ │ │ - platform due to missing os.getuid(). │ │ │ │ │ + * _#_1_0_7_6_5: Fixed _t_m_p___p_a_t_h fixture always raising _O_S_E_r_r_o_r on emscripten │ │ │ │ │ + platform due to missing _o_s_._g_e_t_u_i_d_(_). │ │ │ │ │ * _#_1_9_0_4: Correctly handle __tracebackhide__ for chained exceptions. NOTE: │ │ │ │ │ This change was reverted in version 7.3.1. │ │ │ │ │ ******** IImmpprroovveedd DDooccuummeennttaattiioonn_?¶ ******** │ │ │ │ │ * _#_1_0_7_8_2: Fixed the minimal example in _G_o_o_d_ _I_n_t_e_g_r_a_t_i_o_n_ _P_r_a_c_t_i_c_e_s: pip │ │ │ │ │ install -e . requires a version entry in pyproject.toml to run │ │ │ │ │ successfully. │ │ │ │ │ ******** TTrriivviiaall//IInntteerrnnaall CChhaannggeess_?¶ ******** │ │ │ │ │ @@ -2048,28 +2048,28 @@ │ │ │ │ │ the issue, and their utf-8 representation is expressed instead. │ │ │ │ │ * _#_8_5_0_8: Introduce multiline display for warning matching via pytest.warns │ │ │ │ │ () and enhance match comparison for _p_y_t_e_s_t_._E_x_c_e_p_t_i_o_n_I_n_f_o_._m_a_t_c_h_(_) as │ │ │ │ │ returned by pytest.raises(). │ │ │ │ │ * _#_8_6_4_6: Improve pytest.raises(). Previously passing an empty tuple would │ │ │ │ │ give a confusing error. We now raise immediately with a more helpful │ │ │ │ │ message. │ │ │ │ │ - * _#_9_7_4_1: On Python 3.11, use the standard library's tomllib to parse TOML. │ │ │ │ │ + * _#_9_7_4_1: On Python 3.11, use the standard library's _t_o_m_l_l_i_b to parse TOML. │ │ │ │ │ tomli is no longer a dependency on Python 3.11. │ │ │ │ │ * _#_9_7_4_2: Display assertion message without escaped newline characters with │ │ │ │ │ -vv. │ │ │ │ │ * _#_9_8_2_3: Improved error message that is shown when no collector is found │ │ │ │ │ for a given file. │ │ │ │ │ * _#_9_8_7_3: Some coloring has been added to the short test summary. │ │ │ │ │ * _#_9_8_8_3: Normalize the help description of all command-line options. │ │ │ │ │ * _#_9_9_2_0: Display full crash messages in short test summary info, when │ │ │ │ │ running in a CI environment. │ │ │ │ │ * _#_9_9_8_7: Added support for hidden configuration file by allowing │ │ │ │ │ .pytest.ini as an alternative to pytest.ini. │ │ │ │ │ ******** BBuugg FFiixxeess_?¶ ******** │ │ │ │ │ - * _#_1_0_1_5_0: sys.stdin now contains all expected methods of a file-like object │ │ │ │ │ + * _#_1_0_1_5_0: _s_y_s_._s_t_d_i_n now contains all expected methods of a file-like object │ │ │ │ │ when capture is enabled. │ │ │ │ │ * _#_1_0_3_8_2: Do not break into pdb when raise unittest.SkipTest() appears top- │ │ │ │ │ level in a file. │ │ │ │ │ * _#_7_7_9_2: Marks are now inherited according to the full MRO in test classes. │ │ │ │ │ Previously, if a test class inherited from two or more classes, only │ │ │ │ │ marks from the first super-class would apply. │ │ │ │ │ When inheriting marks from super-classes, marks from the sub-classes are │ │ │ │ │ @@ -2088,15 +2088,15 @@ │ │ │ │ │ invoking caplog.clear(). │ │ │ │ │ ******** IImmpprroovveedd DDooccuummeennttaattiioonn_?¶ ******** │ │ │ │ │ * _#_1_0_3_4_4: Update information on writing plugins to use pyproject.toml │ │ │ │ │ instead of setup.py. │ │ │ │ │ * _#_9_2_4_8: The documentation is now built using Sphinx 5.x (up from 3.x │ │ │ │ │ previously). │ │ │ │ │ * _#_9_2_9_1: Update documentation on how pytest.warns() affects │ │ │ │ │ - DeprecationWarning. │ │ │ │ │ + _D_e_p_r_e_c_a_t_i_o_n_W_a_r_n_i_n_g. │ │ │ │ │ ******** TTrriivviiaall//IInntteerrnnaall CChhaannggeess_?¶ ******** │ │ │ │ │ * _#_1_0_3_1_3: Made _pytest.doctest.DoctestItem export pytest.DoctestItem for │ │ │ │ │ type check and runtime purposes. Made _pytest.doctest use internal APIs │ │ │ │ │ to avoid circular imports. │ │ │ │ │ * _#_9_9_0_6: Made _pytest.compat re-export importlib_metadata in the eyes of │ │ │ │ │ type checkers. │ │ │ │ │ * _#_9_9_1_0: Fix default encoding warning (EncodingWarning) in cacheprovider │ │ │ │ │ @@ -2156,26 +2156,26 @@ │ │ │ │ │ Also, when showing diffs for sequences, -q would produce full diffs │ │ │ │ │ instead of the expected diff. │ │ │ │ │ * _#_9_3_6_2: pytest now avoids specialized assert formatting when it is │ │ │ │ │ detected that the default __eq__ is overridden in attrs or dataclasses. │ │ │ │ │ * _#_9_5_3_6: When -vv is given on command line, show skipping and xfail reasons │ │ │ │ │ in full instead of truncating them to fit the terminal width. │ │ │ │ │ * _#_9_6_4_4: More information about the location of resources that led Python │ │ │ │ │ - to raise ResourceWarning can now be obtained by enabling tracemalloc. │ │ │ │ │ + to raise _R_e_s_o_u_r_c_e_W_a_r_n_i_n_g can now be obtained by enabling _t_r_a_c_e_m_a_l_l_o_c. │ │ │ │ │ See _R_e_s_o_u_r_c_e_ _W_a_r_n_i_n_g_s for more information. │ │ │ │ │ * _#_9_6_7_8: More types are now accepted in the ids argument to │ │ │ │ │ @pytest.mark.parametrize. Previously only str, float, int and bool were │ │ │ │ │ accepted; now bytes, complex, re.Pattern, Enum and anything with a │ │ │ │ │ __name__ are also accepted. │ │ │ │ │ - * _#_9_6_9_2: _p_y_t_e_s_t_._a_p_p_r_o_x_(_) now raises a TypeError when given an unordered │ │ │ │ │ - sequence (such as set). │ │ │ │ │ + * _#_9_6_9_2: _p_y_t_e_s_t_._a_p_p_r_o_x_(_) now raises a _T_y_p_e_E_r_r_o_r when given an unordered │ │ │ │ │ + sequence (such as _s_e_t). │ │ │ │ │ Note that this implies that custom classes which only implement __iter__ │ │ │ │ │ and __len__ are no longer supported as they don't guarantee order. │ │ │ │ │ ******** BBuugg FFiixxeess_?¶ ******** │ │ │ │ │ - * _#_8_2_4_2: The deprecation of raising unittest.SkipTest to skip collection of │ │ │ │ │ + * _#_8_2_4_2: The deprecation of raising _u_n_i_t_t_e_s_t_._S_k_i_p_T_e_s_t to skip collection of │ │ │ │ │ tests during the pytest collection phase is reverted - this is now a │ │ │ │ │ supported feature again. │ │ │ │ │ * _#_9_4_9_3: Symbolic link components are no longer resolved in conftest paths. │ │ │ │ │ This means that if a conftest appears twice in collection tree, using │ │ │ │ │ symlinks, it will be executed twice. For example, given │ │ │ │ │ tests/real/conftest.py tests/real/test_it.py tests/link - │ │ │ │ │ > tests/real │ │ │ │ │ @@ -2184,15 +2184,15 @@ │ │ │ │ │ similar change made to test collection itself in pytest 6.0 (see _#_6_5_2_3 │ │ │ │ │ for details). │ │ │ │ │ * _#_9_6_2_6: Fixed count of selected tests on terminal collection summary when │ │ │ │ │ there were errors or skipped modules. │ │ │ │ │ If there were errors or skipped modules on collection, pytest would │ │ │ │ │ mistakenly subtract those from the selected count. │ │ │ │ │ * _#_9_6_4_5: Fixed regression where --import-mode=importlib used together with │ │ │ │ │ - PYTHONPATH or _p_y_t_h_o_n_p_a_t_h would cause import errors in test suites. │ │ │ │ │ + _P_Y_T_H_O_N_P_A_T_H or _p_y_t_h_o_n_p_a_t_h would cause import errors in test suites. │ │ │ │ │ * _#_9_7_0_8: _p_y_t_e_s_t_e_r now requests a _m_o_n_k_e_y_p_a_t_c_h fixture instead of creating │ │ │ │ │ one internally. This solves some issues with tests that involve pytest │ │ │ │ │ environment variables. │ │ │ │ │ * _#_9_7_3_0: Malformed pyproject.toml files now produce a clearer error │ │ │ │ │ message. │ │ │ │ │ ********** ppyytteesstt 77..00..11 ((22002222--0022--1111))_?¶ ********** │ │ │ │ │ ******** BBuugg FFiixxeess_?¶ ******** │ │ │ │ │ @@ -2297,19 +2297,19 @@ │ │ │ │ │ o _pytest.runner.CallInfo │ │ │ │ │ o _pytest._code.ExceptionInfo │ │ │ │ │ o _pytest.config.argparsing.Parser │ │ │ │ │ o _pytest.config.argparsing.OptionGroup │ │ │ │ │ o _pytest.pytester.HookRecorder │ │ │ │ │ These constructors have always been considered private, but now issue a │ │ │ │ │ deprecation warning, which may become a hard error in pytest 8. │ │ │ │ │ - * _#_8_2_4_2: Raising unittest.SkipTest to skip collection of tests during the │ │ │ │ │ + * _#_8_2_4_2: Raising _u_n_i_t_t_e_s_t_._S_k_i_p_T_e_s_t to skip collection of tests during the │ │ │ │ │ pytest collection phase is deprecated. Use _p_y_t_e_s_t_._s_k_i_p_(_) instead. │ │ │ │ │ - Note: This deprecation only relates to using unittest.SkipTest during │ │ │ │ │ + Note: This deprecation only relates to using _u_n_i_t_t_e_s_t_._S_k_i_p_T_e_s_t during │ │ │ │ │ test collection. You are probably not doing that. Ordinary usage of │ │ │ │ │ - unittest.SkipTest / unittest.TestCase.skipTest() / unittest.skip() in │ │ │ │ │ + _u_n_i_t_t_e_s_t_._S_k_i_p_T_e_s_t / _u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e_._s_k_i_p_T_e_s_t_(_) / _u_n_i_t_t_e_s_t_._s_k_i_p_(_) in │ │ │ │ │ unittest test cases is fully supported. │ │ │ │ │ Note │ │ │ │ │ This deprecation has been reverted in pytest 7.1.0. │ │ │ │ │ * _#_8_3_1_5: Several behaviors of _P_a_r_s_e_r_._a_d_d_o_p_t_i_o_n are now scheduled for │ │ │ │ │ removal in pytest 8 (deprecated since pytest 2.4.0): │ │ │ │ │ o parser.addoption(..., help=".. %default ..") - use %(default)s │ │ │ │ │ instead. │ │ │ │ │ @@ -2342,19 +2342,19 @@ │ │ │ │ │ ******** FFeeaattuurreess_?¶ ******** │ │ │ │ │ * _#_5_1_9_6: Tests are now ordered by definition order in more cases. │ │ │ │ │ In a class hierarchy, tests from base classes are now consistently │ │ │ │ │ ordered before tests defined on their subclasses (reverse MRO order). │ │ │ │ │ * _#_7_1_3_2: Added two environment variables _P_Y_T_E_S_T___T_H_E_M_E and _P_Y_T_E_S_T___T_H_E_M_E___M_O_D_E │ │ │ │ │ to let the users customize the pygments theme used. │ │ │ │ │ * _#_7_2_5_9: Added _c_a_c_h_e_._m_k_d_i_r_(_), which is similar to the existing │ │ │ │ │ - cache.makedir(), but returns a pathlib.Path instead of a legacy │ │ │ │ │ + cache.makedir(), but returns a _p_a_t_h_l_i_b_._P_a_t_h instead of a legacy │ │ │ │ │ py.path.local. │ │ │ │ │ Added a paths type to _p_a_r_s_e_r_._a_d_d_i_n_i_(_), as in parser.addini("mypaths", "my │ │ │ │ │ paths", type="paths"), which is similar to the existing pathlist, but │ │ │ │ │ - returns a list of pathlib.Path instead of legacy py.path.local. │ │ │ │ │ + returns a list of _p_a_t_h_l_i_b_._P_a_t_h instead of legacy py.path.local. │ │ │ │ │ * _#_7_4_6_9: The types of objects used in pytest's API are now exported so they │ │ │ │ │ may be used in type annotations. │ │ │ │ │ The newly-exported types are: │ │ │ │ │ o pytest.Config for _C_o_n_f_i_g. │ │ │ │ │ o pytest.Mark for _m_a_r_k_s. │ │ │ │ │ o pytest.MarkDecorator for _m_a_r_k_ _d_e_c_o_r_a_t_o_r_s. │ │ │ │ │ o pytest.MarkGenerator for the _p_y_t_e_s_t_._m_a_r_k singleton. │ │ │ │ │ @@ -2380,15 +2380,15 @@ │ │ │ │ │ hooks. │ │ │ │ │ Constructing most of them directly is not supported; they are only meant │ │ │ │ │ for use in type annotations. Doing so will emit a deprecation warning, │ │ │ │ │ and may become a hard-error in pytest 8.0. │ │ │ │ │ Subclassing them is also not supported. This is not currently enforced at │ │ │ │ │ runtime, but is detected by type-checkers such as mypy. │ │ │ │ │ * _#_7_8_5_6: _-_-_i_m_p_o_r_t_-_m_o_d_e_=_i_m_p_o_r_t_l_i_b now works with features that depend on │ │ │ │ │ - modules being on sys.modules, such as pickle and dataclasses. │ │ │ │ │ + modules being on _s_y_s_._m_o_d_u_l_e_s, such as _p_i_c_k_l_e and _d_a_t_a_c_l_a_s_s_e_s. │ │ │ │ │ * _#_8_1_4_4: The following hooks now receive an additional pathlib.Path │ │ │ │ │ argument, equivalent to an existing py.path.local argument: │ │ │ │ │ o _p_y_t_e_s_t___i_g_n_o_r_e___c_o_l_l_e_c_t - The collection_path parameter (equivalent │ │ │ │ │ to existing path parameter). │ │ │ │ │ o _p_y_t_e_s_t___c_o_l_l_e_c_t___f_i_l_e - The file_path parameter (equivalent to │ │ │ │ │ existing path parameter). │ │ │ │ │ o _p_y_t_e_s_t___p_y_c_o_l_l_e_c_t___m_a_k_e_m_o_d_u_l_e - The module_path parameter (equivalent │ │ │ │ │ @@ -2413,15 +2413,15 @@ │ │ │ │ │ Note │ │ │ │ │ The name of the _N_o_d_e arguments and attributes (the new attribute being │ │ │ │ │ path) is tthhee ooppppoossiittee of the situation for hooks (the old argument being │ │ │ │ │ path). │ │ │ │ │ This is an unfortunate artifact due to historical reasons, which should │ │ │ │ │ be resolved in future versions as we slowly get rid of the _p_y dependency │ │ │ │ │ (see _#_9_2_8_3 for a longer discussion). │ │ │ │ │ - * _#_8_4_2_1: _p_y_t_e_s_t_._a_p_p_r_o_x_(_) now works on Decimal within mappings/dicts and │ │ │ │ │ + * _#_8_4_2_1: _p_y_t_e_s_t_._a_p_p_r_o_x_(_) now works on _D_e_c_i_m_a_l within mappings/dicts and │ │ │ │ │ sequences/lists. │ │ │ │ │ * _#_8_6_0_6: pytest invocations with --fixtures-per-test and --fixtures have │ │ │ │ │ been enriched with: │ │ │ │ │ o Fixture location path printed with the fixture name. │ │ │ │ │ o First section of the fixture's docstring printed under the fixture │ │ │ │ │ name. │ │ │ │ │ o Whole of fixture's docstring printed under the fixture name using - │ │ │ │ │ @@ -2432,22 +2432,22 @@ │ │ │ │ │ * _#_8_7_8_9: Switch TOML parser from toml to tomli for TOML v1.0.0 support in │ │ │ │ │ pyproject.toml. │ │ │ │ │ * _#_8_9_2_0: Added _p_y_t_e_s_t_._S_t_a_s_h, a facility for plugins to store their data on │ │ │ │ │ _C_o_n_f_i_g and _N_o_d_es in a type-safe and conflict-free manner. See _S_t_o_r_i_n_g │ │ │ │ │ _d_a_t_a_ _o_n_ _i_t_e_m_s_ _a_c_r_o_s_s_ _h_o_o_k_ _f_u_n_c_t_i_o_n_s for details. │ │ │ │ │ * _#_8_9_5_3: _R_u_n_R_e_s_u_l_t method _a_s_s_e_r_t___o_u_t_c_o_m_e_s_(_) now accepts a warnings argument │ │ │ │ │ to assert the total number of warnings captured. │ │ │ │ │ - * _#_8_9_5_4: --debug flag now accepts a str file to route debug logs into, │ │ │ │ │ + * _#_8_9_5_4: --debug flag now accepts a _s_t_r file to route debug logs into, │ │ │ │ │ remains defaulted to pytestdebug.log. │ │ │ │ │ * _#_9_0_2_3: Full diffs are now always shown for equality assertions of │ │ │ │ │ iterables when CI or BUILD_NUMBER is found in the environment, even when │ │ │ │ │ -v isn't used. │ │ │ │ │ * _#_9_1_1_3: _R_u_n_R_e_s_u_l_t method _a_s_s_e_r_t___o_u_t_c_o_m_e_s_(_) now accepts a deselected │ │ │ │ │ argument to assert the total number of deselected tests. │ │ │ │ │ - * _#_9_1_1_4: Added _p_y_t_h_o_n_p_a_t_h setting that adds listed paths to sys.path for │ │ │ │ │ + * _#_9_1_1_4: Added _p_y_t_h_o_n_p_a_t_h setting that adds listed paths to _s_y_s_._p_a_t_h for │ │ │ │ │ the duration of the test session. If you currently use the pytest- │ │ │ │ │ pythonpath or pytest-srcpaths plugins, you should be able to replace them │ │ │ │ │ with built-in pythonpath setting. │ │ │ │ │ ******** IImmpprroovveemmeennttss_?¶ ******** │ │ │ │ │ * _#_7_4_8_0: A deprecation scheduled to be removed in a major version X (e.g. │ │ │ │ │ pytest 7, 8, 9, ...) now uses warning category PytestRemovedInXWarning, a │ │ │ │ │ subclass of _P_y_t_e_s_t_D_e_p_r_e_c_a_t_i_o_n_W_a_r_n_i_n_g, instead of _P_y_t_e_s_t_D_e_p_r_e_c_a_t_i_o_n_W_a_r_n_i_n_g │ │ │ │ │ @@ -2468,15 +2468,15 @@ │ │ │ │ │ E 3 | 4 | 5 +- 5.0e-06 │ │ │ │ │ * _#_8_4_0_3: By default, pytest will truncate long strings in assert errors so │ │ │ │ │ they don't clutter the output too much, currently at 240 characters by │ │ │ │ │ default. │ │ │ │ │ However, in some cases the longer output helps, or is even crucial, to │ │ │ │ │ diagnose a failure. Using -v will now increase the truncation threshold │ │ │ │ │ to 2400 characters, and -vv or higher will disable truncation entirely. │ │ │ │ │ - * _#_8_5_0_9: Fixed issue where unittest.TestCase.setUpClass() is not called │ │ │ │ │ + * _#_8_5_0_9: Fixed issue where _u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e_._s_e_t_U_p_C_l_a_s_s_(_) is not called │ │ │ │ │ when a test has / in its name since pytest 6.2.0. │ │ │ │ │ This refers to the path part in pytest node IDs, e.g. TestClass::test_it │ │ │ │ │ in the node ID tests/test_file.py::TestClass::test_it. │ │ │ │ │ Now, instead of assuming that the test name does not contain /, it is │ │ │ │ │ assumed that test path does not contain ::. We plan to hopefully make │ │ │ │ │ both of these work in the future. │ │ │ │ │ * _#_8_8_0_3: It is now possible to add colors to custom log levels on cli log. │ │ │ │ │ @@ -2502,15 +2502,15 @@ │ │ │ │ │ * _#_8_0_6_1: Fixed failing staticmethod test cases if they are inherited from a │ │ │ │ │ parent test class. │ │ │ │ │ * _#_8_1_9_2: testdir.makefile now silently accepts values which don't start │ │ │ │ │ with . to maintain backward compatibility with older pytest versions. │ │ │ │ │ pytester.makefile now issues a clearer error if the . is missing in the │ │ │ │ │ ext argument. │ │ │ │ │ * _#_8_2_5_8: Fixed issue where pytest's faulthandler support would not dump │ │ │ │ │ - traceback on crashes if the faulthandler module was already enabled │ │ │ │ │ + traceback on crashes if the _f_a_u_l_t_h_a_n_d_l_e_r module was already enabled │ │ │ │ │ during pytest startup (using python -X dev -m pytest for example). │ │ │ │ │ * _#_8_3_1_7: Fixed an issue where illegal directory characters derived from │ │ │ │ │ getpass.getuser() raised an OSError. │ │ │ │ │ * _#_8_3_6_7: Fix Class.from_parent so it forwards extra keyword arguments to │ │ │ │ │ the constructor. │ │ │ │ │ * _#_8_3_7_7: The test selection options pytest -k and pytest -m now support │ │ │ │ │ matching names containing forward slash (/) characters. │ │ │ │ │ @@ -2666,16 +2666,16 @@ │ │ │ │ │ be search/replaced safely. │ │ │ │ │ ******** FFeeaattuurreess_?¶ ******** │ │ │ │ │ * _#_5_2_9_9: pytest now warns about unraisable exceptions and unhandled thread │ │ │ │ │ exceptions that occur in tests on Python>=3.8. See _W_a_r_n_i_n_g_ _a_b_o_u_t │ │ │ │ │ _u_n_r_a_i_s_a_b_l_e_ _e_x_c_e_p_t_i_o_n_s_ _a_n_d_ _u_n_h_a_n_d_l_e_d_ _t_h_r_e_a_d_ _e_x_c_e_p_t_i_o_n_s for more │ │ │ │ │ information. │ │ │ │ │ * _#_7_4_2_5: New _p_y_t_e_s_t_e_r fixture, which is identical to _t_e_s_t_d_i_r but its │ │ │ │ │ - methods return pathlib.Path when appropriate instead of py.path.local. │ │ │ │ │ - This is part of the movement to use pathlib.Path objects internally, in │ │ │ │ │ + methods return _p_a_t_h_l_i_b_._P_a_t_h when appropriate instead of py.path.local. │ │ │ │ │ + This is part of the movement to use _p_a_t_h_l_i_b_._P_a_t_h objects internally, in │ │ │ │ │ order to remove the dependency to py in the future. │ │ │ │ │ Internally, the old pytest.Testdir is now a thin wrapper around _P_y_t_e_s_t_e_r, │ │ │ │ │ preserving the old interface. │ │ │ │ │ * _#_7_6_9_5: A new hook was added, pytest_markeval_namespace which should │ │ │ │ │ return a dictionary. This dictionary will be used to augment the "global" │ │ │ │ │ variables available to evaluate skipif/xfail/xpass markers. │ │ │ │ │ Pseudo example │ │ │ │ │ @@ -2716,39 +2716,39 @@ │ │ │ │ │ o pytest.MonkeyPatch for the _m_o_n_k_e_y_p_a_t_c_h fixture. │ │ │ │ │ o pytest.WarningsRecorder for the _r_e_c_w_a_r_n fixture. │ │ │ │ │ Constructing them is not supported (except for MonkeyPatch); they are │ │ │ │ │ only meant for use in type annotations. Doing so will emit a deprecation │ │ │ │ │ warning, and may become a hard-error in pytest 8.0. │ │ │ │ │ Subclassing them is also not supported. This is not currently enforced at │ │ │ │ │ runtime, but is detected by type-checkers such as mypy. │ │ │ │ │ - * _#_7_5_2_7: When a comparison between namedtuple instances of the same type │ │ │ │ │ + * _#_7_5_2_7: When a comparison between _n_a_m_e_d_t_u_p_l_e instances of the same type │ │ │ │ │ fails, pytest now shows the differing field names (possibly nested) │ │ │ │ │ instead of their indexes. │ │ │ │ │ - * _#_7_6_1_5: _N_o_d_e_._w_a_r_n now permits any subclass of Warning, not just │ │ │ │ │ + * _#_7_6_1_5: _N_o_d_e_._w_a_r_n now permits any subclass of _W_a_r_n_i_n_g, not just │ │ │ │ │ _P_y_t_e_s_t_W_a_r_n_i_n_g. │ │ │ │ │ * _#_7_7_0_1: Improved reporting when using --collected-only. It will now show │ │ │ │ │ the number of collected tests in the summary stats. │ │ │ │ │ * _#_7_7_1_0: Use strict equality comparison for non-numeric types in │ │ │ │ │ - _p_y_t_e_s_t_._a_p_p_r_o_x_(_) instead of raising TypeError. │ │ │ │ │ + _p_y_t_e_s_t_._a_p_p_r_o_x_(_) instead of raising _T_y_p_e_E_r_r_o_r. │ │ │ │ │ This was the undocumented behavior before 3.7, but is now officially a │ │ │ │ │ supported feature. │ │ │ │ │ * _#_7_9_3_8: New --sw-skip argument which is a shorthand for --stepwise-skip. │ │ │ │ │ * _#_8_0_2_3: Added 'node_modules' to default value for _n_o_r_e_c_u_r_s_e_d_i_r_s. │ │ │ │ │ - * _#_8_0_3_2: doClassCleanups (introduced in unittest in Python and 3.8) is now │ │ │ │ │ + * _#_8_0_3_2: _d_o_C_l_a_s_s_C_l_e_a_n_u_p_s (introduced in _u_n_i_t_t_e_s_t in Python and 3.8) is now │ │ │ │ │ called appropriately. │ │ │ │ │ ******** BBuugg FFiixxeess_?¶ ******** │ │ │ │ │ * _#_4_8_2_4: Fixed quadratic behavior and improved performance of collection of │ │ │ │ │ items using autouse fixtures and xunit fixtures. │ │ │ │ │ * _#_7_7_5_8: Fixed an issue where some files in packages are getting lost from │ │ │ │ │ --lf even though they contain tests that failed. Regressed in pytest │ │ │ │ │ 5.4.0. │ │ │ │ │ * _#_7_9_1_1: Directories created by by _t_m_p___p_a_t_h and _t_m_p_d_i_r are now considered │ │ │ │ │ stale after 3 days without modification (previous value was 3 hours) to │ │ │ │ │ avoid deleting directories still in use in long running test suites. │ │ │ │ │ - * _#_7_9_1_3: Fixed a crash or hang in _p_y_t_e_s_t_e_r_._s_p_a_w_n when the readline module │ │ │ │ │ + * _#_7_9_1_3: Fixed a crash or hang in _p_y_t_e_s_t_e_r_._s_p_a_w_n when the _r_e_a_d_l_i_n_e module │ │ │ │ │ is involved. │ │ │ │ │ * _#_7_9_5_1: Fixed handling of recursive symlinks when collecting tests. │ │ │ │ │ * _#_7_9_8_1: Fixed symlinked directories not being followed during collection. │ │ │ │ │ Regressed in pytest 6.1.0. │ │ │ │ │ * _#_8_0_1_6: Fixed only one doctest being collected when using pytest -- │ │ │ │ │ doctest-modules path/to/an/__init__.py. │ │ │ │ │ ******** IImmpprroovveedd DDooccuummeennttaattiioonn_?¶ ******** │ │ │ │ │ @@ -2828,18 +2828,18 @@ │ │ │ │ │ initialization are now properly handled and can filtered through │ │ │ │ │ _f_i_l_t_e_r_w_a_r_n_i_n_g_s or --pythonwarnings/-W. │ │ │ │ │ This also fixes a number of long standing issues: _#_2_8_9_1, _#_7_6_2_0, _#_7_4_2_6. │ │ │ │ │ * _#_7_5_7_2: When a plugin listed in required_plugins is missing or an unknown │ │ │ │ │ config key is used with --strict-config, a simple error message is now │ │ │ │ │ shown instead of a stacktrace. │ │ │ │ │ * _#_7_6_8_5: Added two new attributes _r_o_o_t_p_a_t_h and _i_n_i_p_a_t_h to _C_o_n_f_i_g. These │ │ │ │ │ - attributes are pathlib.Path versions of the existing rootdir and inifile │ │ │ │ │ + attributes are _p_a_t_h_l_i_b_._P_a_t_h versions of the existing rootdir and inifile │ │ │ │ │ attributes, and should be preferred over them when possible. │ │ │ │ │ * _#_7_7_8_0: Public classes which are not designed to be inherited from are now │ │ │ │ │ - marked @final. Code which inherits from these classes will trigger a │ │ │ │ │ + marked _@_f_i_n_a_l. Code which inherits from these classes will trigger a │ │ │ │ │ type-checking (e.g. mypy) error, but will still work in runtime. │ │ │ │ │ Currently the final designation does not appear in the API Reference but │ │ │ │ │ hopefully will in the future. │ │ │ │ │ ******** BBuugg FFiixxeess_?¶ ******** │ │ │ │ │ * _#_1_9_5_3: Fixed error when overwriting a parametrized fixture, while also │ │ │ │ │ reusing the super fixture value. │ │ │ │ │ # conftest.py │ │ │ │ │ @@ -2987,15 +2987,15 @@ │ │ │ │ │ the test session root. │ │ │ │ │ Also, pytest.Package.name is now just the name of the directory │ │ │ │ │ containing the package's __init__.py file, instead of the full path. This │ │ │ │ │ is consistent with how the other nodes are named, and also one of the │ │ │ │ │ reasons why -k would match against any directory containing the test │ │ │ │ │ suite. │ │ │ │ │ * _#_7_1_2_2: Expressions given to the -m and -k options are no longer evaluated │ │ │ │ │ - using Python's eval(). The format supports or, and, not, parenthesis and │ │ │ │ │ + using Python's _e_v_a_l_(_). The format supports or, and, not, parenthesis and │ │ │ │ │ general identifiers to match against. Python constants, keywords or other │ │ │ │ │ operators are no longer evaluated differently. │ │ │ │ │ * _#_7_1_3_5: Pytest now uses its own TerminalWriter class instead of using the │ │ │ │ │ one from the py library. Plugins generally access this class through │ │ │ │ │ TerminalReporter.writer, TerminalReporter.write() (and similar methods), │ │ │ │ │ or _pytest.config.create_terminal_writer(). │ │ │ │ │ The following breaking changes were made: │ │ │ │ │ @@ -3073,15 +3073,15 @@ │ │ │ │ │ o --no-summary: disables the final test summary, including warnings. │ │ │ │ │ * _#_6_8_5_6: A warning is now shown when an unknown key is read from a config │ │ │ │ │ INI file. │ │ │ │ │ The --strict-config flag has been added to treat these warnings as │ │ │ │ │ errors. │ │ │ │ │ * _#_6_9_0_6: Added --code-highlight command line option to enable/disable code │ │ │ │ │ highlighting in terminal output. │ │ │ │ │ - * _#_7_2_4_5: New --import-mode=importlib option that uses importlib to import │ │ │ │ │ + * _#_7_2_4_5: New --import-mode=importlib option that uses _i_m_p_o_r_t_l_i_b to import │ │ │ │ │ test modules. │ │ │ │ │ Traditionally pytest used __import__ while changing sys.path to import │ │ │ │ │ test modules (which also changes sys.modules as a side-effect), which │ │ │ │ │ works but has a number of drawbacks, like requiring test modules that │ │ │ │ │ don't live in packages to have unique names (as they need to reside under │ │ │ │ │ a unique name in sys.modules). │ │ │ │ │ --import-mode=importlib uses more fine-grained import mechanisms from │ │ │ │ │ @@ -3150,15 +3150,15 @@ │ │ │ │ │ Now: │ │ │ │ │ │ │ │ │ │ ******** BBuugg FFiixxeess_?¶ ******** │ │ │ │ │ * _#_1_1_2_0: Fix issue where directories from _t_m_p_d_i_r are not removed properly │ │ │ │ │ when multiple instances of pytest are running in parallel. │ │ │ │ │ * _#_4_5_8_3: Prevent crashing and provide a user-friendly error when a marker │ │ │ │ │ - expression (-m) invoking of eval() raises any exception. │ │ │ │ │ + expression (-m) invoking of _e_v_a_l_(_) raises any exception. │ │ │ │ │ * _#_4_6_7_7: The path shown in the summary report for SKIPPED tests is now │ │ │ │ │ always relative. Previously it was sometimes absolute. │ │ │ │ │ * _#_5_4_5_6: Fix a possible race condition when trying to remove lock files │ │ │ │ │ used to control access to folders created by _t_m_p___p_a_t_h and _t_m_p_d_i_r. │ │ │ │ │ * _#_6_2_4_0: Fixes an issue where logging during collection step caused │ │ │ │ │ duplication of log messages to stderr. │ │ │ │ │ * _#_6_4_2_8: Paths appearing in error messages are now correct in case the │ │ │ │ │ @@ -3173,15 +3173,15 @@ │ │ │ │ │ be an unintended/surprising behavior, but it turns out many people relied │ │ │ │ │ on it, so the restriction has been reverted. │ │ │ │ │ * _#_6_9_1_0: Fix crash when plugins return an unknown stats while using the -- │ │ │ │ │ reportlog option. │ │ │ │ │ * _#_6_9_2_4: Ensure a unittest.IsolatedAsyncioTestCase is actually awaited. │ │ │ │ │ * _#_6_9_2_5: Fix TerminalRepr instances to be hashable again. │ │ │ │ │ * _#_6_9_4_7: Fix regression where functions registered with │ │ │ │ │ - unittest.TestCase.addCleanup() were not being called on test failures. │ │ │ │ │ + _u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e_._a_d_d_C_l_e_a_n_u_p_(_) were not being called on test failures. │ │ │ │ │ * _#_6_9_5_1: Allow users to still set the deprecated TerminalReporter.writer │ │ │ │ │ attribute. │ │ │ │ │ * _#_6_9_5_6: Prevent pytest from printing ConftestImportFailure traceback to │ │ │ │ │ stdout. │ │ │ │ │ * _#_6_9_9_1: Fix regressions with --lf filtering too much since pytest 5.4. │ │ │ │ │ * _#_6_9_9_2: Revert "tmpdir: clean up indirection via config for factories" │ │ │ │ │ _#_6_7_6_7 as it breaks pytest-xdist. │ │ │ │ │ @@ -3198,15 +3198,15 @@ │ │ │ │ │ to the constructor. │ │ │ │ │ * _#_7_1_4_5: Classes with broken __getattribute__ methods are displayed │ │ │ │ │ correctly during failures. │ │ │ │ │ * _#_7_1_5_0: Prevent hiding the underlying exception when ConfTestImportFailure │ │ │ │ │ is raised. │ │ │ │ │ * _#_7_1_8_0: Fix _is_setup_py for files encoded differently than locale. │ │ │ │ │ * _#_7_2_1_5: Fix regression where running with --pdb would call │ │ │ │ │ - unittest.TestCase.tearDown() for skipped tests. │ │ │ │ │ + _u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e_._t_e_a_r_D_o_w_n_(_) for skipped tests. │ │ │ │ │ * _#_7_2_5_3: When using pytest.fixture on a function directly, as in │ │ │ │ │ pytest.fixture(func), if the autouse or params arguments are also passed, │ │ │ │ │ the function is no longer ignored, but is marked as a fixture. │ │ │ │ │ * _#_7_3_6_0: Fix possibly incorrect evaluation of string expressions passed to │ │ │ │ │ pytest.mark.skipif and pytest.mark.xfail, in rare circumstances where the │ │ │ │ │ exact same string is used but refers to different global values. │ │ │ │ │ * _#_7_3_8_3: Fixed exception causes all over the codebase, i.e. use raise │ │ │ │ │ @@ -3367,15 +3367,15 @@ │ │ │ │ │ * _#_6_4_0_9: Fallback to green (instead of yellow) for non-last items without │ │ │ │ │ previous passes with colored terminal progress indicator. │ │ │ │ │ * _#_6_4_5_4: --disable-warnings is honored with -ra and -rA. │ │ │ │ │ * _#_6_4_9_7: Fix bug in the comparison of request key with cached key in │ │ │ │ │ fixture. │ │ │ │ │ A construct if key == cached_key: can fail either because == is │ │ │ │ │ explicitly disallowed, or for, e.g., NumPy arrays, where the result of a │ │ │ │ │ - == b cannot generally be converted to bool. The implemented fix replaces │ │ │ │ │ + == b cannot generally be converted to _b_o_o_l. The implemented fix replaces │ │ │ │ │ == with is. │ │ │ │ │ * _#_6_5_5_7: Make capture output streams .write() method return the same return │ │ │ │ │ value from original streams. │ │ │ │ │ * _#_6_5_6_6: Fix EncodedFile.writelines to call the underlying buffer's │ │ │ │ │ writelines method. │ │ │ │ │ * _#_6_5_7_5: Fix internal crash when faulthandler starts initialized (for │ │ │ │ │ example with PYTHONFAULTHANDLER=1 environment variable set) and │ │ │ │ │ @@ -3436,19 +3436,19 @@ │ │ │ │ │ ********** ppyytteesstt 55..33..11 ((22001199--1111--2255))_?¶ ********** │ │ │ │ │ ******** IImmpprroovveemmeennttss_?¶ ******** │ │ │ │ │ * _#_6_2_3_1: Improve check for misspelling of _p_y_t_e_s_t_._m_a_r_k_._p_a_r_a_m_e_t_r_i_z_e. │ │ │ │ │ * _#_6_2_5_7: Handle _p_y_t_e_s_t_._e_x_i_t_(_) being used via _p_y_t_e_s_t___i_n_t_e_r_n_a_l_e_r_r_o_r, e.g. │ │ │ │ │ when quitting pdb from post mortem. │ │ │ │ │ ******** BBuugg FFiixxeess_?¶ ******** │ │ │ │ │ * _#_5_9_1_4: pytester: fix _n_o___f_n_m_a_t_c_h___l_i_n_e_(_) when used after positive matching. │ │ │ │ │ - * _#_6_0_8_2: Fix line detection for doctest samples inside python:property │ │ │ │ │ - docstrings, as a workaround to _p_y_t_h_o_n_/_c_p_y_t_h_o_n_#_6_1_6_4_8. │ │ │ │ │ + * _#_6_0_8_2: Fix line detection for doctest samples inside _p_r_o_p_e_r_t_y docstrings, │ │ │ │ │ + as a workaround to _p_y_t_h_o_n_/_c_p_y_t_h_o_n_#_6_1_6_4_8. │ │ │ │ │ * _#_6_2_5_4: Fix compatibility with pytest-parallel (regression in pytest │ │ │ │ │ 5.3.0). │ │ │ │ │ - * _#_6_2_5_5: Clear the sys.last_traceback, sys.last_type and sys.last_value │ │ │ │ │ + * _#_6_2_5_5: Clear the _s_y_s_._l_a_s_t___t_r_a_c_e_b_a_c_k, _s_y_s_._l_a_s_t___t_y_p_e and _s_y_s_._l_a_s_t___v_a_l_u_e │ │ │ │ │ attributes by deleting them instead of setting them to None. This better │ │ │ │ │ matches the behaviour of the Python standard library. │ │ │ │ │ ********** ppyytteesstt 55..33..00 ((22001199--1111--1199))_?¶ ********** │ │ │ │ │ ******** DDeepprreeccaattiioonnss_?¶ ******** │ │ │ │ │ * _#_6_1_7_9: The default value of _j_u_n_i_t___f_a_m_i_l_y option will change to "xunit2" │ │ │ │ │ in pytest 6.0, given that this is the version supported by default in │ │ │ │ │ modern tools that manipulate this type of file. │ │ │ │ │ @@ -3463,31 +3463,31 @@ │ │ │ │ │ Each line of the report log contains a self contained JSON object │ │ │ │ │ corresponding to a testing event, such as a collection or a test result │ │ │ │ │ report. The file is guaranteed to be flushed after writing each line, so │ │ │ │ │ systems can read and process events in real-time. │ │ │ │ │ The plugin is meant to replace the --resultlog option, which is │ │ │ │ │ deprecated and meant to be removed in a future release. If you use -- │ │ │ │ │ resultlog, please try out pytest-reportlog and provide feedback. │ │ │ │ │ - * _#_4_7_3_0: When sys.pycache_prefix (Python 3.8+) is set, it will be used by │ │ │ │ │ + * _#_4_7_3_0: When _s_y_s_._p_y_c_a_c_h_e___p_r_e_f_i_x (Python 3.8+) is set, it will be used by │ │ │ │ │ pytest to cache test files changed by the assertion rewriting mechanism. │ │ │ │ │ This makes it easier to benefit of cached .pyc files even on file systems │ │ │ │ │ without permissions. │ │ │ │ │ * _#_5_5_1_5: Allow selective auto-indentation of multiline log messages. │ │ │ │ │ Adds command line option --log-auto-indent, config option _l_o_g___a_u_t_o___i_n_d_e_n_t │ │ │ │ │ and support for per-entry configuration of indentation behavior on calls │ │ │ │ │ - to python:logging.log(). │ │ │ │ │ + to _l_o_g_g_i_n_g_._l_o_g_(_). │ │ │ │ │ Alters the default for auto-indention from "on" to "off". This restores │ │ │ │ │ the older behavior that existed prior to v4.6.0. This reversion to │ │ │ │ │ earlier behavior was done because it is better to activate new features │ │ │ │ │ that may lead to broken tests explicitly rather than implicitly. │ │ │ │ │ * _#_5_9_1_4: _t_e_s_t_d_i_r learned two new functions, _n_o___f_n_m_a_t_c_h___l_i_n_e_(_) and │ │ │ │ │ _n_o___r_e___m_a_t_c_h___l_i_n_e_(_). │ │ │ │ │ The functions are used to ensure the captured text ddooeess nnoott match the │ │ │ │ │ given pattern. │ │ │ │ │ - The previous idiom was to use python:re.match(): │ │ │ │ │ + The previous idiom was to use _r_e_._m_a_t_c_h_(_): │ │ │ │ │ result = testdir.runpytest() │ │ │ │ │ assert re.match(pat, result.stdout.str()) is None │ │ │ │ │ Or the in operator: │ │ │ │ │ result = testdir.runpytest() │ │ │ │ │ assert text in result.stdout.str() │ │ │ │ │ But the new functions produce best output on failure. │ │ │ │ │ * _#_6_0_5_7: Added tolerances to complex values when printing pytest.approx. │ │ │ │ │ @@ -3773,15 +3773,15 @@ │ │ │ │ │ to implement a good alternative for it. │ │ │ │ │ * _#_4_6_6: The funcargnames attribute has been an alias for fixturenames since │ │ │ │ │ pytest 2.3, and is now deprecated in code too. │ │ │ │ │ ******** FFeeaattuurreess_?¶ ******** │ │ │ │ │ * _#_3_4_5_7: New _p_y_t_e_s_t___a_s_s_e_r_t_i_o_n___p_a_s_s hook, called with context information │ │ │ │ │ when an assertion ppaasssseess. │ │ │ │ │ This hook is still eexxppeerriimmeennttaall so use it with caution. │ │ │ │ │ - * _#_5_4_4_0: The faulthandler standard library module is now enabled by default │ │ │ │ │ + * _#_5_4_4_0: The _f_a_u_l_t_h_a_n_d_l_e_r standard library module is now enabled by default │ │ │ │ │ to help users diagnose crashes in C modules. │ │ │ │ │ This functionality was provided by integrating the external _p_y_t_e_s_t_- │ │ │ │ │ _f_a_u_l_t_h_a_n_d_l_e_r plugin into the core, so users should remove that plugin │ │ │ │ │ from their requirements if used. │ │ │ │ │ For more information see the docs: _F_a_u_l_t_ _H_a_n_d_l_e_r. │ │ │ │ │ * _#_5_4_5_2: When warnings are configured as errors, pytest warnings now appear │ │ │ │ │ as originating from pytest. instead of the internal │ │ │ │ │ @@ -4277,15 +4277,15 @@ │ │ │ │ │ * _#_4_6_6_9: Correctly handle unittest.SkipTest exception containing non-ascii │ │ │ │ │ characters on Python 2. │ │ │ │ │ * _#_4_6_8_0: Ensure the tmpdir and the tmp_path fixtures are the same folder. │ │ │ │ │ * _#_4_6_8_1: Ensure tmp_path is always a real path. │ │ │ │ │ ******** TTrriivviiaall//IInntteerrnnaall CChhaannggeess_?¶ ******** │ │ │ │ │ * _#_4_6_4_3: Use a.item() instead of the deprecated np.asscalar(a) in │ │ │ │ │ pytest.approx. │ │ │ │ │ - np.asscalar has been deprecated in numpy 1.16.. │ │ │ │ │ + np.asscalar has been _d_e_p_r_e_c_a_t_e_d in numpy 1.16.. │ │ │ │ │ * _#_4_6_5_7: Copy saferepr from pylib │ │ │ │ │ * _#_4_6_6_8: The verbose word for expected failures in the teststatus report │ │ │ │ │ changes from xfail to XFAIL to be consistent with other test outcomes. │ │ │ │ │ ********** ppyytteesstt 44..11..11 ((22001199--0011--1122))_?¶ ********** │ │ │ │ │ ******** BBuugg FFiixxeess_?¶ ******** │ │ │ │ │ * _#_2_2_5_6: Show full repr with assert a==b and -vv. │ │ │ │ │ * _#_3_4_5_6: Extend Doctest-modules to ignore mock objects. │ │ │ │ │ @@ -4376,15 +4376,15 @@ │ │ │ │ │ Because the assert_called_with method of mock objects already executes an │ │ │ │ │ assertion. │ │ │ │ │ This warning will not be issued when None is explicitly checked. An │ │ │ │ │ assertion like: │ │ │ │ │ assert variable is None │ │ │ │ │ will not issue the warning. │ │ │ │ │ * _#_3_6_3_2: Richer equality comparison introspection on AssertionError for │ │ │ │ │ - objects created using _a_t_t_r_s or dataclasses (Python 3.7+, _b_a_c_k_p_o_r_t_e_d_ _t_o │ │ │ │ │ + objects created using _a_t_t_r_s or _d_a_t_a_c_l_a_s_s_e_s (Python 3.7+, _b_a_c_k_p_o_r_t_e_d_ _t_o │ │ │ │ │ _3_._6). │ │ │ │ │ * _#_4_2_7_8: CACHEDIR.TAG files are now created inside cache directories. │ │ │ │ │ Those files are part of the _C_a_c_h_e_ _D_i_r_e_c_t_o_r_y_ _T_a_g_g_i_n_g_ _S_t_a_n_d_a_r_d, and can be │ │ │ │ │ used by backup or synchronization programs to identify pytest's cache │ │ │ │ │ directory as such. │ │ │ │ │ * _#_4_2_9_2: pytest.outcomes.Exit is derived from SystemExit instead of │ │ │ │ │ KeyboardInterrupt. This allows us to better handle pdb exiting. │ │ ├── ./usr/share/doc/python-pytest-doc/html/deprecations.html │ │ │ @@ -428,15 +428,15 @@ │ │ │

    or set them in your configuration file instead.

    │ │ │
    │ │ │
    │ │ │

    Non-Collection iterables in @pytest.mark.parametrize

    │ │ │
    │ │ │

    Deprecated since version 9.1.

    │ │ │
    │ │ │ -

    Using non-Collection iterables (such as generators, iterators, or custom iterable objects) │ │ │ +

    Using non-Collection iterables (such as generators, iterators, or custom iterable objects) │ │ │ for the argvalues parameter in @pytest.mark.parametrize │ │ │ and metafunc.parametrize is deprecated.

    │ │ │

    These iterables get exhausted after the first iteration, leading to tests getting unexpectedly skipped in cases such as:

    │ │ │
    │ │ │
    │ │ │

    Class-scoped fixture as instance method

    │ │ │
    │ │ │

    Deprecated since version 9.1.

    │ │ │
    │ │ │

    Defining a class-scoped fixture as an instance method (without @classmethod) is deprecated │ │ │ @@ -650,47 +650,47 @@ │ │ │

    │ │ │
    │ │ │

    Removed Features and Breaking Changes

    │ │ │

    As stated in our Backwards Compatibility Policy policy, deprecated features are removed only in major releases after │ │ │ an appropriate period of deprecation has passed.

    │ │ │

    Some breaking changes which could not be deprecated are also listed.

    │ │ │
    │ │ │ -

    pytest.importorskip default behavior regarding ImportError

    │ │ │ +

    pytest.importorskip default behavior regarding ImportError

    │ │ │
    │ │ │

    Deprecated since version 8.2.

    │ │ │
    │ │ │
    │ │ │

    Removed in version 9.1.

    │ │ │
    │ │ │ -

    Traditionally pytest.importorskip() captured ImportError, with the original intent being to skip │ │ │ +

    Traditionally pytest.importorskip() captured ImportError, with the original intent being to skip │ │ │ tests where a dependent module is not installed, for example testing with different dependencies.

    │ │ │

    However, some packages might be installed in the system but not importable due to some other issue, for example │ │ │ a compilation error or a broken installation. In those cases, pytest.importorskip() would still silently skip │ │ │ the test, but more often than not users would rather see the unexpected error so the underlying issue can be fixed.

    │ │ │

    In 8.2, the exc_type parameter was added, giving users the ability to pass │ │ │ -ModuleNotFoundError to skip tests only if the module cannot really be found, and not because of some other │ │ │ +ModuleNotFoundError to skip tests only if the module cannot really be found, and not because of some other │ │ │ error.

    │ │ │ -

    As of 9.1, pytest.importorskip() only captures ModuleNotFoundError by default. │ │ │ -If you want to preserve the previous behavior and skip on other ImportError exceptions during import, │ │ │ +

    As of 9.1, pytest.importorskip() only captures ModuleNotFoundError by default. │ │ │ +If you want to preserve the previous behavior and skip on other ImportError exceptions during import, │ │ │ pass exc_type=ImportError explicitly.

    │ │ │
    │ │ │
    │ │ │

    fspath argument for Node constructors replaced with pathlib.Path

    │ │ │
    │ │ │

    Deprecated since version 7.0.

    │ │ │
    │ │ │
    │ │ │

    Removed in version 9.1.

    │ │ │
    │ │ │ -

    In order to support the transition from py.path.local to pathlib, │ │ │ +

    In order to support the transition from py.path.local to pathlib, │ │ │ the fspath argument to Node constructors like │ │ │ pytest.Function.from_parent() and pytest.Class.from_parent() │ │ │ is now deprecated.

    │ │ │

    Plugins which construct nodes should pass the path argument, of type │ │ │ -pathlib.Path, instead of the fspath argument.

    │ │ │ +pathlib.Path, instead of the fspath argument.

    │ │ │

    Plugins which implement custom items and collectors are encouraged to replace │ │ │ fspath parameters (py.path.local) with path parameters │ │ │ (pathlib.Path), and drop any other usage of the py library if possible.

    │ │ │

    If possible, plugins with custom items should use cooperative │ │ │ constructors to avoid hardcoding │ │ │ arguments they only pass on to the superclass.

    │ │ │
    │ │ │ @@ -791,15 +791,15 @@ │ │ │

    py.path.local arguments for hooks replaced with pathlib.Path

    │ │ │
    │ │ │

    Deprecated since version 7.0.

    │ │ │
    │ │ │
    │ │ │

    Removed in version 9.0.

    │ │ │
    │ │ │ -

    In order to support the transition from py.path.local to pathlib, the following hooks now receive additional arguments:

    │ │ │ +

    In order to support the transition from py.path.local to pathlib, the following hooks now receive additional arguments:

    │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -165,15 +165,15 @@ │ │ │ │ SSeettttiinngg ccoonnffiigguurraattiioonn vvaalluueess:: │ │ │ │ Setting or deleting configuration values after initialization is not supported. │ │ │ │ If you need to override configuration values, use the -o command line option: │ │ │ │ pytest -o some_option=value │ │ │ │ or set them in your configuration file instead. │ │ │ │ ******** NNoonn--CCoolllleeccttiioonn iitteerraabblleess iinn @@ppyytteesstt..mmaarrkk..ppaarraammeettrriizzee_?¶ ******** │ │ │ │ Deprecated since version 9.1. │ │ │ │ -Using non-Collection iterables (such as generators, iterators, or custom │ │ │ │ +Using non-_C_o_l_l_e_c_t_i_o_n iterables (such as generators, iterators, or custom │ │ │ │ iterable objects) for the argvalues parameter in _@_p_y_t_e_s_t_._m_a_r_k_._p_a_r_a_m_e_t_r_i_z_e and │ │ │ │ _m_e_t_a_f_u_n_c_._p_a_r_a_m_e_t_r_i_z_e is deprecated. │ │ │ │ These iterables get exhausted after the first iteration, leading to tests │ │ │ │ getting unexpectedly skipped in cases such as: │ │ │ │ * Running _p_y_t_e_s_t_._m_a_i_n_(_) multiple times in the same process │ │ │ │ * Using class-level parametrize decorators where the same mark is applied │ │ │ │ to multiple test methods │ │ │ │ @@ -207,15 +207,15 @@ │ │ │ │ @pytest.mark.parametrize("n", list(data_generator())) │ │ │ │ class Test: │ │ │ │ def test_1(self, n): │ │ │ │ pass │ │ │ │ │ │ │ │ def test_2(self, n): │ │ │ │ pass │ │ │ │ -Note that range objects are Collection and are not affected by this │ │ │ │ +Note that _r_a_n_g_e objects are Collection and are not affected by this │ │ │ │ deprecation. │ │ │ │ ******** CCllaassss--ssccooppeedd ffiixxttuurree aass iinnssttaannccee mmeetthhoodd_?¶ ******** │ │ │ │ Deprecated since version 9.1. │ │ │ │ Defining a class-scoped fixture as an instance method (without @classmethod) is │ │ │ │ deprecated and will be removed in pytest 10.0. │ │ │ │ When a class-scoped fixture is defined as an instance method, any attributes │ │ │ │ set on self will not be visible to test methods. This happens because pytest │ │ │ │ @@ -338,39 +338,39 @@ │ │ │ │ pytest.yield_fixture is a deprecated alias for pytest.fixture(). │ │ │ │ It has been so for a very long time, so it can be searched/replaced safely. │ │ │ │ ********** RReemmoovveedd FFeeaattuurreess aanndd BBrreeaakkiinngg CChhaannggeess_?¶ ********** │ │ │ │ As stated in our _B_a_c_k_w_a_r_d_s_ _C_o_m_p_a_t_i_b_i_l_i_t_y_ _P_o_l_i_c_y policy, deprecated features are │ │ │ │ removed only in major releases after an appropriate period of deprecation has │ │ │ │ passed. │ │ │ │ Some breaking changes which could not be deprecated are also listed. │ │ │ │ -******** ppyytteesstt..iimmppoorrttoorrsskkiipp ddeeffaauulltt bbeehhaavviioorr rreeggaarrddiinngg IImmppoorrttEErrrroorr_?¶ ******** │ │ │ │ +******** ppyytteesstt..iimmppoorrttoorrsskkiipp ddeeffaauulltt bbeehhaavviioorr rreeggaarrddiinngg _II_mm_pp_oo_rr_tt_EE_rr_rr_oo_rr_?¶ ******** │ │ │ │ Deprecated since version 8.2. │ │ │ │ Removed in version 9.1. │ │ │ │ -Traditionally _p_y_t_e_s_t_._i_m_p_o_r_t_o_r_s_k_i_p_(_) captured ImportError, with the original │ │ │ │ +Traditionally _p_y_t_e_s_t_._i_m_p_o_r_t_o_r_s_k_i_p_(_) captured _I_m_p_o_r_t_E_r_r_o_r, with the original │ │ │ │ intent being to skip tests where a dependent module is not installed, for │ │ │ │ example testing with different dependencies. │ │ │ │ However, some packages might be installed in the system but not importable due │ │ │ │ to some other issue, for example a compilation error or a broken installation. │ │ │ │ In those cases, _p_y_t_e_s_t_._i_m_p_o_r_t_o_r_s_k_i_p_(_) would still silently skip the test, but │ │ │ │ more often than not users would rather see the unexpected error so the │ │ │ │ underlying issue can be fixed. │ │ │ │ In 8.2, the exc_type parameter was added, giving users the ability to pass │ │ │ │ -ModuleNotFoundError to skip tests only if the module cannot really be found, │ │ │ │ +_M_o_d_u_l_e_N_o_t_F_o_u_n_d_E_r_r_o_r to skip tests only if the module cannot really be found, │ │ │ │ and not because of some other error. │ │ │ │ -As of 9.1, _p_y_t_e_s_t_._i_m_p_o_r_t_o_r_s_k_i_p_(_) only captures ModuleNotFoundError by default. │ │ │ │ -If you want to preserve the previous behavior and skip on other ImportError │ │ │ │ +As of 9.1, _p_y_t_e_s_t_._i_m_p_o_r_t_o_r_s_k_i_p_(_) only captures _M_o_d_u_l_e_N_o_t_F_o_u_n_d_E_r_r_o_r by default. │ │ │ │ +If you want to preserve the previous behavior and skip on other _I_m_p_o_r_t_E_r_r_o_r │ │ │ │ exceptions during import, pass exc_type=ImportError explicitly. │ │ │ │ ******** ffssppaatthh aarrgguummeenntt ffoorr NNooddee ccoonnssttrruuccttoorrss rreeppllaacceedd wwiitthh ppaatthhlliibb..PPaatthh_?¶ ******** │ │ │ │ Deprecated since version 7.0. │ │ │ │ Removed in version 9.1. │ │ │ │ -In order to support the transition from py.path.local to pathlib, the fspath │ │ │ │ +In order to support the transition from py.path.local to _p_a_t_h_l_i_b, the fspath │ │ │ │ argument to _N_o_d_e constructors like _p_y_t_e_s_t_._F_u_n_c_t_i_o_n_._f_r_o_m___p_a_r_e_n_t_(_) and │ │ │ │ _p_y_t_e_s_t_._C_l_a_s_s_._f_r_o_m___p_a_r_e_n_t_(_) is now deprecated. │ │ │ │ Plugins which construct nodes should pass the path argument, of type │ │ │ │ -pathlib.Path, instead of the fspath argument. │ │ │ │ +_p_a_t_h_l_i_b_._P_a_t_h, instead of the fspath argument. │ │ │ │ Plugins which implement custom items and collectors are encouraged to replace │ │ │ │ fspath parameters (py.path.local) with path parameters (pathlib.Path), and drop │ │ │ │ any other usage of the py library if possible. │ │ │ │ If possible, plugins with custom items should use _c_o_o_p_e_r_a_t_i_v_e_ _c_o_n_s_t_r_u_c_t_o_r_s to │ │ │ │ avoid hardcoding arguments they only pass on to the superclass. │ │ │ │ Note │ │ │ │ The name of the _N_o_d_e arguments and attributes (the new attribute being path) is │ │ │ │ @@ -454,15 +454,15 @@ │ │ │ │ effect of using the clean_database fixture when user was invoked, when in fact │ │ │ │ it has no effect at all. │ │ │ │ Now pytest will issue a warning when it encounters this problem, and will raise │ │ │ │ an error in the future versions. │ │ │ │ ******** ppyy..ppaatthh..llooccaall aarrgguummeennttss ffoorr hhooookkss rreeppllaacceedd wwiitthh ppaatthhlliibb..PPaatthh_?¶ ******** │ │ │ │ Deprecated since version 7.0. │ │ │ │ Removed in version 9.0. │ │ │ │ -In order to support the transition from py.path.local to pathlib, the following │ │ │ │ +In order to support the transition from py.path.local to _p_a_t_h_l_i_b, the following │ │ │ │ hooks now receive additional arguments: │ │ │ │ * _p_y_t_e_s_t___i_g_n_o_r_e___c_o_l_l_e_c_t_(_c_o_l_l_e_c_t_i_o_n___p_a_t_h_:_ _p_a_t_h_l_i_b_._P_a_t_h_) as equivalent to │ │ │ │ path │ │ │ │ * _p_y_t_e_s_t___c_o_l_l_e_c_t___f_i_l_e_(_f_i_l_e___p_a_t_h_:_ _p_a_t_h_l_i_b_._P_a_t_h_) as equivalent to path │ │ │ │ * _p_y_t_e_s_t___p_y_c_o_l_l_e_c_t___m_a_k_e_m_o_d_u_l_e_(_m_o_d_u_l_e___p_a_t_h_:_ _p_a_t_h_l_i_b_._P_a_t_h_) as equivalent to │ │ │ │ path │ │ │ │ * _p_y_t_e_s_t___r_e_p_o_r_t___h_e_a_d_e_r_(_s_t_a_r_t___p_a_t_h_:_ _p_a_t_h_l_i_b_._P_a_t_h_) as equivalent to startdir │ │ ├── ./usr/share/doc/python-pytest-doc/html/example/markers.html │ │ │ @@ -390,15 +390,15 @@ │ │ │
    │ │ │
    │ │ │

    Note

    │ │ │

    Only keyword argument matching is supported in marker expressions.

    │ │ │
    │ │ │
    │ │ │

    Note

    │ │ │ -

    Only int, (unescaped) str, bool & None values are supported in marker expressions.

    │ │ │ +

    Only int, (unescaped) str, bool & None values are supported in marker expressions.

    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Selecting tests based on their node ID

    │ │ │

    You can provide one or more node IDs as positional │ │ │ arguments to select only specified tests. This makes it easy to select │ │ │ tests based on their module, class, method, or function name:

    │ │ │ ├── html2text {} │ │ │ │ @@ -145,15 +145,15 @@ │ │ │ │ │ │ │ │ test_server.py::test_something_quick PASSED [100%] │ │ │ │ │ │ │ │ ===================== 1 passed, 3 deselected in 0.12s ====================== │ │ │ │ Note │ │ │ │ Only keyword argument matching is supported in marker expressions. │ │ │ │ Note │ │ │ │ -Only int, (unescaped) str, bool & None values are supported in marker │ │ │ │ +Only _i_n_t, (unescaped) _s_t_r, _b_o_o_l & _N_o_n_e values are supported in marker │ │ │ │ expressions. │ │ │ │ ********** SSeelleeccttiinngg tteessttss bbaasseedd oonn tthheeiirr nnooddee IIDD_?¶ ********** │ │ │ │ You can provide one or more _n_o_d_e_ _I_D_s as positional arguments to select only │ │ │ │ specified tests. This makes it easy to select tests based on their module, │ │ │ │ class, method, or function name: │ │ │ │ $ pytest -v test_server.py::TestClass::test_method │ │ │ │ =========================== test session starts ============================ │ │ ├── ./usr/share/doc/python-pytest-doc/html/explanation/fixtures.html │ │ │ @@ -449,17 +449,17 @@ │ │ │ This makes use of the automatic caching mechanisms of pytest.

    │ │ │

    Another good approach is by adding the data files in the tests directory. │ │ │ There are also community plugins available to help to manage this aspect of │ │ │ testing, e.g. pytest-datadir and pytest-datafiles.

    │ │ │
    │ │ │
    │ │ │

    A note about fixture cleanup

    │ │ │ -

    pytest does not do any special processing for SIGTERM and │ │ │ -SIGQUIT signals (SIGINT is handled naturally │ │ │ -by the Python runtime via KeyboardInterrupt), so fixtures that manage external resources which are important │ │ │ +

    pytest does not do any special processing for SIGTERM and │ │ │ +SIGQUIT signals (SIGINT is handled naturally │ │ │ +by the Python runtime via KeyboardInterrupt), so fixtures that manage external resources which are important │ │ │ to be cleared when the Python process is terminated (by those signals) might leak resources.

    │ │ │

    The reason pytest does not handle those signals to perform fixture cleanup is that signal handlers are global, │ │ │ and changing them might interfere with the code under execution.

    │ │ │

    If fixtures in your suite need special care regarding termination in those scenarios, │ │ │ see this comment in the issue │ │ │ tracker for a possible workaround.

    │ │ │
    │ │ │ ├── html2text {} │ │ │ │ @@ -189,16 +189,16 @@ │ │ │ │ If you want to make test data from files available to your tests, a good way to │ │ │ │ do this is by loading these data in a fixture for use by your tests. This makes │ │ │ │ use of the automatic caching mechanisms of pytest. │ │ │ │ Another good approach is by adding the data files in the tests directory. There │ │ │ │ are also community plugins available to help to manage this aspect of testing, │ │ │ │ e.g. _p_y_t_e_s_t_-_d_a_t_a_d_i_r and _p_y_t_e_s_t_-_d_a_t_a_f_i_l_e_s. │ │ │ │ ********** AA nnoottee aabboouutt ffiixxttuurree cclleeaannuupp_?¶ ********** │ │ │ │ -pytest does not do any special processing for SIGTERM and SIGQUIT signals │ │ │ │ -(SIGINT is handled naturally by the Python runtime via KeyboardInterrupt), so │ │ │ │ +pytest does not do any special processing for _S_I_G_T_E_R_M and SIGQUIT signals │ │ │ │ +(_S_I_G_I_N_T is handled naturally by the Python runtime via _K_e_y_b_o_a_r_d_I_n_t_e_r_r_u_p_t), so │ │ │ │ fixtures that manage external resources which are important to be cleared when │ │ │ │ the Python process is terminated (by those signals) might leak resources. │ │ │ │ The reason pytest does not handle those signals to perform fixture cleanup is │ │ │ │ that signal handlers are global, and changing them might interfere with the │ │ │ │ code under execution. │ │ │ │ If fixtures in your suite need special care regarding termination in those │ │ │ │ scenarios, see _t_h_i_s_ _c_o_m_m_e_n_t in the issue tracker for a possible workaround. │ │ ├── ./usr/share/doc/python-pytest-doc/html/explanation/goodpractices.html │ │ │ @@ -315,15 +315,15 @@ │ │ │ │ │ │ │ │ │
    │ │ │
    │ │ │

    Good Integration Practices

    │ │ │
    │ │ │

    Install package with pip

    │ │ │ -

    For development, we recommend you use venv for virtual environments and │ │ │ +

    For development, we recommend you use venv for virtual environments and │ │ │ pip:index for installing your application and any dependencies, │ │ │ as well as the pytest package itself. │ │ │ This ensures your code and dependencies are isolated from your system Python installation.

    │ │ │

    Create a pyproject.toml file in the root of your repository as described in │ │ │ packaging:tutorials/packaging-projects. │ │ │ The first few lines should look like this:

    │ │ │
    [build-system]
    │ │ │ ├── html2text {}
    │ │ │ │ @@ -76,15 +76,15 @@
    │ │ │ │      * _I_s_s_u_e_ _T_r_a_c_k_e_r
    │ │ │ │      * _P_D_F_ _D_o_c_u_m_e_n_t_a_t_i_o_n
    │ │ │ │  _B_a_c_k_ _t_o_ _t_o_p
    │ │ │ │  Toggle Light / Dark / Auto color theme
    │ │ │ │  Toggle table of contents sidebar
    │ │ │ │  ************ GGoooodd IInntteeggrraattiioonn PPrraaccttiicceess_?¶ ************
    │ │ │ │  ********** IInnssttaallll ppaacckkaaggee wwiitthh ppiipp_?¶ **********
    │ │ │ │ -For development, we recommend you use venv for virtual environments and pip:
    │ │ │ │ +For development, we recommend you use _v_e_n_v for virtual environments and pip:
    │ │ │ │  index for installing your application and any dependencies, as well as the
    │ │ │ │  pytest package itself. This ensures your code and dependencies are isolated
    │ │ │ │  from your system Python installation.
    │ │ │ │  Create a pyproject.toml file in the root of your repository as described in
    │ │ │ │  packaging:tutorials/packaging-projects. The first few lines should look like
    │ │ │ │  this:
    │ │ │ │  [build-system]
    │ │ ├── ./usr/share/doc/python-pytest-doc/html/explanation/pythonpath.html
    │ │ │ @@ -321,47 +321,47 @@
    │ │ │  

    Import modes

    │ │ │

    pytest as a testing framework needs to import test modules and conftest.py files for execution.

    │ │ │

    Importing files in Python is a non-trivial process, so aspects of the │ │ │ import process can be controlled through the --import-mode command-line flag, which can assume │ │ │ these values:

    │ │ │
      │ │ │
    • prepend (default): The directory path containing each module will be inserted into the beginning │ │ │ -of sys.path if not already there, and then imported with │ │ │ -the importlib.import_module function.

      │ │ │ +of sys.path if not already there, and then imported with │ │ │ +the importlib.import_module function.

      │ │ │

      It is highly recommended to arrange your test modules as packages by adding __init__.py files to your directories │ │ │ containing tests. This will make the tests part of a proper Python package, allowing pytest to resolve their full │ │ │ name (for example tests.core.test_core for test_core.py inside the tests.core package).

      │ │ │

      If the test directory tree is not arranged as packages, then each test file needs to have a unique name │ │ │ compared to the other test files, otherwise pytest will raise an error if it finds two tests with the same name.

      │ │ │

      This is the classic mechanism, dating back from the time Python 2 was still supported.

      │ │ │
    • │ │ │
    │ │ │
      │ │ │ -
    • append: the directory containing each module is appended to the end of sys.path if not already │ │ │ -there, and imported with importlib.import_module.

      │ │ │ +
    • append: the directory containing each module is appended to the end of sys.path if not already │ │ │ +there, and imported with importlib.import_module.

      │ │ │

      This better allows users to run test modules against installed versions of a package even if the │ │ │ package under test has the same import root. For example:

      │ │ │
      testing/__init__.py
      │ │ │  testing/test_pkg_under_test.py
      │ │ │  pkg_under_test/
      │ │ │  
      │ │ │
      │ │ │

      the tests will run against the installed version │ │ │ of pkg_under_test when --import-mode=append is used whereas │ │ │ with prepend, they would pick up the local version. This kind of confusion is why │ │ │ we advocate for using src-layouts.

      │ │ │

      Same as prepend, requires test module names to be unique when the test directory tree is │ │ │ -not arranged in packages, because the modules will be put in sys.modules after importing.

      │ │ │ +not arranged in packages, because the modules will be put in sys.modules after importing.

      │ │ │
    • │ │ │
    │ │ │
      │ │ │ -
    • importlib: this mode uses more fine control mechanisms provided by importlib to import test modules, without changing sys.path.

      │ │ │ +
    • importlib: this mode uses more fine control mechanisms provided by importlib to import test modules, without changing sys.path.

      │ │ │

      Advantages of this mode:

      │ │ │
        │ │ │ -
      • pytest will not change sys.path at all.

      • │ │ │ +
      • pytest will not change sys.path at all.

      • │ │ │
      • Test module names do not need to be unique -- pytest will generate a unique name automatically based on the rootdir.

      • │ │ │
      │ │ │

      Disadvantages:

      │ │ │
        │ │ │
      • Test modules can't import each other.

      • │ │ │
      • Testing utility modules in the tests directories (for example a tests.helpers module containing test-related functions/classes) │ │ │ are not importable. The recommendation in this case is to place testing utility modules together with the application/library │ │ │ @@ -371,24 +371,24 @@ │ │ │ with the test modules, and are discovered automatically by pytest.

        │ │ │
      • │ │ │
      │ │ │

      It works like this:

      │ │ │
        │ │ │
      1. Given a certain module path, for example tests/core/test_models.py, derives a canonical name │ │ │ like tests.core.test_models and tries to import it.

        │ │ │ -

        For non-test modules, this will work if they are accessible via sys.path. So │ │ │ +

        For non-test modules, this will work if they are accessible via sys.path. So │ │ │ for example, .env/lib/site-packages/app/core.py will be importable as app.core. │ │ │ This happens when plugins import non-test modules (for example doctesting).

        │ │ │

        If this step succeeds, the module is returned.

        │ │ │ -

        For test modules, unless they are reachable from sys.path, this step will fail.

        │ │ │ +

        For test modules, unless they are reachable from sys.path, this step will fail.

        │ │ │
      2. │ │ │
      3. If the previous step fails, we import the module directly using importlib facilities, which lets us import it without │ │ │ -changing sys.path.

        │ │ │ -

        Because Python requires the module to also be available in sys.modules, pytest derives a unique name for it based │ │ │ -on its relative location from the rootdir, and adds the module to sys.modules.

        │ │ │ +changing sys.path.

        │ │ │ +

        Because Python requires the module to also be available in sys.modules, pytest derives a unique name for it based │ │ │ +on its relative location from the rootdir, and adds the module to sys.modules.

        │ │ │

        For example, tests/core/test_models.py will end up being imported as the module tests.core.test_models.

        │ │ │
      4. │ │ │
      │ │ │
      │ │ │

      Added in version 6.0.

      │ │ │
      │ │ │
    • │ │ │ @@ -409,15 +409,15 @@ │ │ │

      The consider_namespace_packages configuration variable.

      │ │ │

      Choosing a test layout.

      │ │ │
    │ │ │
    │ │ │
    │ │ │

    prepend and append import modes scenarios

    │ │ │

    Here's a list of scenarios when using prepend or append import modes where pytest needs to │ │ │ -change sys.path in order to import test modules or conftest.py files, and the issues users │ │ │ +change sys.path in order to import test modules or conftest.py files, and the issues users │ │ │ might encounter because of that.

    │ │ │
    │ │ │

    Test modules / conftest.py files inside packages

    │ │ │

    Consider this file and directory layout:

    │ │ │
    root/
    │ │ │  |- foo/
    │ │ │     |- __init__.py
    │ │ │ @@ -433,15 +433,15 @@
    │ │ │  
    pytest root/
    │ │ │  
    │ │ │
    │ │ │

    pytest will find foo/bar/tests/test_foo.py and realize it is part of a package given that │ │ │ there's an __init__.py file in the same directory. It will then search upwards until it can find the │ │ │ last directory which still contains an __init__.py file in order to find the package root (in │ │ │ this case foo/). To load the module, it will insert root/ to the front of │ │ │ -sys.path (if not there already) in order to load │ │ │ +sys.path (if not there already) in order to load │ │ │ test_foo.py as the module foo.bar.tests.test_foo.

    │ │ │

    The same logic applies to the conftest.py file: it will be imported as foo.conftest module.

    │ │ │

    Preserving the full package name is important when tests live in a package to avoid problems │ │ │ and allow test modules to have duplicated names. This is also discussed in detail in │ │ │ Conventions for Python test discovery.

    │ │ │
    │ │ │
    │ │ │ @@ -457,25 +457,25 @@ │ │ │ │ │ │

    When executing:

    │ │ │
    pytest root/
    │ │ │  
    │ │ │
    │ │ │

    pytest will find foo/bar/tests/test_foo.py and realize it is NOT part of a package given that │ │ │ there's no __init__.py file in the same directory. It will then add root/foo/bar/tests to │ │ │ -sys.path in order to import test_foo.py as the module test_foo. The same is done │ │ │ -with the conftest.py file by adding root/foo to sys.path to import it as conftest.

    │ │ │ +sys.path in order to import test_foo.py as the module test_foo. The same is done │ │ │ +with the conftest.py file by adding root/foo to sys.path to import it as conftest.

    │ │ │

    For this reason this layout cannot have test modules with the same name, as they all will be │ │ │ imported in the global import namespace.

    │ │ │

    This is also discussed in detail in Conventions for Python test discovery.

    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Invoking pytest versus python -m pytest

    │ │ │

    Running pytest with pytest [...] instead of python -m pytest [...] yields nearly │ │ │ -equivalent behaviour, except that the latter will add the current directory to sys.path, which │ │ │ +equivalent behaviour, except that the latter will add the current directory to sys.path, which │ │ │ is standard python behavior.

    │ │ │

    See also Calling pytest through python -m pytest.

    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -82,46 +82,46 @@ │ │ │ │ ********** IImmppoorrtt mmooddeess_?¶ ********** │ │ │ │ pytest as a testing framework needs to import test modules and conftest.py │ │ │ │ files for execution. │ │ │ │ Importing files in Python is a non-trivial process, so aspects of the import │ │ │ │ process can be controlled through the _-_-_i_m_p_o_r_t_-_m_o_d_e command-line flag, which │ │ │ │ can assume these values: │ │ │ │ * prepend (default): The directory path containing each module will be │ │ │ │ - inserted into the bbeeggiinnnniinngg of sys.path if not already there, and then │ │ │ │ - imported with the importlib.import_module function. │ │ │ │ + inserted into the bbeeggiinnnniinngg of _s_y_s_._p_a_t_h if not already there, and then │ │ │ │ + imported with the _i_m_p_o_r_t_l_i_b_._i_m_p_o_r_t___m_o_d_u_l_e function. │ │ │ │ It is highly recommended to arrange your test modules as packages by │ │ │ │ adding __init__.py files to your directories containing tests. This will │ │ │ │ make the tests part of a proper Python package, allowing pytest to │ │ │ │ resolve their full name (for example tests.core.test_core for │ │ │ │ test_core.py inside the tests.core package). │ │ │ │ If the test directory tree is not arranged as packages, then each test │ │ │ │ file needs to have a unique name compared to the other test files, │ │ │ │ otherwise pytest will raise an error if it finds two tests with the same │ │ │ │ name. │ │ │ │ This is the classic mechanism, dating back from the time Python 2 was │ │ │ │ still supported. │ │ │ │ * append: the directory containing each module is appended to the end of │ │ │ │ - sys.path if not already there, and imported with importlib.import_module. │ │ │ │ + _s_y_s_._p_a_t_h if not already there, and imported with _i_m_p_o_r_t_l_i_b_._i_m_p_o_r_t___m_o_d_u_l_e. │ │ │ │ This better allows users to run test modules against installed versions │ │ │ │ of a package even if the package under test has the same import root. For │ │ │ │ example: │ │ │ │ testing/__init__.py │ │ │ │ testing/test_pkg_under_test.py │ │ │ │ pkg_under_test/ │ │ │ │ the tests will run against the installed version of pkg_under_test when _- │ │ │ │ _-_i_m_p_o_r_t_-_m_o_d_e_=_a_p_p_e_n_d is used whereas with prepend, they would pick up the │ │ │ │ local version. This kind of confusion is why we advocate for using _s_r_c_- │ │ │ │ _l_a_y_o_u_t_s. │ │ │ │ Same as prepend, requires test module names to be unique when the test │ │ │ │ directory tree is not arranged in packages, because the modules will be │ │ │ │ - put in sys.modules after importing. │ │ │ │ + put in _s_y_s_._m_o_d_u_l_e_s after importing. │ │ │ │ * importlib: this mode uses more fine control mechanisms provided by │ │ │ │ - importlib to import test modules, without changing sys.path. │ │ │ │ + _i_m_p_o_r_t_l_i_b to import test modules, without changing _s_y_s_._p_a_t_h. │ │ │ │ Advantages of this mode: │ │ │ │ - o pytest will not change sys.path at all. │ │ │ │ + o pytest will not change _s_y_s_._p_a_t_h at all. │ │ │ │ o Test module names do not need to be unique -- pytest will generate │ │ │ │ a unique name automatically based on the rootdir. │ │ │ │ Disadvantages: │ │ │ │ o Test modules can't import each other. │ │ │ │ o Testing utility modules in the tests directories (for example a │ │ │ │ tests.helpers module containing test-related functions/classes) are │ │ │ │ not importable. The recommendation in this case is to place testing │ │ │ │ @@ -132,27 +132,27 @@ │ │ │ │ fixtures, which should be placed in conftest.py files, along with │ │ │ │ the test modules, and are discovered automatically by pytest. │ │ │ │ It works like this: │ │ │ │ 1. Given a certain module path, for example tests/core/test_models.py, │ │ │ │ derives a canonical name like tests.core.test_models and tries to │ │ │ │ import it. │ │ │ │ For non-test modules, this will work if they are accessible via │ │ │ │ - sys.path. So for example, .env/lib/site-packages/app/core.py will │ │ │ │ + _s_y_s_._p_a_t_h. So for example, .env/lib/site-packages/app/core.py will │ │ │ │ be importable as app.core. This happens when plugins import non- │ │ │ │ test modules (for example doctesting). │ │ │ │ If this step succeeds, the module is returned. │ │ │ │ - For test modules, unless they are reachable from sys.path, this │ │ │ │ + For test modules, unless they are reachable from _s_y_s_._p_a_t_h, this │ │ │ │ step will fail. │ │ │ │ 2. If the previous step fails, we import the module directly using │ │ │ │ importlib facilities, which lets us import it without changing │ │ │ │ - sys.path. │ │ │ │ + _s_y_s_._p_a_t_h. │ │ │ │ Because Python requires the module to also be available in │ │ │ │ - sys.modules, pytest derives a unique name for it based on its │ │ │ │ + _s_y_s_._m_o_d_u_l_e_s, pytest derives a unique name for it based on its │ │ │ │ relative location from the rootdir, and adds the module to │ │ │ │ - sys.modules. │ │ │ │ + _s_y_s_._m_o_d_u_l_e_s. │ │ │ │ For example, tests/core/test_models.py will end up being imported │ │ │ │ as the module tests.core.test_models. │ │ │ │ Added in version 6.0. │ │ │ │ Note │ │ │ │ Initially we intended to make importlib the default in future releases, however │ │ │ │ it is clear now that it has its own set of drawbacks so the default will remain │ │ │ │ prepend for the foreseeable future. │ │ │ │ @@ -162,15 +162,15 @@ │ │ │ │ configuration variable. │ │ │ │ See also │ │ │ │ The _p_y_t_h_o_n_p_a_t_h configuration variable. │ │ │ │ The _c_o_n_s_i_d_e_r___n_a_m_e_s_p_a_c_e___p_a_c_k_a_g_e_s configuration variable. │ │ │ │ _C_h_o_o_s_i_n_g_ _a_ _t_e_s_t_ _l_a_y_o_u_t. │ │ │ │ ********** pprreeppeenndd aanndd aappppeenndd iimmppoorrtt mmooddeess sscceennaarriiooss_?¶ ********** │ │ │ │ Here's a list of scenarios when using prepend or append import modes where │ │ │ │ -pytest needs to change sys.path in order to import test modules or conftest.py │ │ │ │ +pytest needs to change _s_y_s_._p_a_t_h in order to import test modules or conftest.py │ │ │ │ files, and the issues users might encounter because of that. │ │ │ │ ******** TTeesstt mmoodduulleess // ccoonnfftteesstt..ppyy ffiilleess iinnssiiddee ppaacckkaaggeess_?¶ ******** │ │ │ │ Consider this file and directory layout: │ │ │ │ root/ │ │ │ │ |- foo/ │ │ │ │ |- __init__.py │ │ │ │ |- conftest.py │ │ │ │ @@ -181,15 +181,15 @@ │ │ │ │ |- test_foo.py │ │ │ │ When executing: │ │ │ │ pytest root/ │ │ │ │ pytest will find foo/bar/tests/test_foo.py and realize it is part of a package │ │ │ │ given that there's an __init__.py file in the same directory. It will then │ │ │ │ search upwards until it can find the last directory which still contains an │ │ │ │ __init__.py file in order to find the package rroooott (in this case foo/). To load │ │ │ │ -the module, it will insert root/ to the front of sys.path (if not there │ │ │ │ +the module, it will insert root/ to the front of _s_y_s_._p_a_t_h (if not there │ │ │ │ already) in order to load test_foo.py as the mmoodduullee foo.bar.tests.test_foo. │ │ │ │ The same logic applies to the conftest.py file: it will be imported as │ │ │ │ foo.conftest module. │ │ │ │ Preserving the full package name is important when tests live in a package to │ │ │ │ avoid problems and allow test modules to have duplicated names. This is also │ │ │ │ discussed in detail in _C_o_n_v_e_n_t_i_o_n_s_ _f_o_r_ _P_y_t_h_o_n_ _t_e_s_t_ _d_i_s_c_o_v_e_r_y. │ │ │ │ ******** SSttaannddaalloonnee tteesstt mmoodduulleess // ccoonnfftteesstt..ppyy ffiilleess_?¶ ******** │ │ │ │ @@ -200,24 +200,24 @@ │ │ │ │ |- bar/ │ │ │ │ |- tests/ │ │ │ │ |- test_foo.py │ │ │ │ When executing: │ │ │ │ pytest root/ │ │ │ │ pytest will find foo/bar/tests/test_foo.py and realize it is NOT part of a │ │ │ │ package given that there's no __init__.py file in the same directory. It will │ │ │ │ -then add root/foo/bar/tests to sys.path in order to import test_foo.py as the │ │ │ │ +then add root/foo/bar/tests to _s_y_s_._p_a_t_h in order to import test_foo.py as the │ │ │ │ mmoodduullee test_foo. The same is done with the conftest.py file by adding root/foo │ │ │ │ -to sys.path to import it as conftest. │ │ │ │ +to _s_y_s_._p_a_t_h to import it as conftest. │ │ │ │ For this reason this layout cannot have test modules with the same name, as │ │ │ │ they all will be imported in the global import namespace. │ │ │ │ This is also discussed in detail in _C_o_n_v_e_n_t_i_o_n_s_ _f_o_r_ _P_y_t_h_o_n_ _t_e_s_t_ _d_i_s_c_o_v_e_r_y. │ │ │ │ ********** IInnvvookkiinngg ppyytteesstt vveerrssuuss ppyytthhoonn --mm ppyytteesstt_?¶ ********** │ │ │ │ Running pytest with pytest [...] instead of python -m pytest [...] yields │ │ │ │ nearly equivalent behaviour, except that the latter will add the current │ │ │ │ -directory to sys.path, which is standard python behavior. │ │ │ │ +directory to _s_y_s_._p_a_t_h, which is standard python behavior. │ │ │ │ See also _C_a_l_l_i_n_g_ _p_y_t_e_s_t_ _t_h_r_o_u_g_h_ _p_y_t_h_o_n_ _-_m_ _p_y_t_e_s_t. │ │ │ │ _N_e_x_t │ │ │ │ _T_y_p_i_n_g_ _i_n_ _p_y_t_e_s_t │ │ │ │ _P_r_e_v_i_o_u_s │ │ │ │ _G_o_o_d_ _I_n_t_e_g_r_a_t_i_o_n_ _P_r_a_c_t_i_c_e_s │ │ │ │ Copyright © 2015, holger krekel and pytest-dev team │ │ │ │ Made with _S_p_h_i_n_x and _@_p_r_a_d_y_u_n_s_g's _F_u_r_o │ │ ├── ./usr/share/doc/python-pytest-doc/html/getting-started.html │ │ │ @@ -367,15 +367,15 @@ │ │ │ FAILED test_sample.py::test_answer - assert 4 == 5 │ │ │ ============================ 1 failed in 0.12s ============================= │ │ │ │ │ │ │ │ │

    The [100%] refers to the overall progress of running all test cases. After it finishes, pytest then shows a failure report because func(3) does not return 5.

    │ │ │
    │ │ │

    Note

    │ │ │ -

    You can use the assert statement to verify test expectations. pytest’s Advanced assertion introspection will intelligently report intermediate values of the assert expression so you can avoid the many names of JUnit legacy methods.

    │ │ │ +

    You can use the assert statement to verify test expectations. pytest’s Advanced assertion introspection will intelligently report intermediate values of the assert expression so you can avoid the many names of JUnit legacy methods.

    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Run multiple tests

    │ │ │

    pytest will run all files of the form test_*.py or *_test.py in the current directory and its subdirectories. More generally, it follows standard test discovery rules.

    │ │ │
    │ │ │
    │ │ │ ├── html2text {} │ │ │ │ @@ -114,17 +114,17 @@ │ │ │ │ test_sample.py:6: AssertionError │ │ │ │ ========================= short test summary info ========================== │ │ │ │ FAILED test_sample.py::test_answer - assert 4 == 5 │ │ │ │ ============================ 1 failed in 0.12s ============================= │ │ │ │ The [100%] refers to the overall progress of running all test cases. After it │ │ │ │ finishes, pytest then shows a failure report because func(3) does not return 5. │ │ │ │ Note │ │ │ │ -You can use the assert statement to verify test expectations. pytest’s Advanced │ │ │ │ -assertion introspection will intelligently report intermediate values of the │ │ │ │ -assert expression so you can avoid the many names of JUnit legacy methods. │ │ │ │ +You can use the assert statement to verify test expectations. pytest’s _A_d_v_a_n_c_e_d │ │ │ │ +_a_s_s_e_r_t_i_o_n_ _i_n_t_r_o_s_p_e_c_t_i_o_n will intelligently report intermediate values of the │ │ │ │ +assert expression so you can avoid the many names _o_f_ _J_U_n_i_t_ _l_e_g_a_c_y_ _m_e_t_h_o_d_s. │ │ │ │ ********** RRuunn mmuullttiippllee tteessttss_?¶ ********** │ │ │ │ pytest will run all files of the form test_*.py or *_test.py in the current │ │ │ │ directory and its subdirectories. More generally, it follows _s_t_a_n_d_a_r_d_ _t_e_s_t │ │ │ │ _d_i_s_c_o_v_e_r_y_ _r_u_l_e_s. │ │ │ │ ********** AAsssseerrtt tthhaatt aa cceerrttaaiinn eexxcceeppttiioonn iiss rraaiisseedd_?¶ ********** │ │ │ │ Use the _r_a_i_s_e_s helper to assert that some code raises an exception: │ │ │ │ # content of test_sysexit.py │ │ ├── ./usr/share/doc/python-pytest-doc/html/how-to/assert.html │ │ │ @@ -423,16 +423,16 @@ │ │ │ raise NotImplementedError │ │ │ │ │ │ with pytest.raises(RuntimeError) as excinfo: │ │ │ foo() │ │ │ assert excinfo.type is RuntimeError │ │ │ │ │ │ │ │ │ -

    The pytest.raises() call will succeed, even though the function raises NotImplementedError, because │ │ │ -NotImplementedError is a subclass of RuntimeError; however the following assert statement will │ │ │ +

    The pytest.raises() call will succeed, even though the function raises NotImplementedError, because │ │ │ +NotImplementedError is a subclass of RuntimeError; however the following assert statement will │ │ │ catch the problem.

    │ │ │
    │ │ │

    Matching exception messages

    │ │ │

    You can pass a match keyword parameter to the context-manager to test │ │ │ that a regular expression matches on the string representation of an exception │ │ │ (similar to the TestCase.assertRaisesRegex method from unittest):

    │ │ │
    import pytest
    │ │ │ @@ -445,22 +445,22 @@
    │ │ │  def test_match():
    │ │ │      with pytest.raises(ValueError, match=r".* 123 .*"):
    │ │ │          myfunc()
    │ │ │  
    │ │ │
    │ │ │

    Notes:

    │ │ │
      │ │ │ -
    • The match parameter is matched with the re.search() │ │ │ +

    • The match parameter is matched with the re.search() │ │ │ function, so in the above example match='123' would have worked as well.

    • │ │ │
    • The match parameter also matches against PEP-678 __notes__.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │

    Assertions about expected exception groups

    │ │ │ -

    When expecting a BaseExceptionGroup or ExceptionGroup you can use pytest.RaisesGroup:

    │ │ │ +

    When expecting a BaseExceptionGroup or ExceptionGroup you can use pytest.RaisesGroup:

    │ │ │
    def test_exception_in_group():
    │ │ │      with pytest.RaisesGroup(ValueError):
    │ │ │          raise ExceptionGroup("group msg", [ValueError("value msg")])
    │ │ │      with pytest.RaisesGroup(ValueError, TypeError):
    │ │ │          raise ExceptionGroup("msg", [ValueError("foo"), TypeError("bar")])
    │ │ │  
    │ │ │
    │ │ │ @@ -470,15 +470,15 @@ │ │ │ raise BaseExceptionGroup("my group msg", [KeyboardInterrupt()]) │ │ │ with pytest.RaisesGroup( │ │ │ Exception, check=lambda eg: isinstance(eg.__cause__, ValueError) │ │ │ ): │ │ │ raise ExceptionGroup("", [TypeError()]) from ValueError() │ │ │ │ │ │ │ │ │ -

    It is strict about structure and unwrapped exceptions, unlike except*, so you might want to set the flatten_subgroups and/or allow_unwrapped parameters.

    │ │ │ +

    It is strict about structure and unwrapped exceptions, unlike except*, so you might want to set the flatten_subgroups and/or allow_unwrapped parameters.

    │ │ │
    def test_structure():
    │ │ │      with pytest.RaisesGroup(pytest.RaisesGroup(ValueError)):
    │ │ │          raise ExceptionGroup("", (ExceptionGroup("", (ValueError(),)),))
    │ │ │      with pytest.RaisesGroup(ValueError, flatten_subgroups=True):
    │ │ │          raise ExceptionGroup("1st group", [ExceptionGroup("2nd group", [ValueError()])])
    │ │ │      with pytest.RaisesGroup(ValueError, allow_unwrapped=True):
    │ │ │          raise ValueError
    │ │ │ @@ -486,15 +486,15 @@
    │ │ │  
    │ │ │

    To specify more details about the contained exception you can use pytest.RaisesExc

    │ │ │
    def test_raises_exc():
    │ │ │      with pytest.RaisesGroup(pytest.RaisesExc(ValueError, match="foo")):
    │ │ │          raise ExceptionGroup("", (ValueError("foo")))
    │ │ │  
    │ │ │
    │ │ │ -

    They both supply a method pytest.RaisesGroup.matches() pytest.RaisesExc.matches() if you want to do matching outside of using it as a . This can be helpful when checking .__context__ or .__cause__.

    │ │ │ +

    They both supply a method pytest.RaisesGroup.matches() pytest.RaisesExc.matches() if you want to do matching outside of using it as a context manager. This can be helpful when checking .__context__ or .__cause__.

    │ │ │
    def test_matches():
    │ │ │      exc = ValueError()
    │ │ │      exc_group = ExceptionGroup("", [exc])
    │ │ │      if RaisesGroup(ValueError).matches(exc_group):
    │ │ │          ...
    │ │ │      # helpful error is available in `.fail_reason` if it fails to match
    │ │ │      r = RaisesExc(ValueError)
    │ │ │ @@ -525,15 +525,15 @@
    │ │ │  
    │ │ │
    │ │ │
    │ │ │

    There is no good way of using excinfo.group_contains() to ensure you're not getting any other exceptions than the one you expected. │ │ │ You should instead use pytest.RaisesGroup, see Assertions about expected exception groups.

    │ │ │ │ │ │

    You can also use the excinfo.group_contains() │ │ │ -method to test for exceptions returned as part of an ExceptionGroup:

    │ │ │ +method to test for exceptions returned as part of an ExceptionGroup:

    │ │ │
    def test_exception_in_group():
    │ │ │      with pytest.raises(ExceptionGroup) as excinfo:
    │ │ │          raise ExceptionGroup(
    │ │ │              "Group message",
    │ │ │              [
    │ │ │                  RuntimeError("Exception 123 raised"),
    │ │ │              ],
    │ │ │ @@ -689,17 +689,17 @@
    │ │ │  of strings. The strings will be joined by newlines but any newlines
    │ │ │  in a string will be escaped. Note that all but the first line will
    │ │ │  be indented slightly, the intention is for the first line to be a summary.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • config (Config) -- The pytest config object.

    • │ │ │ -
    • op (str) -- The operator, e.g. "==", "!=", "not in".

    • │ │ │ -
    • left (object) -- The left operand.

    • │ │ │ -
    • right (object) -- The right operand.

    • │ │ │ +
    • op (str) -- The operator, e.g. "==", "!=", "not in".

    • │ │ │ +
    • left (object) -- The left operand.

    • │ │ │ +
    • right (object) -- The right operand.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest file can implement this hook. For a given item, only conftest │ │ │ files in the item's directory and its parent directories are consulted.

    │ │ │ ├── html2text {} │ │ │ │ @@ -168,15 +168,15 @@ │ │ │ │ def foo(): │ │ │ │ raise NotImplementedError │ │ │ │ │ │ │ │ with pytest.raises(RuntimeError) as excinfo: │ │ │ │ foo() │ │ │ │ assert excinfo.type is RuntimeError │ │ │ │ The pytest.raises() call will succeed, even though the function raises │ │ │ │ -NotImplementedError, because NotImplementedError is a subclass of RuntimeError; │ │ │ │ +_N_o_t_I_m_p_l_e_m_e_n_t_e_d_E_r_r_o_r, because _N_o_t_I_m_p_l_e_m_e_n_t_e_d_E_r_r_o_r is a subclass of _R_u_n_t_i_m_e_E_r_r_o_r; │ │ │ │ however the following assert statement will catch the problem. │ │ │ │ ******** MMaattcchhiinngg eexxcceeppttiioonn mmeessssaaggeess_?¶ ******** │ │ │ │ You can pass a match keyword parameter to the context-manager to test that a │ │ │ │ regular expression matches on the string representation of an exception │ │ │ │ (similar to the TestCase.assertRaisesRegex method from unittest): │ │ │ │ import pytest │ │ │ │ │ │ │ │ @@ -185,19 +185,19 @@ │ │ │ │ raise ValueError("Exception 123 raised") │ │ │ │ │ │ │ │ │ │ │ │ def test_match(): │ │ │ │ with pytest.raises(ValueError, match=r".* 123 .*"): │ │ │ │ myfunc() │ │ │ │ Notes: │ │ │ │ - * The match parameter is matched with the re.search() function, so in the │ │ │ │ + * The match parameter is matched with the _r_e_._s_e_a_r_c_h_(_) function, so in the │ │ │ │ above example match='123' would have worked as well. │ │ │ │ * The match parameter also matches against _P_E_P_-_6_7_8 __notes__. │ │ │ │ ******** AAsssseerrttiioonnss aabboouutt eexxppeecctteedd eexxcceeppttiioonn ggrroouuppss_?¶ ******** │ │ │ │ -When expecting a BaseExceptionGroup or ExceptionGroup you can use │ │ │ │ +When expecting a _B_a_s_e_E_x_c_e_p_t_i_o_n_G_r_o_u_p or _E_x_c_e_p_t_i_o_n_G_r_o_u_p you can use │ │ │ │ _p_y_t_e_s_t_._R_a_i_s_e_s_G_r_o_u_p: │ │ │ │ def test_exception_in_group(): │ │ │ │ with pytest.RaisesGroup(ValueError): │ │ │ │ raise ExceptionGroup("group msg", [ValueError("value msg")]) │ │ │ │ with pytest.RaisesGroup(ValueError, TypeError): │ │ │ │ raise ExceptionGroup("msg", [ValueError("foo"), TypeError("bar")]) │ │ │ │ It accepts a match parameter, that checks against the group message, and a │ │ │ │ @@ -206,15 +206,15 @@ │ │ │ │ def test_raisesgroup_match_and_check(): │ │ │ │ with pytest.RaisesGroup(BaseException, match="my group msg"): │ │ │ │ raise BaseExceptionGroup("my group msg", [KeyboardInterrupt()]) │ │ │ │ with pytest.RaisesGroup( │ │ │ │ Exception, check=lambda eg: isinstance(eg.__cause__, ValueError) │ │ │ │ ): │ │ │ │ raise ExceptionGroup("", [TypeError()]) from ValueError() │ │ │ │ -It is strict about structure and unwrapped exceptions, unlike except*, so you │ │ │ │ +It is strict about structure and unwrapped exceptions, unlike _e_x_c_e_p_t_*, so you │ │ │ │ might want to set the flatten_subgroups and/or allow_unwrapped parameters. │ │ │ │ def test_structure(): │ │ │ │ with pytest.RaisesGroup(pytest.RaisesGroup(ValueError)): │ │ │ │ raise ExceptionGroup("", (ExceptionGroup("", (ValueError(),)),)) │ │ │ │ with pytest.RaisesGroup(ValueError, flatten_subgroups=True): │ │ │ │ raise ExceptionGroup("1st group", [ExceptionGroup("2nd group", │ │ │ │ [ValueError()])]) │ │ │ │ @@ -222,16 +222,16 @@ │ │ │ │ raise ValueError │ │ │ │ To specify more details about the contained exception you can use │ │ │ │ _p_y_t_e_s_t_._R_a_i_s_e_s_E_x_c │ │ │ │ def test_raises_exc(): │ │ │ │ with pytest.RaisesGroup(pytest.RaisesExc(ValueError, match="foo")): │ │ │ │ raise ExceptionGroup("", (ValueError("foo"))) │ │ │ │ They both supply a method _p_y_t_e_s_t_._R_a_i_s_e_s_G_r_o_u_p_._m_a_t_c_h_e_s_(_) _p_y_t_e_s_t_._R_a_i_s_e_s_E_x_c_._m_a_t_c_h_e_s │ │ │ │ -_(_) if you want to do matching outside of using it as a . This can be helpful │ │ │ │ -when checking .__context__ or .__cause__. │ │ │ │ +_(_) if you want to do matching outside of using it as a _c_o_n_t_e_x_t_ _m_a_n_a_g_e_r. This │ │ │ │ +can be helpful when checking .__context__ or .__cause__. │ │ │ │ def test_matches(): │ │ │ │ exc = ValueError() │ │ │ │ exc_group = ExceptionGroup("", [exc]) │ │ │ │ if RaisesGroup(ValueError).matches(exc_group): │ │ │ │ ... │ │ │ │ # helpful error is available in `.fail_reason` if it fails to match │ │ │ │ r = RaisesExc(ValueError) │ │ │ │ @@ -257,15 +257,15 @@ │ │ │ │ assert excinfo.group_contains(ValueError) │ │ │ │ # You can't simply list all exceptions you *don't* want to get │ │ │ │ here. │ │ │ │ There is no good way of using _e_x_c_i_n_f_o_._g_r_o_u_p___c_o_n_t_a_i_n_s_(_) to ensure you're not │ │ │ │ getting aannyy other exceptions than the one you expected. You should instead use │ │ │ │ _p_y_t_e_s_t_._R_a_i_s_e_s_G_r_o_u_p, see _A_s_s_e_r_t_i_o_n_s_ _a_b_o_u_t_ _e_x_p_e_c_t_e_d_ _e_x_c_e_p_t_i_o_n_ _g_r_o_u_p_s. │ │ │ │ You can also use the _e_x_c_i_n_f_o_._g_r_o_u_p___c_o_n_t_a_i_n_s_(_) method to test for exceptions │ │ │ │ -returned as part of an ExceptionGroup: │ │ │ │ +returned as part of an _E_x_c_e_p_t_i_o_n_G_r_o_u_p: │ │ │ │ def test_exception_in_group(): │ │ │ │ with pytest.raises(ExceptionGroup) as excinfo: │ │ │ │ raise ExceptionGroup( │ │ │ │ "Group message", │ │ │ │ [ │ │ │ │ RuntimeError("Exception 123 raised"), │ │ │ │ ], │ │ │ │ @@ -388,17 +388,17 @@ │ │ │ │ Return explanation for comparisons in failing assert expressions. │ │ │ │ Return None for no custom explanation, otherwise return a list of │ │ │ │ strings. The strings will be joined by newlines but any newlines iinn a │ │ │ │ string will be escaped. Note that all but the first line will be indented │ │ │ │ slightly, the intention is for the first line to be a summary. │ │ │ │ Parameters: │ │ │ │ * ccoonnffiigg (_CC_oo_nn_ff_ii_gg) -- The pytest config object. │ │ │ │ - * oopp (ssttrr) -- The operator, e.g. "==", "!=", "not in". │ │ │ │ - * lleefftt (oobbjjeecctt) -- The left operand. │ │ │ │ - * rriigghhtt (oobbjjeecctt) -- The right operand. │ │ │ │ + * oopp (_ss_tt_rr) -- The operator, e.g. "==", "!=", "not in". │ │ │ │ + * lleefftt (_oo_bb_jj_ee_cc_tt) -- The left operand. │ │ │ │ + * rriigghhtt (_oo_bb_jj_ee_cc_tt) -- The right operand. │ │ │ │ ******** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******** │ │ │ │ Any conftest file can implement this hook. For a given item, only │ │ │ │ conftest files in the item's directory and its parent directories are │ │ │ │ consulted. │ │ │ │ As an example consider adding the following hook in a _c_o_n_f_t_e_s_t_._p_y file which │ │ │ │ provides an alternative explanation for Foo objects: │ │ │ │ # content of conftest.py │ │ ├── ./usr/share/doc/python-pytest-doc/html/how-to/capture-warnings.html │ │ │ @@ -348,15 +348,15 @@ │ │ │ │ │ │ -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html │ │ │ ======================= 1 passed, 1 warning in 0.12s ======================= │ │ │
    │ │ │
    │ │ │
    │ │ │

    Controlling warnings

    │ │ │ -

    Similar to Python's warning filter and -W option flag, pytest provides │ │ │ +

    Similar to Python's warning filter and -W option flag, pytest provides │ │ │ its own -W flag to control which warnings are ignored, displayed, or turned into │ │ │ errors. See the warning filter documentation for more │ │ │ advanced use-cases.

    │ │ │

    This code sample shows how to treat any UserWarning category class of warning │ │ │ as an error:

    │ │ │
    $ pytest -q test_show_warnings.py -W error::UserWarning
    │ │ │  F                                                                    [100%]
    │ │ │ @@ -454,15 +454,15 @@
    │ │ │  
    │ │ │
    │ │ │
    │ │ │

    Important

    │ │ │

    Regarding decorator order and filter precedence: │ │ │ it's important to remember that decorators are evaluated in reverse order, │ │ │ so you have to list the warning filters in the reverse order │ │ │ -compared to traditional warnings.filterwarnings() and -W option usage. │ │ │ +compared to traditional warnings.filterwarnings() and -W option usage. │ │ │ This means in practice that filters from earlier @pytest.mark.filterwarnings decorators │ │ │ take precedence over filters from later decorators, as illustrated in the example above.

    │ │ │
    │ │ │

    Filters applied using a mark take precedence over filters passed on the command line or configured │ │ │ by the filterwarnings configuration option.

    │ │ │

    You may apply a filter to all tests of a class by using the filterwarnings mark as a class │ │ │ decorator or to all tests in a module by setting the pytestmark variable:

    │ │ │ @@ -470,15 +470,15 @@ │ │ │ pytestmark = pytest.mark.filterwarnings("error") │ │ │ │ │ │ │ │ │
    │ │ │

    Note

    │ │ │

    If you want to apply multiple filters │ │ │ (by assigning a list of filterwarnings mark to pytestmark), │ │ │ -you must use the traditional warnings.filterwarnings() ordering approach (later filters take precedence), │ │ │ +you must use the traditional warnings.filterwarnings() ordering approach (later filters take precedence), │ │ │ which is the reverse of the decorator approach mentioned above.

    │ │ │
    │ │ │

    Credits go to Florian Schulze for the reference implementation in the pytest-warnings │ │ │ plugin.

    │ │ │
    │ │ │
    │ │ │

    Setting a maximum number of warnings

    │ │ │ @@ -573,19 +573,19 @@ │ │ │

    This will ignore all warnings of type DeprecationWarning where the start of the message matches │ │ │ the regular expression ".*U.*mode is deprecated".

    │ │ │

    See @pytest.mark.filterwarnings and │ │ │ Controlling warnings for more examples.

    │ │ │
    │ │ │

    Note

    │ │ │

    If warnings are configured at the interpreter level, using │ │ │ -the python:PYTHONWARNINGS environment variable or the │ │ │ +the PYTHONWARNINGS environment variable or the │ │ │ -W command-line option, pytest will not configure any filters by default.

    │ │ │

    Also pytest doesn't follow PEP 565 suggestion of resetting all warning filters because │ │ │ it might break test suites that configure warning filters themselves │ │ │ -by calling warnings.simplefilter() (see #2430 for an example of that).

    │ │ │ +by calling warnings.simplefilter() (see #2430 for an example of that).

    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Ensuring code triggers a deprecation warning

    │ │ │

    You can also use pytest.deprecated_call() for checking │ │ │ that a certain function call triggers a DeprecationWarning, PendingDeprecationWarning or │ │ │ FutureWarning:

    │ │ │ @@ -777,17 +777,17 @@ │ │ │

    These warnings might be filtered using the same builtin mechanisms used to filter other types of warnings.

    │ │ │

    Please read our Backwards Compatibility Policy to learn how we proceed about deprecating and eventually removing │ │ │ features.

    │ │ │

    The full list of warnings is listed in the reference documentation.

    │ │ │
    │ │ │
    │ │ │

    Resource Warnings

    │ │ │ -

    Additional information of the source of a ResourceWarning can be obtained when captured by pytest if │ │ │ -tracemalloc module is enabled.

    │ │ │ -

    One convenient way to enable tracemalloc when running tests is to set the PYTHONTRACEMALLOC to a large │ │ │ +

    Additional information of the source of a ResourceWarning can be obtained when captured by pytest if │ │ │ +tracemalloc module is enabled.

    │ │ │ +

    One convenient way to enable tracemalloc when running tests is to set the PYTHONTRACEMALLOC to a large │ │ │ enough number of frames (say 20, but that number is application dependent).

    │ │ │

    For more information, consult the Python Development Mode │ │ │ section in the Python documentation.

    │ │ │
    │ │ │
    │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ @@ -106,15 +106,15 @@ │ │ │ │ /home/sweet/project/test_show_warnings.py:5: UserWarning: api v1, should use │ │ │ │ functions from v2 │ │ │ │ warnings.warn(UserWarning("api v1, should use functions from v2")) │ │ │ │ │ │ │ │ -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html │ │ │ │ ======================= 1 passed, 1 warning in 0.12s ======================= │ │ │ │ ********** CCoonnttrroolllliinngg wwaarrnniinnggss_?¶ ********** │ │ │ │ -Similar to Python's _w_a_r_n_i_n_g_ _f_i_l_t_e_r and -W option flag, pytest provides its own │ │ │ │ +Similar to Python's _w_a_r_n_i_n_g_ _f_i_l_t_e_r and _-_W_ _o_p_t_i_o_n flag, pytest provides its own │ │ │ │ -W flag to control which warnings are ignored, displayed, or turned into │ │ │ │ errors. See the _w_a_r_n_i_n_g_ _f_i_l_t_e_r documentation for more advanced use-cases. │ │ │ │ This code sample shows how to treat any UserWarning category class of warning │ │ │ │ as an error: │ │ │ │ $ pytest -q test_show_warnings.py -W error::UserWarning │ │ │ │ F [100%] │ │ │ │ ================================= FAILURES ================================= │ │ │ │ @@ -190,28 +190,28 @@ │ │ │ │ # Later arguments take precedence, matching warnings.filterwarnings behavior. │ │ │ │ @pytest.mark.filterwarnings("error", "ignore:api v1") │ │ │ │ def test_one(): │ │ │ │ assert api_v1() == 1 │ │ │ │ Important │ │ │ │ Regarding decorator order and filter precedence: it's important to remember │ │ │ │ that decorators are evaluated in reverse order, so you have to list the warning │ │ │ │ -filters in the reverse order compared to traditional warnings.filterwarnings() │ │ │ │ -and -W option usage. This means in practice that filters from earlier │ │ │ │ +filters in the reverse order compared to traditional _w_a_r_n_i_n_g_s_._f_i_l_t_e_r_w_a_r_n_i_n_g_s_(_) │ │ │ │ +and _-_W_ _o_p_t_i_o_n usage. This means in practice that filters from earlier │ │ │ │ _@_p_y_t_e_s_t_._m_a_r_k_._f_i_l_t_e_r_w_a_r_n_i_n_g_s decorators take precedence over filters from later │ │ │ │ decorators, as illustrated in the example above. │ │ │ │ Filters applied using a mark take precedence over filters passed on the command │ │ │ │ line or configured by the _f_i_l_t_e_r_w_a_r_n_i_n_g_s configuration option. │ │ │ │ You may apply a filter to all tests of a class by using the _f_i_l_t_e_r_w_a_r_n_i_n_g_s mark │ │ │ │ as a class decorator or to all tests in a module by setting the _p_y_t_e_s_t_m_a_r_k │ │ │ │ variable: │ │ │ │ # turns all warnings into errors for this module │ │ │ │ pytestmark = pytest.mark.filterwarnings("error") │ │ │ │ Note │ │ │ │ If you want to apply multiple filters (by assigning a list of _f_i_l_t_e_r_w_a_r_n_i_n_g_s │ │ │ │ -mark to _p_y_t_e_s_t_m_a_r_k), you must use the traditional warnings.filterwarnings() │ │ │ │ +mark to _p_y_t_e_s_t_m_a_r_k), you must use the traditional _w_a_r_n_i_n_g_s_._f_i_l_t_e_r_w_a_r_n_i_n_g_s_(_) │ │ │ │ ordering approach (later filters take precedence), which is the reverse of the │ │ │ │ decorator approach mentioned above. │ │ │ │ CCrreeddiittss ggoo ttoo FFlloorriiaann SScchhuullzzee ffoorr tthhee rreeffeerreennccee iimmpplleemmeennttaattiioonn iinn tthhee _p_y_t_e_s_t_- │ │ │ │ _w_a_r_n_i_n_g_s pplluuggiinn.. │ │ │ │ ********** SSeettttiinngg aa mmaaxxiimmuumm nnuummbbeerr ooff wwaarrnniinnggss_?¶ ********** │ │ │ │ Added in version 9.1. │ │ │ │ You can use the _-_-_m_a_x_-_w_a_r_n_i_n_g_s command-line option to fail the test run if the │ │ │ │ @@ -268,20 +268,20 @@ │ │ │ │ [pytest] │ │ │ │ filterwarnings = │ │ │ │ ignore:.*U.*mode is deprecated:DeprecationWarning │ │ │ │ This will ignore all warnings of type DeprecationWarning where the start of the │ │ │ │ message matches the regular expression ".*U.*mode is deprecated". │ │ │ │ See _@_p_y_t_e_s_t_._m_a_r_k_._f_i_l_t_e_r_w_a_r_n_i_n_g_s and _C_o_n_t_r_o_l_l_i_n_g_ _w_a_r_n_i_n_g_s for more examples. │ │ │ │ Note │ │ │ │ -If warnings are configured at the interpreter level, using the python: │ │ │ │ -PYTHONWARNINGS environment variable or the -W command-line option, pytest will │ │ │ │ -not configure any filters by default. │ │ │ │ +If warnings are configured at the interpreter level, using the _P_Y_T_H_O_N_W_A_R_N_I_N_G_S │ │ │ │ +environment variable or the -W command-line option, pytest will not configure │ │ │ │ +any filters by default. │ │ │ │ Also pytest doesn't follow _PP_EE_PP_ _55_66_55 suggestion of resetting all warning filters │ │ │ │ because it might break test suites that configure warning filters themselves by │ │ │ │ -calling warnings.simplefilter() (see _#_2_4_3_0 for an example of that). │ │ │ │ +calling _w_a_r_n_i_n_g_s_._s_i_m_p_l_e_f_i_l_t_e_r_(_) (see _#_2_4_3_0 for an example of that). │ │ │ │ ********** EEnnssuurriinngg ccooddee ttrriiggggeerrss aa ddeepprreeccaattiioonn wwaarrnniinngg_?¶ ********** │ │ │ │ You can also use pytest.deprecated_call() for checking that a certain function │ │ │ │ call triggers a DeprecationWarning, PendingDeprecationWarning or FutureWarning: │ │ │ │ import pytest │ │ │ │ │ │ │ │ │ │ │ │ def test_myfunction_deprecated(): │ │ │ │ @@ -428,18 +428,18 @@ │ │ │ │ 1 warning in 0.12s │ │ │ │ These warnings might be filtered using the same builtin mechanisms used to │ │ │ │ filter other types of warnings. │ │ │ │ Please read our _B_a_c_k_w_a_r_d_s_ _C_o_m_p_a_t_i_b_i_l_i_t_y_ _P_o_l_i_c_y to learn how we proceed about │ │ │ │ deprecating and eventually removing features. │ │ │ │ The full list of warnings is listed in _t_h_e_ _r_e_f_e_r_e_n_c_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n. │ │ │ │ ********** RReessoouurrccee WWaarrnniinnggss_?¶ ********** │ │ │ │ -Additional information of the source of a ResourceWarning can be obtained when │ │ │ │ -captured by pytest if tracemalloc module is enabled. │ │ │ │ -One convenient way to enable tracemalloc when running tests is to set the │ │ │ │ -PYTHONTRACEMALLOC to a large enough number of frames (say 20, but that number │ │ │ │ +Additional information of the source of a _R_e_s_o_u_r_c_e_W_a_r_n_i_n_g can be obtained when │ │ │ │ +captured by pytest if _t_r_a_c_e_m_a_l_l_o_c module is enabled. │ │ │ │ +One convenient way to enable _t_r_a_c_e_m_a_l_l_o_c when running tests is to set the │ │ │ │ +_P_Y_T_H_O_N_T_R_A_C_E_M_A_L_L_O_C to a large enough number of frames (say 20, but that number │ │ │ │ is application dependent). │ │ │ │ For more information, consult the _P_y_t_h_o_n_ _D_e_v_e_l_o_p_m_e_n_t_ _M_o_d_e section in the Python │ │ │ │ documentation. │ │ │ │ _N_e_x_t │ │ │ │ _H_o_w_ _t_o_ _u_s_e_ _s_k_i_p_ _a_n_d_ _x_f_a_i_l_ _t_o_ _d_e_a_l_ _w_i_t_h_ _t_e_s_t_s_ _t_h_a_t_ _c_a_n_n_o_t_ _s_u_c_c_e_e_d │ │ │ │ _P_r_e_v_i_o_u_s │ │ │ │ _H_o_w_ _t_o_ _c_a_p_t_u_r_e_ _s_t_d_o_u_t_/_s_t_d_e_r_r_ _o_u_t_p_u_t │ │ ├── ./usr/share/doc/python-pytest-doc/html/how-to/doctest.html │ │ │ @@ -314,15 +314,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │
    │ │ │

    How to run doctests

    │ │ │

    By default, all files matching the test*.txt pattern will │ │ │ -be run through the python standard doctest module. You │ │ │ +be run through the python standard doctest module. You │ │ │ can change the pattern by issuing:

    │ │ │
    pytest --doctest-glob="*.rst"
    │ │ │  
    │ │ │
    │ │ │

    on the command line. --doctest-glob can be given multiple times in the command-line.

    │ │ │

    If you then have a text file like this:

    │ │ │
    # content of test_example.txt
    │ │ │ @@ -395,15 +395,15 @@
    │ │ │  
    │ │ │
    │ │ │ │ │ │ │ │ │
    │ │ │
    │ │ │

    Using 'doctest' options

    │ │ │ -

    Python's standard doctest module provides some options │ │ │ +

    Python's standard doctest module provides some options │ │ │ to configure the strictness of doctest tests. In pytest, you can enable those flags using the │ │ │ configuration file.

    │ │ │

    For example, to make pytest ignore trailing whitespaces and ignore │ │ │ lengthy exception stack traces you can just write:

    │ │ │
    │ │ │
    │ │ │
    [pytest]
    │ │ │ @@ -470,16 +470,16 @@
    │ │ │  
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Output format

    │ │ │

    You can change the diff output format on failure for your doctests │ │ │ by using one of the standard doctest module's format options │ │ │ -(see python:doctest.REPORT_UDIFF, python:doctest.REPORT_CDIFF, │ │ │ -python:doctest.REPORT_NDIFF, python:doctest.REPORT_ONLY_FIRST_FAILURE):

    │ │ │ +(see doctest.REPORT_UDIFF, doctest.REPORT_CDIFF, │ │ │ +doctest.REPORT_NDIFF, doctest.REPORT_ONLY_FIRST_FAILURE):

    │ │ │
    pytest --doctest-modules --doctest-report none
    │ │ │  pytest --doctest-modules --doctest-report udiff
    │ │ │  pytest --doctest-modules --doctest-report cdiff
    │ │ │  pytest --doctest-modules --doctest-report ndiff
    │ │ │  pytest --doctest-modules --doctest-report only_first_failure
    │ │ │  
    │ │ │
    │ │ │ @@ -543,15 +543,15 @@ │ │ │ Fixtures will not be discovered in a sibling directory tree!

    │ │ │
    │ │ │
    │ │ │

    Skipping tests

    │ │ │

    For the same reasons one might want to skip normal tests, it is also possible to skip │ │ │ tests inside doctests.

    │ │ │

    To skip a single check inside a doctest you can use the standard │ │ │ -doctest.SKIP directive:

    │ │ │ +doctest.SKIP directive:

    │ │ │
    def test_random(y):
    │ │ │      """
    │ │ │      >>> random.random()  # doctest: +SKIP
    │ │ │      0.156231223
    │ │ │  
    │ │ │      >>> 1 + 1
    │ │ │      2
    │ │ │ ├── html2text {}
    │ │ │ │ @@ -76,15 +76,15 @@
    │ │ │ │      * _I_s_s_u_e_ _T_r_a_c_k_e_r
    │ │ │ │      * _P_D_F_ _D_o_c_u_m_e_n_t_a_t_i_o_n
    │ │ │ │  _B_a_c_k_ _t_o_ _t_o_p
    │ │ │ │  Toggle Light / Dark / Auto color theme
    │ │ │ │  Toggle table of contents sidebar
    │ │ │ │  ************ HHooww ttoo rruunn ddoocctteessttss_?¶ ************
    │ │ │ │  By default, all files matching the test*.txt pattern will be run through the
    │ │ │ │ -python standard doctest module. You can change the pattern by issuing:
    │ │ │ │ +python standard _d_o_c_t_e_s_t module. You can change the pattern by issuing:
    │ │ │ │  pytest --doctest-glob="*.rst"
    │ │ │ │  on the command line. _-_-_d_o_c_t_e_s_t_-_g_l_o_b can be given multiple times in the command-
    │ │ │ │  line.
    │ │ │ │  If you then have a text file like this:
    │ │ │ │  # content of test_example.txt
    │ │ │ │  
    │ │ │ │  hello this is a doctest
    │ │ │ │ @@ -135,15 +135,15 @@
    │ │ │ │  #toml
    │ │ │ │  [pytest]
    │ │ │ │  doctest_encoding = "latin1"
    │ │ │ │  oini
    │ │ │ │  [pytest]
    │ │ │ │  doctest_encoding = latin1
    │ │ │ │  ********** UUssiinngg ''ddoocctteesstt'' ooppttiioonnss_?¶ **********
    │ │ │ │ -Python's standard doctest module provides some options to configure the
    │ │ │ │ +Python's standard _d_o_c_t_e_s_t module provides some _o_p_t_i_o_n_s to configure the
    │ │ │ │  strictness of doctest tests. In pytest, you can enable those flags using the
    │ │ │ │  configuration file.
    │ │ │ │  For example, to make pytest ignore trailing whitespaces and ignore lengthy
    │ │ │ │  exception stack traces you can just write:
    │ │ │ │  #toml
    │ │ │ │  [pytest]
    │ │ │ │  doctest_optionflags = ["NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"]
    │ │ │ │ @@ -184,17 +184,16 @@
    │ │ │ │        Added in version 5.1.
    │ │ │ │  ********** CCoonnttiinnuuee oonn ffaaiilluurree_?¶ **********
    │ │ │ │  By default, pytest would report only the first failure for a given doctest. If
    │ │ │ │  you want to continue the test even when you have failures, do:
    │ │ │ │  pytest --doctest-modules --doctest-continue-on-failure
    │ │ │ │  ********** OOuuttppuutt ffoorrmmaatt_?¶ **********
    │ │ │ │  You can change the diff output format on failure for your doctests by using one
    │ │ │ │ -of the standard doctest module's format options (see python:
    │ │ │ │ -doctest.REPORT_UDIFF, python:doctest.REPORT_CDIFF, python:doctest.REPORT_NDIFF,
    │ │ │ │ -python:doctest.REPORT_ONLY_FIRST_FAILURE):
    │ │ │ │ +of the standard doctest module's format options (see _d_o_c_t_e_s_t_._R_E_P_O_R_T___U_D_I_F_F,
    │ │ │ │ +_d_o_c_t_e_s_t_._R_E_P_O_R_T___C_D_I_F_F, _d_o_c_t_e_s_t_._R_E_P_O_R_T___N_D_I_F_F, _d_o_c_t_e_s_t_._R_E_P_O_R_T___O_N_L_Y___F_I_R_S_T___F_A_I_L_U_R_E):
    │ │ │ │  pytest --doctest-modules --doctest-report none
    │ │ │ │  pytest --doctest-modules --doctest-report udiff
    │ │ │ │  pytest --doctest-modules --doctest-report cdiff
    │ │ │ │  pytest --doctest-modules --doctest-report ndiff
    │ │ │ │  pytest --doctest-modules --doctest-report only_first_failure
    │ │ │ │  ********** ppyytteesstt--ssppeecciiffiicc ffeeaattuurreess_?¶ **********
    │ │ │ │  Some features are provided to make writing doctests easier or with better
    │ │ │ │ @@ -245,15 +244,15 @@
    │ │ │ │  Note that like the normal conftest.py, the fixtures are discovered in the
    │ │ │ │  directory tree conftest is in. Meaning that if you put your doctest with your
    │ │ │ │  source code, the relevant conftest.py needs to be in the same directory tree.
    │ │ │ │  Fixtures will not be discovered in a sibling directory tree!
    │ │ │ │  ******** SSkkiippppiinngg tteessttss_?¶ ********
    │ │ │ │  For the same reasons one might want to skip normal tests, it is also possible
    │ │ │ │  to skip tests inside doctests.
    │ │ │ │ -To skip a single check inside a doctest you can use the standard doctest.SKIP
    │ │ │ │ +To skip a single check inside a doctest you can use the standard _d_o_c_t_e_s_t_._S_K_I_P
    │ │ │ │  directive:
    │ │ │ │  def test_random(y):
    │ │ │ │      """
    │ │ │ │      >>> random.random()  # doctest: +SKIP
    │ │ │ │      0.156231223
    │ │ │ │  
    │ │ │ │      >>> 1 + 1
    │ │ ├── ./usr/share/doc/python-pytest-doc/html/how-to/failures.html
    │ │ │ @@ -322,19 +322,19 @@
    │ │ │  

    To stop the testing process after the first (N) failures:

    │ │ │
    pytest -x           # stop after first failure
    │ │ │  pytest --maxfail=2  # stop after two failures
    │ │ │  
    │ │ │
    │ │ │
    │ │ │
    │ │ │ -

    Using python:library/pdb with pytest

    │ │ │ +

    Using pdb — The Python Debugger with pytest

    │ │ │
    │ │ │ -

    Dropping to pdb on failures

    │ │ │ -

    Python comes with a builtin Python debugger called pdb. pytest │ │ │ -allows one to drop into the pdb prompt via a command line option:

    │ │ │ +

    Dropping to pdb on failures

    │ │ │ +

    Python comes with a builtin Python debugger called pdb. pytest │ │ │ +allows one to drop into the pdb prompt via a command line option:

    │ │ │
    pytest --pdb
    │ │ │  
    │ │ │
    │ │ │

    This will invoke the Python debugger on every failure (or KeyboardInterrupt). │ │ │ Often you might only want to do this for the first failing test to understand │ │ │ a certain failure situation:

    │ │ │
    pytest -x --pdb   # drop to PDB on first failure, then end test session
    │ │ │ @@ -351,16 +351,16 @@
    │ │ │  42
    │ │ │  >>> sys.last_value
    │ │ │  AssertionError('assert result == "ok"',)
    │ │ │  
    │ │ │
    │ │ │
    │ │ │
    │ │ │ -

    Dropping to pdb at the start of a test

    │ │ │ -

    pytest allows one to drop into the pdb prompt immediately at the start of each test via a command line option:

    │ │ │ +

    Dropping to pdb at the start of a test

    │ │ │ +

    pytest allows one to drop into the pdb prompt immediately at the start of each test via a command line option:

    │ │ │
    pytest --trace
    │ │ │  
    │ │ │
    │ │ │

    This will invoke the Python debugger at the start of every test.

    │ │ │
    │ │ │
    │ │ │

    Setting breakpoints

    │ │ │ @@ -389,15 +389,15 @@ │ │ │
    │ │ │
    │ │ │
    │ │ │

    Fault Handler

    │ │ │
    │ │ │

    Added in version 5.0.

    │ │ │
    │ │ │ -

    The faulthandler standard module │ │ │ +

    The faulthandler standard module │ │ │ can be used to dump Python tracebacks on a segfault or after a timeout.

    │ │ │

    The module is automatically enabled for pytest runs, unless the -p no:faulthandler is given │ │ │ on the command-line.

    │ │ │

    Also the faulthandler_timeout=X configuration option can be used │ │ │ to dump the traceback of all threads if a test takes longer than X │ │ │ seconds to finish.

    │ │ │
    │ │ │ @@ -417,16 +417,16 @@ │ │ │
    │ │ │

    Warning about unraisable exceptions and unhandled thread exceptions

    │ │ │
    │ │ │

    Added in version 6.2.

    │ │ │
    │ │ │

    Unhandled exceptions are exceptions that are raised in a situation in which │ │ │ they cannot propagate to a caller. The most common case is an exception raised │ │ │ -in a __del__ implementation.

    │ │ │ -

    Unhandled thread exceptions are exceptions raised in a Thread │ │ │ +in a __del__ implementation.

    │ │ │ +

    Unhandled thread exceptions are exceptions raised in a Thread │ │ │ but not handled, causing the thread to terminate uncleanly.

    │ │ │

    Both types of exceptions are normally considered bugs, but may go unnoticed │ │ │ because they don't cause the program itself to crash. Pytest detects these │ │ │ conditions and issues a warning that is visible in the test run summary.

    │ │ │

    The plugins are automatically enabled for pytest runs, unless the │ │ │ -p no:unraisableexception (for unraisable exceptions) and │ │ │ -p no:threadexception (for thread exceptions) options are given on the │ │ │ ├── html2text {} │ │ │ │ @@ -79,18 +79,18 @@ │ │ │ │ Toggle Light / Dark / Auto color theme │ │ │ │ Toggle table of contents sidebar │ │ │ │ ************ HHooww ttoo hhaannddllee tteesstt ffaaiilluurreess_?¶ ************ │ │ │ │ ********** SSttooppppiinngg aafftteerr tthhee ffiirrsstt ((oorr NN)) ffaaiilluurreess_?¶ ********** │ │ │ │ To stop the testing process after the first (N) failures: │ │ │ │ pytest -x # stop after first failure │ │ │ │ pytest --maxfail=2 # stop after two failures │ │ │ │ -********** UUssiinngg ppyytthhoonn::lliibbrraarryy//ppddbb wwiitthh ppyytteesstt_?¶ ********** │ │ │ │ -******** DDrrooppppiinngg ttoo ppddbb oonn ffaaiilluurreess_?¶ ******** │ │ │ │ -Python comes with a builtin Python debugger called pdb. pytest allows one to │ │ │ │ -drop into the pdb prompt via a command line option: │ │ │ │ +********** UUssiinngg _pp_dd_bb_ _?—_ _TT_hh_ee_ _PP_yy_tt_hh_oo_nn_ _DD_ee_bb_uu_gg_gg_ee_rr wwiitthh ppyytteesstt_?¶ ********** │ │ │ │ +******** DDrrooppppiinngg ttoo _pp_dd_bb oonn ffaaiilluurreess_?¶ ******** │ │ │ │ +Python comes with a builtin Python debugger called _p_d_b. pytest allows one to │ │ │ │ +drop into the _p_d_b prompt via a command line option: │ │ │ │ pytest --pdb │ │ │ │ This will invoke the Python debugger on every failure (or KeyboardInterrupt). │ │ │ │ Often you might only want to do this for the first failing test to understand a │ │ │ │ certain failure situation: │ │ │ │ pytest -x --pdb # drop to PDB on first failure, then end test session │ │ │ │ pytest --pdb --maxfail=3 # drop to PDB for first three failures │ │ │ │ Note that on any failure the exception information is stored on sys.last_value, │ │ │ │ @@ -98,16 +98,16 @@ │ │ │ │ drop into postmortem debugging with any debug tool. One can also manually │ │ │ │ access the exception information, for example: │ │ │ │ >>> import sys │ │ │ │ >>> sys.last_traceback.tb_lineno │ │ │ │ 42 │ │ │ │ >>> sys.last_value │ │ │ │ AssertionError('assert result == "ok"',) │ │ │ │ -******** DDrrooppppiinngg ttoo ppddbb aatt tthhee ssttaarrtt ooff aa tteesstt_?¶ ******** │ │ │ │ -pytest allows one to drop into the pdb prompt immediately at the start of each │ │ │ │ +******** DDrrooppppiinngg ttoo _pp_dd_bb aatt tthhee ssttaarrtt ooff aa tteesstt_?¶ ******** │ │ │ │ +pytest allows one to drop into the _p_d_b prompt immediately at the start of each │ │ │ │ test via a command line option: │ │ │ │ pytest --trace │ │ │ │ This will invoke the Python debugger at the start of every test. │ │ │ │ ******** SSeettttiinngg bbrreeaakkppooiinnttss_?¶ ******** │ │ │ │ To set a breakpoint in your code use the native Python import pdb;pdb.set_trace │ │ │ │ () call in your code and pytest automatically disables its output capture for │ │ │ │ that test: │ │ │ │ @@ -126,15 +126,15 @@ │ │ │ │ system Pdb trace UI. │ │ │ │ * With _-_-_p_d_b passed to pytest, the custom internal Pdb trace UI │ │ │ │ is used with both breakpoint() and failed tests/unhandled │ │ │ │ exceptions. │ │ │ │ * _-_-_p_d_b_c_l_s can be used to specify a custom debugger class. │ │ │ │ ********** FFaauulltt HHaannddlleerr_?¶ ********** │ │ │ │ Added in version 5.0. │ │ │ │ -The faulthandler standard module can be used to dump Python tracebacks on a │ │ │ │ +The _f_a_u_l_t_h_a_n_d_l_e_r standard module can be used to dump Python tracebacks on a │ │ │ │ segfault or after a timeout. │ │ │ │ The module is automatically enabled for pytest runs, unless the -p no: │ │ │ │ faulthandler is given on the command-line. │ │ │ │ Also the _f_a_u_l_t_h_a_n_d_l_e_r___t_i_m_e_o_u_t_=_X configuration option can be used to dump the │ │ │ │ traceback of all threads if a test takes longer than X seconds to finish. │ │ │ │ Note │ │ │ │ This functionality has been integrated from the external _p_y_t_e_s_t_-_f_a_u_l_t_h_a_n_d_l_e_r │ │ │ │ @@ -145,16 +145,16 @@ │ │ │ │ _f_a_u_l_t_h_a_n_d_l_e_r___t_i_m_e_o_u_t configuration option. It can still be configured │ │ │ │ from the command-line using -o faulthandler_timeout=X. │ │ │ │ ********** WWaarrnniinngg aabboouutt uunnrraaiissaabbllee eexxcceeppttiioonnss aanndd uunnhhaannddlleedd tthhrreeaadd eexxcceeppttiioonnss_?¶ │ │ │ │ ********** │ │ │ │ Added in version 6.2. │ │ │ │ Unhandled exceptions are exceptions that are raised in a situation in which │ │ │ │ they cannot propagate to a caller. The most common case is an exception raised │ │ │ │ -in a __del__ implementation. │ │ │ │ -Unhandled thread exceptions are exceptions raised in a Thread but not handled, │ │ │ │ +in a _____d_e_l____ implementation. │ │ │ │ +Unhandled thread exceptions are exceptions raised in a _T_h_r_e_a_d but not handled, │ │ │ │ causing the thread to terminate uncleanly. │ │ │ │ Both types of exceptions are normally considered bugs, but may go unnoticed │ │ │ │ because they don't cause the program itself to crash. Pytest detects these │ │ │ │ conditions and issues a warning that is visible in the test run summary. │ │ │ │ The plugins are automatically enabled for pytest runs, unless the -p no: │ │ │ │ unraisableexception (for unraisable exceptions) and -p no:threadexception (for │ │ │ │ thread exceptions) options are given on the command-line. │ │ ├── ./usr/share/doc/python-pytest-doc/html/how-to/fixtures.html │ │ │ @@ -1776,15 +1776,15 @@ │ │ │ and torn down after every test that used it.

    │ │ │
    │ │ │
    │ │ │

    Use fixtures in classes and modules with usefixtures

    │ │ │

    Sometimes test functions do not directly need access to a fixture object. │ │ │ For example, tests may require to operate with an empty directory as the │ │ │ current working directory but otherwise do not care for the concrete │ │ │ -directory. Here is how you can use the standard tempfile │ │ │ +directory. Here is how you can use the standard tempfile │ │ │ and pytest fixtures to │ │ │ achieve it. We separate the creation of the fixture into a conftest.py │ │ │ file:

    │ │ │
    # content of conftest.py
    │ │ │  
    │ │ │  import os
    │ │ │  import tempfile
    │ │ │ ├── html2text {}
    │ │ │ │ @@ -1393,15 +1393,15 @@
    │ │ │ │  and finally test_2 with mod2.
    │ │ │ │  The otherarg parametrized resource (having function scope) was set up before
    │ │ │ │  and torn down after every test that used it.
    │ │ │ │  ********** UUssee ffiixxttuurreess iinn ccllaasssseess aanndd mmoodduulleess wwiitthh uusseeffiixxttuurreess_?¶ **********
    │ │ │ │  Sometimes test functions do not directly need access to a fixture object. For
    │ │ │ │  example, tests may require to operate with an empty directory as the current
    │ │ │ │  working directory but otherwise do not care for the concrete directory. Here is
    │ │ │ │ -how you can use the standard tempfile and pytest fixtures to achieve it. We
    │ │ │ │ +how you can use the standard _t_e_m_p_f_i_l_e and pytest fixtures to achieve it. We
    │ │ │ │  separate the creation of the fixture into a conftest.py file:
    │ │ │ │  # content of conftest.py
    │ │ │ │  
    │ │ │ │  import os
    │ │ │ │  import tempfile
    │ │ │ │  
    │ │ │ │  import pytest
    │ │ ├── ./usr/share/doc/python-pytest-doc/html/how-to/logging.html
    │ │ │ @@ -467,15 +467,15 @@
    │ │ │  
    │ │ │

    Live Logs

    │ │ │

    By setting the log_cli configuration option to true, pytest will output │ │ │ logging records as they are emitted directly into the console.

    │ │ │

    You can specify the logging level for which log records with equal or higher │ │ │ level are printed to the console by passing --log-cli-level. This setting │ │ │ accepts the logging level names or numeric values as seen in │ │ │ -logging's documentation.

    │ │ │ +logging's documentation.

    │ │ │

    Additionally, you can also specify --log-cli-format and │ │ │ --log-cli-date-format which mirror and default to --log-format and │ │ │ --log-date-format if not provided, but are applied only to the console │ │ │ logging handler.

    │ │ │

    All of the CLI log options can also be set in the configuration file. The │ │ │ option names are:

    │ │ │
      │ │ │ @@ -487,15 +487,15 @@ │ │ │ --log-file=/path/to/log/file. This log file is opened in write mode by default, which │ │ │ means that it will be overwritten at each test session. │ │ │ If you'd like the file opened in append mode instead, then you can pass --log-file-mode=a. │ │ │ Note that relative paths for the log-file location, whether passed on the CLI or declared in a │ │ │ config file, are always resolved relative to the current working directory.

      │ │ │

      You can also specify the logging level for the log file by passing │ │ │ --log-file-level. This setting accepts the logging level names or numeric │ │ │ -values as seen in logging's documentation.

      │ │ │ +values as seen in logging's documentation.

      │ │ │

      Additionally, you can also specify --log-file-format and │ │ │ --log-file-date-format which are equal to --log-format and │ │ │ --log-date-format but are applied to the log file logging handler.

      │ │ │

      All of the log file options can also be set in the configuration file. The │ │ │ option names are:

      │ │ │
        │ │ │
      • log_file

      • │ │ │ ├── html2text {} │ │ │ │ @@ -192,16 +192,16 @@ │ │ │ │ captured. To avoid this, ensure that any root logger configuration only adds to │ │ │ │ the existing handlers. │ │ │ │ ********** LLiivvee LLooggss_?¶ ********** │ │ │ │ By setting the _l_o_g___c_l_i configuration option to true, pytest will output logging │ │ │ │ records as they are emitted directly into the console. │ │ │ │ You can specify the logging level for which log records with equal or higher │ │ │ │ level are printed to the console by passing _-_-_l_o_g_-_c_l_i_-_l_e_v_e_l. This setting │ │ │ │ -accepts the logging level names or numeric values as seen in logging's │ │ │ │ -documentation. │ │ │ │ +accepts the logging level names or numeric values as seen in _l_o_g_g_i_n_g_'_s │ │ │ │ +_d_o_c_u_m_e_n_t_a_t_i_o_n. │ │ │ │ Additionally, you can also specify _-_-_l_o_g_-_c_l_i_-_f_o_r_m_a_t and _-_-_l_o_g_-_c_l_i_-_d_a_t_e_-_f_o_r_m_a_t │ │ │ │ which mirror and default to _-_-_l_o_g_-_f_o_r_m_a_t and _-_-_l_o_g_-_d_a_t_e_-_f_o_r_m_a_t if not provided, │ │ │ │ but are applied only to the console logging handler. │ │ │ │ All of the CLI log options can also be set in the configuration file. The │ │ │ │ option names are: │ │ │ │ * _l_o_g___c_l_i___l_e_v_e_l │ │ │ │ * _l_o_g___c_l_i___f_o_r_m_a_t │ │ │ │ @@ -211,15 +211,15 @@ │ │ │ │ default, which means that it will be overwritten at each test session. If you'd │ │ │ │ like the file opened in append mode instead, then you can pass _-_-_l_o_g_-_f_i_l_e_- │ │ │ │ _m_o_d_e_=_a. Note that relative paths for the log-file location, whether passed on │ │ │ │ the CLI or declared in a config file, are always resolved relative to the │ │ │ │ current working directory. │ │ │ │ You can also specify the logging level for the log file by passing _-_-_l_o_g_-_f_i_l_e_- │ │ │ │ _l_e_v_e_l. This setting accepts the logging level names or numeric values as seen │ │ │ │ -in logging's documentation. │ │ │ │ +in _l_o_g_g_i_n_g_'_s_ _d_o_c_u_m_e_n_t_a_t_i_o_n. │ │ │ │ Additionally, you can also specify _-_-_l_o_g_-_f_i_l_e_-_f_o_r_m_a_t and _-_-_l_o_g_-_f_i_l_e_-_d_a_t_e_-_f_o_r_m_a_t │ │ │ │ which are equal to --log-format and _-_-_l_o_g_-_d_a_t_e_-_f_o_r_m_a_t but are applied to the │ │ │ │ log file logging handler. │ │ │ │ All of the log file options can also be set in the configuration file. The │ │ │ │ option names are: │ │ │ │ * _l_o_g___f_i_l_e │ │ │ │ * _l_o_g___f_i_l_e___m_o_d_e │ │ ├── ./usr/share/doc/python-pytest-doc/html/how-to/monkeypatch.html │ │ │ @@ -352,15 +352,15 @@ │ │ │ environment variable is missing, or to set multiple values to a known variable. │ │ │ monkeypatch.setenv and monkeypatch.delenv can be used for │ │ │ these patches.

        │ │ │

        4. Use monkeypatch.setenv("PATH", value, prepend=os.pathsep) to modify $PATH, and │ │ │ monkeypatch.chdir to change the context of the current working directory │ │ │ during a test.

        │ │ │

        5. Use monkeypatch.syspath_prepend to modify sys.path which will also │ │ │ -call pkg_resources.fixup_namespace_packages and importlib.invalidate_caches().

        │ │ │ +call pkg_resources.fixup_namespace_packages and importlib.invalidate_caches().

        │ │ │

        6. Use monkeypatch.context to apply patches only in a specific scope, which can help │ │ │ control teardown of complex fixtures or patches to the stdlib.

        │ │ │

        See the monkeypatch blog post for some introduction material │ │ │ and a discussion of its motivation.

        │ │ │
        │ │ │

        Monkeypatching functions

        │ │ │

        Consider a scenario where you are working with user directories. In the context of │ │ │ ├── html2text {} │ │ │ │ @@ -112,15 +112,15 @@ │ │ │ │ an environment variable is missing, or to set multiple values to a known │ │ │ │ variable. _m_o_n_k_e_y_p_a_t_c_h_._s_e_t_e_n_v and _m_o_n_k_e_y_p_a_t_c_h_._d_e_l_e_n_v can be used for these │ │ │ │ patches. │ │ │ │ 4. Use monkeypatch.setenv("PATH", value, prepend=os.pathsep) to modify $PATH, │ │ │ │ and _m_o_n_k_e_y_p_a_t_c_h_._c_h_d_i_r to change the context of the current working directory │ │ │ │ during a test. │ │ │ │ 5. Use _m_o_n_k_e_y_p_a_t_c_h_._s_y_s_p_a_t_h___p_r_e_p_e_n_d to modify sys.path which will also call │ │ │ │ -pkg_resources.fixup_namespace_packages and importlib.invalidate_caches(). │ │ │ │ +pkg_resources.fixup_namespace_packages and _i_m_p_o_r_t_l_i_b_._i_n_v_a_l_i_d_a_t_e___c_a_c_h_e_s_(_). │ │ │ │ 6. Use _m_o_n_k_e_y_p_a_t_c_h_._c_o_n_t_e_x_t to apply patches only in a specific scope, which can │ │ │ │ help control teardown of complex fixtures or patches to the stdlib. │ │ │ │ See the _m_o_n_k_e_y_p_a_t_c_h_ _b_l_o_g_ _p_o_s_t for some introduction material and a discussion │ │ │ │ of its motivation. │ │ │ │ ********** MMoonnkkeeyyppaattcchhiinngg ffuunnccttiioonnss_?¶ ********** │ │ │ │ Consider a scenario where you are working with user directories. In the context │ │ │ │ of testing, you do not want your test to depend on the running user. │ │ ├── ./usr/share/doc/python-pytest-doc/html/how-to/tmp_path.html │ │ │ @@ -317,15 +317,15 @@ │ │ │

        │ │ │
        │ │ │

        How to use temporary directories and files in tests

        │ │ │
        │ │ │

        The tmp_path fixture

        │ │ │

        You can use the tmp_path fixture which will provide a temporary directory │ │ │ unique to each test function.

        │ │ │ -

        tmp_path is a pathlib.Path object. Here is an example test usage:

        │ │ │ +

        tmp_path is a pathlib.Path object. Here is an example test usage:

        │ │ │
        # content of test_tmp_path.py
        │ │ │  CONTENT = "content"
        │ │ │  
        │ │ │  
        │ │ │  def test_create_file(tmp_path):
        │ │ │      d = tmp_path / "sub"
        │ │ │      d.mkdir()
        │ │ │ @@ -400,15 +400,15 @@
        │ │ │  
        │ │ │

        See tmp_path_factory API for details.

        │ │ │
        │ │ │
        │ │ │

        The tmpdir and tmpdir_factory fixtures

        │ │ │

        The tmpdir and tmpdir_factory fixtures are similar to tmp_path │ │ │ and tmp_path_factory, but use/return legacy py.path.local objects │ │ │ -rather than standard pathlib.Path objects.

        │ │ │ +rather than standard pathlib.Path objects.

        │ │ │
        │ │ │

        Note

        │ │ │

        These days, it is preferred to use tmp_path and tmp_path_factory.

        │ │ │

        In order to help modernize old code bases, one can run pytest with the legacypath │ │ │ plugin disabled:

        │ │ │
        pytest -p no:legacypath
        │ │ │  
        │ │ │ @@ -431,15 +431,15 @@ │ │ │ the temporary directories will follow this template:

        │ │ │
        {temproot}/pytest-of-{user}/pytest-{num}/{testname}/
        │ │ │  
        │ │ │
        │ │ │

        where:

        │ │ │
          │ │ │
        • {temproot} is the system temporary directory │ │ │ -as determined by tempfile.gettempdir(). │ │ │ +as determined by tempfile.gettempdir(). │ │ │ It can be overridden by the PYTEST_DEBUG_TEMPROOT environment variable.

        • │ │ │
        • {user} is the user name running the tests,

        • │ │ │
        • {num} is a number that is incremented with each test suite run

        • │ │ │
        • {testname} is a sanitized version of the name of the current test.

        • │ │ │
        │ │ │

        The auto-incrementing {num} placeholder provides a basic retention feature │ │ │ and avoids that existing results of previous test runs are blindly removed. │ │ │ ├── html2text {} │ │ │ │ @@ -78,15 +78,15 @@ │ │ │ │ _B_a_c_k_ _t_o_ _t_o_p │ │ │ │ Toggle Light / Dark / Auto color theme │ │ │ │ Toggle table of contents sidebar │ │ │ │ ************ HHooww ttoo uussee tteemmppoorraarryy ddiirreeccttoorriieess aanndd ffiilleess iinn tteessttss_?¶ ************ │ │ │ │ ********** TThhee ttmmpp__ppaatthh ffiixxttuurree_?¶ ********** │ │ │ │ You can use the tmp_path fixture which will provide a temporary directory │ │ │ │ unique to each test function. │ │ │ │ -tmp_path is a pathlib.Path object. Here is an example test usage: │ │ │ │ +tmp_path is a _p_a_t_h_l_i_b_._P_a_t_h object. Here is an example test usage: │ │ │ │ # content of test_tmp_path.py │ │ │ │ CONTENT = "content" │ │ │ │ │ │ │ │ │ │ │ │ def test_create_file(tmp_path): │ │ │ │ d = tmp_path / "sub" │ │ │ │ d.mkdir() │ │ │ │ @@ -151,15 +151,15 @@ │ │ │ │ def test_histogram(image_file): │ │ │ │ img = load_image(image_file) │ │ │ │ # compute and test histogram │ │ │ │ See _t_m_p___p_a_t_h___f_a_c_t_o_r_y_ _A_P_I for details. │ │ │ │ ********** TThhee ttmmppddiirr aanndd ttmmppddiirr__ffaaccttoorryy ffiixxttuurreess_?¶ ********** │ │ │ │ The tmpdir and tmpdir_factory fixtures are similar to tmp_path and │ │ │ │ tmp_path_factory, but use/return legacy _p_y_._p_a_t_h_._l_o_c_a_l objects rather than │ │ │ │ -standard pathlib.Path objects. │ │ │ │ +standard _p_a_t_h_l_i_b_._P_a_t_h objects. │ │ │ │ Note │ │ │ │ These days, it is preferred to use tmp_path and tmp_path_factory. │ │ │ │ In order to help modernize old code bases, one can run pytest with the │ │ │ │ legacypath plugin disabled: │ │ │ │ pytest -p no:legacypath │ │ │ │ This will trigger errors on tests using the legacy paths. It can also be │ │ │ │ permanently set as part of the _a_d_d_o_p_t_s parameter in the config file. │ │ │ │ @@ -169,15 +169,15 @@ │ │ │ │ _t_m_p_d_i_r fixtures, are automatically created under a base temporary directory, in │ │ │ │ a structure that depends on the _-_-_b_a_s_e_t_e_m_p option: │ │ │ │ * By default (when the _-_-_b_a_s_e_t_e_m_p option is not set), the temporary │ │ │ │ directories will follow this template: │ │ │ │ {temproot}/pytest-of-{user}/pytest-{num}/{testname}/ │ │ │ │ where: │ │ │ │ o {temproot} is the system temporary directory as determined by │ │ │ │ - tempfile.gettempdir(). It can be overridden by the │ │ │ │ + _t_e_m_p_f_i_l_e_._g_e_t_t_e_m_p_d_i_r_(_). It can be overridden by the │ │ │ │ _P_Y_T_E_S_T___D_E_B_U_G___T_E_M_P_R_O_O_T environment variable. │ │ │ │ o {user} is the user name running the tests, │ │ │ │ o {num} is a number that is incremented with each test suite run │ │ │ │ o {testname} is a sanitized version of _t_h_e_ _n_a_m_e_ _o_f_ _t_h_e_ _c_u_r_r_e_n_t_ _t_e_s_t. │ │ │ │ The auto-incrementing {num} placeholder provides a basic retention │ │ │ │ feature and avoids that existing results of previous test runs are │ │ │ │ blindly removed. By default, the last 3 temporary directories are kept, │ │ ├── ./usr/share/doc/python-pytest-doc/html/how-to/unittest.html │ │ │ @@ -325,19 +325,19 @@ │ │ │

        pytest tests
        │ │ │  
        │ │ │
        │ │ │

        pytest will automatically collect unittest.TestCase subclasses and │ │ │ their test methods in test_*.py or *_test.py files.

        │ │ │

        Almost all unittest features are supported:

        │ │ │ │ │ │

        Up to this point pytest does not have support for the following features:

        │ │ │ │ │ │
        │ │ │

        Benefits out of the box

        │ │ │ ├── html2text {} │ │ │ │ @@ -84,19 +84,19 @@ │ │ │ │ runner and also allow to incrementally adapt the test suite to take full │ │ │ │ advantage of pytest's features. │ │ │ │ To run an existing unittest-style test suite using pytest, type: │ │ │ │ pytest tests │ │ │ │ pytest will automatically collect unittest.TestCase subclasses and their test │ │ │ │ methods in test_*.py or *_test.py files. │ │ │ │ Almost all unittest features are supported: │ │ │ │ - * unittest.skip()/unittest.skipIf() style decorators │ │ │ │ - * unittest.TestCase.setUp()/unittest.TestCase.tearDown() │ │ │ │ - * unittest.TestCase.setUpClass()/unittest.TestCase.tearDownClass() │ │ │ │ + * _u_n_i_t_t_e_s_t_._s_k_i_p_(_)/_u_n_i_t_t_e_s_t_._s_k_i_p_I_f_(_) style decorators │ │ │ │ + * _u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e_._s_e_t_U_p_(_)/_u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e_._t_e_a_r_D_o_w_n_(_) │ │ │ │ + * _u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e_._s_e_t_U_p_C_l_a_s_s_(_)/_u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e_._t_e_a_r_D_o_w_n_C_l_a_s_s_(_) │ │ │ │ * unittest.setUpModule()/unittest.tearDownModule() │ │ │ │ - * unittest.TestCase.subTest() (since version 9.0) │ │ │ │ + * _u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e_._s_u_b_T_e_s_t_(_) (since version 9.0) │ │ │ │ Up to this point pytest does not have support for the following features: │ │ │ │ * _l_o_a_d___t_e_s_t_s_ _p_r_o_t_o_c_o_l; │ │ │ │ ********** BBeenneeffiittss oouutt ooff tthhee bbooxx_?¶ ********** │ │ │ │ By running your test suite with pytest you can make use of several features, in │ │ │ │ most cases without having to modify existing code: │ │ │ │ * Obtain _m_o_r_e_ _i_n_f_o_r_m_a_t_i_v_e_ _t_r_a_c_e_b_a_c_k_s; │ │ │ │ * _s_t_d_o_u_t_ _a_n_d_ _s_t_d_e_r_r capturing; │ │ ├── ./usr/share/doc/python-pytest-doc/html/how-to/usage.html │ │ │ @@ -458,16 +458,16 @@ │ │ │
        │ │ │

        Calling pytest from Python code

        │ │ │

        You can invoke pytest from Python code directly:

        │ │ │
        retcode = pytest.main()
        │ │ │  
        │ │ │
        │ │ │

        this acts as if you would call "pytest" from the command line. │ │ │ -It will not raise SystemExit but return the exit code instead. │ │ │ -If you don't pass it any arguments, main reads the arguments from the command line arguments of the process (sys.argv), which may be undesirable. │ │ │ +It will not raise SystemExit but return the exit code instead. │ │ │ +If you don't pass it any arguments, main reads the arguments from the command line arguments of the process (sys.argv), which may be undesirable. │ │ │ You can pass in options and arguments explicitly:

        │ │ │
        retcode = pytest.main(["-x", "mytestdir"])
        │ │ │  
        │ │ │
        │ │ │

        You can specify additional plugins to pytest.main:

        │ │ │
        # content of myinvoke.py
        │ │ │  import sys
        │ │ │ ├── html2text {}
        │ │ │ │ @@ -168,17 +168,17 @@
        │ │ │ │  This is almost equivalent to invoking the command line script pytest [...]
        │ │ │ │  directly, except that calling via python will also add the current directory to
        │ │ │ │  sys.path.
        │ │ │ │  ******** CCaalllliinngg ppyytteesstt ffrroomm PPyytthhoonn ccooddee_?¶ ********
        │ │ │ │  You can invoke pytest from Python code directly:
        │ │ │ │  retcode = pytest.main()
        │ │ │ │  this acts as if you would call "pytest" from the command line. It will not
        │ │ │ │ -raise SystemExit but return the _e_x_i_t_ _c_o_d_e instead. If you don't pass it any
        │ │ │ │ +raise _S_y_s_t_e_m_E_x_i_t but return the _e_x_i_t_ _c_o_d_e instead. If you don't pass it any
        │ │ │ │  arguments, main reads the arguments from the command line arguments of the
        │ │ │ │ -process (sys.argv), which may be undesirable. You can pass in options and
        │ │ │ │ +process (_s_y_s_._a_r_g_v), which may be undesirable. You can pass in options and
        │ │ │ │  arguments explicitly:
        │ │ │ │  retcode = pytest.main(["-x", "mytestdir"])
        │ │ │ │  You can specify additional plugins to pytest.main:
        │ │ │ │  # content of myinvoke.py
        │ │ │ │  import sys
        │ │ │ │  
        │ │ │ │  import pytest
        │ │ ├── ./usr/share/doc/python-pytest-doc/html/how-to/writing_plugins.html
        │ │ │ @@ -490,15 +490,15 @@
        │ │ │  

        This function will make sure that this module or all modules inside │ │ │ the package will get their assert statements rewritten. │ │ │ Thus you should make sure to call this before the module is │ │ │ actually imported, usually in your __init__.py if you are a plugin │ │ │ using a package.

        │ │ │
        │ │ │
        Parameters:
        │ │ │ -

        names (str) -- The module names to register.

        │ │ │ +

        names (str) -- The module names to register.

        │ │ │
        │ │ │
        │ │ │ │ │ │ │ │ │

        This is especially important when you write a pytest plugin which is │ │ │ created using a package. The import hook only treats conftest.py │ │ │ files and any modules which are listed in the pytest11 entrypoint │ │ │ ├── html2text {} │ │ │ │ @@ -209,15 +209,15 @@ │ │ │ │ register_assert_rewrite(**nnaammeess)_[_s_o_u_r_c_e_] │ │ │ │ Register one or more module names to be rewritten on import. │ │ │ │ This function will make sure that this module or all modules inside the │ │ │ │ package will get their assert statements rewritten. Thus you should make │ │ │ │ sure to call this before the module is actually imported, usually in your │ │ │ │ __init__.py if you are a plugin using a package. │ │ │ │ Parameters: │ │ │ │ - nnaammeess (ssttrr) -- The module names to register. │ │ │ │ + nnaammeess (_ss_tt_rr) -- The module names to register. │ │ │ │ This is especially important when you write a pytest plugin which is created │ │ │ │ using a package. The import hook only treats conftest.py files and any modules │ │ │ │ which are listed in the pytest11 entrypoint as plugins. As an example consider │ │ │ │ the following package: │ │ │ │ pytest_foo/__init__.py │ │ │ │ pytest_foo/plugin.py │ │ │ │ pytest_foo/helper.py │ │ ├── ./usr/share/doc/python-pytest-doc/html/reference/customize.html │ │ │ @@ -428,15 +428,15 @@ │ │ │

        │ │ │
        │ │ │
        │ │ │
        │ │ │
        │ │ │
        │ │ │

        setup.cfg

        │ │ │ -

        setup.cfg files are general purpose configuration files, used originally by distutils (now deprecated) and setuptools, and can also be used to hold pytest configuration │ │ │ +

        setup.cfg files are general purpose configuration files, used originally by distutils (now deprecated) and setuptools, and can also be used to hold pytest configuration │ │ │ if they have a [tool:pytest] section.

        │ │ │
        │ │ │
        │ │ │
        # setup.cfg
        │ │ │  [tool:pytest]
        │ │ │  minversion = 6.0
        │ │ │  addopts = -ra -q
        │ │ │ @@ -520,15 +520,15 @@
        │ │ │  
      • config.rootpath: the determined root directory, guaranteed to exist. It is used as │ │ │ a reference directory for constructing test addresses ("nodeids") and can be used also by plugins for storing │ │ │ per-testrun information.

      • │ │ │
      • config.inipath: the determined configfile, may be None │ │ │ (it is named inipath for historical reasons).

      • │ │ │
      │ │ │
      │ │ │ -

      Added in version 6.1: The config.rootpath and config.inipath properties. They are pathlib.Path │ │ │ +

      Added in version 6.1: The config.rootpath and config.inipath properties. They are pathlib.Path │ │ │ versions of the older config.rootdir and config.inifile, which have type │ │ │ py.path.local, and still exist for backward compatibility.

      │ │ │
      │ │ │

      Example:

      │ │ │
      pytest path/to/testdir path/other/
      │ │ │  
      │ │ │
      │ │ │ ├── html2text {} │ │ │ │ @@ -150,15 +150,15 @@ │ │ │ │ minversion = 6.0 │ │ │ │ addopts = -ra -q │ │ │ │ testpaths = │ │ │ │ tests │ │ │ │ integration │ │ │ │ ******** sseettuupp..ccffgg_?¶ ******** │ │ │ │ setup.cfg files are general purpose configuration files, used originally by │ │ │ │ -distutils (now deprecated) and setuptools, and can also be used to hold pytest │ │ │ │ +distutils (now deprecated) and _s_e_t_u_p_t_o_o_l_s, and can also be used to hold pytest │ │ │ │ configuration if they have a [tool:pytest] section. │ │ │ │ #ini │ │ │ │ # setup.cfg │ │ │ │ [tool:pytest] │ │ │ │ minversion = 6.0 │ │ │ │ addopts = -ra -q │ │ │ │ testpaths = │ │ │ │ @@ -232,15 +232,15 @@ │ │ │ │ * _c_o_n_f_i_g_._r_o_o_t_p_a_t_h: the determined root directory, guaranteed to exist. It │ │ │ │ is used as a reference directory for constructing test addresses │ │ │ │ ("nodeids") and can be used also by plugins for storing per-testrun │ │ │ │ information. │ │ │ │ * _c_o_n_f_i_g_._i_n_i_p_a_t_h: the determined configfile, may be None (it is named │ │ │ │ inipath for historical reasons). │ │ │ │ Added in version 6.1: The config.rootpath and config.inipath properties. They │ │ │ │ -are pathlib.Path versions of the older config.rootdir and config.inifile, which │ │ │ │ +are _p_a_t_h_l_i_b_._P_a_t_h versions of the older config.rootdir and config.inifile, which │ │ │ │ have type py.path.local, and still exist for backward compatibility. │ │ │ │ Example: │ │ │ │ pytest path/to/testdir path/other/ │ │ │ │ will determine the common ancestor as path and then check for configuration │ │ │ │ files as follows: │ │ │ │ # first look for path/pytest.toml │ │ │ │ path/pytest.toml │ │ ├── ./usr/share/doc/python-pytest-doc/html/reference/fixtures.html │ │ │ @@ -361,19 +361,19 @@ │ │ │
      recwarn

      Record warnings emitted by test functions.

      │ │ │
      │ │ │
      request

      Provide information on the executing test function.

      │ │ │
      │ │ │
      testdir

      Provide a temporary test directory to aid in running, and │ │ │ testing, pytest plugins.

      │ │ │
      │ │ │ -
      tmp_path

      Provide a pathlib.Path object to a temporary directory │ │ │ +

      tmp_path

      Provide a pathlib.Path object to a temporary directory │ │ │ which is unique to each test function.

      │ │ │
      │ │ │
      tmp_path_factory

      Make session-scoped temporary directories and return │ │ │ -pathlib.Path objects.

      │ │ │ +pathlib.Path objects.

      │ │ │
      │ │ │
      tmpdir

      Provide a py.path.local object to a temporary │ │ │ directory which is unique to each test function; │ │ │ replaced by tmp_path.

      │ │ │
      │ │ │
      tmpdir_factory

      Make session-scoped temporary directories and return │ │ │ py.path.local objects; │ │ │ ├── html2text {} │ │ │ │ @@ -118,19 +118,19 @@ │ │ │ │ Record warnings emitted by test functions. │ │ │ │ _r_e_q_u_e_s_t │ │ │ │ Provide information on the executing test function. │ │ │ │ _t_e_s_t_d_i_r │ │ │ │ Provide a temporary test directory to aid in running, and │ │ │ │ testing, pytest plugins. │ │ │ │ _t_m_p___p_a_t_h │ │ │ │ - Provide a pathlib.Path object to a temporary directory which is │ │ │ │ + Provide a _p_a_t_h_l_i_b_._P_a_t_h object to a temporary directory which is │ │ │ │ unique to each test function. │ │ │ │ _t_m_p___p_a_t_h___f_a_c_t_o_r_y │ │ │ │ Make session-scoped temporary directories and return │ │ │ │ - pathlib.Path objects. │ │ │ │ + _p_a_t_h_l_i_b_._P_a_t_h objects. │ │ │ │ _t_m_p_d_i_r │ │ │ │ Provide a _p_y_._p_a_t_h_._l_o_c_a_l object to a temporary directory which │ │ │ │ is unique to each test function; replaced by _t_m_p___p_a_t_h. │ │ │ │ _t_m_p_d_i_r___f_a_c_t_o_r_y │ │ │ │ Make session-scoped temporary directories and return │ │ │ │ py.path.local objects; replaced by _t_m_p___p_a_t_h___f_a_c_t_o_r_y. │ │ │ │ ********** FFiixxttuurree aavvaaiillaabbiilliittyy_?¶ ********** │ │ ├── ./usr/share/doc/python-pytest-doc/html/reference/reference.html │ │ │ @@ -362,15 +362,15 @@ │ │ │

      │ │ │

      pytest.approx

      │ │ │
      │ │ │
      │ │ │ approx(expected, rel=None, abs=None, nan_ok=False)[source]
      │ │ │

      Assert that two numbers (or two ordered sequences of numbers) are equal to each other │ │ │ within some tolerance.

      │ │ │ -

      Due to the python:tutorial/floatingpoint, numbers that we │ │ │ +

      Due to the Floating-Point Arithmetic: Issues and Limitations, numbers that we │ │ │ would intuitively expect to be equal are not always so:

      │ │ │
      >>> 0.1 + 0.2 == 0.3
      │ │ │  False
      │ │ │  
      │ │ │
      │ │ │

      This problem is commonly encountered when writing tests, e.g. when making │ │ │ sure that floating-point values are what you expect them to be. One way to │ │ │ @@ -467,17 +467,17 @@ │ │ │ >>> [None, 1.0000005] == approx([None,1]) │ │ │ True │ │ │ >>> ["foo", 1.0000005] == approx([None,1]) │ │ │ False │ │ │

    │ │ │
    │ │ │

    datetime and timedelta

    │ │ │ -

    You can also use approx to compare datetime and │ │ │ -timedelta objects by specifying an absolute tolerance │ │ │ -as a timedelta:

    │ │ │ +

    You can also use approx to compare datetime and │ │ │ +timedelta objects by specifying an absolute tolerance │ │ │ +as a timedelta:

    │ │ │
    >>> from datetime import datetime, timedelta
    │ │ │  >>> dt1 = datetime(2024, 1, 1, 12, 0, 0)
    │ │ │  >>> dt2 = datetime(2024, 1, 1, 12, 0, 0, 500000)
    │ │ │  >>> dt1 == approx(dt2, abs=timedelta(seconds=1))
    │ │ │  True
    │ │ │  
    │ │ │
    │ │ │ @@ -495,39 +495,39 @@ │ │ │
      │ │ │
    • math.isclose(a, b, rel_tol=1e-9, abs_tol=0.0): True if the relative │ │ │ tolerance is met w.r.t. either a or b or if the absolute │ │ │ tolerance is met. Because the relative tolerance is calculated w.r.t. │ │ │ both a and b, this test is symmetric (i.e. neither a nor │ │ │ b is a "reference value"). You have to specify an absolute tolerance │ │ │ if you want to compare to 0.0 because there is no tolerance by │ │ │ -default. More information: math.isclose().

    • │ │ │ +default. More information: math.isclose().

      │ │ │
    • numpy.isclose(a, b, rtol=1e-5, atol=1e-8): True if the difference │ │ │ between a and b is less that the sum of the relative tolerance │ │ │ w.r.t. b and the absolute tolerance. Because the relative tolerance │ │ │ is only calculated w.r.t. b, this test is asymmetric and you can │ │ │ think of b as the reference value. Support for comparing sequences │ │ │ -is provided by numpy.allclose(). More information: │ │ │ -numpy:reference/generated/numpy.isclose.

    • │ │ │ +is provided by numpy.allclose(). More information: │ │ │ +numpy.isclose.

      │ │ │
    • unittest.TestCase.assertAlmostEqual(a, b): True if a and b │ │ │ are within an absolute tolerance of 1e-7. No relative tolerance is │ │ │ considered , so this function is not appropriate for very large or very │ │ │ small numbers. Also, it's only available in subclasses of unittest.TestCase │ │ │ and it's ugly because it doesn't follow PEP8. More information: │ │ │ -unittest.TestCase.assertAlmostEqual().

    • │ │ │ +unittest.TestCase.assertAlmostEqual().

      │ │ │
    • a == pytest.approx(b, rel=1e-6, abs=1e-12): True if the relative │ │ │ tolerance is met w.r.t. b or if the absolute tolerance is met. │ │ │ Because the relative tolerance is only calculated w.r.t. b, this test │ │ │ is asymmetric and you can think of b as the reference value. In the │ │ │ special case that you explicitly specify an absolute tolerance but not a │ │ │ relative tolerance, only the absolute tolerance is considered.

    • │ │ │
    │ │ │
    │ │ │

    Note

    │ │ │

    approx can handle numpy arrays, but we recommend the │ │ │ -specialised test helpers in numpy:reference/routines.testing │ │ │ +specialised test helpers in Test support (numpy.testing) │ │ │ if you need support for comparisons, NaNs, or ULP-based tolerances.

    │ │ │

    To match strings using regex, you can use │ │ │ Matches │ │ │ from the │ │ │ re_assert package.

    │ │ │
    │ │ │
    │ │ │ @@ -540,25 +540,25 @@ │ │ │
    │ │ │
    │ │ │
    │ │ │

    Warning

    │ │ │
    │ │ │

    Changed in version 3.2.

    │ │ │
    │ │ │ -

    In order to avoid inconsistent behavior, TypeError is │ │ │ +

    In order to avoid inconsistent behavior, TypeError is │ │ │ raised for >, >=, < and <= comparisons. │ │ │ The example below illustrates the problem:

    │ │ │
    assert approx(0.1) > 0.1 + 1e-10  # calls approx(0.1).__gt__(0.1 + 1e-10)
    │ │ │  assert 0.1 + 1e-10 > approx(0.1)  # calls approx(0.1).__lt__(0.1 + 1e-10)
    │ │ │  
    │ │ │
    │ │ │

    In the second example one expects approx(0.1).__le__(0.1 + 1e-10) │ │ │ to be called. But instead, approx(0.1).__lt__(0.1 + 1e-10) is used to │ │ │ comparison. This is because the call hierarchy of rich comparisons │ │ │ -follows a fixed behavior. More information: object.__ge__()

    │ │ │ +follows a fixed behavior. More information: object.__ge__()

    │ │ │
    │ │ │
    │ │ │

    Changed in version 3.7.1: approx raises TypeError when it encounters a dict value or │ │ │ sequence element of non-numeric type.

    │ │ │
    │ │ │
    │ │ │

    Changed in version 6.1.0: approx falls back to strict equality for non-numeric types instead │ │ │ @@ -575,16 +575,16 @@ │ │ │

    │ │ │
    │ │ │ fail(reason[, pytrace=True])
    │ │ │

    Explicitly fail an executing test with the given message.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • reason (str) -- The message to show the user as reason for the failure.

    • │ │ │ -
    • pytrace (bool) -- If False, msg represents the full failure information and no │ │ │ +

    • reason (str) -- The message to show the user as reason for the failure.

    • │ │ │ +
    • pytrace (bool) -- If False, msg represents the full failure information and no │ │ │ python traceback will be reported.

    • │ │ │
    │ │ │
    │ │ │
    Raises:
    │ │ │

    pytest.fail.Exception -- The exception that is raised.

    │ │ │
    │ │ │
    │ │ │ @@ -605,16 +605,16 @@ │ │ │

    Skip an executing test with the given message.

    │ │ │

    This function should be called only during testing (setup, call or teardown) or │ │ │ during collection by using the allow_module_level flag. This function can │ │ │ be called in doctests as well.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • reason (str) -- The message to show the user as reason for the skip.

    • │ │ │ -
    • allow_module_level (bool) --

      Allows this function to be called at module level. │ │ │ +

    • reason (str) -- The message to show the user as reason for the skip.

    • │ │ │ +
    • allow_module_level (bool) --

      Allows this function to be called at module level. │ │ │ Raising the skip exception at module level will stop │ │ │ the execution of the module and prevent the collection of all tests in the module, │ │ │ even those defined before the skip call.

      │ │ │

      Defaults to False.

      │ │ │

    • │ │ │
    │ │ │
    │ │ │ @@ -623,15 +623,15 @@ │ │ │
    │ │ │
    │ │ │
    │ │ │

    Note

    │ │ │

    It is better to use the pytest.mark.skipif marker when │ │ │ possible to declare a test to be skipped under certain conditions │ │ │ like mismatching platforms or dependencies. │ │ │ -Similarly, use the # doctest: +SKIP directive (see doctest.SKIP) │ │ │ +Similarly, use the # doctest: +SKIP directive (see doctest.SKIP) │ │ │ to skip a doctest statically.

    │ │ │
    │ │ │ │ │ │ │ │ │
    │ │ │
    │ │ │ class pytest.skip.Exception
    │ │ │ @@ -645,48 +645,48 @@ │ │ │
    │ │ │ importorskip(modname, minversion=None, reason=None, *, exc_type=None)[source]
    │ │ │

    Import and return the requested module modname, or skip the │ │ │ current test if the module cannot be imported.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • modname (str) -- The name of the module to import.

    • │ │ │ -
    • minversion (str | None) -- If given, the imported module's __version__ attribute must be at │ │ │ +

    • modname (str) -- The name of the module to import.

    • │ │ │ +
    • minversion (str | None) -- If given, the imported module's __version__ attribute must be at │ │ │ least this minimal version, otherwise the test is still skipped.

    • │ │ │ -
    • reason (str | None) -- If given, this reason is shown as the message when the module cannot │ │ │ +

    • reason (str | None) -- If given, this reason is shown as the message when the module cannot │ │ │ be imported.

    • │ │ │ -
    • exc_type (type[ImportError] | None) --

      The exception that should be captured in order to skip modules. │ │ │ -Must be ImportError or a subclass.

      │ │ │ -

      Defaults to ModuleNotFoundError when not given, which means │ │ │ +

    • exc_type (type[ImportError] | None) --

      The exception that should be captured in order to skip modules. │ │ │ +Must be ImportError or a subclass.

      │ │ │ +

      Defaults to ModuleNotFoundError when not given, which means │ │ │ the module must be missing for the test to be skipped. │ │ │ Pass exc_type=ImportError to also skip modules that raise │ │ │ -ImportError during import.

      │ │ │ +ImportError during import.

      │ │ │

      See pytest.importorskip default behavior regarding ImportError for details.

      │ │ │

    • │ │ │
    │ │ │
    │ │ │
    Returns:
    │ │ │

    The imported module. This should be assigned to its canonical name.

    │ │ │
    │ │ │
    Raises:
    │ │ │

    pytest.skip.Exception -- If the module cannot be imported.

    │ │ │
    │ │ │
    Return type:
    │ │ │ -

    Any

    │ │ │ +

    Any

    │ │ │
    │ │ │
    │ │ │

    Example:

    │ │ │
    docutils = pytest.importorskip("docutils")
    │ │ │  
    │ │ │
    │ │ │
    │ │ │

    Added in version 8.2: The exc_type parameter.

    │ │ │
    │ │ │
    │ │ │ -

    Changed in version 9.1: The default for exc_type is now ModuleNotFoundError.

    │ │ │ +

    Changed in version 9.1: The default for exc_type is now ModuleNotFoundError.

    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │

    pytest.xfail

    │ │ │
    │ │ │ @@ -694,15 +694,15 @@ │ │ │ xfail(reason='') │ │ │

    Imperatively xfail an executing test or setup function with the given reason.

    │ │ │

    This function should be called only during testing (setup, call or teardown).

    │ │ │

    No other code is executed after using xfail() (it is implemented │ │ │ internally by raising an exception).

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    reason (str) -- The message to show the user as reason for the xfail.

    │ │ │ +

    reason (str) -- The message to show the user as reason for the xfail.

    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Note

    │ │ │

    It is better to use the pytest.mark.xfail marker when │ │ │ possible to declare a test to be xfailed under certain conditions │ │ │ like known bugs or missing features.

    │ │ │ @@ -726,18 +726,18 @@ │ │ │
    │ │ │
    │ │ │ exit(reason[, returncode=None])
    │ │ │

    Exit testing process.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • reason (str) -- The message to show as the reason for exiting pytest. reason has a default value │ │ │ +

    • reason (str) -- The message to show as the reason for exiting pytest. reason has a default value │ │ │ only because msg is deprecated.

    • │ │ │ -
    • returncode (int | None) -- Return code to be used when exiting pytest. None means the same as 0 (no error), │ │ │ -same as sys.exit().

    • │ │ │ +
    • returncode (int | None) -- Return code to be used when exiting pytest. None means the same as 0 (no error), │ │ │ +same as sys.exit().

    • │ │ │
    │ │ │
    │ │ │
    Raises:
    │ │ │

    pytest.exit.Exception -- The exception that is raised.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ @@ -755,24 +755,24 @@ │ │ │
    │ │ │
    │ │ │ main(args=None, plugins=None)[source]
    │ │ │

    Perform an in-process test run.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • args (list[str] | PathLike[str] | None) -- List of command line arguments. If None or not given, defaults to reading │ │ │ -arguments directly from the process command line (sys.argv).

    • │ │ │ -
    • plugins (Sequence[str | object] | None) -- List of plugin objects to be auto-registered during initialization.

    • │ │ │ +
    • args (list[str] | PathLike[str] | None) -- List of command line arguments. If None or not given, defaults to reading │ │ │ +arguments directly from the process command line (sys.argv).

    • │ │ │ +
    • plugins (Sequence[str | object] | None) -- List of plugin objects to be auto-registered during initialization.

    • │ │ │
    │ │ │
    │ │ │
    Returns:
    │ │ │

    An exit code.

    │ │ │
    │ │ │
    Return type:
    │ │ │ -

    int | ExitCode

    │ │ │ +

    int | ExitCode

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │

    pytest.param

    │ │ │ @@ -791,19 +791,19 @@ │ │ │ def test_eval(test_input, expected): │ │ │ assert eval(test_input) == expected │ │ │ │ │ │ │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • values (object) -- Variable args of the values of the parameter set, in order.

    • │ │ │ -
    • marks (MarkDecorator | Collection[MarkDecorator | Mark]) --

      A single mark or a list of marks to be applied to this parameter set.

      │ │ │ +
    • values (object) -- Variable args of the values of the parameter set, in order.

    • │ │ │ +
    • marks (MarkDecorator | Collection[MarkDecorator | Mark]) --

      A single mark or a list of marks to be applied to this parameter set.

      │ │ │

      pytest.mark.usefixtures cannot be added via this parameter.

      │ │ │

    • │ │ │ -
    • id (str | Literal[pytest.HIDDEN_PARAM] | None) --

      The id to attribute to this parameter set.

      │ │ │ +
    • id (str | Literal[pytest.HIDDEN_PARAM] | None) --

      The id to attribute to this parameter set.

      │ │ │
      │ │ │

      Added in version 8.4: pytest.HIDDEN_PARAM means to hide the parameter set │ │ │ from the test name. Can only be used at most 1 time, as │ │ │ test names need to be unique.

      │ │ │
      │ │ │

    • │ │ │
    │ │ │ @@ -830,15 +830,15 @@ │ │ │

    This function will make sure that this module or all modules inside │ │ │ the package will get their assert statements rewritten. │ │ │ Thus you should make sure to call this before the module is │ │ │ actually imported, usually in your __init__.py if you are a plugin │ │ │ using a package.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    names (str) -- The module names to register.

    │ │ │ +

    names (str) -- The module names to register.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │

    pytest.register_fixture

    │ │ │ @@ -854,27 +854,27 @@ │ │ │ cumbersome or nonviable, in which case the imperative interface can be used.

    │ │ │

    Fixture registration is expected to happen during the collection phase, and │ │ │ this is the only sanctioned use. However, to allow for more creative uses, │ │ │ this is not enforced. But do so at your own risk!

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • name (str) -- The fixture's name.

    • │ │ │ -
    • func (Callable[[...], object] | Callable[[...], Generator[object]]) -- The fixture's implementation function.

    • │ │ │ +
    • name (str) -- The fixture's name.

    • │ │ │ +
    • func (Callable[[...], object] | Callable[[...], Generator[object]]) -- The fixture's implementation function.

    • │ │ │
    • node (Node) --

      The visibility of the fixture.

      │ │ │

      Only items that are descendents of this node in the collection tree will │ │ │ be able to request this fixture. You can think of this as the place │ │ │ where you would put the @pytest.fixture.

      │ │ │

      For global visibility, pass the session node, │ │ │ which is the root of the collection tree.

      │ │ │

    • │ │ │ -
    • scope (Literal['session', 'package', 'module', 'class', 'function'] | ~collections.abc.Callable[[str, ~_pytest.config.Config], ~typing.Literal['session', 'package', 'module', 'class', 'function']]) -- The fixture's scope.

    • │ │ │ -
    • params (Sequence[object] | None) -- The fixture's parametrization params.

    • │ │ │ -
    • ids (tuple[object | None, ...] | Callable[[Any], object | None] | None) -- The fixture's IDs.

    • │ │ │ -
    • autouse (bool) -- Whether this is an autouse fixture.

    • │ │ │ +
    • scope (Literal['session', 'package', 'module', 'class', 'function'] | ~collections.abc.Callable[[str, ~_pytest.config.Config], ~typing.Literal['session', 'package', 'module', 'class', 'function']]) -- The fixture's scope.

    • │ │ │ +
    • params (Sequence[object] | None) -- The fixture's parametrization params.

    • │ │ │ +
    • ids (tuple[object | None, ...] | Callable[[Any], object | None] | None) -- The fixture's IDs.

    • │ │ │ +
    • autouse (bool) -- Whether this is an autouse fixture.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │ │ │ │
    │ │ │
    │ │ │ @@ -904,16 +904,16 @@ │ │ │

    Tutorial: @pytest.mark.filterwarnings

    │ │ │

    Add warning filters to marked test items.

    │ │ │
    │ │ │
    │ │ │ pytest.mark.filterwarnings(filter)
    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    filter (str) --

    A warning specification string, which is composed of contents of the tuple (action, message, category, module, lineno) │ │ │ -as specified in python:warning-filter section of │ │ │ +

    filter (str) --

    A warning specification string, which is composed of contents of the tuple (action, message, category, module, lineno) │ │ │ +as specified in The Warnings Filter section of │ │ │ the Python documentation, separated by ":". Optional fields can be omitted. │ │ │ Module names passed for filtering are not regex-escaped.

    │ │ │

    For example:

    │ │ │
    @pytest.mark.filterwarnings(r"ignore:.*usage will be deprecated.*:DeprecationWarning")
    │ │ │  def test_foo(): ...
    │ │ │  
    │ │ │
    │ │ │ @@ -933,15 +933,15 @@ │ │ │

    Tutorial: Skipping test functions

    │ │ │

    Unconditionally skip a test function.

    │ │ │
    │ │ │
    │ │ │ pytest.mark.skip(reason=None)
    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    reason (str) -- Reason why the test function is being skipped.

    │ │ │ +

    reason (str) -- Reason why the test function is being skipped.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │

    pytest.mark.skipif

    │ │ │ @@ -949,16 +949,16 @@ │ │ │

    Skip a test function if a condition is True.

    │ │ │
    │ │ │
    │ │ │ pytest.mark.skipif(condition, *, reason=None)
    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • condition (bool or str) -- True/False if the condition should be skipped or a condition string.

    • │ │ │ -
    • reason (str) -- Reason why the test function is being skipped.

    • │ │ │ +
    • condition (bool or str) -- True/False if the condition should be skipped or a condition string.

    • │ │ │ +
    • reason (str) -- Reason why the test function is being skipped.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ @@ -988,23 +988,23 @@ │ │ │

    Marks a test function as expected to fail.

    │ │ │
    │ │ │
    │ │ │ pytest.mark.xfail(condition=False, *, reason=None, raises=None, run=True, strict=strict_xfail)
    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • condition (Union[bool, str]) -- Condition for marking the test function as xfail (True/False or a │ │ │ +

    • condition (Union[bool, str]) -- Condition for marking the test function as xfail (True/False or a │ │ │ condition string). If a bool, you also have │ │ │ to specify reason (see condition string).

    • │ │ │ -
    • reason (str) -- Reason why the test function is marked as xfail.

    • │ │ │ -
    • raises (Type[Exception]) -- Exception class (or tuple of classes) expected to be raised by the test function; other exceptions will fail the test. │ │ │ +

    • reason (str) -- Reason why the test function is marked as xfail.

    • │ │ │ +
    • raises (Type[Exception]) -- Exception class (or tuple of classes) expected to be raised by the test function; other exceptions will fail the test. │ │ │ Note that subclasses of the classes passed will also result in a match (similar to how the except statement works).

    • │ │ │ -
    • run (bool) -- Whether the test function should actually be executed. If False, the function will always xfail and will │ │ │ +

    • run (bool) -- Whether the test function should actually be executed. If False, the function will always xfail and will │ │ │ not be executed (useful if a function is segfaulting).

    • │ │ │ -
    • strict (bool) --

        │ │ │ +
      • strict (bool) --

          │ │ │
        • If False the function will be shown in the terminal output as xfailed if it fails │ │ │ and as xpass if it passes. In both cases this will not cause the test suite to fail as a whole. This │ │ │ is particularly useful to mark flaky tests (tests that fail at random) to be tackled later.

        • │ │ │
        • If True, the function will be shown in the terminal output as xfailed if it fails, but if it │ │ │ unexpectedly passes then it will fail the test suite. This is particularly useful to mark functions │ │ │ that are always failing and there should be a clear indication if they unexpectedly start to pass (for example │ │ │ a new release of a library fixes a known bug).

        • │ │ │ @@ -1088,62 +1088,62 @@ │ │ │ │ │ │
          │ │ │
          │ │ │ get_records(when)[source]
          │ │ │

          Get the logging records for one of the possible test phases.

          │ │ │
          │ │ │
          Parameters:
          │ │ │ -

          when (Literal['setup', 'call', 'teardown']) -- Which test phase to obtain the records from. │ │ │ +

          when (Literal['setup', 'call', 'teardown']) -- Which test phase to obtain the records from. │ │ │ Valid values are: "setup", "call" and "teardown".

          │ │ │
          │ │ │
          Returns:
          │ │ │

          The list of captured records at the given stage.

          │ │ │
          │ │ │
          Return type:
          │ │ │ -

          list[LogRecord]

          │ │ │ +

          list[LogRecord]

          │ │ │
          │ │ │
          │ │ │
          │ │ │

          Added in version 3.4.

          │ │ │
          │ │ │
          │ │ │ │ │ │
          │ │ │
          │ │ │ -property text: str
          │ │ │ +property text: str │ │ │

          The formatted log text.

          │ │ │
          │ │ │ │ │ │
          │ │ │
          │ │ │ -property records: list[LogRecord]
          │ │ │ +property records: list[LogRecord] │ │ │

          The list of log records.

          │ │ │
          │ │ │ │ │ │
          │ │ │
          │ │ │ -property record_tuples: list[tuple[str, int, str]]
          │ │ │ +property record_tuples: list[tuple[str, int, str]] │ │ │

          A list of a stripped down version of log records intended │ │ │ for use in assertion comparison.

          │ │ │

          The format of the tuple is:

          │ │ │
          │ │ │

          (logger_name, log_level, message)

          │ │ │
          │ │ │
          │ │ │ │ │ │
          │ │ │
          │ │ │ -property messages: list[str]
          │ │ │ +property messages: list[str] │ │ │

          A list of format-interpolated log messages.

          │ │ │

          Unlike 'records', which contains the format string and parameters for │ │ │ interpolation, log messages in this list are all interpolated.

          │ │ │

          Unlike 'text', which contains the output from the handler, log │ │ │ messages in this list are unadorned with levels, timestamps, etc, │ │ │ making exact comparisons more reliable.

          │ │ │ -

          Note that traceback or stack info (from logging.exception() or │ │ │ +

          Note that traceback or stack info (from logging.exception() or │ │ │ the exc_info or stack_info arguments to the logging functions) is │ │ │ not included, as this is added by the formatter in the handler.

          │ │ │
          │ │ │

          Added in version 3.7.

          │ │ │
          │ │ │
          │ │ │ │ │ │ @@ -1160,51 +1160,51 @@ │ │ │ set_level(level, logger=None)[source] │ │ │

          Set the threshold level of a logger for the duration of a test.

          │ │ │

          Logging messages which are less severe than this level will not be captured.

          │ │ │
          │ │ │

          Changed in version 3.4: The levels of the loggers changed by this function will be │ │ │ restored to their initial values at the end of the test.

          │ │ │
          │ │ │ -

          Will enable the requested logging level if it was disabled via logging.disable().

          │ │ │ +

          Will enable the requested logging level if it was disabled via logging.disable().

          │ │ │
          │ │ │
          Parameters:
          │ │ │
            │ │ │ -
          • level (int | str) -- The level.

          • │ │ │ -
          • logger (str | None) -- The logger to update. If not given, the root logger.

          • │ │ │ +
          • level (int | str) -- The level.

          • │ │ │ +
          • logger (str | None) -- The logger to update. If not given, the root logger.

          • │ │ │
          │ │ │
          │ │ │
          │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ at_level(level, logger=None)[source]
    │ │ │

    Context manager that sets the level for capturing of logs. After │ │ │ the end of the 'with' statement the level is restored to its original │ │ │ value.

    │ │ │ -

    Will enable the requested logging level if it was disabled via logging.disable().

    │ │ │ +

    Will enable the requested logging level if it was disabled via logging.disable().

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • level (int | str) -- The level.

    • │ │ │ -
    • logger (str | None) -- The logger to update. If not given, the root logger.

    • │ │ │ +
    • level (int | str) -- The level.

    • │ │ │ +
    • logger (str | None) -- The logger to update. If not given, the root logger.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ filtering(filter_)[source]
    │ │ │

    Context manager that temporarily adds the given filter to the caplog's │ │ │ handler() for the 'with' statement block, and removes that filter at the │ │ │ end of the block.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    filter -- A custom logging.Filter object.

    │ │ │ +

    filter -- A custom logging.Filter object.

    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Added in version 7.5.

    │ │ │
    │ │ │
    │ │ │ │ │ │ @@ -1259,15 +1259,15 @@ │ │ │
    │ │ │

    config.cache

    │ │ │

    Tutorial: How to re-run failed tests and maintain state between test runs

    │ │ │

    The config.cache object allows other plugins and fixtures │ │ │ to store and retrieve values across test runs. To access it from fixtures │ │ │ request pytestconfig into your fixture and get it with pytestconfig.cache.

    │ │ │

    Under the hood, the cache plugin uses the simple │ │ │ -dumps/loads API of the json stdlib module.

    │ │ │ +dumps/loads API of the json stdlib module.

    │ │ │

    config.cache is an instance of pytest.Cache:

    │ │ │
    │ │ │
    │ │ │ final class Cache[source]
    │ │ │

    Instance of the cache fixture.

    │ │ │
    │ │ │
    │ │ │ @@ -1279,15 +1279,15 @@ │ │ │ it to manage files to e.g. store/retrieve database dumps across test │ │ │ sessions.

    │ │ │
    │ │ │

    Added in version 7.0.

    │ │ │
    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    name (str) -- Must be a string not containing a / separator. │ │ │ +

    name (str) -- Must be a string not containing a / separator. │ │ │ Make sure the name contains your plugin or application │ │ │ identifiers to prevent clashes with other cache users.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │ @@ -1295,32 +1295,32 @@ │ │ │ get(key, default)[source] │ │ │

    Return the cached value for the given key.

    │ │ │

    If no value was yet cached or the value cannot be read, the specified │ │ │ default is returned.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • key (str) -- Must be a / separated value. Usually the first │ │ │ +

    • key (str) -- Must be a / separated value. Usually the first │ │ │ name is the name of your plugin or your application.

    • │ │ │
    • default -- The value to return in case of a cache-miss or invalid cache value.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ set(key, value)[source]
    │ │ │

    Save value for the given key.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • key (str) -- Must be a / separated value. Usually the first │ │ │ +

    • key (str) -- Must be a / separated value. Usually the first │ │ │ name is the name of your plugin or your application.

    • │ │ │ -
    • value (object) -- Must be of any combination of basic python types, │ │ │ +

    • value (object) -- Must be of any combination of basic python types, │ │ │ including nested types like lists of dictionaries.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │ @@ -1328,15 +1328,15 @@ │ │ │
    │ │ │
    │ │ │

    doctest_namespace

    │ │ │

    Tutorial: How to run doctests

    │ │ │
    │ │ │
    │ │ │ doctest_namespace()[source]
    │ │ │ -

    Fixture that returns a dict that will be injected into the │ │ │ +

    Fixture that returns a dict that will be injected into the │ │ │ namespace of doctests.

    │ │ │

    Usually this fixture is used in conjunction with another autouse fixture:

    │ │ │
    @pytest.fixture(autouse=True)
    │ │ │  def add_np(doctest_namespace):
    │ │ │      doctest_namespace["np"] = numpy
    │ │ │  
    │ │ │
    │ │ │ @@ -1382,40 +1382,40 @@ │ │ │ of this see #3290).

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -setattr(target: str, name: object, value: NotSetType = NotSetType.token, raising: bool = True) None[source]
    │ │ │ +setattr(target: str, name: object, value: NotSetType = NotSetType.token, raising: bool = True) None[source] │ │ │
    │ │ │ -setattr(target: object, name: str, value: object, raising: bool = True) None
    │ │ │ +setattr(target: object, name: str, value: object, raising: bool = True) None │ │ │

    Set attribute value on target, memorizing the old value.

    │ │ │

    For example:

    │ │ │
    import os
    │ │ │  
    │ │ │  monkeypatch.setattr(os, "getcwd", lambda: "/")
    │ │ │  
    │ │ │
    │ │ │ -

    The code above replaces the os.getcwd() function by a lambda which │ │ │ +

    The code above replaces the os.getcwd() function by a lambda which │ │ │ always returns "/".

    │ │ │

    For convenience, you can specify a string as target which │ │ │ will be interpreted as a dotted import path, with the last part │ │ │ being the attribute name:

    │ │ │
    monkeypatch.setattr("os.getcwd", lambda: "/")
    │ │ │  
    │ │ │
    │ │ │ -

    Raises AttributeError if the attribute does not exist, unless │ │ │ +

    Raises AttributeError if the attribute does not exist, unless │ │ │ raising is set to False.

    │ │ │

    Where to patch

    │ │ │

    monkeypatch.setattr works by (temporarily) changing the object that a name points to with another one. │ │ │ There can be many names pointing to any individual object, so for patching to work you must ensure │ │ │ that you patch the name used by the system under test.

    │ │ │ -

    See the section Where to patch in the unittest.mock │ │ │ -docs for a complete explanation, which is meant for unittest.mock.patch() but │ │ │ +

    See the section Where to patch in the unittest.mock │ │ │ +docs for a complete explanation, which is meant for unittest.mock.patch() but │ │ │ applies to monkeypatch.setattr as well.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ delattr(target, name=NotSetType.token, raising=True)[source]
    │ │ │

    Delete attribute name from target.

    │ │ │ @@ -1477,15 +1477,15 @@ │ │ │ │ │ │
    │ │ │
    │ │ │ chdir(path)[source]
    │ │ │

    Change the current working directory to the specified path.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    path (str | PathLike[str]) -- The path to change into.

    │ │ │ +

    path (str | PathLike[str]) -- The path to change into.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ undo()[source]
    │ │ │ @@ -1552,15 +1552,15 @@ │ │ │
    │ │ │
    │ │ │ exception TimeoutExpired[source]
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -plugins: list[str | object]
    │ │ │ +plugins: list[str | object] │ │ │

    A list of plugins to use with parseconfig() and │ │ │ runpytest(). Initially this is an empty list but plugins can │ │ │ be added to the list.

    │ │ │

    When running in subprocess mode, specify plugins by name (str) - adding │ │ │ plugin objects directly is not supported.

    │ │ │
    │ │ │ │ │ │ @@ -1590,19 +1590,19 @@ │ │ │
    │ │ │
    │ │ │ makefile(ext, *args, **kwargs)[source]
    │ │ │

    Create new text file(s) in the test directory.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • ext (str) -- The extension the file(s) should use, including the dot, e.g. .py.

    • │ │ │ -
    • args (str) -- All args are treated as strings and joined using newlines. │ │ │ +

    • ext (str) -- The extension the file(s) should use, including the dot, e.g. .py.

    • │ │ │ +
    • args (str) -- All args are treated as strings and joined using newlines. │ │ │ The result is written as contents to the file. The name of the │ │ │ file is based on the test function requesting this fixture.

    • │ │ │ -
    • kwargs (str) -- Each keyword is the name of a file, while the value of it will │ │ │ +

    • kwargs (str) -- Each keyword is the name of a file, while the value of it will │ │ │ be written as contents of the file.

    • │ │ │
    │ │ │
    │ │ │
    Returns:
    │ │ │

    The first created file.

    │ │ │
    │ │ │
    Return type:
    │ │ │ @@ -1611,28 +1611,28 @@ │ │ │
    │ │ │

    Examples:

    │ │ │
    pytester.makefile(".txt", "line1", "line2")
    │ │ │  
    │ │ │  pytester.makefile(".ini", pytest="[pytest]\naddopts=-rs\n")
    │ │ │  
    │ │ │
    │ │ │ -

    To create binary files, use pathlib.Path.write_bytes() directly:

    │ │ │ +

    To create binary files, use pathlib.Path.write_bytes() directly:

    │ │ │
    filename = pytester.path.joinpath("foo.bin")
    │ │ │  filename.write_bytes(b"...")
    │ │ │  
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ makeconftest(source)[source]
    │ │ │

    Write a conftest.py file.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    source (str) -- The contents.

    │ │ │ +

    source (str) -- The contents.

    │ │ │
    │ │ │
    Returns:
    │ │ │

    The conftest.py file.

    │ │ │
    │ │ │
    Return type:
    │ │ │

    Path

    │ │ │
    │ │ │ @@ -1641,15 +1641,15 @@ │ │ │ │ │ │
    │ │ │
    │ │ │ makeini(source)[source]
    │ │ │

    Write a tox.ini file.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    source (str) -- The contents.

    │ │ │ +

    source (str) -- The contents.

    │ │ │
    │ │ │
    Returns:
    │ │ │

    The tox.ini file.

    │ │ │
    │ │ │
    Return type:
    │ │ │

    Path

    │ │ │
    │ │ │ @@ -1658,15 +1658,15 @@ │ │ │ │ │ │
    │ │ │
    │ │ │ maketoml(source)[source]
    │ │ │

    Write a pytest.toml file.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    source (str) -- The contents.

    │ │ │ +

    source (str) -- The contents.

    │ │ │
    │ │ │
    Returns:
    │ │ │

    The pytest.toml file.

    │ │ │
    │ │ │
    Return type:
    │ │ │

    Path

    │ │ │
    │ │ │ @@ -1686,15 +1686,15 @@ │ │ │ │ │ │
    │ │ │
    │ │ │ makepyprojecttoml(source)[source]
    │ │ │

    Write a pyproject.toml file.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    source (str) -- The contents.

    │ │ │ +

    source (str) -- The contents.

    │ │ │
    │ │ │
    Returns:
    │ │ │

    The pyproject.ini file.

    │ │ │
    │ │ │
    Return type:
    │ │ │

    Path

    │ │ │
    │ │ │ @@ -1746,32 +1746,32 @@ │ │ │
    │ │ │ syspathinsert(path=None)[source]
    │ │ │

    Prepend a directory to sys.path, defaults to path.

    │ │ │

    This is undone automatically when this object dies at the end of each │ │ │ test.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    path (str | PathLike[str] | None) -- The path.

    │ │ │ +

    path (str | PathLike[str] | None) -- The path.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ mkdir(name)[source]
    │ │ │

    Create a new (sub)directory.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    name (str | PathLike[str]) -- The name of the directory, relative to the pytester path.

    │ │ │ +

    name (str | PathLike[str]) -- The name of the directory, relative to the pytester path.

    │ │ │
    │ │ │
    Returns:
    │ │ │

    The created directory.

    │ │ │
    │ │ │
    Return type:
    │ │ │ -

    pathlib.Path

    │ │ │ +

    pathlib.Path

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ mkpydir(name)[source]
    │ │ │ @@ -1784,35 +1784,35 @@ │ │ │ │ │ │
    │ │ │
    │ │ │ copy_example(name=None)[source]
    │ │ │

    Copy file from project's directory into the testdir.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    name (str | None) -- The name of the file to copy.

    │ │ │ +

    name (str | None) -- The name of the file to copy.

    │ │ │
    │ │ │
    Returns:
    │ │ │

    Path to the copied directory (inside self.path).

    │ │ │
    │ │ │
    Return type:
    │ │ │ -

    pathlib.Path

    │ │ │ +

    pathlib.Path

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ getnode(config, arg)[source]
    │ │ │

    Get the collection node of a file.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • config (Config) -- A pytest config. │ │ │ See parseconfig() and parseconfigure() for creating it.

    • │ │ │ -
    • arg (str | PathLike[str]) -- Path to the file.

    • │ │ │ +
    • arg (str | PathLike[str]) -- Path to the file.

    • │ │ │
    │ │ │
    │ │ │
    Returns:
    │ │ │

    The node.

    │ │ │
    │ │ │
    Return type:
    │ │ │

    Collector | Item

    │ │ │ @@ -1824,15 +1824,15 @@ │ │ │
    │ │ │ getpathnode(path)[source]
    │ │ │

    Return the collection node of a file.

    │ │ │

    This is like getnode() but uses parseconfigure() to │ │ │ create the (configured) pytest Config instance.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    path (str | PathLike[str]) -- Path to the file.

    │ │ │ +

    path (str | PathLike[str]) -- Path to the file.

    │ │ │
    │ │ │
    Returns:
    │ │ │

    The node.

    │ │ │
    │ │ │
    Return type:
    │ │ │

    Collector | Item

    │ │ │
    │ │ │ @@ -1843,21 +1843,21 @@ │ │ │
    │ │ │ genitems(colitems)[source]
    │ │ │

    Generate all test items from a collection node.

    │ │ │

    This recurses into the collection node and returns a list of all the │ │ │ test items contained within.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    colitems (Sequence[Item | Collector]) -- The collection nodes.

    │ │ │ +

    colitems (Sequence[Item | Collector]) -- The collection nodes.

    │ │ │
    │ │ │
    Returns:
    │ │ │

    The collected items.

    │ │ │
    │ │ │
    Return type:
    │ │ │ -

    list[Item]

    │ │ │ +

    list[Item]

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ runitem(source)[source]
    │ │ │ @@ -1876,15 +1876,15 @@ │ │ │

    Run a test module in process using pytest.main().

    │ │ │

    This run writes "source" into a temporary file and runs │ │ │ pytest.main() on it, returning a HookRecorder instance │ │ │ for the result.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • source (str) -- The source code of the test module.

    • │ │ │ +
    • source (str) -- The source code of the test module.

    • │ │ │
    • cmdlineargs -- Any extra command line arguments to use.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │ @@ -1906,17 +1906,17 @@ │ │ │ the test process itself. This means it can return a │ │ │ HookRecorder instance which gives more detailed results │ │ │ from that run than can be done by matching stdout/stderr from │ │ │ runpytest().

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • args (str | PathLike[str]) -- Command line arguments to pass to pytest.main().

    • │ │ │ +
    • args (str | PathLike[str]) -- Command line arguments to pass to pytest.main().

    • │ │ │
    • plugins -- Extra plugin instances the pytest.main() instance should use.

    • │ │ │ -
    • no_reraise_ctrlc (bool) -- Typically we reraise keyboard interrupts from the child run. If │ │ │ +

    • no_reraise_ctrlc (bool) -- Typically we reraise keyboard interrupts from the child run. If │ │ │ True, the KeyboardInterrupt exception is captured.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │ @@ -1969,16 +1969,16 @@ │ │ │

    Return the test item for a test function.

    │ │ │

    Writes the source to a python file and runs pytest's collection on │ │ │ the resulting module, returning the test item for the requested │ │ │ function name.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • source (str | PathLike[str]) -- The module source.

    • │ │ │ -
    • funcname (str) -- The name of the test function for which to return a test item.

    • │ │ │ +
    • source (str | PathLike[str]) -- The module source.

    • │ │ │ +
    • funcname (str) -- The name of the test function for which to return a test item.

    • │ │ │
    │ │ │
    │ │ │
    Returns:
    │ │ │

    The test item.

    │ │ │
    │ │ │
    Return type:
    │ │ │

    Item

    │ │ │ @@ -2002,17 +2002,17 @@ │ │ │

    Return the module collection node for source.

    │ │ │

    Writes source to a file using makepyfile() and then │ │ │ runs the pytest collection on it, returning the collection node for the │ │ │ test module.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • source (str | PathLike[str]) -- The source code of the module to collect.

    • │ │ │ +
    • source (str | PathLike[str]) -- The source code of the module to collect.

    • │ │ │
    • configargs -- Any extra arguments to pass to parseconfigure().

    • │ │ │ -
    • withinit (bool) -- Whether to also write an __init__.py file to the same │ │ │ +

    • withinit (bool) -- Whether to also write an __init__.py file to the same │ │ │ directory to ensure it is a package.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │ @@ -2021,56 +2021,56 @@ │ │ │

    Return the collection node for name from the module collection.

    │ │ │

    Searches a module collection node for a collection node matching the │ │ │ given name.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • modcol (Collector) -- A module collection node; see getmodulecol().

    • │ │ │ -
    • name (str) -- The name of the node to return.

    • │ │ │ +
    • name (str) -- The name of the node to return.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ popen(cmdargs, stdout=-1, stderr=-1, stdin=NotSetType.token, **kw)[source]
    │ │ │ -

    Invoke subprocess.Popen.

    │ │ │ -

    Calls subprocess.Popen making sure the current working │ │ │ +

    Invoke subprocess.Popen.

    │ │ │ +

    Calls subprocess.Popen making sure the current working │ │ │ directory is in PYTHONPATH.

    │ │ │

    You probably want to use run() instead.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ run(*cmdargs, timeout=None, stdin=NotSetType.token)[source]
    │ │ │

    Run a command with arguments.

    │ │ │ -

    Run a process using subprocess.Popen saving the stdout and │ │ │ +

    Run a process using subprocess.Popen saving the stdout and │ │ │ stderr.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • cmdargs (str | PathLike[str]) -- The sequence of arguments to pass to subprocess.Popen, │ │ │ -with path-like objects being converted to str │ │ │ +

    • cmdargs (str | PathLike[str]) -- The sequence of arguments to pass to subprocess.Popen, │ │ │ +with path-like objects being converted to str │ │ │ automatically.

    • │ │ │ -
    • timeout (float | None) -- The period in seconds after which to timeout and raise │ │ │ +

    • timeout (float | None) -- The period in seconds after which to timeout and raise │ │ │ Pytester.TimeoutExpired.

    • │ │ │ -
    • stdin (_pytest.compat.NotSetType | bytes | IO[Any] | int) --

      Optional standard input.

      │ │ │ +
    • stdin (_pytest.compat.NotSetType | bytes | IO[Any] | int) --

      Optional standard input.

      │ │ │
        │ │ │
      • If it is CLOSE_STDIN (Default), then this method calls │ │ │ -subprocess.Popen with stdin=subprocess.PIPE, and │ │ │ +subprocess.Popen with stdin=subprocess.PIPE, and │ │ │ the standard input is closed immediately after the new command is │ │ │ started.

      • │ │ │ -
      • If it is of type bytes, these bytes are sent to the │ │ │ +

      • If it is of type bytes, these bytes are sent to the │ │ │ standard input of the command.

      • │ │ │ -
      • Otherwise, it is passed through to subprocess.Popen. │ │ │ +

      • Otherwise, it is passed through to subprocess.Popen. │ │ │ For further information in this case, consult the document of the │ │ │ -stdin parameter in subprocess.Popen.

      • │ │ │ +stdin parameter in subprocess.Popen.

        │ │ │
      │ │ │

    • │ │ │
    │ │ │
    │ │ │
    Returns:
    │ │ │

    The result.

    │ │ │
    │ │ │ @@ -2104,16 +2104,16 @@ │ │ │ -p command line option. Additionally --basetemp is used to put │ │ │ any temporary files and directories in a numbered directory prefixed │ │ │ with "runpytest-" to not conflict with the normal numbered pytest │ │ │ location for temporary files and directories.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • args (str | PathLike[str]) -- The sequence of arguments to pass to the pytest subprocess.

    • │ │ │ -
    • timeout (float | None) -- The period in seconds after which to timeout and raise │ │ │ +

    • args (str | PathLike[str]) -- The sequence of arguments to pass to the pytest subprocess.

    • │ │ │ +
    • timeout (float | None) -- The period in seconds after which to timeout and raise │ │ │ Pytester.TimeoutExpired.

    • │ │ │
    │ │ │
    │ │ │
    Returns:
    │ │ │

    The result.

    │ │ │
    │ │ │
    Return type:
    │ │ │ @@ -2148,15 +2148,15 @@ │ │ │
    │ │ │ final class RunResult[source]
    │ │ │

    The result of running a command from Pytester.

    │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ -ret: int | ExitCode
    │ │ │ +ret: int | ExitCode │ │ │

    The return value.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ outlines
    │ │ │

    List of lines captured from stdout.

    │ │ │ @@ -2247,23 +2247,23 @@ │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ fnmatch_lines_random(lines2)[source]
    │ │ │ -

    Check lines exist in the output in any order (using python:fnmatch.fnmatch()).

    │ │ │ +

    Check lines exist in the output in any order (using fnmatch.fnmatch()).

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ re_match_lines_random(lines2)[source]
    │ │ │ -

    Check lines exist in the output in any order (using python:re.match()).

    │ │ │ +

    Check lines exist in the output in any order (using re.match()).

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ get_lines_after(fnline)[source]
    │ │ │ @@ -2272,63 +2272,63 @@ │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ fnmatch_lines(lines2, *, consecutive=False)[source]
    │ │ │ -

    Check lines exist in the output (using python:fnmatch.fnmatch()).

    │ │ │ +

    Check lines exist in the output (using fnmatch.fnmatch()).

    │ │ │

    The argument is a list of lines which have to match and can use glob │ │ │ wildcards. If they do not match a pytest.fail() is called. The │ │ │ matches and non-matches are also shown as part of the error message.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • lines2 (Sequence[str]) -- String patterns to match.

    • │ │ │ -
    • consecutive (bool) -- Match lines consecutively?

    • │ │ │ +
    • lines2 (Sequence[str]) -- String patterns to match.

    • │ │ │ +
    • consecutive (bool) -- Match lines consecutively?

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ re_match_lines(lines2, *, consecutive=False)[source]
    │ │ │ -

    Check lines exist in the output (using python:re.match()).

    │ │ │ +

    Check lines exist in the output (using re.match()).

    │ │ │

    The argument is a list of lines which have to match using re.match. │ │ │ If they do not match a pytest.fail() is called.

    │ │ │

    The matches and non-matches are also shown as part of the error message.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • lines2 (Sequence[str]) -- string patterns to match.

    • │ │ │ -
    • consecutive (bool) -- match lines consecutively?

    • │ │ │ +
    • lines2 (Sequence[str]) -- string patterns to match.

    • │ │ │ +
    • consecutive (bool) -- match lines consecutively?

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ no_fnmatch_line(pat)[source]
    │ │ │

    Ensure captured lines do not match the given pattern, using fnmatch.fnmatch.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    pat (str) -- The pattern to match lines.

    │ │ │ +

    pat (str) -- The pattern to match lines.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ no_re_match_line(pat)[source]
    │ │ │

    Ensure captured lines do not match the given pattern, using re.match.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    pat (str) -- The regular expression to match lines.

    │ │ │ +

    pat (str) -- The regular expression to match lines.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ str()[source]
    │ │ │ @@ -2449,15 +2449,15 @@ │ │ │

    DeprecationWarning and PendingDeprecationWarning are treated │ │ │ differently; see Ensuring code triggers a deprecation warning.

    │ │ │ │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ -property list: list[WarningMessage]
    │ │ │ +property list: list[WarningMessage] │ │ │

    The list of recorded warnings.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ __getitem__(i)[source]
    │ │ │

    Get a recorded warning by index.

    │ │ │ @@ -2512,27 +2512,27 @@ │ │ │

    The type of the request fixture.

    │ │ │

    A request object gives access to the requesting test context and has a │ │ │ param attribute in case the fixture is parametrized.

    │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ -fixturename: Final
    │ │ │ +fixturename: Final │ │ │

    Fixture for which this request is being performed.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property scope: Literal['session', 'package', 'module', 'class', 'function']
    │ │ │ +property scope: Literal['session', 'package', 'module', 'class', 'function'] │ │ │

    Scope string, one of "function", "class", "module", "package", "session".

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property fixturenames: list[str]
    │ │ │ +property fixturenames: list[str] │ │ │

    Names of all active fixtures in this request.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ abstract property node
    │ │ │

    Underlying collection node (depends on current request scope).

    │ │ │ @@ -2572,15 +2572,15 @@ │ │ │
    │ │ │ property path: Path
    │ │ │

    Path where the test function was collected.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property keywords: MutableMapping[str, Any]
    │ │ │ +property keywords: MutableMapping[str, Any] │ │ │

    Keywords/markers dictionary for the underlying node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ property session: Session
    │ │ │

    Pytest session object.

    │ │ │ @@ -2599,26 +2599,26 @@ │ │ │
    │ │ │ applymarker(marker)[source]
    │ │ │

    Apply a marker to a single test function invocation.

    │ │ │

    This method is useful if you don't want to have a keyword/marker │ │ │ on all function invocations.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    marker (str | MarkDecorator) -- An object created by a call to pytest.mark.NAME(...).

    │ │ │ +

    marker (str | MarkDecorator) -- An object created by a call to pytest.mark.NAME(...).

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ raiseerror(msg)[source]
    │ │ │

    Raise a FixtureLookupError exception.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    msg (str | None) -- An optional custom error message.

    │ │ │ +

    msg (str | None) -- An optional custom error message.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ getfixturevalue(argname)[source]
    │ │ │ @@ -2632,15 +2632,15 @@ │ │ │
    │ │ │

    Changed in version 9.1: Calling request.getfixturevalue() during teardown to request a │ │ │ fixture that was not already requested │ │ │ is deprecated.

    │ │ │
    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    argname (str) -- The fixture name.

    │ │ │ +

    argname (str) -- The fixture name.

    │ │ │
    │ │ │
    Raises:
    │ │ │

    pytest.FixtureLookupError -- If the given fixture could not be found.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │ @@ -2993,16 +2993,16 @@ │ │ │
    │ │ │
    │ │ │ mktemp(basename, numbered=True)[source]
    │ │ │

    Create a new temporary directory managed by the factory.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • basename (str) -- Directory base name, must be a relative path.

    • │ │ │ -
    • numbered (bool) -- If True, ensure the directory is unique by adding a numbered │ │ │ +

    • basename (str) -- Directory base name, must be a relative path.

    • │ │ │ +
    • numbered (bool) -- If True, ensure the directory is unique by adding a numbered │ │ │ suffix greater than any existing one: basename="foo-" and numbered=True │ │ │ means that this function will create directories named "foo-0", │ │ │ "foo-1", "foo-2" and so on.

    • │ │ │
    │ │ │
    │ │ │
    Returns:
    │ │ │

    The path to the new directory.

    │ │ │ @@ -3087,15 +3087,15 @@ │ │ │
    │ │ │ pytest_load_initial_conftests(early_config, parser, args)[source]
    │ │ │

    Called to implement the loading of initial conftest files ahead of command line option parsing.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • early_config (Config) -- The pytest config object.

    • │ │ │ -
    • args (list[str]) -- Arguments passed on the command line.

    • │ │ │ +
    • args (list[str]) -- Arguments passed on the command line.

    • │ │ │
    • parser (Parser) -- To add command line options.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    This hook is not called for conftest files.

    │ │ │ @@ -3113,15 +3113,15 @@ │ │ │ plugins arg when using pytest.main to perform an in-process │ │ │ test run.

    │ │ │ │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • pluginmanager (PytestPluginManager) -- The pytest plugin manager.

    • │ │ │ -
    • args (list[str]) -- List of arguments passed on the command line.

    • │ │ │ +
    • args (list[str]) -- List of arguments passed on the command line.

    • │ │ │
    │ │ │
    │ │ │
    Returns:
    │ │ │

    A pytest config object.

    │ │ │
    │ │ │
    Return type:
    │ │ │

    Config | None

    │ │ │ @@ -3144,15 +3144,15 @@ │ │ │
    Parameters:
    │ │ │

    config (Config) -- The pytest config object.

    │ │ │
    │ │ │
    Returns:
    │ │ │

    The exit code.

    │ │ │
    │ │ │
    Return type:
    │ │ │ -

    ExitCode | int | None

    │ │ │ +

    ExitCode | int | None

    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    This hook is only called for initial conftests.

    │ │ │
    │ │ │
    │ │ │ @@ -3277,15 +3277,15 @@ │ │ │
    │ │ │ pytest_sessionfinish(session, exitstatus)[source]
    │ │ │

    Called after whole test run finished, right before returning the exit status to the system.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • session (Session) -- The pytest session object.

    • │ │ │ -
    • exitstatus (int | ExitCode) -- The status which pytest will return to the system.

    • │ │ │ +
    • exitstatus (int | ExitCode) -- The status which pytest will return to the system.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest file can implement this hook.

    │ │ │
    │ │ │ @@ -3295,15 +3295,15 @@ │ │ │
    │ │ │ pytest_plugin_registered(plugin, plugin_name, manager)[source]
    │ │ │

    A new pytest plugin got registered.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • plugin (_PluggyPlugin) -- The plugin module or instance.

    • │ │ │ -
    • plugin_name (str) -- The name by which the plugin is registered.

    • │ │ │ +
    • plugin_name (str) -- The name by which the plugin is registered.

    • │ │ │
    • manager (PytestPluginManager) -- The pytest plugin manager.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Note

    │ │ │

    This hook is incompatible with hook wrappers.

    │ │ │ @@ -3384,21 +3384,21 @@ │ │ │ without giving a chance for other plugins to ignore this path.

    │ │ │

    This hook is consulted for all files and directories prior to calling │ │ │ more specific hooks.

    │ │ │

    Stops at first non-None result, see firstresult: stop at first non-None result.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • collection_path (pathlib.Path) -- The path to analyze.

    • │ │ │ +
    • collection_path (pathlib.Path) -- The path to analyze.

    • │ │ │
    • config (Config) -- The pytest config object.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ -

    Changed in version 7.0.0: The collection_path parameter was added as a pathlib.Path │ │ │ +

    Changed in version 7.0.0: The collection_path parameter was added as a pathlib.Path │ │ │ equivalent of the path parameter. The path parameter │ │ │ has been deprecated and removed in pytest 9.0.0.

    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest file can implement this hook. For a given collection path, only │ │ │ conftest files in parent directories of the collection path are consulted │ │ │ @@ -3417,15 +3417,15 @@ │ │ │

    │ │ │

    For best results, the returned collector should be a subclass of │ │ │ Directory, but this is not required.

    │ │ │

    The new node needs to have the specified parent as a parent.

    │ │ │

    Stops at first non-None result, see firstresult: stop at first non-None result.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    path (pathlib.Path) -- The path to analyze.

    │ │ │ +

    path (pathlib.Path) -- The path to analyze.

    │ │ │
    │ │ │
    │ │ │

    See Using a custom directory collector for a simple example of use of this │ │ │ hook.

    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest file can implement this hook. For a given collection path, only │ │ │ @@ -3440,19 +3440,19 @@ │ │ │ pytest_collect_file(file_path, parent)[source] │ │ │

    Create a Collector for the given path, or None if not relevant.

    │ │ │

    For best results, the returned collector should be a subclass of │ │ │ File, but this is not required.

    │ │ │

    The new node needs to have the specified parent as a parent.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    file_path (pathlib.Path) -- The path to analyze.

    │ │ │ +

    file_path (pathlib.Path) -- The path to analyze.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ -

    Changed in version 7.0.0: The file_path parameter was added as a pathlib.Path │ │ │ +

    Changed in version 7.0.0: The file_path parameter was added as a pathlib.Path │ │ │ equivalent of the path parameter. The path parameter │ │ │ has been deprecated and removed in pytest 9.0.0.

    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest file can implement this hook. For a given file path, only │ │ │ conftest files in parent directories of the file path are consulted.

    │ │ │ @@ -3465,19 +3465,19 @@ │ │ │

    Return a pytest.Module collector or None for the given path.

    │ │ │

    This hook will be called for each matching test module path. │ │ │ The pytest_collect_file hook needs to be used if you want to │ │ │ create test modules for files that do not match as a test module.

    │ │ │

    Stops at first non-None result, see firstresult: stop at first non-None result.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    module_path (pathlib.Path) -- The path of the module to collect.

    │ │ │ +

    module_path (pathlib.Path) -- The path of the module to collect.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ -

    Changed in version 7.0.0: The module_path parameter was added as a pathlib.Path │ │ │ +

    Changed in version 7.0.0: The module_path parameter was added as a pathlib.Path │ │ │ equivalent of the path parameter. The path parameter has been │ │ │ deprecated in favor of module_path and removed in pytest 9.0.0.

    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest file can implement this hook. For a given parent collector, │ │ │ only conftest files in the collector's directory and its parent directories │ │ │ @@ -3492,23 +3492,23 @@ │ │ │ pytest_pycollect_makeitem(collector, name, obj)[source] │ │ │

    Return a custom item/collector for a Python object in a module, or None.

    │ │ │

    Stops at first non-None result, see firstresult: stop at first non-None result.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • collector (Module | Class) -- The module/class collector.

    • │ │ │ -
    • name (str) -- The name of the object in the module/class.

    • │ │ │ -
    • obj (object) -- The object.

    • │ │ │ +
    • name (str) -- The name of the object in the module/class.

    • │ │ │ +
    • obj (object) -- The object.

    • │ │ │
    │ │ │
    │ │ │
    Returns:
    │ │ │

    The created items/collectors.

    │ │ │
    │ │ │
    Return type:
    │ │ │ -

    None | Item | Collector | list[Item | Collector]

    │ │ │ +

    None | Item | Collector | list[Item | Collector]

    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest file can implement this hook. For a given collector, only │ │ │ conftest files in the collector's directory and its parent directories │ │ │ are consulted.

    │ │ │ @@ -3540,16 +3540,16 @@ │ │ │ doesn't know about val.

    │ │ │

    The parameter name is available as argname, if required.

    │ │ │

    Stops at first non-None result, see firstresult: stop at first non-None result.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • config (Config) -- The pytest config object.

    • │ │ │ -
    • val (object) -- The parametrized value.

    • │ │ │ -
    • argname (str) -- The automatic parameter name produced by pytest.

    • │ │ │ +
    • val (object) -- The parametrized value.

    • │ │ │ +
    • argname (str) -- The automatic parameter name produced by pytest.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest file can implement this hook.

    │ │ │
    │ │ │ @@ -3572,15 +3572,15 @@ │ │ │
    Parameters:
    │ │ │

    config (Config) -- The pytest config object.

    │ │ │
    │ │ │
    Returns:
    │ │ │

    A dictionary of additional globals to add.

    │ │ │
    │ │ │
    Return type:
    │ │ │ -

    dict[str, Any]

    │ │ │ +

    dict[str, Any]

    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest file can implement this hook. For a given item, only conftest │ │ │ files in parent directories of the item are consulted.

    │ │ │
    │ │ │ @@ -3598,15 +3598,15 @@ │ │ │ with the deselected items to properly notify other plugins, │ │ │ e.g. with config.hook.pytest_deselected(items=deselected_items).

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • session (Session) -- The pytest session object.

    • │ │ │
    • config (Config) -- The pytest config object.

    • │ │ │ -
    • items (list[Item]) -- List of item objects.

    • │ │ │ +
    • items (list[Item]) -- List of item objects.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest plugin can implement this hook.

    │ │ │
    │ │ │ @@ -3719,16 +3719,16 @@ │ │ │
    │ │ │ pytest_runtest_logstart(nodeid, location)[source]
    │ │ │

    Called at the start of running the runtest protocol for a single item.

    │ │ │

    See pytest_runtest_protocol for a description of the runtest protocol.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • nodeid (str) -- Full node ID of the item.

    • │ │ │ -
    • location (tuple[str, int | None, str]) -- A tuple of (filename, lineno, testname) │ │ │ +

    • nodeid (str) -- Full node ID of the item.

    • │ │ │ +
    • location (tuple[str, int | None, str]) -- A tuple of (filename, lineno, testname) │ │ │ where filename is a file path relative to config.rootpath │ │ │ and lineno is 0-based.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │ @@ -3741,16 +3741,16 @@ │ │ │
    │ │ │ pytest_runtest_logfinish(nodeid, location)[source]
    │ │ │

    Called at the end of running the runtest protocol for a single item.

    │ │ │

    See pytest_runtest_protocol for a description of the runtest protocol.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • nodeid (str) -- Full node ID of the item.

    • │ │ │ -
    • location (tuple[str, int | None, str]) -- A tuple of (filename, lineno, testname) │ │ │ +

    • nodeid (str) -- Full node ID of the item.

    • │ │ │ +
    • location (tuple[str, int | None, str]) -- A tuple of (filename, lineno, testname) │ │ │ where filename is a file path relative to config.rootpath │ │ │ and lineno is 0-based.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │ @@ -3966,27 +3966,27 @@ │ │ │
    │ │ │ pytest_report_header(config, start_path)[source]
    │ │ │

    Return a string or list of strings to be displayed as header info for terminal reporting.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • config (Config) -- The pytest config object.

    • │ │ │ -
    • start_path (pathlib.Path) -- The starting dir.

    • │ │ │ +
    • start_path (pathlib.Path) -- The starting dir.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Note

    │ │ │

    Lines returned by a plugin are displayed before those of plugins which │ │ │ ran before it. │ │ │ If you want to have your line(s) displayed first, use │ │ │ trylast=True.

    │ │ │
    │ │ │
    │ │ │ -

    Changed in version 7.0.0: The start_path parameter was added as a pathlib.Path │ │ │ +

    Changed in version 7.0.0: The start_path parameter was added as a pathlib.Path │ │ │ equivalent of the startdir parameter. The startdir parameter │ │ │ has been deprecated and removed in pytest 9.0.0.

    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    This hook is only called for initial conftests.

    │ │ │
    │ │ │ @@ -4001,28 +4001,28 @@ │ │ │
    │ │ │

    Added in version 3.2.

    │ │ │
    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • config (Config) -- The pytest config object.

    • │ │ │ -
    • start_path (pathlib.Path) -- The starting dir.

    • │ │ │ +
    • start_path (pathlib.Path) -- The starting dir.

    • │ │ │
    • items (Sequence[Item]) -- List of pytest items that are going to be executed; this list should not be modified.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Note

    │ │ │

    Lines returned by a plugin are displayed before those of plugins which │ │ │ ran before it. │ │ │ If you want to have your line(s) displayed first, use │ │ │ trylast=True.

    │ │ │
    │ │ │
    │ │ │ -

    Changed in version 7.0.0: The start_path parameter was added as a pathlib.Path │ │ │ +

    Changed in version 7.0.0: The start_path parameter was added as a pathlib.Path │ │ │ equivalent of the startdir parameter. The startdir parameter │ │ │ has been deprecated and removed in pytest 9.0.0.

    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest plugin can implement this hook.

    │ │ │
    │ │ │ @@ -4049,15 +4049,15 @@ │ │ │
  • config (Config) -- The pytest config object.

  • │ │ │ │ │ │
    │ │ │
    Returns:
    │ │ │

    The test status.

    │ │ │
    │ │ │
    Return type:
    │ │ │ -

    TestShortLogReport | tuple[str, str, str | tuple[str, Mapping[str, bool]]]

    │ │ │ +

    TestShortLogReport | tuple[str, str, str | tuple[str, Mapping[str, bool]]]

    │ │ │
    │ │ │
    │ │ │

    Stops at first non-None result, see firstresult: stop at first non-None result.

    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest plugin can implement this hook.

    │ │ │
    │ │ │ @@ -4133,15 +4133,15 @@ │ │ │
  • request (SubRequest) -- The fixture request object.

  • │ │ │ │ │ │
    │ │ │
    Returns:
    │ │ │

    The return value of the call to the fixture function.

    │ │ │
    │ │ │
    Return type:
    │ │ │ -

    object | None

    │ │ │ +

    object | None

    │ │ │
    │ │ │
    │ │ │

    Stops at first non-None result, see firstresult: stop at first non-None result.

    │ │ │
    │ │ │

    Note

    │ │ │

    If the fixture function returns None, other implementations of │ │ │ this hook function will continue to be called, according to the │ │ │ @@ -4180,26 +4180,26 @@ │ │ │

    │ │ │
    │ │ │ pytest_warning_recorded(warning_message, when, nodeid, location)[source]
    │ │ │

    Process a warning captured by the internal pytest warnings plugin.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • warning_message (warnings.WarningMessage) -- The captured warning. This is the same object produced by warnings.catch_warnings, │ │ │ -and contains the same attributes as the parameters of warnings.showwarning().

    • │ │ │ +
    • warning_message (warnings.WarningMessage) -- The captured warning. This is the same object produced by warnings.catch_warnings, │ │ │ +and contains the same attributes as the parameters of warnings.showwarning().

    • │ │ │
    • when (Literal['config', 'collect', 'runtest']) --

      Indicates when the warning was captured. Possible values:

      │ │ │
        │ │ │
      • "config": during pytest configuration/initialization stage.

      • │ │ │
      • "collect": during test collection.

      • │ │ │
      • "runtest": during test execution.

      • │ │ │
      │ │ │

    • │ │ │ -
    • nodeid (str) -- Full id of the item. Empty string for warnings that are not specific to │ │ │ +

    • nodeid (str) -- Full id of the item. Empty string for warnings that are not specific to │ │ │ a particular node.

    • │ │ │ -
    • location (tuple[str, int, str] | None) -- When available, holds information about the execution context of the captured │ │ │ +

    • location (tuple[str, int, str] | None) -- When available, holds information about the execution context of the captured │ │ │ warning (filename, linenumber, function). function evaluates to <module> │ │ │ when the execution context is at the module level.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Added in version 6.0.

    │ │ │ @@ -4237,17 +4237,17 @@ │ │ │ of strings. The strings will be joined by newlines but any newlines │ │ │ in a string will be escaped. Note that all but the first line will │ │ │ be indented slightly, the intention is for the first line to be a summary.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • config (Config) -- The pytest config object.

    • │ │ │ -
    • op (str) -- The operator, e.g. "==", "!=", "not in".

    • │ │ │ -
    • left (object) -- The left operand.

    • │ │ │ -
    • right (object) -- The right operand.

    • │ │ │ +
    • op (str) -- The operator, e.g. "==", "!=", "not in".

    • │ │ │ +
    • left (object) -- The left operand.

    • │ │ │ +
    • right (object) -- The right operand.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest file can implement this hook. For a given item, only conftest │ │ │ files in the item's directory and its parent directories are consulted.

    │ │ │ @@ -4283,17 +4283,17 @@ │ │ │
    │ │ │

    You need to clean the .pyc files in your project directory and interpreter libraries │ │ │ when enabling this option, as assertions will require to be re-written.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • item (Item) -- pytest item object of current test.

    • │ │ │ -
    • lineno (int) -- Line number of the assert statement.

    • │ │ │ -
    • orig (str) -- String with the original assertion.

    • │ │ │ -
    • expl (str) -- String with the assert explanation.

    • │ │ │ +
    • lineno (int) -- Line number of the assert statement.

    • │ │ │ +
    • orig (str) -- String with the original assertion.

    • │ │ │ +
    • expl (str) -- String with the assert explanation.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest file can implement this hook. For a given item, only conftest │ │ │ files in the item's directory and its parent directories are consulted.

    │ │ │ @@ -4311,15 +4311,15 @@ │ │ │

    Called for internal errors.

    │ │ │

    Return True to suppress the fallback handling of printing an │ │ │ INTERNALERROR message directly to sys.stderr.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • excrepr (ExceptionRepr) -- The exception repr object.

    • │ │ │ -
    • excinfo (ExceptionInfo[BaseException]) -- The exception info.

    • │ │ │ +
    • excinfo (ExceptionInfo[BaseException]) -- The exception info.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest plugin can implement this hook.

    │ │ │
    │ │ │ @@ -4327,15 +4327,15 @@ │ │ │ │ │ │
    │ │ │
    │ │ │ pytest_keyboard_interrupt(excinfo)[source]
    │ │ │

    Called for keyboard interrupt.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    excinfo (ExceptionInfo[KeyboardInterrupt | Exit]) -- The exception info.

    │ │ │ +

    excinfo (ExceptionInfo[KeyboardInterrupt | Exit]) -- The exception info.

    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest plugin can implement this hook.

    │ │ │
    │ │ │
    │ │ │ @@ -4373,15 +4373,15 @@ │ │ │

    Called upon pdb.set_trace().

    │ │ │

    Can be used by plugins to take special action just before the python │ │ │ debugger enters interactive mode.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • config (Config) -- The pytest config object.

    • │ │ │ -
    • pdb (pdb.Pdb) -- The Pdb instance.

    • │ │ │ +
    • pdb (pdb.Pdb) -- The Pdb instance.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest plugin can implement this hook.

    │ │ │
    │ │ │ @@ -4393,15 +4393,15 @@ │ │ │

    Called when leaving pdb (e.g. with continue after pdb.set_trace()).

    │ │ │

    Can be used by plugins to take special action just after the python │ │ │ debugger leaves interactive mode.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • config (Config) -- The pytest config object.

    • │ │ │ -
    • pdb (pdb.Pdb) -- The Pdb instance.

    • │ │ │ +
    • pdb (pdb.Pdb) -- The Pdb instance.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Use in conftest plugins

    │ │ │

    Any conftest plugin can implement this hook.

    │ │ │
    │ │ │ @@ -4414,15 +4414,15 @@ │ │ │

    These are the collector and item classes (collectively called "nodes") which │ │ │ make up the collection tree.

    │ │ │
    │ │ │

    Node

    │ │ │
    │ │ │
    │ │ │ class Node[source]
    │ │ │ -

    Bases: ABC

    │ │ │ +

    Bases: ABC

    │ │ │

    Base class of Collector and Item, the components of │ │ │ the test collection tree.

    │ │ │

    Collector's are the internal nodes of the tree, and Item's are the │ │ │ leaf nodes.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ @@ -4432,15 +4432,15 @@ │ │ │ for methods not migrated to pathlib.Path yet, such as │ │ │ Item.reportinfo. Will be deprecated in │ │ │ a future release, prefer using path instead.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -name: str
    │ │ │ +name: str │ │ │

    A unique name within the scope of the parent node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ parent
    │ │ │

    The parent collector node.

    │ │ │ @@ -4456,33 +4456,33 @@ │ │ │
    │ │ │ session: Session
    │ │ │

    The pytest session this node is part of.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -path: pathlib.Path
    │ │ │ +path: pathlib.Path │ │ │

    Filesystem path where this node was collected from.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -keywords: MutableMapping[str, Any]
    │ │ │ +keywords: MutableMapping[str, Any] │ │ │

    Keywords/markers collected from all scopes.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -own_markers: list[Mark]
    │ │ │ +own_markers: list[Mark] │ │ │

    The marker objects belonging to this node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -extra_keyword_matches: set[str]
    │ │ │ +extra_keyword_matches: set[str] │ │ │

    Allow adding of extra keywords to use for matching.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ stash: Stash
    │ │ │

    A place where plugins can store information on the node for their │ │ │ @@ -4513,34 +4513,34 @@ │ │ │

    │ │ │
    │ │ │ warn(warning)[source]
    │ │ │

    Issue a warning for this Node.

    │ │ │

    Warnings will be displayed after the test session, unless explicitly suppressed.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    warning (Warning) -- The warning instance to issue.

    │ │ │ +

    warning (Warning) -- The warning instance to issue.

    │ │ │
    │ │ │
    Raises:
    │ │ │ -

    ValueError -- If warning instance is not a subclass of Warning.

    │ │ │ +

    ValueError -- If warning instance is not a subclass of Warning.

    │ │ │
    │ │ │
    │ │ │

    Example usage:

    │ │ │
    node.warn(PytestWarning("some message"))
    │ │ │  node.warn(UserWarning("some message"))
    │ │ │  
    │ │ │
    │ │ │
    │ │ │ -

    Changed in version 6.2: Any subclass of Warning is now accepted, rather than only │ │ │ +

    Changed in version 6.2: Any subclass of Warning is now accepted, rather than only │ │ │ PytestWarning subclasses.

    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property nodeid: str
    │ │ │ +property nodeid: str │ │ │

    A ::-separated string denoting its collection tree address.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ iter_parents()[source]
    │ │ │

    Iterate over all parent collectors starting from and including self │ │ │ @@ -4564,60 +4564,60 @@ │ │ │

    │ │ │
    │ │ │ add_marker(marker, append=True)[source]
    │ │ │

    Dynamically add a marker object to the node.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • marker (str | MarkDecorator) -- The marker.

    • │ │ │ -
    • append (bool) -- Whether to append the marker, or prepend it.

    • │ │ │ +
    • marker (str | MarkDecorator) -- The marker.

    • │ │ │ +
    • append (bool) -- Whether to append the marker, or prepend it.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ iter_markers(name=None)[source]
    │ │ │

    Iterate over all markers of the node.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    name (str | None) -- If given, filter the results by the name attribute.

    │ │ │ +

    name (str | None) -- If given, filter the results by the name attribute.

    │ │ │
    │ │ │
    Returns:
    │ │ │

    An iterator of the markers of the node.

    │ │ │
    │ │ │
    Return type:
    │ │ │ -

    Iterator[Mark]

    │ │ │ +

    Iterator[Mark]

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ iter_markers_with_node(name=None)[source]
    │ │ │

    Iterate over all markers of the node.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    name (str | None) -- If given, filter the results by the name attribute.

    │ │ │ +

    name (str | None) -- If given, filter the results by the name attribute.

    │ │ │
    │ │ │
    Returns:
    │ │ │

    An iterator of (node, mark) tuples.

    │ │ │
    │ │ │
    Return type:
    │ │ │ -

    Iterator[tuple[Node, Mark]]

    │ │ │ +

    Iterator[tuple[Node, Mark]]

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -get_closest_marker(name: str) Mark | None[source]
    │ │ │ +get_closest_marker(name: str) Mark | None[source] │ │ │
    │ │ │ -get_closest_marker(name: str, default: Mark) Mark
    │ │ │ +get_closest_marker(name: str, default: Mark) Mark │ │ │

    Return the first marker matching the name, from closest (for │ │ │ example function) to farther level (for example module level).

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • default -- Fallback return value if no marker was found.

    • │ │ │
    • name -- Name to filter by.

    • │ │ │ @@ -4648,15 +4648,15 @@ │ │ │
      │ │ │
      │ │ │ getparent(cls)[source]
      │ │ │

      Get the closest parent node (including self) which is an instance of │ │ │ the given class.

      │ │ │
      │ │ │
      Parameters:
      │ │ │ -

      cls (type[_NodeType]) -- The node class to search for.

      │ │ │ +

      cls (type[_NodeType]) -- The node class to search for.

      │ │ │
      │ │ │
      Returns:
      │ │ │

      The node, if found.

      │ │ │
      │ │ │
      Return type:
      │ │ │

      _NodeType | None

      │ │ │
      │ │ │ @@ -4669,37 +4669,37 @@ │ │ │

      Return a representation of a collection or test failure.

      │ │ │
      │ │ │

      See also

      │ │ │

      Working with non-python tests

      │ │ │
      │ │ │
      │ │ │
      Parameters:
      │ │ │ -

      excinfo (ExceptionInfo[BaseException]) -- Exception information for the failure.

      │ │ │ +

      excinfo (ExceptionInfo[BaseException]) -- Exception information for the failure.

      │ │ │
      │ │ │
      │ │ │
      │ │ │ │ │ │
      │ │ │ │ │ │
    │ │ │
    │ │ │

    Collector

    │ │ │
    │ │ │
    │ │ │ class Collector[source]
    │ │ │ -

    Bases: Node, ABC

    │ │ │ +

    Bases: Node, ABC

    │ │ │

    Base class of all collectors.

    │ │ │

    Collector create children through collect() and thus iteratively build │ │ │ the collection tree.

    │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ exception CollectError[source]
    │ │ │ -

    Bases: Exception

    │ │ │ +

    Bases: Exception

    │ │ │

    An error during collection, contains a custom message.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ abstract collect()[source]
    │ │ │

    Collect children (items and collectors) for this collector.

    │ │ │ @@ -4709,40 +4709,40 @@ │ │ │ │ │ │
    │ │ │
    │ │ │ repr_failure(excinfo)[source]
    │ │ │

    Return a representation of a collection failure.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    excinfo (ExceptionInfo[BaseException]) -- Exception information for the failure.

    │ │ │ +

    excinfo (ExceptionInfo[BaseException]) -- Exception information for the failure.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ config: Config
    │ │ │

    The pytest config object.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -name: str
    │ │ │ +name: str │ │ │

    A unique name within the scope of the parent node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ parent
    │ │ │

    The parent collector node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -path: pathlib.Path
    │ │ │ +path: pathlib.Path │ │ │

    Filesystem path where this node was collected from.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ session: Session
    │ │ │

    The pytest session this node is part of.

    │ │ │ @@ -4752,47 +4752,47 @@ │ │ │ │ │ │
    │ │ │
    │ │ │

    Item

    │ │ │
    │ │ │
    │ │ │ class Item[source]
    │ │ │ -

    Bases: Node, ABC

    │ │ │ +

    Bases: Node, ABC

    │ │ │

    Base class of all test invocation items.

    │ │ │

    Note that for a single function there might be multiple test invocation items.

    │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ -user_properties: list[tuple[str, object]]
    │ │ │ +user_properties: list[tuple[str, object]] │ │ │

    A list of tuples (name, value) that holds user defined properties │ │ │ for this test.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ config: Config
    │ │ │

    The pytest config object.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -name: str
    │ │ │ +name: str │ │ │

    A unique name within the scope of the parent node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ parent
    │ │ │

    The parent collector node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -path: pathlib.Path
    │ │ │ +path: pathlib.Path │ │ │

    Filesystem path where this node was collected from.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ session: Session
    │ │ │

    The pytest session this node is part of.

    │ │ │ @@ -4818,18 +4818,18 @@ │ │ │ stdout and stderr captured output:

    │ │ │
    item.add_report_section("call", "stdout", "report section contents")
    │ │ │  
    │ │ │
    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • when (str) -- One of the possible capture states, "setup", "call", "teardown".

    • │ │ │ -
    • key (str) -- Name of the section, can be customized at will. Pytest uses "stdout" and │ │ │ +

    • when (str) -- One of the possible capture states, "setup", "call", "teardown".

    • │ │ │ +
    • key (str) -- Name of the section, can be customized at will. Pytest uses "stdout" and │ │ │ "stderr" internally.

    • │ │ │ -
    • content (str) -- The full contents as a string.

    • │ │ │ +
    • content (str) -- The full contents as a string.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ @@ -4847,54 +4847,54 @@ │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property location: tuple[str, int | None, str][source]
    │ │ │ +property location: tuple[str, int | None, str][source] │ │ │

    Returns a tuple of (relfspath, lineno, testname) for this item │ │ │ where relfspath is file path relative to config.rootpath │ │ │ and lineno is a 0-based line number.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │

    File

    │ │ │
    │ │ │
    │ │ │ class File[source]
    │ │ │ -

    Bases: FSCollector, ABC

    │ │ │ +

    Bases: FSCollector, ABC

    │ │ │

    Base class for collecting tests from a file.

    │ │ │

    Working with non-python tests.

    │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ config: Config
    │ │ │

    The pytest config object.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -name: str
    │ │ │ +name: str │ │ │

    A unique name within the scope of the parent node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ parent
    │ │ │

    The parent collector node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -path: pathlib.Path
    │ │ │ +path: pathlib.Path │ │ │

    Filesystem path where this node was collected from.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ session: Session
    │ │ │

    The pytest session this node is part of.

    │ │ │ @@ -4904,21 +4904,21 @@ │ │ │ │ │ │
    │ │ │
    │ │ │

    FSCollector

    │ │ │
    │ │ │
    │ │ │ class FSCollector[source]
    │ │ │ -

    Bases: Collector, ABC

    │ │ │ +

    Bases: Collector, ABC

    │ │ │

    Base class for filesystem collectors.

    │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ -path: pathlib.Path
    │ │ │ +path: pathlib.Path │ │ │

    Filesystem path where this node was collected from.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ classmethod from_parent(parent, *, fspath=None, path=None, **kw)[source]
    │ │ │

    The public constructor.

    │ │ │ @@ -4930,15 +4930,15 @@ │ │ │
    │ │ │ config: Config
    │ │ │

    The pytest config object.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -name: str
    │ │ │ +name: str │ │ │

    A unique name within the scope of the parent node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ parent
    │ │ │

    The parent collector node.

    │ │ │ @@ -4962,22 +4962,22 @@ │ │ │

    The root of the collection tree.

    │ │ │

    Session collects the initial paths given as arguments to pytest.

    │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ exception Interrupted
    │ │ │ -

    Bases: KeyboardInterrupt

    │ │ │ +

    Bases: KeyboardInterrupt

    │ │ │

    Signals that the test run was interrupted.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ exception Failed
    │ │ │ -

    Bases: Exception

    │ │ │ +

    Bases: Exception

    │ │ │

    Signals a stop as failed test run.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ property startpath: Path
    │ │ │

    The path from which pytest was invoked.

    │ │ │ @@ -4990,27 +4990,27 @@ │ │ │
    │ │ │ isinitpath(path, *, with_parents=False)[source]
    │ │ │

    Is path an initial path?

    │ │ │

    An initial path is a path explicitly given to pytest on the command │ │ │ line.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    with_parents (bool) -- If set, also return True if the path is a parent of an initial path.

    │ │ │ +

    with_parents (bool) -- If set, also return True if the path is a parent of an initial path.

    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Changed in version 8.0: Added the with_parents parameter.

    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -perform_collect(args: Sequence[str] | None = None, genitems: Literal[True] = True) Sequence[Item][source]
    │ │ │ +perform_collect(args: Sequence[str] | None = None, genitems: Literal[True] = True) Sequence[Item][source] │ │ │
    │ │ │ -perform_collect(args: Sequence[str] | None = None, genitems: bool = True) Sequence[Item | Collector]
    │ │ │ +perform_collect(args: Sequence[str] | None = None, genitems: bool = True) Sequence[Item | Collector] │ │ │

    Perform the collection phase for this session.

    │ │ │

    This is called by the default pytest_collection hook │ │ │ implementation; see the documentation of this hook for more details. │ │ │ For testing purposes, it may also be called directly on a fresh │ │ │ Session.

    │ │ │

    This function normally recursively expands any collectors collected │ │ │ from the session to their items, and only items are returned. For │ │ │ @@ -5031,27 +5031,27 @@ │ │ │

    │ │ │ config: Config
    │ │ │

    The pytest config object.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -name: str
    │ │ │ +name: str │ │ │

    A unique name within the scope of the parent node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ parent
    │ │ │

    The parent collector node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -path: pathlib.Path
    │ │ │ +path: pathlib.Path │ │ │

    Filesystem path where this node was collected from.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ session: Session
    │ │ │

    The pytest session this node is part of.

    │ │ │ @@ -5091,27 +5091,27 @@ │ │ │
    │ │ │ config: Config
    │ │ │

    The pytest config object.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -name: str
    │ │ │ +name: str │ │ │

    A unique name within the scope of the parent node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ parent
    │ │ │

    The parent collector node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -path: pathlib.Path
    │ │ │ +path: pathlib.Path │ │ │

    Filesystem path where this node was collected from.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ session: Session
    │ │ │

    The pytest session this node is part of.

    │ │ │ @@ -5141,27 +5141,27 @@ │ │ │
    │ │ │ config: Config
    │ │ │

    The pytest config object.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -name: str
    │ │ │ +name: str │ │ │

    A unique name within the scope of the parent node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ parent
    │ │ │

    The parent collector node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -path: pathlib.Path
    │ │ │ +path: pathlib.Path │ │ │

    Filesystem path where this node was collected from.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ session: Session
    │ │ │

    The pytest session this node is part of.

    │ │ │ @@ -5199,27 +5199,27 @@ │ │ │
    │ │ │ config: Config
    │ │ │

    The pytest config object.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -name: str
    │ │ │ +name: str │ │ │

    A unique name within the scope of the parent node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ parent
    │ │ │

    The parent collector node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -path: pathlib.Path
    │ │ │ +path: pathlib.Path │ │ │

    Filesystem path where this node was collected from.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ session: Session
    │ │ │

    The pytest session this node is part of.

    │ │ │ @@ -5304,40 +5304,40 @@ │ │ │

    Return a representation of a collection or test failure.

    │ │ │
    │ │ │

    See also

    │ │ │

    Working with non-python tests

    │ │ │
    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    excinfo (ExceptionInfo[BaseException]) -- Exception information for the failure.

    │ │ │ +

    excinfo (ExceptionInfo[BaseException]) -- Exception information for the failure.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ config: Config
    │ │ │

    The pytest config object.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -name: str
    │ │ │ +name: str │ │ │

    A unique name within the scope of the parent node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ parent
    │ │ │

    The parent collector node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -path: pathlib.Path
    │ │ │ +path: pathlib.Path │ │ │

    Filesystem path where this node was collected from.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ session: Session
    │ │ │

    The pytest session this node is part of.

    │ │ │ @@ -5368,27 +5368,27 @@ │ │ │
    │ │ │ config: Config
    │ │ │

    The pytest config object.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -name: str
    │ │ │ +name: str │ │ │

    A unique name within the scope of the parent node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ parent
    │ │ │

    The parent collector node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -path: pathlib.Path
    │ │ │ +path: pathlib.Path │ │ │

    Filesystem path where this node was collected from.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ session: Session
    │ │ │

    The pytest session this node is part of.

    │ │ │ @@ -5416,39 +5416,39 @@ │ │ │
    │ │ │ final class CallInfo[source]
    │ │ │

    Result/Exception info of a function invocation.

    │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ -excinfo: ExceptionInfo[BaseException] | None
    │ │ │ +excinfo: ExceptionInfo[BaseException] | None │ │ │

    The captured exception of the call, if it raised.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -start: float
    │ │ │ +start: float │ │ │

    The system time when the call started, in seconds since the epoch.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -stop: float
    │ │ │ +stop: float │ │ │

    The system time when the call ended, in seconds since the epoch.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -duration: float
    │ │ │ +duration: float │ │ │

    The call duration, in seconds.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -when: Literal['collect', 'setup', 'call', 'teardown']
    │ │ │ +when: Literal['collect', 'setup', 'call', 'teardown'] │ │ │

    The context of invocation: "collect", "setup", "call" or "teardown".

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ property result: TResult
    │ │ │

    The return value of the call, if it didn't raise.

    │ │ │ @@ -5459,16 +5459,16 @@ │ │ │
    │ │ │ classmethod from_call(func, when, reraise=None)[source]
    │ │ │

    Call func, wrapping the result in a CallInfo.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • func (Callable[[], _pytest.runner.TResult]) -- The function to call. Called without arguments.

    • │ │ │ -
    • when (Literal['collect', 'setup', 'call', 'teardown']) -- The phase in which the function is called.

    • │ │ │ -
    • reraise (type[BaseException] | tuple[type[BaseException], ...] | None) -- Exception or exceptions that shall propagate if raised by the │ │ │ +

    • when (Literal['collect', 'setup', 'call', 'teardown']) -- The phase in which the function is called.

    • │ │ │ +
    • reraise (type[BaseException] | tuple[type[BaseException], ...] | None) -- Exception or exceptions that shall propagate if raised by the │ │ │ function, instead of being wrapped in the CallInfo.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │ @@ -5482,99 +5482,99 @@ │ │ │

    Bases: BaseReport

    │ │ │

    Collection report object.

    │ │ │

    Reports can contain arbitrary extra attributes.

    │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ -nodeid: str
    │ │ │ +nodeid: str │ │ │

    Normalized collection nodeid.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -outcome: Literal['passed', 'failed', 'skipped']
    │ │ │ +outcome: Literal['passed', 'failed', 'skipped'] │ │ │

    Test outcome, always one of "passed", "failed", "skipped".

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -longrepr: None | ExceptionInfo[BaseException] | tuple[str, int, str] | str | TerminalRepr
    │ │ │ +longrepr: None | ExceptionInfo[BaseException] | tuple[str, int, str] | str | TerminalRepr │ │ │

    None or a failure representation.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ result
    │ │ │

    The collected items and collection nodes.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -sections: list[tuple[str, str]]
    │ │ │ +sections: list[tuple[str, str]] │ │ │

    Tuples of str (heading, content) with extra information │ │ │ for the test report. Used by pytest to add text captured │ │ │ from stdout, stderr, and intercepted logging events. May │ │ │ be used by other plugins to add arbitrary information to reports.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property caplog: str
    │ │ │ +property caplog: str │ │ │

    Return captured log lines, if log capturing is enabled.

    │ │ │
    │ │ │

    Added in version 3.5.

    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property capstderr: str
    │ │ │ +property capstderr: str │ │ │

    Return captured text from stderr, if capturing is enabled.

    │ │ │
    │ │ │

    Added in version 3.0.

    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property capstdout: str
    │ │ │ +property capstdout: str │ │ │

    Return captured text from stdout, if capturing is enabled.

    │ │ │
    │ │ │

    Added in version 3.0.

    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property count_towards_summary: bool
    │ │ │ +property count_towards_summary: bool │ │ │

    Experimental Whether this report should be counted towards the │ │ │ totals shown at the end of the test session: "1 passed, 1 failure, etc".

    │ │ │
    │ │ │

    Note

    │ │ │

    This function is considered experimental, so beware that it is subject to changes │ │ │ even in patch releases.

    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property failed: bool
    │ │ │ +property failed: bool │ │ │

    Whether the outcome is failed.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property fspath: str
    │ │ │ +property fspath: str │ │ │

    The path portion of the reported node, as a string.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property head_line: str | None
    │ │ │ +property head_line: str | None │ │ │

    Experimental The head line shown with longrepr output for this │ │ │ report, more commonly during traceback representation during │ │ │ failures:

    │ │ │
    ________ Test.foo ________
    │ │ │  
    │ │ │
    │ │ │

    In the example above, the head_line is "Test.foo".

    │ │ │ @@ -5583,31 +5583,31 @@ │ │ │

    This function is considered experimental, so beware that it is subject to changes │ │ │ even in patch releases.

    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property longreprtext: str
    │ │ │ +property longreprtext: str │ │ │

    Read-only property that returns the full string representation of │ │ │ longrepr.

    │ │ │
    │ │ │

    Added in version 3.0.

    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property passed: bool
    │ │ │ +property passed: bool │ │ │

    Whether the outcome is passed.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property skipped: bool
    │ │ │ +property skipped: bool │ │ │

    Whether the outcome is skipped.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ @@ -5639,21 +5639,21 @@ │ │ │ configuration option are handled by pytest, not being included in the args attribute.

    │ │ │

    Plugins accessing InvocationParams must be aware of that.

    │ │ │ │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ -args: tuple[str, ...]
    │ │ │ +args: tuple[str, ...] │ │ │

    The command-line arguments as passed to pytest.main().

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -plugins: Sequence[str | object] | None
    │ │ │ +plugins: Sequence[str | object] | None │ │ │

    Extra plugins, might be None.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ dir: Path
    │ │ │

    The directory from which pytest.main() was invoked.

    │ │ │ @@ -5690,15 +5690,15 @@ │ │ │ │ │ │
    │ │ │
    │ │ │ option
    │ │ │

    Access to command line option as attributes.

    │ │ │
    │ │ │
    Type:
    │ │ │ -

    argparse.Namespace

    │ │ │ +

    argparse.Namespace

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ invocation_params
    │ │ │ @@ -5740,15 +5740,15 @@ │ │ │
    │ │ │

    Added in version 6.1.

    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property inipath: Path | None
    │ │ │ +property inipath: Path | None │ │ │

    The path to the configfile.

    │ │ │
    │ │ │

    Added in version 6.1.

    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │ @@ -5775,16 +5775,16 @@ │ │ │

    During pytest_configure we can't capture warnings using the catch_warnings_for_item │ │ │ function because it is not possible to have hook wrappers around pytest_configure.

    │ │ │

    This function is mainly intended for plugins that need to issue warnings during │ │ │ pytest_configure (or similar stages).

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • warning (Warning) -- The warning instance.

    • │ │ │ -
    • stacklevel (int) -- stacklevel forwarded to warnings.warn.

    • │ │ │ +
    • warning (Warning) -- The warning instance.

    • │ │ │ +
    • stacklevel (int) -- stacklevel forwarded to warnings.warn.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ @@ -5830,19 +5830,19 @@ │ │ │
    │ │ │
    │ │ │ getoption(name, default=NotSetType.token, skip=False)[source]
    │ │ │

    Return command line option value.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • name (str) -- Name of the option. You may also specify │ │ │ +

    • name (str) -- Name of the option. You may also specify │ │ │ the literal --OPT option instead of the "dest" option name.

    • │ │ │ -
    • default (Any) -- Fallback value if no option of that name is declared via pytest_addoption. │ │ │ +

    • default (Any) -- Fallback value if no option of that name is declared via pytest_addoption. │ │ │ Note this parameter will be ignored when the option is declared even if the option's value is None.

    • │ │ │ -
    • skip (bool) -- If True, raise pytest.skip() if option is undeclared or has a None value. │ │ │ +

    • skip (bool) -- If True, raise pytest.skip() if option is undeclared or has a None value. │ │ │ Note that even if True, if a default was specified it will be returned instead of a skip.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │ @@ -5881,15 +5881,15 @@ │ │ │ │ │ │
    │ │ │
    │ │ │ get_verbosity(verbosity_type=None)[source]
    │ │ │

    Retrieve the verbosity level for a fine-grained verbosity type.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    verbosity_type (str | None) -- Verbosity type to get level for. If a level is │ │ │ +

    verbosity_type (str | None) -- Verbosity type to get level for. If a level is │ │ │ configured for the given type, that value will be returned. If the │ │ │ given type is not a known verbosity type, the global verbosity │ │ │ level will be returned. If the given type is None (default), the │ │ │ global verbosity level will be returned.

    │ │ │
    │ │ │
    │ │ │

    To configure a level for a fine-grained verbosity type, the │ │ │ @@ -5944,15 +5944,15 @@ │ │ │

    │ │ │ classmethod from_parent(parent, *, path)[source]
    │ │ │

    The public constructor.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • parent (nodes.Collector) -- The parent collector of this Dir.

    • │ │ │ -
    • path (pathlib.Path) -- The directory's path.

    • │ │ │ +
    • path (pathlib.Path) -- The directory's path.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ @@ -5966,27 +5966,27 @@ │ │ │
    │ │ │ config: Config
    │ │ │

    The pytest config object.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -name: str
    │ │ │ +name: str
    │ │ │

    A unique name within the scope of the parent node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ parent
    │ │ │

    The parent collector node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -path: pathlib.Path
    │ │ │ +path: pathlib.Path │ │ │

    Filesystem path where this node was collected from.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ session: Session
    │ │ │

    The pytest session this node is part of.

    │ │ │ @@ -6018,27 +6018,27 @@ │ │ │
    │ │ │ config: Config
    │ │ │

    The pytest config object.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -name: str
    │ │ │ +name: str │ │ │

    A unique name within the scope of the parent node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ parent
    │ │ │

    The parent collector node.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -path: pathlib.Path
    │ │ │ +path: pathlib.Path │ │ │

    Filesystem path where this node was collected from.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ session: Session
    │ │ │

    The pytest session this node is part of.

    │ │ │ @@ -6058,18 +6058,18 @@ │ │ │
    │ │ │
    │ │ │ classmethod from_exception(exception, exprinfo=None)[source]
    │ │ │

    Return an ExceptionInfo for an existing exception.

    │ │ │

    The exception must have a non-None __traceback__ attribute, │ │ │ otherwise this function fails with an assertion error. This means that │ │ │ the exception must have been raised, or added a traceback with the │ │ │ -with_traceback() method.

    │ │ │ +with_traceback() method.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    exprinfo (str | None) -- A text string helping to determine if we should strip │ │ │ +

    exprinfo (str | None) -- A text string helping to determine if we should strip │ │ │ AssertionError from the output. Defaults to the exception │ │ │ message/__str__().

    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Added in version 7.4.

    │ │ │
    │ │ │ @@ -6089,15 +6089,15 @@ │ │ │

    Return an ExceptionInfo matching the current traceback.

    │ │ │
    │ │ │

    Warning

    │ │ │

    Experimental API

    │ │ │
    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    exprinfo (str | None) -- A text string helping to determine if we should strip │ │ │ +

    exprinfo (str | None) -- A text string helping to determine if we should strip │ │ │ AssertionError from the output. Defaults to the exception │ │ │ message/__str__().

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │ @@ -6114,33 +6114,33 @@ │ │ │

    Fill an unfilled ExceptionInfo created with for_later().

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property type: type[E]
    │ │ │ +property type: type[E] │ │ │

    The exception class.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ property value: E
    │ │ │

    The exception value.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property tb: TracebackType
    │ │ │ +property tb: TracebackType │ │ │

    The exception raw traceback.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property typename: str
    │ │ │ +property typename: str │ │ │

    The type name of the exception.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ property traceback: Traceback
    │ │ │

    The traceback.

    │ │ │ @@ -6151,15 +6151,15 @@ │ │ │ exconly(tryshort=False)[source] │ │ │

    Return the exception as a string.

    │ │ │

    This is usually a single line "<exception type>: <exception str>", but │ │ │ may also include additional lines for the exception notes, and detailed │ │ │ information for SyntaxError's.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    tryshort (bool) -- If true, and the exception is an AssertionError, strip │ │ │ +

    tryshort (bool) -- If true, and the exception is an AssertionError, strip │ │ │ 'AssertionError: ' from the beginning.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ @@ -6175,65 +6175,65 @@ │ │ │ getrepr(showlocals=False, style='long', abspath=False, tbfilter=True, funcargs=False, truncate_locals=True, truncate_args=True, chain=True)[source]
    │ │ │

    Return str()able representation of this exception info.

    │ │ │

    The formatting parameters are ineffective if style="native", │ │ │ since in this case the native formatting is used.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • showlocals (bool) -- Show locals per traceback entry.

    • │ │ │ -
    • style (str) -- long|short|line|no|native|value traceback style.

    • │ │ │ -
    • abspath (bool) -- If paths should be changed to absolute or left unchanged.

    • │ │ │ -
    • tbfilter (bool | Callable[[ExceptionInfo[BaseException]], Traceback]) --

      A filter for traceback entries.

      │ │ │ +
    • showlocals (bool) -- Show locals per traceback entry.

    • │ │ │ +
    • style (str) -- long|short|line|no|native|value traceback style.

    • │ │ │ +
    • abspath (bool) -- If paths should be changed to absolute or left unchanged.

    • │ │ │ +
    • tbfilter (bool | Callable[[ExceptionInfo[BaseException]], Traceback]) --

      A filter for traceback entries.

      │ │ │
        │ │ │
      • If false, don't hide any entries.

      • │ │ │
      • If true, hide internal entries and entries that contain a local │ │ │ variable __tracebackhide__ = True.

      • │ │ │
      • If a callable, delegates the filtering to the callable.

      • │ │ │
      │ │ │

    • │ │ │ -
    • funcargs (bool) -- Show function arguments per traceback entry.

    • │ │ │ -
    • truncate_locals (bool) -- Whether to show a size-limited repr() of locals, or a full │ │ │ +

    • funcargs (bool) -- Show function arguments per traceback entry.

    • │ │ │ +
    • truncate_locals (bool) -- Whether to show a size-limited repr() of locals, or a full │ │ │ pretty-printing.

    • │ │ │ -
    • truncate_args (bool) -- Whether to show a size-limited truncated repr() of function │ │ │ +

    • truncate_args (bool) -- Whether to show a size-limited truncated repr() of function │ │ │ arguments, or a full pretty-printing.

    • │ │ │ -
    • chain (bool) -- If chained exceptions should be shown.

    • │ │ │ +
    • chain (bool) -- If chained exceptions should be shown.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Changed in version 3.9: Added the chain parameter.

    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ match(regexp)[source]
    │ │ │

    Check whether the regular expression regexp matches the string │ │ │ -representation of the exception using python:re.search().

    │ │ │ +representation of the exception using re.search().

    │ │ │

    If it matches True is returned, otherwise an AssertionError is raised.

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ group_contains(expected_exception, *, match=None, depth=None)[source]
    │ │ │

    Check whether a captured exception group contains a matching exception.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • expected_exception (Type[BaseException] | Tuple[Type[BaseException]]) -- The expected exception type, or a tuple if one of multiple possible │ │ │ +

    • expected_exception (Type[BaseException] | Tuple[Type[BaseException]]) -- The expected exception type, or a tuple if one of multiple possible │ │ │ exception types are expected.

    • │ │ │ -
    • match (str | re.Pattern[str] | None) --

      If specified, a string containing a regular expression, │ │ │ +

    • match (str | re.Pattern[str] | None) --

      If specified, a string containing a regular expression, │ │ │ or a regular expression object, that is tested against the string │ │ │ representation of the exception and its PEP-678 <https://peps.python.org/pep-0678/> __notes__ │ │ │ -using re.search().

      │ │ │ -

      To match a literal string that may contain special characters, the pattern can first be escaped with re.escape().

      │ │ │ +using re.search().

      │ │ │ +

      To match a literal string that may contain special characters, the pattern can first be escaped with re.escape().

      │ │ │

    • │ │ │ -
    • depth (Optional[int]) -- If None, will search for a matching exception at any nesting depth. │ │ │ +

    • depth (Optional[int]) -- If None, will search for a matching exception at any nesting depth. │ │ │ If >= 1, will only match an exception if it's at the specified depth (depth = 1 being │ │ │ the exceptions contained within the topmost exception group).

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │

    Added in version 8.0.

    │ │ │ @@ -6264,23 +6264,23 @@ │ │ │ │ │ │
    │ │ │
    │ │ │

    FixtureDef

    │ │ │
    │ │ │
    │ │ │ class FixtureDef[source]
    │ │ │ -

    Bases: Generic[FixtureValue]

    │ │ │ +

    Bases: Generic[FixtureValue]

    │ │ │

    A container for a fixture definition.

    │ │ │

    Note: At this time, only explicitly documented fields and methods are │ │ │ considered public stable API.

    │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ -property scope: Literal['session', 'package', 'module', 'class', 'function']
    │ │ │ +property scope: Literal['session', 'package', 'module', 'class', 'function'] │ │ │

    Scope string, one of "function", "class", "module", "package", "session".

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ execute(request)[source]
    │ │ │

    Return the value of this fixture, executing it if not cached.

    │ │ │ @@ -6325,27 +6325,27 @@ │ │ │ single function or class reference as its positional argument with no │ │ │ additional keyword or positional arguments. You can work around this by │ │ │ using with_args().

    │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ -property name: str
    │ │ │ +property name: str │ │ │

    Alias for mark.name.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property args: tuple[Any, ...]
    │ │ │ +property args: tuple[Any, ...] │ │ │

    Alias for mark.args.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property kwargs: Mapping[str, Any]
    │ │ │ +property kwargs: Mapping[str, Any] │ │ │

    Alias for mark.kwargs.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ with_args(*args, **kwargs)[source]
    │ │ │

    Return a MarkDecorator with extra arguments added.

    │ │ │ @@ -6386,27 +6386,27 @@ │ │ │
    │ │ │ final class Mark[source]
    │ │ │

    A pytest mark.

    │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ -name: str
    │ │ │ +name: str │ │ │

    Name of the mark.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -args: tuple[Any, ...]
    │ │ │ +args: tuple[Any, ...] │ │ │

    Positional arguments of the mark decorator.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -kwargs: Mapping[str, Any]
    │ │ │ +kwargs: Mapping[str, Any] │ │ │

    Keyword arguments of the mark decorator.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ combined_with(other)[source]
    │ │ │

    Return a new Mark which is a combination of this │ │ │ @@ -6486,35 +6486,35 @@ │ │ │ parametrize ["x", "y"]: t[x], t[y] │ │ │ parametrize [1, 2]: t[x-1], t[x-2], t[y-1], t[y-2] │ │ │ │ │ │ │ │ │

    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • argnames (str | Sequence[str]) -- A comma-separated string denoting one or more argument names, or │ │ │ +

    • argnames (str | Sequence[str]) -- A comma-separated string denoting one or more argument names, or │ │ │ a list/tuple of argument strings.

    • │ │ │ -
    • argvalues (Iterable[ParameterSet | Sequence[object] | object]) --

      The list of argvalues determines how often a test is invoked with │ │ │ +

    • argvalues (Iterable[ParameterSet | Sequence[object] | object]) --

      The list of argvalues determines how often a test is invoked with │ │ │ different argument values.

      │ │ │

      If only one argname was specified argvalues is a list of values. │ │ │ If N argnames were specified, argvalues must be a list of │ │ │ N-tuples, where each tuple-element specifies a value for its │ │ │ respective argname.

      │ │ │
      │ │ │ -

      Changed in version 9.1: Passing a non-Collection iterable │ │ │ +

      Changed in version 9.1: Passing a non-Collection iterable │ │ │ (such as a generator or iterator) is deprecated. See │ │ │ Non-Collection iterables in @pytest.mark.parametrize for details.

      │ │ │
      │ │ │

    • │ │ │ -
    • indirect (bool | Sequence[str]) -- A list of arguments' names (subset of argnames) or a boolean. │ │ │ +

    • indirect (bool | Sequence[str]) -- A list of arguments' names (subset of argnames) or a boolean. │ │ │ If True the list contains all names from the argnames. Each │ │ │ argvalue corresponding to an argname in this list will │ │ │ be passed as request.param to its respective argname fixture │ │ │ function so that it can perform more expensive setups during the │ │ │ setup phase of a test rather than at collection time.

    • │ │ │ -
    • ids (Iterable[object | None] | Callable[[Any], object | None] | None) --

      Sequence of (or generator for) ids for argvalues, │ │ │ +

    • ids (Iterable[object | None] | Callable[[Any], object | None] | None) --

      Sequence of (or generator for) ids for argvalues, │ │ │ or a callable to return part of the id for each argvalue.

      │ │ │

      With sequences (and generators like itertools.count()) the │ │ │ returned ids should be of type string, int, float, │ │ │ bool, or None. │ │ │ They are mapped to the corresponding index in argvalues. │ │ │ None means to use the auto-generated id.

      │ │ │
      │ │ │ @@ -6527,15 +6527,15 @@ │ │ │ auto-generated id for the whole set (where parts are joined with │ │ │ dashes ("-")). │ │ │ This is useful to provide more specific ids for certain items, e.g. │ │ │ dates. Returning None will use an auto-generated id.

      │ │ │

      If no ids are provided they will be generated automatically from │ │ │ the argvalues.

      │ │ │

    • │ │ │ -
    • scope (Literal['session', 'package', 'module', 'class', 'function'] | None) -- If specified it denotes the scope of the parameters. │ │ │ +

    • scope (Literal['session', 'package', 'module', 'class', 'function'] | None) -- If specified it denotes the scope of the parameters. │ │ │ The scope is used for grouping tests by parameter instances. │ │ │ It will also override any fixture-function defined scope, allowing │ │ │ to set a dynamic scope using test context or configuration.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ @@ -6558,17 +6558,17 @@ │ │ │
    │ │ │
    │ │ │ getgroup(name, description='', after=None)[source]
    │ │ │

    Get (or create) a named option Group.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • name (str) -- Name of the option group.

    • │ │ │ -
    • description (str) -- Long description for --help output.

    • │ │ │ -
    • after (str | None) -- Name of another group, used for ordering --help output.

    • │ │ │ +
    • name (str) -- Name of the option group.

    • │ │ │ +
    • description (str) -- Long description for --help output.

    • │ │ │ +
    • after (str | None) -- Name of another group, used for ordering --help output.

    • │ │ │
    │ │ │
    │ │ │
    Returns:
    │ │ │

    The option group.

    │ │ │
    │ │ │
    Return type:
    │ │ │

    OptionGroup

    │ │ │ @@ -6583,16 +6583,16 @@ │ │ │
    │ │ │
    │ │ │ addoption(*opts, **attrs)[source]
    │ │ │

    Register a command line option.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • opts (str) -- Option names, can be short or long options.

    • │ │ │ -
    • attrs (Any) -- Same attributes as the argparse library's add_argument() function accepts.

    • │ │ │ +
    • opts (str) -- Option names, can be short or long options.

    • │ │ │ +
    • attrs (Any) -- Same attributes as the argparse library's add_argument() function accepts.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │

    After command line parsing, options are available on the pytest config │ │ │ object via config.option.NAME where NAME is usually set │ │ │ by passing a dest attribute, for example │ │ │ addoption("--long", dest="NAME", ...).

    │ │ │ @@ -6603,15 +6603,15 @@ │ │ │ parse_known_args(args, namespace=None)[source] │ │ │

    Parse the known arguments at this point.

    │ │ │
    │ │ │
    Returns:
    │ │ │

    An argparse namespace object.

    │ │ │
    │ │ │
    Return type:
    │ │ │ -

    Namespace

    │ │ │ +

    Namespace

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ parse_known_and_unknown_args(args, namespace=None)[source]
    │ │ │ @@ -6619,35 +6619,35 @@ │ │ │ remaining unknown flag arguments.

    │ │ │
    │ │ │
    Returns:
    │ │ │

    A tuple containing an argparse namespace object for the known │ │ │ arguments, and a list of unknown flag arguments.

    │ │ │
    │ │ │
    Return type:
    │ │ │ -

    tuple[Namespace, list[str]]

    │ │ │ +

    tuple[Namespace, list[str]]

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ addini(name, help, type=None, default=NotSetType.token, *, aliases=())[source]
    │ │ │

    Register a configuration file option.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • name (str) -- Name of the configuration.

    • │ │ │ -
    • type (Literal['string', 'paths', 'pathlist', 'args', 'linelist', 'bool', 'int', 'float'] | None) --

      Type of the configuration. Can be:

      │ │ │ +
    • name (str) -- Name of the configuration.

    • │ │ │ +
    • type (Literal['string', 'paths', 'pathlist', 'args', 'linelist', 'bool', 'int', 'float'] | None) --

      Type of the configuration. Can be:

      │ │ │
      │ │ │
        │ │ │
      • string: a string

      • │ │ │
      • bool: a boolean

      • │ │ │
      • args: a list of strings, separated as in a shell

      • │ │ │
      • linelist: a list of strings, separated by line breaks

      • │ │ │ -
      • paths: a list of pathlib.Path, separated as in a shell

      • │ │ │ +
      • paths: a list of pathlib.Path, separated as in a shell

      • │ │ │
      • pathlist: a list of py.path, separated as in a shell

      • │ │ │
      • int: an integer

      • │ │ │
      • float: a floating-point number

      • │ │ │
      │ │ │
      │ │ │

      Added in version 8.4: The float and int types.

      │ │ │
      │ │ │ @@ -6659,16 +6659,16 @@ │ │ │

      Added in version 7.0: The paths variable type.

      │ │ │
      │ │ │
      │ │ │

      Added in version 8.1: Use the current working directory to resolve paths and pathlist in the absence of a config-file.

      │ │ │
      │ │ │

      Defaults to string if None or not passed.

      │ │ │

    • │ │ │ -
    • default (Any) -- Default value if no config-file option exists but is queried.

    • │ │ │ -
    • aliases (Sequence[str]) --

      Additional names by which this option can be referenced. │ │ │ +

    • default (Any) -- Default value if no config-file option exists but is queried.

    • │ │ │ +
    • aliases (Sequence[str]) --

      Additional names by which this option can be referenced. │ │ │ Aliases resolve to the canonical name.

      │ │ │
      │ │ │

      Added in version 9.0: The aliases parameter.

      │ │ │
      │ │ │

    • │ │ │
    │ │ │
    │ │ │ @@ -6695,17 +6695,17 @@ │ │ │

    If a shortened version of a long option is specified, it will │ │ │ be suppressed in the help. addoption('--twowords', '--two-words') │ │ │ results in help showing --two-words only, but --twowords gets │ │ │ accepted and the automatic destination is in args.twowords.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • opts (str) -- Option names, can be short or long options. │ │ │ +

    • opts (str) -- Option names, can be short or long options. │ │ │ Note that lower-case short options (e.g. -x) are reserved.

    • │ │ │ -
    • attrs (Any) -- Same attributes as the argparse library's add_argument() function accepts.

    • │ │ │ +
    • attrs (Any) -- Same attributes as the argparse library's add_argument() function accepts.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │ @@ -6727,26 +6727,26 @@ │ │ │
    │ │ │
    │ │ │
    │ │ │ register(plugin, name=None)[source]
    │ │ │

    Register a plugin and return its name.

    │ │ │
    │ │ │
    Parameters:
    │ │ │ -

    name (str | None) -- The name under which to register the plugin. If not specified, a │ │ │ +

    name (str | None) -- The name under which to register the plugin. If not specified, a │ │ │ name is generated using get_canonical_name().

    │ │ │
    │ │ │
    Returns:
    │ │ │

    The plugin name. If the name is blocked from registering, returns │ │ │ None.

    │ │ │
    │ │ │
    Return type:
    │ │ │ -

    str | None

    │ │ │ +

    str | None

    │ │ │
    │ │ │
    │ │ │ -

    If the plugin is already registered, raises a ValueError.

    │ │ │ +

    If the plugin is already registered, raises a ValueError.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ getplugin(name)[source]
    │ │ │
    │ │ │
    │ │ │ @@ -6831,15 +6831,15 @@ │ │ │

    Get all hook callers for the specified plugin.

    │ │ │
    │ │ │
    Returns:
    │ │ │

    The hook callers, or None if plugin is not registered in │ │ │ this plugin manager.

    │ │ │
    │ │ │
    Return type:
    │ │ │ -

    list[HookCaller] | None

    │ │ │ +

    list[HookCaller] | None

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ get_name(plugin)
    │ │ │ @@ -6909,23 +6909,23 @@ │ │ │
    │ │ │
    │ │ │ load_setuptools_entrypoints(group, name=None)
    │ │ │

    Load modules from querying the specified setuptools group.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • group (str) -- Entry point group to load plugins.

    • │ │ │ -
    • name (str | None) -- If given, loads only plugins with the given name.

    • │ │ │ +
    • group (str) -- Entry point group to load plugins.

    • │ │ │ +
    • name (str | None) -- If given, loads only plugins with the given name.

    • │ │ │
    │ │ │
    │ │ │
    Returns:
    │ │ │

    The number of plugins loaded by this call.

    │ │ │
    │ │ │
    Return type:
    │ │ │ -

    int

    │ │ │ +

    int

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ set_blocked(name)
    │ │ │ @@ -6998,21 +6998,21 @@ │ │ │ directly as a helper class with RaisesGroup when you want to specify │ │ │ requirements on sub-exceptions.

    │ │ │

    You don't need this if you only want to specify the type, since RaisesGroup │ │ │ accepts type[BaseException].

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │ -
    • expected_exception (type[BaseException] | tuple[type[BaseException]] | None) --

      The expected type, or one of several possible types. │ │ │ +

    • expected_exception (type[BaseException] | tuple[type[BaseException]] | None) --

      The expected type, or one of several possible types. │ │ │ May be None in order to only make use of match and/or check

      │ │ │ -

      The type is checked with isinstance(), and does not need to be an exact match. │ │ │ +

      The type is checked with isinstance(), and does not need to be an exact match. │ │ │ If that is wanted you can use the check parameter.

      │ │ │

    • │ │ │ -
    • match (str | Pattern[str]) -- A regex to match.

    • │ │ │ -
    • check (Callable[[BaseException], bool]) -- If specified, a callable that will be called with the exception as a parameter │ │ │ +

    • match (str | Pattern[str]) -- A regex to match.

    • │ │ │ +
    • check (Callable[[BaseException], bool]) -- If specified, a callable that will be called with the exception as a parameter │ │ │ after checking the type and the match regex if specified. │ │ │ If it returns True it will be considered a match, if not it will │ │ │ be considered a failed match.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │

    RaisesExc.matches() can also be used standalone to check individual exceptions.

    │ │ │ @@ -7064,52 +7064,52 @@ │ │ │

    Tutorial: Assertions about expected exception groups

    │ │ │
    │ │ │
    │ │ │ final class RaisesGroup[source]
    │ │ │
    │ │ │

    Added in version 8.4.

    │ │ │
    │ │ │ -

    Contextmanager for checking for an expected ExceptionGroup. │ │ │ -This works similar to pytest.raises(), but allows for specifying the structure of an ExceptionGroup. │ │ │ +

    Contextmanager for checking for an expected ExceptionGroup. │ │ │ +This works similar to pytest.raises(), but allows for specifying the structure of an ExceptionGroup. │ │ │ ExceptionInfo.group_contains() also tries to handle exception groups, │ │ │ but it is very bad at checking that you didn't get unexpected exceptions.

    │ │ │ -

    The catching behaviour differs from except*, being much │ │ │ +

    The catching behaviour differs from except*, being much │ │ │ stricter about the structure by default. │ │ │ By using allow_unwrapped=True and flatten_subgroups=True you can match │ │ │ -except* fully when expecting a single exception.

    │ │ │ +except* fully when expecting a single exception.

    │ │ │
    │ │ │
    Parameters:
    │ │ │
      │ │ │
    • args --

      Any number of exception types, RaisesGroup or RaisesExc │ │ │ to specify the exceptions contained in this exception. │ │ │ All specified exceptions must be present in the raised group, and no others.

      │ │ │

      If you expect a variable number of exceptions you need to use │ │ │ pytest.raises(ExceptionGroup) and manually check │ │ │ the contained exceptions. Consider making use of RaisesExc.matches().

      │ │ │

      It does not care about the order of the exceptions, so │ │ │ RaisesGroup(ValueError, TypeError) │ │ │ is equivalent to │ │ │ RaisesGroup(TypeError, ValueError).

      │ │ │

    • │ │ │ -
    • match (str | re.Pattern[str] | None) --

      If specified, a string containing a regular expression, │ │ │ +

    • match (str | re.Pattern[str] | None) --

      If specified, a string containing a regular expression, │ │ │ or a regular expression object, that is tested against the string │ │ │ representation of the exception group and its PEP 678 __notes__ │ │ │ -using re.search().

      │ │ │ -

      To match a literal string that may contain special characters, the pattern can first be escaped with re.escape().

      │ │ │ +using re.search().

      │ │ │ +

      To match a literal string that may contain special characters, the pattern can first be escaped with re.escape().

      │ │ │

      Note that " (5 subgroups)" will be stripped from the repr before matching.

      │ │ │

    • │ │ │ -
    • check (Callable[[E], bool]) -- If specified, a callable that will be called with the group as a parameter │ │ │ +

    • check (Callable[[E], bool]) -- If specified, a callable that will be called with the group as a parameter │ │ │ after successfully matching the expected exceptions. If it returns True │ │ │ it will be considered a match, if not it will be considered a failed match.

    • │ │ │ -
    • allow_unwrapped (bool) --

      If expecting a single exception or RaisesExc it will match even │ │ │ +

    • allow_unwrapped (bool) --

      If expecting a single exception or RaisesExc it will match even │ │ │ if the exception is not inside an exceptiongroup.

      │ │ │

      Using this together with match, check or expecting multiple exceptions │ │ │ will raise an error.

      │ │ │

    • │ │ │ -
    • flatten_subgroups (bool) -- "flatten" any groups inside the raised exception group, extracting all exceptions │ │ │ +

    • flatten_subgroups (bool) -- "flatten" any groups inside the raised exception group, extracting all exceptions │ │ │ inside any nested groups, before matching. Without this it expects you to │ │ │ fully specify the nesting structure by passing RaisesGroup as expected │ │ │ parameter.

    • │ │ │
    │ │ │
    │ │ │
    │ │ │

    Examples:

    │ │ │ @@ -7153,15 +7153,15 @@ │ │ │

    RaisesGroup.matches() can also be used directly to check a standalone exception group.

    │ │ │

    The matching algorithm is greedy, which means cases such as this may fail:

    │ │ │
    with RaisesGroup(ValueError, RaisesExc(ValueError, match="hello")):
    │ │ │      raise ExceptionGroup("", (ValueError("hello"), ValueError("goodbye")))
    │ │ │  
    │ │ │
    │ │ │

    even though it generally does not care about the order of the exceptions in the group. │ │ │ -To avoid the above you should specify the first ValueError with a RaisesExc as well.

    │ │ │ +To avoid the above you should specify the first ValueError with a RaisesExc as well.

    │ │ │
    │ │ │

    Note

    │ │ │

    When raised exceptions don't match the expected ones, you'll get a detailed error │ │ │ message explaining why. This includes repr(check) if set, which in Python can be │ │ │ overly verbose, showing memory locations etc etc.

    │ │ │

    If installed and imported (in e.g. conftest.py), the hypothesis library will │ │ │ monkeypatch this output to provide shorter & more readable repr's.

    │ │ │ @@ -7172,17 +7172,17 @@ │ │ │

    Set after a call to matches() to give a human-readable reason for why the match failed. │ │ │ When used as a context manager the string will be printed as the reason for the │ │ │ test failing.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -matches(exception: BaseException | None) TypeGuard[ExceptionGroup[ExcT_1]][source]
    │ │ │ +matches(exception: BaseException | None) TypeGuard[ExceptionGroup[ExcT_1]][source] │ │ │
    │ │ │ -matches(exception: BaseException | None) TypeGuard[BaseExceptionGroup[BaseExcT_1]]
    │ │ │ +matches(exception: BaseException | None) TypeGuard[BaseExceptionGroup[BaseExcT_1]] │ │ │

    Check if an exception matches the requirements of this RaisesGroup. │ │ │ If it fails, RaisesGroup.fail_reason will be set.

    │ │ │

    Example:

    │ │ │
    with pytest.raises(TypeError) as excinfo:
    │ │ │      ...
    │ │ │  assert RaisesGroup(ValueError).matches(excinfo.value.__cause__)
    │ │ │  # the above line is equivalent to
    │ │ │ @@ -7258,84 +7258,84 @@
    │ │ │  

    Basic test report object (also used for setup and teardown calls if │ │ │ they fail).

    │ │ │

    Reports can contain arbitrary extra attributes.

    │ │ │
    │ │ │
    │ │ │
    │ │ │
    │ │ │ -nodeid: str
    │ │ │ +nodeid: str │ │ │

    Normalized collection nodeid.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -location: tuple[str, int | None, str]
    │ │ │ +location: tuple[str, int | None, str] │ │ │

    A (filesystempath, lineno, domaininfo) tuple indicating the │ │ │ actual location of a test item - it might be different from the │ │ │ collected one e.g. if a method is inherited from a different module. │ │ │ The filesystempath may be relative to config.rootdir. │ │ │ The line number is 0-based.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -keywords: Mapping[str, Any]
    │ │ │ +keywords: Mapping[str, Any] │ │ │

    A name -> value dictionary containing all keywords and │ │ │ markers associated with a test invocation.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -outcome: Literal['passed', 'failed', 'skipped']
    │ │ │ +outcome: Literal['passed', 'failed', 'skipped'] │ │ │

    Test outcome, always one of "passed", "failed", "skipped".

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -longrepr: None | ExceptionInfo[BaseException] | tuple[str, int, str] | str | TerminalRepr
    │ │ │ +longrepr: None | ExceptionInfo[BaseException] | tuple[str, int, str] | str | TerminalRepr │ │ │

    None or a failure representation.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -when: Literal['setup', 'call', 'teardown']
    │ │ │ +when: Literal['setup', 'call', 'teardown'] │ │ │

    One of 'setup', 'call', 'teardown' to indicate runtest phase.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ user_properties
    │ │ │

    User properties is a list of tuples (name, value) that holds user │ │ │ defined properties of the test.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -sections: list[tuple[str, str]]
    │ │ │ +sections: list[tuple[str, str]] │ │ │

    Tuples of str (heading, content) with extra information │ │ │ for the test report. Used by pytest to add text captured │ │ │ from stdout, stderr, and intercepted logging events. May │ │ │ be used by other plugins to add arbitrary information to reports.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -duration: float
    │ │ │ +duration: float │ │ │

    Time it took to run just the test.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -start: float
    │ │ │ +start: float │ │ │

    The system time when the call started, in seconds since the epoch.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -stop: float
    │ │ │ +stop: float │ │ │

    The system time when the call ended, in seconds since the epoch.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ classmethod from_item_and_call(item, call)[source]
    │ │ │

    Create and fill a TestReport with standard item and call info.

    │ │ │ @@ -7347,66 +7347,66 @@ │ │ │ │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property caplog: str
    │ │ │ +property caplog: str │ │ │

    Return captured log lines, if log capturing is enabled.

    │ │ │
    │ │ │

    Added in version 3.5.

    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property capstderr: str
    │ │ │ +property capstderr: str │ │ │

    Return captured text from stderr, if capturing is enabled.

    │ │ │
    │ │ │

    Added in version 3.0.

    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property capstdout: str
    │ │ │ +property capstdout: str │ │ │

    Return captured text from stdout, if capturing is enabled.

    │ │ │
    │ │ │

    Added in version 3.0.

    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property count_towards_summary: bool
    │ │ │ +property count_towards_summary: bool │ │ │

    Experimental Whether this report should be counted towards the │ │ │ totals shown at the end of the test session: "1 passed, 1 failure, etc".

    │ │ │
    │ │ │

    Note

    │ │ │

    This function is considered experimental, so beware that it is subject to changes │ │ │ even in patch releases.

    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property failed: bool
    │ │ │ +property failed: bool │ │ │

    Whether the outcome is failed.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property fspath: str
    │ │ │ +property fspath: str │ │ │

    The path portion of the reported node, as a string.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property head_line: str | None
    │ │ │ +property head_line: str | None │ │ │

    Experimental The head line shown with longrepr output for this │ │ │ report, more commonly during traceback representation during │ │ │ failures:

    │ │ │
    ________ Test.foo ________
    │ │ │  
    │ │ │
    │ │ │

    In the example above, the head_line is "Test.foo".

    │ │ │ @@ -7415,31 +7415,31 @@ │ │ │

    This function is considered experimental, so beware that it is subject to changes │ │ │ even in patch releases.

    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property longreprtext: str
    │ │ │ +property longreprtext: str │ │ │

    Read-only property that returns the full string representation of │ │ │ longrepr.

    │ │ │
    │ │ │

    Added in version 3.0.

    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property passed: bool
    │ │ │ +property passed: bool │ │ │

    Whether the outcome is passed.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -property skipped: bool
    │ │ │ +property skipped: bool │ │ │

    Whether the outcome is skipped.

    │ │ │
    │ │ │ │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ @@ -7457,27 +7457,27 @@ │ │ │
  • word -- Verbose word is shown as testing progresses in verbose mode, for example "PASSED", "SKIPPED", │ │ │ "ERROR", or the empty string.

  • │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │
    │ │ │ -category: str
    │ │ │ +category: str │ │ │

    Alias for field number 0

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -letter: str
    │ │ │ +letter: str │ │ │

    Alias for field number 1

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ -word: str | tuple[str, Mapping[str, bool]]
    │ │ │ +word: str | tuple[str, Mapping[str, bool]] │ │ │

    Alias for field number 2

    │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │
    │ │ │ @@ -7583,15 +7583,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │
    │ │ │ class StashKey[source]
    │ │ │ -

    Bases: Generic[T]

    │ │ │ +

    Bases: Generic[T]

    │ │ │

    StashKey is an object used as a key to a Stash.

    │ │ │

    A StashKey is associated with the type T of the value of the key.

    │ │ │

    A StashKey is unique and cannot conflict with another key.

    │ │ │
    │ │ │

    Added in version 7.0.

    │ │ │
    │ │ │
    │ │ │ @@ -7605,15 +7605,15 @@ │ │ │
    │ │ │
    │ │ │ collect_ignore
    │ │ │
    │ │ │ │ │ │

    Tutorial: Customizing test collection

    │ │ │

    Can be declared in conftest.py files to exclude test directories or modules. │ │ │ -Needs to be a list of paths (str, pathlib.Path or any os.PathLike).

    │ │ │ +Needs to be a list of paths (str, pathlib.Path or any os.PathLike).

    │ │ │
    collect_ignore = ["setup.py"]
    │ │ │  
    │ │ │
    │ │ │
    │ │ │
    │ │ │ collect_ignore_glob
    │ │ │
    │ │ │ @@ -7763,35 +7763,35 @@ │ │ │ │ │ │
    │ │ │
    │ │ │

    Exceptions

    │ │ │
    │ │ │
    │ │ │ exception UsageError
    │ │ │ -

    Bases: Exception

    │ │ │ +

    Bases: Exception

    │ │ │

    Error in pytest usage or invocation.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ final exception FixtureLookupError[source]
    │ │ │ -

    Bases: LookupError

    │ │ │ +

    Bases: LookupError

    │ │ │

    Could not return a requested fixture (missing or invalid).

    │ │ │
    │ │ │
    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │

    Warnings

    │ │ │

    Custom warnings generated in some situations such as improper usage or deprecated features.

    │ │ │
    │ │ │
    │ │ │ class PytestWarning
    │ │ │ -

    Bases: UserWarning

    │ │ │ +

    Bases: UserWarning

    │ │ │

    Base class for all warnings emitted by pytest.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ class PytestAssertRewriteWarning
    │ │ │

    Bases: PytestWarning

    │ │ │ @@ -7818,22 +7818,22 @@ │ │ │

    Bases: PytestWarning

    │ │ │

    Warning emitted for configuration issues.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ class PytestDeprecationWarning
    │ │ │ -

    Bases: PytestWarning, DeprecationWarning

    │ │ │ +

    Bases: PytestWarning, DeprecationWarning

    │ │ │

    Warning class for features that will be removed in a future version.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ class PytestExperimentalApiWarning
    │ │ │ -

    Bases: PytestWarning, FutureWarning

    │ │ │ +

    Bases: PytestWarning, FutureWarning

    │ │ │

    Warning category used to denote experiments in pytest.

    │ │ │

    Use sparingly as the API might change or even be removed completely in a │ │ │ future version.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ @@ -7859,24 +7859,24 @@ │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ class PytestUnraisableExceptionWarning
    │ │ │

    Bases: PytestWarning

    │ │ │

    An unraisable exception was reported.

    │ │ │ -

    Unraisable exceptions are exceptions raised in __del__ │ │ │ +

    Unraisable exceptions are exceptions raised in __del__ │ │ │ implementations and similar situations when the exception cannot be raised │ │ │ as normal.

    │ │ │
    │ │ │ │ │ │
    │ │ │
    │ │ │ class PytestUnhandledThreadExceptionWarning
    │ │ │

    Bases: PytestWarning

    │ │ │ -

    An unhandled exception occurred in a Thread.

    │ │ │ +

    An unhandled exception occurred in a Thread.

    │ │ │

    Such exceptions don't propagate normally.

    │ │ │
    │ │ │ │ │ │

    Consult the Internal pytest warnings section in the documentation for more information.

    │ │ │
    │ │ │
    │ │ │

    Configuration Options

    │ │ │ @@ -8166,15 +8166,15 @@ │ │ │
    │ │ │
    Type:
    │ │ │
    bool
    │ │ │
    Default:
    │ │ │
    false
    │ │ │
    │ │ │

    Exit the pytest process after the per-test timeout is reached by passing │ │ │ -exit=True to the faulthandler.dump_traceback_later() function. This │ │ │ +exit=True to the faulthandler.dump_traceback_later() function. This │ │ │ is particularly useful to avoid wasting CI resources for test suites that │ │ │ are prone to putting the main Python interpreter into a deadlock state.

    │ │ │
    │ │ │
    │ │ │
    [pytest]
    │ │ │  faulthandler_timeout = 5
    │ │ │  faulthandler_exit_on_timeout = true
    │ │ │ @@ -8197,15 +8197,15 @@
    │ │ │  
    │ │ │
    Type:
    │ │ │
    float
    │ │ │
    Default:
    │ │ │
    0 (disabled)
    │ │ │
    │ │ │

    Dumps the tracebacks of all threads if a test takes longer than X seconds to run (including │ │ │ -fixture setup and teardown). Implemented using the faulthandler.dump_traceback_later() function, │ │ │ +fixture setup and teardown). Implemented using the faulthandler.dump_traceback_later() function, │ │ │ so all caveats there apply.

    │ │ │
    │ │ │
    │ │ │
    [pytest]
    │ │ │  faulthandler_timeout = 5
    │ │ │  
    │ │ │
    │ │ │ @@ -8524,15 +8524,15 @@ │ │ │ log_cli_date_format │ │ │
    │ │ │
    Type:
    │ │ │
    str
    │ │ │
    Default:
    │ │ │
    Fallback to log_date_format
    │ │ │
    │ │ │ -

    Sets a time.strftime()-compatible string that will be used when formatting dates for live logging.

    │ │ │ +

    Sets a time.strftime()-compatible string that will be used when formatting dates for live logging.

    │ │ │
    │ │ │
    │ │ │
    [pytest]
    │ │ │  log_cli_date_format = "%Y-%m-%d %H:%M:%S"
    │ │ │  
    │ │ │
    │ │ │
    │ │ │ @@ -8551,15 +8551,15 @@ │ │ │ log_cli_format │ │ │
    │ │ │
    Type:
    │ │ │
    str
    │ │ │
    Default:
    │ │ │
    Fallback to log_format
    │ │ │
    │ │ │ -

    Sets a logging-compatible string used to format live logging messages.

    │ │ │ +

    Sets a logging-compatible string used to format live logging messages.

    │ │ │
    │ │ │
    │ │ │
    [pytest]
    │ │ │  log_cli_format = "%(asctime)s %(levelname)s %(message)s"
    │ │ │  
    │ │ │
    │ │ │
    │ │ │ @@ -8609,15 +8609,15 @@ │ │ │ log_date_format │ │ │
    │ │ │
    Type:
    │ │ │
    str
    │ │ │
    Default:
    │ │ │
    "%H:%M:%S"
    │ │ │
    │ │ │ -

    Sets a time.strftime()-compatible string that will be used when formatting dates for logging capture.

    │ │ │ +

    Sets a time.strftime()-compatible string that will be used when formatting dates for logging capture.

    │ │ │
    │ │ │
    │ │ │
    [pytest]
    │ │ │  log_date_format = "%Y-%m-%d %H:%M:%S"
    │ │ │  
    │ │ │
    │ │ │
    │ │ │ @@ -8662,15 +8662,15 @@ │ │ │ log_file_date_format │ │ │
    │ │ │
    Type:
    │ │ │
    str
    │ │ │
    Default:
    │ │ │
    Fallback to log_date_format
    │ │ │
    │ │ │ -

    Sets a time.strftime()-compatible string that will be used when formatting dates for the logging file.

    │ │ │ +

    Sets a time.strftime()-compatible string that will be used when formatting dates for the logging file.

    │ │ │
    │ │ │
    │ │ │
    [pytest]
    │ │ │  log_file_date_format = "%Y-%m-%d %H:%M:%S"
    │ │ │  
    │ │ │
    │ │ │
    │ │ │ @@ -8689,15 +8689,15 @@ │ │ │ log_file_format │ │ │
    │ │ │
    Type:
    │ │ │
    str
    │ │ │
    Default:
    │ │ │
    Fallback to log_format
    │ │ │
    │ │ │ -

    Sets a logging-compatible string used to format logging messages redirected to the logging file.

    │ │ │ +

    Sets a logging-compatible string used to format logging messages redirected to the logging file.

    │ │ │
    │ │ │
    │ │ │
    [pytest]
    │ │ │  log_file_format = "%(asctime)s %(levelname)s %(message)s"
    │ │ │  
    │ │ │
    │ │ │
    │ │ │ @@ -8774,15 +8774,15 @@ │ │ │ log_format │ │ │
    │ │ │
    Type:
    │ │ │
    str
    │ │ │
    Default:
    │ │ │
    %(levelname)-8s %(name)s:%(filename)s:%(lineno)d %(message)s
    │ │ │
    │ │ │ -

    Sets a logging-compatible string used to format captured logging messages.

    │ │ │ +

    Sets a logging-compatible string used to format captured logging messages.

    │ │ │
    │ │ │
    │ │ │
    [pytest]
    │ │ │  log_format = "%(asctime)s %(levelname)s %(message)s"
    │ │ │  
    │ │ │
    │ │ │
    │ │ │ @@ -9036,16 +9036,16 @@ │ │ │
    │ │ │ pythonpath
    │ │ │
    │ │ │
    Type:
    │ │ │
    list[str]
    │ │ │
    │ │ │

    Sets list of directories that should be added to the python search path. │ │ │ -Directories will be added to the head of sys.path. │ │ │ -Similar to the PYTHONPATH environment variable, the directories will be │ │ │ +Directories will be added to the head of sys.path. │ │ │ +Similar to the PYTHONPATH environment variable, the directories will be │ │ │ included in where Python will look for imported modules. │ │ │ Paths are relative to the rootdir directory. │ │ │ Directories remain in path for the duration of the test session.

    │ │ │
    │ │ │
    │ │ │
    [pytest]
    │ │ │  pythonpath = ["src1", "src2"]
    │ │ │ ├── html2text {}
    │ │ │ │ @@ -103,16 +103,16 @@
    │ │ │ │  >>> pytest.version_tuple
    │ │ │ │  (7, 0, '0rc1')
    │ │ │ │  ********** FFuunnccttiioonnss_?¶ **********
    │ │ │ │  ******** ppyytteesstt..aapppprrooxx_?¶ ********
    │ │ │ │    approx(eexxppeecctteedd, rreell==NNoonnee, aabbss==NNoonnee, nnaann__ookk==FFaallssee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Assert that two numbers (or two ordered sequences of numbers) are equal
    │ │ │ │        to each other within some tolerance.
    │ │ │ │ -      Due to the python:tutorial/floatingpoint, numbers that we would
    │ │ │ │ -      intuitively expect to be equal are not always so:
    │ │ │ │ +      Due to the _F_l_o_a_t_i_n_g_-_P_o_i_n_t_ _A_r_i_t_h_m_e_t_i_c_:_ _I_s_s_u_e_s_ _a_n_d_ _L_i_m_i_t_a_t_i_o_n_s, numbers
    │ │ │ │ +      that we would intuitively expect to be equal are not always so:
    │ │ │ │        >>> 0.1 + 0.2 == 0.3
    │ │ │ │        False
    │ │ │ │        This problem is commonly encountered when writing tests, e.g. when making
    │ │ │ │        sure that floating-point values are what you expect them to be. One way
    │ │ │ │        to deal with this problem is to assert that two floating-point numbers
    │ │ │ │        are equal to within some appropriate tolerance:
    │ │ │ │        >>> abs((0.1 + 0.2) - 0.3) < 1e-6
    │ │ │ │ @@ -190,16 +190,16 @@
    │ │ │ │        "optional": None})
    │ │ │ │        True
    │ │ │ │        >>> [None, 1.0000005] == approx([None,1])
    │ │ │ │        True
    │ │ │ │        >>> ["foo", 1.0000005] == approx([None,1])
    │ │ │ │        False
    │ │ │ │        ddaatteettiimmee aanndd ttiimmeeddeellttaa
    │ │ │ │ -      You can also use approx to compare datetime and timedelta objects by
    │ │ │ │ -      specifying an absolute tolerance as a timedelta:
    │ │ │ │ +      You can also use approx to compare _d_a_t_e_t_i_m_e and _t_i_m_e_d_e_l_t_a objects by
    │ │ │ │ +      specifying an absolute tolerance as a _t_i_m_e_d_e_l_t_a:
    │ │ │ │        >>> from datetime import datetime, timedelta
    │ │ │ │        >>> dt1 = datetime(2024, 1, 1, 12, 0, 0)
    │ │ │ │        >>> dt2 = datetime(2024, 1, 1, 12, 0, 0, 500000)
    │ │ │ │        >>> dt1 == approx(dt2, abs=timedelta(seconds=1))
    │ │ │ │        True
    │ │ │ │        Note that rel is not supported for datetime comparisons. For timedelta
    │ │ │ │        comparisons, rel is a number (not a timedelta) that represents a relative
    │ │ │ │ @@ -212,68 +212,67 @@
    │ │ │ │        agree for the most part, but they do have meaningful differences:
    │ │ │ │            * math.isclose(a, b, rel_tol=1e-9, abs_tol=0.0): True if the relative
    │ │ │ │              tolerance is met w.r.t. either a or b or if the absolute tolerance
    │ │ │ │              is met. Because the relative tolerance is calculated w.r.t. both a
    │ │ │ │              and b, this test is symmetric (i.e. neither a nor b is a "reference
    │ │ │ │              value"). You have to specify an absolute tolerance if you want to
    │ │ │ │              compare to 0.0 because there is no tolerance by default. More
    │ │ │ │ -            information: math.isclose().
    │ │ │ │ +            information: _m_a_t_h_._i_s_c_l_o_s_e_(_).
    │ │ │ │            * numpy.isclose(a, b, rtol=1e-5, atol=1e-8): True if the difference
    │ │ │ │              between a and b is less that the sum of the relative tolerance
    │ │ │ │              w.r.t. b and the absolute tolerance. Because the relative tolerance
    │ │ │ │              is only calculated w.r.t. b, this test is asymmetric and you can
    │ │ │ │              think of b as the reference value. Support for comparing sequences
    │ │ │ │ -            is provided by numpy.allclose(). More information: numpy:reference/
    │ │ │ │ -            generated/numpy.isclose.
    │ │ │ │ +            is provided by _n_u_m_p_y_._a_l_l_c_l_o_s_e_(_). More information: _n_u_m_p_y_._i_s_c_l_o_s_e.
    │ │ │ │            * unittest.TestCase.assertAlmostEqual(a, b): True if a and b are
    │ │ │ │              within an absolute tolerance of 1e-7. No relative tolerance is
    │ │ │ │              considered , so this function is not appropriate for very large or
    │ │ │ │              very small numbers. Also, it's only available in subclasses of
    │ │ │ │              unittest.TestCase and it's ugly because it doesn't follow PEP8.
    │ │ │ │ -            More information: unittest.TestCase.assertAlmostEqual().
    │ │ │ │ +            More information: _u_n_i_t_t_e_s_t_._T_e_s_t_C_a_s_e_._a_s_s_e_r_t_A_l_m_o_s_t_E_q_u_a_l_(_).
    │ │ │ │            * a == pytest.approx(b, rel=1e-6, abs=1e-12): True if the relative
    │ │ │ │              tolerance is met w.r.t. b or if the absolute tolerance is met.
    │ │ │ │              Because the relative tolerance is only calculated w.r.t. b, this
    │ │ │ │              test is asymmetric and you can think of b as the reference value.
    │ │ │ │              In the special case that you explicitly specify an absolute
    │ │ │ │              tolerance but not a relative tolerance, only the absolute tolerance
    │ │ │ │              is considered.
    │ │ │ │        Note
    │ │ │ │        approx can handle numpy arrays, but we recommend the specialised test
    │ │ │ │ -      helpers in numpy:reference/routines.testing if you need support for
    │ │ │ │ +      helpers in _T_e_s_t_ _s_u_p_p_o_r_t_ _(_n_u_m_p_y_._t_e_s_t_i_n_g_) if you need support for
    │ │ │ │        comparisons, NaNs, or ULP-based tolerances.
    │ │ │ │        To match strings using regex, you can use _M_a_t_c_h_e_s from the _r_e___a_s_s_e_r_t
    │ │ │ │        _p_a_c_k_a_g_e.
    │ │ │ │        Note
    │ │ │ │        Unlike built-in equality, this function considers booleans unequal to
    │ │ │ │        numeric zero or one. For example:
    │ │ │ │        >>> 1 == approx(True)
    │ │ │ │        False
    │ │ │ │        Warning
    │ │ │ │        Changed in version 3.2.
    │ │ │ │ -      In order to avoid inconsistent behavior, TypeError is raised for >, >=, <
    │ │ │ │ +      In order to avoid inconsistent behavior, _T_y_p_e_E_r_r_o_r is raised for >, >=, <
    │ │ │ │        and <= comparisons. The example below illustrates the problem:
    │ │ │ │        assert approx(0.1) > 0.1 + 1e-10  # calls approx(0.1).__gt__(0.1 + 1e-10)
    │ │ │ │        assert 0.1 + 1e-10 > approx(0.1)  # calls approx(0.1).__lt__(0.1 + 1e-10)
    │ │ │ │        In the second example one expects approx(0.1).__le__(0.1 + 1e-10) to be
    │ │ │ │        called. But instead, approx(0.1).__lt__(0.1 + 1e-10) is used to
    │ │ │ │        comparison. This is because the call hierarchy of rich comparisons
    │ │ │ │ -      follows a fixed behavior. More information: object.__ge__()
    │ │ │ │ +      follows a fixed behavior. More information: _o_b_j_e_c_t_._____g_e_____(_)
    │ │ │ │        Changed in version 3.7.1: approx raises TypeError when it encounters a
    │ │ │ │        dict value or sequence element of non-numeric type.
    │ │ │ │        Changed in version 6.1.0: approx falls back to strict equality for non-
    │ │ │ │        numeric types instead of raising TypeError.
    │ │ │ │  ******** ppyytteesstt..ffaaiill_?¶ ********
    │ │ │ │  TTuuttoorriiaall: _H_o_w_ _t_o_ _u_s_e_ _s_k_i_p_ _a_n_d_ _x_f_a_i_l_ _t_o_ _d_e_a_l_ _w_i_t_h_ _t_e_s_t_s_ _t_h_a_t_ _c_a_n_n_o_t_ _s_u_c_c_e_e_d
    │ │ │ │    fail(rreeaassoonn[, ppyyttrraaccee==TTrruuee])_¶
    │ │ │ │        Explicitly fail an executing test with the given message.
    │ │ │ │          Parameters:
    │ │ │ │ -                * rreeaassoonn (ssttrr) -- The message to show the user as reason for
    │ │ │ │ +                * rreeaassoonn (_ss_tt_rr) -- The message to show the user as reason for
    │ │ │ │                    the failure.
    │ │ │ │ -                * ppyyttrraaccee (bbooooll) -- If False, msg represents the full failure
    │ │ │ │ +                * ppyyttrraaccee (_bb_oo_oo_ll) -- If False, msg represents the full failure
    │ │ │ │                    information and no python traceback will be reported.
    │ │ │ │          Raises:
    │ │ │ │              _pp_yy_tt_ee_ss_tt_.._ff_aa_ii_ll_.._EE_xx_cc_ee_pp_tt_ii_oo_nn -- The exception that is raised.
    │ │ │ │    ccllaassss pytest.fail.Exception_¶
    │ │ │ │        The exception raised by _p_y_t_e_s_t_._f_a_i_l_(_).
    │ │ │ │  ******** ppyytteesstt..sskkiipp_?¶ ********
    │ │ │ │    skip(rreeaassoonn[, aallllooww__mmoodduullee__lleevveell==FFaallssee])_¶
    │ │ │ │ @@ -283,80 +282,80 @@
    │ │ │ │        function can be called in doctests as well.
    │ │ │ │          Raises:
    │ │ │ │              _pp_yy_tt_ee_ss_tt_.._ss_kk_ii_pp_.._EE_xx_cc_ee_pp_tt_ii_oo_nn -- The exception that is raised.
    │ │ │ │        Note
    │ │ │ │        It is better to use the _p_y_t_e_s_t_._m_a_r_k_._s_k_i_p_i_f marker when possible to
    │ │ │ │        declare a test to be skipped under certain conditions like mismatching
    │ │ │ │        platforms or dependencies. Similarly, use the # doctest: +SKIP directive
    │ │ │ │ -      (see doctest.SKIP) to skip a doctest statically.
    │ │ │ │ +      (see _d_o_c_t_e_s_t_._S_K_I_P) to skip a doctest statically.
    │ │ │ │    ccllaassss pytest.skip.Exception_¶
    │ │ │ │        The exception raised by _p_y_t_e_s_t_._s_k_i_p_(_).
    │ │ │ │  ******** ppyytteesstt..iimmppoorrttoorrsskkiipp_?¶ ********
    │ │ │ │    importorskip(mmooddnnaammee, mmiinnvveerrssiioonn==NNoonnee, rreeaassoonn==NNoonnee, **, eexxcc__ttyyppee==NNoonnee)
    │ │ │ │    _[_s_o_u_r_c_e_]_¶
    │ │ │ │        Import and return the requested module modname, or skip the current test
    │ │ │ │        if the module cannot be imported.
    │ │ │ │          Returns:
    │ │ │ │              The imported module. This should be assigned to its canonical name.
    │ │ │ │          Raises:
    │ │ │ │              _pp_yy_tt_ee_ss_tt_.._ss_kk_ii_pp_.._EE_xx_cc_ee_pp_tt_ii_oo_nn -- If the module cannot be imported.
    │ │ │ │          Return type:
    │ │ │ │ -            AAnnyy
    │ │ │ │ +            _AA_nn_yy
    │ │ │ │        Example:
    │ │ │ │        docutils = pytest.importorskip("docutils")
    │ │ │ │        Added in version 8.2: The exc_type parameter.
    │ │ │ │        Changed in version 9.1: The default for exc_type is now
    │ │ │ │ -      ModuleNotFoundError.
    │ │ │ │ +      _M_o_d_u_l_e_N_o_t_F_o_u_n_d_E_r_r_o_r.
    │ │ │ │  ******** ppyytteesstt..xxffaaiill_?¶ ********
    │ │ │ │    xfail(rreeaassoonn=='''')_¶
    │ │ │ │        Imperatively xfail an executing test or setup function with the given
    │ │ │ │        reason.
    │ │ │ │        This function should be called only during testing (setup, call or
    │ │ │ │        teardown).
    │ │ │ │        No other code is executed after using xfail() (it is implemented
    │ │ │ │        internally by raising an exception).
    │ │ │ │          Parameters:
    │ │ │ │ -            rreeaassoonn (ssttrr) -- The message to show the user as reason for the
    │ │ │ │ +            rreeaassoonn (_ss_tt_rr) -- The message to show the user as reason for the
    │ │ │ │              xfail.
    │ │ │ │        Note
    │ │ │ │        It is better to use the _p_y_t_e_s_t_._m_a_r_k_._x_f_a_i_l marker when possible to declare
    │ │ │ │        a test to be xfailed under certain conditions like known bugs or missing
    │ │ │ │        features.
    │ │ │ │          Raises:
    │ │ │ │              _pp_yy_tt_ee_ss_tt_.._xx_ff_aa_ii_ll_.._EE_xx_cc_ee_pp_tt_ii_oo_nn -- The exception that is raised.
    │ │ │ │    ccllaassss pytest.xfail.Exception_¶
    │ │ │ │        The exception raised by _p_y_t_e_s_t_._x_f_a_i_l_(_).
    │ │ │ │  ******** ppyytteesstt..eexxiitt_?¶ ********
    │ │ │ │    exit(rreeaassoonn[, rreettuurrnnccooddee==NNoonnee])_¶
    │ │ │ │        Exit testing process.
    │ │ │ │          Parameters:
    │ │ │ │ -                * rreeaassoonn (ssttrr) -- The message to show as the reason for exiting
    │ │ │ │ +                * rreeaassoonn (_ss_tt_rr) -- The message to show as the reason for exiting
    │ │ │ │                    pytest. reason has a default value only because msg is
    │ │ │ │                    deprecated.
    │ │ │ │ -                * rreettuurrnnccooddee (iinntt || NNoonnee) -- Return code to be used when
    │ │ │ │ +                * rreettuurrnnccooddee (_ii_nn_tt || NNoonnee) -- Return code to be used when
    │ │ │ │                    exiting pytest. None means the same as 0 (no error), same as
    │ │ │ │ -                  sys.exit().
    │ │ │ │ +                  _s_y_s_._e_x_i_t_(_).
    │ │ │ │          Raises:
    │ │ │ │              _pp_yy_tt_ee_ss_tt_.._ee_xx_ii_tt_.._EE_xx_cc_ee_pp_tt_ii_oo_nn -- The exception that is raised.
    │ │ │ │    ccllaassss pytest.exit.Exception_¶
    │ │ │ │        The exception raised by _p_y_t_e_s_t_._e_x_i_t_(_).
    │ │ │ │  ******** ppyytteesstt..mmaaiinn_?¶ ********
    │ │ │ │  TTuuttoorriiaall: _C_a_l_l_i_n_g_ _p_y_t_e_s_t_ _f_r_o_m_ _P_y_t_h_o_n_ _c_o_d_e
    │ │ │ │    main(aarrggss==NNoonnee, pplluuggiinnss==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Perform an in-process test run.
    │ │ │ │          Parameters:
    │ │ │ │ -                * aarrggss (lliisstt[[ssttrr]] || PPaatthhLLiikkee[[ssttrr]] || NNoonnee) -- List of command
    │ │ │ │ +                * aarrggss (_ll_ii_ss_tt[[_ss_tt_rr]] || _PP_aa_tt_hh_LL_ii_kk_ee[[_ss_tt_rr]] || NNoonnee) -- List of command
    │ │ │ │                    line arguments. If None or not given, defaults to reading
    │ │ │ │ -                  arguments directly from the process command line (sys.argv).
    │ │ │ │ -                * pplluuggiinnss (SSeeqquueennccee[[ssttrr || oobbjjeecctt]] || NNoonnee) -- List of plugin
    │ │ │ │ +                  arguments directly from the process command line (_s_y_s_._a_r_g_v).
    │ │ │ │ +                * pplluuggiinnss (_SS_ee_qq_uu_ee_nn_cc_ee[[_ss_tt_rr || _oo_bb_jj_ee_cc_tt]] || NNoonnee) -- List of plugin
    │ │ │ │                    objects to be auto-registered during initialization.
    │ │ │ │          Returns:
    │ │ │ │              An exit code.
    │ │ │ │          Return type:
    │ │ │ │ -            int | _EE_xx_ii_tt_CC_oo_dd_ee
    │ │ │ │ +            _i_n_t | _EE_xx_ii_tt_CC_oo_dd_ee
    │ │ │ │  ******** ppyytteesstt..ppaarraamm_?¶ ********
    │ │ │ │    param(**vvaalluueess[, iidd][, mmaarrkkss])_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Specify a parameter in _p_y_t_e_s_t_._m_a_r_k_._p_a_r_a_m_e_t_r_i_z_e calls or _p_a_r_a_m_e_t_r_i_z_e_d
    │ │ │ │        _f_i_x_t_u_r_e_s.
    │ │ │ │        @pytest.mark.parametrize(
    │ │ │ │            "test_input,expected",
    │ │ │ │            [
    │ │ │ │ @@ -375,15 +374,15 @@
    │ │ │ │    register_assert_rewrite(**nnaammeess)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Register one or more module names to be rewritten on import.
    │ │ │ │        This function will make sure that this module or all modules inside the
    │ │ │ │        package will get their assert statements rewritten. Thus you should make
    │ │ │ │        sure to call this before the module is actually imported, usually in your
    │ │ │ │        __init__.py if you are a plugin using a package.
    │ │ │ │          Parameters:
    │ │ │ │ -            nnaammeess (ssttrr) -- The module names to register.
    │ │ │ │ +            nnaammeess (_ss_tt_rr) -- The module names to register.
    │ │ │ │  ******** ppyytteesstt..rreeggiisstteerr__ffiixxttuurree_?¶ ********
    │ │ │ │    register_fixture(**, nnaammee, ffuunncc, nnooddee, ssccooppee==''ffuunnccttiioonn'', ppaarraammss==NNoonnee,
    │ │ │ │    iiddss==NNoonnee, aauuttoouussee==FFaallssee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Register a fixture imperatively.
    │ │ │ │        This is an advanced function intended for use by plugins.
    │ │ │ │        Normally, fixtures should be registered declaratively using the
    │ │ │ │        @pytest.fixture decorator. Pytest looks for these fixture definitions
    │ │ │ │ @@ -411,23 +410,23 @@
    │ │ │ │  TTuuttoorriiaall: _H_o_w_ _t_o_ _p_a_r_a_m_e_t_r_i_z_e_ _f_i_x_t_u_r_e_s_ _a_n_d_ _t_e_s_t_ _f_u_n_c_t_i_o_n_s
    │ │ │ │  This mark has the same signature as _p_y_t_e_s_t_._M_e_t_a_f_u_n_c_._p_a_r_a_m_e_t_r_i_z_e_(_); see there.
    │ │ │ │  ******** ppyytteesstt..mmaarrkk..sskkiipp_?¶ ********
    │ │ │ │  TTuuttoorriiaall: _S_k_i_p_p_i_n_g_ _t_e_s_t_ _f_u_n_c_t_i_o_n_s
    │ │ │ │  Unconditionally skip a test function.
    │ │ │ │    pytest.mark.skip(rreeaassoonn==NNoonnee)_¶
    │ │ │ │          Parameters:
    │ │ │ │ -            rreeaassoonn (ssttrr) -- Reason why the test function is being skipped.
    │ │ │ │ +            rreeaassoonn (_ss_tt_rr) -- Reason why the test function is being skipped.
    │ │ │ │  ******** ppyytteesstt..mmaarrkk..sskkiippiiff_?¶ ********
    │ │ │ │  TTuuttoorriiaall: _S_k_i_p_p_i_n_g_ _t_e_s_t_ _f_u_n_c_t_i_o_n_s
    │ │ │ │  Skip a test function if a condition is True.
    │ │ │ │    pytest.mark.skipif(ccoonnddiittiioonn, **, rreeaassoonn==NNoonnee)_¶
    │ │ │ │          Parameters:
    │ │ │ │ -                * ccoonnddiittiioonn (bbooooll oorr ssttrr) -- True/False if the condition should
    │ │ │ │ +                * ccoonnddiittiioonn (_bb_oo_oo_ll oorr _ss_tt_rr) -- True/False if the condition should
    │ │ │ │                    be skipped or a _c_o_n_d_i_t_i_o_n_ _s_t_r_i_n_g.
    │ │ │ │ -                * rreeaassoonn (ssttrr) -- Reason why the test function is being
    │ │ │ │ +                * rreeaassoonn (_ss_tt_rr) -- Reason why the test function is being
    │ │ │ │                    skipped.
    │ │ │ │  ******** ppyytteesstt..mmaarrkk..uusseeffiixxttuurreess_?¶ ********
    │ │ │ │  TTuuttoorriiaall: _U_s_e_ _f_i_x_t_u_r_e_s_ _i_n_ _c_l_a_s_s_e_s_ _a_n_d_ _m_o_d_u_l_e_s_ _w_i_t_h_ _u_s_e_f_i_x_t_u_r_e_s
    │ │ │ │  Mark a test function as using the given fixture names.
    │ │ │ │    pytest.mark.usefixtures(**nnaammeess)_¶
    │ │ │ │          Parameters:
    │ │ │ │              aarrggss -- The names of the fixture to use, as strings.
    │ │ │ │ @@ -485,73 +484,73 @@
    │ │ │ │    ffiinnaall ccllaassss LogCaptureFixture_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Provides access and control of log capturing.
    │ │ │ │          pprrooppeerrttyy handler:: LLooggCCaappttuurreeHHaannddlleerr_¶
    │ │ │ │              Get the logging handler used by the fixture.
    │ │ │ │          get_records(wwhheenn)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Get the logging records for one of the possible test phases.
    │ │ │ │                Parameters:
    │ │ │ │ -                  wwhheenn (LLiitteerraall[[''sseettuupp'',, ''ccaallll'',, ''tteeaarrddoowwnn'']]) -- Which test
    │ │ │ │ +                  wwhheenn (_LL_ii_tt_ee_rr_aa_ll[[''sseettuupp'',, ''ccaallll'',, ''tteeaarrddoowwnn'']]) -- Which test
    │ │ │ │                    phase to obtain the records from. Valid values are: "setup",
    │ │ │ │                    "call" and "teardown".
    │ │ │ │                Returns:
    │ │ │ │                    The list of captured records at the given stage.
    │ │ │ │                Return type:
    │ │ │ │ -                  list[LLooggRReeccoorrdd]
    │ │ │ │ +                  _l_i_s_t[_LL_oo_gg_RR_ee_cc_oo_rr_dd]
    │ │ │ │              Added in version 3.4.
    │ │ │ │ -        pprrooppeerrttyy text:: ssttrr_¶
    │ │ │ │ +        pprrooppeerrttyy text:: _ss_tt_rr_¶
    │ │ │ │              The formatted log text.
    │ │ │ │ -        pprrooppeerrttyy records:: lliisstt[[LLooggRReeccoorrdd]]_¶
    │ │ │ │ +        pprrooppeerrttyy records:: _ll_ii_ss_tt[[_LL_oo_gg_RR_ee_cc_oo_rr_dd]]_¶
    │ │ │ │              The list of log records.
    │ │ │ │ -        pprrooppeerrttyy record_tuples:: lliisstt[[ttuuppllee[[ssttrr,, iinntt,, ssttrr]]]]_¶
    │ │ │ │ +        pprrooppeerrttyy record_tuples:: _ll_ii_ss_tt[[_tt_uu_pp_ll_ee[[_ss_tt_rr,, _ii_nn_tt,, _ss_tt_rr]]]]_¶
    │ │ │ │              A list of a stripped down version of log records intended for use
    │ │ │ │              in assertion comparison.
    │ │ │ │              The format of the tuple is:
    │ │ │ │                   (logger_name, log_level, message)
    │ │ │ │ -        pprrooppeerrttyy messages:: lliisstt[[ssttrr]]_¶
    │ │ │ │ +        pprrooppeerrttyy messages:: _ll_ii_ss_tt[[_ss_tt_rr]]_¶
    │ │ │ │              A list of format-interpolated log messages.
    │ │ │ │              Unlike 'records', which contains the format string and parameters
    │ │ │ │              for interpolation, log messages in this list are all interpolated.
    │ │ │ │              Unlike 'text', which contains the output from the handler, log
    │ │ │ │              messages in this list are unadorned with levels, timestamps, etc,
    │ │ │ │              making exact comparisons more reliable.
    │ │ │ │ -            Note that traceback or stack info (from logging.exception() or the
    │ │ │ │ +            Note that traceback or stack info (from _l_o_g_g_i_n_g_._e_x_c_e_p_t_i_o_n_(_) or the
    │ │ │ │              exc_info or stack_info arguments to the logging functions) is not
    │ │ │ │              included, as this is added by the formatter in the handler.
    │ │ │ │              Added in version 3.7.
    │ │ │ │          clear()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Reset the list of log records and the captured log text.
    │ │ │ │          set_level(lleevveell, llooggggeerr==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Set the threshold level of a logger for the duration of a test.
    │ │ │ │              Logging messages which are less severe than this level will not be
    │ │ │ │              captured.
    │ │ │ │              Changed in version 3.4: The levels of the loggers changed by this
    │ │ │ │              function will be restored to their initial values at the end of the
    │ │ │ │              test.
    │ │ │ │              Will enable the requested logging level if it was disabled via
    │ │ │ │ -            logging.disable().
    │ │ │ │ +            _l_o_g_g_i_n_g_._d_i_s_a_b_l_e_(_).
    │ │ │ │                Parameters:
    │ │ │ │ -                      * lleevveell (iinntt || ssttrr) -- The level.
    │ │ │ │ -                      * llooggggeerr (ssttrr || NNoonnee) -- The logger to update. If not
    │ │ │ │ +                      * lleevveell (_ii_nn_tt || _ss_tt_rr) -- The level.
    │ │ │ │ +                      * llooggggeerr (_ss_tt_rr || NNoonnee) -- The logger to update. If not
    │ │ │ │                          given, the root logger.
    │ │ │ │          at_level(lleevveell, llooggggeerr==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Context manager that sets the level for capturing of logs. After
    │ │ │ │              the end of the 'with' statement the level is restored to its
    │ │ │ │              original value.
    │ │ │ │              Will enable the requested logging level if it was disabled via
    │ │ │ │ -            logging.disable().
    │ │ │ │ +            _l_o_g_g_i_n_g_._d_i_s_a_b_l_e_(_).
    │ │ │ │                Parameters:
    │ │ │ │ -                      * lleevveell (iinntt || ssttrr) -- The level.
    │ │ │ │ -                      * llooggggeerr (ssttrr || NNoonnee) -- The logger to update. If not
    │ │ │ │ +                      * lleevveell (_ii_nn_tt || _ss_tt_rr) -- The level.
    │ │ │ │ +                      * llooggggeerr (_ss_tt_rr || NNoonnee) -- The logger to update. If not
    │ │ │ │                          given, the root logger.
    │ │ │ │          filtering(ffiilltteerr__)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Context manager that temporarily adds the given filter to the
    │ │ │ │              caplog's _h_a_n_d_l_e_r_(_) for the 'with' statement block, and removes that
    │ │ │ │              filter at the end of the block.
    │ │ │ │                Parameters:
    │ │ │ │ -                  ffiilltteerr -- A custom logging.Filter object.
    │ │ │ │ +                  ffiilltteerr -- A custom _l_o_g_g_i_n_g_._F_i_l_t_e_r object.
    │ │ │ │              Added in version 7.5.
    │ │ │ │  ******** ccaappssyyss_?¶ ********
    │ │ │ │  TTuuttoorriiaall: _H_o_w_ _t_o_ _c_a_p_t_u_r_e_ _s_t_d_o_u_t_/_s_t_d_e_r_r_ _o_u_t_p_u_t
    │ │ │ │    ccllaassss CaptureFixture_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Object returned by the _c_a_p_s_y_s, _c_a_p_s_y_s_b_i_n_a_r_y, _c_a_p_f_d and _c_a_p_f_d_b_i_n_a_r_y
    │ │ │ │        fixtures.
    │ │ │ │          readouterr()_[_s_o_u_r_c_e_]_¶
    │ │ │ │ @@ -569,52 +568,52 @@
    │ │ │ │  ******** ccaappssyyssbbiinnaarryy_?¶ ********
    │ │ │ │  TTuuttoorriiaall: _H_o_w_ _t_o_ _c_a_p_t_u_r_e_ _s_t_d_o_u_t_/_s_t_d_e_r_r_ _o_u_t_p_u_t
    │ │ │ │  ******** ccoonnffiigg..ccaacchhee_?¶ ********
    │ │ │ │  TTuuttoorriiaall: _H_o_w_ _t_o_ _r_e_-_r_u_n_ _f_a_i_l_e_d_ _t_e_s_t_s_ _a_n_d_ _m_a_i_n_t_a_i_n_ _s_t_a_t_e_ _b_e_t_w_e_e_n_ _t_e_s_t_ _r_u_n_s
    │ │ │ │  The config.cache object allows other plugins and fixtures to store and retrieve
    │ │ │ │  values across test runs. To access it from fixtures request pytestconfig into
    │ │ │ │  your fixture and get it with pytestconfig.cache.
    │ │ │ │ -Under the hood, the cache plugin uses the simple dumps/loads API of the json
    │ │ │ │ +Under the hood, the cache plugin uses the simple dumps/loads API of the _j_s_o_n
    │ │ │ │  stdlib module.
    │ │ │ │  config.cache is an instance of _p_y_t_e_s_t_._C_a_c_h_e:
    │ │ │ │    ffiinnaall ccllaassss Cache_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Instance of the cache fixture.
    │ │ │ │          mkdir(nnaammee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return a directory path object with the given name.
    │ │ │ │              If the directory does not yet exist, it will be created. You can
    │ │ │ │              use it to manage files to e.g. store/retrieve database dumps across
    │ │ │ │              test sessions.
    │ │ │ │              Added in version 7.0.
    │ │ │ │                Parameters:
    │ │ │ │ -                  nnaammee (ssttrr) -- Must be a string not containing a / separator.
    │ │ │ │ +                  nnaammee (_ss_tt_rr) -- Must be a string not containing a / separator.
    │ │ │ │                    Make sure the name contains your plugin or application
    │ │ │ │                    identifiers to prevent clashes with other cache users.
    │ │ │ │          get(kkeeyy, ddeeffaauulltt)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return the cached value for the given key.
    │ │ │ │              If no value was yet cached or the value cannot be read, the
    │ │ │ │              specified default is returned.
    │ │ │ │                Parameters:
    │ │ │ │ -                      * kkeeyy (ssttrr) -- Must be a / separated value. Usually the
    │ │ │ │ +                      * kkeeyy (_ss_tt_rr) -- Must be a / separated value. Usually the
    │ │ │ │                          first name is the name of your plugin or your
    │ │ │ │                          application.
    │ │ │ │                        * ddeeffaauulltt -- The value to return in case of a cache-miss
    │ │ │ │                          or invalid cache value.
    │ │ │ │          set(kkeeyy, vvaalluuee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Save value for the given key.
    │ │ │ │                Parameters:
    │ │ │ │ -                      * kkeeyy (ssttrr) -- Must be a / separated value. Usually the
    │ │ │ │ +                      * kkeeyy (_ss_tt_rr) -- Must be a / separated value. Usually the
    │ │ │ │                          first name is the name of your plugin or your
    │ │ │ │                          application.
    │ │ │ │ -                      * vvaalluuee (oobbjjeecctt) -- Must be of any combination of basic
    │ │ │ │ +                      * vvaalluuee (_oo_bb_jj_ee_cc_tt) -- Must be of any combination of basic
    │ │ │ │                          python types, including nested types like lists of
    │ │ │ │                          dictionaries.
    │ │ │ │  ******** ddoocctteesstt__nnaammeessppaaccee_?¶ ********
    │ │ │ │  TTuuttoorriiaall: _H_o_w_ _t_o_ _r_u_n_ _d_o_c_t_e_s_t_s
    │ │ │ │    doctest_namespace()_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -      Fixture that returns a dict that will be injected into the namespace of
    │ │ │ │ +      Fixture that returns a _d_i_c_t that will be injected into the namespace of
    │ │ │ │        doctests.
    │ │ │ │        Usually this fixture is used in conjunction with another autouse fixture:
    │ │ │ │        @pytest.fixture(autouse=True)
    │ │ │ │        def add_np(doctest_namespace):
    │ │ │ │            doctest_namespace["np"] = numpy
    │ │ │ │        For more details: _'_d_o_c_t_e_s_t___n_a_m_e_s_p_a_c_e_'_ _f_i_x_t_u_r_e.
    │ │ │ │  ******** mmoonnkkeeyyppaattcchh_?¶ ********
    │ │ │ │ @@ -636,38 +635,38 @@
    │ │ │ │  
    │ │ │ │              def test_partial(monkeypatch):
    │ │ │ │                  with monkeypatch.context() as m:
    │ │ │ │                      m.setattr(functools, "partial", 3)
    │ │ │ │              Useful in situations where it is desired to undo some patches
    │ │ │ │              before the test ends, such as mocking stdlib functions that might
    │ │ │ │              break pytest itself if mocked (for examples of this see _#_3_2_9_0).
    │ │ │ │ -        setattr(ttaarrggeett:: ssttrr, nnaammee:: oobbjjeecctt, vvaalluuee:: NNoottSSeettTTyyppee ==
    │ │ │ │ -        NNoottSSeettTTyyppee..ttookkeenn, rraaiissiinngg:: bbooooll == TTrruuee) → None_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -        setattr(ttaarrggeett:: oobbjjeecctt, nnaammee:: ssttrr, vvaalluuee:: oobbjjeecctt, rraaiissiinngg:: bbooooll == TTrruuee)
    │ │ │ │ -        → None
    │ │ │ │ +        setattr(ttaarrggeett:: _ss_tt_rr, nnaammee:: _oo_bb_jj_ee_cc_tt, vvaalluuee:: NNoottSSeettTTyyppee ==
    │ │ │ │ +        NNoottSSeettTTyyppee..ttookkeenn, rraaiissiinngg:: _bb_oo_oo_ll == TTrruuee) → _N_o_n_e_[_s_o_u_r_c_e_]_¶
    │ │ │ │ +        setattr(ttaarrggeett:: _oo_bb_jj_ee_cc_tt, nnaammee:: _ss_tt_rr, vvaalluuee:: _oo_bb_jj_ee_cc_tt, rraaiissiinngg:: _bb_oo_oo_ll == TTrruuee)
    │ │ │ │ +        → _N_o_n_e
    │ │ │ │              Set attribute value on target, memorizing the old value.
    │ │ │ │              For example:
    │ │ │ │              import os
    │ │ │ │  
    │ │ │ │              monkeypatch.setattr(os, "getcwd", lambda: "/")
    │ │ │ │ -            The code above replaces the os.getcwd() function by a lambda which
    │ │ │ │ +            The code above replaces the _o_s_._g_e_t_c_w_d_(_) function by a lambda which
    │ │ │ │              always returns "/".
    │ │ │ │              For convenience, you can specify a string as target which will be
    │ │ │ │              interpreted as a dotted import path, with the last part being the
    │ │ │ │              attribute name:
    │ │ │ │              monkeypatch.setattr("os.getcwd", lambda: "/")
    │ │ │ │ -            Raises AttributeError if the attribute does not exist, unless
    │ │ │ │ +            Raises _A_t_t_r_i_b_u_t_e_E_r_r_o_r if the attribute does not exist, unless
    │ │ │ │              raising is set to False.
    │ │ │ │              WWhheerree ttoo ppaattcchh
    │ │ │ │              monkeypatch.setattr works by (temporarily) changing the object that
    │ │ │ │              a name points to with another one. There can be many names pointing
    │ │ │ │              to any individual object, so for patching to work you must ensure
    │ │ │ │              that you patch the name used by the system under test.
    │ │ │ │ -            See the section Where to patch in the unittest.mock docs for a
    │ │ │ │ -            complete explanation, which is meant for unittest.mock.patch() but
    │ │ │ │ +            See the section _W_h_e_r_e_ _t_o_ _p_a_t_c_h in the _u_n_i_t_t_e_s_t_._m_o_c_k docs for a
    │ │ │ │ +            complete explanation, which is meant for _u_n_i_t_t_e_s_t_._m_o_c_k_._p_a_t_c_h_(_) but
    │ │ │ │              applies to monkeypatch.setattr as well.
    │ │ │ │          delattr(ttaarrggeett, nnaammee==NNoottSSeettTTyyppee..ttookkeenn, rraaiissiinngg==TTrruuee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Delete attribute name from target.
    │ │ │ │              If no name is specified and target is a string it will be
    │ │ │ │              interpreted as a dotted import path with the last part being the
    │ │ │ │              attribute name.
    │ │ │ │              Raises AttributeError it the attribute does not exist, unless
    │ │ │ │ @@ -687,15 +686,15 @@
    │ │ │ │              Raises KeyError if it does not exist, unless raising is set to
    │ │ │ │              False.
    │ │ │ │          syspath_prepend(ppaatthh)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Prepend path to sys.path list of import locations.
    │ │ │ │          chdir(ppaatthh)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Change the current working directory to the specified path.
    │ │ │ │                Parameters:
    │ │ │ │ -                  ppaatthh (ssttrr || PPaatthhLLiikkee[[ssttrr]]) -- The path to change into.
    │ │ │ │ +                  ppaatthh (_ss_tt_rr || _PP_aa_tt_hh_LL_ii_kk_ee[[_ss_tt_rr]]) -- The path to change into.
    │ │ │ │          undo()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Undo previous changes.
    │ │ │ │              This call consumes the undo stack. Calling it a second time has no
    │ │ │ │              effect unless you do more monkeypatching after the undo call.
    │ │ │ │              There is generally no need to call undo(), since it is called
    │ │ │ │              automatically during tear-down.
    │ │ │ │              Note
    │ │ │ │ @@ -723,15 +722,15 @@
    │ │ │ │        Facilities to write tests/configuration files, execute pytest in
    │ │ │ │        isolation, and match against expected output, perfect for black-box
    │ │ │ │        testing of pytest plugins.
    │ │ │ │        It attempts to isolate the test run from external factors as much as
    │ │ │ │        possible, modifying the current working directory to _p_a_t_h and environment
    │ │ │ │        variables during initialization.
    │ │ │ │          eexxcceeppttiioonn TimeoutExpired_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -        plugins:: lliisstt[[ssttrr || oobbjjeecctt]]_¶
    │ │ │ │ +        plugins:: _ll_ii_ss_tt[[_ss_tt_rr || _oo_bb_jj_ee_cc_tt]]_¶
    │ │ │ │              A list of plugins to use with _p_a_r_s_e_c_o_n_f_i_g_(_) and _r_u_n_p_y_t_e_s_t_(_).
    │ │ │ │              Initially this is an empty list but plugins can be added to the
    │ │ │ │              list.
    │ │ │ │              When running in subprocess mode, specify plugins by name (str) -
    │ │ │ │              adding plugin objects directly is not supported.
    │ │ │ │          pprrooppeerrttyy path:: PPaatthh_¶
    │ │ │ │              Temporary directory path used to create files/run tests from, etc.
    │ │ │ │ @@ -739,65 +738,65 @@
    │ │ │ │              Create a new _H_o_o_k_R_e_c_o_r_d_e_r for a _P_y_t_e_s_t_P_l_u_g_i_n_M_a_n_a_g_e_r.
    │ │ │ │          chdir()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Cd into the temporary directory.
    │ │ │ │              This is done automatically upon instantiation.
    │ │ │ │          makefile(eexxtt, **aarrggss, ****kkwwaarrggss)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Create new text file(s) in the test directory.
    │ │ │ │                Parameters:
    │ │ │ │ -                      * eexxtt (ssttrr) -- The extension the file(s) should use,
    │ │ │ │ +                      * eexxtt (_ss_tt_rr) -- The extension the file(s) should use,
    │ │ │ │                          including the dot, e.g. .py.
    │ │ │ │ -                      * aarrggss (ssttrr) -- All args are treated as strings and
    │ │ │ │ +                      * aarrggss (_ss_tt_rr) -- All args are treated as strings and
    │ │ │ │                          joined using newlines. The result is written as
    │ │ │ │                          contents to the file. The name of the file is based on
    │ │ │ │                          the test function requesting this fixture.
    │ │ │ │ -                      * kkwwaarrggss (ssttrr) -- Each keyword is the name of a file,
    │ │ │ │ +                      * kkwwaarrggss (_ss_tt_rr) -- Each keyword is the name of a file,
    │ │ │ │                          while the value of it will be written as contents of
    │ │ │ │                          the file.
    │ │ │ │                Returns:
    │ │ │ │                    The first created file.
    │ │ │ │                Return type:
    │ │ │ │                    PPaatthh
    │ │ │ │              Examples:
    │ │ │ │              pytester.makefile(".txt", "line1", "line2")
    │ │ │ │  
    │ │ │ │              pytester.makefile(".ini", pytest="[pytest]\naddopts=-rs\n")
    │ │ │ │ -            To create binary files, use pathlib.Path.write_bytes() directly:
    │ │ │ │ +            To create binary files, use _p_a_t_h_l_i_b_._P_a_t_h_._w_r_i_t_e___b_y_t_e_s_(_) directly:
    │ │ │ │              filename = pytester.path.joinpath("foo.bin")
    │ │ │ │              filename.write_bytes(b"...")
    │ │ │ │          makeconftest(ssoouurrccee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Write a conftest.py file.
    │ │ │ │                Parameters:
    │ │ │ │ -                  ssoouurrccee (ssttrr) -- The contents.
    │ │ │ │ +                  ssoouurrccee (_ss_tt_rr) -- The contents.
    │ │ │ │                Returns:
    │ │ │ │                    The conftest.py file.
    │ │ │ │                Return type:
    │ │ │ │                    PPaatthh
    │ │ │ │          makeini(ssoouurrccee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Write a tox.ini file.
    │ │ │ │                Parameters:
    │ │ │ │ -                  ssoouurrccee (ssttrr) -- The contents.
    │ │ │ │ +                  ssoouurrccee (_ss_tt_rr) -- The contents.
    │ │ │ │                Returns:
    │ │ │ │                    The tox.ini file.
    │ │ │ │                Return type:
    │ │ │ │                    PPaatthh
    │ │ │ │          maketoml(ssoouurrccee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Write a pytest.toml file.
    │ │ │ │                Parameters:
    │ │ │ │ -                  ssoouurrccee (ssttrr) -- The contents.
    │ │ │ │ +                  ssoouurrccee (_ss_tt_rr) -- The contents.
    │ │ │ │                Returns:
    │ │ │ │                    The pytest.toml file.
    │ │ │ │                Return type:
    │ │ │ │                    PPaatthh
    │ │ │ │              Added in version 9.0.
    │ │ │ │          getinicfg(ssoouurrccee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return the pytest section from the tox.ini config file.
    │ │ │ │          makepyprojecttoml(ssoouurrccee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Write a pyproject.toml file.
    │ │ │ │                Parameters:
    │ │ │ │ -                  ssoouurrccee (ssttrr) -- The contents.
    │ │ │ │ +                  ssoouurrccee (_ss_tt_rr) -- The contents.
    │ │ │ │                Returns:
    │ │ │ │                    The pyproject.ini file.
    │ │ │ │                Return type:
    │ │ │ │                    PPaatthh
    │ │ │ │              Added in version 6.0.
    │ │ │ │          makepyfile(**aarrggss, ****kkwwaarrggss)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Shortcut for .makefile() with a .py extension.
    │ │ │ │ @@ -824,97 +823,97 @@
    │ │ │ │                  # At this point, both 'test_something.txt' & 'custom.txt' exist
    │ │ │ │              in the test directory.
    │ │ │ │          syspathinsert(ppaatthh==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Prepend a directory to sys.path, defaults to _p_a_t_h.
    │ │ │ │              This is undone automatically when this object dies at the end of
    │ │ │ │              each test.
    │ │ │ │                Parameters:
    │ │ │ │ -                  ppaatthh (ssttrr || PPaatthhLLiikkee[[ssttrr]] || NNoonnee) -- The path.
    │ │ │ │ +                  ppaatthh (_ss_tt_rr || _PP_aa_tt_hh_LL_ii_kk_ee[[_ss_tt_rr]] || NNoonnee) -- The path.
    │ │ │ │          mkdir(nnaammee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Create a new (sub)directory.
    │ │ │ │                Parameters:
    │ │ │ │ -                  nnaammee (ssttrr || PPaatthhLLiikkee[[ssttrr]]) -- The name of the directory,
    │ │ │ │ +                  nnaammee (_ss_tt_rr || _PP_aa_tt_hh_LL_ii_kk_ee[[_ss_tt_rr]]) -- The name of the directory,
    │ │ │ │                    relative to the pytester path.
    │ │ │ │                Returns:
    │ │ │ │                    The created directory.
    │ │ │ │                Return type:
    │ │ │ │ -                  pathlib.Path
    │ │ │ │ +                  _p_a_t_h_l_i_b_._P_a_t_h
    │ │ │ │          mkpydir(nnaammee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Create a new python package.
    │ │ │ │              This creates a (sub)directory with an empty __init__.py file so it
    │ │ │ │              gets recognised as a Python package.
    │ │ │ │          copy_example(nnaammee==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Copy file from project's directory into the testdir.
    │ │ │ │                Parameters:
    │ │ │ │ -                  nnaammee (ssttrr || NNoonnee) -- The name of the file to copy.
    │ │ │ │ +                  nnaammee (_ss_tt_rr || NNoonnee) -- The name of the file to copy.
    │ │ │ │                Returns:
    │ │ │ │                    Path to the copied directory (inside self.path).
    │ │ │ │                Return type:
    │ │ │ │ -                  pathlib.Path
    │ │ │ │ +                  _p_a_t_h_l_i_b_._P_a_t_h
    │ │ │ │          getnode(ccoonnffiigg, aarrgg)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Get the collection node of a file.
    │ │ │ │                Parameters:
    │ │ │ │                        * ccoonnffiigg (_CC_oo_nn_ff_ii_gg) -- A pytest config. See _p_a_r_s_e_c_o_n_f_i_g_(_)
    │ │ │ │                          and _p_a_r_s_e_c_o_n_f_i_g_u_r_e_(_) for creating it.
    │ │ │ │ -                      * aarrgg (ssttrr || PPaatthhLLiikkee[[ssttrr]]) -- Path to the file.
    │ │ │ │ +                      * aarrgg (_ss_tt_rr || _PP_aa_tt_hh_LL_ii_kk_ee[[_ss_tt_rr]]) -- Path to the file.
    │ │ │ │                Returns:
    │ │ │ │                    The node.
    │ │ │ │                Return type:
    │ │ │ │                    _CC_oo_ll_ll_ee_cc_tt_oo_rr | _II_tt_ee_mm
    │ │ │ │          getpathnode(ppaatthh)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return the collection node of a file.
    │ │ │ │              This is like _g_e_t_n_o_d_e_(_) but uses _p_a_r_s_e_c_o_n_f_i_g_u_r_e_(_) to create the
    │ │ │ │              (configured) pytest Config instance.
    │ │ │ │                Parameters:
    │ │ │ │ -                  ppaatthh (ssttrr || PPaatthhLLiikkee[[ssttrr]]) -- Path to the file.
    │ │ │ │ +                  ppaatthh (_ss_tt_rr || _PP_aa_tt_hh_LL_ii_kk_ee[[_ss_tt_rr]]) -- Path to the file.
    │ │ │ │                Returns:
    │ │ │ │                    The node.
    │ │ │ │                Return type:
    │ │ │ │                    _CC_oo_ll_ll_ee_cc_tt_oo_rr | _II_tt_ee_mm
    │ │ │ │          genitems(ccoolliitteemmss)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Generate all test items from a collection node.
    │ │ │ │              This recurses into the collection node and returns a list of all
    │ │ │ │              the test items contained within.
    │ │ │ │                Parameters:
    │ │ │ │ -                  ccoolliitteemmss (SSeeqquueennccee[[_II_tt_ee_mm || _CC_oo_ll_ll_ee_cc_tt_oo_rr]]) -- The collection
    │ │ │ │ +                  ccoolliitteemmss (_SS_ee_qq_uu_ee_nn_cc_ee[[_II_tt_ee_mm || _CC_oo_ll_ll_ee_cc_tt_oo_rr]]) -- The collection
    │ │ │ │                    nodes.
    │ │ │ │                Returns:
    │ │ │ │                    The collected items.
    │ │ │ │                Return type:
    │ │ │ │ -                  list[_II_tt_ee_mm]
    │ │ │ │ +                  _l_i_s_t[_II_tt_ee_mm]
    │ │ │ │          runitem(ssoouurrccee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Run the "test_func" Item.
    │ │ │ │              The calling test instance (class containing the test method) must
    │ │ │ │              provide a .getrunner() method which should return a runner which
    │ │ │ │              can run the test protocol for a single item, e.g.
    │ │ │ │              _pytest.runner.runtestprotocol.
    │ │ │ │          inline_runsource(ssoouurrccee, **ccmmddlliinneeaarrggss)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Run a test module in process using pytest.main().
    │ │ │ │              This run writes "source" into a temporary file and runs pytest.main
    │ │ │ │              () on it, returning a _H_o_o_k_R_e_c_o_r_d_e_r instance for the result.
    │ │ │ │                Parameters:
    │ │ │ │ -                      * ssoouurrccee (ssttrr) -- The source code of the test module.
    │ │ │ │ +                      * ssoouurrccee (_ss_tt_rr) -- The source code of the test module.
    │ │ │ │                        * ccmmddlliinneeaarrggss -- Any extra command line arguments to use.
    │ │ │ │          inline_genitems(**aarrggss)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Run pytest.main(['--collect-only']) in-process.
    │ │ │ │              Runs the _p_y_t_e_s_t_._m_a_i_n_(_) function to run all of pytest inside the
    │ │ │ │              test process itself like _i_n_l_i_n_e___r_u_n_(_), but returns a tuple of the
    │ │ │ │              collected items and a _H_o_o_k_R_e_c_o_r_d_e_r instance.
    │ │ │ │          inline_run(**aarrggss, pplluuggiinnss==(()), nnoo__rreerraaiissee__ccttrrllcc==FFaallssee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Run pytest.main() in-process, returning a HookRecorder.
    │ │ │ │              Runs the _p_y_t_e_s_t_._m_a_i_n_(_) function to run all of pytest inside the
    │ │ │ │              test process itself. This means it can return a _H_o_o_k_R_e_c_o_r_d_e_r
    │ │ │ │              instance which gives more detailed results from that run than can
    │ │ │ │              be done by matching stdout/stderr from _r_u_n_p_y_t_e_s_t_(_).
    │ │ │ │                Parameters:
    │ │ │ │ -                      * aarrggss (ssttrr || PPaatthhLLiikkee[[ssttrr]]) -- Command line arguments to
    │ │ │ │ +                      * aarrggss (_ss_tt_rr || _PP_aa_tt_hh_LL_ii_kk_ee[[_ss_tt_rr]]) -- Command line arguments to
    │ │ │ │                          pass to _p_y_t_e_s_t_._m_a_i_n_(_).
    │ │ │ │                        * pplluuggiinnss -- Extra plugin instances the pytest.main()
    │ │ │ │                          instance should use.
    │ │ │ │ -                      * nnoo__rreerraaiissee__ccttrrllcc (bbooooll) -- Typically we reraise
    │ │ │ │ +                      * nnoo__rreerraaiissee__ccttrrllcc (_bb_oo_oo_ll) -- Typically we reraise
    │ │ │ │                          keyboard interrupts from the child run. If True, the
    │ │ │ │                          KeyboardInterrupt exception is captured.
    │ │ │ │          runpytest_inprocess(**aarrggss, ****kkwwaarrggss)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return result of running pytest in-process, providing a similar
    │ │ │ │              interface to what self.runpytest() provides.
    │ │ │ │          runpytest(**aarrggss, ****kkwwaarrggss)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Run pytest inline or in a subprocess, depending on the command line
    │ │ │ │ @@ -933,16 +932,16 @@
    │ │ │ │              calls the _p_y_t_e_s_t___c_o_n_f_i_g_u_r_e hook.
    │ │ │ │          getitem(ssoouurrccee, ffuunnccnnaammee==''tteesstt__ffuunncc'')_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return the test item for a test function.
    │ │ │ │              Writes the source to a python file and runs pytest's collection on
    │ │ │ │              the resulting module, returning the test item for the requested
    │ │ │ │              function name.
    │ │ │ │                Parameters:
    │ │ │ │ -                      * ssoouurrccee (ssttrr || PPaatthhLLiikkee[[ssttrr]]) -- The module source.
    │ │ │ │ -                      * ffuunnccnnaammee (ssttrr) -- The name of the test function for
    │ │ │ │ +                      * ssoouurrccee (_ss_tt_rr || _PP_aa_tt_hh_LL_ii_kk_ee[[_ss_tt_rr]]) -- The module source.
    │ │ │ │ +                      * ffuunnccnnaammee (_ss_tt_rr) -- The name of the test function for
    │ │ │ │                          which to return a test item.
    │ │ │ │                Returns:
    │ │ │ │                    The test item.
    │ │ │ │                Return type:
    │ │ │ │                    _II_tt_ee_mm
    │ │ │ │          getitems(ssoouurrccee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return all test items collected from the module.
    │ │ │ │ @@ -950,37 +949,37 @@
    │ │ │ │              the resulting module, returning all test items contained within.
    │ │ │ │          getmodulecol(ssoouurrccee, ccoonnffiiggaarrggss==(()), **, wwiitthhiinniitt==FFaallssee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return the module collection node for source.
    │ │ │ │              Writes source to a file using _m_a_k_e_p_y_f_i_l_e_(_) and then runs the pytest
    │ │ │ │              collection on it, returning the collection node for the test
    │ │ │ │              module.
    │ │ │ │                Parameters:
    │ │ │ │ -                      * ssoouurrccee (ssttrr || PPaatthhLLiikkee[[ssttrr]]) -- The source code of the
    │ │ │ │ +                      * ssoouurrccee (_ss_tt_rr || _PP_aa_tt_hh_LL_ii_kk_ee[[_ss_tt_rr]]) -- The source code of the
    │ │ │ │                          module to collect.
    │ │ │ │                        * ccoonnffiiggaarrggss -- Any extra arguments to pass to
    │ │ │ │                          _p_a_r_s_e_c_o_n_f_i_g_u_r_e_(_).
    │ │ │ │ -                      * wwiitthhiinniitt (bbooooll) -- Whether to also write an __init__.py
    │ │ │ │ +                      * wwiitthhiinniitt (_bb_oo_oo_ll) -- Whether to also write an __init__.py
    │ │ │ │                          file to the same directory to ensure it is a package.
    │ │ │ │          collect_by_name(mmooddccooll, nnaammee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return the collection node for name from the module collection.
    │ │ │ │              Searches a module collection node for a collection node matching
    │ │ │ │              the given name.
    │ │ │ │                Parameters:
    │ │ │ │                        * mmooddccooll (_CC_oo_ll_ll_ee_cc_tt_oo_rr) -- A module collection node; see
    │ │ │ │                          _g_e_t_m_o_d_u_l_e_c_o_l_(_).
    │ │ │ │ -                      * nnaammee (ssttrr) -- The name of the node to return.
    │ │ │ │ +                      * nnaammee (_ss_tt_rr) -- The name of the node to return.
    │ │ │ │          popen(ccmmddaarrggss, ssttddoouutt==--11, ssttddeerrrr==--11, ssttddiinn==NNoottSSeettTTyyppee..ttookkeenn, ****kkww)
    │ │ │ │          _[_s_o_u_r_c_e_]_¶
    │ │ │ │ -            Invoke subprocess.Popen.
    │ │ │ │ -            Calls subprocess.Popen making sure the current working directory is
    │ │ │ │ +            Invoke _s_u_b_p_r_o_c_e_s_s_._P_o_p_e_n.
    │ │ │ │ +            Calls _s_u_b_p_r_o_c_e_s_s_._P_o_p_e_n making sure the current working directory is
    │ │ │ │              in PYTHONPATH.
    │ │ │ │              You probably want to use _r_u_n_(_) instead.
    │ │ │ │          run(**ccmmddaarrggss, ttiimmeeoouutt==NNoonnee, ssttddiinn==NNoottSSeettTTyyppee..ttookkeenn)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Run a command with arguments.
    │ │ │ │ -            Run a process using subprocess.Popen saving the stdout and stderr.
    │ │ │ │ +            Run a process using _s_u_b_p_r_o_c_e_s_s_._P_o_p_e_n saving the stdout and stderr.
    │ │ │ │                Returns:
    │ │ │ │                    The result.
    │ │ │ │                Return type:
    │ │ │ │                    _RR_uu_nn_RR_ee_ss_uu_ll_tt
    │ │ │ │          runpython(ssccrriipptt)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Run a python script using sys.executable as interpreter.
    │ │ │ │          runpython_c(ccoommmmaanndd)_[_s_o_u_r_c_e_]_¶
    │ │ │ │ @@ -989,17 +988,17 @@
    │ │ │ │              Run pytest as a subprocess with given arguments.
    │ │ │ │              Any plugins added to the _p_l_u_g_i_n_s list will be added using the -
    │ │ │ │              p command line option. Additionally --basetemp is used to put any
    │ │ │ │              temporary files and directories in a numbered directory prefixed
    │ │ │ │              with "runpytest-" to not conflict with the normal numbered pytest
    │ │ │ │              location for temporary files and directories.
    │ │ │ │                Parameters:
    │ │ │ │ -                      * aarrggss (ssttrr || PPaatthhLLiikkee[[ssttrr]]) -- The sequence of arguments
    │ │ │ │ +                      * aarrggss (_ss_tt_rr || _PP_aa_tt_hh_LL_ii_kk_ee[[_ss_tt_rr]]) -- The sequence of arguments
    │ │ │ │                          to pass to the pytest subprocess.
    │ │ │ │ -                      * ttiimmeeoouutt (ffllooaatt || NNoonnee) -- The period in seconds after
    │ │ │ │ +                      * ttiimmeeoouutt (_ff_ll_oo_aa_tt || NNoonnee) -- The period in seconds after
    │ │ │ │                          which to timeout and raise _P_y_t_e_s_t_e_r_._T_i_m_e_o_u_t_E_x_p_i_r_e_d.
    │ │ │ │                Returns:
    │ │ │ │                    The result.
    │ │ │ │                Return type:
    │ │ │ │                    _RR_uu_nn_RR_ee_ss_uu_ll_tt
    │ │ │ │          spawn_pytest(ssttrriinngg, eexxppeecctt__ttiimmeeoouutt==1100..00)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Run pytest using pexpect.
    │ │ │ │ @@ -1007,15 +1006,15 @@
    │ │ │ │              directory locations.
    │ │ │ │              The pexpect child is returned.
    │ │ │ │          spawn(ccmmdd, eexxppeecctt__ttiimmeeoouutt==1100..00)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Run a command using pexpect.
    │ │ │ │              The pexpect child is returned.
    │ │ │ │    ffiinnaall ccllaassss RunResult_[_s_o_u_r_c_e_]_¶
    │ │ │ │        The result of running a command from _P_y_t_e_s_t_e_r.
    │ │ │ │ -        ret:: iinntt || _EE_xx_ii_tt_CC_oo_dd_ee_¶
    │ │ │ │ +        ret:: _ii_nn_tt || _EE_xx_ii_tt_CC_oo_dd_ee_¶
    │ │ │ │              The return value.
    │ │ │ │          outlines_¶
    │ │ │ │              List of lines captured from stdout.
    │ │ │ │          errlines_¶
    │ │ │ │              List of lines captured from stderr.
    │ │ │ │          stdout_¶
    │ │ │ │              _L_i_n_e_M_a_t_c_h_e_r of stdout.
    │ │ │ │ @@ -1048,50 +1047,49 @@
    │ │ │ │        commands.
    │ │ │ │        The constructor takes a list of lines without their trailing newlines,
    │ │ │ │        i.e. text.splitlines().
    │ │ │ │          __str__()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return the entire original text.
    │ │ │ │              Added in version 6.2: You can use _s_t_r_(_) in older versions.
    │ │ │ │          fnmatch_lines_random(lliinneess22)_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -            Check lines exist in the output in any order (using python:
    │ │ │ │ -            fnmatch.fnmatch()).
    │ │ │ │ +            Check lines exist in the output in any order (using _f_n_m_a_t_c_h_._f_n_m_a_t_c_h
    │ │ │ │ +            _(_)).
    │ │ │ │          re_match_lines_random(lliinneess22)_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -            Check lines exist in the output in any order (using python:re.match
    │ │ │ │ -            ()).
    │ │ │ │ +            Check lines exist in the output in any order (using _r_e_._m_a_t_c_h_(_)).
    │ │ │ │          get_lines_after(ffnnlliinnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return all lines following the given line in the text.
    │ │ │ │              The given line can contain glob wildcards.
    │ │ │ │          fnmatch_lines(lliinneess22, **, ccoonnsseeccuuttiivvee==FFaallssee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -            Check lines exist in the output (using python:fnmatch.fnmatch()).
    │ │ │ │ +            Check lines exist in the output (using _f_n_m_a_t_c_h_._f_n_m_a_t_c_h_(_)).
    │ │ │ │              The argument is a list of lines which have to match and can use
    │ │ │ │              glob wildcards. If they do not match a pytest.fail() is called. The
    │ │ │ │              matches and non-matches are also shown as part of the error
    │ │ │ │              message.
    │ │ │ │                Parameters:
    │ │ │ │ -                      * lliinneess22 (SSeeqquueennccee[[ssttrr]]) -- String patterns to match.
    │ │ │ │ -                      * ccoonnsseeccuuttiivvee (bbooooll) -- Match lines consecutively?
    │ │ │ │ +                      * lliinneess22 (_SS_ee_qq_uu_ee_nn_cc_ee[[_ss_tt_rr]]) -- String patterns to match.
    │ │ │ │ +                      * ccoonnsseeccuuttiivvee (_bb_oo_oo_ll) -- Match lines consecutively?
    │ │ │ │          re_match_lines(lliinneess22, **, ccoonnsseeccuuttiivvee==FFaallssee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -            Check lines exist in the output (using python:re.match()).
    │ │ │ │ +            Check lines exist in the output (using _r_e_._m_a_t_c_h_(_)).
    │ │ │ │              The argument is a list of lines which have to match using re.match.
    │ │ │ │              If they do not match a pytest.fail() is called.
    │ │ │ │              The matches and non-matches are also shown as part of the error
    │ │ │ │              message.
    │ │ │ │                Parameters:
    │ │ │ │ -                      * lliinneess22 (SSeeqquueennccee[[ssttrr]]) -- string patterns to match.
    │ │ │ │ -                      * ccoonnsseeccuuttiivvee (bbooooll) -- match lines consecutively?
    │ │ │ │ +                      * lliinneess22 (_SS_ee_qq_uu_ee_nn_cc_ee[[_ss_tt_rr]]) -- string patterns to match.
    │ │ │ │ +                      * ccoonnsseeccuuttiivvee (_bb_oo_oo_ll) -- match lines consecutively?
    │ │ │ │          no_fnmatch_line(ppaatt)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Ensure captured lines do not match the given pattern, using
    │ │ │ │              fnmatch.fnmatch.
    │ │ │ │                Parameters:
    │ │ │ │ -                  ppaatt (ssttrr) -- The pattern to match lines.
    │ │ │ │ +                  ppaatt (_ss_tt_rr) -- The pattern to match lines.
    │ │ │ │          no_re_match_line(ppaatt)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Ensure captured lines do not match the given pattern, using
    │ │ │ │              re.match.
    │ │ │ │                Parameters:
    │ │ │ │ -                  ppaatt (ssttrr) -- The regular expression to match lines.
    │ │ │ │ +                  ppaatt (_ss_tt_rr) -- The regular expression to match lines.
    │ │ │ │          str()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return the entire original text.
    │ │ │ │    ffiinnaall ccllaassss HookRecorder_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Record all hooks called in a plugin manager.
    │ │ │ │        Hook recorders are created by _P_y_t_e_s_t_e_r.
    │ │ │ │        This wraps all the hook calls in the plugin manager, recording each call
    │ │ │ │        before propagating the normal calls.
    │ │ │ │ @@ -1139,15 +1137,15 @@
    │ │ │ │    ccllaassss WarningsRecorder_[_s_o_u_r_c_e_]_¶
    │ │ │ │        A context manager to record raised warnings.
    │ │ │ │        Each recorded warning is an instance of warnings.WarningMessage.
    │ │ │ │        Adapted from warnings.catch_warnings.
    │ │ │ │        Note
    │ │ │ │        DeprecationWarning and PendingDeprecationWarning are treated differently;
    │ │ │ │        see _E_n_s_u_r_i_n_g_ _c_o_d_e_ _t_r_i_g_g_e_r_s_ _a_ _d_e_p_r_e_c_a_t_i_o_n_ _w_a_r_n_i_n_g.
    │ │ │ │ -        pprrooppeerrttyy list:: lliisstt[[WWaarrnniinnggMMeessssaaggee]]_¶
    │ │ │ │ +        pprrooppeerrttyy list:: _ll_ii_ss_tt[[WWaarrnniinnggMMeessssaaggee]]_¶
    │ │ │ │              The list of recorded warnings.
    │ │ │ │          __getitem__(ii)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Get a recorded warning by index.
    │ │ │ │          __iter__()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Iterate through the recorded warnings.
    │ │ │ │          __len__()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              The number of recorded warnings.
    │ │ │ │ @@ -1162,21 +1160,21 @@
    │ │ │ │  _o_p_t_i_o_n_s
    │ │ │ │  The request fixture is a special fixture providing information of the
    │ │ │ │  requesting test function.
    │ │ │ │    ccllaassss FixtureRequest_[_s_o_u_r_c_e_]_¶
    │ │ │ │        The type of the request fixture.
    │ │ │ │        A request object gives access to the requesting test context and has a
    │ │ │ │        param attribute in case the fixture is parametrized.
    │ │ │ │ -        fixturename:: FFiinnaall_¶
    │ │ │ │ +        fixturename:: _FF_ii_nn_aa_ll_¶
    │ │ │ │              Fixture for which this request is being performed.
    │ │ │ │ -        pprrooppeerrttyy scope:: LLiitteerraall[[''sseessssiioonn'',, ''ppaacckkaaggee'',, ''mmoodduullee'',, ''ccllaassss'',,
    │ │ │ │ +        pprrooppeerrttyy scope:: _LL_ii_tt_ee_rr_aa_ll[[''sseessssiioonn'',, ''ppaacckkaaggee'',, ''mmoodduullee'',, ''ccllaassss'',,
    │ │ │ │          ''ffuunnccttiioonn'']]_¶
    │ │ │ │              Scope string, one of "function", "class", "module", "package",
    │ │ │ │              "session".
    │ │ │ │ -        pprrooppeerrttyy fixturenames:: lliisstt[[ssttrr]]_¶
    │ │ │ │ +        pprrooppeerrttyy fixturenames:: _ll_ii_ss_tt[[_ss_tt_rr]]_¶
    │ │ │ │              Names of all active fixtures in this request.
    │ │ │ │          aabbssttrraacctt pprrooppeerrttyy node_¶
    │ │ │ │              Underlying collection node (depends on current request scope).
    │ │ │ │          pprrooppeerrttyy config:: _CC_oo_nn_ff_ii_gg_¶
    │ │ │ │              The pytest config object associated with this request.
    │ │ │ │          pprrooppeerrttyy function_¶
    │ │ │ │              Test function object if the request has a per-function scope.
    │ │ │ │ @@ -1184,46 +1182,46 @@
    │ │ │ │              Class (can be None) where the test function was collected.
    │ │ │ │          pprrooppeerrttyy instance_¶
    │ │ │ │              Instance (can be None) on which test function was collected.
    │ │ │ │          pprrooppeerrttyy module_¶
    │ │ │ │              Python module object where the test function was collected.
    │ │ │ │          pprrooppeerrttyy path:: PPaatthh_¶
    │ │ │ │              Path where the test function was collected.
    │ │ │ │ -        pprrooppeerrttyy keywords:: MMuuttaabblleeMMaappppiinngg[[ssttrr,, AAnnyy]]_¶
    │ │ │ │ +        pprrooppeerrttyy keywords:: _MM_uu_tt_aa_bb_ll_ee_MM_aa_pp_pp_ii_nn_gg[[_ss_tt_rr,, _AA_nn_yy]]_¶
    │ │ │ │              Keywords/markers dictionary for the underlying node.
    │ │ │ │          pprrooppeerrttyy session:: _SS_ee_ss_ss_ii_oo_nn_¶
    │ │ │ │              Pytest session object.
    │ │ │ │          aabbssttrraacctt addfinalizer(ffiinnaalliizzeerr)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Add finalizer/teardown function to be called without arguments
    │ │ │ │              after the last test within the requesting test context finished
    │ │ │ │              execution.
    │ │ │ │          applymarker(mmaarrkkeerr)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Apply a marker to a single test function invocation.
    │ │ │ │              This method is useful if you don't want to have a keyword/marker on
    │ │ │ │              all function invocations.
    │ │ │ │                Parameters:
    │ │ │ │ -                  mmaarrkkeerr (ssttrr || _MM_aa_rr_kk_DD_ee_cc_oo_rr_aa_tt_oo_rr) -- An object created by a call
    │ │ │ │ +                  mmaarrkkeerr (_ss_tt_rr || _MM_aa_rr_kk_DD_ee_cc_oo_rr_aa_tt_oo_rr) -- An object created by a call
    │ │ │ │                    to pytest.mark.NAME(...).
    │ │ │ │          raiseerror(mmssgg)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Raise a FixtureLookupError exception.
    │ │ │ │                Parameters:
    │ │ │ │ -                  mmssgg (ssttrr || NNoonnee) -- An optional custom error message.
    │ │ │ │ +                  mmssgg (_ss_tt_rr || NNoonnee) -- An optional custom error message.
    │ │ │ │          getfixturevalue(aarrggnnaammee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Dynamically run a named fixture function.
    │ │ │ │              Declaring fixtures via function argument is recommended where
    │ │ │ │              possible. But if you can only decide whether to use another fixture
    │ │ │ │              at test setup time, you may use this function to retrieve it inside
    │ │ │ │              a fixture or test function body.
    │ │ │ │              This method can be used during the test setup phase or the test run
    │ │ │ │              phase. Avoid using it during the teardown phase.
    │ │ │ │              Changed in version 9.1: Calling request.getfixturevalue() during
    │ │ │ │              teardown to request a fixture that was not already requested _i_s
    │ │ │ │              _d_e_p_r_e_c_a_t_e_d.
    │ │ │ │                Parameters:
    │ │ │ │ -                  aarrggnnaammee (ssttrr) -- The fixture name.
    │ │ │ │ +                  aarrggnnaammee (_ss_tt_rr) -- The fixture name.
    │ │ │ │                Raises:
    │ │ │ │                    _pp_yy_tt_ee_ss_tt_.._FF_ii_xx_tt_uu_rr_ee_LL_oo_oo_kk_uu_pp_EE_rr_rr_oo_rr -- If the given fixture could not
    │ │ │ │                    be found.
    │ │ │ │  ******** ssuubbtteessttss_?¶ ********
    │ │ │ │  The subtests fixture enables declaring subtests inside test functions.
    │ │ │ │  TTuuttoorriiaall: _H_o_w_ _t_o_ _u_s_e_ _s_u_b_t_e_s_t_s
    │ │ │ │    ccllaassss Subtests_[_s_o_u_r_c_e_]_¶
    │ │ │ │ @@ -1333,17 +1331,17 @@
    │ │ │ │  tmp_path_factory is an instance of _T_e_m_p_P_a_t_h_F_a_c_t_o_r_y:
    │ │ │ │    ffiinnaall ccllaassss TempPathFactory_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Factory for temporary directories under the common base temp directory,
    │ │ │ │        as discussed at _T_e_m_p_o_r_a_r_y_ _d_i_r_e_c_t_o_r_y_ _l_o_c_a_t_i_o_n_ _a_n_d_ _r_e_t_e_n_t_i_o_n.
    │ │ │ │          mktemp(bbaasseennaammee, nnuummbbeerreedd==TTrruuee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Create a new temporary directory managed by the factory.
    │ │ │ │                Parameters:
    │ │ │ │ -                      * bbaasseennaammee (ssttrr) -- Directory base name, must be a
    │ │ │ │ +                      * bbaasseennaammee (_ss_tt_rr) -- Directory base name, must be a
    │ │ │ │                          relative path.
    │ │ │ │ -                      * nnuummbbeerreedd (bbooooll) -- If True, ensure the directory is
    │ │ │ │ +                      * nnuummbbeerreedd (_bb_oo_oo_ll) -- If True, ensure the directory is
    │ │ │ │                          unique by adding a numbered suffix greater than any
    │ │ │ │                          existing one: basename="foo-" and numbered=True means
    │ │ │ │                          that this function will create directories named "foo-
    │ │ │ │                          0", "foo-1", "foo-2" and so on.
    │ │ │ │                Returns:
    │ │ │ │                    The path to the new directory.
    │ │ │ │                Return type:
    │ │ │ │ @@ -1381,29 +1379,29 @@
    │ │ │ │  Bootstrapping hooks called for plugins registered early enough (internal and
    │ │ │ │  third-party plugins).
    │ │ │ │    pytest_load_initial_conftests(eeaarrllyy__ccoonnffiigg, ppaarrsseerr, aarrggss)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Called to implement the loading of _i_n_i_t_i_a_l_ _c_o_n_f_t_e_s_t_ _f_i_l_e_s ahead of
    │ │ │ │        command line option parsing.
    │ │ │ │          Parameters:
    │ │ │ │                  * eeaarrllyy__ccoonnffiigg (_CC_oo_nn_ff_ii_gg) -- The pytest config object.
    │ │ │ │ -                * aarrggss (lliisstt[[ssttrr]]) -- Arguments passed on the command line.
    │ │ │ │ +                * aarrggss (_ll_ii_ss_tt[[_ss_tt_rr]]) -- Arguments passed on the command line.
    │ │ │ │                  * ppaarrsseerr (_PP_aa_rr_ss_ee_rr) -- To add command line options.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        This hook is not called for conftest files.
    │ │ │ │    pytest_cmdline_parse(pplluuggiinnmmaannaaggeerr, aarrggss)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Return an initialized _C_o_n_f_i_g, parsing the specified args.
    │ │ │ │        Stops at first non-None result, see _f_i_r_s_t_r_e_s_u_l_t_:_ _s_t_o_p_ _a_t_ _f_i_r_s_t_ _n_o_n_-_N_o_n_e
    │ │ │ │        _r_e_s_u_l_t.
    │ │ │ │        Note
    │ │ │ │        This hook is only called for plugin classes passed to the plugins arg
    │ │ │ │        when using _p_y_t_e_s_t_._m_a_i_n to perform an in-process test run.
    │ │ │ │          Parameters:
    │ │ │ │                  * pplluuggiinnmmaannaaggeerr (_PP_yy_tt_ee_ss_tt_PP_ll_uu_gg_ii_nn_MM_aa_nn_aa_gg_ee_rr) -- The pytest plugin
    │ │ │ │                    manager.
    │ │ │ │ -                * aarrggss (lliisstt[[ssttrr]]) -- List of arguments passed on the command
    │ │ │ │ +                * aarrggss (_ll_ii_ss_tt[[_ss_tt_rr]]) -- List of arguments passed on the command
    │ │ │ │                    line.
    │ │ │ │          Returns:
    │ │ │ │              A pytest config object.
    │ │ │ │          Return type:
    │ │ │ │              _C_o_n_f_i_g | None
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        This hook is not called for conftest files.
    │ │ │ │ @@ -1414,15 +1412,15 @@
    │ │ │ │        Stops at first non-None result, see _f_i_r_s_t_r_e_s_u_l_t_:_ _s_t_o_p_ _a_t_ _f_i_r_s_t_ _n_o_n_-_N_o_n_e
    │ │ │ │        _r_e_s_u_l_t.
    │ │ │ │          Parameters:
    │ │ │ │              ccoonnffiigg (_CC_oo_nn_ff_ii_gg) -- The pytest config object.
    │ │ │ │          Returns:
    │ │ │ │              The exit code.
    │ │ │ │          Return type:
    │ │ │ │ -            _E_x_i_t_C_o_d_e | int | None
    │ │ │ │ +            _E_x_i_t_C_o_d_e | _i_n_t | None
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        This hook is only called for _i_n_i_t_i_a_l_ _c_o_n_f_t_e_s_t_s.
    │ │ │ │  ******** IInniittiiaalliizzaattiioonn hhooookkss_?¶ ********
    │ │ │ │  Initialization hooks called for plugins and conftest.py files.
    │ │ │ │    pytest_addoption(ppaarrsseerr, pplluuggiinnmmaannaaggeerr)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Register argparse-style options and config-style config values, called
    │ │ │ │        once at the beginning of a test run.
    │ │ │ │ @@ -1481,23 +1479,23 @@
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        This hook is only called for _i_n_i_t_i_a_l_ _c_o_n_f_t_e_s_t_s.
    │ │ │ │    pytest_sessionfinish(sseessssiioonn, eexxiittssttaattuuss)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Called after whole test run finished, right before returning the exit
    │ │ │ │        status to the system.
    │ │ │ │          Parameters:
    │ │ │ │                  * sseessssiioonn (_SS_ee_ss_ss_ii_oo_nn) -- The pytest session object.
    │ │ │ │ -                * eexxiittssttaattuuss (iinntt || _EE_xx_ii_tt_CC_oo_dd_ee) -- The status which pytest will
    │ │ │ │ +                * eexxiittssttaattuuss (_ii_nn_tt || _EE_xx_ii_tt_CC_oo_dd_ee) -- The status which pytest will
    │ │ │ │                    return to the system.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest file can implement this hook.
    │ │ │ │    pytest_plugin_registered(pplluuggiinn, pplluuggiinn__nnaammee, mmaannaaggeerr)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        A new pytest plugin got registered.
    │ │ │ │          Parameters:
    │ │ │ │                  * pplluuggiinn (__PPlluuggggyyPPlluuggiinn) -- The plugin module or instance.
    │ │ │ │ -                * pplluuggiinn__nnaammee (ssttrr) -- The name by which the plugin is
    │ │ │ │ +                * pplluuggiinn__nnaammee (_ss_tt_rr) -- The name by which the plugin is
    │ │ │ │                    registered.
    │ │ │ │                  * mmaannaaggeerr (_PP_yy_tt_ee_ss_tt_PP_ll_uu_gg_ii_nn_MM_aa_nn_aa_gg_ee_rr) -- The pytest plugin manager.
    │ │ │ │        Note
    │ │ │ │        This hook is incompatible with hook wrappers.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        If a conftest plugin implements this hook, it will be called immediately
    │ │ │ │        when the conftest is registered, once for each plugin registered thus far
    │ │ │ │ @@ -1539,18 +1537,18 @@
    │ │ │ │        Returning False will forcefully nnoott ignore this path for collection,
    │ │ │ │        without giving a chance for other plugins to ignore this path.
    │ │ │ │        This hook is consulted for all files and directories prior to calling
    │ │ │ │        more specific hooks.
    │ │ │ │        Stops at first non-None result, see _f_i_r_s_t_r_e_s_u_l_t_:_ _s_t_o_p_ _a_t_ _f_i_r_s_t_ _n_o_n_-_N_o_n_e
    │ │ │ │        _r_e_s_u_l_t.
    │ │ │ │          Parameters:
    │ │ │ │ -                * ccoolllleeccttiioonn__ppaatthh (ppaatthhlliibb..PPaatthh) -- The path to analyze.
    │ │ │ │ +                * ccoolllleeccttiioonn__ppaatthh (_pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh) -- The path to analyze.
    │ │ │ │                  * ccoonnffiigg (_CC_oo_nn_ff_ii_gg) -- The pytest config object.
    │ │ │ │        Changed in version 7.0.0: The collection_path parameter was added as a
    │ │ │ │ -      pathlib.Path equivalent of the path parameter. The path parameter has
    │ │ │ │ +      _p_a_t_h_l_i_b_._P_a_t_h equivalent of the path parameter. The path parameter has
    │ │ │ │        been deprecated and removed in pytest 9.0.0.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest file can implement this hook. For a given collection path,
    │ │ │ │        only conftest files in parent directories of the collection path are
    │ │ │ │        consulted (if the path is a directory, its own conftest file is nnoott
    │ │ │ │        consulted - a directory cannot ignore itself!).
    │ │ │ │    pytest_collect_directory(ppaatthh, ppaarreenntt)_[_s_o_u_r_c_e_]_¶
    │ │ │ │ @@ -1558,65 +1556,65 @@
    │ │ │ │        Added in version 8.0.
    │ │ │ │        For best results, the returned collector should be a subclass of
    │ │ │ │        _D_i_r_e_c_t_o_r_y, but this is not required.
    │ │ │ │        The new node needs to have the specified parent as a parent.
    │ │ │ │        Stops at first non-None result, see _f_i_r_s_t_r_e_s_u_l_t_:_ _s_t_o_p_ _a_t_ _f_i_r_s_t_ _n_o_n_-_N_o_n_e
    │ │ │ │        _r_e_s_u_l_t.
    │ │ │ │          Parameters:
    │ │ │ │ -            ppaatthh (ppaatthhlliibb..PPaatthh) -- The path to analyze.
    │ │ │ │ +            ppaatthh (_pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh) -- The path to analyze.
    │ │ │ │        See _U_s_i_n_g_ _a_ _c_u_s_t_o_m_ _d_i_r_e_c_t_o_r_y_ _c_o_l_l_e_c_t_o_r for a simple example of use of
    │ │ │ │        this hook.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest file can implement this hook. For a given collection path,
    │ │ │ │        only conftest files in parent directories of the collection path are
    │ │ │ │        consulted (if the path is a directory, its own conftest file is nnoott
    │ │ │ │        consulted - a directory cannot collect itself!).
    │ │ │ │    pytest_collect_file(ffiillee__ppaatthh, ppaarreenntt)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Create a _C_o_l_l_e_c_t_o_r for the given path, or None if not relevant.
    │ │ │ │        For best results, the returned collector should be a subclass of _F_i_l_e,
    │ │ │ │        but this is not required.
    │ │ │ │        The new node needs to have the specified parent as a parent.
    │ │ │ │          Parameters:
    │ │ │ │ -            ffiillee__ppaatthh (ppaatthhlliibb..PPaatthh) -- The path to analyze.
    │ │ │ │ +            ffiillee__ppaatthh (_pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh) -- The path to analyze.
    │ │ │ │        Changed in version 7.0.0: The file_path parameter was added as a
    │ │ │ │ -      pathlib.Path equivalent of the path parameter. The path parameter has
    │ │ │ │ +      _p_a_t_h_l_i_b_._P_a_t_h equivalent of the path parameter. The path parameter has
    │ │ │ │        been deprecated and removed in pytest 9.0.0.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest file can implement this hook. For a given file path, only
    │ │ │ │        conftest files in parent directories of the file path are consulted.
    │ │ │ │    pytest_pycollect_makemodule(mmoodduullee__ppaatthh, ppaarreenntt)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Return a _p_y_t_e_s_t_._M_o_d_u_l_e collector or None for the given path.
    │ │ │ │        This hook will be called for each matching test module path. The
    │ │ │ │        _p_y_t_e_s_t___c_o_l_l_e_c_t___f_i_l_e hook needs to be used if you want to create test
    │ │ │ │        modules for files that do not match as a test module.
    │ │ │ │        Stops at first non-None result, see _f_i_r_s_t_r_e_s_u_l_t_:_ _s_t_o_p_ _a_t_ _f_i_r_s_t_ _n_o_n_-_N_o_n_e
    │ │ │ │        _r_e_s_u_l_t.
    │ │ │ │          Parameters:
    │ │ │ │ -            mmoodduullee__ppaatthh (ppaatthhlliibb..PPaatthh) -- The path of the module to collect.
    │ │ │ │ +            mmoodduullee__ppaatthh (_pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh) -- The path of the module to collect.
    │ │ │ │        Changed in version 7.0.0: The module_path parameter was added as a
    │ │ │ │ -      pathlib.Path equivalent of the path parameter. The path parameter has
    │ │ │ │ +      _p_a_t_h_l_i_b_._P_a_t_h equivalent of the path parameter. The path parameter has
    │ │ │ │        been deprecated in favor of module_path and removed in pytest 9.0.0.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest file can implement this hook. For a given parent collector,
    │ │ │ │        only conftest files in the collector's directory and its parent
    │ │ │ │        directories are consulted.
    │ │ │ │  For influencing the collection of objects in Python modules you can use the
    │ │ │ │  following hook:
    │ │ │ │    pytest_pycollect_makeitem(ccoolllleeccttoorr, nnaammee, oobbjj)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Return a custom item/collector for a Python object in a module, or None.
    │ │ │ │        Stops at first non-None result, see _f_i_r_s_t_r_e_s_u_l_t_:_ _s_t_o_p_ _a_t_ _f_i_r_s_t_ _n_o_n_-_N_o_n_e
    │ │ │ │        _r_e_s_u_l_t.
    │ │ │ │          Parameters:
    │ │ │ │                  * ccoolllleeccttoorr (_MM_oo_dd_uu_ll_ee || _CC_ll_aa_ss_ss) -- The module/class collector.
    │ │ │ │ -                * nnaammee (ssttrr) -- The name of the object in the module/class.
    │ │ │ │ -                * oobbjj (oobbjjeecctt) -- The object.
    │ │ │ │ +                * nnaammee (_ss_tt_rr) -- The name of the object in the module/class.
    │ │ │ │ +                * oobbjj (_oo_bb_jj_ee_cc_tt) -- The object.
    │ │ │ │          Returns:
    │ │ │ │              The created items/collectors.
    │ │ │ │          Return type:
    │ │ │ │ -            None | _I_t_e_m | _C_o_l_l_e_c_t_o_r | list[_I_t_e_m | _C_o_l_l_e_c_t_o_r]
    │ │ │ │ +            None | _I_t_e_m | _C_o_l_l_e_c_t_o_r | _l_i_s_t[_I_t_e_m | _C_o_l_l_e_c_t_o_r]
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest file can implement this hook. For a given collector, only
    │ │ │ │        conftest files in the collector's directory and its parent directories
    │ │ │ │        are consulted.
    │ │ │ │    pytest_generate_tests(mmeettaaffuunncc)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Generate (multiple) parametrized calls to a test function.
    │ │ │ │          Parameters:
    │ │ │ │ @@ -1630,16 +1628,16 @@
    │ │ │ │        be used by @pytest.mark.parametrize calls, or None if the hook doesn't
    │ │ │ │        know about val.
    │ │ │ │        The parameter name is available as argname, if required.
    │ │ │ │        Stops at first non-None result, see _f_i_r_s_t_r_e_s_u_l_t_:_ _s_t_o_p_ _a_t_ _f_i_r_s_t_ _n_o_n_-_N_o_n_e
    │ │ │ │        _r_e_s_u_l_t.
    │ │ │ │          Parameters:
    │ │ │ │                  * ccoonnffiigg (_CC_oo_nn_ff_ii_gg) -- The pytest config object.
    │ │ │ │ -                * vvaall (oobbjjeecctt) -- The parametrized value.
    │ │ │ │ -                * aarrggnnaammee (ssttrr) -- The automatic parameter name produced by
    │ │ │ │ +                * vvaall (_oo_bb_jj_ee_cc_tt) -- The parametrized value.
    │ │ │ │ +                * aarrggnnaammee (_ss_tt_rr) -- The automatic parameter name produced by
    │ │ │ │                    pytest.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest file can implement this hook.
    │ │ │ │  Hooks for influencing test skipping:
    │ │ │ │    pytest_markeval_namespace(ccoonnffiigg)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Called when constructing the globals dictionary used for evaluating
    │ │ │ │        string conditions in xfail/skipif markers.
    │ │ │ │ @@ -1648,15 +1646,15 @@
    │ │ │ │        required by normal boolean conditions.
    │ │ │ │        Added in version 6.2.
    │ │ │ │          Parameters:
    │ │ │ │              ccoonnffiigg (_CC_oo_nn_ff_ii_gg) -- The pytest config object.
    │ │ │ │          Returns:
    │ │ │ │              A dictionary of additional globals to add.
    │ │ │ │          Return type:
    │ │ │ │ -            dict[str, Any]
    │ │ │ │ +            _d_i_c_t[_s_t_r, Any]
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest file can implement this hook. For a given item, only
    │ │ │ │        conftest files in parent directories of the item are consulted.
    │ │ │ │  After collection is complete, you can modify the order of items, delete or
    │ │ │ │  otherwise amend the test items:
    │ │ │ │    pytest_collection_modifyitems(sseessssiioonn, ccoonnffiigg, iitteemmss)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Called after collection has been performed. May filter or re-order the
    │ │ │ │ @@ -1664,15 +1662,15 @@
    │ │ │ │        When items are deselected (filtered out from items), the hook
    │ │ │ │        _p_y_t_e_s_t___d_e_s_e_l_e_c_t_e_d must be called explicitly with the deselected items to
    │ │ │ │        properly notify other plugins, e.g. with config.hook.pytest_deselected
    │ │ │ │        (items=deselected_items).
    │ │ │ │          Parameters:
    │ │ │ │                  * sseessssiioonn (_SS_ee_ss_ss_ii_oo_nn) -- The pytest session object.
    │ │ │ │                  * ccoonnffiigg (_CC_oo_nn_ff_ii_gg) -- The pytest config object.
    │ │ │ │ -                * iitteemmss (lliisstt[[_II_tt_ee_mm]]) -- List of item objects.
    │ │ │ │ +                * iitteemmss (_ll_ii_ss_tt[[_II_tt_ee_mm]]) -- List of item objects.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest plugin can implement this hook.
    │ │ │ │  Note
    │ │ │ │  If this hook is implemented in conftest.py files, it always receives all
    │ │ │ │  collected items, not only those under the conftest.py where it is implemented.
    │ │ │ │    pytest_collection_finish(sseessssiioonn)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Called after collection has been performed and modified.
    │ │ │ │ @@ -1735,28 +1733,28 @@
    │ │ │ │        _r_e_s_u_l_t. The return value is not used, but only stops further processing.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest file can implement this hook.
    │ │ │ │    pytest_runtest_logstart(nnooddeeiidd, llooccaattiioonn)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Called at the start of running the runtest protocol for a single item.
    │ │ │ │        See _p_y_t_e_s_t___r_u_n_t_e_s_t___p_r_o_t_o_c_o_l for a description of the runtest protocol.
    │ │ │ │          Parameters:
    │ │ │ │ -                * nnooddeeiidd (ssttrr) -- Full node ID of the item.
    │ │ │ │ -                * llooccaattiioonn (ttuuppllee[[ssttrr,, iinntt || NNoonnee,, ssttrr]]) -- A tuple of
    │ │ │ │ +                * nnooddeeiidd (_ss_tt_rr) -- Full node ID of the item.
    │ │ │ │ +                * llooccaattiioonn (_tt_uu_pp_ll_ee[[_ss_tt_rr,, _ii_nn_tt || NNoonnee,, _ss_tt_rr]]) -- A tuple of
    │ │ │ │                    (filename, lineno, testname) where filename is a file path
    │ │ │ │                    relative to config.rootpath and lineno is 0-based.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest file can implement this hook. For a given item, only
    │ │ │ │        conftest files in the item's directory and its parent directories are
    │ │ │ │        consulted.
    │ │ │ │    pytest_runtest_logfinish(nnooddeeiidd, llooccaattiioonn)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Called at the end of running the runtest protocol for a single item.
    │ │ │ │        See _p_y_t_e_s_t___r_u_n_t_e_s_t___p_r_o_t_o_c_o_l for a description of the runtest protocol.
    │ │ │ │          Parameters:
    │ │ │ │ -                * nnooddeeiidd (ssttrr) -- Full node ID of the item.
    │ │ │ │ -                * llooccaattiioonn (ttuuppllee[[ssttrr,, iinntt || NNoonnee,, ssttrr]]) -- A tuple of
    │ │ │ │ +                * nnooddeeiidd (_ss_tt_rr) -- Full node ID of the item.
    │ │ │ │ +                * llooccaattiioonn (_tt_uu_pp_ll_ee[[_ss_tt_rr,, _ii_nn_tt || NNoonnee,, _ss_tt_rr]]) -- A tuple of
    │ │ │ │                    (filename, lineno, testname) where filename is a file path
    │ │ │ │                    relative to config.rootpath and lineno is 0-based.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest file can implement this hook. For a given item, only
    │ │ │ │        conftest files in the item's directory and its parent directories are
    │ │ │ │        consulted.
    │ │ │ │    pytest_runtest_setup(iitteemm)_[_s_o_u_r_c_e_]_¶
    │ │ │ │ @@ -1872,41 +1870,41 @@
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest file can implement this hook.
    │ │ │ │    pytest_report_header(ccoonnffiigg, ssttaarrtt__ppaatthh)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Return a string or list of strings to be displayed as header info for
    │ │ │ │        terminal reporting.
    │ │ │ │          Parameters:
    │ │ │ │                  * ccoonnffiigg (_CC_oo_nn_ff_ii_gg) -- The pytest config object.
    │ │ │ │ -                * ssttaarrtt__ppaatthh (ppaatthhlliibb..PPaatthh) -- The starting dir.
    │ │ │ │ +                * ssttaarrtt__ppaatthh (_pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh) -- The starting dir.
    │ │ │ │        Note
    │ │ │ │        Lines returned by a plugin are displayed before those of plugins which
    │ │ │ │        ran before it. If you want to have your line(s) displayed first, use
    │ │ │ │        _t_r_y_l_a_s_t_=_T_r_u_e.
    │ │ │ │        Changed in version 7.0.0: The start_path parameter was added as a
    │ │ │ │ -      pathlib.Path equivalent of the startdir parameter. The startdir parameter
    │ │ │ │ +      _p_a_t_h_l_i_b_._P_a_t_h equivalent of the startdir parameter. The startdir parameter
    │ │ │ │        has been deprecated and removed in pytest 9.0.0.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        This hook is only called for _i_n_i_t_i_a_l_ _c_o_n_f_t_e_s_t_s.
    │ │ │ │    pytest_report_collectionfinish(ccoonnffiigg, ssttaarrtt__ppaatthh, iitteemmss)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Return a string or list of strings to be displayed after collection has
    │ │ │ │        finished successfully.
    │ │ │ │        These strings will be displayed after the standard "collected X items"
    │ │ │ │        message.
    │ │ │ │        Added in version 3.2.
    │ │ │ │          Parameters:
    │ │ │ │                  * ccoonnffiigg (_CC_oo_nn_ff_ii_gg) -- The pytest config object.
    │ │ │ │ -                * ssttaarrtt__ppaatthh (ppaatthhlliibb..PPaatthh) -- The starting dir.
    │ │ │ │ +                * ssttaarrtt__ppaatthh (_pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh) -- The starting dir.
    │ │ │ │                  * iitteemmss (SSeeqquueennccee[[_II_tt_ee_mm]]) -- List of pytest items that are going
    │ │ │ │                    to be executed; this list should not be modified.
    │ │ │ │        Note
    │ │ │ │        Lines returned by a plugin are displayed before those of plugins which
    │ │ │ │        ran before it. If you want to have your line(s) displayed first, use
    │ │ │ │        _t_r_y_l_a_s_t_=_T_r_u_e.
    │ │ │ │        Changed in version 7.0.0: The start_path parameter was added as a
    │ │ │ │ -      pathlib.Path equivalent of the startdir parameter. The startdir parameter
    │ │ │ │ +      _p_a_t_h_l_i_b_._P_a_t_h equivalent of the startdir parameter. The startdir parameter
    │ │ │ │        has been deprecated and removed in pytest 9.0.0.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest plugin can implement this hook.
    │ │ │ │    pytest_report_teststatus(rreeppoorrtt, ccoonnffiigg)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Return result-category, shortletter and verbose word for status
    │ │ │ │        reporting.
    │ │ │ │        The result-category is a category in which to count the result, for
    │ │ │ │ @@ -1921,16 +1919,16 @@
    │ │ │ │          Parameters:
    │ │ │ │                  * rreeppoorrtt (_CC_oo_ll_ll_ee_cc_tt_RR_ee_pp_oo_rr_tt || _TT_ee_ss_tt_RR_ee_pp_oo_rr_tt) -- The report object
    │ │ │ │                    whose status is to be returned.
    │ │ │ │                  * ccoonnffiigg (_CC_oo_nn_ff_ii_gg) -- The pytest config object.
    │ │ │ │          Returns:
    │ │ │ │              The test status.
    │ │ │ │          Return type:
    │ │ │ │ -            _T_e_s_t_S_h_o_r_t_L_o_g_R_e_p_o_r_t | tuple[str, str, str | tuple[str, Mapping[str,
    │ │ │ │ -            bool]]]
    │ │ │ │ +            _T_e_s_t_S_h_o_r_t_L_o_g_R_e_p_o_r_t | _t_u_p_l_e[_s_t_r, _s_t_r, _s_t_r | _t_u_p_l_e[_s_t_r, Mapping[_s_t_r,
    │ │ │ │ +            _b_o_o_l]]]
    │ │ │ │        Stops at first non-None result, see _f_i_r_s_t_r_e_s_u_l_t_:_ _s_t_o_p_ _a_t_ _f_i_r_s_t_ _n_o_n_-_N_o_n_e
    │ │ │ │        _r_e_s_u_l_t.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest plugin can implement this hook.
    │ │ │ │    pytest_report_to_serializable(ccoonnffiigg, rreeppoorrtt)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Serialize the given report object into a data structure suitable for
    │ │ │ │        sending over the wire, e.g. converted to JSON.
    │ │ │ │ @@ -1964,15 +1962,15 @@
    │ │ │ │          Parameters:
    │ │ │ │                  * ffiixxttuurreeddeeff (_FF_ii_xx_tt_uu_rr_ee_DD_ee_ff[[AAnnyy]]) -- The fixture definition
    │ │ │ │                    object.
    │ │ │ │                  * rreeqquueesstt (SSuubbRReeqquueesstt) -- The fixture request object.
    │ │ │ │          Returns:
    │ │ │ │              The return value of the call to the fixture function.
    │ │ │ │          Return type:
    │ │ │ │ -            object | None
    │ │ │ │ +            _o_b_j_e_c_t | None
    │ │ │ │        Stops at first non-None result, see _f_i_r_s_t_r_e_s_u_l_t_:_ _s_t_o_p_ _a_t_ _f_i_r_s_t_ _n_o_n_-_N_o_n_e
    │ │ │ │        _r_e_s_u_l_t.
    │ │ │ │        Note
    │ │ │ │        If the fixture function returns None, other implementations of this hook
    │ │ │ │        function will continue to be called, according to the behavior of the
    │ │ │ │        _f_i_r_s_t_r_e_s_u_l_t_:_ _s_t_o_p_ _a_t_ _f_i_r_s_t_ _n_o_n_-_N_o_n_e_ _r_e_s_u_l_t option.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │ @@ -2011,17 +2009,17 @@
    │ │ │ │        Return explanation for comparisons in failing assert expressions.
    │ │ │ │        Return None for no custom explanation, otherwise return a list of
    │ │ │ │        strings. The strings will be joined by newlines but any newlines iinn a
    │ │ │ │        string will be escaped. Note that all but the first line will be indented
    │ │ │ │        slightly, the intention is for the first line to be a summary.
    │ │ │ │          Parameters:
    │ │ │ │                  * ccoonnffiigg (_CC_oo_nn_ff_ii_gg) -- The pytest config object.
    │ │ │ │ -                * oopp (ssttrr) -- The operator, e.g. "==", "!=", "not in".
    │ │ │ │ -                * lleefftt (oobbjjeecctt) -- The left operand.
    │ │ │ │ -                * rriigghhtt (oobbjjeecctt) -- The right operand.
    │ │ │ │ +                * oopp (_ss_tt_rr) -- The operator, e.g. "==", "!=", "not in".
    │ │ │ │ +                * lleefftt (_oo_bb_jj_ee_cc_tt) -- The left operand.
    │ │ │ │ +                * rriigghhtt (_oo_bb_jj_ee_cc_tt) -- The right operand.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest file can implement this hook. For a given item, only
    │ │ │ │        conftest files in the item's directory and its parent directories are
    │ │ │ │        consulted.
    │ │ │ │    pytest_assertion_pass(iitteemm, lliinneennoo, oorriigg, eexxppll)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Called whenever an assertion passes.
    │ │ │ │        Added in version 5.0.
    │ │ │ │ @@ -2038,37 +2036,37 @@
    │ │ │ │        [pytest]
    │ │ │ │        enable_assertion_pass_hook = true
    │ │ │ │        You need to cclleeaann tthhee ..ppyycc files in your project directory and
    │ │ │ │        interpreter libraries when enabling this option, as assertions will
    │ │ │ │        require to be re-written.
    │ │ │ │          Parameters:
    │ │ │ │                  * iitteemm (_II_tt_ee_mm) -- pytest item object of current test.
    │ │ │ │ -                * lliinneennoo (iinntt) -- Line number of the assert statement.
    │ │ │ │ -                * oorriigg (ssttrr) -- String with the original assertion.
    │ │ │ │ -                * eexxppll (ssttrr) -- String with the assert explanation.
    │ │ │ │ +                * lliinneennoo (_ii_nn_tt) -- Line number of the assert statement.
    │ │ │ │ +                * oorriigg (_ss_tt_rr) -- String with the original assertion.
    │ │ │ │ +                * eexxppll (_ss_tt_rr) -- String with the assert explanation.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest file can implement this hook. For a given item, only
    │ │ │ │        conftest files in the item's directory and its parent directories are
    │ │ │ │        consulted.
    │ │ │ │  ******** DDeebbuuggggiinngg//IInntteerraaccttiioonn hhooookkss_?¶ ********
    │ │ │ │  There are few hooks which can be used for special reporting or interaction with
    │ │ │ │  exceptions:
    │ │ │ │    pytest_internalerror(eexxccrreepprr, eexxcciinnffoo)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Called for internal errors.
    │ │ │ │        Return True to suppress the fallback handling of printing an
    │ │ │ │        INTERNALERROR message directly to sys.stderr.
    │ │ │ │          Parameters:
    │ │ │ │                  * eexxccrreepprr (EExxcceeppttiioonnRReepprr) -- The exception repr object.
    │ │ │ │ -                * eexxcciinnffoo (_EE_xx_cc_ee_pp_tt_ii_oo_nn_II_nn_ff_oo[[BBaasseeEExxcceeppttiioonn]]) -- The exception info.
    │ │ │ │ +                * eexxcciinnffoo (_EE_xx_cc_ee_pp_tt_ii_oo_nn_II_nn_ff_oo[[_BB_aa_ss_ee_EE_xx_cc_ee_pp_tt_ii_oo_nn]]) -- The exception info.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest plugin can implement this hook.
    │ │ │ │    pytest_keyboard_interrupt(eexxcciinnffoo)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Called for keyboard interrupt.
    │ │ │ │          Parameters:
    │ │ │ │ -            eexxcciinnffoo (_EE_xx_cc_ee_pp_tt_ii_oo_nn_II_nn_ff_oo[[KKeeyybbooaarrddIInntteerrrruupptt || EExxiitt]]) -- The exception
    │ │ │ │ +            eexxcciinnffoo (_EE_xx_cc_ee_pp_tt_ii_oo_nn_II_nn_ff_oo[[_KK_ee_yy_bb_oo_aa_rr_dd_II_nn_tt_ee_rr_rr_uu_pp_tt || EExxiitt]]) -- The exception
    │ │ │ │              info.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest plugin can implement this hook.
    │ │ │ │    pytest_exception_interact(nnooddee, ccaallll, rreeppoorrtt)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Called when an exception was raised which can potentially be
    │ │ │ │        interactively handled.
    │ │ │ │        May be called during collection (see _p_y_t_e_s_t___m_a_k_e___c_o_l_l_e_c_t___r_e_p_o_r_t), in
    │ │ │ │ @@ -2088,55 +2086,55 @@
    │ │ │ │        conftest files in parent directories of the node are consulted.
    │ │ │ │    pytest_enter_pdb(ccoonnffiigg, ppddbb)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Called upon pdb.set_trace().
    │ │ │ │        Can be used by plugins to take special action just before the python
    │ │ │ │        debugger enters interactive mode.
    │ │ │ │          Parameters:
    │ │ │ │                  * ccoonnffiigg (_CC_oo_nn_ff_ii_gg) -- The pytest config object.
    │ │ │ │ -                * ppddbb (ppddbb..PPddbb) -- The Pdb instance.
    │ │ │ │ +                * ppddbb (_pp_dd_bb_.._PP_dd_bb) -- The Pdb instance.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest plugin can implement this hook.
    │ │ │ │    pytest_leave_pdb(ccoonnffiigg, ppddbb)_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Called when leaving pdb (e.g. with continue after pdb.set_trace()).
    │ │ │ │        Can be used by plugins to take special action just after the python
    │ │ │ │        debugger leaves interactive mode.
    │ │ │ │          Parameters:
    │ │ │ │                  * ccoonnffiigg (_CC_oo_nn_ff_ii_gg) -- The pytest config object.
    │ │ │ │ -                * ppddbb (ppddbb..PPddbb) -- The Pdb instance.
    │ │ │ │ +                * ppddbb (_pp_dd_bb_.._PP_dd_bb) -- The Pdb instance.
    │ │ │ │        ****** UUssee iinn ccoonnfftteesstt pplluuggiinnss_?¶ ******
    │ │ │ │        Any conftest plugin can implement this hook.
    │ │ │ │  ********** CCoolllleeccttiioonn ttrreeee oobbjjeeccttss_?¶ **********
    │ │ │ │  These are the collector and item classes (collectively called "nodes") which
    │ │ │ │  make up the collection tree.
    │ │ │ │  ******** NNooddee_?¶ ********
    │ │ │ │    ccllaassss Node_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -      Bases: ABC
    │ │ │ │ +      Bases: _A_B_C
    │ │ │ │        Base class of _C_o_l_l_e_c_t_o_r and _I_t_e_m, the components of the test collection
    │ │ │ │        tree.
    │ │ │ │        Collector's are the internal nodes of the tree, and Item's are the leaf
    │ │ │ │        nodes.
    │ │ │ │          fspath:: LLEEGGAACCYY__PPAATTHH_¶
    │ │ │ │              A LEGACY_PATH copy of the _p_a_t_h attribute. Intended for usage for
    │ │ │ │              methods not migrated to pathlib.Path yet, such as _I_t_e_m_._r_e_p_o_r_t_i_n_f_o.
    │ │ │ │              Will be deprecated in a future release, prefer using _p_a_t_h instead.
    │ │ │ │ -        name:: ssttrr_¶
    │ │ │ │ +        name:: _ss_tt_rr_¶
    │ │ │ │              A unique name within the scope of the parent node.
    │ │ │ │          parent_¶
    │ │ │ │              The parent collector node.
    │ │ │ │          config:: _CC_oo_nn_ff_ii_gg_¶
    │ │ │ │              The pytest config object.
    │ │ │ │          session:: _SS_ee_ss_ss_ii_oo_nn_¶
    │ │ │ │              The pytest session this node is part of.
    │ │ │ │ -        path:: ppaatthhlliibb..PPaatthh_¶
    │ │ │ │ +        path:: _pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh_¶
    │ │ │ │              Filesystem path where this node was collected from.
    │ │ │ │ -        keywords:: MMuuttaabblleeMMaappppiinngg[[ssttrr,, AAnnyy]]_¶
    │ │ │ │ +        keywords:: MMuuttaabblleeMMaappppiinngg[[_ss_tt_rr,, AAnnyy]]_¶
    │ │ │ │              Keywords/markers collected from all scopes.
    │ │ │ │ -        own_markers:: lliisstt[[_MM_aa_rr_kk]]_¶
    │ │ │ │ +        own_markers:: _ll_ii_ss_tt[[_MM_aa_rr_kk]]_¶
    │ │ │ │              The marker objects belonging to this node.
    │ │ │ │ -        extra_keyword_matches:: sseett[[ssttrr]]_¶
    │ │ │ │ +        extra_keyword_matches:: _ss_ee_tt[[_ss_tt_rr]]_¶
    │ │ │ │              Allow adding of extra keywords to use for matching.
    │ │ │ │          stash:: _SS_tt_aa_ss_hh_¶
    │ │ │ │              A place where plugins can store information on the node for their
    │ │ │ │              own use.
    │ │ │ │          ccllaassssmmeetthhoodd from_parent(ppaarreenntt, ****kkww)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Public constructor for Nodes.
    │ │ │ │              This indirection got introduced in order to enable removing the
    │ │ │ │ @@ -2148,58 +2146,58 @@
    │ │ │ │          pprrooppeerrttyy ihook:: HHooookkRReellaayy_¶
    │ │ │ │              Path-sensitive hook proxy used to call pytest hooks.
    │ │ │ │          warn(wwaarrnniinngg)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Issue a warning for this Node.
    │ │ │ │              Warnings will be displayed after the test session, unless
    │ │ │ │              explicitly suppressed.
    │ │ │ │                Parameters:
    │ │ │ │ -                  wwaarrnniinngg (WWaarrnniinngg) -- The warning instance to issue.
    │ │ │ │ +                  wwaarrnniinngg (_WW_aa_rr_nn_ii_nn_gg) -- The warning instance to issue.
    │ │ │ │                Raises:
    │ │ │ │ -                  VVaalluueeEErrrroorr -- If warning instance is not a subclass of
    │ │ │ │ +                  _VV_aa_ll_uu_ee_EE_rr_rr_oo_rr -- If warning instance is not a subclass of
    │ │ │ │                    Warning.
    │ │ │ │              Example usage:
    │ │ │ │              node.warn(PytestWarning("some message"))
    │ │ │ │              node.warn(UserWarning("some message"))
    │ │ │ │ -            Changed in version 6.2: Any subclass of Warning is now accepted,
    │ │ │ │ +            Changed in version 6.2: Any subclass of _W_a_r_n_i_n_g is now accepted,
    │ │ │ │              rather than only _P_y_t_e_s_t_W_a_r_n_i_n_g subclasses.
    │ │ │ │ -        pprrooppeerrttyy nodeid:: ssttrr_¶
    │ │ │ │ +        pprrooppeerrttyy nodeid:: _ss_tt_rr_¶
    │ │ │ │              A ::-separated string denoting its collection tree address.
    │ │ │ │          iter_parents()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Iterate over all parent collectors starting from and including self
    │ │ │ │              up to the root of the collection tree.
    │ │ │ │              Added in version 8.1.
    │ │ │ │          listchain()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return a list of all parent collectors starting from the root of
    │ │ │ │              the collection tree down to and including self.
    │ │ │ │          add_marker(mmaarrkkeerr, aappppeenndd==TTrruuee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Dynamically add a marker object to the node.
    │ │ │ │                Parameters:
    │ │ │ │ -                      * mmaarrkkeerr (ssttrr || _MM_aa_rr_kk_DD_ee_cc_oo_rr_aa_tt_oo_rr) -- The marker.
    │ │ │ │ -                      * aappppeenndd (bbooooll) -- Whether to append the marker, or
    │ │ │ │ +                      * mmaarrkkeerr (_ss_tt_rr || _MM_aa_rr_kk_DD_ee_cc_oo_rr_aa_tt_oo_rr) -- The marker.
    │ │ │ │ +                      * aappppeenndd (_bb_oo_oo_ll) -- Whether to append the marker, or
    │ │ │ │                          prepend it.
    │ │ │ │          iter_markers(nnaammee==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Iterate over all markers of the node.
    │ │ │ │                Parameters:
    │ │ │ │ -                  nnaammee (ssttrr || NNoonnee) -- If given, filter the results by the name
    │ │ │ │ +                  nnaammee (_ss_tt_rr || NNoonnee) -- If given, filter the results by the name
    │ │ │ │                    attribute.
    │ │ │ │                Returns:
    │ │ │ │                    An iterator of the markers of the node.
    │ │ │ │                Return type:
    │ │ │ │ -                  IItteerraattoorr[_MM_aa_rr_kk]
    │ │ │ │ +                  _II_tt_ee_rr_aa_tt_oo_rr[_MM_aa_rr_kk]
    │ │ │ │          iter_markers_with_node(nnaammee==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Iterate over all markers of the node.
    │ │ │ │                Parameters:
    │ │ │ │ -                  nnaammee (ssttrr || NNoonnee) -- If given, filter the results by the name
    │ │ │ │ +                  nnaammee (_ss_tt_rr || NNoonnee) -- If given, filter the results by the name
    │ │ │ │                    attribute.
    │ │ │ │                Returns:
    │ │ │ │                    An iterator of (node, mark) tuples.
    │ │ │ │                Return type:
    │ │ │ │ -                  IItteerraattoorr[tuple[_NN_oo_dd_ee, _MM_aa_rr_kk]]
    │ │ │ │ -        get_closest_marker(nnaammee:: ssttrr) → _M_a_r_k | None_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -        get_closest_marker(nnaammee:: ssttrr, ddeeffaauulltt:: _MM_aa_rr_kk) → _M_a_r_k
    │ │ │ │ +                  _II_tt_ee_rr_aa_tt_oo_rr[_t_u_p_l_e[_NN_oo_dd_ee, _MM_aa_rr_kk]]
    │ │ │ │ +        get_closest_marker(nnaammee:: _ss_tt_rr) → _M_a_r_k | _N_o_n_e_[_s_o_u_r_c_e_]_¶
    │ │ │ │ +        get_closest_marker(nnaammee:: _ss_tt_rr, ddeeffaauulltt:: _MM_aa_rr_kk) → _M_a_r_k
    │ │ │ │              Return the first marker matching the name, from closest (for
    │ │ │ │              example function) to farther level (for example module level).
    │ │ │ │                Parameters:
    │ │ │ │                        * ddeeffaauulltt -- Fallback return value if no marker was
    │ │ │ │                          found.
    │ │ │ │                        * nnaammee -- Name to filter by.
    │ │ │ │          listextrakeywords()_[_s_o_u_r_c_e_]_¶
    │ │ │ │ @@ -2209,176 +2207,176 @@
    │ │ │ │              is finalized.
    │ │ │ │              This method can only be called when this node is active in a setup
    │ │ │ │              chain, for example during self.setup().
    │ │ │ │          getparent(ccllss)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Get the closest parent node (including self) which is an instance
    │ │ │ │              of the given class.
    │ │ │ │                Parameters:
    │ │ │ │ -                  ccllss (ttyyppee[[__NNooddeeTTyyppee]]) -- The node class to search for.
    │ │ │ │ +                  ccllss (_tt_yy_pp_ee[[__NNooddeeTTyyppee]]) -- The node class to search for.
    │ │ │ │                Returns:
    │ │ │ │                    The node, if found.
    │ │ │ │                Return type:
    │ │ │ │                    __NNooddeeTTyyppee | None
    │ │ │ │          repr_failure(eexxcciinnffoo, ssttyyllee==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return a representation of a collection or test failure.
    │ │ │ │              See also
    │ │ │ │              _W_o_r_k_i_n_g_ _w_i_t_h_ _n_o_n_-_p_y_t_h_o_n_ _t_e_s_t_s
    │ │ │ │                Parameters:
    │ │ │ │ -                  eexxcciinnffoo (_EE_xx_cc_ee_pp_tt_ii_oo_nn_II_nn_ff_oo[[BBaasseeEExxcceeppttiioonn]]) -- Exception
    │ │ │ │ +                  eexxcciinnffoo (_EE_xx_cc_ee_pp_tt_ii_oo_nn_II_nn_ff_oo[[_BB_aa_ss_ee_EE_xx_cc_ee_pp_tt_ii_oo_nn]]) -- Exception
    │ │ │ │                    information for the failure.
    │ │ │ │  ******** CCoolllleeccttoorr_?¶ ********
    │ │ │ │    ccllaassss Collector_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -      Bases: _N_o_d_e, ABC
    │ │ │ │ +      Bases: _N_o_d_e, _A_B_C
    │ │ │ │        Base class of all collectors.
    │ │ │ │        Collector create children through collect() and thus iteratively build
    │ │ │ │        the collection tree.
    │ │ │ │          eexxcceeppttiioonn CollectError_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -            Bases: Exception
    │ │ │ │ +            Bases: _E_x_c_e_p_t_i_o_n
    │ │ │ │              An error during collection, contains a custom message.
    │ │ │ │          aabbssttrraacctt collect()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Collect children (items and collectors) for this collector.
    │ │ │ │          repr_failure(eexxcciinnffoo)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return a representation of a collection failure.
    │ │ │ │                Parameters:
    │ │ │ │ -                  eexxcciinnffoo (_EE_xx_cc_ee_pp_tt_ii_oo_nn_II_nn_ff_oo[[BBaasseeEExxcceeppttiioonn]]) -- Exception
    │ │ │ │ +                  eexxcciinnffoo (_EE_xx_cc_ee_pp_tt_ii_oo_nn_II_nn_ff_oo[[_BB_aa_ss_ee_EE_xx_cc_ee_pp_tt_ii_oo_nn]]) -- Exception
    │ │ │ │                    information for the failure.
    │ │ │ │          config:: _CC_oo_nn_ff_ii_gg_¶
    │ │ │ │              The pytest config object.
    │ │ │ │ -        name:: ssttrr_¶
    │ │ │ │ +        name:: _ss_tt_rr_¶
    │ │ │ │              A unique name within the scope of the parent node.
    │ │ │ │          parent_¶
    │ │ │ │              The parent collector node.
    │ │ │ │ -        path:: ppaatthhlliibb..PPaatthh_¶
    │ │ │ │ +        path:: _pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh_¶
    │ │ │ │              Filesystem path where this node was collected from.
    │ │ │ │          session:: _SS_ee_ss_ss_ii_oo_nn_¶
    │ │ │ │              The pytest session this node is part of.
    │ │ │ │  ******** IItteemm_?¶ ********
    │ │ │ │    ccllaassss Item_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -      Bases: _N_o_d_e, ABC
    │ │ │ │ +      Bases: _N_o_d_e, _A_B_C
    │ │ │ │        Base class of all test invocation items.
    │ │ │ │        Note that for a single function there might be multiple test invocation
    │ │ │ │        items.
    │ │ │ │ -        user_properties:: lliisstt[[ttuuppllee[[ssttrr,, oobbjjeecctt]]]]_¶
    │ │ │ │ +        user_properties:: _ll_ii_ss_tt[[_tt_uu_pp_ll_ee[[_ss_tt_rr,, _oo_bb_jj_ee_cc_tt]]]]_¶
    │ │ │ │              A list of tuples (name, value) that holds user defined properties
    │ │ │ │              for this test.
    │ │ │ │          config:: _CC_oo_nn_ff_ii_gg_¶
    │ │ │ │              The pytest config object.
    │ │ │ │ -        name:: ssttrr_¶
    │ │ │ │ +        name:: _ss_tt_rr_¶
    │ │ │ │              A unique name within the scope of the parent node.
    │ │ │ │          parent_¶
    │ │ │ │              The parent collector node.
    │ │ │ │ -        path:: ppaatthhlliibb..PPaatthh_¶
    │ │ │ │ +        path:: _pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh_¶
    │ │ │ │              Filesystem path where this node was collected from.
    │ │ │ │          session:: _SS_ee_ss_ss_ii_oo_nn_¶
    │ │ │ │              The pytest session this node is part of.
    │ │ │ │          aabbssttrraacctt runtest()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Run the test case for this item.
    │ │ │ │              Must be implemented by subclasses.
    │ │ │ │              See also
    │ │ │ │              _W_o_r_k_i_n_g_ _w_i_t_h_ _n_o_n_-_p_y_t_h_o_n_ _t_e_s_t_s
    │ │ │ │          add_report_section(wwhheenn, kkeeyy, ccoonntteenntt)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Add a new report section, similar to what's done internally to add
    │ │ │ │              stdout and stderr captured output:
    │ │ │ │              item.add_report_section("call", "stdout", "report section
    │ │ │ │              contents")
    │ │ │ │                Parameters:
    │ │ │ │ -                      * wwhheenn (ssttrr) -- One of the possible capture states,
    │ │ │ │ +                      * wwhheenn (_ss_tt_rr) -- One of the possible capture states,
    │ │ │ │                          "setup", "call", "teardown".
    │ │ │ │ -                      * kkeeyy (ssttrr) -- Name of the section, can be customized at
    │ │ │ │ +                      * kkeeyy (_ss_tt_rr) -- Name of the section, can be customized at
    │ │ │ │                          will. Pytest uses "stdout" and "stderr" internally.
    │ │ │ │ -                      * ccoonntteenntt (ssttrr) -- The full contents as a string.
    │ │ │ │ +                      * ccoonntteenntt (_ss_tt_rr) -- The full contents as a string.
    │ │ │ │          reportinfo()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Get location information for this item for test reports.
    │ │ │ │              Returns a tuple with three elements:
    │ │ │ │                  * The path of the test (default self.path)
    │ │ │ │                  * The 0-based line number of the test (default None)
    │ │ │ │                  * A name of the test to be shown (default "")
    │ │ │ │              See also
    │ │ │ │              _W_o_r_k_i_n_g_ _w_i_t_h_ _n_o_n_-_p_y_t_h_o_n_ _t_e_s_t_s
    │ │ │ │ -        pprrooppeerrttyy location:: ttuuppllee[[ssttrr,, iinntt || NNoonnee,, ssttrr]]_[_s_o_u_r_c_e_]_¶
    │ │ │ │ +        pprrooppeerrttyy location:: _tt_uu_pp_ll_ee[[_ss_tt_rr,, _ii_nn_tt || _NN_oo_nn_ee,, _ss_tt_rr]]_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Returns a tuple of (relfspath, lineno, testname) for this item
    │ │ │ │              where relfspath is file path relative to config.rootpath and lineno
    │ │ │ │              is a 0-based line number.
    │ │ │ │  ******** FFiillee_?¶ ********
    │ │ │ │    ccllaassss File_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -      Bases: _F_S_C_o_l_l_e_c_t_o_r, ABC
    │ │ │ │ +      Bases: _F_S_C_o_l_l_e_c_t_o_r, _A_B_C
    │ │ │ │        Base class for collecting tests from a file.
    │ │ │ │        _W_o_r_k_i_n_g_ _w_i_t_h_ _n_o_n_-_p_y_t_h_o_n_ _t_e_s_t_s.
    │ │ │ │          config:: _CC_oo_nn_ff_ii_gg_¶
    │ │ │ │              The pytest config object.
    │ │ │ │ -        name:: ssttrr_¶
    │ │ │ │ +        name:: _ss_tt_rr_¶
    │ │ │ │              A unique name within the scope of the parent node.
    │ │ │ │          parent_¶
    │ │ │ │              The parent collector node.
    │ │ │ │ -        path:: ppaatthhlliibb..PPaatthh_¶
    │ │ │ │ +        path:: _pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh_¶
    │ │ │ │              Filesystem path where this node was collected from.
    │ │ │ │          session:: _SS_ee_ss_ss_ii_oo_nn_¶
    │ │ │ │              The pytest session this node is part of.
    │ │ │ │  ******** FFSSCCoolllleeccttoorr_?¶ ********
    │ │ │ │    ccllaassss FSCollector_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -      Bases: _C_o_l_l_e_c_t_o_r, ABC
    │ │ │ │ +      Bases: _C_o_l_l_e_c_t_o_r, _A_B_C
    │ │ │ │        Base class for filesystem collectors.
    │ │ │ │ -        path:: ppaatthhlliibb..PPaatthh_¶
    │ │ │ │ +        path:: _pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh_¶
    │ │ │ │              Filesystem path where this node was collected from.
    │ │ │ │          ccllaassssmmeetthhoodd from_parent(ppaarreenntt, **, ffssppaatthh==NNoonnee, ppaatthh==NNoonnee, ****kkww)
    │ │ │ │          _[_s_o_u_r_c_e_]_¶
    │ │ │ │              The public constructor.
    │ │ │ │          config:: _CC_oo_nn_ff_ii_gg_¶
    │ │ │ │              The pytest config object.
    │ │ │ │ -        name:: ssttrr_¶
    │ │ │ │ +        name:: _ss_tt_rr_¶
    │ │ │ │              A unique name within the scope of the parent node.
    │ │ │ │          parent_¶
    │ │ │ │              The parent collector node.
    │ │ │ │          session:: _SS_ee_ss_ss_ii_oo_nn_¶
    │ │ │ │              The pytest session this node is part of.
    │ │ │ │  ******** SSeessssiioonn_?¶ ********
    │ │ │ │    ffiinnaall ccllaassss Session_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Bases: _C_o_l_l_e_c_t_o_r
    │ │ │ │        The root of the collection tree.
    │ │ │ │        Session collects the initial paths given as arguments to pytest.
    │ │ │ │          eexxcceeppttiioonn Interrupted_¶
    │ │ │ │ -            Bases: KeyboardInterrupt
    │ │ │ │ +            Bases: _K_e_y_b_o_a_r_d_I_n_t_e_r_r_u_p_t
    │ │ │ │              Signals that the test run was interrupted.
    │ │ │ │          eexxcceeppttiioonn Failed_¶
    │ │ │ │ -            Bases: Exception
    │ │ │ │ +            Bases: _E_x_c_e_p_t_i_o_n
    │ │ │ │              Signals a stop as failed test run.
    │ │ │ │          pprrooppeerrttyy startpath:: PPaatthh_¶
    │ │ │ │              The path from which pytest was invoked.
    │ │ │ │              Added in version 7.0.0.
    │ │ │ │          isinitpath(ppaatthh, **, wwiitthh__ppaarreennttss==FFaallssee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Is path an initial path?
    │ │ │ │              An initial path is a path explicitly given to pytest on the command
    │ │ │ │              line.
    │ │ │ │                Parameters:
    │ │ │ │ -                  wwiitthh__ppaarreennttss (bbooooll) -- If set, also return True if the path
    │ │ │ │ +                  wwiitthh__ppaarreennttss (_bb_oo_oo_ll) -- If set, also return True if the path
    │ │ │ │                    is a parent of an initial path.
    │ │ │ │              Changed in version 8.0: Added the with_parents parameter.
    │ │ │ │ -        perform_collect(aarrggss:: SSeeqquueennccee[[ssttrr]] || NNoonnee == NNoonnee, ggeenniitteemmss:: LLiitteerraall
    │ │ │ │ -        [[TTrruuee]] == TTrruuee) → Sequence[_I_t_e_m]_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -        perform_collect(aarrggss:: SSeeqquueennccee[[ssttrr]] || NNoonnee == NNoonnee, ggeenniitteemmss:: bbooooll ==
    │ │ │ │ -        TTrruuee) → Sequence[_I_t_e_m | _C_o_l_l_e_c_t_o_r]
    │ │ │ │ +        perform_collect(aarrggss:: _SS_ee_qq_uu_ee_nn_cc_ee[[_ss_tt_rr]] || _NN_oo_nn_ee == NNoonnee, ggeenniitteemmss:: _LL_ii_tt_ee_rr_aa_ll
    │ │ │ │ +        [[TTrruuee]] == TTrruuee) → _S_e_q_u_e_n_c_e[_I_t_e_m]_[_s_o_u_r_c_e_]_¶
    │ │ │ │ +        perform_collect(aarrggss:: _SS_ee_qq_uu_ee_nn_cc_ee[[_ss_tt_rr]] || _NN_oo_nn_ee == NNoonnee, ggeenniitteemmss:: _bb_oo_oo_ll ==
    │ │ │ │ +        TTrruuee) → _S_e_q_u_e_n_c_e[_I_t_e_m | _C_o_l_l_e_c_t_o_r]
    │ │ │ │              Perform the collection phase for this session.
    │ │ │ │              This is called by the default _p_y_t_e_s_t___c_o_l_l_e_c_t_i_o_n hook
    │ │ │ │              implementation; see the documentation of this hook for more
    │ │ │ │              details. For testing purposes, it may also be called directly on a
    │ │ │ │              fresh Session.
    │ │ │ │              This function normally recursively expands any collectors collected
    │ │ │ │              from the session to their items, and only items are returned. For
    │ │ │ │              testing purposes, this may be suppressed by passing genitems=False,
    │ │ │ │              in which case the return value contains these collectors
    │ │ │ │              unexpanded, and session.items is empty.
    │ │ │ │          collect()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Collect children (items and collectors) for this collector.
    │ │ │ │          config:: _CC_oo_nn_ff_ii_gg_¶
    │ │ │ │              The pytest config object.
    │ │ │ │ -        name:: ssttrr_¶
    │ │ │ │ +        name:: _ss_tt_rr_¶
    │ │ │ │              A unique name within the scope of the parent node.
    │ │ │ │          parent_¶
    │ │ │ │              The parent collector node.
    │ │ │ │ -        path:: ppaatthhlliibb..PPaatthh_¶
    │ │ │ │ +        path:: _pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh_¶
    │ │ │ │              Filesystem path where this node was collected from.
    │ │ │ │          session:: _SS_ee_ss_ss_ii_oo_nn_¶
    │ │ │ │              The pytest session this node is part of.
    │ │ │ │  ******** PPaacckkaaggee_?¶ ********
    │ │ │ │    ccllaassss Package_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Bases: _D_i_r_e_c_t_o_r_y
    │ │ │ │        Collector for files and directories in a Python packages -- directories
    │ │ │ │ @@ -2387,53 +2385,53 @@
    │ │ │ │        Directories without an __init__.py file are instead collected by _D_i_r by
    │ │ │ │        default. Both are _D_i_r_e_c_t_o_r_y collectors.
    │ │ │ │        Changed in version 8.0: Now inherits from _D_i_r_e_c_t_o_r_y.
    │ │ │ │          collect()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Collect children (items and collectors) for this collector.
    │ │ │ │          config:: _CC_oo_nn_ff_ii_gg_¶
    │ │ │ │              The pytest config object.
    │ │ │ │ -        name:: ssttrr_¶
    │ │ │ │ +        name:: _ss_tt_rr_¶
    │ │ │ │              A unique name within the scope of the parent node.
    │ │ │ │          parent_¶
    │ │ │ │              The parent collector node.
    │ │ │ │ -        path:: ppaatthhlliibb..PPaatthh_¶
    │ │ │ │ +        path:: _pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh_¶
    │ │ │ │              Filesystem path where this node was collected from.
    │ │ │ │          session:: _SS_ee_ss_ss_ii_oo_nn_¶
    │ │ │ │              The pytest session this node is part of.
    │ │ │ │  ******** MMoodduullee_?¶ ********
    │ │ │ │    ccllaassss Module_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Bases: _F_i_l_e, PyCollector
    │ │ │ │        Collector for test classes and functions in a Python module.
    │ │ │ │          collect()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Collect children (items and collectors) for this collector.
    │ │ │ │          config:: _CC_oo_nn_ff_ii_gg_¶
    │ │ │ │              The pytest config object.
    │ │ │ │ -        name:: ssttrr_¶
    │ │ │ │ +        name:: _ss_tt_rr_¶
    │ │ │ │              A unique name within the scope of the parent node.
    │ │ │ │          parent_¶
    │ │ │ │              The parent collector node.
    │ │ │ │ -        path:: ppaatthhlliibb..PPaatthh_¶
    │ │ │ │ +        path:: _pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh_¶
    │ │ │ │              Filesystem path where this node was collected from.
    │ │ │ │          session:: _SS_ee_ss_ss_ii_oo_nn_¶
    │ │ │ │              The pytest session this node is part of.
    │ │ │ │  ******** CCllaassss_?¶ ********
    │ │ │ │    ccllaassss Class_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Bases: PyCollector
    │ │ │ │        Collector for test methods (and nested classes) in a Python class.
    │ │ │ │          ccllaassssmmeetthhoodd from_parent(ppaarreenntt, **, nnaammee, oobbjj==NNoonnee, ****kkww)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              The public constructor.
    │ │ │ │          collect()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Collect children (items and collectors) for this collector.
    │ │ │ │          config:: _CC_oo_nn_ff_ii_gg_¶
    │ │ │ │              The pytest config object.
    │ │ │ │ -        name:: ssttrr_¶
    │ │ │ │ +        name:: _ss_tt_rr_¶
    │ │ │ │              A unique name within the scope of the parent node.
    │ │ │ │          parent_¶
    │ │ │ │              The parent collector node.
    │ │ │ │ -        path:: ppaatthhlliibb..PPaatthh_¶
    │ │ │ │ +        path:: _pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh_¶
    │ │ │ │              Filesystem path where this node was collected from.
    │ │ │ │          session:: _SS_ee_ss_ss_ii_oo_nn_¶
    │ │ │ │              The pytest session this node is part of.
    │ │ │ │  ******** FFuunnccttiioonn_?¶ ********
    │ │ │ │    ccllaassss Function_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Bases: PyobjMixin, _I_t_e_m
    │ │ │ │        Item responsible for setting up and executing a Python test function.
    │ │ │ │ @@ -2475,130 +2473,130 @@
    │ │ │ │          runtest()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Execute the underlying test function.
    │ │ │ │          repr_failure(eexxcciinnffoo)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return a representation of a collection or test failure.
    │ │ │ │              See also
    │ │ │ │              _W_o_r_k_i_n_g_ _w_i_t_h_ _n_o_n_-_p_y_t_h_o_n_ _t_e_s_t_s
    │ │ │ │                Parameters:
    │ │ │ │ -                  eexxcciinnffoo (_EE_xx_cc_ee_pp_tt_ii_oo_nn_II_nn_ff_oo[[BBaasseeEExxcceeppttiioonn]]) -- Exception
    │ │ │ │ +                  eexxcciinnffoo (_EE_xx_cc_ee_pp_tt_ii_oo_nn_II_nn_ff_oo[[_BB_aa_ss_ee_EE_xx_cc_ee_pp_tt_ii_oo_nn]]) -- Exception
    │ │ │ │                    information for the failure.
    │ │ │ │          config:: _CC_oo_nn_ff_ii_gg_¶
    │ │ │ │              The pytest config object.
    │ │ │ │ -        name:: ssttrr_¶
    │ │ │ │ +        name:: _ss_tt_rr_¶
    │ │ │ │              A unique name within the scope of the parent node.
    │ │ │ │          parent_¶
    │ │ │ │              The parent collector node.
    │ │ │ │ -        path:: ppaatthhlliibb..PPaatthh_¶
    │ │ │ │ +        path:: _pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh_¶
    │ │ │ │              Filesystem path where this node was collected from.
    │ │ │ │          session:: _SS_ee_ss_ss_ii_oo_nn_¶
    │ │ │ │              The pytest session this node is part of.
    │ │ │ │  ******** FFuunnccttiioonnDDeeffiinniittiioonn_?¶ ********
    │ │ │ │    ccllaassss FunctionDefinition_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Bases: _F_u_n_c_t_i_o_n
    │ │ │ │        This class is a stop gap solution until we evolve to have actual function
    │ │ │ │        definition nodes and manage to get rid of metafunc.
    │ │ │ │          runtest()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Execute the underlying test function.
    │ │ │ │          config:: _CC_oo_nn_ff_ii_gg_¶
    │ │ │ │              The pytest config object.
    │ │ │ │ -        name:: ssttrr_¶
    │ │ │ │ +        name:: _ss_tt_rr_¶
    │ │ │ │              A unique name within the scope of the parent node.
    │ │ │ │          parent_¶
    │ │ │ │              The parent collector node.
    │ │ │ │ -        path:: ppaatthhlliibb..PPaatthh_¶
    │ │ │ │ +        path:: _pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh_¶
    │ │ │ │              Filesystem path where this node was collected from.
    │ │ │ │          session:: _SS_ee_ss_ss_ii_oo_nn_¶
    │ │ │ │              The pytest session this node is part of.
    │ │ │ │          setup()_¶
    │ │ │ │              Execute the underlying test function.
    │ │ │ │  ********** OObbjjeeccttss_?¶ **********
    │ │ │ │  Objects accessible from _f_i_x_t_u_r_e_s or _h_o_o_k_s or importable from pytest.
    │ │ │ │  ******** CCaallllIInnffoo_?¶ ********
    │ │ │ │    ffiinnaall ccllaassss CallInfo_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Result/Exception info of a function invocation.
    │ │ │ │ -        excinfo:: _EE_xx_cc_ee_pp_tt_ii_oo_nn_II_nn_ff_oo[[BBaasseeEExxcceeppttiioonn]] || NNoonnee_¶
    │ │ │ │ +        excinfo:: _EE_xx_cc_ee_pp_tt_ii_oo_nn_II_nn_ff_oo[[_BB_aa_ss_ee_EE_xx_cc_ee_pp_tt_ii_oo_nn]] || _NN_oo_nn_ee_¶
    │ │ │ │              The captured exception of the call, if it raised.
    │ │ │ │ -        start:: ffllooaatt_¶
    │ │ │ │ +        start:: _ff_ll_oo_aa_tt_¶
    │ │ │ │              The system time when the call started, in seconds since the epoch.
    │ │ │ │ -        stop:: ffllooaatt_¶
    │ │ │ │ +        stop:: _ff_ll_oo_aa_tt_¶
    │ │ │ │              The system time when the call ended, in seconds since the epoch.
    │ │ │ │ -        duration:: ffllooaatt_¶
    │ │ │ │ +        duration:: _ff_ll_oo_aa_tt_¶
    │ │ │ │              The call duration, in seconds.
    │ │ │ │ -        when:: LLiitteerraall[[''ccoolllleecctt'',, ''sseettuupp'',, ''ccaallll'',, ''tteeaarrddoowwnn'']]_¶
    │ │ │ │ +        when:: _LL_ii_tt_ee_rr_aa_ll[[''ccoolllleecctt'',, ''sseettuupp'',, ''ccaallll'',, ''tteeaarrddoowwnn'']]_¶
    │ │ │ │              The context of invocation: "collect", "setup", "call" or
    │ │ │ │              "teardown".
    │ │ │ │          pprrooppeerrttyy result:: TTRReessuulltt_¶
    │ │ │ │              The return value of the call, if it didn't raise.
    │ │ │ │              Can only be accessed if excinfo is None.
    │ │ │ │          ccllaassssmmeetthhoodd from_call(ffuunncc, wwhheenn, rreerraaiissee==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Call func, wrapping the result in a CallInfo.
    │ │ │ │                Parameters:
    │ │ │ │                        * ffuunncc (CCaallllaabbllee[[[[]],, __ppyytteesstt..rruunnnneerr..TTRReessuulltt]]) -- The
    │ │ │ │                          function to call. Called without arguments.
    │ │ │ │ -                      * wwhheenn (LLiitteerraall[[''ccoolllleecctt'',, ''sseettuupp'',, ''ccaallll'',, ''tteeaarrddoowwnn'']])
    │ │ │ │ +                      * wwhheenn (_LL_ii_tt_ee_rr_aa_ll[[''ccoolllleecctt'',, ''sseettuupp'',, ''ccaallll'',, ''tteeaarrddoowwnn'']])
    │ │ │ │                          -- The phase in which the function is called.
    │ │ │ │ -                      * rreerraaiissee (ttyyppee[[BBaasseeEExxcceeppttiioonn]] || ttuuppllee[[ttyyppee
    │ │ │ │ -                        [[BBaasseeEExxcceeppttiioonn]],, ......]] || NNoonnee) -- Exception or
    │ │ │ │ +                      * rreerraaiissee (_tt_yy_pp_ee[[_BB_aa_ss_ee_EE_xx_cc_ee_pp_tt_ii_oo_nn]] || _tt_uu_pp_ll_ee[[_tt_yy_pp_ee
    │ │ │ │ +                        [[_BB_aa_ss_ee_EE_xx_cc_ee_pp_tt_ii_oo_nn]],, ......]] || NNoonnee) -- Exception or
    │ │ │ │                          exceptions that shall propagate if raised by the
    │ │ │ │                          function, instead of being wrapped in the CallInfo.
    │ │ │ │  ******** CCoolllleeccttRReeppoorrtt_?¶ ********
    │ │ │ │    ffiinnaall ccllaassss CollectReport_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Bases: BaseReport
    │ │ │ │        Collection report object.
    │ │ │ │        Reports can contain arbitrary extra attributes.
    │ │ │ │ -        nodeid:: ssttrr_¶
    │ │ │ │ +        nodeid:: _ss_tt_rr_¶
    │ │ │ │              Normalized collection nodeid.
    │ │ │ │ -        outcome:: LLiitteerraall[[''ppaasssseedd'',, ''ffaaiilleedd'',, ''sskkiippppeedd'']]_¶
    │ │ │ │ +        outcome:: _LL_ii_tt_ee_rr_aa_ll[[''ppaasssseedd'',, ''ffaaiilleedd'',, ''sskkiippppeedd'']]_¶
    │ │ │ │              Test outcome, always one of "passed", "failed", "skipped".
    │ │ │ │ -        longrepr:: NNoonnee || _EE_xx_cc_ee_pp_tt_ii_oo_nn_II_nn_ff_oo[[BBaasseeEExxcceeppttiioonn]] || ttuuppllee[[ssttrr,, iinntt,, ssttrr]] ||
    │ │ │ │ -        ssttrr || TTeerrmmiinnaallRReepprr_¶
    │ │ │ │ +        longrepr:: _NN_oo_nn_ee || _EE_xx_cc_ee_pp_tt_ii_oo_nn_II_nn_ff_oo[[_BB_aa_ss_ee_EE_xx_cc_ee_pp_tt_ii_oo_nn]] || _tt_uu_pp_ll_ee[[_ss_tt_rr,, _ii_nn_tt,, _ss_tt_rr]] ||
    │ │ │ │ +        _ss_tt_rr || TTeerrmmiinnaallRReepprr_¶
    │ │ │ │              None or a failure representation.
    │ │ │ │          result_¶
    │ │ │ │              The collected items and collection nodes.
    │ │ │ │ -        sections:: lliisstt[[ttuuppllee[[ssttrr,, ssttrr]]]]_¶
    │ │ │ │ +        sections:: _ll_ii_ss_tt[[_tt_uu_pp_ll_ee[[_ss_tt_rr,, _ss_tt_rr]]]]_¶
    │ │ │ │              Tuples of str (heading, content) with extra information for the
    │ │ │ │              test report. Used by pytest to add text captured from stdout,
    │ │ │ │              stderr, and intercepted logging events. May be used by other
    │ │ │ │              plugins to add arbitrary information to reports.
    │ │ │ │ -        pprrooppeerrttyy caplog:: ssttrr_¶
    │ │ │ │ +        pprrooppeerrttyy caplog:: _ss_tt_rr_¶
    │ │ │ │              Return captured log lines, if log capturing is enabled.
    │ │ │ │              Added in version 3.5.
    │ │ │ │ -        pprrooppeerrttyy capstderr:: ssttrr_¶
    │ │ │ │ +        pprrooppeerrttyy capstderr:: _ss_tt_rr_¶
    │ │ │ │              Return captured text from stderr, if capturing is enabled.
    │ │ │ │              Added in version 3.0.
    │ │ │ │ -        pprrooppeerrttyy capstdout:: ssttrr_¶
    │ │ │ │ +        pprrooppeerrttyy capstdout:: _ss_tt_rr_¶
    │ │ │ │              Return captured text from stdout, if capturing is enabled.
    │ │ │ │              Added in version 3.0.
    │ │ │ │ -        pprrooppeerrttyy count_towards_summary:: bbooooll_¶
    │ │ │ │ +        pprrooppeerrttyy count_towards_summary:: _bb_oo_oo_ll_¶
    │ │ │ │              EExxppeerriimmeennttaall Whether this report should be counted towards the
    │ │ │ │              totals shown at the end of the test session: "1 passed, 1 failure,
    │ │ │ │              etc".
    │ │ │ │              Note
    │ │ │ │              This function is considered eexxppeerriimmeennttaall, so beware that it is
    │ │ │ │              subject to changes even in patch releases.
    │ │ │ │ -        pprrooppeerrttyy failed:: bbooooll_¶
    │ │ │ │ +        pprrooppeerrttyy failed:: _bb_oo_oo_ll_¶
    │ │ │ │              Whether the outcome is failed.
    │ │ │ │ -        pprrooppeerrttyy fspath:: ssttrr_¶
    │ │ │ │ +        pprrooppeerrttyy fspath:: _ss_tt_rr_¶
    │ │ │ │              The path portion of the reported node, as a string.
    │ │ │ │ -        pprrooppeerrttyy head_line:: ssttrr || NNoonnee_¶
    │ │ │ │ +        pprrooppeerrttyy head_line:: _ss_tt_rr || _NN_oo_nn_ee_¶
    │ │ │ │              EExxppeerriimmeennttaall The head line shown with longrepr output for this
    │ │ │ │              report, more commonly during traceback representation during
    │ │ │ │              failures:
    │ │ │ │              ________ Test.foo ________
    │ │ │ │              In the example above, the head_line is "Test.foo".
    │ │ │ │              Note
    │ │ │ │              This function is considered eexxppeerriimmeennttaall, so beware that it is
    │ │ │ │              subject to changes even in patch releases.
    │ │ │ │ -        pprrooppeerrttyy longreprtext:: ssttrr_¶
    │ │ │ │ +        pprrooppeerrttyy longreprtext:: _ss_tt_rr_¶
    │ │ │ │              Read-only property that returns the full string representation of
    │ │ │ │              longrepr.
    │ │ │ │              Added in version 3.0.
    │ │ │ │ -        pprrooppeerrttyy passed:: bbooooll_¶
    │ │ │ │ +        pprrooppeerrttyy passed:: _bb_oo_oo_ll_¶
    │ │ │ │              Whether the outcome is passed.
    │ │ │ │ -        pprrooppeerrttyy skipped:: bbooooll_¶
    │ │ │ │ +        pprrooppeerrttyy skipped:: _bb_oo_oo_ll_¶
    │ │ │ │              Whether the outcome is skipped.
    │ │ │ │  ******** CCoonnffiigg_?¶ ********
    │ │ │ │    ffiinnaall ccllaassss Config_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Access to configuration values, pluginmanager and plugin hooks.
    │ │ │ │          Parameters:
    │ │ │ │                  * pplluuggiinnmmaannaaggeerr (_PP_yy_tt_ee_ss_tt_PP_ll_uu_gg_ii_nn_MM_aa_nn_aa_gg_ee_rr) -- A pytest
    │ │ │ │                    PluginManager.
    │ │ │ │ @@ -2609,17 +2607,17 @@
    │ │ │ │              The object attributes are read-only.
    │ │ │ │              Added in version 5.1.
    │ │ │ │              Note
    │ │ │ │              Note that the environment variable PYTEST_ADDOPTS and the addopts
    │ │ │ │              configuration option are handled by pytest, not being included in
    │ │ │ │              the args attribute.
    │ │ │ │              Plugins accessing InvocationParams must be aware of that.
    │ │ │ │ -              args:: ttuuppllee[[ssttrr,, ......]]_¶
    │ │ │ │ +              args:: _tt_uu_pp_ll_ee[[_ss_tt_rr,, ......]]_¶
    │ │ │ │                    The command-line arguments as passed to _p_y_t_e_s_t_._m_a_i_n_(_).
    │ │ │ │ -              plugins:: SSeeqquueennccee[[ssttrr || oobbjjeecctt]] || NNoonnee_¶
    │ │ │ │ +              plugins:: _SS_ee_qq_uu_ee_nn_cc_ee[[_ss_tt_rr || _oo_bb_jj_ee_cc_tt]] || _NN_oo_nn_ee_¶
    │ │ │ │                    Extra plugins, might be None.
    │ │ │ │                dir:: PPaatthh_¶
    │ │ │ │                    The directory from which _p_y_t_e_s_t_._m_a_i_n_(_) was invoked.
    │ │ │ │          ccllaassss ArgsSource(vvaalluuee, nnaammeess==<>, **vvaalluueess, mmoodduullee==NNoonnee,
    │ │ │ │          qquuaallnnaammee==NNoonnee, ttyyppee==NNoonnee, ssttaarrtt==11, bboouunnddaarryy==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Indicates the source of the test arguments.
    │ │ │ │              Added in version 7.2.
    │ │ │ │ @@ -2628,15 +2626,15 @@
    │ │ │ │                INVOCATION_DIR == 22_¶
    │ │ │ │                    Invocation directory.
    │ │ │ │                TESTPATHS == 33_¶
    │ │ │ │                    'testpaths' configuration value.
    │ │ │ │          option_¶
    │ │ │ │              Access to command line option as attributes.
    │ │ │ │                Type:
    │ │ │ │ -                  argparse.Namespace
    │ │ │ │ +                  _a_r_g_p_a_r_s_e_._N_a_m_e_s_p_a_c_e
    │ │ │ │          invocation_params_¶
    │ │ │ │              The parameters with which pytest was invoked.
    │ │ │ │                Type:
    │ │ │ │                    _I_n_v_o_c_a_t_i_o_n_P_a_r_a_m_s
    │ │ │ │          pluginmanager_¶
    │ │ │ │              The plugin manager handles plugin registration and hook invocation.
    │ │ │ │                Type:
    │ │ │ │ @@ -2645,15 +2643,15 @@
    │ │ │ │              A place where plugins can store information on the config for their
    │ │ │ │              own use.
    │ │ │ │                Type:
    │ │ │ │                    _S_t_a_s_h
    │ │ │ │          pprrooppeerrttyy rootpath:: PPaatthh_¶
    │ │ │ │              The path to the _r_o_o_t_d_i_r.
    │ │ │ │              Added in version 6.1.
    │ │ │ │ -        pprrooppeerrttyy inipath:: PPaatthh || NNoonnee_¶
    │ │ │ │ +        pprrooppeerrttyy inipath:: PPaatthh || _NN_oo_nn_ee_¶
    │ │ │ │              The path to the _c_o_n_f_i_g_f_i_l_e.
    │ │ │ │              Added in version 6.1.
    │ │ │ │          add_cleanup(ffuunncc)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Add a function to be called when the config object gets out of use
    │ │ │ │              (usually coinciding with pytest_unconfigure).
    │ │ │ │          ccllaassssmmeetthhoodd fromdictargs(ooppttiioonn__ddiicctt, aarrggss)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Constructor usable for subprocesses.
    │ │ │ │ @@ -2661,16 +2659,16 @@
    │ │ │ │              Issue and handle a warning during the "configure" stage.
    │ │ │ │              During pytest_configure we can't capture warnings using the
    │ │ │ │              catch_warnings_for_item function because it is not possible to have
    │ │ │ │              hook wrappers around pytest_configure.
    │ │ │ │              This function is mainly intended for plugins that need to issue
    │ │ │ │              warnings during pytest_configure (or similar stages).
    │ │ │ │                Parameters:
    │ │ │ │ -                      * wwaarrnniinngg (WWaarrnniinngg) -- The warning instance.
    │ │ │ │ -                      * ssttaacckklleevveell (iinntt) -- stacklevel forwarded to
    │ │ │ │ +                      * wwaarrnniinngg (_WW_aa_rr_nn_ii_nn_gg) -- The warning instance.
    │ │ │ │ +                      * ssttaacckklleevveell (_ii_nn_tt) -- stacklevel forwarded to
    │ │ │ │                          warnings.warn.
    │ │ │ │          addinivalue_line(nnaammee, lliinnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Add a line to a configuration option. The option must have been
    │ │ │ │              declared but might not yet be set in which case the line becomes
    │ │ │ │              the first line in its value.
    │ │ │ │          getini(nnaammee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return configuration value the an _c_o_n_f_i_g_u_r_a_t_i_o_n_ _f_i_l_e.
    │ │ │ │ @@ -2688,22 +2686,22 @@
    │ │ │ │              configuration is treated as a string and a default empty string ''
    │ │ │ │              is returned.
    │ │ │ │              If the specified name hasn't been registered through a prior
    │ │ │ │              _p_a_r_s_e_r_._a_d_d_i_n_i call (usually from a plugin), a ValueError is raised.
    │ │ │ │          getoption(nnaammee, ddeeffaauulltt==NNoottSSeettTTyyppee..ttookkeenn, sskkiipp==FFaallssee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return command line option value.
    │ │ │ │                Parameters:
    │ │ │ │ -                      * nnaammee (ssttrr) -- Name of the option. You may also specify
    │ │ │ │ +                      * nnaammee (_ss_tt_rr) -- Name of the option. You may also specify
    │ │ │ │                          the literal --OPT option instead of the "dest" option
    │ │ │ │                          name.
    │ │ │ │ -                      * ddeeffaauulltt (AAnnyy) -- Fallback value if no option of that
    │ │ │ │ +                      * ddeeffaauulltt (_AA_nn_yy) -- Fallback value if no option of that
    │ │ │ │                          name is ddeeccllaarreedd via _p_y_t_e_s_t___a_d_d_o_p_t_i_o_n. Note this
    │ │ │ │                          parameter will be ignored when the option is ddeeccllaarreedd
    │ │ │ │                          even if the option's value is None.
    │ │ │ │ -                      * sskkiipp (bbooooll) -- If True, raise _p_y_t_e_s_t_._s_k_i_p_(_) if option
    │ │ │ │ +                      * sskkiipp (_bb_oo_oo_ll) -- If True, raise _p_y_t_e_s_t_._s_k_i_p_(_) if option
    │ │ │ │                          is undeclared or has a None value. Note that even if
    │ │ │ │                          True, if a default was specified it will be returned
    │ │ │ │                          instead of a skip.
    │ │ │ │          getvalue(nnaammee, ppaatthh==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Deprecated, use getoption() instead.
    │ │ │ │          getvalueorskip(nnaammee, ppaatthh==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Deprecated, use getoption(skip=True) instead.
    │ │ │ │ @@ -2712,15 +2710,15 @@
    │ │ │ │          VERBOSITY_TEST_CASES:: FFiinnaall == ''tteesstt__ccaasseess''_¶
    │ │ │ │              Verbosity type for test case execution (see _v_e_r_b_o_s_i_t_y___t_e_s_t___c_a_s_e_s).
    │ │ │ │          VERBOSITY_SUBTESTS:: FFiinnaall == ''ssuubbtteessttss''_¶
    │ │ │ │              Verbosity type for failed subtests (see _v_e_r_b_o_s_i_t_y___s_u_b_t_e_s_t_s).
    │ │ │ │          get_verbosity(vveerrbboossiittyy__ttyyppee==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Retrieve the verbosity level for a fine-grained verbosity type.
    │ │ │ │                Parameters:
    │ │ │ │ -                  vveerrbboossiittyy__ttyyppee (ssttrr || NNoonnee) -- Verbosity type to get level
    │ │ │ │ +                  vveerrbboossiittyy__ttyyppee (_ss_tt_rr || NNoonnee) -- Verbosity type to get level
    │ │ │ │                    for. If a level is configured for the given type, that value
    │ │ │ │                    will be returned. If the given type is not a known verbosity
    │ │ │ │                    type, the global verbosity level will be returned. If the
    │ │ │ │                    given type is None (default), the global verbosity level will
    │ │ │ │                    be returned.
    │ │ │ │              To configure a level for a fine-grained verbosity type, the
    │ │ │ │              configuration file should have a setting for the configuration name
    │ │ │ │ @@ -2744,24 +2742,24 @@
    │ │ │ │        Python directories with an __init__.py file are instead collected by
    │ │ │ │        _P_a_c_k_a_g_e by default. Both are _D_i_r_e_c_t_o_r_y collectors.
    │ │ │ │          ccllaassssmmeetthhoodd from_parent(ppaarreenntt, **, ppaatthh)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              The public constructor.
    │ │ │ │                Parameters:
    │ │ │ │                        * ppaarreenntt (_nn_oo_dd_ee_ss_.._CC_oo_ll_ll_ee_cc_tt_oo_rr) -- The parent collector of
    │ │ │ │                          this Dir.
    │ │ │ │ -                      * ppaatthh (ppaatthhlliibb..PPaatthh) -- The directory's path.
    │ │ │ │ +                      * ppaatthh (_pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh) -- The directory's path.
    │ │ │ │          collect()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Collect children (items and collectors) for this collector.
    │ │ │ │          config:: _CC_oo_nn_ff_ii_gg_¶
    │ │ │ │              The pytest config object.
    │ │ │ │ -        name:: ssttrr_¶
    │ │ │ │ +        name:: _ss_tt_rr_¶
    │ │ │ │              A unique name within the scope of the parent node.
    │ │ │ │          parent_¶
    │ │ │ │              The parent collector node.
    │ │ │ │ -        path:: ppaatthhlliibb..PPaatthh_¶
    │ │ │ │ +        path:: _pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh_¶
    │ │ │ │              Filesystem path where this node was collected from.
    │ │ │ │          session:: _SS_ee_ss_ss_ii_oo_nn_¶
    │ │ │ │              The pytest session this node is part of.
    │ │ │ │  ******** DDiirreeccttoorryy_?¶ ********
    │ │ │ │    ccllaassss Directory_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Base class for collecting files from a directory.
    │ │ │ │        A basic directory collector does the following: goes over the files and
    │ │ │ │ @@ -2769,82 +2767,82 @@
    │ │ │ │        calling the hooks _p_y_t_e_s_t___c_o_l_l_e_c_t___d_i_r_e_c_t_o_r_y and _p_y_t_e_s_t___c_o_l_l_e_c_t___f_i_l_e, after
    │ │ │ │        checking that they are not ignored using _p_y_t_e_s_t___i_g_n_o_r_e___c_o_l_l_e_c_t.
    │ │ │ │        The default directory collectors are _D_i_r and _P_a_c_k_a_g_e.
    │ │ │ │        Added in version 8.0.
    │ │ │ │        _U_s_i_n_g_ _a_ _c_u_s_t_o_m_ _d_i_r_e_c_t_o_r_y_ _c_o_l_l_e_c_t_o_r.
    │ │ │ │          config:: _CC_oo_nn_ff_ii_gg_¶
    │ │ │ │              The pytest config object.
    │ │ │ │ -        name:: ssttrr_¶
    │ │ │ │ +        name:: _ss_tt_rr_¶
    │ │ │ │              A unique name within the scope of the parent node.
    │ │ │ │          parent_¶
    │ │ │ │              The parent collector node.
    │ │ │ │ -        path:: ppaatthhlliibb..PPaatthh_¶
    │ │ │ │ +        path:: _pp_aa_tt_hh_ll_ii_bb_.._PP_aa_tt_hh_¶
    │ │ │ │              Filesystem path where this node was collected from.
    │ │ │ │          session:: _SS_ee_ss_ss_ii_oo_nn_¶
    │ │ │ │              The pytest session this node is part of.
    │ │ │ │  ******** EExxcceeppttiioonnIInnffoo_?¶ ********
    │ │ │ │    ffiinnaall ccllaassss ExceptionInfo_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Wraps sys.exc_info() objects and offers help for navigating the
    │ │ │ │        traceback.
    │ │ │ │          ccllaassssmmeetthhoodd from_exception(eexxcceeppttiioonn, eexxpprriinnffoo==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return an ExceptionInfo for an existing exception.
    │ │ │ │              The exception must have a non-None __traceback__ attribute,
    │ │ │ │              otherwise this function fails with an assertion error. This means
    │ │ │ │              that the exception must have been raised, or added a traceback with
    │ │ │ │ -            the with_traceback() method.
    │ │ │ │ +            the _w_i_t_h___t_r_a_c_e_b_a_c_k_(_) method.
    │ │ │ │                Parameters:
    │ │ │ │ -                  eexxpprriinnffoo (ssttrr || NNoonnee) -- A text string helping to determine
    │ │ │ │ +                  eexxpprriinnffoo (_ss_tt_rr || NNoonnee) -- A text string helping to determine
    │ │ │ │                    if we should strip AssertionError from the output. Defaults
    │ │ │ │                    to the exception message/__str__().
    │ │ │ │              Added in version 7.4.
    │ │ │ │          ccllaassssmmeetthhoodd from_exc_info(eexxcc__iinnffoo, eexxpprriinnffoo==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Like _f_r_o_m___e_x_c_e_p_t_i_o_n_(_), but using old-style exc_info tuple.
    │ │ │ │          ccllaassssmmeetthhoodd from_current(eexxpprriinnffoo==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return an ExceptionInfo matching the current traceback.
    │ │ │ │              Warning
    │ │ │ │              Experimental API
    │ │ │ │                Parameters:
    │ │ │ │ -                  eexxpprriinnffoo (ssttrr || NNoonnee) -- A text string helping to determine
    │ │ │ │ +                  eexxpprriinnffoo (_ss_tt_rr || NNoonnee) -- A text string helping to determine
    │ │ │ │                    if we should strip AssertionError from the output. Defaults
    │ │ │ │                    to the exception message/__str__().
    │ │ │ │          ccllaassssmmeetthhoodd for_later()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return an unfilled ExceptionInfo.
    │ │ │ │          fill_unfilled(eexxcc__iinnffoo)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Fill an unfilled ExceptionInfo created with for_later().
    │ │ │ │ -        pprrooppeerrttyy type:: ttyyppee[[EE]]_¶
    │ │ │ │ +        pprrooppeerrttyy type:: _tt_yy_pp_ee[[EE]]_¶
    │ │ │ │              The exception class.
    │ │ │ │          pprrooppeerrttyy value:: EE_¶
    │ │ │ │              The exception value.
    │ │ │ │ -        pprrooppeerrttyy tb:: TTrraacceebbaacckkTTyyppee_¶
    │ │ │ │ +        pprrooppeerrttyy tb:: _TT_rr_aa_cc_ee_bb_aa_cc_kk_TT_yy_pp_ee_¶
    │ │ │ │              The exception raw traceback.
    │ │ │ │ -        pprrooppeerrttyy typename:: ssttrr_¶
    │ │ │ │ +        pprrooppeerrttyy typename:: _ss_tt_rr_¶
    │ │ │ │              The type name of the exception.
    │ │ │ │          pprrooppeerrttyy traceback:: TTrraacceebbaacckk_¶
    │ │ │ │              The traceback.
    │ │ │ │          exconly(ttrryysshhoorrtt==FFaallssee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return the exception as a string.
    │ │ │ │              This is usually a single line ": ",
    │ │ │ │              but may also include additional lines for the exception notes, and
    │ │ │ │              detailed information for SyntaxError's.
    │ │ │ │                Parameters:
    │ │ │ │ -                  ttrryysshhoorrtt (bbooooll) -- If true, and the exception is an
    │ │ │ │ +                  ttrryysshhoorrtt (_bb_oo_oo_ll) -- If true, and the exception is an
    │ │ │ │                    AssertionError, strip 'AssertionError: ' from the beginning.
    │ │ │ │          errisinstance(eexxcc)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return True if the exception is an instance of exc.
    │ │ │ │              Consider using isinstance(excinfo.value, exc) instead.
    │ │ │ │          getrepr(sshhoowwllooccaallss==FFaallssee, ssttyyllee==''lloonngg'', aabbssppaatthh==FFaallssee, ttbbffiilltteerr==TTrruuee,
    │ │ │ │          ffuunnccaarrggss==FFaallssee, ttrruunnccaattee__llooccaallss==TTrruuee, ttrruunnccaattee__aarrggss==TTrruuee, cchhaaiinn==TTrruuee)
    │ │ │ │          _[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return str()able representation of this exception info.
    │ │ │ │              The formatting parameters are ineffective if style="native", since
    │ │ │ │              in this case the native formatting is used.
    │ │ │ │              Changed in version 3.9: Added the chain parameter.
    │ │ │ │          match(rreeggeexxpp)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Check whether the regular expression regexp matches the string
    │ │ │ │ -            representation of the exception using python:re.search().
    │ │ │ │ +            representation of the exception using _r_e_._s_e_a_r_c_h_(_).
    │ │ │ │              If it matches True is returned, otherwise an AssertionError is
    │ │ │ │              raised.
    │ │ │ │          group_contains(eexxppeecctteedd__eexxcceeppttiioonn, **, mmaattcchh==NNoonnee, ddeepptthh==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Check whether a captured exception group contains a matching
    │ │ │ │              exception.
    │ │ │ │              Added in version 8.0.
    │ │ │ │              Warning
    │ │ │ │ @@ -2856,19 +2854,19 @@
    │ │ │ │    ccllaassss ExitCode(vvaalluuee, nnaammeess==<>, **vvaalluueess, mmoodduullee==NNoonnee, qquuaallnnaammee==NNoonnee,
    │ │ │ │    ttyyppee==NNoonnee, ssttaarrtt==11, bboouunnddaarryy==NNoonnee)_¶
    │ │ │ │        Encodes the valid exit codes by pytest.
    │ │ │ │        Currently users and plugins may supply other exit codes as well.
    │ │ │ │        Added in version 5.0.
    │ │ │ │  ******** FFiixxttuurreeDDeeff_?¶ ********
    │ │ │ │    ccllaassss FixtureDef_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -      Bases: Generic[FixtureValue]
    │ │ │ │ +      Bases: _G_e_n_e_r_i_c[FixtureValue]
    │ │ │ │        A container for a fixture definition.
    │ │ │ │        Note: At this time, only explicitly documented fields and methods are
    │ │ │ │        considered public stable API.
    │ │ │ │ -        pprrooppeerrttyy scope:: LLiitteerraall[[''sseessssiioonn'',, ''ppaacckkaaggee'',, ''mmoodduullee'',, ''ccllaassss'',,
    │ │ │ │ +        pprrooppeerrttyy scope:: _LL_ii_tt_ee_rr_aa_ll[[''sseessssiioonn'',, ''ppaacckkaaggee'',, ''mmoodduullee'',, ''ccllaassss'',,
    │ │ │ │          ''ffuunnccttiioonn'']]_¶
    │ │ │ │              Scope string, one of "function", "class", "module", "package",
    │ │ │ │              "session".
    │ │ │ │          execute(rreeqquueesstt)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return the value of this fixture, executing it if not cached.
    │ │ │ │  ******** MMaarrkkDDeeccoorraattoorr_?¶ ********
    │ │ │ │    ccllaassss MarkDecorator_[_s_o_u_r_c_e_]_¶
    │ │ │ │ @@ -2892,19 +2890,19 @@
    │ │ │ │           3. When called in any other case, it returns a new MarkDecorator
    │ │ │ │              instance with the original MarkDecorator's content updated with the
    │ │ │ │              arguments passed to this call.
    │ │ │ │        Note: The rules above prevent a MarkDecorator from storing only a single
    │ │ │ │        function or class reference as its positional argument with no additional
    │ │ │ │        keyword or positional arguments. You can work around this by using
    │ │ │ │        with_args().
    │ │ │ │ -        pprrooppeerrttyy name:: ssttrr_¶
    │ │ │ │ +        pprrooppeerrttyy name:: _ss_tt_rr_¶
    │ │ │ │              Alias for mark.name.
    │ │ │ │ -        pprrooppeerrttyy args:: ttuuppllee[[AAnnyy,, ......]]_¶
    │ │ │ │ +        pprrooppeerrttyy args:: _tt_uu_pp_ll_ee[[_AA_nn_yy,, ......]]_¶
    │ │ │ │              Alias for mark.args.
    │ │ │ │ -        pprrooppeerrttyy kwargs:: MMaappppiinngg[[ssttrr,, AAnnyy]]_¶
    │ │ │ │ +        pprrooppeerrttyy kwargs:: _MM_aa_pp_pp_ii_nn_gg[[_ss_tt_rr,, _AA_nn_yy]]_¶
    │ │ │ │              Alias for mark.kwargs.
    │ │ │ │          with_args(**aarrggss, ****kkwwaarrggss)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return a MarkDecorator with extra arguments added.
    │ │ │ │              Unlike calling the MarkDecorator, with_args() can be used even if
    │ │ │ │              the sole argument is a callable/class.
    │ │ │ │  ******** MMaarrkkGGeenneerraattoorr_?¶ ********
    │ │ │ │    ffiinnaall ccllaassss MarkGenerator_[_s_o_u_r_c_e_]_¶
    │ │ │ │ @@ -2917,19 +2915,19 @@
    │ │ │ │        @pytest.mark.slowtest
    │ │ │ │        def test_function():
    │ │ │ │            pass
    │ │ │ │        applies a 'slowtest' _M_a_r_k on test_function.
    │ │ │ │  ******** MMaarrkk_?¶ ********
    │ │ │ │    ffiinnaall ccllaassss Mark_[_s_o_u_r_c_e_]_¶
    │ │ │ │        A pytest mark.
    │ │ │ │ -        name:: ssttrr_¶
    │ │ │ │ +        name:: _ss_tt_rr_¶
    │ │ │ │              Name of the mark.
    │ │ │ │ -        args:: ttuuppllee[[AAnnyy,, ......]]_¶
    │ │ │ │ +        args:: _tt_uu_pp_ll_ee[[_AA_nn_yy,, ......]]_¶
    │ │ │ │              Positional arguments of the mark decorator.
    │ │ │ │ -        kwargs:: MMaappppiinngg[[ssttrr,, AAnnyy]]_¶
    │ │ │ │ +        kwargs:: _MM_aa_pp_pp_ii_nn_gg[[_ss_tt_rr,, _AA_nn_yy]]_¶
    │ │ │ │              Keyword arguments of the mark decorator.
    │ │ │ │          combined_with(ootthheerr)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return a new Mark which is a combination of this Mark and another
    │ │ │ │              Mark.
    │ │ │ │              Combines by appending args and merging kwargs.
    │ │ │ │                Parameters:
    │ │ │ │                    ootthheerr (_MM_aa_rr_kk) -- The mark to combine with.
    │ │ │ │ @@ -2971,51 +2969,51 @@
    │ │ │ │        Parser for command line arguments and config-file values.
    │ │ │ │          Variables:
    │ │ │ │              eexxttrraa__iinnffoo -- Dict of generic param -> value to display in case
    │ │ │ │              there's an error processing the command line arguments.
    │ │ │ │          getgroup(nnaammee, ddeessccrriippttiioonn=='''', aafftteerr==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Get (or create) a named option Group.
    │ │ │ │                Parameters:
    │ │ │ │ -                      * nnaammee (ssttrr) -- Name of the option group.
    │ │ │ │ -                      * ddeessccrriippttiioonn (ssttrr) -- Long description for --help
    │ │ │ │ +                      * nnaammee (_ss_tt_rr) -- Name of the option group.
    │ │ │ │ +                      * ddeessccrriippttiioonn (_ss_tt_rr) -- Long description for --help
    │ │ │ │                          output.
    │ │ │ │ -                      * aafftteerr (ssttrr || NNoonnee) -- Name of another group, used for
    │ │ │ │ +                      * aafftteerr (_ss_tt_rr || NNoonnee) -- Name of another group, used for
    │ │ │ │                          ordering --help output.
    │ │ │ │                Returns:
    │ │ │ │                    The option group.
    │ │ │ │                Return type:
    │ │ │ │                    _OO_pp_tt_ii_oo_nn_GG_rr_oo_uu_pp
    │ │ │ │              The returned group object has an addoption method with the same
    │ │ │ │              signature as _p_a_r_s_e_r_._a_d_d_o_p_t_i_o_n but will be shown in the respective
    │ │ │ │              group in the output of pytest --help.
    │ │ │ │          addoption(**ooppttss, ****aattttrrss)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Register a command line option.
    │ │ │ │                Parameters:
    │ │ │ │ -                      * ooppttss (ssttrr) -- Option names, can be short or long
    │ │ │ │ +                      * ooppttss (_ss_tt_rr) -- Option names, can be short or long
    │ │ │ │                          options.
    │ │ │ │ -                      * aattttrrss (AAnnyy) -- Same attributes as the argparse
    │ │ │ │ -                        library's add_argument() function accepts.
    │ │ │ │ +                      * aattttrrss (_AA_nn_yy) -- Same attributes as the argparse
    │ │ │ │ +                        library's _a_d_d___a_r_g_u_m_e_n_t_(_) function accepts.
    │ │ │ │              After command line parsing, options are available on the pytest
    │ │ │ │              config object via config.option.NAME where NAME is usually set by
    │ │ │ │              passing a dest attribute, for example addoption("--long",
    │ │ │ │              dest="NAME", ...).
    │ │ │ │          parse_known_args(aarrggss, nnaammeessppaaccee==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Parse the known arguments at this point.
    │ │ │ │                Returns:
    │ │ │ │                    An argparse namespace object.
    │ │ │ │                Return type:
    │ │ │ │ -                  NNaammeessppaaccee
    │ │ │ │ +                  _NN_aa_mm_ee_ss_pp_aa_cc_ee
    │ │ │ │          parse_known_and_unknown_args(aarrggss, nnaammeessppaaccee==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Parse the known arguments at this point, and also return the
    │ │ │ │              remaining unknown flag arguments.
    │ │ │ │                Returns:
    │ │ │ │                    A tuple containing an argparse namespace object for the known
    │ │ │ │                    arguments, and a list of unknown flag arguments.
    │ │ │ │                Return type:
    │ │ │ │ -                  tuple[NNaammeessppaaccee, list[str]]
    │ │ │ │ +                  _t_u_p_l_e[_NN_aa_mm_ee_ss_pp_aa_cc_ee, _l_i_s_t[_s_t_r]]
    │ │ │ │          addini(nnaammee, hheellpp, ttyyppee==NNoonnee, ddeeffaauulltt==NNoottSSeettTTyyppee..ttookkeenn, **, aalliiaasseess==(()))
    │ │ │ │          _[_s_o_u_r_c_e_]_¶
    │ │ │ │              Register a configuration file option.
    │ │ │ │              The value of configuration keys can be retrieved via a call to
    │ │ │ │              _c_o_n_f_i_g_._g_e_t_i_n_i_(_n_a_m_e_).
    │ │ │ │  ******** OOppttiioonnGGrroouupp_?¶ ********
    │ │ │ │    ccllaassss OptionGroup_[_s_o_u_r_c_e_]_¶
    │ │ │ │ @@ -3023,38 +3021,38 @@
    │ │ │ │          addoption(**ooppttss, ****aattttrrss)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Add an option to this group.
    │ │ │ │              If a shortened version of a long option is specified, it will be
    │ │ │ │              suppressed in the help. addoption('--twowords', '--two-words')
    │ │ │ │              results in help showing --two-words only, but --twowords gets
    │ │ │ │              accepted aanndd the automatic destination is in args.twowords.
    │ │ │ │                Parameters:
    │ │ │ │ -                      * ooppttss (ssttrr) -- Option names, can be short or long
    │ │ │ │ +                      * ooppttss (_ss_tt_rr) -- Option names, can be short or long
    │ │ │ │                          options. Note that lower-case short options (e.g. -x)
    │ │ │ │                          are reserved.
    │ │ │ │ -                      * aattttrrss (AAnnyy) -- Same attributes as the argparse
    │ │ │ │ -                        library's add_argument() function accepts.
    │ │ │ │ +                      * aattttrrss (_AA_nn_yy) -- Same attributes as the argparse
    │ │ │ │ +                        library's _a_d_d___a_r_g_u_m_e_n_t_(_) function accepts.
    │ │ │ │  ******** PPyytteessttPPlluuggiinnMMaannaaggeerr_?¶ ********
    │ │ │ │    ffiinnaall ccllaassss PytestPluginManager_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Bases: PluginManager
    │ │ │ │        A pluggy.PluginManager with additional pytest-specific functionality:
    │ │ │ │            * Loading plugins from the command line, PYTEST_PLUGINS env variable
    │ │ │ │              and pytest_plugins global variables found in plugins being loaded.
    │ │ │ │            * conftest.py loading during start-up.
    │ │ │ │          register(pplluuggiinn, nnaammee==NNoonnee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Register a plugin and return its name.
    │ │ │ │                Parameters:
    │ │ │ │ -                  nnaammee (ssttrr || NNoonnee) -- The name under which to register the
    │ │ │ │ +                  nnaammee (_ss_tt_rr || NNoonnee) -- The name under which to register the
    │ │ │ │                    plugin. If not specified, a name is generated using
    │ │ │ │                    _g_e_t___c_a_n_o_n_i_c_a_l___n_a_m_e_(_).
    │ │ │ │                Returns:
    │ │ │ │                    The plugin name. If the name is blocked from registering,
    │ │ │ │                    returns None.
    │ │ │ │                Return type:
    │ │ │ │ -                  str | None
    │ │ │ │ -            If the plugin is already registered, raises a ValueError.
    │ │ │ │ +                  _s_t_r | None
    │ │ │ │ +            If the plugin is already registered, raises a _V_a_l_u_e_E_r_r_o_r.
    │ │ │ │          getplugin(nnaammee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │          hasplugin(nnaammee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return whether a plugin with the given name is registered.
    │ │ │ │          import_plugin(mmooddnnaammee, ccoonnssiiddeerr__eennttrryy__ppooiinnttss==FFaallssee)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Import a plugin with modname.
    │ │ │ │              If consider_entry_points is True, entry point names are also
    │ │ │ │              considered to find a plugin.
    │ │ │ │ @@ -3086,15 +3084,15 @@
    │ │ │ │              name of a registered plugin use _g_e_t___n_a_m_e_(_p_l_u_g_i_n_) instead.
    │ │ │ │          get_hookcallers(pplluuggiinn)_¶
    │ │ │ │              Get all hook callers for the specified plugin.
    │ │ │ │                Returns:
    │ │ │ │                    The hook callers, or None if plugin is not registered in this
    │ │ │ │                    plugin manager.
    │ │ │ │                Return type:
    │ │ │ │ -                  list[HHooookkCCaalllleerr] | None
    │ │ │ │ +                  _l_i_s_t[HHooookkCCaalllleerr] | None
    │ │ │ │          get_name(pplluuggiinn)_¶
    │ │ │ │              Return the name the plugin is registered under, or None if is
    │ │ │ │              isn't.
    │ │ │ │          get_plugin(nnaammee)_¶
    │ │ │ │              Return the plugin registered under the given name, if any.
    │ │ │ │          get_plugins()_¶
    │ │ │ │              Return a set of all registered plugin objects.
    │ │ │ │ @@ -3108,21 +3106,21 @@
    │ │ │ │              Return a list of (name, plugin) pairs for all registered plugins.
    │ │ │ │          list_plugin_distinfo()_¶
    │ │ │ │              Return a list of (plugin, distinfo) pairs for all setuptools-
    │ │ │ │              registered plugins.
    │ │ │ │          load_setuptools_entrypoints(ggrroouupp, nnaammee==NNoonnee)_¶
    │ │ │ │              Load modules from querying the specified setuptools group.
    │ │ │ │                Parameters:
    │ │ │ │ -                      * ggrroouupp (ssttrr) -- Entry point group to load plugins.
    │ │ │ │ -                      * nnaammee (ssttrr || NNoonnee) -- If given, loads only plugins with
    │ │ │ │ +                      * ggrroouupp (_ss_tt_rr) -- Entry point group to load plugins.
    │ │ │ │ +                      * nnaammee (_ss_tt_rr || NNoonnee) -- If given, loads only plugins with
    │ │ │ │                          the given name.
    │ │ │ │                Returns:
    │ │ │ │                    The number of plugins loaded by this call.
    │ │ │ │                Return type:
    │ │ │ │ -                  int
    │ │ │ │ +                  _i_n_t
    │ │ │ │          set_blocked(nnaammee)_¶
    │ │ │ │              Block registrations of the given name, unregister if already
    │ │ │ │              registered.
    │ │ │ │          subset_hook_caller(nnaammee, rreemmoovvee__pplluuggiinnss)_¶
    │ │ │ │              Return a proxy HookCaller instance for the named method which
    │ │ │ │              manages calls to all registered plugins except the ones from
    │ │ │ │              remove_plugins.
    │ │ │ │ @@ -3179,22 +3177,22 @@
    │ │ │ │              # above line is equivalent to
    │ │ │ │              assert isinstance(excinfo.value.__cause__, SyntaxError)
    │ │ │ │              assert re.search("foo", str(excinfo.value.__cause__)
    │ │ │ │  ******** RRaaiisseessGGrroouupp_?¶ ********
    │ │ │ │  TTuuttoorriiaall: _A_s_s_e_r_t_i_o_n_s_ _a_b_o_u_t_ _e_x_p_e_c_t_e_d_ _e_x_c_e_p_t_i_o_n_ _g_r_o_u_p_s
    │ │ │ │    ffiinnaall ccllaassss RaisesGroup_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Added in version 8.4.
    │ │ │ │ -      Contextmanager for checking for an expected ExceptionGroup. This works
    │ │ │ │ +      Contextmanager for checking for an expected _E_x_c_e_p_t_i_o_n_G_r_o_u_p. This works
    │ │ │ │        similar to pytest.raises(), but allows for specifying the structure of an
    │ │ │ │ -      ExceptionGroup. _E_x_c_e_p_t_i_o_n_I_n_f_o_._g_r_o_u_p___c_o_n_t_a_i_n_s_(_) also tries to handle
    │ │ │ │ +      _E_x_c_e_p_t_i_o_n_G_r_o_u_p. _E_x_c_e_p_t_i_o_n_I_n_f_o_._g_r_o_u_p___c_o_n_t_a_i_n_s_(_) also tries to handle
    │ │ │ │        exception groups, but it is very bad at checking that you ddiiddnn''tt get
    │ │ │ │        unexpected exceptions.
    │ │ │ │ -      The catching behaviour differs from except*, being much stricter about
    │ │ │ │ +      The catching behaviour differs from _e_x_c_e_p_t_*, being much stricter about
    │ │ │ │        the structure by default. By using allow_unwrapped=True and
    │ │ │ │ -      flatten_subgroups=True you can match except* fully when expecting a
    │ │ │ │ +      flatten_subgroups=True you can match _e_x_c_e_p_t_* fully when expecting a
    │ │ │ │        single exception.
    │ │ │ │        Examples:
    │ │ │ │        with RaisesGroup(ValueError):
    │ │ │ │            raise ExceptionGroup("", (ValueError(),))
    │ │ │ │        # match
    │ │ │ │        with RaisesGroup(
    │ │ │ │            ValueError,
    │ │ │ │ @@ -3233,29 +3231,29 @@
    │ │ │ │        exception group.
    │ │ │ │        The matching algorithm is greedy, which means cases such as this may
    │ │ │ │        fail:
    │ │ │ │        with RaisesGroup(ValueError, RaisesExc(ValueError, match="hello")):
    │ │ │ │            raise ExceptionGroup("", (ValueError("hello"), ValueError
    │ │ │ │        ("goodbye")))
    │ │ │ │        even though it generally does not care about the order of the exceptions
    │ │ │ │ -      in the group. To avoid the above you should specify the first ValueError
    │ │ │ │ +      in the group. To avoid the above you should specify the first _V_a_l_u_e_E_r_r_o_r
    │ │ │ │        with a _R_a_i_s_e_s_E_x_c as well.
    │ │ │ │        Note
    │ │ │ │        When raised exceptions don't match the expected ones, you'll get a
    │ │ │ │        detailed error message explaining why. This includes repr(check) if set,
    │ │ │ │        which in Python can be overly verbose, showing memory locations etc etc.
    │ │ │ │        If installed and imported (in e.g. conftest.py), the hypothesis library
    │ │ │ │        will monkeypatch this output to provide shorter & more readable repr's.
    │ │ │ │          fail_reason_¶
    │ │ │ │              Set after a call to _m_a_t_c_h_e_s_(_) to give a human-readable reason for
    │ │ │ │              why the match failed. When used as a context manager the string
    │ │ │ │              will be printed as the reason for the test failing.
    │ │ │ │ -        matches(eexxcceeppttiioonn:: BBaasseeEExxcceeppttiioonn || NNoonnee) → TypeGuard[ExceptionGroup
    │ │ │ │ +        matches(eexxcceeppttiioonn:: _BB_aa_ss_ee_EE_xx_cc_ee_pp_tt_ii_oo_nn || _NN_oo_nn_ee) → TypeGuard[_E_x_c_e_p_t_i_o_n_G_r_o_u_p
    │ │ │ │          [ExcT_1]]_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -        matches(eexxcceeppttiioonn:: BBaasseeEExxcceeppttiioonn || NNoonnee) → TypeGuard[BaseExceptionGroup
    │ │ │ │ +        matches(eexxcceeppttiioonn:: _BB_aa_ss_ee_EE_xx_cc_ee_pp_tt_ii_oo_nn || _NN_oo_nn_ee) → TypeGuard[_B_a_s_e_E_x_c_e_p_t_i_o_n_G_r_o_u_p
    │ │ │ │          [BaseExcT_1]]
    │ │ │ │              Check if an exception matches the requirements of this RaisesGroup.
    │ │ │ │              If it fails, RaisesGroup.fail_reason will be set.
    │ │ │ │              Example:
    │ │ │ │              with pytest.raises(TypeError) as excinfo:
    │ │ │ │                  ...
    │ │ │ │              assert RaisesGroup(ValueError).matches(excinfo.value.__cause__)
    │ │ │ │ @@ -3292,105 +3290,105 @@
    │ │ │ │              and is the second element of the returned tuple.
    │ │ │ │  ******** TTeessttRReeppoorrtt_?¶ ********
    │ │ │ │    ccllaassss TestReport_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Bases: BaseReport
    │ │ │ │        Basic test report object (also used for setup and teardown calls if they
    │ │ │ │        fail).
    │ │ │ │        Reports can contain arbitrary extra attributes.
    │ │ │ │ -        nodeid:: ssttrr_¶
    │ │ │ │ +        nodeid:: _ss_tt_rr_¶
    │ │ │ │              Normalized collection nodeid.
    │ │ │ │ -        location:: ttuuppllee[[ssttrr,, iinntt || NNoonnee,, ssttrr]]_¶
    │ │ │ │ +        location:: _tt_uu_pp_ll_ee[[_ss_tt_rr,, _ii_nn_tt || _NN_oo_nn_ee,, _ss_tt_rr]]_¶
    │ │ │ │              A (filesystempath, lineno, domaininfo) tuple indicating the actual
    │ │ │ │              location of a test item - it might be different from the collected
    │ │ │ │              one e.g. if a method is inherited from a different module. The
    │ │ │ │              filesystempath may be relative to config.rootdir. The line number
    │ │ │ │              is 0-based.
    │ │ │ │ -        keywords:: MMaappppiinngg[[ssttrr,, AAnnyy]]_¶
    │ │ │ │ +        keywords:: _MM_aa_pp_pp_ii_nn_gg[[_ss_tt_rr,, _AA_nn_yy]]_¶
    │ │ │ │              A name -> value dictionary containing all keywords and markers
    │ │ │ │              associated with a test invocation.
    │ │ │ │ -        outcome:: LLiitteerraall[[''ppaasssseedd'',, ''ffaaiilleedd'',, ''sskkiippppeedd'']]_¶
    │ │ │ │ +        outcome:: _LL_ii_tt_ee_rr_aa_ll[[''ppaasssseedd'',, ''ffaaiilleedd'',, ''sskkiippppeedd'']]_¶
    │ │ │ │              Test outcome, always one of "passed", "failed", "skipped".
    │ │ │ │ -        longrepr:: NNoonnee || _EE_xx_cc_ee_pp_tt_ii_oo_nn_II_nn_ff_oo[[BBaasseeEExxcceeppttiioonn]] || ttuuppllee[[ssttrr,, iinntt,, ssttrr]] ||
    │ │ │ │ -        ssttrr || TTeerrmmiinnaallRReepprr_¶
    │ │ │ │ +        longrepr:: _NN_oo_nn_ee || _EE_xx_cc_ee_pp_tt_ii_oo_nn_II_nn_ff_oo[[_BB_aa_ss_ee_EE_xx_cc_ee_pp_tt_ii_oo_nn]] || _tt_uu_pp_ll_ee[[_ss_tt_rr,, _ii_nn_tt,, _ss_tt_rr]] ||
    │ │ │ │ +        _ss_tt_rr || TTeerrmmiinnaallRReepprr_¶
    │ │ │ │              None or a failure representation.
    │ │ │ │ -        when:: LLiitteerraall[[''sseettuupp'',, ''ccaallll'',, ''tteeaarrddoowwnn'']]_¶
    │ │ │ │ +        when:: _LL_ii_tt_ee_rr_aa_ll[[''sseettuupp'',, ''ccaallll'',, ''tteeaarrddoowwnn'']]_¶
    │ │ │ │              One of 'setup', 'call', 'teardown' to indicate runtest phase.
    │ │ │ │          user_properties_¶
    │ │ │ │              User properties is a list of tuples (name, value) that holds user
    │ │ │ │              defined properties of the test.
    │ │ │ │ -        sections:: lliisstt[[ttuuppllee[[ssttrr,, ssttrr]]]]_¶
    │ │ │ │ +        sections:: _ll_ii_ss_tt[[_tt_uu_pp_ll_ee[[_ss_tt_rr,, _ss_tt_rr]]]]_¶
    │ │ │ │              Tuples of str (heading, content) with extra information for the
    │ │ │ │              test report. Used by pytest to add text captured from stdout,
    │ │ │ │              stderr, and intercepted logging events. May be used by other
    │ │ │ │              plugins to add arbitrary information to reports.
    │ │ │ │ -        duration:: ffllooaatt_¶
    │ │ │ │ +        duration:: _ff_ll_oo_aa_tt_¶
    │ │ │ │              Time it took to run just the test.
    │ │ │ │ -        start:: ffllooaatt_¶
    │ │ │ │ +        start:: _ff_ll_oo_aa_tt_¶
    │ │ │ │              The system time when the call started, in seconds since the epoch.
    │ │ │ │ -        stop:: ffllooaatt_¶
    │ │ │ │ +        stop:: _ff_ll_oo_aa_tt_¶
    │ │ │ │              The system time when the call ended, in seconds since the epoch.
    │ │ │ │          ccllaassssmmeetthhoodd from_item_and_call(iitteemm, ccaallll)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Create and fill a TestReport with standard item and call info.
    │ │ │ │                Parameters:
    │ │ │ │                        * iitteemm (_II_tt_ee_mm) -- The item.
    │ │ │ │                        * ccaallll (_CC_aa_ll_ll_II_nn_ff_oo[[NNoonnee]]) -- The call info.
    │ │ │ │ -        pprrooppeerrttyy caplog:: ssttrr_¶
    │ │ │ │ +        pprrooppeerrttyy caplog:: _ss_tt_rr_¶
    │ │ │ │              Return captured log lines, if log capturing is enabled.
    │ │ │ │              Added in version 3.5.
    │ │ │ │ -        pprrooppeerrttyy capstderr:: ssttrr_¶
    │ │ │ │ +        pprrooppeerrttyy capstderr:: _ss_tt_rr_¶
    │ │ │ │              Return captured text from stderr, if capturing is enabled.
    │ │ │ │              Added in version 3.0.
    │ │ │ │ -        pprrooppeerrttyy capstdout:: ssttrr_¶
    │ │ │ │ +        pprrooppeerrttyy capstdout:: _ss_tt_rr_¶
    │ │ │ │              Return captured text from stdout, if capturing is enabled.
    │ │ │ │              Added in version 3.0.
    │ │ │ │ -        pprrooppeerrttyy count_towards_summary:: bbooooll_¶
    │ │ │ │ +        pprrooppeerrttyy count_towards_summary:: _bb_oo_oo_ll_¶
    │ │ │ │              EExxppeerriimmeennttaall Whether this report should be counted towards the
    │ │ │ │              totals shown at the end of the test session: "1 passed, 1 failure,
    │ │ │ │              etc".
    │ │ │ │              Note
    │ │ │ │              This function is considered eexxppeerriimmeennttaall, so beware that it is
    │ │ │ │              subject to changes even in patch releases.
    │ │ │ │ -        pprrooppeerrttyy failed:: bbooooll_¶
    │ │ │ │ +        pprrooppeerrttyy failed:: _bb_oo_oo_ll_¶
    │ │ │ │              Whether the outcome is failed.
    │ │ │ │ -        pprrooppeerrttyy fspath:: ssttrr_¶
    │ │ │ │ +        pprrooppeerrttyy fspath:: _ss_tt_rr_¶
    │ │ │ │              The path portion of the reported node, as a string.
    │ │ │ │ -        pprrooppeerrttyy head_line:: ssttrr || NNoonnee_¶
    │ │ │ │ +        pprrooppeerrttyy head_line:: _ss_tt_rr || _NN_oo_nn_ee_¶
    │ │ │ │              EExxppeerriimmeennttaall The head line shown with longrepr output for this
    │ │ │ │              report, more commonly during traceback representation during
    │ │ │ │              failures:
    │ │ │ │              ________ Test.foo ________
    │ │ │ │              In the example above, the head_line is "Test.foo".
    │ │ │ │              Note
    │ │ │ │              This function is considered eexxppeerriimmeennttaall, so beware that it is
    │ │ │ │              subject to changes even in patch releases.
    │ │ │ │ -        pprrooppeerrttyy longreprtext:: ssttrr_¶
    │ │ │ │ +        pprrooppeerrttyy longreprtext:: _ss_tt_rr_¶
    │ │ │ │              Read-only property that returns the full string representation of
    │ │ │ │              longrepr.
    │ │ │ │              Added in version 3.0.
    │ │ │ │ -        pprrooppeerrttyy passed:: bbooooll_¶
    │ │ │ │ +        pprrooppeerrttyy passed:: _bb_oo_oo_ll_¶
    │ │ │ │              Whether the outcome is passed.
    │ │ │ │ -        pprrooppeerrttyy skipped:: bbooooll_¶
    │ │ │ │ +        pprrooppeerrttyy skipped:: _bb_oo_oo_ll_¶
    │ │ │ │              Whether the outcome is skipped.
    │ │ │ │  ******** TTeessttSShhoorrttLLooggRReeppoorrtt_?¶ ********
    │ │ │ │    ccllaassss TestShortLogReport_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Used to store the test status result category, shortletter and verbose
    │ │ │ │        word. For example "rerun", "R", ("RERUN", {"yellow": True}).
    │ │ │ │          Variables:
    │ │ │ │                  * ccaatteeggoorryy -- The class of result, for example “passed”,
    │ │ │ │                    “skipped”, “error”, or the empty string.
    │ │ │ │                  * lleetttteerr -- The short letter shown as testing progresses, for
    │ │ │ │                    example ".", "s", "E", or the empty string.
    │ │ │ │                  * wwoorrdd -- Verbose word is shown as testing progresses in
    │ │ │ │                    verbose mode, for example "PASSED", "SKIPPED", "ERROR", or
    │ │ │ │                    the empty string.
    │ │ │ │ -        category:: ssttrr_¶
    │ │ │ │ +        category:: _ss_tt_rr_¶
    │ │ │ │              Alias for field number 0
    │ │ │ │ -        letter:: ssttrr_¶
    │ │ │ │ +        letter:: _ss_tt_rr_¶
    │ │ │ │              Alias for field number 1
    │ │ │ │ -        word:: ssttrr || ttuuppllee[[ssttrr,, MMaappppiinngg[[ssttrr,, bbooooll]]]]_¶
    │ │ │ │ +        word:: _ss_tt_rr || _tt_uu_pp_ll_ee[[_ss_tt_rr,, _MM_aa_pp_pp_ii_nn_gg[[_ss_tt_rr,, _bb_oo_oo_ll]]]]_¶
    │ │ │ │              Alias for field number 2
    │ │ │ │  ******** RReessuulltt_?¶ ********
    │ │ │ │  Result object used within _h_o_o_k_ _w_r_a_p_p_e_r_s, see Result in the pluggy documentation
    │ │ │ │  for more information.
    │ │ │ │  ******** SSttaasshh_?¶ ********
    │ │ │ │    ccllaassss Stash_[_s_o_u_r_c_e_]_¶
    │ │ │ │        Stash is a type-safe heterogeneous mutable mapping that allows keys and
    │ │ │ │ @@ -3429,26 +3427,26 @@
    │ │ │ │              Delete the value for key.
    │ │ │ │              Raises KeyError if the key wasn't set before.
    │ │ │ │          __contains__(kkeeyy)_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return whether key was set.
    │ │ │ │          __len__()_[_s_o_u_r_c_e_]_¶
    │ │ │ │              Return how many items exist in the stash.
    │ │ │ │    ccllaassss StashKey_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -      Bases: Generic[T]
    │ │ │ │ +      Bases: _G_e_n_e_r_i_c[T]
    │ │ │ │        StashKey is an object used as a key to a _S_t_a_s_h.
    │ │ │ │        A StashKey is associated with the type T of the value of the key.
    │ │ │ │        A StashKey is unique and cannot conflict with another key.
    │ │ │ │        Added in version 7.0.
    │ │ │ │  ********** GGlloobbaall VVaarriiaabblleess_?¶ **********
    │ │ │ │  pytest treats some global variables in a special manner when defined in a test
    │ │ │ │  module or conftest.py files.
    │ │ │ │    collect_ignore_¶
    │ │ │ │  TTuuttoorriiaall: _C_u_s_t_o_m_i_z_i_n_g_ _t_e_s_t_ _c_o_l_l_e_c_t_i_o_n
    │ │ │ │  Can be declared in ccoonnfftteesstt..ppyy ffiilleess to exclude test directories or modules.
    │ │ │ │ -Needs to be a list of paths (str, pathlib.Path or any os.PathLike).
    │ │ │ │ +Needs to be a list of paths (str, _p_a_t_h_l_i_b_._P_a_t_h or any _o_s_._P_a_t_h_L_i_k_e).
    │ │ │ │  collect_ignore = ["setup.py"]
    │ │ │ │    collect_ignore_glob_¶
    │ │ │ │  TTuuttoorriiaall: _C_u_s_t_o_m_i_z_i_n_g_ _t_e_s_t_ _c_o_l_l_e_c_t_i_o_n
    │ │ │ │  Can be declared in ccoonnfftteesstt..ppyy ffiilleess to exclude test directories or modules
    │ │ │ │  with Unix shell-style wildcards. Needs to be list[str] where str can contain
    │ │ │ │  glob patterns.
    │ │ │ │  collect_ignore_glob = ["*_ignore.py"]
    │ │ │ │ @@ -3519,24 +3517,24 @@
    │ │ │ │        supporting this community standard.
    │ │ │ │    FORCE_COLOR_¶
    │ │ │ │        When set to a non-empty string (regardless of value), pytest will use
    │ │ │ │        color in terminal output. PY_COLORS and NO_COLOR take precedence over
    │ │ │ │        FORCE_COLOR.
    │ │ │ │  ********** EExxcceeppttiioonnss_?¶ **********
    │ │ │ │    eexxcceeppttiioonn UsageError_¶
    │ │ │ │ -      Bases: Exception
    │ │ │ │ +      Bases: _E_x_c_e_p_t_i_o_n
    │ │ │ │        Error in pytest usage or invocation.
    │ │ │ │    ffiinnaall eexxcceeppttiioonn FixtureLookupError_[_s_o_u_r_c_e_]_¶
    │ │ │ │ -      Bases: LookupError
    │ │ │ │ +      Bases: _L_o_o_k_u_p_E_r_r_o_r
    │ │ │ │        Could not return a requested fixture (missing or invalid).
    │ │ │ │  ********** WWaarrnniinnggss_?¶ **********
    │ │ │ │  Custom warnings generated in some situations such as improper usage or
    │ │ │ │  deprecated features.
    │ │ │ │    ccllaassss PytestWarning_¶
    │ │ │ │ -      Bases: UserWarning
    │ │ │ │ +      Bases: _U_s_e_r_W_a_r_n_i_n_g
    │ │ │ │        Base class for all warnings emitted by pytest.
    │ │ │ │    ccllaassss PytestAssertRewriteWarning_¶
    │ │ │ │        Bases: _P_y_t_e_s_t_W_a_r_n_i_n_g
    │ │ │ │        Warning emitted by the pytest assert rewrite module.
    │ │ │ │    ccllaassss PytestCacheWarning_¶
    │ │ │ │        Bases: _P_y_t_e_s_t_W_a_r_n_i_n_g
    │ │ │ │        Warning emitted by the cache plugin in various situations.
    │ │ │ │ @@ -3544,18 +3542,18 @@
    │ │ │ │        Bases: _P_y_t_e_s_t_W_a_r_n_i_n_g
    │ │ │ │        Warning emitted when pytest is not able to collect a file or symbol in a
    │ │ │ │        module.
    │ │ │ │    ccllaassss PytestConfigWarning_¶
    │ │ │ │        Bases: _P_y_t_e_s_t_W_a_r_n_i_n_g
    │ │ │ │        Warning emitted for configuration issues.
    │ │ │ │    ccllaassss PytestDeprecationWarning_¶
    │ │ │ │ -      Bases: _P_y_t_e_s_t_W_a_r_n_i_n_g, DeprecationWarning
    │ │ │ │ +      Bases: _P_y_t_e_s_t_W_a_r_n_i_n_g, _D_e_p_r_e_c_a_t_i_o_n_W_a_r_n_i_n_g
    │ │ │ │        Warning class for features that will be removed in a future version.
    │ │ │ │    ccllaassss PytestExperimentalApiWarning_¶
    │ │ │ │ -      Bases: _P_y_t_e_s_t_W_a_r_n_i_n_g, FutureWarning
    │ │ │ │ +      Bases: _P_y_t_e_s_t_W_a_r_n_i_n_g, _F_u_t_u_r_e_W_a_r_n_i_n_g
    │ │ │ │        Warning category used to denote experiments in pytest.
    │ │ │ │        Use sparingly as the API might change or even be removed completely in a
    │ │ │ │        future version.
    │ │ │ │    ccllaassss PytestReturnNotNoneWarning_¶
    │ │ │ │        Bases: _P_y_t_e_s_t_W_a_r_n_i_n_g
    │ │ │ │        Warning emitted when a test function returns a value other than None.
    │ │ │ │        See _R_e_t_u_r_n_i_n_g_ _n_o_n_-_N_o_n_e_ _v_a_l_u_e_ _i_n_ _t_e_s_t_ _f_u_n_c_t_i_o_n_s for details.
    │ │ │ │ @@ -3565,19 +3563,19 @@
    │ │ │ │    ccllaassss PytestUnknownMarkWarning_¶
    │ │ │ │        Bases: _P_y_t_e_s_t_W_a_r_n_i_n_g
    │ │ │ │        Warning emitted on use of unknown markers.
    │ │ │ │        See _H_o_w_ _t_o_ _m_a_r_k_ _t_e_s_t_ _f_u_n_c_t_i_o_n_s_ _w_i_t_h_ _a_t_t_r_i_b_u_t_e_s for details.
    │ │ │ │    ccllaassss PytestUnraisableExceptionWarning_¶
    │ │ │ │        Bases: _P_y_t_e_s_t_W_a_r_n_i_n_g
    │ │ │ │        An unraisable exception was reported.
    │ │ │ │ -      Unraisable exceptions are exceptions raised in __del__ implementations
    │ │ │ │ +      Unraisable exceptions are exceptions raised in _____d_e_l____ implementations
    │ │ │ │        and similar situations when the exception cannot be raised as normal.
    │ │ │ │    ccllaassss PytestUnhandledThreadExceptionWarning_¶
    │ │ │ │        Bases: _P_y_t_e_s_t_W_a_r_n_i_n_g
    │ │ │ │ -      An unhandled exception occurred in a Thread.
    │ │ │ │ +      An unhandled exception occurred in a _T_h_r_e_a_d.
    │ │ │ │        Such exceptions don't propagate normally.
    │ │ │ │  Consult the _I_n_t_e_r_n_a_l_ _p_y_t_e_s_t_ _w_a_r_n_i_n_g_s section in the documentation for more
    │ │ │ │  information.
    │ │ │ │  ********** CCoonnffiigguurraattiioonn OOppttiioonnss_?¶ **********
    │ │ │ │  Here is a list of builtin configuration options that may be written in a
    │ │ │ │  pytest.ini (or .pytest.ini), pyproject.toml, tox.ini, or setup.cfg file,
    │ │ │ │  usually located at the root of your repository.
    │ │ │ │ @@ -3756,15 +3754,15 @@
    │ │ │ │        enable_assertion_pass_hook = true
    │ │ │ │    faulthandler_exit_on_timeout_¶
    │ │ │ │          Type:
    │ │ │ │              bool
    │ │ │ │          Default:
    │ │ │ │              false
    │ │ │ │        Exit the pytest process after the per-test timeout is reached by passing
    │ │ │ │ -      exit=True to the faulthandler.dump_traceback_later() function. This is
    │ │ │ │ +      exit=True to the _f_a_u_l_t_h_a_n_d_l_e_r_._d_u_m_p___t_r_a_c_e_b_a_c_k___l_a_t_e_r_(_) function. This is
    │ │ │ │        particularly useful to avoid wasting CI resources for test suites that
    │ │ │ │        are prone to putting the main Python interpreter into a deadlock state.
    │ │ │ │        #toml
    │ │ │ │        [pytest]
    │ │ │ │        faulthandler_timeout = 5
    │ │ │ │        faulthandler_exit_on_timeout = true
    │ │ │ │        oini
    │ │ │ │ @@ -3774,15 +3772,15 @@
    │ │ │ │    faulthandler_timeout_¶
    │ │ │ │          Type:
    │ │ │ │              float
    │ │ │ │          Default:
    │ │ │ │              0 (disabled)
    │ │ │ │        Dumps the tracebacks of all threads if a test takes longer than X seconds
    │ │ │ │        to run (including fixture setup and teardown). Implemented using the
    │ │ │ │ -      faulthandler.dump_traceback_later() function, so all caveats there apply.
    │ │ │ │ +      _f_a_u_l_t_h_a_n_d_l_e_r_._d_u_m_p___t_r_a_c_e_b_a_c_k___l_a_t_e_r_(_) function, so all caveats there apply.
    │ │ │ │        #toml
    │ │ │ │        [pytest]
    │ │ │ │        faulthandler_timeout = 5
    │ │ │ │        oini
    │ │ │ │        [pytest]
    │ │ │ │        faulthandler_timeout = 5
    │ │ │ │        For more information please refer to _F_a_u_l_t_ _H_a_n_d_l_e_r.
    │ │ │ │ @@ -3948,29 +3946,29 @@
    │ │ │ │        [pytest]
    │ │ │ │        log_cli = true
    │ │ │ │    log_cli_date_format_¶
    │ │ │ │          Type:
    │ │ │ │              str
    │ │ │ │          Default:
    │ │ │ │              Fallback to log_date_format
    │ │ │ │ -      Sets a time.strftime()-compatible string that will be used when
    │ │ │ │ +      Sets a _t_i_m_e_._s_t_r_f_t_i_m_e_(_)-compatible string that will be used when
    │ │ │ │        formatting dates for live logging.
    │ │ │ │        #toml
    │ │ │ │        [pytest]
    │ │ │ │        log_cli_date_format = "%Y-%m-%d %H:%M:%S"
    │ │ │ │        oini
    │ │ │ │        [pytest]
    │ │ │ │        log_cli_date_format = %Y-%m-%d %H:%M:%S
    │ │ │ │        For more information, see _L_i_v_e_ _L_o_g_s.
    │ │ │ │    log_cli_format_¶
    │ │ │ │          Type:
    │ │ │ │              str
    │ │ │ │          Default:
    │ │ │ │              Fallback to log_format
    │ │ │ │ -      Sets a logging-compatible string used to format live logging messages.
    │ │ │ │ +      Sets a _l_o_g_g_i_n_g-compatible string used to format live logging messages.
    │ │ │ │        #toml
    │ │ │ │        [pytest]
    │ │ │ │        log_cli_format = "%(asctime)s %(levelname)s %(message)s"
    │ │ │ │        oini
    │ │ │ │        [pytest]
    │ │ │ │        log_cli_format = %(asctime)s %(levelname)s %(message)s
    │ │ │ │        For more information, see _L_i_v_e_ _L_o_g_s.
    │ │ │ │ @@ -3993,15 +3991,15 @@
    │ │ │ │        log_cli_level = 10
    │ │ │ │        For more information, see _L_i_v_e_ _L_o_g_s.
    │ │ │ │    log_date_format_¶
    │ │ │ │          Type:
    │ │ │ │              str
    │ │ │ │          Default:
    │ │ │ │              "%H:%M:%S"
    │ │ │ │ -      Sets a time.strftime()-compatible string that will be used when
    │ │ │ │ +      Sets a _t_i_m_e_._s_t_r_f_t_i_m_e_(_)-compatible string that will be used when
    │ │ │ │        formatting dates for logging capture.
    │ │ │ │        #toml
    │ │ │ │        [pytest]
    │ │ │ │        log_date_format = "%Y-%m-%d %H:%M:%S"
    │ │ │ │        oini
    │ │ │ │        [pytest]
    │ │ │ │        log_date_format = %Y-%m-%d %H:%M:%S
    │ │ │ │ @@ -4020,29 +4018,29 @@
    │ │ │ │        log_file = logs/pytest-logs.txt
    │ │ │ │        For more information, see _H_o_w_ _t_o_ _m_a_n_a_g_e_ _l_o_g_g_i_n_g.
    │ │ │ │    log_file_date_format_¶
    │ │ │ │          Type:
    │ │ │ │              str
    │ │ │ │          Default:
    │ │ │ │              Fallback to log_date_format
    │ │ │ │ -      Sets a time.strftime()-compatible string that will be used when
    │ │ │ │ +      Sets a _t_i_m_e_._s_t_r_f_t_i_m_e_(_)-compatible string that will be used when
    │ │ │ │        formatting dates for the logging file.
    │ │ │ │        #toml
    │ │ │ │        [pytest]
    │ │ │ │        log_file_date_format = "%Y-%m-%d %H:%M:%S"
    │ │ │ │        oini
    │ │ │ │        [pytest]
    │ │ │ │        log_file_date_format = %Y-%m-%d %H:%M:%S
    │ │ │ │        For more information, see _H_o_w_ _t_o_ _m_a_n_a_g_e_ _l_o_g_g_i_n_g.
    │ │ │ │    log_file_format_¶
    │ │ │ │          Type:
    │ │ │ │              str
    │ │ │ │          Default:
    │ │ │ │              Fallback to log_format
    │ │ │ │ -      Sets a logging-compatible string used to format logging messages
    │ │ │ │ +      Sets a _l_o_g_g_i_n_g-compatible string used to format logging messages
    │ │ │ │        redirected to the logging file.
    │ │ │ │        #toml
    │ │ │ │        [pytest]
    │ │ │ │        log_file_format = "%(asctime)s %(levelname)s %(message)s"
    │ │ │ │        oini
    │ │ │ │        [pytest]
    │ │ │ │        log_file_format = %(asctime)s %(levelname)s %(message)s
    │ │ │ │ @@ -4079,15 +4077,15 @@
    │ │ │ │        log_file_mode = a
    │ │ │ │        For more information, see _H_o_w_ _t_o_ _m_a_n_a_g_e_ _l_o_g_g_i_n_g.
    │ │ │ │    log_format_¶
    │ │ │ │          Type:
    │ │ │ │              str
    │ │ │ │          Default:
    │ │ │ │              %(levelname)-8s %(name)s:%(filename)s:%(lineno)d %(message)s
    │ │ │ │ -      Sets a logging-compatible string used to format captured logging
    │ │ │ │ +      Sets a _l_o_g_g_i_n_g-compatible string used to format captured logging
    │ │ │ │        messages.
    │ │ │ │        #toml
    │ │ │ │        [pytest]
    │ │ │ │        log_format = "%(asctime)s %(levelname)s %(message)s"
    │ │ │ │        oini
    │ │ │ │        [pytest]
    │ │ │ │        log_format = %(asctime)s %(levelname)s %(message)s
    │ │ │ │ @@ -4226,16 +4224,16 @@
    │ │ │ │        derived class, as unittest's own collection framework is used to collect
    │ │ │ │        those tests.
    │ │ │ │        See _C_h_a_n_g_i_n_g_ _n_a_m_i_n_g_ _c_o_n_v_e_n_t_i_o_n_s for more detailed examples.
    │ │ │ │    pythonpath_¶
    │ │ │ │          Type:
    │ │ │ │              list[str]
    │ │ │ │        Sets list of directories that should be added to the python search path.
    │ │ │ │ -      Directories will be added to the head of sys.path. Similar to the
    │ │ │ │ -      PYTHONPATH environment variable, the directories will be included in
    │ │ │ │ +      Directories will be added to the head of _s_y_s_._p_a_t_h. Similar to the
    │ │ │ │ +      _P_Y_T_H_O_N_P_A_T_H environment variable, the directories will be included in
    │ │ │ │        where Python will look for imported modules. Paths are relative to the
    │ │ │ │        _r_o_o_t_d_i_r directory. Directories remain in path for the duration of the
    │ │ │ │        test session.
    │ │ │ │        #toml
    │ │ │ │        [pytest]
    │ │ │ │        pythonpath = ["src1", "src2"]
    │ │ │ │        oini
    │ │ ├── ./usr/share/doc/python-pytest-doc/html/searchindex.js
    │ │ │ ├── js-beautify {}
    │ │ │ │ @@ -2271,26 +2271,26 @@
    │ │ │ │          ],
    │ │ │ │          "Using markers to pass data to fixtures": [
    │ │ │ │              [226, "using-markers-to-pass-data-to-fixtures"]
    │ │ │ │          ],
    │ │ │ │          "Using marks with parametrized fixtures": [
    │ │ │ │              [226, "using-marks-with-parametrized-fixtures"]
    │ │ │ │          ],
    │ │ │ │ +        "Using pdb \u2014 The Python Debugger with pytest": [
    │ │ │ │ +            [225, "using-python-library-pdb-with-pytest"]
    │ │ │ │ +        ],
    │ │ │ │          "Using print statements for debugging": [
    │ │ │ │              [221, "using-print-statements-for-debugging"]
    │ │ │ │          ],
    │ │ │ │          "Using pytest's strict mode": [
    │ │ │ │              [210, "using-pytest-s-strict-mode"]
    │ │ │ │          ],
    │ │ │ │          "Using pytest.warns(None)": [
    │ │ │ │              [195, "using-pytest-warns-none"]
    │ │ │ │          ],
    │ │ │ │ -        "Using python:library/pdb with pytest": [
    │ │ │ │ -            [225, "using-python-library-pdb-with-pytest"]
    │ │ │ │ -        ],
    │ │ │ │          "Using the builtin breakpoint function": [
    │ │ │ │              [225, "using-the-builtin-breakpoint-function"]
    │ │ │ │          ],
    │ │ │ │          "Using typing in test suites": [
    │ │ │ │              [213, "using-typing-in-test-suites"]
    │ │ │ │          ],
    │ │ │ │          "Verbosity": [
    │ │ │ │ @@ -9413,15 +9413,15 @@
    │ │ │ │          "On": [24, 30, 188, 191, 216, 251],
    │ │ │ │          "One": [23, 191, 195, 201, 217, 221, 222, 225, 226, 239, 240, 251],
    │ │ │ │          "Or": [0, 191, 194, 199, 204, 222, 229, 251],
    │ │ │ │          "Such": [191, 195, 251],
    │ │ │ │          "THE": 243,
    │ │ │ │          "TO": [191, 243],
    │ │ │ │          "That": [0, 208, 209, 226, 231, 234, 251, 254],
    │ │ │ │ -        "The": [2, 4, 6, 9, 11, 20, 23, 24, 25, 26, 27, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 190, 191, 192, 193, 194, 196, 197, 198, 199, 201, 202, 204, 206, 207, 208, 209, 210, 212, 213, 214, 215, 216, 217, 218, 221, 222, 223, 225, 226, 228, 230, 231, 232, 233, 234, 235, 237, 238, 239, 240, 242, 243, 244, 246, 247, 248, 250, 251, 254],
    │ │ │ │ +        "The": [2, 4, 6, 9, 11, 20, 23, 24, 25, 26, 27, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 190, 191, 192, 193, 194, 196, 197, 198, 199, 201, 202, 204, 206, 207, 208, 209, 210, 212, 213, 214, 215, 216, 217, 218, 221, 222, 223, 226, 228, 230, 231, 232, 233, 234, 235, 237, 238, 239, 240, 242, 243, 244, 246, 247, 248, 250, 251, 254],
    │ │ │ │          "Then": [0, 201, 226, 234, 246],
    │ │ │ │          "There": [0, 2, 5, 39, 42, 191, 194, 199, 201, 208, 214, 215, 217, 218, 220, 221, 226, 230, 239, 251],
    │ │ │ │          "These": [189, 190, 191, 195, 199, 201, 204, 213, 214, 222, 226, 228, 234, 236, 239, 250, 251],
    │ │ │ │          "To": [2, 11, 12, 13, 15, 16, 17, 18, 19, 20, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 55, 57, 58, 59, 60, 61, 63, 64, 66, 67, 69, 71, 72, 73, 74, 76, 77, 78, 79, 81, 82, 84, 85, 86, 88, 89, 91, 93, 95, 97, 98, 101, 102, 103, 104, 105, 106, 107, 108, 109, 111, 113, 114, 115, 117, 118, 119, 120, 122, 123, 124, 125, 126, 128, 129, 130, 132, 133, 134, 136, 137, 139, 140, 141, 142, 143, 146, 148, 149, 150, 152, 153, 155, 156, 158, 159, 160, 161, 165, 166, 168, 169, 171, 172, 174, 175, 176, 177, 189, 190, 191, 194, 195, 199, 202, 204, 209, 210, 212, 213, 218, 221, 222, 223, 225, 226, 228, 231, 232, 233, 237, 238, 239, 240, 242, 248, 251],
    │ │ │ │          "WITH": 243,
    │ │ │ │          "Will": [179, 186, 190, 195, 202, 231, 251],
    │ │ │ │          "With": [189, 191, 194, 201, 210, 216, 225, 226, 240, 250, 251],
    │ │ │ │ @@ -9935,14 +9935,15 @@
    │ │ │ │          "argument": [3, 4, 9, 10, 11, 17, 18, 21, 23, 24, 26, 27, 30, 31, 36, 41, 191, 193, 194, 198, 199, 204, 208, 210, 214, 215, 217, 218, 220, 221, 222, 226, 228, 230, 232, 234, 237, 238, 239, 240, 241, 246, 250, 251],
    │ │ │ │          "argumentpars": 191,
    │ │ │ │          "argv": [204, 238, 251],
    │ │ │ │          "argvalu": [191, 195, 199, 201, 250, 251],
    │ │ │ │          "aria": [144, 145, 147],
    │ │ │ │          "ariel": 138,
    │ │ │ │          "aris": [191, 243, 254],
    │ │ │ │ +        "arithmet": 251,
    │ │ │ │          "armin": [24, 191],
    │ │ │ │          "arn": 251,
    │ │ │ │          "arndt": 127,
    │ │ │ │          "aron": [32, 65, 191],
    │ │ │ │          "arora": 157,
    │ │ │ │          "around": [26, 30, 188, 189, 191, 193, 194, 217, 218, 226, 241, 244, 250, 251, 252],
    │ │ │ │          "arpa": 121,
    │ │ │ │ @@ -11101,15 +11102,15 @@
    │ │ │ │          "deal": [23, 191, 193, 209, 216, 222, 226, 227, 243, 251],
    │ │ │ │          "dealt": 189,
    │ │ │ │          "dear": 250,
    │ │ │ │          "dearli": 191,
    │ │ │ │          "debi": 131,
    │ │ │ │          "debug": [20, 30, 32, 191, 193, 195, 213, 216, 217, 225, 237, 250],
    │ │ │ │          "debug_file_nam": 251,
    │ │ │ │ -        "debugg": [191, 216, 225, 250, 251],
    │ │ │ │ +        "debugg": [191, 216, 250, 251],
    │ │ │ │          "dec": 250,
    │ │ │ │          "decad": 189,
    │ │ │ │          "deceas": [13, 191],
    │ │ │ │          "decemb": 217,
    │ │ │ │          "decid": [0, 191, 194, 226, 251],
    │ │ │ │          "decim": [191, 223],
    │ │ │ │          "decis": [39, 191, 235],
    │ │ │ │ @@ -11954,15 +11955,14 @@
    │ │ │ │          "flatten_subgroup": [218, 251],
    │ │ │ │          "flavor": 224,
    │ │ │ │          "flexibl": [1, 191, 217, 226, 230, 250, 251],
    │ │ │ │          "flexreport": 250,
    │ │ │ │          "flip": 191,
    │ │ │ │          "float": [191, 193, 195, 203, 209, 218, 223, 251],
    │ │ │ │          "float_valu": 191,
    │ │ │ │ -        "floatingpoint": 251,
    │ │ │ │          "floatoper": 191,
    │ │ │ │          "flori": [2, 3, 9, 14, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 40, 42, 45, 49, 50, 51, 56, 64, 69, 99, 191, 240, 253],
    │ │ │ │          "florian": [8, 34, 50, 132, 151, 154, 186, 191, 222],
    │ │ │ │          "flow": [191, 226, 250],
    │ │ │ │          "flub": 191,
    │ │ │ │          "fluent": 250,
    │ │ │ │          "fluentbit": 250,
    │ │ │ │ @@ -15800,15 +15800,14 @@
    │ │ │ │          "rosen": [151, 154],
    │ │ │ │          "rossum": 191,
    │ │ │ │          "rotest": 250,
    │ │ │ │          "roughli": [2, 226],
    │ │ │ │          "round": [201, 215, 218, 226, 250],
    │ │ │ │          "rousseau": 179,
    │ │ │ │          "rout": [191, 250],
    │ │ │ │ -        "routin": 251,
    │ │ │ │          "rowin": [151, 154],
    │ │ │ │          "rp": [39, 191],
    │ │ │ │          "rpc": 250,
    │ │ │ │          "rpp": 231,
    │ │ │ │          "rq": 250,
    │ │ │ │          "rror": 251,
    │ │ │ │          "rsession": 191,
    │ │ │ │ @@ -18200,15 +18199,15 @@
    │ │ │ │          "6": [26, 27, 28, 29, 30, 37, 38, 48, 70, 71, 72, 73, 74, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 189, 191],
    │ │ │ │          "7": [30, 31, 32, 33, 38, 39, 49, 75, 76, 77, 78, 79, 107, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 191],
    │ │ │ │          "8": [33, 34, 35, 36, 37, 38, 39, 80, 81, 82, 108, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 191, 195],
    │ │ │ │          "9": [39, 40, 41, 83, 84, 85, 86, 109, 182, 183, 184, 185, 186, 187, 191],
    │ │ │ │          "A": [197, 200, 201, 205, 208, 226, 242],
    │ │ │ │          "For": 191,
    │ │ │ │          "No": 214,
    │ │ │ │ -        "The": [0, 195, 220, 236],
    │ │ │ │ +        "The": [0, 195, 220, 225, 236],
    │ │ │ │          "__init__": 195,
    │ │ │ │          "__notes__": 191,
    │ │ │ │          "__version__": 251,
    │ │ │ │          "_fillfuncarg": 195,
    │ │ │ │          "about": [208, 218, 225],
    │ │ │ │          "access": [195, 221, 237, 240],
    │ │ │ │          "accord": 204,
    │ │ │ │ @@ -18336,14 +18335,15 @@
    │ │ │ │          "creat": [215, 231],
    │ │ │ │          "custom": [191, 195, 197, 198, 199, 202, 222, 228, 240, 246, 251],
    │ │ │ │          "cx_freez": 28,
    │ │ │ │          "data": [208, 226, 239],
    │ │ │ │          "deactiv": 233,
    │ │ │ │          "deal": 234,
    │ │ │ │          "debug": [221, 251],
    │ │ │ │ +        "debugg": 225,
    │ │ │ │          "declar": 239,
    │ │ │ │          "decor": [195, 214, 216],
    │ │ │ │          "default": [195, 204, 221],
    │ │ │ │          "defer": 201,
    │ │ │ │          "defin": 218,
    │ │ │ │          "delet": 209,
    │ │ │ │          "demo": 203,
    │ │ │ │ @@ -18522,15 +18522,14 @@
    │ │ │ │          "keep": 202,
    │ │ │ │          "keyword": 195,
    │ │ │ │          "kwarg": 195,
    │ │ │ │          "last": 220,
    │ │ │ │          "layout": 210,
    │ │ │ │          "legaci": [195, 218],
    │ │ │ │          "level": [195, 204, 226, 241],
    │ │ │ │ -        "librari": 225,
    │ │ │ │          "licens": 243,
    │ │ │ │          "limit": 231,
    │ │ │ │          "line": [195, 199, 201, 202, 204, 246, 251],
    │ │ │ │          "list": 250,
    │ │ │ │          "littl": [19, 29],
    │ │ │ │          "live": 228,
    │ │ │ │          "llm": 194,