From 43213add579d1550031d5e4d4eff489c4096eb1d Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 15 Nov 2021 21:00:32 +0200 Subject: [PATCH 001/549] testing/test_session: add a regression test for an old bug Nothing tests this currently. Make sure it doesn't regress if/when the complex code in `Session.collect` is cleaned up. --- testing/test_session.py | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/testing/test_session.py b/testing/test_session.py index 3ca6d390383..f73dc89ef33 100644 --- a/testing/test_session.py +++ b/testing/test_session.py @@ -335,6 +335,54 @@ def pytest_sessionfinish(): assert res.ret == ExitCode.NO_TESTS_COLLECTED +def test_collection_args_do_not_duplicate_modules(pytester: Pytester) -> None: + """Test that when multiple collection args are specified on the command line + for the same module, only a single Module collector is created. + + Regression test for #723, #3358. + """ + pytester.makepyfile( + **{ + "d/test_it": """ + def test_1(): pass + def test_2(): pass + """ + } + ) + + result = pytester.runpytest( + "--collect-only", + "d/test_it.py::test_1", + "d/test_it.py::test_2", + ) + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + ], + consecutive=True, + ) + + # Different, but related case. + result = pytester.runpytest( + "--collect-only", + "--keep-duplicates", + "d", + "d", + ) + result.stdout.fnmatch_lines( + [ + "", + " ", + " ", + " ", + " ", + ], + consecutive=True, + ) + + @pytest.mark.parametrize("path", ["root", "{relative}/root", "{environment}/root"]) def test_rootdir_option_arg( pytester: Pytester, monkeypatch: MonkeyPatch, path: str From d7e7c32a5f4aa569480582f5e73b8874b1a54482 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 21:10:55 +0000 Subject: [PATCH 002/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 21.11b1 → 21.12b0](https://github.com/psf/black/compare/21.11b1...21.12b0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 20cede3b7bb..1741136dfe0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 21.11b1 + rev: 21.12b0 hooks: - id: black args: [--safe, --quiet] From dd53cc7e388d3c62956d0922ab5d0f3aa8f0adca Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 21:12:32 +0000 Subject: [PATCH 003/549] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytest/_argcomplete.py | 1 - src/_pytest/assertion/rewrite.py | 1 - src/_pytest/compat.py | 1 - src/_pytest/pathlib.py | 1 - 4 files changed, 4 deletions(-) diff --git a/src/_pytest/_argcomplete.py b/src/_pytest/_argcomplete.py index 41d9d9407c7..120f09ff68f 100644 --- a/src/_pytest/_argcomplete.py +++ b/src/_pytest/_argcomplete.py @@ -108,7 +108,6 @@ def __call__(self, prefix: str, **kwargs: Any) -> List[str]: def try_argcomplete(parser: argparse.ArgumentParser) -> None: argcomplete.autocomplete(parser, always_complete_options=False) - else: def try_argcomplete(parser: argparse.ArgumentParser) -> None: diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index 456681ab29e..50b367e25ef 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -324,7 +324,6 @@ def _write_pyc( return False return True - else: def _write_pyc( diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index 7703dee8c5a..5af01eb7d95 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -192,7 +192,6 @@ def getfuncargnames( def nullcontext(): yield - else: from contextlib import nullcontext as nullcontext # noqa: F401 diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py index b44753e1a41..b23e51d4429 100644 --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -562,7 +562,6 @@ def import_path( def _is_same(f1: str, f2: str) -> bool: return Path(f1) == Path(f2) or os.path.samefile(f1, f2) - else: def _is_same(f1: str, f2: str) -> bool: From 0ad452bcbadffa2bb890c543c8b409d2df61c67d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 7 Dec 2021 10:13:36 +0100 Subject: [PATCH 004/549] Prepare release version 7.0.0rc1 (#9375) (#9377) Co-authored-by: pytest bot (cherry picked from commit 85897eddc6d31c5825f5ca28f85e69b8d1506fc4) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- changelog/4320.doc.rst | 1 - changelog/5105.doc.rst | 1 - changelog/5196.feature.rst | 3 - changelog/7124.bugfix.rst | 1 - changelog/7132.feature.rst | 1 - changelog/7259.breaking.rst | 9 - changelog/7259.deprecation.rst | 12 - changelog/7259.feature.rst | 7 - changelog/7469.deprecation.rst | 13 - changelog/7469.feature.rst | 25 -- changelog/7480.improvement.rst | 5 - changelog/7856.feature.rst | 2 - changelog/7864.improvement.rst | 4 - changelog/8061.bugfix.rst | 1 - changelog/8133.trivial.rst | 1 - changelog/8144.feature.rst | 16 - changelog/8174.trivial.rst | 6 - changelog/8192.bugfix.rst | 3 - changelog/8242.deprecation.rst | 7 - changelog/8246.breaking.rst | 1 - changelog/8248.trivial.rst | 1 - changelog/8251.feature.rst | 11 - changelog/8258.bugfix.rst | 3 - changelog/8315.deprecation.rst | 5 - changelog/8317.bugfix.rst | 1 - changelog/8335.improvement.rst | 10 - changelog/8337.doc.rst | 1 - changelog/8367.bugfix.rst | 1 - changelog/8377.bugfix.rst | 2 - changelog/8384.bugfix.rst | 1 - changelog/8394.bugfix.rst | 1 - changelog/8403.improvement.rst | 5 - changelog/8421.feature.rst | 1 - changelog/8432.trivial.rst | 1 - changelog/8447.deprecation.rst | 4 - changelog/8456.bugfix.rst | 1 - changelog/8464.bugfix.rst | 1 - changelog/8503.bugfix.rst | 4 - changelog/8509.improvement.rst | 5 - changelog/8548.bugfix.rst | 1 - changelog/8592.deprecation.rst | 3 - changelog/8606.feature.rst | 5 - changelog/8645.deprecation.rst | 4 - changelog/8655.doc.rst | 1 - changelog/8733.breaking.rst | 5 - changelog/8761.feature.rst | 1 - changelog/8789.feature.rst | 1 - changelog/8796.bugfix.rst | 1 - changelog/8803.improvement.rst | 9 - changelog/8818.trivial.rst | 1 - changelog/8822.improvement.rst | 1 - changelog/8898.improvement.rst | 1 - changelog/8913.trivial.rst | 1 - changelog/8920.feature.rst | 2 - changelog/8948.deprecation.rst | 5 - changelog/8953.feature.rst | 2 - changelog/8954.feature.rst | 1 - changelog/8967.trivial.rst | 2 - changelog/8983.bugfix.rst | 2 - changelog/8990.bugfix.rst | 1 - changelog/9023.feature.rst | 4 - changelog/9061.breaking.rst | 15 - changelog/9062.improvement.rst | 1 - changelog/9077.bugfix.rst | 1 - changelog/9113.feature.rst | 2 - changelog/9114.feature.rst | 1 - changelog/9131.bugfix.rst | 1 - changelog/9163.bugfix.rst | 1 - changelog/9169.bugfix.rst | 1 - changelog/9202.trivial.rst | 1 - changelog/9205.improvement.rst | 1 - changelog/9210.doc.rst | 1 - changelog/9225.trivial.rst | 1 - changelog/9242.doc.rst | 1 - changelog/9272.bugfix.rst | 2 - changelog/9277.breaking.rst | 3 - changelog/9308.breaking.rst | 22 -- changelog/9341.doc.rst | 1 - changelog/9351.trivial.rst | 1 - doc/en/announce/index.rst | 1 + doc/en/announce/release-7.0.0rc1.rst | 74 ++++ doc/en/builtin.rst | 70 ++-- doc/en/changelog.rst | 476 ++++++++++++++++++++++++ doc/en/example/markers.rst | 34 +- doc/en/example/nonpython.rst | 8 +- doc/en/example/parametrize.rst | 35 +- doc/en/example/pythoncollection.rst | 17 +- doc/en/example/reportingdemo.rst | 3 +- doc/en/example/simple.rst | 32 +- doc/en/getting-started.rst | 5 +- doc/en/how-to/assert.rst | 6 +- doc/en/how-to/cache.rst | 12 +- doc/en/how-to/capture-stdout-stderr.rst | 3 +- doc/en/how-to/capture-warnings.rst | 3 +- doc/en/how-to/doctest.rst | 6 +- doc/en/how-to/fixtures.rst | 12 +- doc/en/how-to/output.rst | 9 +- doc/en/how-to/parametrize.rst | 6 +- doc/en/how-to/tmp_path.rst | 3 +- doc/en/how-to/unittest.rst | 3 +- doc/en/how-to/writing_plugins.rst | 3 +- doc/en/index.rst | 3 +- doc/en/reference/reference.rst | 1 + 103 files changed, 666 insertions(+), 448 deletions(-) delete mode 100644 changelog/4320.doc.rst delete mode 100644 changelog/5105.doc.rst delete mode 100644 changelog/5196.feature.rst delete mode 100644 changelog/7124.bugfix.rst delete mode 100644 changelog/7132.feature.rst delete mode 100644 changelog/7259.breaking.rst delete mode 100644 changelog/7259.deprecation.rst delete mode 100644 changelog/7259.feature.rst delete mode 100644 changelog/7469.deprecation.rst delete mode 100644 changelog/7469.feature.rst delete mode 100644 changelog/7480.improvement.rst delete mode 100644 changelog/7856.feature.rst delete mode 100644 changelog/7864.improvement.rst delete mode 100644 changelog/8061.bugfix.rst delete mode 100644 changelog/8133.trivial.rst delete mode 100644 changelog/8144.feature.rst delete mode 100644 changelog/8174.trivial.rst delete mode 100644 changelog/8192.bugfix.rst delete mode 100644 changelog/8242.deprecation.rst delete mode 100644 changelog/8246.breaking.rst delete mode 100644 changelog/8248.trivial.rst delete mode 100644 changelog/8251.feature.rst delete mode 100644 changelog/8258.bugfix.rst delete mode 100644 changelog/8315.deprecation.rst delete mode 100644 changelog/8317.bugfix.rst delete mode 100644 changelog/8335.improvement.rst delete mode 100644 changelog/8337.doc.rst delete mode 100644 changelog/8367.bugfix.rst delete mode 100644 changelog/8377.bugfix.rst delete mode 100644 changelog/8384.bugfix.rst delete mode 100644 changelog/8394.bugfix.rst delete mode 100644 changelog/8403.improvement.rst delete mode 100644 changelog/8421.feature.rst delete mode 100644 changelog/8432.trivial.rst delete mode 100644 changelog/8447.deprecation.rst delete mode 100644 changelog/8456.bugfix.rst delete mode 100644 changelog/8464.bugfix.rst delete mode 100644 changelog/8503.bugfix.rst delete mode 100644 changelog/8509.improvement.rst delete mode 100644 changelog/8548.bugfix.rst delete mode 100644 changelog/8592.deprecation.rst delete mode 100644 changelog/8606.feature.rst delete mode 100644 changelog/8645.deprecation.rst delete mode 100644 changelog/8655.doc.rst delete mode 100644 changelog/8733.breaking.rst delete mode 100644 changelog/8761.feature.rst delete mode 100644 changelog/8789.feature.rst delete mode 100644 changelog/8796.bugfix.rst delete mode 100644 changelog/8803.improvement.rst delete mode 100644 changelog/8818.trivial.rst delete mode 100644 changelog/8822.improvement.rst delete mode 100644 changelog/8898.improvement.rst delete mode 100644 changelog/8913.trivial.rst delete mode 100644 changelog/8920.feature.rst delete mode 100644 changelog/8948.deprecation.rst delete mode 100644 changelog/8953.feature.rst delete mode 100644 changelog/8954.feature.rst delete mode 100644 changelog/8967.trivial.rst delete mode 100644 changelog/8983.bugfix.rst delete mode 100644 changelog/8990.bugfix.rst delete mode 100644 changelog/9023.feature.rst delete mode 100644 changelog/9061.breaking.rst delete mode 100644 changelog/9062.improvement.rst delete mode 100644 changelog/9077.bugfix.rst delete mode 100644 changelog/9113.feature.rst delete mode 100644 changelog/9114.feature.rst delete mode 100644 changelog/9131.bugfix.rst delete mode 100644 changelog/9163.bugfix.rst delete mode 100644 changelog/9169.bugfix.rst delete mode 100644 changelog/9202.trivial.rst delete mode 100644 changelog/9205.improvement.rst delete mode 100644 changelog/9210.doc.rst delete mode 100644 changelog/9225.trivial.rst delete mode 100644 changelog/9242.doc.rst delete mode 100644 changelog/9272.bugfix.rst delete mode 100644 changelog/9277.breaking.rst delete mode 100644 changelog/9308.breaking.rst delete mode 100644 changelog/9341.doc.rst delete mode 100644 changelog/9351.trivial.rst create mode 100644 doc/en/announce/release-7.0.0rc1.rst diff --git a/changelog/4320.doc.rst b/changelog/4320.doc.rst deleted file mode 100644 index 70a4a743f36..00000000000 --- a/changelog/4320.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Improved docs for `pytester.copy_example`. diff --git a/changelog/5105.doc.rst b/changelog/5105.doc.rst deleted file mode 100644 index 71c1edc9fc4..00000000000 --- a/changelog/5105.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Add automatically generated :ref:`plugin-list`. The list is updated on a periodic schedule. diff --git a/changelog/5196.feature.rst b/changelog/5196.feature.rst deleted file mode 100644 index 5e6312b482d..00000000000 --- a/changelog/5196.feature.rst +++ /dev/null @@ -1,3 +0,0 @@ -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). diff --git a/changelog/7124.bugfix.rst b/changelog/7124.bugfix.rst deleted file mode 100644 index 191925d7a24..00000000000 --- a/changelog/7124.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed an issue where ``__main__.py`` would raise an ``ImportError`` when ``--doctest-modules`` was provided. diff --git a/changelog/7132.feature.rst b/changelog/7132.feature.rst deleted file mode 100644 index 9fb735ee153..00000000000 --- a/changelog/7132.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Added two environment variables :envvar:`PYTEST_THEME` and :envvar:`PYTEST_THEME_MODE` to let the users customize the pygments theme used. diff --git a/changelog/7259.breaking.rst b/changelog/7259.breaking.rst deleted file mode 100644 index 48ecbcbb730..00000000000 --- a/changelog/7259.breaking.rst +++ /dev/null @@ -1,9 +0,0 @@ -The :ref:`Node.reportinfo() ` function first return value type has been expanded from `py.path.local | str` to `os.PathLike[str] | str`. - -Most plugins which refer to `reportinfo()` only define it as part of a custom :class:`pytest.Item` implementation. -Since `py.path.local` is a `os.PathLike[str]`, these plugins are unaffacted. - -Plugins and users which call `reportinfo()`, use the first return value and interact with it as a `py.path.local`, would need to adjust by calling `py.path.local(fspath)`. -Although preferably, avoid the legacy `py.path.local` and use `pathlib.Path`, or use `item.location` or `item.path`, instead. - -Note: pytest was not able to provide a deprecation period for this change. diff --git a/changelog/7259.deprecation.rst b/changelog/7259.deprecation.rst deleted file mode 100644 index ae857c0d826..00000000000 --- a/changelog/7259.deprecation.rst +++ /dev/null @@ -1,12 +0,0 @@ -``py.path.local`` arguments for hooks have been deprecated. See :ref:`the deprecation note ` for full details. - -``py.path.local`` arguments to Node constructors have been deprecated. See :ref:`the deprecation note ` for full details. - -.. note:: - The name of the :class:`~_pytest.nodes.Node` arguments and attributes (the - 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 :pypi:`py` - dependency (see :issue:`9283` for a longer discussion). diff --git a/changelog/7259.feature.rst b/changelog/7259.feature.rst deleted file mode 100644 index dd03b48969d..00000000000 --- a/changelog/7259.feature.rst +++ /dev/null @@ -1,7 +0,0 @@ -Added :meth:`cache.mkdir() `, which is similar to the existing :meth:`cache.makedir() `, -but returns a :class:`pathlib.Path` instead of a legacy ``py.path.local``. - -Added a ``paths`` type to :meth:`parser.addini() `, -as in ``parser.addini("mypaths", "my paths", type="paths")``, -which is similar to the existing ``pathlist``, -but returns a list of :class:`pathlib.Path` instead of legacy ``py.path.local``. diff --git a/changelog/7469.deprecation.rst b/changelog/7469.deprecation.rst deleted file mode 100644 index ea8c7c0b4f9..00000000000 --- a/changelog/7469.deprecation.rst +++ /dev/null @@ -1,13 +0,0 @@ -Directly constructing the following classes is now deprecated: - -- ``_pytest.mark.structures.Mark`` -- ``_pytest.mark.structures.MarkDecorator`` -- ``_pytest.mark.structures.MarkGenerator`` -- ``_pytest.python.Metafunc`` -- ``_pytest.runner.CallInfo`` -- ``_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. diff --git a/changelog/7469.feature.rst b/changelog/7469.feature.rst deleted file mode 100644 index 4694e97e9d9..00000000000 --- a/changelog/7469.feature.rst +++ /dev/null @@ -1,25 +0,0 @@ -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 :class:`Config `. -- ``pytest.Mark`` for :class:`marks `. -- ``pytest.MarkDecorator`` for :class:`mark decorators `. -- ``pytest.MarkGenerator`` for the :class:`pytest.mark ` singleton. -- ``pytest.Metafunc`` for the :class:`metafunc ` argument to the :func:`pytest_generate_tests ` hook. -- ``pytest.CallInfo`` for the :class:`CallInfo ` type passed to various hooks. -- ``pytest.PytestPluginManager`` for :class:`PytestPluginManager `. -- ``pytest.ExceptionInfo`` for the :class:`ExceptionInfo ` type returned from :func:`pytest.raises` and passed to various hooks. -- ``pytest.Parser`` for the :class:`Parser ` type passed to the :func:`pytest_addoption ` hook. -- ``pytest.OptionGroup`` for the :class:`OptionGroup ` type returned from the :func:`parser.addgroup ` method. -- ``pytest.HookRecorder`` for the :class:`HookRecorder ` type returned from :class:`~pytest.Pytester`. -- ``pytest.RecordedHookCall`` for the :class:`RecordedHookCall ` type returned from :class:`~pytest.HookRecorder`. -- ``pytest.RunResult`` for the :class:`RunResult ` type returned from :class:`~pytest.Pytester`. -- ``pytest.LineMatcher`` for the :class:`LineMatcher ` type used in :class:`~pytest.RunResult` and others. -- ``pytest.TestReport`` for the :class:`TestReport ` type used in various hooks. -- ``pytest.CollectReport`` for the :class:`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. diff --git a/changelog/7480.improvement.rst b/changelog/7480.improvement.rst deleted file mode 100644 index 296e6e7fb54..00000000000 --- a/changelog/7480.improvement.rst +++ /dev/null @@ -1,5 +0,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 :class:`~pytest.PytestDeprecationWarning`, -instead of :class:`PytestDeprecationWarning` directly. - -See :ref:`backwards-compatibility` for more details. diff --git a/changelog/7856.feature.rst b/changelog/7856.feature.rst deleted file mode 100644 index 22ed4c83bc3..00000000000 --- a/changelog/7856.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -:ref:`--import-mode=importlib ` now works with features that -depend on modules being on :py:data:`sys.modules`, such as :mod:`pickle` and :mod:`dataclasses`. diff --git a/changelog/7864.improvement.rst b/changelog/7864.improvement.rst deleted file mode 100644 index 195632346fe..00000000000 --- a/changelog/7864.improvement.rst +++ /dev/null @@ -1,4 +0,0 @@ -Improved error messages when parsing warning filters. - -Previously pytest would show an internal traceback, which besides being ugly sometimes would hide the cause -of the problem (for example an ``ImportError`` while importing a specific warning type). diff --git a/changelog/8061.bugfix.rst b/changelog/8061.bugfix.rst deleted file mode 100644 index 5686af66321..00000000000 --- a/changelog/8061.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed failing ``staticmethod`` test cases if they are inherited from a parent test class. diff --git a/changelog/8133.trivial.rst b/changelog/8133.trivial.rst deleted file mode 100644 index 7ceaae59765..00000000000 --- a/changelog/8133.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Migrate to ``setuptools_scm`` 6.x to use ``SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST`` for more robust release tooling. diff --git a/changelog/8144.feature.rst b/changelog/8144.feature.rst deleted file mode 100644 index fe576eeffa8..00000000000 --- a/changelog/8144.feature.rst +++ /dev/null @@ -1,16 +0,0 @@ -The following hooks now receive an additional ``pathlib.Path`` argument, equivalent to an existing ``py.path.local`` argument: - -- :func:`pytest_ignore_collect <_pytest.hookspec.pytest_ignore_collect>` - The ``collection_path`` parameter (equivalent to existing ``path`` parameter). -- :func:`pytest_collect_file <_pytest.hookspec.pytest_collect_file>` - The ``file_path`` parameter (equivalent to existing ``path`` parameter). -- :func:`pytest_pycollect_makemodule <_pytest.hookspec.pytest_pycollect_makemodule>` - The ``module_path`` parameter (equivalent to existing ``path`` parameter). -- :func:`pytest_report_header <_pytest.hookspec.pytest_report_header>` - The ``start_path`` parameter (equivalent to existing ``startdir`` parameter). -- :func:`pytest_report_collectionfinish <_pytest.hookspec.pytest_report_collectionfinish>` - The ``start_path`` parameter (equivalent to existing ``startdir`` parameter). - -.. note:: - The name of the :class:`~_pytest.nodes.Node` arguments and attributes (the - 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 :pypi:`py` - dependency (see :issue:`9283` for a longer discussion). diff --git a/changelog/8174.trivial.rst b/changelog/8174.trivial.rst deleted file mode 100644 index 7649764618f..00000000000 --- a/changelog/8174.trivial.rst +++ /dev/null @@ -1,6 +0,0 @@ -The following changes have been made to internal pytest types/functions: - -- The ``path`` property of ``_pytest.code.Code`` returns ``Path`` instead of ``py.path.local``. -- The ``path`` property of ``_pytest.code.TracebackEntry`` returns ``Path`` instead of ``py.path.local``. -- The ``_pytest.code.getfslineno()`` function returns ``Path`` instead of ``py.path.local``. -- The ``_pytest.python.path_matches_patterns()`` function takes ``Path`` instead of ``py.path.local``. diff --git a/changelog/8192.bugfix.rst b/changelog/8192.bugfix.rst deleted file mode 100644 index 8920b200a21..00000000000 --- a/changelog/8192.bugfix.rst +++ /dev/null @@ -1,3 +0,0 @@ -``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. diff --git a/changelog/8242.deprecation.rst b/changelog/8242.deprecation.rst deleted file mode 100644 index 3875c5867e3..00000000000 --- a/changelog/8242.deprecation.rst +++ /dev/null @@ -1,7 +0,0 @@ -Raising :class:`unittest.SkipTest` to skip collection of tests during the -pytest collection phase is deprecated. Use :func:`pytest.skip` instead. - -Note: This deprecation only relates to using :class:`unittest.SkipTest` during test -collection. You are probably not doing that. Ordinary usage of -:class:`unittest.SkipTest` / :meth:`unittest.TestCase.skipTest` / -:func:`unittest.skip` in unittest test cases is fully supported. diff --git a/changelog/8246.breaking.rst b/changelog/8246.breaking.rst deleted file mode 100644 index ba9e5c8beea..00000000000 --- a/changelog/8246.breaking.rst +++ /dev/null @@ -1 +0,0 @@ -``--version`` now writes version information to ``stdout`` rather than ``stderr``. diff --git a/changelog/8248.trivial.rst b/changelog/8248.trivial.rst deleted file mode 100644 index 3044071fa81..00000000000 --- a/changelog/8248.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Internal Restructure: let ``python.PyObjMixin`` inherit from ``nodes.Node`` to carry over typing information. diff --git a/changelog/8251.feature.rst b/changelog/8251.feature.rst deleted file mode 100644 index fe157cc98b7..00000000000 --- a/changelog/8251.feature.rst +++ /dev/null @@ -1,11 +0,0 @@ -Implement ``Node.path`` as a ``pathlib.Path``. Both the old ``fspath`` and this new attribute gets set no matter whether ``path`` or ``fspath`` (deprecated) is passed to the constructor. It is a replacement for the ``fspath`` attribute (which represents the same path as ``py.path.local``). While ``fspath`` is not deprecated yet -due to the ongoing migration of methods like :meth:`~_pytest.Item.reportinfo`, we expect to deprecate it in a future release. - -.. note:: - The name of the :class:`~_pytest.nodes.Node` arguments and attributes (the - 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 :pypi:`py` - dependency (see :issue:`9283` for a longer discussion). diff --git a/changelog/8258.bugfix.rst b/changelog/8258.bugfix.rst deleted file mode 100644 index 6518ec0b738..00000000000 --- a/changelog/8258.bugfix.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fixed issue where pytest's ``faulthandler`` support would not dump traceback on crashes -if the :mod:`faulthandler` module was already enabled during pytest startup (using -``python -X dev -m pytest`` for example). diff --git a/changelog/8315.deprecation.rst b/changelog/8315.deprecation.rst deleted file mode 100644 index b204dcedd9b..00000000000 --- a/changelog/8315.deprecation.rst +++ /dev/null @@ -1,5 +0,0 @@ -Several behaviors of :meth:`Parser.addoption ` are now -scheduled for removal in pytest 8 (deprecated since pytest 2.4.0): - -- ``parser.addoption(..., help=".. %default ..")`` - use ``%(default)s`` instead. -- ``parser.addoption(..., type="int/string/float/complex")`` - use ``type=int`` etc. instead. diff --git a/changelog/8317.bugfix.rst b/changelog/8317.bugfix.rst deleted file mode 100644 index 7312880a11f..00000000000 --- a/changelog/8317.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed an issue where illegal directory characters derived from ``getpass.getuser()`` raised an ``OSError``. diff --git a/changelog/8335.improvement.rst b/changelog/8335.improvement.rst deleted file mode 100644 index f6c0e3343f0..00000000000 --- a/changelog/8335.improvement.rst +++ /dev/null @@ -1,10 +0,0 @@ -Improved :func:`pytest.approx` assertion messages for sequences of numbers. - -The assertion messages now dumps a table with the index and the error of each diff. -Example:: - - > assert [1, 2, 3, 4] == pytest.approx([1, 3, 3, 5]) - E assert comparison failed for 2 values: - E Index | Obtained | Expected - E 1 | 2 | 3 +- 3.0e-06 - E 3 | 4 | 5 +- 5.0e-06 diff --git a/changelog/8337.doc.rst b/changelog/8337.doc.rst deleted file mode 100644 index f2483a6b481..00000000000 --- a/changelog/8337.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Recommend `numpy.testing `__ module on :func:`pytest.approx` documentation. diff --git a/changelog/8367.bugfix.rst b/changelog/8367.bugfix.rst deleted file mode 100644 index f4b03670108..00000000000 --- a/changelog/8367.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix ``Class.from_parent`` so it forwards extra keyword arguments to the constructor. diff --git a/changelog/8377.bugfix.rst b/changelog/8377.bugfix.rst deleted file mode 100644 index 3df54a949af..00000000000 --- a/changelog/8377.bugfix.rst +++ /dev/null @@ -1,2 +0,0 @@ -The test selection options ``pytest -k`` and ``pytest -m`` now support matching -names containing forward slash (``/``) characters. diff --git a/changelog/8384.bugfix.rst b/changelog/8384.bugfix.rst deleted file mode 100644 index 3b70987490e..00000000000 --- a/changelog/8384.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -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). diff --git a/changelog/8394.bugfix.rst b/changelog/8394.bugfix.rst deleted file mode 100644 index a0fb5bb71fd..00000000000 --- a/changelog/8394.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -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``). diff --git a/changelog/8403.improvement.rst b/changelog/8403.improvement.rst deleted file mode 100644 index ec392245f67..00000000000 --- a/changelog/8403.improvement.rst +++ /dev/null @@ -1,5 +0,0 @@ -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. diff --git a/changelog/8421.feature.rst b/changelog/8421.feature.rst deleted file mode 100644 index c729ca3950a..00000000000 --- a/changelog/8421.feature.rst +++ /dev/null @@ -1 +0,0 @@ -:func:`pytest.approx` now works on :class:`~decimal.Decimal` within mappings/dicts and sequences/lists. diff --git a/changelog/8432.trivial.rst b/changelog/8432.trivial.rst deleted file mode 100644 index af4c7a22617..00000000000 --- a/changelog/8432.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Improve error message when :func:`pytest.skip` is used at module level without passing `allow_module_level=True`. diff --git a/changelog/8447.deprecation.rst b/changelog/8447.deprecation.rst deleted file mode 100644 index 8386e3b7480..00000000000 --- a/changelog/8447.deprecation.rst +++ /dev/null @@ -1,4 +0,0 @@ -Defining a custom pytest node type which is both an :class:`pytest.Item ` and a :class:`pytest.Collector ` (e.g. :class:`pytest.File `) now issues a warning. -It was never sanely supported and triggers hard to debug errors. - -See :ref:`the deprecation note ` for full details. diff --git a/changelog/8456.bugfix.rst b/changelog/8456.bugfix.rst deleted file mode 100644 index da9370b7b1b..00000000000 --- a/changelog/8456.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -The :confval:`required_plugins` config option now works correctly when pre-releases of plugins are installed, rather than falsely claiming that those plugins aren't installed at all. diff --git a/changelog/8464.bugfix.rst b/changelog/8464.bugfix.rst deleted file mode 100644 index 017c4c078fb..00000000000 --- a/changelog/8464.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -``-c `` now also properly defines ``rootdir`` as the directory that contains ````. diff --git a/changelog/8503.bugfix.rst b/changelog/8503.bugfix.rst deleted file mode 100644 index 26f660bbf3f..00000000000 --- a/changelog/8503.bugfix.rst +++ /dev/null @@ -1,4 +0,0 @@ -:meth:`pytest.MonkeyPatch.syspath_prepend` no longer fails when -``setuptools`` is not installed. -It now only calls :func:`pkg_resources.fixup_namespace_packages` if -``pkg_resources`` was previously imported, because it is not needed otherwise. diff --git a/changelog/8509.improvement.rst b/changelog/8509.improvement.rst deleted file mode 100644 index 982888c1fea..00000000000 --- a/changelog/8509.improvement.rst +++ /dev/null @@ -1,5 +0,0 @@ -Fixed issue where :meth:`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. diff --git a/changelog/8548.bugfix.rst b/changelog/8548.bugfix.rst deleted file mode 100644 index 9201169fc0b..00000000000 --- a/changelog/8548.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Introduce fix to handle precision width in ``log-cli-format`` in turn to fix output coloring for certain formats. diff --git a/changelog/8592.deprecation.rst b/changelog/8592.deprecation.rst deleted file mode 100644 index 733ad3586e5..00000000000 --- a/changelog/8592.deprecation.rst +++ /dev/null @@ -1,3 +0,0 @@ -:func:`pytest_cmdline_preparse <_pytest.hookspec.pytest_cmdline_preparse>` has been officially deprecated. It will be removed in a future release. Use :func:`pytest_load_initial_conftests <_pytest.hookspec.pytest_load_initial_conftests>` instead. - -See :ref:`the deprecation note ` for full details. diff --git a/changelog/8606.feature.rst b/changelog/8606.feature.rst deleted file mode 100644 index d918ecd1ec1..00000000000 --- a/changelog/8606.feature.rst +++ /dev/null @@ -1,5 +0,0 @@ -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. diff --git a/changelog/8645.deprecation.rst b/changelog/8645.deprecation.rst deleted file mode 100644 index 722a5d764de..00000000000 --- a/changelog/8645.deprecation.rst +++ /dev/null @@ -1,4 +0,0 @@ -:func:`pytest.warns(None) ` is now deprecated because many people used -it to mean "this code does not emit warnings", but it actually had the effect of -checking that the code emits at least one warning of any type - like ``pytest.warns()`` -or ``pytest.warns(Warning)``. diff --git a/changelog/8655.doc.rst b/changelog/8655.doc.rst deleted file mode 100644 index 65051a74319..00000000000 --- a/changelog/8655.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Help text for ``--pdbcls`` more accurately reflects the option's behavior. diff --git a/changelog/8733.breaking.rst b/changelog/8733.breaking.rst deleted file mode 100644 index fa2a43ac655..00000000000 --- a/changelog/8733.breaking.rst +++ /dev/null @@ -1,5 +0,0 @@ -Drop a workaround for `pyreadline `__ that made it work with ``--pdb``. - -The workaround was introduced in `#1281 `__ in 2015, however since then -`pyreadline seems to have gone unmaintained `__, is `generating -warnings `__, and will stop working on Python 3.10. diff --git a/changelog/8761.feature.rst b/changelog/8761.feature.rst deleted file mode 100644 index 88288c81002..00000000000 --- a/changelog/8761.feature.rst +++ /dev/null @@ -1 +0,0 @@ -New :ref:`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). diff --git a/changelog/8789.feature.rst b/changelog/8789.feature.rst deleted file mode 100644 index 23215c97ef2..00000000000 --- a/changelog/8789.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Switch TOML parser from ``toml`` to ``tomli`` for TOML v1.0.0 support in ``pyproject.toml``. diff --git a/changelog/8796.bugfix.rst b/changelog/8796.bugfix.rst deleted file mode 100644 index 1e83f4e2613..00000000000 --- a/changelog/8796.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed internal error when skipping doctests. diff --git a/changelog/8803.improvement.rst b/changelog/8803.improvement.rst deleted file mode 100644 index 1e4db257dfc..00000000000 --- a/changelog/8803.improvement.rst +++ /dev/null @@ -1,9 +0,0 @@ -It is now possible to add colors to custom log levels on cli log. - -By using :func:`add_color_level <_pytest.logging.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') - logging_plugin.log_cli_handler.formatter.add_color_level(logging.SPAM, 'blue') - -See :ref:`log_colors` for more information. diff --git a/changelog/8818.trivial.rst b/changelog/8818.trivial.rst deleted file mode 100644 index e8c7a24c61b..00000000000 --- a/changelog/8818.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Ensure ``regendoc`` opts out of ``TOX_ENV`` cachedir selection to ensure independent example test runs. diff --git a/changelog/8822.improvement.rst b/changelog/8822.improvement.rst deleted file mode 100644 index a89bcd6baa7..00000000000 --- a/changelog/8822.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -When showing fixture paths in `--fixtures` or `--fixtures-by-test`, fixtures coming from pytest itself now display an elided path, rather than the full path to the file in the `site-packages` directory. diff --git a/changelog/8898.improvement.rst b/changelog/8898.improvement.rst deleted file mode 100644 index d725157cfc6..00000000000 --- a/changelog/8898.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Complex numbers are now treated like floats and integers when generating parameterization IDs. diff --git a/changelog/8913.trivial.rst b/changelog/8913.trivial.rst deleted file mode 100644 index 0d971c475a5..00000000000 --- a/changelog/8913.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -The private ``CallSpec2._arg2scopenum`` attribute has been removed after an internal refactoring. diff --git a/changelog/8920.feature.rst b/changelog/8920.feature.rst deleted file mode 100644 index 05bdab6da75..00000000000 --- a/changelog/8920.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -Added :class:`pytest.Stash`, a facility for plugins to store their data on :class:`~pytest.Config` and :class:`~_pytest.nodes.Node`\s in a type-safe and conflict-free manner. -See :ref:`plugin-stash` for details. diff --git a/changelog/8948.deprecation.rst b/changelog/8948.deprecation.rst deleted file mode 100644 index a39a92bc70e..00000000000 --- a/changelog/8948.deprecation.rst +++ /dev/null @@ -1,5 +0,0 @@ -:func:`pytest.skip(msg=...) `, :func:`pytest.fail(msg=...) ` and :func:`pytest.exit(msg=...) ` -signatures now accept a ``reason`` argument instead of ``msg``. Using ``msg`` still works, but is deprecated and will be removed in a future release. - -This was changed for consistency with :func:`pytest.mark.skip ` and :func:`pytest.mark.xfail ` which both accept -``reason`` as an argument. diff --git a/changelog/8953.feature.rst b/changelog/8953.feature.rst deleted file mode 100644 index aa60fa19ca2..00000000000 --- a/changelog/8953.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -:class:`RunResult <_pytest.pytester.RunResult>` method :meth:`assert_outcomes <_pytest.pytester.RunResult.assert_outcomes>` now accepts a -``warnings`` argument to assert the total number of warnings captured. diff --git a/changelog/8954.feature.rst b/changelog/8954.feature.rst deleted file mode 100644 index 7edb430075e..00000000000 --- a/changelog/8954.feature.rst +++ /dev/null @@ -1 +0,0 @@ -``--debug`` flag now accepts a :class:`str` file to route debug logs into, remains defaulted to `pytestdebug.log`. diff --git a/changelog/8967.trivial.rst b/changelog/8967.trivial.rst deleted file mode 100644 index d5f773241f5..00000000000 --- a/changelog/8967.trivial.rst +++ /dev/null @@ -1,2 +0,0 @@ -:func:`pytest_assertion_pass <_pytest.hookspec.pytest_assertion_pass>` is no longer considered experimental and -future changes to it will be considered more carefully. diff --git a/changelog/8983.bugfix.rst b/changelog/8983.bugfix.rst deleted file mode 100644 index 403d421d6bd..00000000000 --- a/changelog/8983.bugfix.rst +++ /dev/null @@ -1,2 +0,0 @@ -The test selection options ``pytest -k`` and ``pytest -m`` now support matching names containing backslash (`\\`) characters. -Backslashes are treated literally, not as escape characters (the values being matched against are already escaped). diff --git a/changelog/8990.bugfix.rst b/changelog/8990.bugfix.rst deleted file mode 100644 index ab63eb9a75e..00000000000 --- a/changelog/8990.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix `pytest -vv` crashing with an internal exception `AttributeError: 'str' object has no attribute 'relative_to'` in some cases. diff --git a/changelog/9023.feature.rst b/changelog/9023.feature.rst deleted file mode 100644 index 86a819a84e0..00000000000 --- a/changelog/9023.feature.rst +++ /dev/null @@ -1,4 +0,0 @@ - -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. diff --git a/changelog/9061.breaking.rst b/changelog/9061.breaking.rst deleted file mode 100644 index bf639e13214..00000000000 --- a/changelog/9061.breaking.rst +++ /dev/null @@ -1,15 +0,0 @@ -Using :func:`pytest.approx` in a boolean context now raises an error hinting at the proper usage. - -It is apparently common for users to mistakenly use ``pytest.approx`` like this: - -.. code-block:: python - - assert pytest.approx(actual, expected) - -While the correct usage is: - -.. code-block:: python - - assert actual == pytest.approx(expected) - -The new error message helps catch those mistakes. diff --git a/changelog/9062.improvement.rst b/changelog/9062.improvement.rst deleted file mode 100644 index bfc7cf00a46..00000000000 --- a/changelog/9062.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -``--stepwise-skip`` now implicitly enables ``--stepwise`` and can be used on its own. diff --git a/changelog/9077.bugfix.rst b/changelog/9077.bugfix.rst deleted file mode 100644 index fcee5d385df..00000000000 --- a/changelog/9077.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed confusing error message when ``request.fspath`` / ``request.path`` was accessed from a session-scoped fixture. diff --git a/changelog/9113.feature.rst b/changelog/9113.feature.rst deleted file mode 100644 index f16e6ea63fd..00000000000 --- a/changelog/9113.feature.rst +++ /dev/null @@ -1,2 +0,0 @@ -:class:`RunResult <_pytest.pytester.RunResult>` method :meth:`assert_outcomes <_pytest.pytester.RunResult.assert_outcomes>` now accepts a -``deselected`` argument to assert the total number of deselected tests. diff --git a/changelog/9114.feature.rst b/changelog/9114.feature.rst deleted file mode 100644 index 0a576c3b735..00000000000 --- a/changelog/9114.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Added :confval:`pythonpath` setting that adds listed paths to :data:`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. diff --git a/changelog/9131.bugfix.rst b/changelog/9131.bugfix.rst deleted file mode 100644 index 837bb596db5..00000000000 --- a/changelog/9131.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed the URL used by ``--pastebin`` to use `bpa.st `__. diff --git a/changelog/9163.bugfix.rst b/changelog/9163.bugfix.rst deleted file mode 100644 index fb559d10fe8..00000000000 --- a/changelog/9163.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -The end line number and end column offset are now properly set for rewritten assert statements. diff --git a/changelog/9169.bugfix.rst b/changelog/9169.bugfix.rst deleted file mode 100644 index 83fce0a3893..00000000000 --- a/changelog/9169.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Support for the ``files`` API from ``importlib.resources`` within rewritten files. diff --git a/changelog/9202.trivial.rst b/changelog/9202.trivial.rst deleted file mode 100644 index 916d75074b9..00000000000 --- a/changelog/9202.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Add github action to upload coverage report to codecov instead of bash uploader. diff --git a/changelog/9205.improvement.rst b/changelog/9205.improvement.rst deleted file mode 100644 index edfc3008965..00000000000 --- a/changelog/9205.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -:meth:`pytest.Cache.set` now preserves key order when saving dicts. diff --git a/changelog/9210.doc.rst b/changelog/9210.doc.rst deleted file mode 100644 index 02a850c08c4..00000000000 --- a/changelog/9210.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Remove incorrect docs about ``confcutdir`` being a configuration option: it can only be set through the ``--confcutdir`` command-line option. diff --git a/changelog/9225.trivial.rst b/changelog/9225.trivial.rst deleted file mode 100644 index 979f7fd0ce3..00000000000 --- a/changelog/9225.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Changed the command used to create sdist and wheel artifacts: using the build package instead of setup.py. diff --git a/changelog/9242.doc.rst b/changelog/9242.doc.rst deleted file mode 100644 index ef2afc744bf..00000000000 --- a/changelog/9242.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Upgrade readthedocs configuration to use a `newer Ubuntu version `__` with better unicode support for PDF docs. diff --git a/changelog/9272.bugfix.rst b/changelog/9272.bugfix.rst deleted file mode 100644 index 0f242d40891..00000000000 --- a/changelog/9272.bugfix.rst +++ /dev/null @@ -1,2 +0,0 @@ -The nose compatibility module-level fixtures `setup()` and `teardown()` are now only called once per module, instead of for each test function. -They are now called even if object-level `setup`/`teardown` is defined. diff --git a/changelog/9277.breaking.rst b/changelog/9277.breaking.rst deleted file mode 100644 index 0296dcd7c99..00000000000 --- a/changelog/9277.breaking.rst +++ /dev/null @@ -1,3 +0,0 @@ -The ``pytest.Instance`` collector type has been removed. -Importing ``pytest.Instance`` or ``_pytest.python.Instance`` returns a dummy type and emits a deprecation warning. -See :ref:`instance-collector-deprecation` for details. diff --git a/changelog/9308.breaking.rst b/changelog/9308.breaking.rst deleted file mode 100644 index b03a854aa2f..00000000000 --- a/changelog/9308.breaking.rst +++ /dev/null @@ -1,22 +0,0 @@ -**PytestRemovedIn7Warning deprecation warnings are now errors by default.** - -Following our plan to remove deprecated features with as little disruption as -possible, all warnings of type ``PytestRemovedIn7Warning`` now generate errors -instead of warning messages by default. - -**The affected features will be effectively removed in pytest 7.1**, so please consult the -:ref:`deprecations` section in the docs for directions on how to update existing code. - -In the pytest ``7.0.X`` series, it is possible to change the errors back into warnings as a -stopgap measure by adding this to your ``pytest.ini`` file: - -.. code-block:: ini - - [pytest] - filterwarnings = - ignore::pytest.PytestRemovedIn7Warning - -But this will stop working when pytest ``7.1`` is released. - -**If you have concerns** about the removal of a specific feature, please add a -comment to :issue:`9308`. diff --git a/changelog/9341.doc.rst b/changelog/9341.doc.rst deleted file mode 100644 index 1b97a581247..00000000000 --- a/changelog/9341.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Various methods commonly used for :ref:`non-python tests` are now correctly documented in the reference docs. They were undocumented previously. diff --git a/changelog/9351.trivial.rst b/changelog/9351.trivial.rst deleted file mode 100644 index 4fd8ac82704..00000000000 --- a/changelog/9351.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Correct minor typos in doc/en/example/special.rst. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index f0c84cb4c47..ccda9d536e3 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-7.0.0rc1 release-6.2.5 release-6.2.4 release-6.2.3 diff --git a/doc/en/announce/release-7.0.0rc1.rst b/doc/en/announce/release-7.0.0rc1.rst new file mode 100644 index 00000000000..de9bcd42fd1 --- /dev/null +++ b/doc/en/announce/release-7.0.0rc1.rst @@ -0,0 +1,74 @@ +pytest-7.0.0rc1 +======================================= + +The pytest team is proud to announce the 7.0.0rc1 prerelease! + +This is a prerelease, not intended for production use, but to test the upcoming features and improvements +in order to catch any major problems before the final version is released to the major public. + +We appreciate your help testing this out before the final release, making sure to report any +regressions to our issue tracker: + +https://github.com/pytest-dev/pytest/issues + +When doing so, please include the string ``[prerelease]`` in the title. + +You can upgrade from PyPI via: + + pip install pytest==7.0.0rc1 + +Users are encouraged to take a look at the CHANGELOG carefully: + + https://docs.pytest.org/en/stable/changelog.html + +Thanks to all the contributors to this release: + +* Adam J. Stewart +* Alexander King +* Amin Alaee +* Andrew Neitsch +* Anthony Sottile +* Ben Davies +* Bernát Gábor +* Brian Okken +* Bruno Oliveira +* Cristian Vera +* David Szotten +* Eddie +* Emmanuel Arias +* Emmanuel Meric de Bellefon +* Eric Liu +* Florian Bruhin +* GergelyKalmar +* Graeme Smecher +* Harshna +* Hugo van Kemenade +* Jakub Kulík +* James Myatt +* Jeff Rasley +* Kale Kundert +* Miro Hrončok +* Naveen-Pratap +* Oleg Höfling +* Ran Benita +* Ronny Pfannschmidt +* Simon K +* Srip +* Sören Wegener +* Taneli Hukkinen +* Terje Runde +* Thomas Grainger +* Thomas Hisch +* William Jamir Silva +* Zac Hatfield-Dodds +* andrewdotn +* denivyruck +* ericluoliu +* oleg.hoefling +* symonk +* ziebam +* Éloi Rivard + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index e22a874b4d5..ba173ac196f 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -18,11 +18,11 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a $ pytest --fixtures -v =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: /home/sweet/project collected 0 items - cache -- ../../../..$PYTHON_SITE/_pytest/cacheprovider.py:520 + cache -- .../_pytest/cacheprovider.py:510 Return a cache object that can persist state between testing sessions. cache.get(key, default) @@ -33,39 +33,39 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a Values can be any object handled by the json stdlib module. - capsys -- ../../../..$PYTHON_SITE/_pytest/capture.py:903 + capsys -- .../_pytest/capture.py:878 Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``. The captured output is made available via ``capsys.readouterr()`` method calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``text`` objects. - capsysbinary -- ../../../..$PYTHON_SITE/_pytest/capture.py:920 + capsysbinary -- .../_pytest/capture.py:895 Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``. The captured output is made available via ``capsysbinary.readouterr()`` method calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``bytes`` objects. - capfd -- ../../../..$PYTHON_SITE/_pytest/capture.py:937 + capfd -- .../_pytest/capture.py:912 Enable text capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``text`` objects. - capfdbinary -- ../../../..$PYTHON_SITE/_pytest/capture.py:954 + capfdbinary -- .../_pytest/capture.py:929 Enable bytes capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``byte`` objects. - doctest_namespace [session scope] -- ../../../..$PYTHON_SITE/_pytest/doctest.py:728 + doctest_namespace [session scope] -- .../_pytest/doctest.py:731 Fixture that returns a :py:class:`dict` that will be injected into the namespace of doctests. - pytestconfig [session scope] -- ../../../..$PYTHON_SITE/_pytest/fixtures.py:1372 + pytestconfig [session scope] -- .../_pytest/fixtures.py:1365 Session-scoped fixture that returns the session's :class:`pytest.Config` object. @@ -75,7 +75,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a if pytestconfig.getoption("verbose") > 0: ... - record_property -- ../../../..$PYTHON_SITE/_pytest/junitxml.py:282 + record_property -- .../_pytest/junitxml.py:282 Add extra properties to the calling test. User properties become part of the test report and are available to the @@ -89,13 +89,13 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a def test_function(record_property): record_property("example_key", 1) - record_xml_attribute -- ../../../..$PYTHON_SITE/_pytest/junitxml.py:305 + record_xml_attribute -- .../_pytest/junitxml.py:305 Add extra xml attributes to the tag for the calling test. The fixture is callable with ``name, value``. The value is automatically XML-encoded. - record_testsuite_property [session scope] -- ../../../..$PYTHON_SITE/_pytest/junitxml.py:343 + record_testsuite_property [session scope] -- .../_pytest/junitxml.py:343 Record a new ```` tag as child of the root ````. This is suitable to writing global information regarding the entire test @@ -114,10 +114,27 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a .. warning:: Currently this fixture **does not work** with the - `pytest-xdist `__ plugin. See issue - `#7767 `__ for details. + `pytest-xdist `__ plugin. See + :issue:`7767` for details. - caplog -- ../../../..$PYTHON_SITE/_pytest/logging.py:491 + tmpdir_factory [session scope] -- .../_pytest/legacypath.py:292 + Return a :class:`pytest.TempdirFactory` instance for the test session. + + tmpdir -- .../_pytest/legacypath.py:299 + Return a temporary directory path object which is unique to each test + function invocation, created as a sub directory of the base temporary + directory. + + By default, a new base temporary directory is created each test session, + and old bases are removed after 3 sessions, to aid in debugging. If + ``--basetemp`` is used then it is cleared each session. See :ref:`base + temporary directory`. + + The returned object is a `legacy_path`_ object. + + .. _legacy_path: https://py.readthedocs.io/en/latest/path.html + + caplog -- .../_pytest/logging.py:483 Access and control log capturing. Captured logs are available through the following properties/methods:: @@ -128,7 +145,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a * caplog.record_tuples -> list of (logger_name, level, message) tuples * caplog.clear() -> clear captured records and formatted log output string - monkeypatch -- ../../../..$PYTHON_SITE/_pytest/monkeypatch.py:29 + monkeypatch -- .../_pytest/monkeypatch.py:29 A convenient fixture for monkey-patching. The fixture provides these methods to modify objects, dictionaries or @@ -147,33 +164,16 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a fixture has finished. The ``raising`` parameter determines if a KeyError or AttributeError will be raised if the set/deletion operation has no target. - recwarn -- ../../../..$PYTHON_SITE/_pytest/recwarn.py:29 + recwarn -- .../_pytest/recwarn.py:29 Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions. See https://docs.python.org/library/how-to/capture-warnings.html for information on warning categories. - tmpdir_factory [session scope] -- ../../../..$PYTHON_SITE/_pytest/tmpdir.py:210 - Return a :class:`pytest.TempdirFactory` instance for the test session. - - tmp_path_factory [session scope] -- ../../../..$PYTHON_SITE/_pytest/tmpdir.py:217 + tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:183 Return a :class:`pytest.TempPathFactory` instance for the test session. - tmpdir -- ../../../..$PYTHON_SITE/_pytest/tmpdir.py:232 - Return a temporary directory path object which is unique to each test - function invocation, created as a sub directory of the base temporary - directory. - - By default, a new base temporary directory is created each test session, - and old bases are removed after 3 sessions, to aid in debugging. If - ``--basetemp`` is used then it is cleared each session. See :ref:`base - temporary directory`. - - The returned object is a `legacy_path`_ object. - - .. _legacy_path: https://py.readthedocs.io/en/latest/path.html - - tmp_path -- ../../../..$PYTHON_SITE/_pytest/tmpdir.py:250 + tmp_path -- .../_pytest/tmpdir.py:198 Return a temporary directory path object which is unique to each test function invocation, created as a sub directory of the base temporary directory. diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 6cec2935d9a..65b160d2bf6 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -28,6 +28,482 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 7.0.0rc1 (2021-12-06) +============================ + +Breaking Changes +---------------- + +- `#7259 `_: The :ref:`Node.reportinfo() ` function first return value type has been expanded from `py.path.local | str` to `os.PathLike[str] | str`. + + Most plugins which refer to `reportinfo()` only define it as part of a custom :class:`pytest.Item` implementation. + Since `py.path.local` is a `os.PathLike[str]`, these plugins are unaffacted. + + Plugins and users which call `reportinfo()`, use the first return value and interact with it as a `py.path.local`, would need to adjust by calling `py.path.local(fspath)`. + Although preferably, avoid the legacy `py.path.local` and use `pathlib.Path`, or use `item.location` or `item.path`, instead. + + Note: pytest was not able to provide a deprecation period for this change. + + +- `#8246 `_: ``--version`` now writes version information to ``stdout`` rather than ``stderr``. + + +- `#8733 `_: Drop a workaround for `pyreadline `__ that made it work with ``--pdb``. + + The workaround was introduced in `#1281 `__ in 2015, however since then + `pyreadline seems to have gone unmaintained `__, is `generating + warnings `__, and will stop working on Python 3.10. + + +- `#9061 `_: Using :func:`pytest.approx` in a boolean context now raises an error hinting at the proper usage. + + It is apparently common for users to mistakenly use ``pytest.approx`` like this: + + .. code-block:: python + + assert pytest.approx(actual, expected) + + While the correct usage is: + + .. code-block:: python + + assert actual == pytest.approx(expected) + + The new error message helps catch those mistakes. + + +- `#9277 `_: The ``pytest.Instance`` collector type has been removed. + Importing ``pytest.Instance`` or ``_pytest.python.Instance`` returns a dummy type and emits a deprecation warning. + See :ref:`instance-collector-deprecation` for details. + + +- `#9308 `_: **PytestRemovedIn7Warning deprecation warnings are now errors by default.** + + Following our plan to remove deprecated features with as little disruption as + possible, all warnings of type ``PytestRemovedIn7Warning`` now generate errors + instead of warning messages by default. + + **The affected features will be effectively removed in pytest 7.1**, so please consult the + :ref:`deprecations` section in the docs for directions on how to update existing code. + + In the pytest ``7.0.X`` series, it is possible to change the errors back into warnings as a + stopgap measure by adding this to your ``pytest.ini`` file: + + .. code-block:: ini + + [pytest] + filterwarnings = + ignore::pytest.PytestRemovedIn7Warning + + But this will stop working when pytest ``7.1`` is released. + + **If you have concerns** about the removal of a specific feature, please add a + comment to :issue:`9308`. + + + +Deprecations +------------ + +- `#7259 `_: ``py.path.local`` arguments for hooks have been deprecated. See :ref:`the deprecation note ` for full details. + + ``py.path.local`` arguments to Node constructors have been deprecated. See :ref:`the deprecation note ` for full details. + + .. note:: + The name of the :class:`~_pytest.nodes.Node` arguments and attributes (the + 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 :pypi:`py` + dependency (see :issue:`9283` for a longer discussion). + + +- `#7469 `_: Directly constructing the following classes is now deprecated: + + - ``_pytest.mark.structures.Mark`` + - ``_pytest.mark.structures.MarkDecorator`` + - ``_pytest.mark.structures.MarkGenerator`` + - ``_pytest.python.Metafunc`` + - ``_pytest.runner.CallInfo`` + - ``_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 :class:`unittest.SkipTest` to skip collection of tests during the + pytest collection phase is deprecated. Use :func:`pytest.skip` instead. + + Note: This deprecation only relates to using :class:`unittest.SkipTest` during test + collection. You are probably not doing that. Ordinary usage of + :class:`unittest.SkipTest` / :meth:`unittest.TestCase.skipTest` / + :func:`unittest.skip` in unittest test cases is fully supported. + + +- `#8315 `_: Several behaviors of :meth:`Parser.addoption ` are now + scheduled for removal in pytest 8 (deprecated since pytest 2.4.0): + + - ``parser.addoption(..., help=".. %default ..")`` - use ``%(default)s`` instead. + - ``parser.addoption(..., type="int/string/float/complex")`` - use ``type=int`` etc. instead. + + +- `#8447 `_: Defining a custom pytest node type which is both an :class:`pytest.Item ` and a :class:`pytest.Collector ` (e.g. :class:`pytest.File `) now issues a warning. + It was never sanely supported and triggers hard to debug errors. + + See :ref:`the deprecation note ` for full details. + + +- `#8592 `_: :func:`pytest_cmdline_preparse <_pytest.hookspec.pytest_cmdline_preparse>` has been officially deprecated. It will be removed in a future release. Use :func:`pytest_load_initial_conftests <_pytest.hookspec.pytest_load_initial_conftests>` instead. + + See :ref:`the deprecation note ` for full details. + + +- `#8645 `_: :func:`pytest.warns(None) ` is now deprecated because many people used + it to mean "this code does not emit warnings", but it actually had the effect of + checking that the code emits at least one warning of any type - like ``pytest.warns()`` + or ``pytest.warns(Warning)``. + + +- `#8948 `_: :func:`pytest.skip(msg=...) `, :func:`pytest.fail(msg=...) ` and :func:`pytest.exit(msg=...) ` + signatures now accept a ``reason`` argument instead of ``msg``. Using ``msg`` still works, but is deprecated and will be removed in a future release. + + This was changed for consistency with :func:`pytest.mark.skip ` and :func:`pytest.mark.xfail ` which both accept + ``reason`` as an argument. + + + +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 :envvar:`PYTEST_THEME` and :envvar:`PYTEST_THEME_MODE` to let the users customize the pygments theme used. + + +- `#7259 `_: Added :meth:`cache.mkdir() `, which is similar to the existing :meth:`cache.makedir() `, + but returns a :class:`pathlib.Path` instead of a legacy ``py.path.local``. + + Added a ``paths`` type to :meth:`parser.addini() `, + as in ``parser.addini("mypaths", "my paths", type="paths")``, + which is similar to the existing ``pathlist``, + but returns a list of :class:`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 :class:`Config `. + - ``pytest.Mark`` for :class:`marks `. + - ``pytest.MarkDecorator`` for :class:`mark decorators `. + - ``pytest.MarkGenerator`` for the :class:`pytest.mark ` singleton. + - ``pytest.Metafunc`` for the :class:`metafunc ` argument to the :func:`pytest_generate_tests ` hook. + - ``pytest.CallInfo`` for the :class:`CallInfo ` type passed to various hooks. + - ``pytest.PytestPluginManager`` for :class:`PytestPluginManager `. + - ``pytest.ExceptionInfo`` for the :class:`ExceptionInfo ` type returned from :func:`pytest.raises` and passed to various hooks. + - ``pytest.Parser`` for the :class:`Parser ` type passed to the :func:`pytest_addoption ` hook. + - ``pytest.OptionGroup`` for the :class:`OptionGroup ` type returned from the :func:`parser.addgroup ` method. + - ``pytest.HookRecorder`` for the :class:`HookRecorder ` type returned from :class:`~pytest.Pytester`. + - ``pytest.RecordedHookCall`` for the :class:`RecordedHookCall ` type returned from :class:`~pytest.HookRecorder`. + - ``pytest.RunResult`` for the :class:`RunResult ` type returned from :class:`~pytest.Pytester`. + - ``pytest.LineMatcher`` for the :class:`LineMatcher ` type used in :class:`~pytest.RunResult` and others. + - ``pytest.TestReport`` for the :class:`TestReport ` type used in various hooks. + - ``pytest.CollectReport`` for the :class:`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 `_: :ref:`--import-mode=importlib ` now works with features that + depend on modules being on :py:data:`sys.modules`, such as :mod:`pickle` and :mod:`dataclasses`. + + +- `#8144 `_: The following hooks now receive an additional ``pathlib.Path`` argument, equivalent to an existing ``py.path.local`` argument: + + - :func:`pytest_ignore_collect <_pytest.hookspec.pytest_ignore_collect>` - The ``collection_path`` parameter (equivalent to existing ``path`` parameter). + - :func:`pytest_collect_file <_pytest.hookspec.pytest_collect_file>` - The ``file_path`` parameter (equivalent to existing ``path`` parameter). + - :func:`pytest_pycollect_makemodule <_pytest.hookspec.pytest_pycollect_makemodule>` - The ``module_path`` parameter (equivalent to existing ``path`` parameter). + - :func:`pytest_report_header <_pytest.hookspec.pytest_report_header>` - The ``start_path`` parameter (equivalent to existing ``startdir`` parameter). + - :func:`pytest_report_collectionfinish <_pytest.hookspec.pytest_report_collectionfinish>` - The ``start_path`` parameter (equivalent to existing ``startdir`` parameter). + + .. note:: + The name of the :class:`~_pytest.nodes.Node` arguments and attributes (the + 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 :pypi:`py` + dependency (see :issue:`9283` for a longer discussion). + + +- `#8251 `_: Implement ``Node.path`` as a ``pathlib.Path``. Both the old ``fspath`` and this new attribute gets set no matter whether ``path`` or ``fspath`` (deprecated) is passed to the constructor. It is a replacement for the ``fspath`` attribute (which represents the same path as ``py.path.local``). While ``fspath`` is not deprecated yet + due to the ongoing migration of methods like :meth:`~_pytest.Item.reportinfo`, we expect to deprecate it in a future release. + + .. note:: + The name of the :class:`~_pytest.nodes.Node` arguments and attributes (the + 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 :pypi:`py` + dependency (see :issue:`9283` for a longer discussion). + + +- `#8421 `_: :func:`pytest.approx` now works on :class:`~decimal.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 :ref:`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 :class:`pytest.Stash`, a facility for plugins to store their data on :class:`~pytest.Config` and :class:`~_pytest.nodes.Node`\s in a type-safe and conflict-free manner. + See :ref:`plugin-stash` for details. + + +- `#8953 `_: :class:`RunResult <_pytest.pytester.RunResult>` method :meth:`assert_outcomes <_pytest.pytester.RunResult.assert_outcomes>` now accepts a + ``warnings`` argument to assert the total number of warnings captured. + + +- `#8954 `_: ``--debug`` flag now accepts a :class:`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 `_: :class:`RunResult <_pytest.pytester.RunResult>` method :meth:`assert_outcomes <_pytest.pytester.RunResult.assert_outcomes>` now accepts a + ``deselected`` argument to assert the total number of deselected tests. + + +- `#9114 `_: Added :confval:`pythonpath` setting that adds listed paths to :data:`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 :class:`~pytest.PytestDeprecationWarning`, + instead of :class:`PytestDeprecationWarning` directly. + + See :ref:`backwards-compatibility` for more details. + + +- `#7864 `_: Improved error messages when parsing warning filters. + + Previously pytest would show an internal traceback, which besides being ugly sometimes would hide the cause + of the problem (for example an ``ImportError`` while importing a specific warning type). + + +- `#8335 `_: Improved :func:`pytest.approx` assertion messages for sequences of numbers. + + The assertion messages now dumps a table with the index and the error of each diff. + Example:: + + > assert [1, 2, 3, 4] == pytest.approx([1, 3, 3, 5]) + E assert comparison failed for 2 values: + E Index | Obtained | Expected + E 1 | 2 | 3 +- 3.0e-06 + E 3 | 4 | 5 +- 5.0e-06 + + +- `#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 :meth:`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 :func:`add_color_level <_pytest.logging.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') + logging_plugin.log_cli_handler.formatter.add_color_level(logging.SPAM, 'blue') + + See :ref:`log_colors` for more information. + + +- `#8822 `_: When showing fixture paths in `--fixtures` or `--fixtures-by-test`, fixtures coming from pytest itself now display an elided path, rather than the full path to the file in the `site-packages` directory. + + +- `#8898 `_: Complex numbers are now treated like floats and integers when generating parameterization IDs. + + +- `#9062 `_: ``--stepwise-skip`` now implicitly enables ``--stepwise`` and can be used on its own. + + +- `#9205 `_: :meth:`pytest.Cache.set` now preserves key order when saving dicts. + + + +Bug Fixes +--------- + +- `#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 :mod:`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``). + + +- `#8456 `_: The :confval:`required_plugins` config option now works correctly when pre-releases of plugins are installed, rather than falsely claiming that those plugins aren't installed at all. + + +- `#8464 `_: ``-c `` now also properly defines ``rootdir`` as the directory that contains ````. + + +- `#8503 `_: :meth:`pytest.MonkeyPatch.syspath_prepend` no longer fails when + ``setuptools`` is not installed. + It now only calls :func:`pkg_resources.fixup_namespace_packages` if + ``pkg_resources`` was previously imported, because it is not needed otherwise. + + +- `#8548 `_: Introduce fix to handle precision width in ``log-cli-format`` in turn to fix output coloring for certain formats. + + +- `#8796 `_: Fixed internal error when skipping doctests. + + +- `#8983 `_: The test selection options ``pytest -k`` and ``pytest -m`` now support matching names containing backslash (`\\`) characters. + Backslashes are treated literally, not as escape characters (the values being matched against are already escaped). + + +- `#8990 `_: Fix `pytest -vv` crashing with an internal exception `AttributeError: 'str' object has no attribute 'relative_to'` in some cases. + + +- `#9077 `_: Fixed confusing error message when ``request.fspath`` / ``request.path`` was accessed from a session-scoped fixture. + + +- `#9131 `_: Fixed the URL used by ``--pastebin`` to use `bpa.st `__. + + +- `#9163 `_: The end line number and end column offset are now properly set for rewritten assert statements. + + +- `#9169 `_: Support for the ``files`` API from ``importlib.resources`` within rewritten files. + + +- `#9272 `_: The nose compatibility module-level fixtures `setup()` and `teardown()` are now only called once per module, instead of for each test function. + They are now called even if object-level `setup`/`teardown` is defined. + + + +Improved Documentation +---------------------- + +- `#4320 `_: Improved docs for `pytester.copy_example`. + + +- `#5105 `_: Add automatically generated :ref:`plugin-list`. The list is updated on a periodic schedule. + + +- `#8337 `_: Recommend `numpy.testing `__ module on :func:`pytest.approx` documentation. + + +- `#8655 `_: Help text for ``--pdbcls`` more accurately reflects the option's behavior. + + +- `#9210 `_: Remove incorrect docs about ``confcutdir`` being a configuration option: it can only be set through the ``--confcutdir`` command-line option. + + +- `#9242 `_: Upgrade readthedocs configuration to use a `newer Ubuntu version `__` with better unicode support for PDF docs. + + +- `#9341 `_: Various methods commonly used for :ref:`non-python tests` are now correctly documented in the reference docs. They were undocumented previously. + + + +Trivial/Internal Changes +------------------------ + +- `#8133 `_: Migrate to ``setuptools_scm`` 6.x to use ``SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST`` for more robust release tooling. + + +- `#8174 `_: The following changes have been made to internal pytest types/functions: + + - The ``path`` property of ``_pytest.code.Code`` returns ``Path`` instead of ``py.path.local``. + - The ``path`` property of ``_pytest.code.TracebackEntry`` returns ``Path`` instead of ``py.path.local``. + - The ``_pytest.code.getfslineno()`` function returns ``Path`` instead of ``py.path.local``. + - The ``_pytest.python.path_matches_patterns()`` function takes ``Path`` instead of ``py.path.local``. + + +- `#8248 `_: Internal Restructure: let ``python.PyObjMixin`` inherit from ``nodes.Node`` to carry over typing information. + + +- `#8432 `_: Improve error message when :func:`pytest.skip` is used at module level without passing `allow_module_level=True`. + + +- `#8818 `_: Ensure ``regendoc`` opts out of ``TOX_ENV`` cachedir selection to ensure independent example test runs. + + +- `#8913 `_: The private ``CallSpec2._arg2scopenum`` attribute has been removed after an internal refactoring. + + +- `#8967 `_: :func:`pytest_assertion_pass <_pytest.hookspec.pytest_assertion_pass>` is no longer considered experimental and + future changes to it will be considered more carefully. + + +- `#9202 `_: Add github action to upload coverage report to codecov instead of bash uploader. + + +- `#9225 `_: Changed the command used to create sdist and wheel artifacts: using the build package instead of setup.py. + + +- `#9351 `_: Correct minor typos in doc/en/example/special.rst. + + pytest 6.2.5 (2021-08-29) ========================= diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index 402b8e34626..3226c0871e0 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -45,7 +45,7 @@ You can then restrict a test run to only run tests marked with ``webtest``: $ pytest -v -m webtest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: /home/sweet/project collecting ... collected 4 items / 3 deselected / 1 selected @@ -60,7 +60,7 @@ Or the inverse, running all tests except the webtest ones: $ pytest -v -m "not webtest" =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: /home/sweet/project collecting ... collected 4 items / 1 deselected / 3 selected @@ -82,7 +82,7 @@ tests based on their module, class, method, or function name: $ pytest -v test_server.py::TestClass::test_method =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: /home/sweet/project collecting ... collected 1 item @@ -97,7 +97,7 @@ You can also select on the class: $ pytest -v test_server.py::TestClass =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: /home/sweet/project collecting ... collected 1 item @@ -112,7 +112,7 @@ Or select multiple nodes: $ pytest -v test_server.py::TestClass test_server.py::test_send_http =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: /home/sweet/project collecting ... collected 2 items @@ -156,7 +156,7 @@ The expression matching is now case-insensitive. $ pytest -v -k http # running with the above defined example module =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: /home/sweet/project collecting ... collected 4 items / 3 deselected / 1 selected @@ -171,7 +171,7 @@ And you can also run all tests except the ones that match the keyword: $ pytest -k "not send_http" -v =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: /home/sweet/project collecting ... collected 4 items / 1 deselected / 3 selected @@ -188,7 +188,7 @@ Or to select "http" and "quick" tests: $ pytest -k "http or quick" -v =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: /home/sweet/project collecting ... collected 4 items / 2 deselected / 2 selected @@ -397,8 +397,7 @@ the test needs: $ pytest -E stage2 =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 1 item @@ -412,8 +411,7 @@ and here is one that specifies exactly the environment needed: $ pytest -E stage1 =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 1 item @@ -605,8 +603,7 @@ then you will see two tests skipped and two executed tests as expected: $ pytest -rs # this option reports skip reasons =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 4 items @@ -622,8 +619,7 @@ Note that if you specify a platform via the marker-command line option like this $ pytest -m linux =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 4 items / 3 deselected / 1 selected @@ -686,8 +682,7 @@ We can now use the ``-m option`` to select one set: $ pytest -m interface --tb=short =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 4 items / 2 deselected / 2 selected @@ -713,8 +708,7 @@ or to select both "event" and "interface" tests: $ pytest -m "interface or event" --tb=short =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 4 items / 1 deselected / 3 selected diff --git a/doc/en/example/nonpython.rst b/doc/en/example/nonpython.rst index 876c9c872f1..f79f15b4f79 100644 --- a/doc/en/example/nonpython.rst +++ b/doc/en/example/nonpython.rst @@ -28,8 +28,7 @@ now execute the test specification: nonpython $ pytest test_simple.yaml =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project/nonpython collected 2 items @@ -65,7 +64,7 @@ consulted when reporting in ``verbose`` mode: nonpython $ pytest -v =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: /home/sweet/project/nonpython collecting ... collected 2 items @@ -91,8 +90,7 @@ interesting to just look at the collection tree: nonpython $ pytest --collect-only =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project/nonpython collected 2 items diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index 87ed1420694..66d72f3cc0d 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -160,8 +160,7 @@ objects, they are still using the default pytest representation: $ pytest test_time.py --collect-only =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 8 items @@ -223,8 +222,7 @@ this is a fully self-contained example which you can run with: $ pytest test_scenarios.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 4 items @@ -238,17 +236,16 @@ If you just collect tests you'll also nicely see 'advanced' and 'basic' as varia $ pytest --collect-only test_scenarios.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 4 items - - - - + + + + ======================== 4 tests collected in 0.12s ======================== @@ -317,8 +314,7 @@ Let's first see how it looks like at collection time: $ pytest test_backends.py --collect-only =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 2 items @@ -416,7 +412,7 @@ The result of this test will be successful: $ pytest -v test_indirect_list.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: /home/sweet/project collecting ... collected 1 item @@ -506,8 +502,12 @@ Running it results in some skips if we don't have all the python interpreters in .. code-block:: pytest . $ pytest -rs -q multipython.py - ........................... [100%] - 27 passed in 0.12s + sssssssssssssssssssssssssss [100%] + ========================= short test summary info ========================== + SKIPPED [9] multipython.py:29: 'python3.5' not found + SKIPPED [9] multipython.py:29: 'python3.6' not found + SKIPPED [9] multipython.py:29: 'python3.7' not found + 27 skipped in 0.12s Indirect parametrization of optional implementations/imports -------------------------------------------------------------------- @@ -567,8 +567,7 @@ If you run this with reporting for skips enabled: $ pytest -rs test_module.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 2 items @@ -629,7 +628,7 @@ Then run ``pytest`` with verbose mode and with only the ``basic`` marker: $ pytest -v -m basic =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: /home/sweet/project collecting ... collected 24 items / 21 deselected / 3 selected diff --git a/doc/en/example/pythoncollection.rst b/doc/en/example/pythoncollection.rst index 8b7f05bb76d..b9c2386ac51 100644 --- a/doc/en/example/pythoncollection.rst +++ b/doc/en/example/pythoncollection.rst @@ -147,15 +147,14 @@ The test collection would look like this: $ pytest --collect-only =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project, configfile: pytest.ini collected 2 items - - + + ======================== 2 tests collected in 0.12s ======================== @@ -209,16 +208,15 @@ You can always peek at the collection tree without running tests like this: . $ pytest --collect-only pythoncollection.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project, configfile: pytest.ini collected 3 items - - + + ======================== 3 tests collected in 0.12s ======================== @@ -291,8 +289,7 @@ file will be left out: $ pytest --collect-only =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project, configfile: pytest.ini collected 0 items diff --git a/doc/en/example/reportingdemo.rst b/doc/en/example/reportingdemo.rst index ff814bd754a..cab93143615 100644 --- a/doc/en/example/reportingdemo.rst +++ b/doc/en/example/reportingdemo.rst @@ -9,8 +9,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: assertion $ pytest failure_demo.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project/assertion collected 44 items diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index 3b9963f09d6..a70f3404992 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -232,8 +232,7 @@ directory with the above conftest.py: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 0 items @@ -297,8 +296,7 @@ and when running it will see a skipped "slow" test: $ pytest -rs # "-rs" means report details on the little 's' =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 2 items @@ -314,8 +312,7 @@ Or run it including the ``slow`` marked test: $ pytest --runslow =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 2 items @@ -458,8 +455,7 @@ which will add the string to the test header accordingly: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y project deps: mylib-1.1 rootdir: /home/sweet/project collected 0 items @@ -487,7 +483,7 @@ which will add info only when run with "--v": $ pytest -v =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache info1: did you know that ... did you? @@ -502,8 +498,7 @@ and nothing when run plainly: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 0 items @@ -542,8 +537,7 @@ Now we can profile which test functions execute the slowest: $ pytest --durations=3 =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 3 items @@ -648,8 +642,7 @@ If we run this: $ pytest -rx =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 4 items @@ -732,8 +725,7 @@ We can run this: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 7 items @@ -851,8 +843,7 @@ and run them: $ pytest test_module.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 2 items @@ -958,8 +949,7 @@ and run it: $ pytest -s test_module.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 3 items diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index a013645d1f5..6b2ff672c59 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -22,7 +22,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 6.3.0.dev685+g581b021aa.d20210922 + pytest 7.0.0rc1 .. _`simpletest`: @@ -47,8 +47,7 @@ The test $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 1 item diff --git a/doc/en/how-to/assert.rst b/doc/en/how-to/assert.rst index ab6cbdee7cf..cb70db6b8ed 100644 --- a/doc/en/how-to/assert.rst +++ b/doc/en/how-to/assert.rst @@ -29,8 +29,7 @@ you will see the return value of the function call: $ pytest test_assert1.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 1 item @@ -184,8 +183,7 @@ if you run this module: $ pytest test_assert2.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 1 item diff --git a/doc/en/how-to/cache.rst b/doc/en/how-to/cache.rst index 1ba048d955f..e7994645dd3 100644 --- a/doc/en/how-to/cache.rst +++ b/doc/en/how-to/cache.rst @@ -86,8 +86,7 @@ If you then run it with ``--lf``: $ pytest --lf =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 2 items run-last-failure: rerun previous 2 failures @@ -133,8 +132,7 @@ of ``FF`` and dots): $ pytest --ff =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 50 items run-last-failure: rerun previous 2 failures first @@ -277,8 +275,7 @@ You can always peek at the content of the cache using the $ pytest --cache-show =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project cachedir: /home/sweet/project/.pytest_cache --------------------------- cache values for '*' --------------------------- @@ -300,8 +297,7 @@ filtering: $ pytest --cache-show example/* =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project cachedir: /home/sweet/project/.pytest_cache ----------------------- cache values for 'example/*' ----------------------- diff --git a/doc/en/how-to/capture-stdout-stderr.rst b/doc/en/how-to/capture-stdout-stderr.rst index 14628df6164..9ccea719b64 100644 --- a/doc/en/how-to/capture-stdout-stderr.rst +++ b/doc/en/how-to/capture-stdout-stderr.rst @@ -83,8 +83,7 @@ of the failing function and hide the other one: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 2 items diff --git a/doc/en/how-to/capture-warnings.rst b/doc/en/how-to/capture-warnings.rst index 4c89905e2c6..7e877b4d3da 100644 --- a/doc/en/how-to/capture-warnings.rst +++ b/doc/en/how-to/capture-warnings.rst @@ -28,8 +28,7 @@ Running pytest now produces this output: $ pytest test_show_warnings.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 1 item diff --git a/doc/en/how-to/doctest.rst b/doc/en/how-to/doctest.rst index 29e689e1290..ce0b5a5f649 100644 --- a/doc/en/how-to/doctest.rst +++ b/doc/en/how-to/doctest.rst @@ -30,8 +30,7 @@ then you can just invoke ``pytest`` directly: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 1 item @@ -59,8 +58,7 @@ and functions, including from test modules: $ pytest --doctest-modules =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 2 items diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index e0ac36e792d..08013877455 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -432,8 +432,7 @@ marked ``smtp_connection`` fixture function. Running the test looks like this: $ pytest test_module.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 2 items @@ -1331,8 +1330,7 @@ Running the above tests results in the following test IDs being used: $ pytest --collect-only =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 11 items @@ -1384,7 +1382,7 @@ Running this test will *skip* the invocation of ``data_set`` with value ``2``: $ pytest test_fixture_marks.py -v =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: /home/sweet/project collecting ... collected 3 items @@ -1434,7 +1432,7 @@ Here we declare an ``app`` fixture which receives the previously defined $ pytest -v test_appsetup.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: /home/sweet/project collecting ... collected 2 items @@ -1514,7 +1512,7 @@ Let's run the tests in verbose mode and with looking at the print-output: $ pytest -v -s test_module.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y -- $PYTHON_PREFIX/bin/python cachedir: .pytest_cache rootdir: /home/sweet/project collecting ... collected 8 items diff --git a/doc/en/how-to/output.rst b/doc/en/how-to/output.rst index 38de25edc7b..4b90988f49d 100644 --- a/doc/en/how-to/output.rst +++ b/doc/en/how-to/output.rst @@ -323,8 +323,7 @@ Example: $ pytest -ra =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 6 items @@ -381,8 +380,7 @@ More than one character can be used, so for example to only see failed and skipp $ pytest -rfs =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 6 items @@ -417,8 +415,7 @@ captured output: $ pytest -rpP =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 6 items diff --git a/doc/en/how-to/parametrize.rst b/doc/en/how-to/parametrize.rst index 240016601be..a0c9968428c 100644 --- a/doc/en/how-to/parametrize.rst +++ b/doc/en/how-to/parametrize.rst @@ -56,8 +56,7 @@ them in turn: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 3 items @@ -168,8 +167,7 @@ Let's run this: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 3 items diff --git a/doc/en/how-to/tmp_path.rst b/doc/en/how-to/tmp_path.rst index 3e95116dca9..ebd74d42e90 100644 --- a/doc/en/how-to/tmp_path.rst +++ b/doc/en/how-to/tmp_path.rst @@ -36,8 +36,7 @@ Running this would result in a passed test except for the last $ pytest test_tmp_path.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 1 item diff --git a/doc/en/how-to/unittest.rst b/doc/en/how-to/unittest.rst index e2a23a1a785..bff75110778 100644 --- a/doc/en/how-to/unittest.rst +++ b/doc/en/how-to/unittest.rst @@ -136,8 +136,7 @@ the ``self.db`` values in the traceback: $ pytest test_unittest_db.py =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 2 items diff --git a/doc/en/how-to/writing_plugins.rst b/doc/en/how-to/writing_plugins.rst index 28ed8f5f76d..b2d2b6563d6 100644 --- a/doc/en/how-to/writing_plugins.rst +++ b/doc/en/how-to/writing_plugins.rst @@ -445,8 +445,7 @@ in our ``pytest.ini`` to tell pytest where to look for example files. $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project, configfile: pytest.ini collected 2 items diff --git a/doc/en/index.rst b/doc/en/index.rst index 2f771aa3c42..3d7c2f53709 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -44,8 +44,7 @@ To execute it: $ pytest =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-6.x.y, py-1.x.y, pluggy-1.x.y - cachedir: .pytest_cache + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project collected 1 item diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 42897e3d18f..8f6f2ce7cb1 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -2019,6 +2019,7 @@ All the command-line flags can be obtained by running ``pytest --help``:: default value for --log-file-date-format log_auto_indent (string): default value for --log-auto-indent + pythonpath (paths): Add paths to sys.path faulthandler_timeout (string): Dump the traceback of all threads if a test takes more than TIMEOUT seconds to finish. From dc7091502d92b3f4c5b7eeaccd8a00255e9a4879 Mon Sep 17 00:00:00 2001 From: Yuval Shimon Date: Tue, 7 Dec 2021 11:31:03 +0200 Subject: [PATCH 005/549] Fixed error message prints function decorators when using assert in Python 3.9 and above. (#9359) --- AUTHORS | 1 + changelog/9355.bugfix.rst | 1 + src/_pytest/_code/source.py | 5 +++++ testing/code/test_source.py | 13 +++++++++++++ 4 files changed, 20 insertions(+) create mode 100644 changelog/9355.bugfix.rst diff --git a/AUTHORS b/AUTHORS index c57502ac22b..25b55e5aed2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -348,6 +348,7 @@ Xixi Zhao Xuan Luong Xuecong Liao Yoav Caspi +Yuval Shimon Zac Hatfield-Dodds Zachary Kneupper Zoltán Máté diff --git a/changelog/9355.bugfix.rst b/changelog/9355.bugfix.rst new file mode 100644 index 00000000000..62ea79ea492 --- /dev/null +++ b/changelog/9355.bugfix.rst @@ -0,0 +1 @@ +Fixed error message prints function decorators when using assert in Python 3.9 and above. diff --git a/src/_pytest/_code/source.py b/src/_pytest/_code/source.py index 6f54057c0a9..208cfb80037 100644 --- a/src/_pytest/_code/source.py +++ b/src/_pytest/_code/source.py @@ -149,6 +149,11 @@ def get_statement_startend2(lineno: int, node: ast.AST) -> Tuple[int, Optional[i values: List[int] = [] for x in ast.walk(node): if isinstance(x, (ast.stmt, ast.ExceptHandler)): + # Before Python 3.8, the lineno of a decorated class or function pointed at the decorator. + # Since Python 3.8, the lineno points to the class/def, so need to include the decorators. + if isinstance(x, (ast.ClassDef, ast.FunctionDef, ast.AsyncFunctionDef)): + for d in x.decorator_list: + values.append(d.lineno - 1) values.append(x.lineno - 1) for name in ("finalbody", "orelse"): val: Optional[List[ast.stmt]] = getattr(x, name, None) diff --git a/testing/code/test_source.py b/testing/code/test_source.py index 53e1bb9856b..53202ee27e3 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -618,6 +618,19 @@ def something(): assert str(source) == "def func(): raise ValueError(42)" +def test_decorator() -> None: + s = """\ +def foo(f): + pass + +@foo +def bar(): + pass + """ + source = getstatement(3, s) + assert "@foo" in str(source) + + def XXX_test_expression_multiline() -> None: source = """\ something From 5cb50fa13cfc2485f4ea4fcac4eec295aa93f94b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 7 Dec 2021 11:04:55 +0100 Subject: [PATCH 006/549] Fix changelog URL in 7.0.0rc1 announcement (#9379) The changelog does not exist at /stable because an rc isn't stable... --- doc/en/announce/release-7.0.0rc1.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/announce/release-7.0.0rc1.rst b/doc/en/announce/release-7.0.0rc1.rst index de9bcd42fd1..a5bf0ed3c44 100644 --- a/doc/en/announce/release-7.0.0rc1.rst +++ b/doc/en/announce/release-7.0.0rc1.rst @@ -19,7 +19,7 @@ You can upgrade from PyPI via: Users are encouraged to take a look at the CHANGELOG carefully: - https://docs.pytest.org/en/stable/changelog.html + https://docs.pytest.org/en/7.0.x/changelog.html Thanks to all the contributors to this release: From 21a186bbda5ce2407af6a626023879c8c5809431 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 7 Dec 2021 11:24:57 +0100 Subject: [PATCH 007/549] scripts: Use release branch for changelog URL (#9380) * scripts: Use release branch for changelog URL With a prerelease, /stable won't show the correct changelog. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- scripts/prepare-release-pr.py | 4 ++++ scripts/release.pre.rst | 2 +- scripts/release.py | 14 ++++++++++---- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/prepare-release-pr.py b/scripts/prepare-release-pr.py index f16e7b9625c..73088397d55 100644 --- a/scripts/prepare-release-pr.py +++ b/scripts/prepare-release-pr.py @@ -90,10 +90,13 @@ def prepare_release_pr( if prerelease: template_name = "release.pre.rst" + doc_version = release_branch elif is_feature_release: template_name = "release.minor.rst" + doc_version = "" # unused in template else: template_name = "release.patch.rst" + doc_version = "" # unused in template # important to use tox here because we have changed branches, so dependencies # might have changed as well @@ -104,6 +107,7 @@ def prepare_release_pr( "--", version, template_name, + doc_version, "--skip-check-links", ] print("Running", " ".join(cmdline)) diff --git a/scripts/release.pre.rst b/scripts/release.pre.rst index f0b054de3fc..960fae7e4f6 100644 --- a/scripts/release.pre.rst +++ b/scripts/release.pre.rst @@ -19,7 +19,7 @@ You can upgrade from PyPI via: Users are encouraged to take a look at the CHANGELOG carefully: - https://docs.pytest.org/en/stable/changelog.html + https://docs.pytest.org/en/{doc_version}/changelog.html Thanks to all the contributors to this release: diff --git a/scripts/release.py b/scripts/release.py index 19608991b61..19fef428428 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -10,7 +10,7 @@ from colorama import init -def announce(version, template_name): +def announce(version, template_name, doc_version): """Generates a new release announcement entry in the docs.""" # Get our list of authors stdout = check_output(["git", "describe", "--abbrev=0", "--tags"]) @@ -31,7 +31,9 @@ def announce(version, template_name): ) contributors_text = "\n".join(f"* {name}" for name in sorted(contributors)) + "\n" - text = template_text.format(version=version, contributors=contributors_text) + text = template_text.format( + version=version, contributors=contributors_text, doc_version=doc_version + ) target = Path(__file__).parent.joinpath(f"../doc/en/announce/release-{version}.rst") target.write_text(text, encoding="UTF-8") @@ -82,9 +84,9 @@ def check_links(): check_call(["tox", "-e", "docs-checklinks"]) -def pre_release(version, template_name, *, skip_check_links): +def pre_release(version, template_name, doc_version, *, skip_check_links): """Generates new docs, release announcements and creates a local tag.""" - announce(version, template_name) + announce(version, template_name, doc_version) regen(version) changelog(version, write_out=True) fix_formatting() @@ -112,11 +114,15 @@ def main(): parser.add_argument( "template_name", help="Name of template file to use for release announcement" ) + parser.add_argument( + "doc_version", help="For prereleases, the version to link to in the docs" + ) parser.add_argument("--skip-check-links", action="store_true", default=False) options = parser.parse_args() pre_release( options.version, options.template_name, + options.doc_version, skip_check_links=options.skip_check_links, ) From 49278c1df8ae3670f5ecc2ce7110453c1aedea4e Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 7 Dec 2021 15:04:27 +0200 Subject: [PATCH 008/549] RELEASING: should also tag dev0 for prereleases --- RELEASING.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASING.rst b/RELEASING.rst index 25ce90d0f65..f9e4d5f153c 100644 --- a/RELEASING.rst +++ b/RELEASING.rst @@ -152,7 +152,7 @@ Both automatic and manual processes described above follow the same steps from t #. Open a PR for ``cherry-pick-release`` and merge it once CI passes. No need to wait for approvals if there were no conflicts on the previous step. -#. For major and minor releases, tag the release cherry-pick merge commit in main with +#. For major and minor releases (or the first prerelease of it), tag the release cherry-pick merge commit in main with a dev tag for the next feature release:: git checkout main From b691d31897fae46fda0cf0445f5386c54460f09a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric?= Date: Tue, 7 Dec 2021 10:59:12 -0500 Subject: [PATCH 009/549] fix typo --- doc/en/deprecations.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index ea9ef2aa35d..bcd13fd5bff 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -127,7 +127,7 @@ Passing ``msg=`` to ``pytest.skip``, ``pytest.fail`` or ``pytest.exit`` Passing the keyword argument ``msg`` to :func:`pytest.skip`, :func:`pytest.fail` or :func:`pytest.exit` is now deprecated and ``reason`` should be used instead. This change is to bring consistency between these -functions and the``@pytest.mark.skip`` and ``@pytest.mark.xfail`` markers which already accept a ``reason`` argument. +functions and the ``@pytest.mark.skip`` and ``@pytest.mark.xfail`` markers which already accept a ``reason`` argument. .. code-block:: python From 0b0e2d2dbb59ad20c7e70691dec56fc5e2b1047c Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 7 Dec 2021 21:56:46 +0200 Subject: [PATCH 010/549] Remove deprecated `_fillfuncargs` function --- doc/en/deprecations.rst | 14 ++++--- doc/en/how-to/plugins.rst | 3 -- src/_pytest/deprecated.py | 6 --- src/_pytest/fixtures.py | 37 ------------------ src/pytest/__init__.py | 2 - src/pytest/collect.py | 1 - testing/deprecated_test.py | 25 ------------ testing/python/fixtures.py | 4 -- testing/python/integration.py | 74 ----------------------------------- 9 files changed, 8 insertions(+), 158 deletions(-) diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index bcd13fd5bff..c0f32c3bc61 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -269,10 +269,18 @@ The ``pytest.collect`` module is no longer part of the public API, all its names should now be imported from ``pytest`` directly instead. +Removed Features +---------------- + +As stated in our :ref:`backwards-compatibility` policy, deprecated features are removed only in major releases after +an appropriate period of deprecation has passed. + + The ``pytest._fillfuncargs`` function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. deprecated:: 6.0 +.. versionremoved:: 7.0 This function was kept for backward compatibility with an older plugin. @@ -281,12 +289,6 @@ it, use `function._request._fillfixtures()` instead, though note this is not a public API and may break in the future. -Removed Features ----------------- - -As stated in our :ref:`backwards-compatibility` policy, deprecated features are removed only in major releases after -an appropriate period of deprecation has passed. - ``--no-print-logs`` command-line option ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/en/how-to/plugins.rst b/doc/en/how-to/plugins.rst index cae737e96ed..de31bc04a86 100644 --- a/doc/en/how-to/plugins.rst +++ b/doc/en/how-to/plugins.rst @@ -51,9 +51,6 @@ Here is a little annotated list for some popular plugins: * :pypi:`pytest-flakes`: check source code with pyflakes. -* :pypi:`oejskit`: - a plugin to run javascript unittests in live browsers. - To see a complete list of all plugins with their latest testing status against different pytest and Python versions, please visit :ref:`plugin-list`. diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index 5f1edd60727..88114fbf345 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -24,12 +24,6 @@ } -FILLFUNCARGS = UnformattedWarning( - PytestRemovedIn7Warning, - "{name} is deprecated, use " - "function._request._fillfixtures() instead if you cannot avoid reaching into internals.", -) - PYTEST_COLLECT_MODULE = UnformattedWarning( PytestRemovedIn7Warning, "pytest.collect.{name} was moved to pytest.{name}\n" diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index fddff931c51..e0409fcf2d7 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -52,7 +52,6 @@ from _pytest.config import Config from _pytest.config.argparsing import Parser from _pytest.deprecated import check_ispytest -from _pytest.deprecated import FILLFUNCARGS from _pytest.deprecated import YIELD_FIXTURE from _pytest.mark import Mark from _pytest.mark import ParameterSet @@ -73,7 +72,6 @@ from _pytest.scope import _ScopeName from _pytest.main import Session from _pytest.python import CallSpec2 - from _pytest.python import Function from _pytest.python import Metafunc @@ -352,41 +350,6 @@ def reorder_items_atscope( return items_done -def _fillfuncargs(function: "Function") -> None: - """Fill missing fixtures for a test function, old public API (deprecated).""" - warnings.warn(FILLFUNCARGS.format(name="pytest._fillfuncargs()"), stacklevel=2) - _fill_fixtures_impl(function) - - -def fillfixtures(function: "Function") -> None: - """Fill missing fixtures for a test function (deprecated).""" - warnings.warn( - FILLFUNCARGS.format(name="_pytest.fixtures.fillfixtures()"), stacklevel=2 - ) - _fill_fixtures_impl(function) - - -def _fill_fixtures_impl(function: "Function") -> None: - """Internal implementation to fill fixtures on the given function object.""" - try: - request = function._request - except AttributeError: - # XXX this special code path is only expected to execute - # with the oejskit plugin. It uses classes with funcargs - # and we thus have to work a bit to allow this. - fm = function.session._fixturemanager - assert function.parent is not None - fi = fm.getfixtureinfo(function.parent, function.obj, None) - function._fixtureinfo = fi - request = function._request = FixtureRequest(function, _ispytest=True) - fm.session._setupstate.setup(function) - request._fillfixtures() - # Prune out funcargs for jstests. - function.funcargs = {name: function.funcargs[name] for name in fi.argnames} - else: - request._fillfixtures() - - def get_direct_param_fixture_func(request): return request.param diff --git a/src/pytest/__init__.py b/src/pytest/__init__.py index 7a596cd3783..26b87c7f567 100644 --- a/src/pytest/__init__.py +++ b/src/pytest/__init__.py @@ -19,7 +19,6 @@ from _pytest.config.argparsing import OptionGroup from _pytest.config.argparsing import Parser from _pytest.debugging import pytestPDB as __pytestPDB -from _pytest.fixtures import _fillfuncargs from _pytest.fixtures import fixture from _pytest.fixtures import FixtureLookupError from _pytest.fixtures import FixtureRequest @@ -81,7 +80,6 @@ __all__ = [ "__version__", - "_fillfuncargs", "approx", "Cache", "CallInfo", diff --git a/src/pytest/collect.py b/src/pytest/collect.py index 4b2b5818066..71afe5d9cca 100644 --- a/src/pytest/collect.py +++ b/src/pytest/collect.py @@ -15,7 +15,6 @@ "Item", "Class", "File", - "_fillfuncargs", ] diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index 7d7e6d31240..e4dcfa67fb2 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -2,7 +2,6 @@ import sys import warnings from pathlib import Path -from unittest import mock import pytest from _pytest import deprecated @@ -28,30 +27,6 @@ def test_external_plugins_integrated(pytester: Pytester, plugin) -> None: pytester.parseconfig("-p", plugin) -def test_fillfuncargs_is_deprecated() -> None: - with pytest.warns( - pytest.PytestDeprecationWarning, - match=re.escape( - "pytest._fillfuncargs() is deprecated, use " - "function._request._fillfixtures() instead if you cannot avoid reaching into internals." - ), - ): - pytest._fillfuncargs(mock.Mock()) - - -def test_fillfixtures_is_deprecated() -> None: - import _pytest.fixtures - - with pytest.warns( - pytest.PytestDeprecationWarning, - match=re.escape( - "_pytest.fixtures.fillfixtures() is deprecated, use " - "function._request._fillfixtures() instead if you cannot avoid reaching into internals." - ), - ): - _pytest.fixtures.fillfixtures(mock.Mock()) - - def test_minus_k_dash_is_deprecated(pytester: Pytester) -> None: threepass = pytester.makepyfile( test_threepass=""" diff --git a/testing/python/fixtures.py b/testing/python/fixtures.py index f29ca1dfa59..3ce5cb34ddd 100644 --- a/testing/python/fixtures.py +++ b/testing/python/fixtures.py @@ -103,10 +103,6 @@ class T: @pytest.mark.pytester_example_path("fixtures/fill_fixtures") class TestFillFixtures: - def test_fillfuncargs_exposed(self): - # used by oejskit, kept for compatibility - assert pytest._fillfuncargs == fixtures._fillfuncargs - def test_funcarg_lookupfails(self, pytester: Pytester) -> None: pytester.copy_example() result = pytester.runpytest() # "--collect-only") diff --git a/testing/python/integration.py b/testing/python/integration.py index d138b726638..6b5c53c98c4 100644 --- a/testing/python/integration.py +++ b/testing/python/integration.py @@ -1,84 +1,10 @@ -from typing import Any - import pytest -from _pytest import runner from _pytest._code import getfslineno from _pytest.fixtures import getfixturemarker from _pytest.pytester import Pytester from _pytest.python import Function -class TestOEJSKITSpecials: - def test_funcarg_non_pycollectobj( - self, pytester: Pytester, recwarn - ) -> None: # rough jstests usage - pytester.makeconftest( - """ - import pytest - def pytest_pycollect_makeitem(collector, name, obj): - if name == "MyClass": - return MyCollector.from_parent(collector, name=name) - class MyCollector(pytest.Collector): - def reportinfo(self): - return self.path, 3, "xyz" - """ - ) - modcol = pytester.getmodulecol( - """ - import pytest - @pytest.fixture - def arg1(request): - return 42 - class MyClass(object): - pass - """ - ) - # this hook finds funcarg factories - rep = runner.collect_one_node(collector=modcol) - # TODO: Don't treat as Any. - clscol: Any = rep.result[0] - clscol.obj = lambda arg1: None - clscol.funcargs = {} - pytest._fillfuncargs(clscol) - assert clscol.funcargs["arg1"] == 42 - - def test_autouse_fixture( - self, pytester: Pytester, recwarn - ) -> None: # rough jstests usage - pytester.makeconftest( - """ - import pytest - def pytest_pycollect_makeitem(collector, name, obj): - if name == "MyClass": - return MyCollector.from_parent(collector, name=name) - class MyCollector(pytest.Collector): - def reportinfo(self): - return self.path, 3, "xyz" - """ - ) - modcol = pytester.getmodulecol( - """ - import pytest - @pytest.fixture(autouse=True) - def hello(): - pass - @pytest.fixture - def arg1(request): - return 42 - class MyClass(object): - pass - """ - ) - # this hook finds funcarg factories - rep = runner.collect_one_node(modcol) - # TODO: Don't treat as Any. - clscol: Any = rep.result[0] - clscol.obj = lambda: None - clscol.funcargs = {} - pytest._fillfuncargs(clscol) - assert not clscol.funcargs - - def test_wrapped_getfslineno() -> None: def func(): pass From 41d8fb09ca1d201ef126347c4bffe77f0e0245d2 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 7 Dec 2021 22:00:31 +0200 Subject: [PATCH 011/549] Remove deprecated `pytest_warning_captured` hook --- doc/en/deprecations.rst | 23 ++++++++++++---------- doc/en/reference/reference.rst | 1 - src/_pytest/config/__init__.py | 8 -------- src/_pytest/deprecated.py | 5 ----- src/_pytest/hookspec.py | 36 ---------------------------------- src/_pytest/warnings.py | 8 -------- testing/test_warnings.py | 8 ++++---- 7 files changed, 17 insertions(+), 72 deletions(-) diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index c0f32c3bc61..a966e6efce8 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -250,16 +250,6 @@ The ``yield_fixture`` function/decorator It has been so for a very long time, so can be search/replaced safely. -The ``pytest_warning_captured`` hook -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. deprecated:: 6.0 - -This hook has an `item` parameter which cannot be serialized by ``pytest-xdist``. - -Use the ``pytest_warning_recored`` hook instead, which replaces the ``item`` parameter -by a ``nodeid`` parameter. - The ``pytest.collect`` module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -276,6 +266,19 @@ As stated in our :ref:`backwards-compatibility` policy, deprecated features are an appropriate period of deprecation has passed. +The ``pytest_warning_captured`` hook +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. deprecated:: 6.0 +.. versionremoved:: 7.0 + +This hook has an `item` parameter which cannot be serialized by ``pytest-xdist``. + +Use the ``pytest_warning_recored`` hook instead, which replaces the ``item`` parameter +by a ``nodeid`` parameter. + + + The ``pytest._fillfuncargs`` function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 8f6f2ce7cb1..c132ae6d3dd 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -758,7 +758,6 @@ Session related reporting hooks: .. autofunction:: pytest_terminal_summary .. autofunction:: pytest_fixture_setup .. autofunction:: pytest_fixture_post_finalizer -.. autofunction:: pytest_warning_captured .. autofunction:: pytest_warning_recorded Central hook for reporting about test execution: diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index eadce78fa65..4cb22009a06 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1330,14 +1330,6 @@ def issue_config_time_warning(self, warning: Warning, stacklevel: int) -> None: if records: frame = sys._getframe(stacklevel - 1) location = frame.f_code.co_filename, frame.f_lineno, frame.f_code.co_name - self.hook.pytest_warning_captured.call_historic( - kwargs=dict( - warning_message=records[0], - when="config", - item=None, - location=location, - ) - ) self.hook.pytest_warning_recorded.call_historic( kwargs=dict( warning_message=records[0], diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index 88114fbf345..0d0af725e84 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -46,11 +46,6 @@ "Please open an issue if you use this and want a replacement." ) -WARNING_CAPTURED_HOOK = PytestRemovedIn7Warning( - "The pytest_warning_captured is deprecated and will be removed in a future release.\n" - "Please use pytest_warning_recorded instead." -) - WARNING_CMDLINE_PREPARSE_HOOK = PytestRemovedIn8Warning( "The pytest_cmdline_preparse hook is deprecated and will be removed in a future release. \n" "Please use pytest_load_initial_conftests hook instead." diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index b65be981560..57f199499d5 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -13,7 +13,6 @@ from pluggy import HookspecMarker -from _pytest.deprecated import WARNING_CAPTURED_HOOK from _pytest.deprecated import WARNING_CMDLINE_PREPARSE_HOOK if TYPE_CHECKING: @@ -777,41 +776,6 @@ def pytest_terminal_summary( """ -@hookspec(historic=True, warn_on_impl=WARNING_CAPTURED_HOOK) -def pytest_warning_captured( - warning_message: "warnings.WarningMessage", - when: "Literal['config', 'collect', 'runtest']", - item: Optional["Item"], - location: Optional[Tuple[str, int, str]], -) -> None: - """(**Deprecated**) Process a warning captured by the internal pytest warnings plugin. - - .. deprecated:: 6.0 - - This hook is considered deprecated and will be removed in a future pytest version. - Use :func:`pytest_warning_recorded` instead. - - :param warnings.WarningMessage warning_message: - The captured warning. This is the same object produced by :py:func:`warnings.catch_warnings`, and contains - the same attributes as the parameters of :py:func:`warnings.showwarning`. - - :param str when: - Indicates when the warning was captured. Possible values: - - * ``"config"``: during pytest configuration/initialization stage. - * ``"collect"``: during test collection. - * ``"runtest"``: during test execution. - - :param pytest.Item|None item: - The item being executed if ``when`` is ``"runtest"``, otherwise ``None``. - - :param tuple location: - When available, holds information about the execution context of the captured - warning (filename, linenumber, function). ``function`` evaluates to - when the execution context is at the module level. - """ - - @hookspec(historic=True) def pytest_warning_recorded( warning_message: "warnings.WarningMessage", diff --git a/src/_pytest/warnings.py b/src/_pytest/warnings.py index c0c946cbde5..d5afbfeb64c 100644 --- a/src/_pytest/warnings.py +++ b/src/_pytest/warnings.py @@ -63,14 +63,6 @@ def catch_warnings_for_item( yield for warning_message in log: - ihook.pytest_warning_captured.call_historic( - kwargs=dict( - warning_message=warning_message, - when=when, - item=item, - location=None, - ) - ) ihook.pytest_warning_recorded.call_historic( kwargs=dict( warning_message=warning_message, diff --git a/testing/test_warnings.py b/testing/test_warnings.py index cac716680f4..45acb720d1d 100644 --- a/testing/test_warnings.py +++ b/testing/test_warnings.py @@ -239,7 +239,7 @@ def test_func(): @pytest.mark.filterwarnings("always::UserWarning") -def test_warning_captured_hook(pytester: Pytester) -> None: +def test_warning_recorded_hook(pytester: Pytester) -> None: pytester.makeconftest( """ def pytest_configure(config): @@ -276,9 +276,9 @@ def pytest_warning_recorded(self, warning_message, when, nodeid, location): expected = [ ("config warning", "config", ""), ("collect warning", "collect", ""), - ("setup warning", "runtest", "test_warning_captured_hook.py::test_func"), - ("call warning", "runtest", "test_warning_captured_hook.py::test_func"), - ("teardown warning", "runtest", "test_warning_captured_hook.py::test_func"), + ("setup warning", "runtest", "test_warning_recorded_hook.py::test_func"), + ("call warning", "runtest", "test_warning_recorded_hook.py::test_func"), + ("teardown warning", "runtest", "test_warning_recorded_hook.py::test_func"), ] for index in range(len(expected)): collected_result = collected[index] From 927d9d274fd6b5045beeb87fcafdccac939daf84 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 7 Dec 2021 22:08:12 +0200 Subject: [PATCH 012/549] Remove deprecated `-k -foobar` syntax --- src/_pytest/deprecated.py | 4 ---- src/_pytest/mark/__init__.py | 5 ----- testing/deprecated_test.py | 12 ------------ 3 files changed, 21 deletions(-) diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index 0d0af725e84..274e63b8e64 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -37,10 +37,6 @@ "Use @pytest.fixture instead; they are the same." ) -MINUS_K_DASH = PytestRemovedIn7Warning( - "The `-k '-expr'` syntax to -k is deprecated.\nUse `-k 'not expr'` instead." -) - MINUS_K_COLON = PytestRemovedIn7Warning( "The `-k 'expr:'` syntax to -k is deprecated.\n" "Please open an issue if you use this and want a replacement." diff --git a/src/_pytest/mark/__init__.py b/src/_pytest/mark/__init__.py index 7e082f2e6e0..2eb305109e0 100644 --- a/src/_pytest/mark/__init__.py +++ b/src/_pytest/mark/__init__.py @@ -24,7 +24,6 @@ from _pytest.config import UsageError from _pytest.config.argparsing import Parser from _pytest.deprecated import MINUS_K_COLON -from _pytest.deprecated import MINUS_K_DASH from _pytest.stash import StashKey if TYPE_CHECKING: @@ -189,10 +188,6 @@ def deselect_by_keyword(items: "List[Item]", config: Config) -> None: if not keywordexpr: return - if keywordexpr.startswith("-"): - # To be removed in pytest 8.0.0. - warnings.warn(MINUS_K_DASH, stacklevel=2) - keywordexpr = "not " + keywordexpr[1:] selectuntil = False if keywordexpr[-1:] == ":": # To be removed in pytest 8.0.0. diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index e4dcfa67fb2..18483a4e362 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -27,18 +27,6 @@ def test_external_plugins_integrated(pytester: Pytester, plugin) -> None: pytester.parseconfig("-p", plugin) -def test_minus_k_dash_is_deprecated(pytester: Pytester) -> None: - threepass = pytester.makepyfile( - test_threepass=""" - def test_one(): assert 1 - def test_two(): assert 1 - def test_three(): assert 1 - """ - ) - result = pytester.runpytest("-k=-test_two", threepass) - result.stdout.fnmatch_lines(["*The `-k '-expr'` syntax*deprecated*"]) - - def test_minus_k_colon_is_deprecated(pytester: Pytester) -> None: threepass = pytester.makepyfile( test_threepass=""" From 4a45a5e983c0fc5c881e379ae90483e649ac6595 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 7 Dec 2021 22:13:58 +0200 Subject: [PATCH 013/549] Remove deprecated `-k foobar:` syntax --- src/_pytest/deprecated.py | 5 ----- src/_pytest/mark/__init__.py | 13 +------------ testing/deprecated_test.py | 12 ------------ testing/test_mark.py | 19 ------------------- testing/test_terminal.py | 4 +--- 5 files changed, 2 insertions(+), 51 deletions(-) diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index 274e63b8e64..9094911f9b3 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -37,11 +37,6 @@ "Use @pytest.fixture instead; they are the same." ) -MINUS_K_COLON = PytestRemovedIn7Warning( - "The `-k 'expr:'` syntax to -k is deprecated.\n" - "Please open an issue if you use this and want a replacement." -) - WARNING_CMDLINE_PREPARSE_HOOK = PytestRemovedIn8Warning( "The pytest_cmdline_preparse hook is deprecated and will be removed in a future release. \n" "Please use pytest_load_initial_conftests hook instead." diff --git a/src/_pytest/mark/__init__.py b/src/_pytest/mark/__init__.py index 2eb305109e0..11e6e34d73a 100644 --- a/src/_pytest/mark/__init__.py +++ b/src/_pytest/mark/__init__.py @@ -1,5 +1,4 @@ """Generic mechanism for marking and selecting python functions.""" -import warnings from typing import AbstractSet from typing import Collection from typing import List @@ -23,7 +22,6 @@ from _pytest.config import hookimpl from _pytest.config import UsageError from _pytest.config.argparsing import Parser -from _pytest.deprecated import MINUS_K_COLON from _pytest.stash import StashKey if TYPE_CHECKING: @@ -188,23 +186,14 @@ def deselect_by_keyword(items: "List[Item]", config: Config) -> None: if not keywordexpr: return - selectuntil = False - if keywordexpr[-1:] == ":": - # To be removed in pytest 8.0.0. - warnings.warn(MINUS_K_COLON, stacklevel=2) - selectuntil = True - keywordexpr = keywordexpr[:-1] - expr = _parse_expression(keywordexpr, "Wrong expression passed to '-k'") remaining = [] deselected = [] for colitem in items: - if keywordexpr and not expr.evaluate(KeywordMatcher.from_item(colitem)): + if not expr.evaluate(KeywordMatcher.from_item(colitem)): deselected.append(colitem) else: - if selectuntil: - keywordexpr = None remaining.append(colitem) if deselected: diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index 18483a4e362..54a55190016 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -27,18 +27,6 @@ def test_external_plugins_integrated(pytester: Pytester, plugin) -> None: pytester.parseconfig("-p", plugin) -def test_minus_k_colon_is_deprecated(pytester: Pytester) -> None: - threepass = pytester.makepyfile( - test_threepass=""" - def test_one(): assert 1 - def test_two(): assert 1 - def test_three(): assert 1 - """ - ) - result = pytester.runpytest("-k", "test_two:", threepass) - result.stdout.fnmatch_lines(["*The `-k 'expr:'` syntax*deprecated*"]) - - def test_fscollector_gethookproxy_isinitpath(pytester: Pytester) -> None: module = pytester.getmodulecol( """ diff --git a/testing/test_mark.py b/testing/test_mark.py index da67d1ea7bc..65f2581bd63 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -823,25 +823,6 @@ def pytest_pycollect_makeitem(name): assert len(dlist) == 1 assert dlist[0].items[0].name == "test_1" - def test_select_starton(self, pytester: Pytester) -> None: - threepass = pytester.makepyfile( - test_threepass=""" - def test_one(): assert 1 - def test_two(): assert 1 - def test_three(): assert 1 - """ - ) - reprec = pytester.inline_run( - "-Wignore::pytest.PytestRemovedIn7Warning", "-k", "test_two:", threepass - ) - passed, skipped, failed = reprec.listoutcomes() - assert len(passed) == 2 - assert not failed - dlist = reprec.getcalls("pytest_deselected") - assert len(dlist) == 1 - item = dlist[0].items[0] - assert item.name == "test_one" - def test_keyword_extra(self, pytester: Pytester) -> None: p = pytester.makepyfile( """ diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 23f597e3325..b1904816c95 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -682,9 +682,7 @@ def test_three(): pass """ ) - result = pytester.runpytest( - "-Wignore::pytest.PytestRemovedIn7Warning", "-k", "test_two:", testpath - ) + result = pytester.runpytest("-k", "test_t", testpath) result.stdout.fnmatch_lines( ["collected 3 items / 1 deselected / 2 selected", "*test_deselected.py ..*"] ) From 0f39f11d88d714146fd719d87483f0cb2c7fa827 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 7 Dec 2021 22:14:55 +0200 Subject: [PATCH 014/549] Remove deprecated `pytest.collect` module --- doc/en/deprecations.rst | 14 ++++++++------ src/_pytest/deprecated.py | 7 ------- src/pytest/__init__.py | 2 -- src/pytest/collect.py | 37 ------------------------------------- testing/deprecated_test.py | 7 ------- 5 files changed, 8 insertions(+), 59 deletions(-) delete mode 100644 src/pytest/collect.py diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index a966e6efce8..c748316cb73 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -250,21 +250,23 @@ The ``yield_fixture`` function/decorator It has been so for a very long time, so can be search/replaced safely. +Removed Features +---------------- + +As stated in our :ref:`backwards-compatibility` policy, deprecated features are removed only in major releases after +an appropriate period of deprecation has passed. + + The ``pytest.collect`` module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. deprecated:: 6.0 +.. versionremoved:: 7.0 The ``pytest.collect`` module is no longer part of the public API, all its names should now be imported from ``pytest`` directly instead. -Removed Features ----------------- - -As stated in our :ref:`backwards-compatibility` policy, deprecated features are removed only in major releases after -an appropriate period of deprecation has passed. - The ``pytest_warning_captured`` hook ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index 9094911f9b3..f68aea37e4d 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -11,7 +11,6 @@ from warnings import warn from _pytest.warning_types import PytestDeprecationWarning -from _pytest.warning_types import PytestRemovedIn7Warning from _pytest.warning_types import PytestRemovedIn8Warning from _pytest.warning_types import UnformattedWarning @@ -24,12 +23,6 @@ } -PYTEST_COLLECT_MODULE = UnformattedWarning( - PytestRemovedIn7Warning, - "pytest.collect.{name} was moved to pytest.{name}\n" - "Please update to the new name.", -) - # This can be* removed pytest 8, but it's harmless and common, so no rush to remove. # * If you're in the future: "could have been". YIELD_FIXTURE = PytestDeprecationWarning( diff --git a/src/pytest/__init__.py b/src/pytest/__init__.py index 26b87c7f567..beb8eba03a2 100644 --- a/src/pytest/__init__.py +++ b/src/pytest/__init__.py @@ -1,6 +1,5 @@ # PYTHON_ARGCOMPLETE_OK """pytest: unit and functional testing with Python.""" -from . import collect from _pytest import __version__ from _pytest import version_tuple from _pytest._code import ExceptionInfo @@ -86,7 +85,6 @@ "CaptureFixture", "Class", "cmdline", - "collect", "Collector", "CollectReport", "Config", diff --git a/src/pytest/collect.py b/src/pytest/collect.py deleted file mode 100644 index 71afe5d9cca..00000000000 --- a/src/pytest/collect.py +++ /dev/null @@ -1,37 +0,0 @@ -import sys -import warnings -from types import ModuleType -from typing import Any -from typing import List - -import pytest -from _pytest.deprecated import PYTEST_COLLECT_MODULE - -COLLECT_FAKEMODULE_ATTRIBUTES = [ - "Collector", - "Module", - "Function", - "Session", - "Item", - "Class", - "File", -] - - -class FakeCollectModule(ModuleType): - def __init__(self) -> None: - super().__init__("pytest.collect") - self.__all__ = list(COLLECT_FAKEMODULE_ATTRIBUTES) - self.__pytest = pytest - - def __dir__(self) -> List[str]: - return dir(super()) + self.__all__ - - def __getattr__(self, name: str) -> Any: - if name not in self.__all__: - raise AttributeError(name) - warnings.warn(PYTEST_COLLECT_MODULE.format(name=name), stacklevel=2) - return getattr(pytest, name) - - -sys.modules["pytest.collect"] = FakeCollectModule() diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index 54a55190016..c316b074c4b 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -10,13 +10,6 @@ from pytest import PytestDeprecationWarning -@pytest.mark.parametrize("attribute", pytest.collect.__all__) # type: ignore -# false positive due to dynamic attribute -def test_pytest_collect_module_deprecated(attribute) -> None: - with pytest.warns(DeprecationWarning, match=attribute): - getattr(pytest.collect, attribute) - - @pytest.mark.parametrize("plugin", sorted(deprecated.DEPRECATED_EXTERNAL_PLUGINS)) @pytest.mark.filterwarnings("default") def test_external_plugins_integrated(pytester: Pytester, plugin) -> None: From 3ba9c01f9bfd442f2bcc4711e15612aa5b518cc3 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 8 Dec 2021 06:46:44 -0300 Subject: [PATCH 015/549] Hide internal stack when using pytest.approx() in bool context (#9394) This makes the error traceback point directly to the offending usage, rather than to the internal `Approx.__bool__` method. --- src/_pytest/python_api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 26f78c66ad4..cb72fde1e1f 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -101,6 +101,7 @@ def __eq__(self, actual) -> bool: ) def __bool__(self): + __tracebackhide__ = True raise AssertionError( "approx() is not supported in a boolean context.\nDid you mean: `assert a == approx(b)`?" ) From 7ae23ff8ae6acdca4862e728bf7187c30d076d6c Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 8 Dec 2021 04:46:55 -0500 Subject: [PATCH 016/549] fix python version in changelog message (#9390) --- changelog/9355.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/9355.bugfix.rst b/changelog/9355.bugfix.rst index 62ea79ea492..a2739369fe0 100644 --- a/changelog/9355.bugfix.rst +++ b/changelog/9355.bugfix.rst @@ -1 +1 @@ -Fixed error message prints function decorators when using assert in Python 3.9 and above. +Fixed error message prints function decorators when using assert in Python 3.8 and above. From e05e696fdac097ebad4a77a47f878c81fca39cb2 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 4 Nov 2021 00:21:35 +0200 Subject: [PATCH 017/549] Make PyCollector an implementation detail - don't use in hook type annotation The `pytest_pycollector_makeitem` argument `collector` is currently annotated with type `PyCollector`. As part of #7469, that would have required us to expose it in the public API. But really it's an implementation detail, not something we want to expose. So replace the annotation with the concrete python collector types that are passed. Strictly speaking, `pytest_pycollector_makeitem` is called from `PyCollector.collect()`, so the new type annotation is incorrect if another type subclasses `PyCollector`. But the set of python collectors is closed (mapping to language constructs), and the type is private, so there shouldn't be any other deriving classes, and we can consider it effectively sealed (unfortunately Python does not provide a way to express this - yet?). --- src/_pytest/hookspec.py | 4 ++-- src/_pytest/python.py | 15 ++++++++++----- src/_pytest/unittest.py | 4 ++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index b65be981560..8aaa6e434da 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -34,10 +34,10 @@ from _pytest.nodes import Collector from _pytest.nodes import Item from _pytest.outcomes import Exit + from _pytest.python import Class from _pytest.python import Function from _pytest.python import Metafunc from _pytest.python import Module - from _pytest.python import PyCollector from _pytest.reports import CollectReport from _pytest.reports import TestReport from _pytest.runner import CallInfo @@ -360,7 +360,7 @@ def pytest_pycollect_makemodule( @hookspec(firstresult=True) def pytest_pycollect_makeitem( - collector: "PyCollector", name: str, obj: object + collector: Union["Module", "Class"], name: str, obj: object ) -> Union[None, "Item", "Collector", List[Union["Item", "Collector"]]]: """Return a custom item/collector for a Python object in a module, or None. diff --git a/src/_pytest/python.py b/src/_pytest/python.py index b557cd8fa77..b5e391fb210 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -224,11 +224,15 @@ def pytest_pycollect_makemodule(module_path: Path, parent) -> "Module": @hookimpl(trylast=True) -def pytest_pycollect_makeitem(collector: "PyCollector", name: str, obj: object): +def pytest_pycollect_makeitem( + collector: Union["Module", "Class"], name: str, obj: object +) -> Union[None, nodes.Item, nodes.Collector, List[Union[nodes.Item, nodes.Collector]]]: + assert isinstance(collector, (Class, Module)), type(collector) # Nothing was collected elsewhere, let's do it here. if safe_isclass(obj): if collector.istestclass(obj, name): - return Class.from_parent(collector, name=name, obj=obj) + klass: Class = Class.from_parent(collector, name=name, obj=obj) + return klass elif collector.istestfunction(obj, name): # mock seems to store unbound methods (issue473), normalize it. obj = getattr(obj, "__func__", obj) @@ -247,15 +251,16 @@ def pytest_pycollect_makeitem(collector: "PyCollector", name: str, obj: object): ) elif getattr(obj, "__test__", True): if is_generator(obj): - res = Function.from_parent(collector, name=name) + res: Function = Function.from_parent(collector, name=name) reason = "yield tests were removed in pytest 4.0 - {name} will be ignored".format( name=name ) res.add_marker(MARK_GEN.xfail(run=False, reason=reason)) res.warn(PytestCollectionWarning(reason)) + return res else: - res = list(collector._genfunctions(name, obj)) - return res + return list(collector._genfunctions(name, obj)) + return None class PyobjMixin(nodes.Node): diff --git a/src/_pytest/unittest.py b/src/_pytest/unittest.py index 108095bfcbe..a05c3b4bc43 100644 --- a/src/_pytest/unittest.py +++ b/src/_pytest/unittest.py @@ -27,7 +27,7 @@ from _pytest.outcomes import xfail from _pytest.python import Class from _pytest.python import Function -from _pytest.python import PyCollector +from _pytest.python import Module from _pytest.runner import CallInfo from _pytest.scope import Scope @@ -42,7 +42,7 @@ def pytest_pycollect_makeitem( - collector: PyCollector, name: str, obj: object + collector: Union[Module, Class], name: str, obj: object ) -> Optional["UnitTestCase"]: # Has unittest been imported and is obj a subclass of its TestCase? try: From ee93557ef33c03d7a792af1921806b54fe7c7a89 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 7 Dec 2021 22:18:01 +0200 Subject: [PATCH 018/549] Remove `PytestRemovedIn7Warning` Fix #8838. --- changelog/8838.breaking.rst | 15 +++++++++++++++ src/_pytest/warning_types.py | 7 ------- src/_pytest/warnings.py | 2 -- src/pytest/__init__.py | 2 -- testing/test_warnings.py | 7 ++++--- 5 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 changelog/8838.breaking.rst diff --git a/changelog/8838.breaking.rst b/changelog/8838.breaking.rst new file mode 100644 index 00000000000..f5c1fead874 --- /dev/null +++ b/changelog/8838.breaking.rst @@ -0,0 +1,15 @@ +As per our policy, the following features have been deprecated in the 6.X series and are now +removed: + +* ``pytest._fillfuncargs`` function. + +* ``pytest_warning_captured`` hook - use ``pytest_warning_recorded`` instead. + +* ``-k -foobar`` syntax - use ``-k 'not foobar'`` instead. + +* ``-k foobar:`` syntax. + +* ``pytest.collect`` module - import from ``pytest`` directly. + +For more information consult +`Deprecations and Removals `__ in the docs. diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index 2a97a319789..ac79bb53acc 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -48,13 +48,6 @@ class PytestDeprecationWarning(PytestWarning, DeprecationWarning): __module__ = "pytest" -@final -class PytestRemovedIn7Warning(PytestDeprecationWarning): - """Warning class for features that will be removed in pytest 7.""" - - __module__ = "pytest" - - @final class PytestRemovedIn8Warning(PytestDeprecationWarning): """Warning class for features that will be removed in pytest 8.""" diff --git a/src/_pytest/warnings.py b/src/_pytest/warnings.py index d5afbfeb64c..154283632cf 100644 --- a/src/_pytest/warnings.py +++ b/src/_pytest/warnings.py @@ -49,8 +49,6 @@ def catch_warnings_for_item( warnings.filterwarnings("always", category=DeprecationWarning) warnings.filterwarnings("always", category=PendingDeprecationWarning) - warnings.filterwarnings("error", category=pytest.PytestRemovedIn7Warning) - apply_warning_filters(config_filters, cmdline_filters) # apply filters from "filterwarnings" marks diff --git a/src/pytest/__init__.py b/src/pytest/__init__.py index beb8eba03a2..9c284ac9615 100644 --- a/src/pytest/__init__.py +++ b/src/pytest/__init__.py @@ -66,7 +66,6 @@ from _pytest.warning_types import PytestConfigWarning from _pytest.warning_types import PytestDeprecationWarning from _pytest.warning_types import PytestExperimentalApiWarning -from _pytest.warning_types import PytestRemovedIn7Warning from _pytest.warning_types import PytestRemovedIn8Warning from _pytest.warning_types import PytestUnhandledCoroutineWarning from _pytest.warning_types import PytestUnhandledThreadExceptionWarning @@ -125,7 +124,6 @@ "PytestConfigWarning", "PytestDeprecationWarning", "PytestExperimentalApiWarning", - "PytestRemovedIn7Warning", "PytestRemovedIn8Warning", "Pytester", "PytestPluginManager", diff --git a/testing/test_warnings.py b/testing/test_warnings.py index 45acb720d1d..3ae9ea33181 100644 --- a/testing/test_warnings.py +++ b/testing/test_warnings.py @@ -517,6 +517,7 @@ def test_hidden_by_system(self, pytester: Pytester, monkeypatch) -> None: assert WARNINGS_SUMMARY_HEADER not in result.stdout.str() +@pytest.mark.skip("not relevant until pytest 8.0") @pytest.mark.parametrize("change_default", [None, "ini", "cmdline"]) def test_removed_in_x_warning_as_error(pytester: Pytester, change_default) -> None: """This ensures that PytestRemovedInXWarnings raised by pytest are turned into errors. @@ -528,7 +529,7 @@ def test_removed_in_x_warning_as_error(pytester: Pytester, change_default) -> No """ import warnings, pytest def test(): - warnings.warn(pytest.PytestRemovedIn7Warning("some warning")) + warnings.warn(pytest.PytestRemovedIn8Warning("some warning")) """ ) if change_default == "ini": @@ -536,12 +537,12 @@ def test(): """ [pytest] filterwarnings = - ignore::pytest.PytestRemovedIn7Warning + ignore::pytest.PytestRemovedIn8Warning """ ) args = ( - ("-Wignore::pytest.PytestRemovedIn7Warning",) + ("-Wignore::pytest.PytestRemovedIn8Warning",) if change_default == "cmdline" else () ) From c85b14391d9be2afd5f19b10ecd6b84eec9dba3d Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 12 Dec 2021 00:47:26 +0200 Subject: [PATCH 019/549] ci: add a workflow for backporting to other branches To backport a PR, e.g. 1000, to another branch, e.g. `7.0.x`, add a label `backport 7.0.x` to the PR. This will trigger a workflow which will create a branch `backport-1000-to-7.0.x` based on the `7.0.x` branch with a cherry-pick of the PR's merge commit, and create a new PR for it against the `7.0.x` branch. It is very simplistic, for instance it doesn't handle cherry-pick failure gracefully, doesn't validate the state of the PR, doesn't check if the branch already exists, etc. But we can improve on it later as needed. Finally, PRs created by github actions do not themselves trigger further actions, i.e. the PR isn't checked. You need to close & reopen the PR for the checks to trigger. There are workarounds for this but they are either less secure or require more setup. --- .github/workflows/backport.yml | 45 ++++++++++++++++++++++++++++++++++ CONTRIBUTING.rst | 7 ++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/backport.yml diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml new file mode 100644 index 00000000000..c1a0554199f --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,45 @@ +name: backport + +on: + pull_request: + types: [labeled] + +# Set permissions at the job level. +permissions: {} + +jobs: + backport: + if: ${{ startsWith(github.event.label.name, 'backport ') }} + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + persist-credentials: true + + - name: Create backport PR + run: | + set -eux + + git config --global user.name "pytest bot" + git config --global user.email "pytestbot@gmail.com" + + label='${{ github.event.label.name }}' + target_branch="${label#backport }" + backport_branch=backport-${{ github.event.number }}-to-"${target_branch}" + subject="[$target_branch] $(gh pr view --json title -q .title ${{ github.event.number }})" + + git checkout origin/"${target_branch}" -b "${backport_branch}" + git cherry-pick -x --mainline 1 ${{ github.event.pull_request.merge_commit_sha }} + git commit --amend --message "$subject" + git push --set-upstream origin --force-with-lease "${backport_branch}" + gh pr create \ + --base "${target_branch}" \ + --title "${subject}" \ + --body "Backport of PR #${{ github.event.number }} to $target_branch branch. PR created by backport workflow." + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 24bca723c8b..e72cbfe2401 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -391,6 +391,13 @@ actual latest release). The procedure for this is: request, as described above. An exception to this is if the bug fix is not applicable to ``main`` anymore. +Automatic method: + +Add a ``backport 1.2.x`` label to the PR you want to backport. This will create +a backport PR against the ``1.2.x`` branch. + +Manual method: + #. ``git checkout origin/1.2.x -b backport-XXXX`` # use the main PR number here #. Locate the merge commit on the PR, in the *merged* message, for example: From 99a8be200a3b67f40d2620c309ac14cf28ad5516 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 12 Dec 2021 00:12:01 +0000 Subject: [PATCH 020/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 136 +++++++++++++++++++++---------- 1 file changed, 92 insertions(+), 44 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index ebf40091369..8760860f9a6 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 963 plugins. +This list contains 969 plugins. .. only:: not latex @@ -29,6 +29,7 @@ This list contains 963 plugins. :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A :pypi:`pytest-aiohttp` pytest plugin for aiohttp support Dec 05, 2017 N/A pytest :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Nov 01, 2020 N/A pytest (>=6) + :pypi:`pytest-aiomoto` pytest-aiomoto Dec 10, 2021 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) @@ -151,7 +152,7 @@ This list contains 963 plugins. :pypi:`pytest-cloud` Distributed tests planner plugin for pytest testing framework. Oct 05, 2020 6 - Mature N/A :pypi:`pytest-cloudflare-worker` pytest plugin for testing cloudflare workers Mar 30, 2021 4 - Beta pytest (>=6.0.0) :pypi:`pytest-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) - :pypi:`pytest-codeblocks` Test code blocks in your READMEs Oct 13, 2021 4 - Beta pytest (>=6) + :pypi:`pytest-codeblocks` Test code blocks in your READMEs Dec 11, 2021 4 - Beta pytest (>=6) :pypi:`pytest-codecheckers` pytest plugin to add source code sanity checks (pep8 and friends) Feb 13, 2010 N/A N/A :pypi:`pytest-codecov` Pytest plugin for uploading pytest-cov results to codecov.io Oct 27, 2021 4 - Beta pytest (>=4.6.0) :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A @@ -177,7 +178,7 @@ This list contains 963 plugins. :pypi:`pytest-coverage` Jun 17, 2015 N/A N/A :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' - :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Dec 03, 2021 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) + :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Dec 06, 2021 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest @@ -227,7 +228,7 @@ This list contains 963 plugins. :pypi:`pytest-disable` pytest plugin to disable a test and skip it from testrun Sep 10, 2015 4 - Beta N/A :pypi:`pytest-disable-plugin` Disable plugins per test Feb 28, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. Mar 20, 2021 3 - Alpha pytest (!=6.0.0,<7,>=3.3.2) - :pypi:`pytest-django` A Django plugin for pytest. Dec 02, 2021 5 - Production/Stable pytest (>=5.4.0) + :pypi:`pytest-django` A Django plugin for pytest. Dec 07, 2021 5 - Production/Stable pytest (>=5.4.0) :pypi:`pytest-django-ahead` A Django plugin for pytest. Oct 27, 2016 5 - Production/Stable pytest (>=2.9) :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Aug 04, 2021 4 - Beta N/A :pypi:`pytest-django-cache-xdist` A djangocachexdist plugin for pytest May 12, 2020 4 - Beta N/A @@ -265,7 +266,7 @@ This list contains 963 plugins. :pypi:`pytest-doctest-custom` A py.test plugin for customizing string representations of doctest results. Jul 25, 2016 4 - Beta N/A :pypi:`pytest-doctest-ellipsis-markers` Setup additional values for ELLIPSIS_MARKER for doctests Jan 12, 2018 4 - Beta N/A :pypi:`pytest-doctest-import` A simple pytest plugin to import names and add them to the doctest namespace. Nov 13, 2018 4 - Beta pytest (>=3.3.0) - :pypi:`pytest-doctestplus` Pytest plugin with advanced doctest features. Nov 16, 2021 3 - Alpha pytest (>=4.6) + :pypi:`pytest-doctestplus` Pytest plugin with advanced doctest features. Dec 09, 2021 3 - Alpha pytest (>=4.6) :pypi:`pytest-doctest-ufunc` A plugin to run doctests in docstrings of Numpy ufuncs Aug 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-dolphin` Some extra stuff that we use ininternally Nov 30, 2016 4 - Beta pytest (==3.0.4) :pypi:`pytest-doorstop` A pytest plugin for adding test results into doorstop items. Jun 09, 2020 4 - Beta pytest (>=3.5.0) @@ -273,7 +274,7 @@ This list contains 963 plugins. :pypi:`pytest-drf` A Django REST framework plugin for pytest. Nov 12, 2020 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-drivings` Tool to allow webdriver automation to be ran locally or remotely Jan 13, 2021 N/A N/A :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection May 23, 2020 4 - Beta pytest (>=2.7) - :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Oct 13, 2021 5 - Production/Stable pytest + :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 10, 2021 5 - Production/Stable pytest :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A :pypi:`pytest-duration-insights` Jun 25, 2021 N/A N/A :pypi:`pytest-dynamicrerun` A pytest plugin to rerun tests dynamically based off of test outcome and output. Aug 15, 2020 4 - Beta N/A @@ -332,6 +333,7 @@ This list contains 963 plugins. :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Dec 11, 2020 4 - Beta pytest (>=5.0) :pypi:`pytest-failed-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A :pypi:`pytest-failed-to-verify` A pytest plugin that helps better distinguishing real test failures from setup flakiness. Aug 08, 2019 5 - Production/Stable pytest (>=4.1.0) + :pypi:`pytest-fail-slow` Fail tests that take too long to run Dec 10, 2021 4 - Beta pytest (>=6.0) :pypi:`pytest-faker` Faker integration with the pytest framework. Dec 19, 2016 6 - Mature N/A :pypi:`pytest-falcon` Pytest helpers for Falcon. Sep 07, 2016 4 - Beta N/A :pypi:`pytest-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A @@ -372,7 +374,7 @@ This list contains 963 plugins. :pypi:`pytest-forward-compatibility` A pytest plugin to shim pytest commandline options for fowards compatibility Sep 29, 2020 N/A N/A :pypi:`pytest-freezegun` Wrap tests with fixtures in freeze_time Jul 19, 2020 4 - Beta pytest (>=3.0.0) :pypi:`pytest-freeze-reqs` Check if requirement files are frozen Apr 29, 2021 N/A N/A - :pypi:`pytest-frozen-uuids` Deterministically frozen UUID's for your tests Oct 19, 2021 N/A pytest (>=3.0) + :pypi:`pytest-frozen-uuids` Deterministically frozen UUID's for your tests Dec 08, 2021 N/A pytest (>=3.0) :pypi:`pytest-func-cov` Pytest plugin for measuring function coverage Apr 15, 2021 3 - Alpha pytest (>=5) :pypi:`pytest-funparam` An alternative way to parametrize test cases. Dec 02, 2021 4 - Beta pytest >=4.6.0 :pypi:`pytest-fxa` pytest plugin for Firefox Accounts Aug 28, 2018 5 - Production/Stable N/A @@ -387,7 +389,7 @@ This list contains 963 plugins. :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest :pypi:`pytest-github` Plugin for py.test that associates tests with github issues using a marker. Mar 07, 2019 5 - Production/Stable N/A - :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Oct 24, 2021 N/A pytest (>=4.0.0) + :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Dec 08, 2021 N/A pytest (>=4.0.0) :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Nov 26, 2021 4 - Beta pytest :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest @@ -407,7 +409,7 @@ This list contains 963 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Nov 20, 2021 3 - Alpha pytest (==6.2.5) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Dec 10, 2021 3 - Alpha pytest (==6.2.5) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jul 12, 2021 N/A pytest (>=5.0) :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Aug 29, 2021 4 - Beta N/A @@ -444,6 +446,7 @@ This list contains 963 plugins. :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Apr 07, 2021 N/A pytest (>=6.0.2,<7.0.0) :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) + :pypi:`pytest-instant` Fast-forward asyncio time (in tests) Dec 05, 2021 N/A N/A :pypi:`pytest-instrument` pytest plugin to instrument tests Apr 05, 2020 5 - Production/Stable pytest (>=5.1.0) :pypi:`pytest-integration` Organizing pytests by integration or not Apr 16, 2020 N/A N/A :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) @@ -454,12 +457,13 @@ This list contains 963 plugins. :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A :pypi:`pytest-isort` py.test plugin to check import ordering using isort Apr 27, 2021 5 - Production/Stable N/A + :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. Dec 06, 2021 5 - Production/Stable pytest :pypi:`pytest-it` Pytest plugin to display test reports as a plaintext spec, inspired by Rspec: https://github.com/mattduck/pytest-it. Jan 22, 2020 4 - Beta N/A :pypi:`pytest-iterassert` Nicer list and iterable assertion messages for pytest May 11, 2020 3 - Alpha N/A :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Dec 02, 2021 3 - Alpha N/A - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Nov 28, 2021 3 - Alpha pytest + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Dec 10, 2021 3 - Alpha pytest :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A @@ -509,7 +513,7 @@ This list contains 963 plugins. :pypi:`pytest-markfiltration` UNKNOWN Nov 08, 2011 3 - Alpha N/A :pypi:`pytest-mark-no-py3` pytest plugin and bowler codemod to help migrate tests to Python 3 May 17, 2019 N/A pytest :pypi:`pytest-marks` UNKNOWN Nov 23, 2012 3 - Alpha N/A - :pypi:`pytest-matcher` Match test output against patterns stored in files Apr 23, 2020 5 - Production/Stable pytest (>=3.4) + :pypi:`pytest-matcher` Match test output against patterns stored in files Dec 10, 2021 5 - Production/Stable N/A :pypi:`pytest-match-skip` Skip matching marks. Matches partial marks using wildcards. May 15, 2019 4 - Beta pytest (>=4.4.1) :pypi:`pytest-mat-report` this is report Jan 20, 2021 N/A N/A :pypi:`pytest-matrix` Provide tools for generating tests from combinations of fixtures. Jun 24, 2020 5 - Production/Stable pytest (>=5.4.3,<6.0.0) @@ -592,7 +596,7 @@ This list contains 963 plugins. :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Nov 04, 2021 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Oct 26, 2021 N/A N/A + :pypi:`pytest-operator` Fixtures for Operators Dec 06, 2021 N/A N/A :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -621,7 +625,8 @@ This list contains 963 plugins. :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) :pypi:`pytest-perf` pytest-perf Jun 27, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) - :pypi:`pytest-persistence` Pytest tool for persistent objects Nov 06, 2021 N/A N/A + :pypi:`pytest-persistence` Pytest tool for persistent objects Dec 07, 2021 N/A N/A + :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Dec 10, 2021 5 - Production/Stable pytest :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Nov 10, 2021 4 - Beta pytest (>=6.2) ; extra == 'test' :pypi:`pytest-picked` Run the tests related to the changed files Dec 23, 2020 N/A pytest (>=3.5.0) @@ -657,6 +662,7 @@ This list contains 963 plugins. :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Nov 24, 2021 N/A pytest (>=3.4.1) :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Jun 17, 2021 5 - Production/Stable pytest (>=6) + :pypi:`pytest-profiles` pytest plugin for configuration profiles Dec 09, 2021 4 - Beta pytest (>=3.7.0) :pypi:`pytest-profiling` Profiling plugin for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-progress` pytest plugin for instant test progress status Nov 09, 2021 5 - Production/Stable pytest (>=2.7) :pypi:`pytest-prometheus` Report test pass / failures to a Prometheus PushGateway Oct 03, 2017 N/A N/A @@ -683,7 +689,7 @@ This list contains 963 plugins. :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Jun 26, 2021 4 - Beta pytest (>=6.2.0) - :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Nov 25, 2021 5 - Production/Stable pytest (>=6.2.3) + :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Dec 07, 2021 5 - Production/Stable pytest (>=6.2.3) :pypi:`pytest-qml` Run QML Tests with pytest Dec 02, 2020 4 - Beta pytest (>=6.0.0) :pypi:`pytest-qr` pytest plugin to generate test result QR codes Nov 25, 2021 4 - Beta N/A :pypi:`pytest-qt` pytest support for PyQt and PySide applications Jun 13, 2021 5 - Production/Stable pytest (>=3.0.0) @@ -706,7 +712,7 @@ This list contains 963 plugins. :pypi:`pytest-reana` Pytest fixtures for REANA. Nov 22, 2021 3 - Alpha N/A :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jul 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A - :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Nov 03, 2021 5 - Production/Stable pytest + :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Dec 07, 2021 5 - Production/Stable pytest :pypi:`pytest-redislite` Pytest plugin for testing code using Redis Sep 19, 2021 4 - Beta pytest :pypi:`pytest-redmine` Pytest plugin for redmine Mar 19, 2018 1 - Planning N/A :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) @@ -766,13 +772,13 @@ This list contains 963 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Dec 03, 2021 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Dec 11, 2021 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Aug 31, 2020 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Dec 03, 2021 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Dec 11, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Nov 26, 2020 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -823,7 +829,7 @@ This list contains 963 plugins. :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Nov 29, 2021 N/A pytest (>5.4.0,<6.3) - :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Oct 07, 2021 N/A N/A + :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Dec 06, 2021 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Mar 13, 2018 3 - Alpha N/A @@ -865,9 +871,9 @@ This list contains 963 plugins. :pypi:`pytest-testbook` A plugin to run tests written in Jupyter notebook Dec 11, 2016 3 - Alpha N/A :pypi:`pytest-testconfig` Test configuration plugin for pytest. Jan 11, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testdirectory` A py.test plugin providing temporary directories in unit tests. Nov 06, 2018 5 - Production/Stable pytest - :pypi:`pytest-testdox` A testdox format reporter for pytest Oct 13, 2020 5 - Production/Stable pytest (>=3.7.0) + :pypi:`pytest-testdox` A testdox format reporter for pytest Dec 05, 2021 5 - Production/Stable pytest (>=4.6.0) :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A - :pypi:`pytest-testinfra` Test infrastructures Jun 20, 2021 5 - Production/Stable pytest (!=3.0.2) + :pypi:`pytest-testinfra` Test infrastructures Dec 07, 2021 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) :pypi:`pytest-testmon` selects tests affected by changed files and methods Oct 22, 2021 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) @@ -957,7 +963,7 @@ This list contains 963 plugins. :pypi:`pytest-winnotify` Windows tray notifications for py.test results. Apr 22, 2016 N/A N/A :pypi:`pytest-with-docker` pytest with docker helpers. Nov 09, 2021 N/A pytest :pypi:`pytest-workflow` A pytest plugin for configuring workflow/pipeline tests using YAML files Dec 03, 2021 5 - Production/Stable pytest (>=5.4.0) - :pypi:`pytest-xdist` pytest xdist plugin for distributed testing and loop-on-failing modes Sep 21, 2021 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-xdist` pytest xdist plugin for distributed testing and loop-on-failing modes Dec 10, 2021 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-xdist-debug-for-graingert` pytest xdist plugin for distributed testing and loop-on-failing modes Jul 24, 2019 5 - Production/Stable pytest (>=4.4.0) :pypi:`pytest-xdist-forked` forked from pytest-xdist Feb 10, 2020 5 - Production/Stable pytest (>=4.4.0) :pypi:`pytest-xdist-tracker` pytest plugin helps to reproduce failures for particular xdist node Nov 18, 2021 3 - Alpha pytest (>=3.5.1) @@ -1063,6 +1069,13 @@ This list contains 963 plugins. Pytest \`client\` fixture for the Aiohttp + :pypi:`pytest-aiomoto` + *last release*: Dec 10, 2021, + *status*: N/A, + *requires*: pytest (>=6.2.5,<7.0.0) + + pytest-aiomoto + :pypi:`pytest-aioresponses` *last release*: Jul 29, 2021, *status*: 4 - Beta, @@ -1918,7 +1931,7 @@ This list contains 963 plugins. PyTest plugin for testing Smart Contracts for Ethereum blockchain. :pypi:`pytest-codeblocks` - *last release*: Oct 13, 2021, + *last release*: Dec 11, 2021, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -2100,7 +2113,7 @@ This list contains 963 plugins. Pytest plugin for excluding tests based on coverage data :pypi:`pytest-cpp` - *last release*: Dec 03, 2021, + *last release*: Dec 06, 2021, *status*: 5 - Production/Stable, *requires*: pytest (!=5.4.0,!=5.4.1) @@ -2450,7 +2463,7 @@ This list contains 963 plugins. A pytest plugin to notify test results to a Discord channel. :pypi:`pytest-django` - *last release*: Dec 02, 2021, + *last release*: Dec 07, 2021, *status*: 5 - Production/Stable, *requires*: pytest (>=5.4.0) @@ -2716,7 +2729,7 @@ This list contains 963 plugins. A simple pytest plugin to import names and add them to the doctest namespace. :pypi:`pytest-doctestplus` - *last release*: Nov 16, 2021, + *last release*: Dec 09, 2021, *status*: 3 - Alpha, *requires*: pytest (>=4.6) @@ -2772,7 +2785,7 @@ This list contains 963 plugins. A Pytest plugin to drop duplicated tests during collection :pypi:`pytest-dummynet` - *last release*: Oct 13, 2021, + *last release*: Dec 10, 2021, *status*: 5 - Production/Stable, *requires*: pytest @@ -3184,6 +3197,13 @@ This list contains 963 plugins. A pytest plugin that helps better distinguishing real test failures from setup flakiness. + :pypi:`pytest-fail-slow` + *last release*: Dec 10, 2021, + *status*: 4 - Beta, + *requires*: pytest (>=6.0) + + Fail tests that take too long to run + :pypi:`pytest-faker` *last release*: Dec 19, 2016, *status*: 6 - Mature, @@ -3465,7 +3485,7 @@ This list contains 963 plugins. Check if requirement files are frozen :pypi:`pytest-frozen-uuids` - *last release*: Oct 19, 2021, + *last release*: Dec 08, 2021, *status*: N/A, *requires*: pytest (>=3.0) @@ -3570,7 +3590,7 @@ This list contains 963 plugins. Plugin for py.test that associates tests with github issues using a marker. :pypi:`pytest-github-actions-annotate-failures` - *last release*: Oct 24, 2021, + *last release*: Dec 08, 2021, *status*: N/A, *requires*: pytest (>=4.0.0) @@ -3710,7 +3730,7 @@ This list contains 963 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Nov 20, 2021, + *last release*: Dec 10, 2021, *status*: 3 - Alpha, *requires*: pytest (==6.2.5) @@ -3968,6 +3988,13 @@ This list contains 963 plugins. pytest plugin to show failures instantly + :pypi:`pytest-instant` + *last release*: Dec 05, 2021, + *status*: N/A, + *requires*: N/A + + Fast-forward asyncio time (in tests) + :pypi:`pytest-instrument` *last release*: Apr 05, 2020, *status*: 5 - Production/Stable, @@ -4038,6 +4065,13 @@ This list contains 963 plugins. py.test plugin to check import ordering using isort + :pypi:`pytest-is-running` + *last release*: Dec 06, 2021, + *status*: 5 - Production/Stable, + *requires*: pytest + + pytest plugin providing a function to check if pytest is running. + :pypi:`pytest-it` *last release*: Jan 22, 2020, *status*: 4 - Beta, @@ -4074,7 +4108,7 @@ This list contains 963 plugins. py.test JIRA integration plugin, using markers :pypi:`pytest-jira-xray` - *last release*: Nov 28, 2021, + *last release*: Dec 10, 2021, *status*: 3 - Alpha, *requires*: pytest @@ -4424,9 +4458,9 @@ This list contains 963 plugins. UNKNOWN :pypi:`pytest-matcher` - *last release*: Apr 23, 2020, + *last release*: Dec 10, 2021, *status*: 5 - Production/Stable, - *requires*: pytest (>=3.4) + *requires*: N/A Match test output against patterns stored in files @@ -5005,7 +5039,7 @@ This list contains 963 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: Oct 26, 2021, + *last release*: Dec 06, 2021, *status*: N/A, *requires*: N/A @@ -5208,12 +5242,19 @@ This list contains 963 plugins. A simple plugin to ensure the execution of critical sections of code has not been impacted :pypi:`pytest-persistence` - *last release*: Nov 06, 2021, + *last release*: Dec 07, 2021, *status*: N/A, *requires*: N/A Pytest tool for persistent objects + :pypi:`pytest-pg` + *last release*: Dec 10, 2021, + *status*: 5 - Production/Stable, + *requires*: pytest + + Helps to run PostgreSQL in docker as pytest fixture + :pypi:`pytest-pgsql` *last release*: May 13, 2020, *status*: 5 - Production/Stable, @@ -5459,6 +5500,13 @@ This list contains 963 plugins. pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) + :pypi:`pytest-profiles` + *last release*: Dec 09, 2021, + *status*: 4 - Beta, + *requires*: pytest (>=3.7.0) + + pytest plugin for configuration profiles + :pypi:`pytest-profiling` *last release*: May 28, 2019, *status*: 5 - Production/Stable, @@ -5642,7 +5690,7 @@ This list contains 963 plugins. Pytest plugin for uploading test results to your QA Touch Testrun. :pypi:`pytest-qgis` - *last release*: Nov 25, 2021, + *last release*: Dec 07, 2021, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2.3) @@ -5803,7 +5851,7 @@ This list contains 963 plugins. Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal :pypi:`pytest-redis` - *last release*: Nov 03, 2021, + *last release*: Dec 07, 2021, *status*: 5 - Production/Stable, *requires*: pytest @@ -6223,7 +6271,7 @@ This list contains 963 plugins. :pypi:`pytest-sbase` - *last release*: Dec 03, 2021, + *last release*: Dec 11, 2021, *status*: 5 - Production/Stable, *requires*: N/A @@ -6265,7 +6313,7 @@ This list contains 963 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Dec 03, 2021, + *last release*: Dec 11, 2021, *status*: 5 - Production/Stable, *requires*: N/A @@ -6622,7 +6670,7 @@ This list contains 963 plugins. A Dynamic test tool for Splunk Apps and Add-ons :pypi:`pytest-splunk-addon-ui-smartx` - *last release*: Oct 07, 2021, + *last release*: Dec 06, 2021, *status*: N/A, *requires*: N/A @@ -6916,9 +6964,9 @@ This list contains 963 plugins. A py.test plugin providing temporary directories in unit tests. :pypi:`pytest-testdox` - *last release*: Oct 13, 2020, + *last release*: Dec 05, 2021, *status*: 5 - Production/Stable, - *requires*: pytest (>=3.7.0) + *requires*: pytest (>=4.6.0) A testdox format reporter for pytest @@ -6930,7 +6978,7 @@ This list contains 963 plugins. A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. :pypi:`pytest-testinfra` - *last release*: Jun 20, 2021, + *last release*: Dec 07, 2021, *status*: 5 - Production/Stable, *requires*: pytest (!=3.0.2) @@ -7560,9 +7608,9 @@ This list contains 963 plugins. A pytest plugin for configuring workflow/pipeline tests using YAML files :pypi:`pytest-xdist` - *last release*: Sep 21, 2021, + *last release*: Dec 10, 2021, *status*: 5 - Production/Stable, - *requires*: pytest (>=6.0.0) + *requires*: pytest (>=6.2.0) pytest xdist plugin for distributed testing and loop-on-failing modes From 897395afd584b54394ab0b747ff03c80da07871d Mon Sep 17 00:00:00 2001 From: Yuval Shimon Date: Sun, 12 Dec 2021 14:38:45 +0200 Subject: [PATCH 021/549] fix 9326 --- changelog/9326.bugfix.rst | 1 + src/_pytest/assertion/util.py | 23 ++++++++++++++++- ...test_compare_dataclasses_with_custom_eq.py | 17 +++++++++++++ testing/test_assertion.py | 25 ++++++++++++++++++- 4 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 changelog/9326.bugfix.rst create mode 100644 testing/example_scripts/dataclasses/test_compare_dataclasses_with_custom_eq.py diff --git a/changelog/9326.bugfix.rst b/changelog/9326.bugfix.rst new file mode 100644 index 00000000000..1aaa424d371 --- /dev/null +++ b/changelog/9326.bugfix.rst @@ -0,0 +1 @@ +Pytest will now avoid specialized assert formatting when it is detected that the default __eq__ is overridden diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index 19f1089c20a..ed5b01d1d53 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -135,6 +135,26 @@ def isiterable(obj: Any) -> bool: return False +def has_default_eq( + obj: object, +) -> bool: + """Check if an instance of an object contains the default eq + + First, we check if the object's __eq__ attribute has __code__, if so, we check the equally of the method code filename (__code__.co_filename) + to the default onces generated by the dataclass and attr module + for dataclasses the default co_filename is , for attrs class, the __eq__ should contain "attrs eq generated" + """ + # inspired from https://github.com/willmcgugan/rich/blob/07d51ffc1aee6f16bd2e5a25b4e82850fb9ed778/rich/pretty.py#L68 + if not hasattr(obj.__eq__, "__code__"): # the obj does not have a code attribute + return True + + code_filename = obj.__eq__.__code__.co_filename + if isattrs(obj): + return "attrs eq generated" in code_filename + if isdatacls(obj): + return code_filename == "" + + def assertrepr_compare(config, op: str, left: Any, right: Any) -> Optional[List[str]]: """Return specialised explanations for some operators/operands.""" verbose = config.getoption("verbose") @@ -427,6 +447,8 @@ def _compare_eq_dict( def _compare_eq_cls(left: Any, right: Any, verbose: int) -> List[str]: + if not has_default_eq(left): + return [] if isdatacls(left): all_fields = left.__dataclass_fields__ fields_to_check = [field for field, info in all_fields.items() if info.compare] @@ -437,7 +459,6 @@ def _compare_eq_cls(left: Any, right: Any, verbose: int) -> List[str]: fields_to_check = left._fields else: assert False - indent = " " same = [] diff = [] diff --git a/testing/example_scripts/dataclasses/test_compare_dataclasses_with_custom_eq.py b/testing/example_scripts/dataclasses/test_compare_dataclasses_with_custom_eq.py new file mode 100644 index 00000000000..e026fe3d192 --- /dev/null +++ b/testing/example_scripts/dataclasses/test_compare_dataclasses_with_custom_eq.py @@ -0,0 +1,17 @@ +from dataclasses import dataclass +from dataclasses import field + + +def test_dataclasses() -> None: + @dataclass + class SimpleDataObject: + field_a: int = field() + field_b: str = field() + + def __eq__(self, __o: object) -> bool: + return super().__eq__(__o) + + left = SimpleDataObject(1, "b") + right = SimpleDataObject(1, "c") + + assert left == right diff --git a/testing/test_assertion.py b/testing/test_assertion.py index e8717590d53..29320c54b64 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -899,6 +899,16 @@ def test_comparing_two_different_data_classes(self, pytester: Pytester) -> None: result = pytester.runpytest(p, "-vv") result.assert_outcomes(failed=0, passed=1) + @pytest.mark.skipif(sys.version_info < (3, 7), reason="Dataclasses in Python3.7+") + def test_data_classes_with_custom_eq(self, pytester: Pytester) -> None: + p = pytester.copy_example( + "dataclasses/test_compare_dataclasses_with_custom_eq.py" + ) + # issue 9362 + result = pytester.runpytest(p, "-vv") + result.assert_outcomes(failed=1, passed=0) + result.stdout.no_re_match_line(".*Differing attributes.*") + class TestAssert_reprcompare_attrsclass: def test_attrs(self) -> None: @@ -982,7 +992,6 @@ class SimpleDataObject: right = SimpleDataObject(1, "b") lines = callequal(left, right, verbose=2) - print(lines) assert lines is not None assert lines[2].startswith("Matching attributes:") assert "Omitting" not in lines[1] @@ -1007,6 +1016,20 @@ class SimpleDataObjectTwo: lines = callequal(left, right) assert lines is None + def test_attrs_with_custom_eq(self) -> None: + @attr.define + class SimpleDataObject: + field_a = attr.ib() + + def __eq__(self, other): + return self.field_a == other.field_a + + left = SimpleDataObject(1) + right = SimpleDataObject(2) + # issue 9362 + lines = callequal(left, right, verbose=2) + assert lines is None + class TestAssert_reprcompare_namedtuple: def test_namedtuple(self) -> None: From 31f42ef83fed3fef98ac17361aafa25f1397a266 Mon Sep 17 00:00:00 2001 From: Yuval Shimon Date: Sun, 12 Dec 2021 14:40:46 +0200 Subject: [PATCH 022/549] small fix --- src/_pytest/assertion/util.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index ed5b01d1d53..ecc1274a80e 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -151,8 +151,7 @@ def has_default_eq( code_filename = obj.__eq__.__code__.co_filename if isattrs(obj): return "attrs eq generated" in code_filename - if isdatacls(obj): - return code_filename == "" + return code_filename == "" # dataclass def assertrepr_compare(config, op: str, left: Any, right: Any) -> Optional[List[str]]: From a67c547536b0800c21a86224f62feab6a368ddcf Mon Sep 17 00:00:00 2001 From: Yuval Shimon Date: Sun, 12 Dec 2021 14:45:47 +0200 Subject: [PATCH 023/549] fixing tests --- src/_pytest/assertion/util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index ecc1274a80e..d852a34797c 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -149,9 +149,11 @@ def has_default_eq( return True code_filename = obj.__eq__.__code__.co_filename + if isattrs(obj): - return "attrs eq generated" in code_filename - return code_filename == "" # dataclass + return "attrs generated eq" in code_filename + + return code_filename == "" # data class def assertrepr_compare(config, op: str, left: Any, right: Any) -> Optional[List[str]]: From 8c3b17263b77af051511547b2d0963368a5c833c Mon Sep 17 00:00:00 2001 From: Yuval Shimon Date: Sun, 12 Dec 2021 14:47:00 +0200 Subject: [PATCH 024/549] removing unnecessary changes --- src/_pytest/assertion/util.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index d852a34797c..c0e4f4d20ac 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -460,6 +460,7 @@ def _compare_eq_cls(left: Any, right: Any, verbose: int) -> List[str]: fields_to_check = left._fields else: assert False + indent = " " same = [] diff = [] From 9166ff6cb52c64ed58b8ce0f32d05785a0e2ad96 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 12 Dec 2021 12:49:23 +0000 Subject: [PATCH 025/549] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytest/assertion/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index c0e4f4d20ac..618a93ecadd 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -460,7 +460,7 @@ def _compare_eq_cls(left: Any, right: Any, verbose: int) -> List[str]: fields_to_check = left._fields else: assert False - + indent = " " same = [] diff = [] From df74e5c532e5cc3f8d00adb65b3578f0ba5db7ee Mon Sep 17 00:00:00 2001 From: Yuval Shimon Date: Sun, 12 Dec 2021 14:53:29 +0200 Subject: [PATCH 026/549] fixing pre-commit --- src/_pytest/assertion/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index 618a93ecadd..860002f4d98 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -140,7 +140,8 @@ def has_default_eq( ) -> bool: """Check if an instance of an object contains the default eq - First, we check if the object's __eq__ attribute has __code__, if so, we check the equally of the method code filename (__code__.co_filename) + First, we check if the object's __eq__ attribute has __code__, + if so, we check the equally of the method code filename (__code__.co_filename) to the default onces generated by the dataclass and attr module for dataclasses the default co_filename is , for attrs class, the __eq__ should contain "attrs eq generated" """ From 2d7905b13be5eb83d9651117327aed02f004a445 Mon Sep 17 00:00:00 2001 From: Yuval Shimon Date: Sun, 12 Dec 2021 15:14:24 +0200 Subject: [PATCH 027/549] support pypy --- src/_pytest/assertion/util.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index 860002f4d98..c26ff90dc53 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -146,15 +146,14 @@ def has_default_eq( for dataclasses the default co_filename is , for attrs class, the __eq__ should contain "attrs eq generated" """ # inspired from https://github.com/willmcgugan/rich/blob/07d51ffc1aee6f16bd2e5a25b4e82850fb9ed778/rich/pretty.py#L68 - if not hasattr(obj.__eq__, "__code__"): # the obj does not have a code attribute - return True + if hasattr(obj.__eq__, "__code__") and hasattr(obj.__eq__.__code__, "co_filename"): + code_filename = obj.__eq__.__code__.co_filename - code_filename = obj.__eq__.__code__.co_filename + if isattrs(obj): + return "attrs generated eq" in code_filename - if isattrs(obj): - return "attrs generated eq" in code_filename - - return code_filename == "" # data class + return code_filename == "" # data class + return True def assertrepr_compare(config, op: str, left: Any, right: Any) -> Optional[List[str]]: From 0c45065040c87e1076e7c0bb1c079eb8f924c134 Mon Sep 17 00:00:00 2001 From: Yuval Shimon Date: Sun, 12 Dec 2021 15:39:30 +0200 Subject: [PATCH 028/549] removing coverage on eq method --- testing/test_assertion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/test_assertion.py b/testing/test_assertion.py index 29320c54b64..fe5a3d3bb2e 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -1021,8 +1021,8 @@ def test_attrs_with_custom_eq(self) -> None: class SimpleDataObject: field_a = attr.ib() - def __eq__(self, other): - return self.field_a == other.field_a + def __eq__(self, other): # pragma: no cover + return super().__eq__(other) left = SimpleDataObject(1) right = SimpleDataObject(2) From 0ea039db602c01ddc57eac40b1abd60704a7d00c Mon Sep 17 00:00:00 2001 From: Yuval Shimon Date: Sun, 12 Dec 2021 16:11:33 +0200 Subject: [PATCH 029/549] adding auto_detect=true test --- testing/test_assertion.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/testing/test_assertion.py b/testing/test_assertion.py index fe5a3d3bb2e..8a4525cb74a 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -1016,6 +1016,22 @@ class SimpleDataObjectTwo: lines = callequal(left, right) assert lines is None + def test_attrs_with_auto_detect_and_custom_eq(self) -> None: + @attr.s( + auto_detect=True + ) # attr.s doesn’t ignore a custom eq if auto_detect=True + class SimpleDataObject: + field_a = attr.ib() + + def __eq__(self, other): # pragma: no cover + return super().__eq__(other) + + left = SimpleDataObject(1) + right = SimpleDataObject(2) + # issue 9362 + lines = callequal(left, right, verbose=2) + assert lines is None + def test_attrs_with_custom_eq(self) -> None: @attr.define class SimpleDataObject: From 4d6e8a310b2e46051ed997ed8b8c44a59b065633 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 12 Dec 2021 14:26:36 +0000 Subject: [PATCH 030/549] build(deps): Bump django in /testing/plugins_integration Bumps [django](https://github.com/django/django) from 3.2.9 to 3.2.10. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/3.2.9...3.2.10) --- updated-dependencies: - dependency-name: django dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 90b253cc6d3..88fe6a3e3f4 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.4.0 -django==3.2.9 +django==3.2.10 pytest-asyncio==0.16.0 pytest-bdd==5.0.0 pytest-cov==3.0.0 From 0e69c62eced97d73caed88b9a12e0b7de4c0d8e0 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 8 Dec 2021 16:19:09 +0200 Subject: [PATCH 031/549] doc: add a `hook` crossref type Allow writing :hook:`pytest_cmdline_main` instead of :func:`pytest_cmdline_main <_pytest.hookspec.pytest_cmdline_main>` --- doc/en/changelog.rst | 34 ++++++++++++------------ doc/en/conf.py | 7 +++++ doc/en/deprecations.rst | 18 ++++++------- doc/en/reference/reference.rst | 47 ++++++++++++++++++++++++++++++++++ src/_pytest/hookspec.py | 16 ++++++------ src/_pytest/main.py | 3 +-- src/_pytest/python.py | 2 +- 7 files changed, 90 insertions(+), 37 deletions(-) diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 65b160d2bf6..c5ccc75e3af 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -156,7 +156,7 @@ Deprecations See :ref:`the deprecation note ` for full details. -- `#8592 `_: :func:`pytest_cmdline_preparse <_pytest.hookspec.pytest_cmdline_preparse>` has been officially deprecated. It will be removed in a future release. Use :func:`pytest_load_initial_conftests <_pytest.hookspec.pytest_load_initial_conftests>` instead. +- `#8592 `_: :hook:`pytest_cmdline_preparse` has been officially deprecated. It will be removed in a future release. Use :hook:`pytest_load_initial_conftests` instead. See :ref:`the deprecation note ` for full details. @@ -203,11 +203,11 @@ Features - ``pytest.Mark`` for :class:`marks `. - ``pytest.MarkDecorator`` for :class:`mark decorators `. - ``pytest.MarkGenerator`` for the :class:`pytest.mark ` singleton. - - ``pytest.Metafunc`` for the :class:`metafunc ` argument to the :func:`pytest_generate_tests ` hook. + - ``pytest.Metafunc`` for the :class:`metafunc ` argument to the :hook:`pytest_generate_tests` hook. - ``pytest.CallInfo`` for the :class:`CallInfo ` type passed to various hooks. - ``pytest.PytestPluginManager`` for :class:`PytestPluginManager `. - ``pytest.ExceptionInfo`` for the :class:`ExceptionInfo ` type returned from :func:`pytest.raises` and passed to various hooks. - - ``pytest.Parser`` for the :class:`Parser ` type passed to the :func:`pytest_addoption ` hook. + - ``pytest.Parser`` for the :class:`Parser ` type passed to the :hook:`pytest_addoption` hook. - ``pytest.OptionGroup`` for the :class:`OptionGroup ` type returned from the :func:`parser.addgroup ` method. - ``pytest.HookRecorder`` for the :class:`HookRecorder ` type returned from :class:`~pytest.Pytester`. - ``pytest.RecordedHookCall`` for the :class:`RecordedHookCall ` type returned from :class:`~pytest.HookRecorder`. @@ -228,11 +228,11 @@ Features - `#8144 `_: The following hooks now receive an additional ``pathlib.Path`` argument, equivalent to an existing ``py.path.local`` argument: - - :func:`pytest_ignore_collect <_pytest.hookspec.pytest_ignore_collect>` - The ``collection_path`` parameter (equivalent to existing ``path`` parameter). - - :func:`pytest_collect_file <_pytest.hookspec.pytest_collect_file>` - The ``file_path`` parameter (equivalent to existing ``path`` parameter). - - :func:`pytest_pycollect_makemodule <_pytest.hookspec.pytest_pycollect_makemodule>` - The ``module_path`` parameter (equivalent to existing ``path`` parameter). - - :func:`pytest_report_header <_pytest.hookspec.pytest_report_header>` - The ``start_path`` parameter (equivalent to existing ``startdir`` parameter). - - :func:`pytest_report_collectionfinish <_pytest.hookspec.pytest_report_collectionfinish>` - The ``start_path`` parameter (equivalent to existing ``startdir`` parameter). + - :hook:`pytest_ignore_collect` - The ``collection_path`` parameter (equivalent to existing ``path`` parameter). + - :hook:`pytest_collect_file` - The ``file_path`` parameter (equivalent to existing ``path`` parameter). + - :hook:`pytest_pycollect_makemodule` - The ``module_path`` parameter (equivalent to existing ``path`` parameter). + - :hook:`pytest_report_header` - The ``start_path`` parameter (equivalent to existing ``startdir`` parameter). + - :hook:`pytest_report_collectionfinish` - The ``start_path`` parameter (equivalent to existing ``startdir`` parameter). .. note:: The name of the :class:`~_pytest.nodes.Node` arguments and attributes (the @@ -491,7 +491,7 @@ Trivial/Internal Changes - `#8913 `_: The private ``CallSpec2._arg2scopenum`` attribute has been removed after an internal refactoring. -- `#8967 `_: :func:`pytest_assertion_pass <_pytest.hookspec.pytest_assertion_pass>` is no longer considered experimental and +- `#8967 `_: :hook:`pytest_assertion_pass` is no longer considered experimental and future changes to it will be considered more carefully. @@ -853,8 +853,8 @@ Deprecations if you use this and want a replacement. -- :issue:`7255`: The :func:`pytest_warning_captured <_pytest.hookspec.pytest_warning_captured>` hook is deprecated in favor - of :func:`pytest_warning_recorded <_pytest.hookspec.pytest_warning_recorded>`, and will be removed in a future version. +- :issue:`7255`: The :hook:`pytest_warning_captured` hook is deprecated in favor + of :hook:`pytest_warning_recorded`, and will be removed in a future version. - :issue:`7648`: The ``gethookproxy()`` and ``isinitpath()`` methods of ``FSCollector`` and ``Package`` are deprecated; @@ -962,7 +962,7 @@ Trivial/Internal Changes process, pytest now ignores builtin attributes (like ``__class__``, ``__delattr__`` and ``__new__``) without consulting the :confval:`python_classes` and :confval:`python_functions` configuration options and without passing them to plugins - using the :func:`pytest_pycollect_makeitem <_pytest.hookspec.pytest_pycollect_makeitem>` hook. + using the :hook:`pytest_pycollect_makeitem` hook. pytest 6.0.2 (2020-09-04) @@ -1751,7 +1751,7 @@ Bug Fixes - :issue:`6646`: Assertion rewriting hooks are (re)stored for the current item, which fixes them being still used after e.g. pytester's :func:`testdir.runpytest <_pytest.pytester.Testdir.runpytest>` etc. -- :issue:`6660`: :py:func:`pytest.exit` is handled when emitted from the :func:`pytest_sessionfinish <_pytest.hookspec.pytest_sessionfinish>` hook. This includes quitting from a debugger. +- :issue:`6660`: :py:func:`pytest.exit` is handled when emitted from the :hook:`pytest_sessionfinish` hook. This includes quitting from a debugger. - :issue:`6752`: When :py:func:`pytest.raises` is used as a function (as opposed to a context manager), @@ -1863,7 +1863,7 @@ Improvements - :issue:`6231`: Improve check for misspelling of :ref:`pytest.mark.parametrize ref`. -- :issue:`6257`: Handle :py:func:`pytest.exit` being used via :py:func:`~_pytest.hookspec.pytest_internalerror`, e.g. when quitting pdb from post mortem. +- :issue:`6257`: Handle :func:`pytest.exit` being used via :hook:`pytest_internalerror`, e.g. when quitting pdb from post mortem. @@ -2497,7 +2497,7 @@ Deprecations Features -------- -- :issue:`3457`: New :func:`~_pytest.hookspec.pytest_assertion_pass` +- :issue:`3457`: New :hook:`pytest_assertion_pass` hook, called with context information when an assertion *passes*. This hook is still **experimental** so use it with caution. @@ -5017,9 +5017,9 @@ Features - Console output falls back to "classic" mode when capturing is disabled (``-s``), otherwise the output gets garbled to the point of being useless. (:issue:`3038`) -- New :func:`~_pytest.hookspec.pytest_runtest_logfinish` +- New :hook:`pytest_runtest_logfinish` hook which is called when a test item has finished executing, analogous to - :func:`~_pytest.hookspec.pytest_runtest_logstart`. + :hook:`pytest_runtest_logstart`. (:issue:`3101`) - Improve performance when collecting tests using many fixtures. (:issue:`3107`) diff --git a/doc/en/conf.py b/doc/en/conf.py index bcf01aa4713..b316163532a 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -445,6 +445,13 @@ def setup(app: "sphinx.application.Sphinx") -> None: indextemplate="pair: %s; global variable interpreted by pytest", ) + app.add_crossref_type( + directivename="hook", + rolename="hook", + objname="pytest hook", + indextemplate="pair: %s; hook", + ) + configure_logging(app) # Make Sphinx mark classes with "final" when decorated with @final. diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index c748316cb73..6351d1f6e6a 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -81,11 +81,11 @@ no matter what argument was used in the constructor. We expect to deprecate the In order to support the transition from ``py.path.local`` to :mod:`pathlib`, the following hooks now receive additional arguments: -* :func:`pytest_ignore_collect(collection_path: pathlib.Path) <_pytest.hookspec.pytest_ignore_collect>` as equivalent to ``path`` -* :func:`pytest_collect_file(file_path: pathlib.Path) <_pytest.hookspec.pytest_collect_file>` as equivalent to ``path`` -* :func:`pytest_pycollect_makemodule(module_path: pathlib.Path) <_pytest.hookspec.pytest_pycollect_makemodule>` as equivalent to ``path`` -* :func:`pytest_report_header(start_path: pathlib.Path) <_pytest.hookspec.pytest_report_header>` as equivalent to ``startdir`` -* :func:`pytest_report_collectionfinish(start_path: pathlib.Path) <_pytest.hookspec.pytest_report_collectionfinish>` as equivalent to ``startdir`` +* :hook:`pytest_ignore_collect(collection_path: pathlib.Path) ` as equivalent to ``path`` +* :hook:`pytest_collect_file(file_path: pathlib.Path) ` as equivalent to ``path`` +* :hook:`pytest_pycollect_makemodule(module_path: pathlib.Path) ` as equivalent to ``path`` +* :hook:`pytest_report_header(start_path: pathlib.Path) ` as equivalent to ``startdir`` +* :hook:`pytest_report_collectionfinish(start_path: pathlib.Path) ` as equivalent to ``startdir`` The accompanying ``py.path.local`` based paths have been deprecated: plugins which manually invoke those hooks should only pass the new ``pathlib.Path`` arguments, and users should change their hook implementations to use the new ``pathlib.Path`` arguments. @@ -157,8 +157,8 @@ Implementing the ``pytest_cmdline_preparse`` hook .. deprecated:: 7.0 -Implementing the :func:`pytest_cmdline_preparse <_pytest.hookspec.pytest_cmdline_preparse>` hook has been officially deprecated. -Implement the :func:`pytest_load_initial_conftests <_pytest.hookspec.pytest_load_initial_conftests>` hook instead. +Implementing the :hook:`pytest_cmdline_preparse` hook has been officially deprecated. +Implement the :hook:`pytest_load_initial_conftests` hook instead. .. code-block:: python @@ -331,8 +331,8 @@ at some point, depending on the plans for the plugins and number of users using .. versionremoved:: 6.0 -The ``pytest_collect_directory`` has not worked properly for years (it was called -but the results were ignored). Users may consider using :func:`pytest_collection_modifyitems <_pytest.hookspec.pytest_collection_modifyitems>` instead. +The ``pytest_collect_directory`` hook has not worked properly for years (it was called +but the results were ignored). Users may consider using :hook:`pytest_collection_modifyitems` instead. TerminalReporter.writer ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index c132ae6d3dd..d4cbcbac08a 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -671,9 +671,13 @@ Bootstrapping hooks Bootstrapping hooks called for plugins registered early enough (internal and setuptools plugins). +.. hook:: pytest_load_initial_conftests .. autofunction:: pytest_load_initial_conftests +.. hook:: pytest_cmdline_preparse .. autofunction:: pytest_cmdline_preparse +.. hook:: pytest_cmdline_parse .. autofunction:: pytest_cmdline_parse +.. hook:: pytest_cmdline_main .. autofunction:: pytest_cmdline_main .. _`initialization-hooks`: @@ -683,13 +687,20 @@ Initialization hooks Initialization hooks called for plugins and ``conftest.py`` files. +.. hook:: pytest_addoption .. autofunction:: pytest_addoption +.. hook:: pytest_addhooks .. autofunction:: pytest_addhooks +.. hook:: pytest_configure .. autofunction:: pytest_configure +.. hook:: pytest_unconfigure .. autofunction:: pytest_unconfigure +.. hook:: pytest_sessionstart .. autofunction:: pytest_sessionstart +.. hook:: pytest_sessionfinish .. autofunction:: pytest_sessionfinish +.. hook:: pytest_plugin_registered .. autofunction:: pytest_plugin_registered Collection hooks @@ -697,21 +708,29 @@ Collection hooks ``pytest`` calls the following hooks for collecting files and directories: +.. hook:: pytest_collection .. autofunction:: pytest_collection +.. hook:: pytest_ignore_collect .. autofunction:: pytest_ignore_collect +.. hook:: pytest_collect_file .. autofunction:: pytest_collect_file +.. hook:: pytest_pycollect_makemodule .. autofunction:: pytest_pycollect_makemodule For influencing the collection of objects in Python modules you can use the following hook: +.. hook:: pytest_pycollect_makeitem .. autofunction:: pytest_pycollect_makeitem +.. hook:: pytest_generate_tests .. autofunction:: pytest_generate_tests +.. hook:: pytest_make_parametrize_id .. autofunction:: pytest_make_parametrize_id After collection is complete, you can modify the order of items, delete or otherwise amend the test items: +.. hook:: pytest_collection_modifyitems .. autofunction:: pytest_collection_modifyitems .. note:: @@ -725,13 +744,21 @@ Test running (runtest) hooks All runtest related hooks receive a :py:class:`pytest.Item ` object. +.. hook:: pytest_runtestloop .. autofunction:: pytest_runtestloop +.. hook:: pytest_runtest_protocol .. autofunction:: pytest_runtest_protocol +.. hook:: pytest_runtest_logstart .. autofunction:: pytest_runtest_logstart +.. hook:: pytest_runtest_logfinish .. autofunction:: pytest_runtest_logfinish +.. hook:: pytest_runtest_setup .. autofunction:: pytest_runtest_setup +.. hook:: pytest_runtest_call .. autofunction:: pytest_runtest_call +.. hook:: pytest_runtest_teardown .. autofunction:: pytest_runtest_teardown +.. hook:: pytest_runtest_makereport .. autofunction:: pytest_runtest_makereport For deeper understanding you may look at the default implementation of @@ -740,6 +767,7 @@ in ``_pytest.pdb`` which interacts with ``_pytest.capture`` and its input/output capturing in order to immediately drop into interactive debugging when a test failure occurs. +.. hook:: pytest_pyfunc_call .. autofunction:: pytest_pyfunc_call Reporting hooks @@ -747,26 +775,41 @@ Reporting hooks Session related reporting hooks: +.. hook:: pytest_collectstart .. autofunction:: pytest_collectstart +.. hook:: pytest_make_collect_report .. autofunction:: pytest_make_collect_report +.. hook:: pytest_itemcollected .. autofunction:: pytest_itemcollected +.. hook:: pytest_collectreport .. autofunction:: pytest_collectreport +.. hook:: pytest_deselected .. autofunction:: pytest_deselected +.. hook:: pytest_report_header .. autofunction:: pytest_report_header +.. hook:: pytest_report_collectionfinish .. autofunction:: pytest_report_collectionfinish +.. hook:: pytest_report_teststatus .. autofunction:: pytest_report_teststatus +.. hook:: pytest_terminal_summary .. autofunction:: pytest_terminal_summary +.. hook:: pytest_fixture_setup .. autofunction:: pytest_fixture_setup +.. hook:: pytest_fixture_post_finalizer .. autofunction:: pytest_fixture_post_finalizer +.. hook:: pytest_warning_recorded .. autofunction:: pytest_warning_recorded Central hook for reporting about test execution: +.. hook:: pytest_runtest_logreport .. autofunction:: pytest_runtest_logreport Assertion related hooks: +.. hook:: pytest_assertrepr_compare .. autofunction:: pytest_assertrepr_compare +.. hook:: pytest_assertion_pass .. autofunction:: pytest_assertion_pass @@ -776,9 +819,13 @@ Debugging/Interaction hooks There are few hooks which can be used for special reporting or interaction with exceptions: +.. hook:: pytest_internalerror .. autofunction:: pytest_internalerror +.. hook:: pytest_keyboard_interrupt .. autofunction:: pytest_keyboard_interrupt +.. hook:: pytest_exception_interact .. autofunction:: pytest_exception_interact +.. hook:: pytest_enter_pdb .. autofunction:: pytest_enter_pdb diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index bbb6f5e96c7..a03c0e9ab79 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -162,7 +162,7 @@ def pytest_cmdline_preparse(config: "Config", args: List[str]) -> None: """(**Deprecated**) modify command line arguments before option parsing. This hook is considered deprecated and will be removed in a future pytest version. Consider - using :func:`pytest_load_initial_conftests` instead. + using :hook:`pytest_load_initial_conftests` instead. .. note:: This hook will not be called for ``conftest.py`` files, only for setuptools plugins. @@ -466,7 +466,7 @@ def pytest_runtest_logstart( ) -> None: """Called at the start of running the runtest protocol for a single item. - See :func:`pytest_runtest_protocol` for a description of the runtest protocol. + See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. :param str nodeid: Full node ID of the item. :param location: A tuple of ``(filename, lineno, testname)``. @@ -478,7 +478,7 @@ def pytest_runtest_logfinish( ) -> None: """Called at the end of running the runtest protocol for a single item. - See :func:`pytest_runtest_protocol` for a description of the runtest protocol. + See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. :param str nodeid: Full node ID of the item. :param location: A tuple of ``(filename, lineno, testname)``. @@ -525,7 +525,7 @@ def pytest_runtest_makereport( """Called to create a :class:`~pytest.TestReport` for each of the setup, call and teardown runtest phases of a test item. - See :func:`pytest_runtest_protocol` for a description of the runtest protocol. + See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. :param call: The :class:`~pytest.CallInfo` for the phase. @@ -537,7 +537,7 @@ def pytest_runtest_logreport(report: "TestReport") -> None: """Process the :class:`~pytest.TestReport` produced for each of the setup, call and teardown runtest phases of an item. - See :func:`pytest_runtest_protocol` for a description of the runtest protocol. + See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. """ @@ -556,7 +556,7 @@ def pytest_report_from_serializable( data: Dict[str, Any], ) -> Optional[Union["CollectReport", "TestReport"]]: """Restore a report object previously serialized with - :func:`pytest_report_to_serializable`.""" + :hook:`pytest_report_to_serializable`.""" # ------------------------------------------------------------------------- @@ -859,10 +859,10 @@ def pytest_exception_interact( """Called when an exception was raised which can potentially be interactively handled. - May be called during collection (see :py:func:`pytest_make_collect_report`), + May be called during collection (see :hook:`pytest_make_collect_report`), in which case ``report`` is a :class:`CollectReport`. - May be called during runtest of an item (see :py:func:`pytest_runtest_protocol`), + May be called during runtest of an item (see :hook:`pytest_runtest_protocol`), in which case ``report`` is a :class:`TestReport`. This hook is not called if the exception that was raised is an internal diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 57407fe5495..952c703509d 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -605,8 +605,7 @@ def perform_collect( ) -> Sequence[Union[nodes.Item, nodes.Collector]]: """Perform the collection phase for this session. - This is called by the default - :func:`pytest_collection <_pytest.hookspec.pytest_collection>` hook + This is called by the default :hook:`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``. diff --git a/src/_pytest/python.py b/src/_pytest/python.py index b5e391fb210..aa49aa26499 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -985,7 +985,7 @@ def id(self) -> str: @final class Metafunc: - """Objects passed to the :func:`pytest_generate_tests <_pytest.hookspec.pytest_generate_tests>` hook. + """Objects passed to the :hook:`pytest_generate_tests` hook. They help to inspect a test function and to generate tests according to test configuration or values specified in the class or module where a From a3cf2ad3bcc4e3b69613f19affe97d90b2426eba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Dec 2021 03:02:33 +0000 Subject: [PATCH 032/549] build(deps): Bump pytest-django in /testing/plugins_integration Bumps [pytest-django](https://github.com/pytest-dev/pytest-django) from 4.5.1 to 4.5.2. - [Release notes](https://github.com/pytest-dev/pytest-django/releases) - [Changelog](https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst) - [Commits](https://github.com/pytest-dev/pytest-django/compare/v4.5.1...v4.5.2) --- updated-dependencies: - dependency-name: pytest-django dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 88fe6a3e3f4..64d0ab83d70 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -3,7 +3,7 @@ django==3.2.10 pytest-asyncio==0.16.0 pytest-bdd==5.0.0 pytest-cov==3.0.0 -pytest-django==4.5.1 +pytest-django==4.5.2 pytest-flakes==4.0.5 pytest-html==3.1.1 pytest-mock==3.6.1 From 913439f5e5691f391e2969b3c8f0a49e50dce43a Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 16 Dec 2021 09:07:14 -0300 Subject: [PATCH 033/549] Fix test_errors_in_xfail_skip_expressions for Python 3.10.1 Decided to remove the condition altogether as seems reasonable to state that our own test suite requires Python 3.10.1. Fix #9413 --- .github/workflows/main.yml | 4 ++-- testing/test_skipping.py | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 92e2dc6be7c..bbc48adb49a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -78,7 +78,7 @@ jobs: os: windows-latest tox_env: "py39-xdist" - name: "windows-py310" - python: "3.10-dev" + python: "3.10.1" os: windows-latest tox_env: "py310-xdist" @@ -108,7 +108,7 @@ jobs: os: ubuntu-latest tox_env: "py39-xdist" - name: "ubuntu-py310" - python: "3.10-dev" + python: "3.10.1" os: ubuntu-latest tox_env: "py310-xdist" - name: "ubuntu-pypy3" diff --git a/testing/test_skipping.py b/testing/test_skipping.py index a0b5cddabce..3010943607c 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -1143,8 +1143,6 @@ def test_func(): pypy_version_info = getattr(sys, "pypy_version_info", None) if pypy_version_info is not None and pypy_version_info < (6,): markline = markline[5:] - elif sys.version_info[:2] >= (3, 10): - markline = markline[11:] elif sys.version_info >= (3, 8) or hasattr(sys, "pypy_version_info"): markline = markline[4:] From a73a9a12a22b79422505b8057c8cddc7e1c7d3b0 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 19 Dec 2021 00:12:37 +0000 Subject: [PATCH 034/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 86 ++++++++++++++++---------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 8760860f9a6..843cfcd5405 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -274,7 +274,7 @@ This list contains 969 plugins. :pypi:`pytest-drf` A Django REST framework plugin for pytest. Nov 12, 2020 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-drivings` Tool to allow webdriver automation to be ran locally or remotely Jan 13, 2021 N/A N/A :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection May 23, 2020 4 - Beta pytest (>=2.7) - :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 10, 2021 5 - Production/Stable pytest + :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A :pypi:`pytest-duration-insights` Jun 25, 2021 N/A N/A :pypi:`pytest-dynamicrerun` A pytest plugin to rerun tests dynamically based off of test outcome and output. Aug 15, 2020 4 - Beta N/A @@ -322,6 +322,7 @@ This list contains 969 plugins. :pypi:`pytest-expect` py.test plugin to store test expectations and mark tests based on them Apr 21, 2016 4 - Beta N/A :pypi:`pytest-expecter` Better testing with expecter and pytest. Jul 08, 2020 5 - Production/Stable N/A :pypi:`pytest-expectr` This plugin is used to expect multiple assert using pytest framework. Oct 05, 2018 N/A pytest (>=2.4.2) + :pypi:`pytest-experiments` A pytest plugin to help developers of research-oriented software projects keep track of the results of their numerical experiments. Dec 13, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) :pypi:`pytest-explicit` A Pytest plugin to ignore certain marked tests by default Jun 15, 2021 5 - Production/Stable pytest :pypi:`pytest-exploratory` Interactive console for pytest. Aug 03, 2021 N/A pytest (>=5.3) :pypi:`pytest-external-blockers` a special outcome for tests that are blocked for external reasons Oct 05, 2021 N/A pytest @@ -409,7 +410,7 @@ This list contains 969 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Dec 10, 2021 3 - Alpha pytest (==6.2.5) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Dec 18, 2021 3 - Alpha pytest (==6.2.5) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jul 12, 2021 N/A pytest (>=5.0) :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Aug 29, 2021 4 - Beta N/A @@ -423,13 +424,13 @@ This list contains 969 plugins. :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Feb 11, 2019 5 - Production/Stable N/A :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A - :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Oct 18, 2021 3 - Alpha pytest ; extra == 'dev' + :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Dec 15, 2021 3 - Alpha N/A :pypi:`pytest-httpx` Send responses to httpx. Nov 16, 2021 5 - Production/Stable pytest (==6.*) :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A - :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jun 16, 2021 4 - Beta pytest + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Dec 15, 2021 4 - Beta pytest :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Nov 26, 2021 N/A N/A @@ -446,7 +447,6 @@ This list contains 969 plugins. :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Apr 07, 2021 N/A pytest (>=6.0.2,<7.0.0) :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) - :pypi:`pytest-instant` Fast-forward asyncio time (in tests) Dec 05, 2021 N/A N/A :pypi:`pytest-instrument` pytest plugin to instrument tests Apr 05, 2020 5 - Production/Stable pytest (>=5.1.0) :pypi:`pytest-integration` Organizing pytests by integration or not Apr 16, 2020 N/A N/A :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) @@ -485,7 +485,7 @@ This list contains 969 plugins. :pypi:`pytest-leaks` A pytest plugin to trace resource leaks. Nov 27, 2019 1 - Planning N/A :pypi:`pytest-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest. Dec 22, 2018 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Oct 29, 2021 4 - Beta N/A + :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Dec 15, 2021 4 - Beta N/A :pypi:`pytest-libnotify` Pytest plugin that shows notifications about the test run Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-ligo` Jan 16, 2020 4 - Beta N/A :pypi:`pytest-lineno` A pytest plugin to show the line numbers of test functions Dec 04, 2020 N/A pytest @@ -495,7 +495,7 @@ This list contains 969 plugins. :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) :pypi:`pytest-live` Live results for pytest Mar 08, 2020 N/A pytest :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Aug 25, 2021 5 - Production/Stable pytest - :pypi:`pytest-localserver` py.test plugin to test server connections locally. Nov 19, 2021 4 - Beta N/A + :pypi:`pytest-localserver` py.test plugin to test server connections locally. Dec 13, 2021 4 - Beta N/A :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Aug 22, 2019 4 - Beta pytest (>=3.3.0) :pypi:`pytest-lockable` lockable resource plugin for pytest Nov 09, 2021 5 - Production/Stable pytest :pypi:`pytest-locker` Used to lock object during testing. Essentially changing assertions from being hard coded to asserting that nothing changed Oct 29, 2021 N/A pytest (>=5.4) @@ -603,7 +603,7 @@ This list contains 969 plugins. :pypi:`pytest-order` pytest plugin to run your tests in a specific order May 30, 2021 4 - Beta pytest (>=5.0) :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A - :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Dec 03, 2021 N/A N/A + :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Dec 16, 2021 N/A N/A :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A :pypi:`pytest-pahrametahrize` Parametrize your tests with a Boston accent. Nov 24, 2021 4 - Beta pytest (>=6.0,<7.0) :pypi:`pytest-parallel` a pytest plugin for parallel and concurrent testing Oct 10, 2021 3 - Alpha pytest (>=3.0.0) @@ -689,7 +689,7 @@ This list contains 969 plugins. :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Jun 26, 2021 4 - Beta pytest (>=6.2.0) - :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Dec 07, 2021 5 - Production/Stable pytest (>=6.2.3) + :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Dec 16, 2021 5 - Production/Stable pytest (>=6.2.3) :pypi:`pytest-qml` Run QML Tests with pytest Dec 02, 2020 4 - Beta pytest (>=6.0.0) :pypi:`pytest-qr` pytest plugin to generate test result QR codes Nov 25, 2021 4 - Beta N/A :pypi:`pytest-qt` pytest support for PyQt and PySide applications Jun 13, 2021 5 - Production/Stable pytest (>=3.0.0) @@ -728,7 +728,7 @@ This list contains 969 plugins. :pypi:`pytest-reorder` Reorder tests depending on their paths and names. May 31, 2018 4 - Beta pytest :pypi:`pytest-repeat` pytest plugin for repeating tests Oct 31, 2020 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-replay` Saves previous test runs and allow re-execute previous pytest runs to reproduce crashes or flaky tests Jun 09, 2021 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-repo-health` A pytest plugin to report on repository standards conformance Nov 23, 2021 3 - Alpha pytest + :pypi:`pytest-repo-health` A pytest plugin to report on repository standards conformance Dec 16, 2021 3 - Alpha pytest :pypi:`pytest-report` Creates json report that is compatible with atom.io's linter message format May 11, 2016 4 - Beta N/A :pypi:`pytest-reporter` Generate Pytest reports with templates Jul 22, 2021 4 - Beta pytest :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest Jun 08, 2021 4 - Beta N/A @@ -772,14 +772,14 @@ This list contains 969 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Dec 11, 2021 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Dec 17, 2021 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Aug 31, 2020 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Dec 11, 2021 5 - Production/Stable N/A - :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Nov 26, 2020 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Dec 17, 2021 5 - Production/Stable N/A + :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest @@ -828,7 +828,7 @@ This list contains 969 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Nov 29, 2021 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Dec 17, 2021 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Dec 06, 2021 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A @@ -879,8 +879,8 @@ This list contains 969 plugins. :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) :pypi:`pytest-testrail2` A small example package Nov 17, 2020 N/A pytest (>=5) - :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Nov 30, 2021 N/A pytest (>=5.5) - :pypi:`pytest-testrail-api-client` TestRail Api Python Client Dec 03, 2021 N/A pytest + :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Dec 17, 2021 N/A pytest (>=5.5) + :pypi:`pytest-testrail-api-client` TestRail Api Python Client Dec 14, 2021 N/A pytest :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) @@ -890,14 +890,14 @@ This list contains 969 plugins. :pypi:`pytest-testreport` Nov 12, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) - :pypi:`pytest-test-utils` Nov 30, 2021 N/A pytest (>=5) + :pypi:`pytest-test-utils` Dec 14, 2021 N/A pytest (>=5) :pypi:`pytest-tesults` Tesults plugin for pytest Jul 31, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-tezos` pytest-ligo Jan 16, 2020 4 - Beta N/A :pypi:`pytest-thawgun` Pytest plugin for time travel May 26, 2020 3 - Alpha N/A :pypi:`pytest-threadleak` Detects thread leaks Sep 08, 2017 4 - Beta N/A :pypi:`pytest-tick` Ticking on tests Aug 31, 2021 5 - Production/Stable pytest (>=6.2.5,<7.0.0) :pypi:`pytest-timeit` A pytest plugin to time test function runs Oct 13, 2016 4 - Beta N/A - :pypi:`pytest-timeout` pytest plugin to abort hanging tests Oct 11, 2021 5 - Production/Stable pytest (>=5.0.0) + :pypi:`pytest-timeout` pytest plugin to abort hanging tests Dec 13, 2021 5 - Production/Stable pytest (>=5.0.0) :pypi:`pytest-timeouts` Linux-only Pytest plugin to control durations of various test case execution phases Sep 21, 2019 5 - Production/Stable N/A :pypi:`pytest-timer` A timer plugin for pytest Jun 02, 2021 N/A N/A :pypi:`pytest-timestamper` Pytest plugin to add a timestamp prefix to the pytest output Jun 06, 2021 N/A N/A @@ -2785,7 +2785,7 @@ This list contains 969 plugins. A Pytest plugin to drop duplicated tests during collection :pypi:`pytest-dummynet` - *last release*: Dec 10, 2021, + *last release*: Dec 15, 2021, *status*: 5 - Production/Stable, *requires*: pytest @@ -3120,6 +3120,13 @@ This list contains 969 plugins. This plugin is used to expect multiple assert using pytest framework. + :pypi:`pytest-experiments` + *last release*: Dec 13, 2021, + *status*: 4 - Beta, + *requires*: pytest (>=6.2.5,<7.0.0) + + A pytest plugin to help developers of research-oriented software projects keep track of the results of their numerical experiments. + :pypi:`pytest-explicit` *last release*: Jun 15, 2021, *status*: 5 - Production/Stable, @@ -3730,7 +3737,7 @@ This list contains 969 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Dec 10, 2021, + *last release*: Dec 18, 2021, *status*: 3 - Alpha, *requires*: pytest (==6.2.5) @@ -3828,9 +3835,9 @@ This list contains 969 plugins. A thin wrapper of HTTPretty for pytest :pypi:`pytest-httpserver` - *last release*: Oct 18, 2021, + *last release*: Dec 15, 2021, *status*: 3 - Alpha, - *requires*: pytest ; extra == 'dev' + *requires*: N/A pytest-httpserver is a httpserver for pytest @@ -3870,7 +3877,7 @@ This list contains 969 plugins. help hypo module for pytest :pypi:`pytest-ibutsu` - *last release*: Jun 16, 2021, + *last release*: Dec 15, 2021, *status*: 4 - Beta, *requires*: pytest @@ -3988,13 +3995,6 @@ This list contains 969 plugins. pytest plugin to show failures instantly - :pypi:`pytest-instant` - *last release*: Dec 05, 2021, - *status*: N/A, - *requires*: N/A - - Fast-forward asyncio time (in tests) - :pypi:`pytest-instrument` *last release*: Apr 05, 2020, *status*: 5 - Production/Stable, @@ -4262,7 +4262,7 @@ This list contains 969 plugins. A python-libfaketime plugin for pytest. :pypi:`pytest-libiio` - *last release*: Oct 29, 2021, + *last release*: Dec 15, 2021, *status*: 4 - Beta, *requires*: N/A @@ -4332,7 +4332,7 @@ This list contains 969 plugins. A PyTest plugin which provides an FTP fixture for your tests :pypi:`pytest-localserver` - *last release*: Nov 19, 2021, + *last release*: Dec 13, 2021, *status*: 4 - Beta, *requires*: N/A @@ -5088,7 +5088,7 @@ This list contains 969 plugins. OS X notifications for py.test results. :pypi:`pytest-otel` - *last release*: Dec 03, 2021, + *last release*: Dec 16, 2021, *status*: N/A, *requires*: N/A @@ -5690,7 +5690,7 @@ This list contains 969 plugins. Pytest plugin for uploading test results to your QA Touch Testrun. :pypi:`pytest-qgis` - *last release*: Dec 07, 2021, + *last release*: Dec 16, 2021, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2.3) @@ -5963,7 +5963,7 @@ This list contains 969 plugins. Saves previous test runs and allow re-execute previous pytest runs to reproduce crashes or flaky tests :pypi:`pytest-repo-health` - *last release*: Nov 23, 2021, + *last release*: Dec 16, 2021, *status*: 3 - Alpha, *requires*: pytest @@ -6271,7 +6271,7 @@ This list contains 969 plugins. :pypi:`pytest-sbase` - *last release*: Dec 11, 2021, + *last release*: Dec 17, 2021, *status*: 5 - Production/Stable, *requires*: N/A @@ -6313,14 +6313,14 @@ This list contains 969 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Dec 11, 2021, + *last release*: Dec 17, 2021, *status*: 5 - Production/Stable, *requires*: N/A A complete web automation framework for end-to-end testing. :pypi:`pytest-selenium-enhancer` - *last release*: Nov 26, 2020, + *last release*: Dec 16, 2021, *status*: 5 - Production/Stable, *requires*: N/A @@ -6663,7 +6663,7 @@ This list contains 969 plugins. :pypi:`pytest-splunk-addon` - *last release*: Nov 29, 2021, + *last release*: Dec 17, 2021, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7020,14 +7020,14 @@ This list contains 969 plugins. A small example package :pypi:`pytest-testrail-api` - *last release*: Nov 30, 2021, + *last release*: Dec 17, 2021, *status*: N/A, *requires*: pytest (>=5.5) Плагин Pytest, для интеграции с TestRail :pypi:`pytest-testrail-api-client` - *last release*: Dec 03, 2021, + *last release*: Dec 14, 2021, *status*: N/A, *requires*: pytest @@ -7097,7 +7097,7 @@ This list contains 969 plugins. Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply :pypi:`pytest-test-utils` - *last release*: Nov 30, 2021, + *last release*: Dec 14, 2021, *status*: N/A, *requires*: pytest (>=5) @@ -7146,7 +7146,7 @@ This list contains 969 plugins. A pytest plugin to time test function runs :pypi:`pytest-timeout` - *last release*: Oct 11, 2021, + *last release*: Dec 13, 2021, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0.0) From e358bc65a8ae7bc2e21ff547767c7705089f76a9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 20 Dec 2021 20:42:31 +0000 Subject: [PATCH 035/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.910-1 → v0.920](https://github.com/pre-commit/mirrors-mypy/compare/v0.910-1...v0.920) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1741136dfe0..1a740045015 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -48,7 +48,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.910-1 + rev: v0.920 hooks: - id: mypy files: ^(src/|testing/) From c69b84f2367b44c0692589aef037deeca9e11a4a Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 21 Dec 2021 20:42:32 -0500 Subject: [PATCH 036/549] fix typing issues in mypy 0.920 --- src/_pytest/capture.py | 2 +- src/_pytest/junitxml.py | 2 +- src/_pytest/logging.py | 19 ++++++++++++------- testing/code/test_source.py | 3 +-- testing/test_assertrewrite.py | 2 +- testing/test_legacypath.py | 2 +- testing/test_pastebin.py | 5 ++++- testing/test_recwarn.py | 4 ++-- 8 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index 884f035e299..d82ee9552f1 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -112,7 +112,7 @@ def _reopen_stdio(f, mode): buffering = -1 return io.TextIOWrapper( - open(os.dup(f.fileno()), mode, buffering), # type: ignore[arg-type] + open(os.dup(f.fileno()), mode, buffering), f.encoding, f.errors, f.newlines, diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py index 13688251f6a..8249dccffed 100644 --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -92,7 +92,7 @@ def __init__(self, nodeid: Union[str, TestReport], xml: "LogXML") -> None: self.xml = xml self.add_stats = self.xml.add_stats self.family = self.xml.family - self.duration = 0 + self.duration = 0.0 self.properties: List[Tuple[str, str]] = [] self.nodes: List[ET.Element] = [] self.attrs: Dict[str, str] = {} diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index 31ad8301076..796a1c3f8af 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -1,4 +1,5 @@ """Access and control log capturing.""" +import io import logging import os import re @@ -13,6 +14,7 @@ from typing import Mapping from typing import Optional from typing import Tuple +from typing import TYPE_CHECKING from typing import TypeVar from typing import Union @@ -34,6 +36,11 @@ from _pytest.stash import StashKey from _pytest.terminal import TerminalReporter +if TYPE_CHECKING: + logging_StreamHandler = logging.StreamHandler[StringIO] +else: + logging_StreamHandler = logging.StreamHandler + DEFAULT_LOG_FORMAT = "%(levelname)-8s %(name)s:%(filename)s:%(lineno)d %(message)s" DEFAULT_LOG_DATE_FORMAT = "%H:%M:%S" @@ -322,11 +329,9 @@ def __exit__(self, type, value, traceback): root_logger.removeHandler(self.handler) -class LogCaptureHandler(logging.StreamHandler): +class LogCaptureHandler(logging_StreamHandler): """A logging handler that stores log records and the log text.""" - stream: StringIO - def __init__(self) -> None: """Create a new log handler.""" super().__init__(StringIO()) @@ -621,7 +626,8 @@ def set_log_path(self, fname: str) -> None: if not fpath.parent.exists(): fpath.parent.mkdir(exist_ok=True, parents=True) - stream = fpath.open(mode="w", encoding="UTF-8") + # https://github.com/python/mypy/issues/11193 + stream: io.TextIOWrapper = fpath.open(mode="w", encoding="UTF-8") # type: ignore[assignment] if sys.version_info >= (3, 7): old_stream = self.log_file_handler.setStream(stream) else: @@ -633,8 +639,7 @@ def set_log_path(self, fname: str) -> None: finally: self.log_file_handler.release() if old_stream: - # https://github.com/python/typeshed/pull/5663 - old_stream.close() # type:ignore[attr-defined] + old_stream.close() def _log_cli_enabled(self): """Return whether live logging is enabled.""" @@ -758,7 +763,7 @@ def handleError(self, record: logging.LogRecord) -> None: pass -class _LiveLoggingStreamHandler(logging.StreamHandler): +class _LiveLoggingStreamHandler(logging_StreamHandler): """A logging StreamHandler used by the live logging feature: it will write a newline before the first log message in each test. diff --git a/testing/code/test_source.py b/testing/code/test_source.py index 53202ee27e3..b7b3c17115a 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -332,8 +332,7 @@ def test_findsource(monkeypatch) -> None: lines = ["if 1:\n", " def x():\n", " pass\n"] co = compile("".join(lines), filename, "exec") - # Type ignored because linecache.cache is private. - monkeypatch.setitem(linecache.cache, filename, (1, None, lines, filename)) # type: ignore[attr-defined] + monkeypatch.setitem(linecache.cache, filename, (1, None, lines, filename)) src, lineno = findsource(co) assert src is not None diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 61f5760e725..a88c7eba33e 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1057,7 +1057,7 @@ def atomic_write_failed(fn, mode="r", overwrite=False): e = OSError() e.errno = 10 raise e - yield # type:ignore[unreachable] + yield monkeypatch.setattr( _pytest.assertion.rewrite, "atomic_write", atomic_write_failed diff --git a/testing/test_legacypath.py b/testing/test_legacypath.py index 9ab139df467..1d3fdb4bd9c 100644 --- a/testing/test_legacypath.py +++ b/testing/test_legacypath.py @@ -14,7 +14,7 @@ def test_item_fspath(pytester: pytest.Pytester) -> None: items2, hookrec = pytester.inline_genitems(item.nodeid) (item2,) = items2 assert item2.name == item.name - assert item2.fspath == item.fspath # type: ignore[attr-defined] + assert item2.fspath == item.fspath assert item2.path == item.path diff --git a/testing/test_pastebin.py b/testing/test_pastebin.py index b338519ae17..86b231f8b5e 100644 --- a/testing/test_pastebin.py +++ b/testing/test_pastebin.py @@ -1,3 +1,4 @@ +import email.message import io from typing import List from typing import Union @@ -98,7 +99,9 @@ def mocked_urlopen_fail(self, monkeypatch: MonkeyPatch): def mocked(url, data): calls.append((url, data)) - raise urllib.error.HTTPError(url, 400, "Bad request", {}, io.BytesIO()) + raise urllib.error.HTTPError( + url, 400, "Bad request", email.message.Message(), io.BytesIO() + ) monkeypatch.setattr(urllib.request, "urlopen", mocked) return calls diff --git a/testing/test_recwarn.py b/testing/test_recwarn.py index d3f218f1660..c5a8ae90fc1 100644 --- a/testing/test_recwarn.py +++ b/testing/test_recwarn.py @@ -114,13 +114,13 @@ def test_deprecated_call_preserves(self) -> None: # Type ignored because `onceregistry` and `filters` are not # documented API. onceregistry = warnings.onceregistry.copy() # type: ignore - filters = warnings.filters[:] # type: ignore + filters = warnings.filters[:] warn = warnings.warn warn_explicit = warnings.warn_explicit self.test_deprecated_call_raises() self.test_deprecated_call() assert onceregistry == warnings.onceregistry # type: ignore - assert filters == warnings.filters # type: ignore + assert filters == warnings.filters assert warn is warnings.warn assert warn_explicit is warnings.warn_explicit From 8071ad6b909353b5921cbd97acf008bdfb3122d9 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 16 Dec 2021 13:51:17 +0200 Subject: [PATCH 037/549] doc: fix a reference in "Writing hook functions" --- doc/en/how-to/writing_hook_functions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/how-to/writing_hook_functions.rst b/doc/en/how-to/writing_hook_functions.rst index 663bceb6321..f615fced861 100644 --- a/doc/en/how-to/writing_hook_functions.rst +++ b/doc/en/how-to/writing_hook_functions.rst @@ -321,7 +321,7 @@ Plugins often need to store data on :class:`~pytest.Item`\s in one hook implementation, and access it in another. One common solution is to just assign some private attribute directly on the item, but type-checkers like mypy frown upon this, and it may also cause conflicts with other plugins. -So pytest offers a better way to do this, :attr:`_pytest.nodes.Node.stash `. +So pytest offers a better way to do this, :attr:`item.stash <_pytest.nodes.Node.stash>`. To use the "stash" in your plugins, first create "stash keys" somewhere at the top level of your plugin: From 10e21dadeec16caef955d0cb1e222d532e33a5ff Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 25 Dec 2021 12:03:15 +0200 Subject: [PATCH 038/549] python: skip nose setup/teardown fixtures if non-callable Since commit 89f0b5b5a2f485f77999d15cb9437ad9234003a1 cases as in the added test started to fail, like they do for the standard pytest names (`setup_module` etc). But the name `setup` in particular is way too common for us to start taking it over more aggressively, so restore the previous behavior which required the object to be callable. Fix #9391. --- src/_pytest/python.py | 6 ++++++ testing/test_nose.py | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index aa49aa26499..197d36ee9df 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -522,12 +522,18 @@ def _inject_setup_module_fixture(self) -> None: self.obj, ("setUpModule", "setup_module") ) if setup_module is None and has_nose: + # The name "setup" is too common - only treat as fixture if callable. setup_module = _get_first_non_fixture_func(self.obj, ("setup",)) + if not callable(setup_module): + setup_module = None teardown_module = _get_first_non_fixture_func( self.obj, ("tearDownModule", "teardown_module") ) if teardown_module is None and has_nose: teardown_module = _get_first_non_fixture_func(self.obj, ("teardown",)) + # Same as "setup" above - only treat as fixture if callable. + if not callable(teardown_module): + teardown_module = None if setup_module is None and teardown_module is None: return diff --git a/testing/test_nose.py b/testing/test_nose.py index edca0f4463e..1ded8854bb7 100644 --- a/testing/test_nose.py +++ b/testing/test_nose.py @@ -477,3 +477,22 @@ def test_raises_baseexception_caught(): "* 1 failed, 2 passed *", ] ) + + +def test_nose_setup_skipped_if_non_callable(pytester: Pytester) -> None: + """Regression test for #9391.""" + p = pytester.makepyfile( + __init__="", + setup=""" + """, + teardown=""" + """, + test_it=""" + from . import setup, teardown + + def test_it(): + pass + """, + ) + result = pytester.runpytest(p, "-p", "nose") + assert result.ret == 0 From 3128080806f884ffdf303312f2a433f3334c05ee Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 25 Dec 2021 10:37:07 +0200 Subject: [PATCH 039/549] pytest: bring back direct imports of TempdirFactory, Testdir The monkeypatch approach doesn't work for `import pytest; pytest.TempdirFactory`. Fix #9432. --- src/_pytest/legacypath.py | 95 ++++++++++++++++++++------------------- src/pytest/__init__.py | 4 ++ 2 files changed, 53 insertions(+), 46 deletions(-) diff --git a/src/_pytest/legacypath.py b/src/_pytest/legacypath.py index 743c06d55c4..4c2db941257 100644 --- a/src/_pytest/legacypath.py +++ b/src/_pytest/legacypath.py @@ -10,13 +10,26 @@ import attr from iniconfig import SectionWrapper -import pytest +from _pytest.cacheprovider import Cache from _pytest.compat import final from _pytest.compat import LEGACY_PATH from _pytest.compat import legacy_path +from _pytest.config import Config +from _pytest.config import hookimpl +from _pytest.config import PytestPluginManager from _pytest.deprecated import check_ispytest +from _pytest.fixtures import fixture +from _pytest.fixtures import FixtureRequest +from _pytest.main import Session +from _pytest.monkeypatch import MonkeyPatch +from _pytest.nodes import Collector +from _pytest.nodes import Item from _pytest.nodes import Node +from _pytest.pytester import HookRecorder +from _pytest.pytester import Pytester +from _pytest.pytester import RunResult from _pytest.terminal import TerminalReporter +from _pytest.tmpdir import TempPathFactory if TYPE_CHECKING: from typing_extensions import Final @@ -35,10 +48,10 @@ class Testdir: __test__ = False - CLOSE_STDIN: "Final" = pytest.Pytester.CLOSE_STDIN - TimeoutExpired: "Final" = pytest.Pytester.TimeoutExpired + CLOSE_STDIN: "Final" = Pytester.CLOSE_STDIN + TimeoutExpired: "Final" = Pytester.TimeoutExpired - def __init__(self, pytester: pytest.Pytester, *, _ispytest: bool = False) -> None: + def __init__(self, pytester: Pytester, *, _ispytest: bool = False) -> None: check_ispytest(_ispytest) self._pytester = pytester @@ -64,10 +77,10 @@ def plugins(self, plugins): self._pytester.plugins = plugins @property - def monkeypatch(self) -> pytest.MonkeyPatch: + def monkeypatch(self) -> MonkeyPatch: return self._pytester._monkeypatch - def make_hook_recorder(self, pluginmanager) -> pytest.HookRecorder: + def make_hook_recorder(self, pluginmanager) -> HookRecorder: """See :meth:`Pytester.make_hook_recorder`.""" return self._pytester.make_hook_recorder(pluginmanager) @@ -131,9 +144,7 @@ def copy_example(self, name=None) -> LEGACY_PATH: """See :meth:`Pytester.copy_example`.""" return legacy_path(self._pytester.copy_example(name)) - def getnode( - self, config: pytest.Config, arg - ) -> Optional[Union[pytest.Item, pytest.Collector]]: + def getnode(self, config: Config, arg) -> Optional[Union[Item, Collector]]: """See :meth:`Pytester.getnode`.""" return self._pytester.getnode(config, arg) @@ -141,9 +152,7 @@ def getpathnode(self, path): """See :meth:`Pytester.getpathnode`.""" return self._pytester.getpathnode(path) - def genitems( - self, colitems: List[Union[pytest.Item, pytest.Collector]] - ) -> List[pytest.Item]: + def genitems(self, colitems: List[Union[Item, Collector]]) -> List[Item]: """See :meth:`Pytester.genitems`.""" return self._pytester.genitems(colitems) @@ -165,19 +174,19 @@ def inline_run(self, *args, plugins=(), no_reraise_ctrlc: bool = False): *args, plugins=plugins, no_reraise_ctrlc=no_reraise_ctrlc ) - def runpytest_inprocess(self, *args, **kwargs) -> pytest.RunResult: + def runpytest_inprocess(self, *args, **kwargs) -> RunResult: """See :meth:`Pytester.runpytest_inprocess`.""" return self._pytester.runpytest_inprocess(*args, **kwargs) - def runpytest(self, *args, **kwargs) -> pytest.RunResult: + def runpytest(self, *args, **kwargs) -> RunResult: """See :meth:`Pytester.runpytest`.""" return self._pytester.runpytest(*args, **kwargs) - def parseconfig(self, *args) -> pytest.Config: + def parseconfig(self, *args) -> Config: """See :meth:`Pytester.parseconfig`.""" return self._pytester.parseconfig(*args) - def parseconfigure(self, *args) -> pytest.Config: + def parseconfigure(self, *args) -> Config: """See :meth:`Pytester.parseconfigure`.""" return self._pytester.parseconfigure(*args) @@ -196,8 +205,8 @@ def getmodulecol(self, source, configargs=(), withinit=False): ) def collect_by_name( - self, modcol: pytest.Collector, name: str - ) -> Optional[Union[pytest.Item, pytest.Collector]]: + self, modcol: Collector, name: str + ) -> Optional[Union[Item, Collector]]: """See :meth:`Pytester.collect_by_name`.""" return self._pytester.collect_by_name(modcol, name) @@ -212,11 +221,11 @@ def popen( """See :meth:`Pytester.popen`.""" return self._pytester.popen(cmdargs, stdout, stderr, stdin, **kw) - def run(self, *cmdargs, timeout=None, stdin=CLOSE_STDIN) -> pytest.RunResult: + def run(self, *cmdargs, timeout=None, stdin=CLOSE_STDIN) -> RunResult: """See :meth:`Pytester.run`.""" return self._pytester.run(*cmdargs, timeout=timeout, stdin=stdin) - def runpython(self, script) -> pytest.RunResult: + def runpython(self, script) -> RunResult: """See :meth:`Pytester.runpython`.""" return self._pytester.runpython(script) @@ -224,7 +233,7 @@ def runpython_c(self, command): """See :meth:`Pytester.runpython_c`.""" return self._pytester.runpython_c(command) - def runpytest_subprocess(self, *args, timeout=None) -> pytest.RunResult: + def runpytest_subprocess(self, *args, timeout=None) -> RunResult: """See :meth:`Pytester.runpytest_subprocess`.""" return self._pytester.runpytest_subprocess(*args, timeout=timeout) @@ -245,13 +254,10 @@ def __str__(self) -> str: return str(self.tmpdir) -pytest.Testdir = Testdir # type: ignore[attr-defined] - - class LegacyTestdirPlugin: @staticmethod - @pytest.fixture - def testdir(pytester: pytest.Pytester) -> Testdir: + @fixture + def testdir(pytester: Pytester) -> Testdir: """ Identical to :fixture:`pytester`, and provides an instance whose methods return legacy ``LEGACY_PATH`` objects instead when applicable. @@ -267,10 +273,10 @@ class TempdirFactory: """Backward compatibility wrapper that implements :class:``_pytest.compat.LEGACY_PATH`` for :class:``TempPathFactory``.""" - _tmppath_factory: pytest.TempPathFactory + _tmppath_factory: TempPathFactory def __init__( - self, tmppath_factory: pytest.TempPathFactory, *, _ispytest: bool = False + self, tmppath_factory: TempPathFactory, *, _ispytest: bool = False ) -> None: check_ispytest(_ispytest) self._tmppath_factory = tmppath_factory @@ -284,19 +290,16 @@ def getbasetemp(self) -> LEGACY_PATH: return legacy_path(self._tmppath_factory.getbasetemp().resolve()) -pytest.TempdirFactory = TempdirFactory # type: ignore[attr-defined] - - class LegacyTmpdirPlugin: @staticmethod - @pytest.fixture(scope="session") - def tmpdir_factory(request: pytest.FixtureRequest) -> TempdirFactory: + @fixture(scope="session") + def tmpdir_factory(request: FixtureRequest) -> TempdirFactory: """Return a :class:`pytest.TempdirFactory` instance for the test session.""" # Set dynamically by pytest_configure(). return request.config._tmpdirhandler # type: ignore @staticmethod - @pytest.fixture + @fixture def tmpdir(tmp_path: Path) -> LEGACY_PATH: """Return a temporary directory path object which is unique to each test function invocation, created as a sub directory of the base temporary @@ -314,7 +317,7 @@ def tmpdir(tmp_path: Path) -> LEGACY_PATH: return legacy_path(tmp_path) -def Cache_makedir(self: pytest.Cache, name: str) -> LEGACY_PATH: +def Cache_makedir(self: Cache, name: str) -> LEGACY_PATH: """Return a directory path object with the given name. Same as :func:`mkdir`, but returns a legacy py path instance. @@ -322,7 +325,7 @@ def Cache_makedir(self: pytest.Cache, name: str) -> LEGACY_PATH: return legacy_path(self.mkdir(name)) -def FixtureRequest_fspath(self: pytest.FixtureRequest) -> LEGACY_PATH: +def FixtureRequest_fspath(self: FixtureRequest) -> LEGACY_PATH: """(deprecated) The file system path of the test module which collected this test.""" return legacy_path(self.path) @@ -337,7 +340,7 @@ def TerminalReporter_startdir(self: TerminalReporter) -> LEGACY_PATH: return legacy_path(self.startpath) -def Config_invocation_dir(self: pytest.Config) -> LEGACY_PATH: +def Config_invocation_dir(self: Config) -> LEGACY_PATH: """The directory from which pytest was invoked. Prefer to use :attr:`invocation_params.dir `, @@ -348,7 +351,7 @@ def Config_invocation_dir(self: pytest.Config) -> LEGACY_PATH: return legacy_path(str(self.invocation_params.dir)) -def Config_rootdir(self: pytest.Config) -> LEGACY_PATH: +def Config_rootdir(self: Config) -> LEGACY_PATH: """The path to the :ref:`rootdir `. Prefer to use :attr:`rootpath`, which is a :class:`pathlib.Path`. @@ -358,7 +361,7 @@ def Config_rootdir(self: pytest.Config) -> LEGACY_PATH: return legacy_path(str(self.rootpath)) -def Config_inifile(self: pytest.Config) -> Optional[LEGACY_PATH]: +def Config_inifile(self: Config) -> Optional[LEGACY_PATH]: """The path to the :ref:`configfile `. Prefer to use :attr:`inipath`, which is a :class:`pathlib.Path`. @@ -368,7 +371,7 @@ def Config_inifile(self: pytest.Config) -> Optional[LEGACY_PATH]: return legacy_path(str(self.inipath)) if self.inipath else None -def Session_stardir(self: pytest.Session) -> LEGACY_PATH: +def Session_stardir(self: Session) -> LEGACY_PATH: """The path from which pytest was invoked. Prefer to use ``startpath`` which is a :class:`pathlib.Path`. @@ -400,8 +403,10 @@ def Node_fspath_set(self: Node, value: LEGACY_PATH) -> None: self.path = Path(value) -@pytest.hookimpl -def pytest_configure(config: pytest.Config) -> None: +@hookimpl +def pytest_configure(config: Config) -> None: + import pytest + mp = pytest.MonkeyPatch() config.add_cleanup(mp.undo) @@ -452,10 +457,8 @@ def pytest_configure(config: pytest.Config) -> None: mp.setattr(Node, "fspath", property(Node_fspath, Node_fspath_set), raising=False) -@pytest.hookimpl -def pytest_plugin_registered( - plugin: object, manager: pytest.PytestPluginManager -) -> None: +@hookimpl +def pytest_plugin_registered(plugin: object, manager: PytestPluginManager) -> None: # pytester is not loaded by default and is commonly loaded from a conftest, # so checking for it in `pytest_configure` is not enough. is_pytester = plugin is manager.get_plugin("pytester") diff --git a/src/pytest/__init__.py b/src/pytest/__init__.py index 9c284ac9615..777d3774064 100644 --- a/src/pytest/__init__.py +++ b/src/pytest/__init__.py @@ -23,6 +23,8 @@ from _pytest.fixtures import FixtureRequest from _pytest.fixtures import yield_fixture from _pytest.freeze_support import freeze_includes +from _pytest.legacypath import TempdirFactory +from _pytest.legacypath import Testdir from _pytest.logging import LogCaptureFixture from _pytest.main import Session from _pytest.mark import Mark @@ -142,7 +144,9 @@ "Stash", "StashKey", "version_tuple", + "TempdirFactory", "TempPathFactory", + "Testdir", "TestReport", "UsageError", "WarningsRecorder", From 05d46ca850c17661e0ccf50191aca3cd7a164f50 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 25 Dec 2021 13:53:30 +0200 Subject: [PATCH 040/549] doc/reference: add 4 missing hooks to reference Fix #9434. --- doc/en/reference/reference.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index d4cbcbac08a..ce97ad5f710 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -727,6 +727,11 @@ you can use the following hook: .. hook:: pytest_make_parametrize_id .. autofunction:: pytest_make_parametrize_id +Hooks for influencing test skipping: + +.. hook:: pytest_markeval_namespace +.. autofunction:: pytest_markeval_namespace + After collection is complete, you can modify the order of items, delete or otherwise amend the test items: @@ -791,6 +796,10 @@ Session related reporting hooks: .. autofunction:: pytest_report_collectionfinish .. hook:: pytest_report_teststatus .. autofunction:: pytest_report_teststatus +.. hook:: pytest_report_to_serializable +.. autofunction:: pytest_report_to_serializable +.. hook:: pytest_report_from_serializable +.. autofunction:: pytest_report_from_serializable .. hook:: pytest_terminal_summary .. autofunction:: pytest_terminal_summary .. hook:: pytest_fixture_setup @@ -827,6 +836,8 @@ reporting or interaction with exceptions: .. autofunction:: pytest_exception_interact .. hook:: pytest_enter_pdb .. autofunction:: pytest_enter_pdb +.. hook:: pytest_leave_pdb +.. autofunction:: pytest_leave_pdb Objects From 427f035b760c57f9ed1d456952be4056066c52a7 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 26 Dec 2021 00:14:18 +0000 Subject: [PATCH 041/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 122 +++++++++++++++++++++---------- 1 file changed, 85 insertions(+), 37 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 843cfcd5405..7e89ac61778 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,14 +11,14 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 969 plugins. +This list contains 975 plugins. .. only:: not latex =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ name summary last release status requires =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ - :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Nov 22, 2021 N/A pytest (>=6,<7) + :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Dec 22, 2021 N/A pytest (>=6,<7) :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Nov 30, 2021 N/A pytest (>=5.4.0) :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) @@ -34,7 +34,7 @@ This list contains 969 plugins. :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A - :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Dec 02, 2021 N/A pytest (>=1.0) + :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Dec 21, 2021 N/A pytest (>=1.0) :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) @@ -103,7 +103,7 @@ This list contains 969 plugins. :pypi:`pytest-blame` A pytest plugin helps developers to debug by providing useful commits history. May 04, 2019 N/A pytest (>=4.4.0) :pypi:`pytest-blender` Blender Pytest plugin. Oct 29, 2021 N/A pytest (==6.2.5) ; extra == 'dev' :pypi:`pytest-blink1` Pytest plugin to emit notifications via the Blink(1) RGB LED Jan 07, 2018 4 - Beta N/A - :pypi:`pytest-blockage` Disable network requests during a test run. Feb 13, 2019 N/A pytest + :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A :pypi:`pytest-board` Local continuous test runner with pytest and watchdog. Jan 20, 2019 N/A N/A :pypi:`pytest-bpdb` A py.test plug-in to enable drop to bpdb debugger on test failure. Jan 19, 2015 2 - Pre-Alpha N/A @@ -152,7 +152,7 @@ This list contains 969 plugins. :pypi:`pytest-cloud` Distributed tests planner plugin for pytest testing framework. Oct 05, 2020 6 - Mature N/A :pypi:`pytest-cloudflare-worker` pytest plugin for testing cloudflare workers Mar 30, 2021 4 - Beta pytest (>=6.0.0) :pypi:`pytest-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) - :pypi:`pytest-codeblocks` Test code blocks in your READMEs Dec 11, 2021 4 - Beta pytest (>=6) + :pypi:`pytest-codeblocks` Test code blocks in your READMEs Dec 21, 2021 4 - Beta pytest (>=6) :pypi:`pytest-codecheckers` pytest plugin to add source code sanity checks (pep8 and friends) Feb 13, 2010 N/A N/A :pypi:`pytest-codecov` Pytest plugin for uploading pytest-cov results to codecov.io Oct 27, 2021 4 - Beta pytest (>=4.6.0) :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A @@ -248,6 +248,7 @@ This list contains 969 plugins. :pypi:`pytest-django-sqlcounts` py.test plugin for reporting the number of SQLs executed per django testcase. Jun 16, 2015 4 - Beta N/A :pypi:`pytest-django-testing-postgresql` Use a temporary PostgreSQL database with pytest-django Dec 05, 2019 3 - Alpha N/A :pypi:`pytest-doc` A documentation plugin for py.test. Jun 28, 2015 5 - Production/Stable N/A + :pypi:`pytest-docfiles` pytest plugin to test codeblocks in your documentation. Dec 22, 2021 4 - Beta pytest (>=3.7.0) :pypi:`pytest-docgen` An RST Documentation Generator for pytest-based test suites Apr 17, 2020 N/A N/A :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Jun 14, 2021 N/A pytest (<7.0,>=4.0) :pypi:`pytest-docker-butla` Jun 16, 2019 3 - Alpha N/A @@ -319,6 +320,7 @@ This list contains 969 plugins. :pypi:`pytest-exceptional` Better exceptions Mar 16, 2017 4 - Beta N/A :pypi:`pytest-exception-script` Walk your code through exception script to check it's resiliency to failures. Aug 04, 2020 3 - Alpha pytest :pypi:`pytest-executable` pytest plugin for testing executables Nov 10, 2021 4 - Beta pytest (<6.3,>=4.3) + :pypi:`pytest-execution-timer` A timer for the phases of Pytest's execution. Dec 24, 2021 4 - Beta N/A :pypi:`pytest-expect` py.test plugin to store test expectations and mark tests based on them Apr 21, 2016 4 - Beta N/A :pypi:`pytest-expecter` Better testing with expecter and pytest. Jul 08, 2020 5 - Production/Stable N/A :pypi:`pytest-expectr` This plugin is used to expect multiple assert using pytest framework. Oct 05, 2018 N/A pytest (>=2.4.2) @@ -410,7 +412,7 @@ This list contains 969 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Dec 18, 2021 3 - Alpha pytest (==6.2.5) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Dec 24, 2021 3 - Alpha pytest (==6.2.5) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jul 12, 2021 N/A pytest (>=5.0) :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Aug 29, 2021 4 - Beta N/A @@ -421,11 +423,11 @@ This list contains 969 plugins. :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Apr 25, 2021 N/A N/A :pypi:`pytest-html-thread` pytest plugin for generating HTML reports Dec 29, 2020 5 - Production/Stable N/A :pypi:`pytest-http` Fixture "http" for http requests Dec 05, 2019 N/A N/A - :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Feb 11, 2019 5 - Production/Stable N/A + :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Dec 25, 2021 5 - Production/Stable N/A :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Dec 15, 2021 3 - Alpha N/A - :pypi:`pytest-httpx` Send responses to httpx. Nov 16, 2021 5 - Production/Stable pytest (==6.*) + :pypi:`pytest-httpx` Send responses to httpx. Dec 23, 2021 5 - Production/Stable pytest (==6.*) :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest @@ -433,7 +435,7 @@ This list contains 969 plugins. :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Dec 15, 2021 4 - Beta pytest :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A - :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Nov 26, 2021 N/A N/A + :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Dec 24, 2021 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A :pypi:`pytest-image-diff` Jul 28, 2021 3 - Alpha pytest :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A @@ -538,7 +540,7 @@ This list contains 969 plugins. :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Dec 03, 2021 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Dec 22, 2021 N/A pytest (>=1.0) :pypi:`pytest-mock-server` Mock server plugin for pytest Apr 06, 2020 4 - Beta N/A :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-modifyjunit` Utility for adding additional properties to junit xml for IDM QE Jan 10, 2019 N/A N/A @@ -546,7 +548,7 @@ This list contains 969 plugins. :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Oct 06, 2021 5 - Production/Stable N/A :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Jun 07, 2021 5 - Production/Stable pytest :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures Dec 07, 2019 5 - Production/Stable pytest (>=2.5.2) - :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Aug 24, 2021 5 - Production/Stable pytest + :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Dec 23, 2021 5 - Production/Stable pytest :pypi:`pytest-monkeyplus` pytest's monkeypatch subclass with extra functionalities Sep 18, 2012 5 - Production/Stable N/A :pypi:`pytest-monkeytype` pytest-monkeytype: Generate Monkeytype annotations from your pytest tests. Jul 29, 2020 4 - Beta N/A :pypi:`pytest-moto` Fixtures for integration tests of AWS services,uses moto mocking library. Aug 28, 2015 1 - Planning N/A @@ -626,7 +628,7 @@ This list contains 969 plugins. :pypi:`pytest-perf` pytest-perf Jun 27, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) :pypi:`pytest-persistence` Pytest tool for persistent objects Dec 07, 2021 N/A N/A - :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Dec 10, 2021 5 - Production/Stable pytest + :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Dec 25, 2021 5 - Production/Stable pytest :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Nov 10, 2021 4 - Beta pytest (>=6.2) ; extra == 'test' :pypi:`pytest-picked` Run the tests related to the changed files Dec 23, 2020 N/A pytest (>=3.5.0) @@ -657,7 +659,7 @@ This list contains 969 plugins. :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Aug 19, 2021 5 - Production/Stable pytest :pypi:`pytest-portion` Select a portion of the collected tests Jan 28, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest - :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Nov 05, 2021 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Dec 22, 2021 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Nov 24, 2021 N/A pytest (>=3.4.1) :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A @@ -722,7 +724,7 @@ This list contains 969 plugins. :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Jun 14, 2019 5 - Production/Stable pytest (<5,>=3) :pypi:`pytest-remfiles` Pytest plugin to create a temporary directory with remote files Jul 01, 2019 5 - Production/Stable N/A - :pypi:`pytest-remotedata` Pytest plugin for controlling remote data access. Jul 20, 2019 3 - Alpha pytest (>=3.1) + :pypi:`pytest-remotedata` Pytest plugin for controlling remote data access. Dec 21, 2021 3 - Alpha pytest (>=4.6) :pypi:`pytest-remote-response` Pytest plugin for capturing and mocking connection requests. Jun 30, 2021 4 - Beta pytest (>=4.6) :pypi:`pytest-remove-stale-bytecode` py.test plugin to remove stale byte code files. Mar 04, 2020 4 - Beta pytest :pypi:`pytest-reorder` Reorder tests depending on their paths and names. May 31, 2018 4 - Beta pytest @@ -740,6 +742,7 @@ This list contains 969 plugins. :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Jun 18, 2021 N/A pytest (>=3.8.0) :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Jun 17, 2021 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) @@ -758,7 +761,7 @@ This list contains 969 plugins. :pypi:`pytest-rotest` Pytest integration with rotest Sep 08, 2019 N/A pytest (>=3.5.0) :pypi:`pytest-rpc` Extend py.test for RPC OpenStack testing. Feb 22, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-rst` Test code from RST documents with pytest Sep 21, 2021 N/A pytest - :pypi:`pytest-rt` pytest data collector plugin for Testgr Sep 04, 2021 N/A N/A + :pypi:`pytest-rt` pytest data collector plugin for Testgr Dec 22, 2021 N/A N/A :pypi:`pytest-rts` Coverage-based regression test selection (RTS) plugin for pytest May 17, 2021 N/A pytest :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A @@ -772,13 +775,13 @@ This list contains 969 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Dec 17, 2021 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Dec 24, 2021 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Aug 31, 2020 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Dec 17, 2021 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Dec 24, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -813,10 +816,12 @@ This list contains 969 plugins. :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Dec 02, 2021 4 - Beta pytest (>=3.0.0) :pypi:`pytest-snmpserver` May 12, 2021 N/A N/A - :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Aug 28, 2021 4 - Beta pytest (>=3.6.3) + :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Dec 19, 2021 4 - Beta pytest (>=6.2.0) + :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Dec 23, 2021 4 - Beta pytest (>=3.6.3) :pypi:`pytest-soft-assertions` May 05, 2020 3 - Alpha pytest :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) :pypi:`pytest-sorter` A simple plugin to first execute tests that historically failed more Apr 20, 2021 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Dec 20, 2021 2 - Pre-Alpha pytest :pypi:`pytest-sourceorder` Test-ordering plugin for pytest Sep 01, 2021 4 - Beta pytest :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. Feb 23, 2020 4 - Beta pytest :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A @@ -824,6 +829,7 @@ This list contains 969 plugins. :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Aug 05, 2020 4 - Beta N/A :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Oct 13, 2021 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A + :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Dec 22, 2021 6 - Mature pytest (>=6.2.4) :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Nov 09, 2021 4 - Beta pytest (>=5,<7) :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) @@ -993,7 +999,7 @@ This list contains 969 plugins. :pypi:`pytest-accept` - *last release*: Nov 22, 2021, + *last release*: Dec 22, 2021, *status*: N/A, *requires*: pytest (>=6,<7) @@ -1105,7 +1111,7 @@ This list contains 969 plugins. :pypi:`pytest-alembic` - *last release*: Dec 02, 2021, + *last release*: Dec 21, 2021, *status*: N/A, *requires*: pytest (>=1.0) @@ -1588,7 +1594,7 @@ This list contains 969 plugins. Pytest plugin to emit notifications via the Blink(1) RGB LED :pypi:`pytest-blockage` - *last release*: Feb 13, 2019, + *last release*: Dec 21, 2021, *status*: N/A, *requires*: pytest @@ -1931,7 +1937,7 @@ This list contains 969 plugins. PyTest plugin for testing Smart Contracts for Ethereum blockchain. :pypi:`pytest-codeblocks` - *last release*: Dec 11, 2021, + *last release*: Dec 21, 2021, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -2602,6 +2608,13 @@ This list contains 969 plugins. A documentation plugin for py.test. + :pypi:`pytest-docfiles` + *last release*: Dec 22, 2021, + *status*: 4 - Beta, + *requires*: pytest (>=3.7.0) + + pytest plugin to test codeblocks in your documentation. + :pypi:`pytest-docgen` *last release*: Apr 17, 2020, *status*: N/A, @@ -3099,6 +3112,13 @@ This list contains 969 plugins. pytest plugin for testing executables + :pypi:`pytest-execution-timer` + *last release*: Dec 24, 2021, + *status*: 4 - Beta, + *requires*: N/A + + A timer for the phases of Pytest's execution. + :pypi:`pytest-expect` *last release*: Apr 21, 2016, *status*: 4 - Beta, @@ -3737,7 +3757,7 @@ This list contains 969 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Dec 18, 2021, + *last release*: Dec 24, 2021, *status*: 3 - Alpha, *requires*: pytest (==6.2.5) @@ -3814,7 +3834,7 @@ This list contains 969 plugins. Fixture "http" for http requests :pypi:`pytest-httpbin` - *last release*: Feb 11, 2019, + *last release*: Dec 25, 2021, *status*: 5 - Production/Stable, *requires*: N/A @@ -3842,7 +3862,7 @@ This list contains 969 plugins. pytest-httpserver is a httpserver for pytest :pypi:`pytest-httpx` - *last release*: Nov 16, 2021, + *last release*: Dec 23, 2021, *status*: 5 - Production/Stable, *requires*: pytest (==6.*) @@ -3898,7 +3918,7 @@ This list contains 969 plugins. A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api :pypi:`pytest-idempotent` - *last release*: Nov 26, 2021, + *last release*: Dec 24, 2021, *status*: N/A, *requires*: N/A @@ -4633,7 +4653,7 @@ This list contains 969 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Dec 03, 2021, + *last release*: Dec 22, 2021, *status*: N/A, *requires*: pytest (>=1.0) @@ -4689,7 +4709,7 @@ This list contains 969 plugins. pytest plugin for MongoDB fixtures :pypi:`pytest-monitor` - *last release*: Aug 24, 2021, + *last release*: Dec 23, 2021, *status*: 5 - Production/Stable, *requires*: pytest @@ -5249,7 +5269,7 @@ This list contains 969 plugins. Pytest tool for persistent objects :pypi:`pytest-pg` - *last release*: Dec 10, 2021, + *last release*: Dec 25, 2021, *status*: 5 - Production/Stable, *requires*: pytest @@ -5466,9 +5486,9 @@ This list contains 969 plugins. Run PostgreSQL in Docker container in Pytest. :pypi:`pytest-postgresql` - *last release*: Nov 05, 2021, + *last release*: Dec 22, 2021, *status*: 5 - Production/Stable, - *requires*: pytest (>=3.0.0) + *requires*: pytest (>=6.2.0) Postgresql fixtures and fixture factories for Pytest. @@ -5921,9 +5941,9 @@ This list contains 969 plugins. Pytest plugin to create a temporary directory with remote files :pypi:`pytest-remotedata` - *last release*: Jul 20, 2019, + *last release*: Dec 21, 2021, *status*: 3 - Alpha, - *requires*: pytest (>=3.1) + *requires*: pytest (>=4.6) Pytest plugin for controlling remote data access. @@ -6046,6 +6066,13 @@ This list contains 969 plugins. A simple plugin to use with pytest + :pypi:`pytest-requires` + *last release*: Dec 21, 2021, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + A pytest plugin to elegantly skip tests with optional requirements + :pypi:`pytest-reraise` *last release*: Jun 17, 2021, *status*: 5 - Production/Stable, @@ -6173,7 +6200,7 @@ This list contains 969 plugins. Test code from RST documents with pytest :pypi:`pytest-rt` - *last release*: Sep 04, 2021, + *last release*: Dec 22, 2021, *status*: N/A, *requires*: N/A @@ -6271,7 +6298,7 @@ This list contains 969 plugins. :pypi:`pytest-sbase` - *last release*: Dec 17, 2021, + *last release*: Dec 24, 2021, *status*: 5 - Production/Stable, *requires*: N/A @@ -6313,7 +6340,7 @@ This list contains 969 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Dec 17, 2021, + *last release*: Dec 24, 2021, *status*: 5 - Production/Stable, *requires*: N/A @@ -6557,8 +6584,15 @@ This list contains 969 plugins. + :pypi:`pytest-snowflake-bdd` + *last release*: Dec 19, 2021, + *status*: 4 - Beta, + *requires*: pytest (>=6.2.0) + + Setup test data and run tests on snowflake in BDD style! + :pypi:`pytest-socket` - *last release*: Aug 28, 2021, + *last release*: Dec 23, 2021, *status*: 4 - Beta, *requires*: pytest (>=3.6.3) @@ -6585,6 +6619,13 @@ This list contains 969 plugins. A simple plugin to first execute tests that historically failed more + :pypi:`pytest-sosu` + *last release*: Dec 20, 2021, + *status*: 2 - Pre-Alpha, + *requires*: pytest + + Unofficial PyTest plugin for Sauce Labs + :pypi:`pytest-sourceorder` *last release*: Sep 01, 2021, *status*: 4 - Beta, @@ -6634,6 +6675,13 @@ This list contains 969 plugins. Splinter plugin for pytest testing framework + :pypi:`pytest-splinter4` + *last release*: Dec 22, 2021, + *status*: 6 - Mature, + *requires*: pytest (>=6.2.4) + + Pytest plugin for the splinter automation library + :pypi:`pytest-split` *last release*: Nov 09, 2021, *status*: 4 - Beta, From 5599c5ad4589994c7816364139d6bedae4c5fd46 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Sat, 25 Dec 2021 12:04:59 +0100 Subject: [PATCH 042/549] Drop Python3.6 in CI, setup.cfg, and readme. --- .github/workflows/main.yml | 10 ---------- README.rst | 2 +- changelog/9437.breaking.rst | 1 + doc/en/getting-started.rst | 2 +- doc/en/index.rst | 4 ++-- setup.cfg | 3 +-- tox.ini | 1 - 7 files changed, 6 insertions(+), 17 deletions(-) create mode 100644 changelog/9437.breaking.rst diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bbc48adb49a..0416b8cf406 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,14 +31,12 @@ jobs: fail-fast: false matrix: name: [ - "windows-py36", "windows-py37", "windows-py37-pluggy", "windows-py38", "windows-py39", "windows-py310", - "ubuntu-py36", "ubuntu-py37", "ubuntu-py37-pluggy", "ubuntu-py37-freeze", @@ -56,10 +54,6 @@ jobs: ] include: - - name: "windows-py36" - python: "3.6" - os: windows-latest - tox_env: "py36-xdist" - name: "windows-py37" python: "3.7" os: windows-latest @@ -82,10 +76,6 @@ jobs: os: windows-latest tox_env: "py310-xdist" - - name: "ubuntu-py36" - python: "3.6" - os: ubuntu-latest - tox_env: "py36-xdist" - name: "ubuntu-py37" python: "3.7" os: ubuntu-latest diff --git a/README.rst b/README.rst index 14733765173..47e780ad63d 100644 --- a/README.rst +++ b/README.rst @@ -100,7 +100,7 @@ Features - Can run `unittest `_ (or trial), `nose `_ test suites out of the box -- Python 3.6+ and PyPy3 +- Python 3.7+ and PyPy3 - Rich plugin architecture, with over 850+ `external plugins `_ and thriving community diff --git a/changelog/9437.breaking.rst b/changelog/9437.breaking.rst new file mode 100644 index 00000000000..60d4337f420 --- /dev/null +++ b/changelog/9437.breaking.rst @@ -0,0 +1 @@ +Dropped support for Python 3.6, which reached `end-of-life `__ at 2021-12-23. diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index 6b2ff672c59..40060a60da4 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -9,7 +9,7 @@ Get Started Install ``pytest`` ---------------------------------------- -``pytest`` requires: Python 3.6, 3.7, 3.8, 3.9, or PyPy3. +``pytest`` requires: Python 3.7, 3.8, 3.9, or PyPy3. 1. Run the following command in your command line: diff --git a/doc/en/index.rst b/doc/en/index.rst index 3d7c2f53709..46d501ede83 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -17,7 +17,7 @@ The ``pytest`` framework makes it easy to write small, readable tests, and can scale to support complex functional testing for applications and libraries. -**Pythons**: ``pytest`` requires: Python 3.6, 3.7, 3.8, 3.9, or PyPy3. +**Pythons**: ``pytest`` requires: Python 3.7, 3.8, 3.9, or PyPy3. **PyPI package name**: :pypi:`pytest` @@ -78,7 +78,7 @@ Features - Can run :ref:`unittest ` (including trial) and :ref:`nose ` test suites out of the box -- Python 3.6+ and PyPy 3 +- Python 3.7+ and PyPy 3 - Rich plugin architecture, with over 800+ :ref:`external plugins ` and thriving community diff --git a/setup.cfg b/setup.cfg index 26a5d2e63e5..fe6ea4095bc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,7 +17,6 @@ classifiers = Operating System :: POSIX Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 @@ -51,7 +50,7 @@ install_requires = atomicwrites>=1.0;sys_platform=="win32" colorama;sys_platform=="win32" importlib-metadata>=0.12;python_version<"3.8" -python_requires = >=3.6 +python_requires = >=3.7 package_dir = =src setup_requires = diff --git a/tox.ini b/tox.ini index 9d26051ebb7..42e1ee1c777 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,6 @@ minversion = 3.20.0 distshare = {homedir}/.tox/distshare envlist = linting - py36 py37 py38 py39 From 0da4760715bebb130cc8bb84bdd6715cc9a2e0c4 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 27 Dec 2021 11:22:00 +0200 Subject: [PATCH 043/549] code: accept any `os.PathLike[str]` in `Traceback.cut` Before 7.0.0rc1, the function accepted `Union[str, py.path.local]`, and `py.path.local` compares equal to the string path, so a user was able to pass the path as a string and it would work. In 7.0.0rc1 we changed the `py.path.local` to `Path` which doesn't compare equal to the string path, which breaks compatibility (e.g. the `sybil` package). This restores compatibility for this function by accepting any `os.PathLike[str]` and only comparing the string representations. --- src/_pytest/_code/code.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index b19ee7c64d9..291d8890c6b 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -1,5 +1,6 @@ import ast import inspect +import os import re import sys import traceback @@ -343,10 +344,10 @@ def f(cur: TracebackType) -> Iterable[TracebackEntry]: def cut( self, - path: Optional[Union[Path, str]] = None, + path: Optional[Union["os.PathLike[str]", str]] = None, lineno: Optional[int] = None, firstlineno: Optional[int] = None, - excludepath: Optional[Path] = None, + excludepath: Optional["os.PathLike[str]"] = None, ) -> "Traceback": """Return a Traceback instance wrapping part of this Traceback. @@ -357,15 +358,17 @@ def cut( for formatting reasons (removing some uninteresting bits that deal with handling of the exception/traceback). """ + path_ = None if path is None else os.fspath(path) + excludepath_ = None if excludepath is None else os.fspath(excludepath) for x in self: code = x.frame.code codepath = code.path - if path is not None and codepath != path: + if path is not None and str(codepath) != path_: continue if ( excludepath is not None and isinstance(codepath, Path) - and excludepath in codepath.parents + and excludepath_ in (str(p) for p in codepath.parents) # type: ignore[operator] ): continue if lineno is not None and x.lineno != lineno: From 55debfad1f690d11da3b33022d55c49060460e44 Mon Sep 17 00:00:00 2001 From: "Kian Meng, Ang" Date: Mon, 27 Dec 2021 20:23:15 +0800 Subject: [PATCH 044/549] Fix typos (#9424) --- AUTHORS | 1 + doc/en/announce/release-2.5.0.rst | 2 +- doc/en/changelog.rst | 14 +++++++------- doc/en/history.rst | 2 +- doc/en/how-to/skipping.rst | 2 +- doc/en/reference/fixtures.rst | 2 +- src/_pytest/_code/code.py | 2 +- src/_pytest/assertion/rewrite.py | 2 +- src/_pytest/assertion/util.py | 2 +- src/_pytest/config/__init__.py | 2 +- src/_pytest/config/compat.py | 2 +- src/_pytest/junitxml.py | 2 +- src/_pytest/mark/expression.py | 2 +- src/_pytest/pytester.py | 2 +- src/_pytest/python.py | 2 +- testing/acceptance_test.py | 2 +- testing/code/test_source.py | 2 +- testing/test_compat.py | 4 ++-- testing/test_config.py | 4 ++-- testing/test_doctest.py | 4 ++-- testing/test_runner.py | 2 +- testing/test_stash.py | 2 +- testing/test_warnings.py | 4 ++-- tox.ini | 4 ++-- 24 files changed, 35 insertions(+), 34 deletions(-) diff --git a/AUTHORS b/AUTHORS index 25b55e5aed2..9413f9c2e74 100644 --- a/AUTHORS +++ b/AUTHORS @@ -185,6 +185,7 @@ Katerina Koukiou Keri Volans Kevin Cox Kevin J. Foley +Kian-Meng Ang Kodi B. Arfer Kostis Anagnostopoulos Kristoffer Nordström diff --git a/doc/en/announce/release-2.5.0.rst b/doc/en/announce/release-2.5.0.rst index bc83fdc122c..c6cdcdd8a83 100644 --- a/doc/en/announce/release-2.5.0.rst +++ b/doc/en/announce/release-2.5.0.rst @@ -11,7 +11,7 @@ clear information about the circumstances and a simple example which reproduces the problem. The issue tracker is of course not empty now. We have many remaining -"enhacement" issues which we'll hopefully can tackle in 2014 with your +"enhancement" issues which we'll hopefully can tackle in 2014 with your help. For those who use older Python versions, please note that pytest is not diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index c5ccc75e3af..15ac02d83ae 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -538,7 +538,7 @@ Bug Fixes the ``tmp_path``/``tmpdir`` fixture). Now the directories are created with private permissions. - pytest used to silenty use a pre-existing ``/tmp/pytest-of-`` directory, + pytest used to silently use a pre-existing ``/tmp/pytest-of-`` directory, even if owned by another user. This means another user could pre-create such a directory and gain control of another user's temporary directory. Now such a condition results in an error. @@ -1304,7 +1304,7 @@ Improvements is not displayed by default for passing tests. This change makes the mistake visible during testing. - You may supress this behavior temporarily or permanently by setting + You may suppress this behavior temporarily or permanently by setting ``logging.raiseExceptions = False``. @@ -1759,7 +1759,7 @@ Bug Fixes it was swallowed and ignored (regression in pytest 5.1.0). -- :issue:`6801`: Do not display empty lines inbetween traceback for unexpected exceptions with doctests. +- :issue:`6801`: Do not display empty lines in between traceback for unexpected exceptions with doctests. - :issue:`6802`: The :fixture:`testdir fixture ` works within doctests now. @@ -4628,7 +4628,7 @@ Bug Fixes - Fixed a bug where stdout and stderr were logged twice by junitxml when a test was marked xfail. (:issue:`3491`) -- Fix ``usefixtures`` mark applyed to unittest tests by correctly instantiating +- Fix ``usefixtures`` mark applied to unittest tests by correctly instantiating ``FixtureInfo``. (:issue:`3498`) - Fix assertion rewriter compatibility with libraries that monkey patch @@ -8009,7 +8009,7 @@ Bug fixes: or through plugin hooks. Also introduce a "--strict" option which will treat unregistered markers as errors allowing to avoid typos and maintain a well described set of markers - for your test suite. See exaples at http://pytest.org/en/stable/how-to/mark.html + for your test suite. See examples at http://pytest.org/en/stable/how-to/mark.html and its links. - issue50: introduce "-m marker" option to select tests based on markers (this is a stricter and more predictable version of '-k' in that "-m" @@ -8321,7 +8321,7 @@ Bug fixes: - fix issue57 -f|--looponfail to work with xpassing tests (thanks Ronny) - fix issue92 collectonly reporter and --pastebin (thanks Benjamin Peterson) - fix py.code.compile(source) to generate unique filenames -- fix assertion re-interp problems on PyPy, by defering code +- fix assertion re-interp problems on PyPy, by deferring code compilation to the (overridable) Frame.eval class. (thanks Amaury Forgeot) - fix py.path.local.pyimport() to work with directories - streamline py.path.local.mkdtemp implementation and usage @@ -8395,7 +8395,7 @@ Bug fixes: - improve support for raises and other dynamically compiled code by manipulating python's linecache.cache instead of the previous rather hacky way of creating custom code objects. This makes - it seemlessly work on Jython and PyPy where it previously didn't. + it seamlessly work on Jython and PyPy where it previously didn't. - fix issue96: make capturing more resilient against Control-C interruptions (involved somewhat substantial refactoring diff --git a/doc/en/history.rst b/doc/en/history.rst index 796a42486ca..bb5aa493022 100644 --- a/doc/en/history.rst +++ b/doc/en/history.rst @@ -139,7 +139,7 @@ project: which adds ``pytest`` (rather than ``py.test``) as the recommended command-line entry point -Due to this history, it's diffcult to answer the question when pytest was started. +Due to this history, it's difficult to answer the question when pytest was started. It depends what point should really be seen as the start of it all. One possible interpretation is to pick Europython 2004, i.e. around June/July 2004. diff --git a/doc/en/how-to/skipping.rst b/doc/en/how-to/skipping.rst index 9b74628d59f..e2f59c77ae8 100644 --- a/doc/en/how-to/skipping.rst +++ b/doc/en/how-to/skipping.rst @@ -369,7 +369,7 @@ Here is a simple test file with the several usages: Running it with the report-on-xfail option gives this output: -.. FIXME: Use $ instead of ! again to reenable regendoc once it's fixed: +.. FIXME: Use $ instead of ! again to re-enable regendoc once it's fixed: https://github.com/pytest-dev/pytest/issues/8807 .. code-block:: pytest diff --git a/doc/en/reference/fixtures.rst b/doc/en/reference/fixtures.rst index 35b79021209..da2c5e009c3 100644 --- a/doc/en/reference/fixtures.rst +++ b/doc/en/reference/fixtures.rst @@ -208,7 +208,7 @@ the one defined in ``tests/test_top.py`` would be unavailable to it because it would have to step down a level (step inside a circle) to find it. The first fixture the test finds is the one that will be used, so -:ref:`fixtures can be overriden ` if you need to change or +:ref:`fixtures can be overridden ` if you need to change or extend what one does for a particular scope. You can also use the ``conftest.py`` file to implement diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index b19ee7c64d9..12ce135529c 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -895,7 +895,7 @@ def _truncate_recursive_traceback( max_frames=max_frames, total=len(traceback), ) - # Type ignored because adding two instaces of a List subtype + # Type ignored because adding two instances of a List subtype # currently incorrectly has type List instead of the subtype. traceback = traceback[:max_frames] + traceback[-max_frames:] # type: ignore else: diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index 50b367e25ef..e9ecedfaa52 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -513,7 +513,7 @@ def _call_assertion_pass(lineno: int, orig: str, expl: str) -> None: def _check_if_assertion_pass_impl() -> bool: """Check if any plugins implement the pytest_assertion_pass hook - in order not to generate explanation unecessarily (might be expensive).""" + in order not to generate explanation unnecessarily (might be expensive).""" return True if util._assertion_pass else False diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index c26ff90dc53..14512a7c5ca 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -142,7 +142,7 @@ def has_default_eq( First, we check if the object's __eq__ attribute has __code__, if so, we check the equally of the method code filename (__code__.co_filename) - to the default onces generated by the dataclass and attr module + to the default one generated by the dataclass and attr module for dataclasses the default co_filename is , for attrs class, the __eq__ should contain "attrs eq generated" """ # inspired from https://github.com/willmcgugan/rich/blob/07d51ffc1aee6f16bd2e5a25b4e82850fb9ed778/rich/pretty.py#L68 diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 4cb22009a06..1bdd8effba2 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -970,7 +970,7 @@ def inipath(self) -> Optional[Path]: def add_cleanup(self, func: Callable[[], None]) -> None: """Add a function to be called when the config object gets out of - use (usually coninciding with pytest_unconfigure).""" + use (usually coinciding with pytest_unconfigure).""" self._cleanup.append(func) def _do_configure(self) -> None: diff --git a/src/_pytest/config/compat.py b/src/_pytest/config/compat.py index 8f82dd9f9d7..ba267d21505 100644 --- a/src/_pytest/config/compat.py +++ b/src/_pytest/config/compat.py @@ -23,7 +23,7 @@ class PathAwareHookProxy: this helper wraps around hook callers until pluggy supports fixingcalls, this one will do - it currently doesnt return full hook caller proxies for fixed hooks, + it currently doesn't return full hook caller proxies for fixed hooks, this may have to be changed later depending on bugs """ diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py index 8249dccffed..1b9e3bfecac 100644 --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -256,7 +256,7 @@ def append_skipped(self, report: TestReport) -> None: def finalize(self) -> None: data = self.to_xml() self.__dict__.clear() - # Type ignored becuase mypy doesn't like overriding a method. + # Type ignored because mypy doesn't like overriding a method. # Also the return value doesn't match... self.to_xml = lambda: data # type: ignore[assignment] diff --git a/src/_pytest/mark/expression.py b/src/_pytest/mark/expression.py index 9d57e944b92..92220d7723a 100644 --- a/src/_pytest/mark/expression.py +++ b/src/_pytest/mark/expression.py @@ -190,7 +190,7 @@ def __len__(self) -> int: class Expression: """A compiled match expression as used by -k and -m. - The expression can be evaulated against different matchers. + The expression can be evaluated against different matchers. """ __slots__ = ("code",) diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 42e71ff917e..84547535d5f 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -1288,7 +1288,7 @@ def collect_by_name( ) -> Optional[Union[Item, Collector]]: """Return the collection node for name from the module collection. - Searchs a module collection node for a collection node matching the + Searches a module collection node for a collection node matching the given name. :param modcol: A module collection node; see :py:meth:`getmodulecol`. diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 197d36ee9df..8db9e748975 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1655,7 +1655,7 @@ def __init__( # this will be redeemed later for mark in callspec.marks: # feel free to cry, this was broken for years before - # and keywords cant fix it per design + # and keywords can't fix it per design self.keywords[mark.name] = mark self.own_markers.extend(normalize_mark_list(callspec.marks)) if keywords: diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index bfd1fe6e668..8b8d4a4a6ed 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -1281,7 +1281,7 @@ def test_simple(): reason="Windows raises `OSError: [Errno 22] Invalid argument` instead", ) def test_no_brokenpipeerror_message(pytester: Pytester) -> None: - """Ensure that the broken pipe error message is supressed. + """Ensure that the broken pipe error message is suppressed. In some Python versions, it reaches sys.unraisablehook, in others a BrokenPipeError exception is propagated, but either way it prints diff --git a/testing/code/test_source.py b/testing/code/test_source.py index b7b3c17115a..fd2c9fc9719 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -483,7 +483,7 @@ def deco_fixture(): src = inspect.getsource(deco_fixture) assert src == " @pytest.fixture\n def deco_fixture():\n assert False\n" - # currenly Source does not unwrap decorators, testing the + # currently Source does not unwrap decorators, testing the # existing behavior here for explicitness, but perhaps we should revisit/change this # in the future assert str(Source(deco_fixture)).startswith("@functools.wraps(function)") diff --git a/testing/test_compat.py b/testing/test_compat.py index 9f48a31d689..8471a1a50f6 100644 --- a/testing/test_compat.py +++ b/testing/test_compat.py @@ -156,11 +156,11 @@ def raise_baseexception(self): @property def raise_exception(self): - raise Exception("exception should be catched") + raise Exception("exception should be caught") @property def raise_fail_outcome(self): - pytest.fail("fail should be catched") + pytest.fail("fail should be caught") def test_helper_failures() -> None: diff --git a/testing/test_config.py b/testing/test_config.py index 4435591164f..9a57b919dd9 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -386,7 +386,7 @@ def pytest_configure(config): pytest.param( """ [some_other_header] - required_plugins = wont be triggered + required_plugins = won't be triggered [pytest] """, "1.5", @@ -807,7 +807,7 @@ def test_confcutdir_check_isdir(self, pytester: Pytester) -> None: with pytest.raises(pytest.UsageError, match=exp_match): pytester.parseconfig("--confcutdir", pytester.path.joinpath("file")) with pytest.raises(pytest.UsageError, match=exp_match): - pytester.parseconfig("--confcutdir", pytester.path.joinpath("inexistant")) + pytester.parseconfig("--confcutdir", pytester.path.joinpath("nonexistent")) p = pytester.mkdir("dir") config = pytester.parseconfig("--confcutdir", p) diff --git a/testing/test_doctest.py b/testing/test_doctest.py index ca215e070fa..e85f44f93f4 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -80,7 +80,7 @@ def test_collect_module_two_doctest_no_modulelevel( '# Empty' def my_func(): ">>> magic = 42 " - def unuseful(): + def useless(): ''' # This is a function # >>> # it doesn't have any doctest @@ -564,7 +564,7 @@ def my_func(): >>> magic - 42 0 ''' - def unuseful(): + def useless(): pass def another(): ''' diff --git a/testing/test_runner.py b/testing/test_runner.py index a34cd98f964..2e2c462d978 100644 --- a/testing/test_runner.py +++ b/testing/test_runner.py @@ -287,7 +287,7 @@ def teardown_class(cls): def test_func(): import sys - # on python2 exc_info is keept till a function exits + # on python2 exc_info is kept till a function exits # so we would end up calling test functions while # sys.exc_info would return the indexerror # from guessing the lastitem diff --git a/testing/test_stash.py b/testing/test_stash.py index bb294f5da35..2c9df4832e4 100644 --- a/testing/test_stash.py +++ b/testing/test_stash.py @@ -56,7 +56,7 @@ def test_stash() -> None: with pytest.raises(AttributeError): stash.foo = "nope" # type: ignore[attr-defined] - # No interaction with anoter stash. + # No interaction with another stash. stash2 = Stash() key3 = StashKey[int]() assert key2 not in stash2 diff --git a/testing/test_warnings.py b/testing/test_warnings.py index 3ae9ea33181..734e1ebb5cd 100644 --- a/testing/test_warnings.py +++ b/testing/test_warnings.py @@ -289,7 +289,7 @@ def pytest_warning_recorded(self, warning_message, when, nodeid, location): assert collected_result[2] == expected_result[2], str(collected) # NOTE: collected_result[3] is location, which differs based on the platform you are on - # thus, the best we can do here is assert the types of the paremeters match what we expect + # thus, the best we can do here is assert the types of the parameters match what we expect # and not try and preload it in the expected array if collected_result[3] is not None: assert type(collected_result[3][0]) is str, str(collected) @@ -708,7 +708,7 @@ def test_issue4445_preparse(self, pytester: Pytester, capwarn) -> None: pytester.parseconfig("--help") # with stacklevel=2 the warning should originate from config._preparse and is - # thrown by an errorneous conftest.py + # thrown by an erroneous conftest.py assert len(capwarn.captured) == 1 warning, location = capwarn.captured.pop() file, _, func = location diff --git a/tox.ini b/tox.ini index 9d26051ebb7..6d30e0b0dca 100644 --- a/tox.ini +++ b/tox.ini @@ -130,7 +130,7 @@ commands = {envpython} tox_run.py [testenv:release] -decription = do a release, required posarg of the version number +description = do a release, required posarg of the version number basepython = python3 usedevelop = True passenv = * @@ -144,7 +144,7 @@ deps = commands = python scripts/release.py {posargs} [testenv:prepare-release-pr] -decription = prepare a release PR from a manual trigger in GitHub actions +description = prepare a release PR from a manual trigger in GitHub actions usedevelop = {[testenv:release]usedevelop} passenv = {[testenv:release]passenv} deps = {[testenv:release]deps} From 0db1ff0d82322fffd8667103e87a42dd1a3b5a9a Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 27 Dec 2021 15:23:20 +0200 Subject: [PATCH 045/549] doc: document {Code,TracebackEntry}.path changes as breaking Closes #9423. --- doc/en/changelog.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 15ac02d83ae..6896072e1ab 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -173,6 +173,12 @@ Deprecations This was changed for consistency with :func:`pytest.mark.skip ` and :func:`pytest.mark.xfail ` which both accept ``reason`` as an argument. +- `#8174 `_: The following changes have been made to types reachable through :attr:`pytest.ExceptionInfo.traceback`: + + - The ``path`` property of ``_pytest.code.Code`` returns ``Path`` instead of ``py.path.local``. + - The ``path`` property of ``_pytest.code.TracebackEntry`` returns ``Path`` instead of ``py.path.local``. + + There was no deprecation period for this change (sorry!). Features @@ -473,10 +479,9 @@ Trivial/Internal Changes - `#8174 `_: The following changes have been made to internal pytest types/functions: - - The ``path`` property of ``_pytest.code.Code`` returns ``Path`` instead of ``py.path.local``. - - The ``path`` property of ``_pytest.code.TracebackEntry`` returns ``Path`` instead of ``py.path.local``. - The ``_pytest.code.getfslineno()`` function returns ``Path`` instead of ``py.path.local``. - The ``_pytest.python.path_matches_patterns()`` function takes ``Path`` instead of ``py.path.local``. + - The ``_pytest._code.Traceback.cut()`` function accepts any ``os.PathLike[str]``, not just ``py.path.local``. - `#8248 `_: Internal Restructure: let ``python.PyObjMixin`` inherit from ``nodes.Node`` to carry over typing information. From 1522afa1cd237d0ae269da229e79088061f6a3f4 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 28 Dec 2021 11:01:23 +0200 Subject: [PATCH 046/549] ci: run plugins job with python 3.9 instead of 3.7 Latest Django release dropped support for 3.7. --- .github/workflows/main.yml | 2 +- tox.ini | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bbc48adb49a..08a9aa3756b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -127,7 +127,7 @@ jobs: use_coverage: true - name: "plugins" - python: "3.7" + python: "3.9" os: ubuntu-latest tox_env: "plugins" diff --git a/tox.ini b/tox.ini index 6d30e0b0dca..82c688e8aed 100644 --- a/tox.ini +++ b/tox.ini @@ -100,9 +100,9 @@ commands = [testenv:plugins] # use latest versions of all plugins, including pre-releases pip_pre=true -# use latest pip and new dependency resolver (#7783) +# use latest pip to get new dependency resolver (#7783) download=true -install_command=python -m pip --use-feature=2020-resolver install {opts} {packages} +install_command=python -m pip install {opts} {packages} changedir = testing/plugins_integration deps = -rtesting/plugins_integration/requirements.txt setenv = From 3d7cd77017eaca7cf9fd76bd9756a2be2fc6a01a Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Sat, 25 Dec 2021 21:25:42 +0100 Subject: [PATCH 047/549] Update syntax to Python3.7+. --- .pre-commit-config.yaml | 4 ++-- doc/en/how-to/skipping.rst | 4 ++-- src/_pytest/assertion/rewrite.py | 5 ++--- src/_pytest/compat.py | 12 +----------- src/_pytest/logging.py | 12 +----------- src/_pytest/pytester.py | 2 +- testing/test_debugging.py | 3 +-- testing/test_parseopt.py | 2 +- 8 files changed, 11 insertions(+), 33 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1a740045015..f853528d537 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,12 +32,12 @@ repos: rev: v2.6.0 hooks: - id: reorder-python-imports - args: ['--application-directories=.:src', --py36-plus] + args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade rev: v2.29.1 hooks: - id: pyupgrade - args: [--py36-plus] + args: [--py37-plus] - repo: https://github.com/asottile/setup-cfg-fmt rev: v1.20.0 hooks: diff --git a/doc/en/how-to/skipping.rst b/doc/en/how-to/skipping.rst index 9b74628d59f..9e58dc49e29 100644 --- a/doc/en/how-to/skipping.rst +++ b/doc/en/how-to/skipping.rst @@ -84,14 +84,14 @@ It is also possible to skip the whole module using If you wish to skip something conditionally then you can use ``skipif`` instead. Here is an example of marking a test function to be skipped -when run on an interpreter earlier than Python3.6: +when run on an interpreter earlier than Python3.10: .. code-block:: python import sys - @pytest.mark.skipif(sys.version_info < (3, 7), reason="requires python3.7 or higher") + @pytest.mark.skipif(sys.version_info < (3, 10), reason="requires python3.10 or higher") def test_function(): ... diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index 50b367e25ef..cacbe359b0c 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -293,9 +293,8 @@ def _write_pyc_fp( # import. However, there's little reason to deviate. fp.write(importlib.util.MAGIC_NUMBER) # https://www.python.org/dev/peps/pep-0552/ - if sys.version_info >= (3, 7): - flags = b"\x00\x00\x00\x00" - fp.write(flags) + flags = b"\x00\x00\x00\x00" + fp.write(flags) # as of now, bytecode header expects 32-bit numbers for size and mtime (#4903) mtime = int(source_stat.st_mtime) & 0xFFFFFFFF size = source_stat.st_size & 0xFFFFFFFF diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index 5af01eb7d95..3193a9a2293 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -4,7 +4,7 @@ import inspect import os import sys -from contextlib import contextmanager +from contextlib import nullcontext as nullcontext # noqa: F401 from inspect import Parameter from inspect import signature from pathlib import Path @@ -186,16 +186,6 @@ def getfuncargnames( return arg_names -if sys.version_info < (3, 7): - - @contextmanager - def nullcontext(): - yield - -else: - from contextlib import nullcontext as nullcontext # noqa: F401 - - def get_default_arg_names(function: Callable[..., Any]) -> Tuple[str, ...]: # Note: this code intentionally mirrors the code at the beginning of # getfuncargnames, to get the arguments which were excluded from its result diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index 796a1c3f8af..bc4a23f6abb 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -3,7 +3,6 @@ import logging import os import re -import sys from contextlib import contextmanager from io import StringIO from pathlib import Path @@ -628,16 +627,7 @@ def set_log_path(self, fname: str) -> None: # https://github.com/python/mypy/issues/11193 stream: io.TextIOWrapper = fpath.open(mode="w", encoding="UTF-8") # type: ignore[assignment] - if sys.version_info >= (3, 7): - old_stream = self.log_file_handler.setStream(stream) - else: - old_stream = self.log_file_handler.stream - self.log_file_handler.acquire() - try: - self.log_file_handler.flush() - self.log_file_handler.stream = stream - finally: - self.log_file_handler.release() + old_stream = self.log_file_handler.setStream(stream) if old_stream: old_stream.close() diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 42e71ff917e..38eaef2fcc6 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -128,7 +128,7 @@ def get_open_files(self) -> List[Tuple[str, str]]: stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, check=True, - universal_newlines=True, + text=True, ).stdout def isopen(line: str) -> bool: diff --git a/testing/test_debugging.py b/testing/test_debugging.py index a822bb57f58..f3c271710d2 100644 --- a/testing/test_debugging.py +++ b/testing/test_debugging.py @@ -913,8 +913,7 @@ def test_foo(): class TestDebuggingBreakpoints: def test_supports_breakpoint_module_global(self) -> None: """Test that supports breakpoint global marks on Python 3.7+.""" - if sys.version_info >= (3, 7): - assert SUPPORTS_BREAKPOINT_BUILTIN is True + assert SUPPORTS_BREAKPOINT_BUILTIN is True @pytest.mark.skipif( not SUPPORTS_BREAKPOINT_BUILTIN, reason="Requires breakpoint() builtin" diff --git a/testing/test_parseopt.py b/testing/test_parseopt.py index 28529d04378..992f49bc53c 100644 --- a/testing/test_parseopt.py +++ b/testing/test_parseopt.py @@ -295,7 +295,7 @@ def test_argcomplete(pytester: Pytester, monkeypatch: MonkeyPatch) -> None: stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, check=True, - universal_newlines=True, + text=True, ).stdout except (OSError, subprocess.CalledProcessError): pytest.skip("bash is not available") From 400915067f1f867a79fbb21e19db1dd1b0de213f Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Sun, 26 Dec 2021 20:46:42 +0100 Subject: [PATCH 048/549] Move nullcontext import to src._pytest.logging. --- src/_pytest/compat.py | 1 - src/_pytest/logging.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index 3193a9a2293..e4c2a5fdac1 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -4,7 +4,6 @@ import inspect import os import sys -from contextlib import nullcontext as nullcontext # noqa: F401 from inspect import Parameter from inspect import signature from pathlib import Path diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index bc4a23f6abb..0163554bae4 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -4,6 +4,7 @@ import os import re from contextlib import contextmanager +from contextlib import nullcontext from io import StringIO from pathlib import Path from typing import AbstractSet @@ -21,7 +22,6 @@ from _pytest._io import TerminalWriter from _pytest.capture import CaptureManager from _pytest.compat import final -from _pytest.compat import nullcontext from _pytest.config import _strtobool from _pytest.config import Config from _pytest.config import create_terminal_writer From 77042f77ccbeb87efcdd2ab3db49cca8c85cf593 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Sun, 26 Dec 2021 20:52:14 +0100 Subject: [PATCH 049/549] Remove breakpoint support checking since all python versions support it. --- testing/test_debugging.py | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/testing/test_debugging.py b/testing/test_debugging.py index f3c271710d2..a95b542adec 100644 --- a/testing/test_debugging.py +++ b/testing/test_debugging.py @@ -8,14 +8,6 @@ from _pytest.monkeypatch import MonkeyPatch from _pytest.pytester import Pytester -try: - # Type ignored for Python <= 3.6. - breakpoint # type: ignore -except NameError: - SUPPORTS_BREAKPOINT_BUILTIN = False -else: - SUPPORTS_BREAKPOINT_BUILTIN = True - _ENVIRON_PYTHONBREAKPOINT = os.environ.get("PYTHONBREAKPOINT", "") @@ -911,13 +903,6 @@ def test_foo(): class TestDebuggingBreakpoints: - def test_supports_breakpoint_module_global(self) -> None: - """Test that supports breakpoint global marks on Python 3.7+.""" - assert SUPPORTS_BREAKPOINT_BUILTIN is True - - @pytest.mark.skipif( - not SUPPORTS_BREAKPOINT_BUILTIN, reason="Requires breakpoint() builtin" - ) @pytest.mark.parametrize("arg", ["--pdb", ""]) def test_sys_breakpointhook_configure_and_unconfigure( self, pytester: Pytester, arg: str @@ -951,9 +936,6 @@ def test_nothing(): pass result = pytester.runpytest_subprocess(*args) result.stdout.fnmatch_lines(["*1 passed in *"]) - @pytest.mark.skipif( - not SUPPORTS_BREAKPOINT_BUILTIN, reason="Requires breakpoint() builtin" - ) def test_pdb_custom_cls(self, pytester: Pytester, custom_debugger_hook) -> None: p1 = pytester.makepyfile( """ @@ -968,9 +950,6 @@ def test_nothing(): assert custom_debugger_hook == ["init", "set_trace"] @pytest.mark.parametrize("arg", ["--pdb", ""]) - @pytest.mark.skipif( - not SUPPORTS_BREAKPOINT_BUILTIN, reason="Requires breakpoint() builtin" - ) def test_environ_custom_class( self, pytester: Pytester, custom_debugger_hook, arg: str ) -> None: @@ -1001,9 +980,6 @@ def test_nothing(): pass result = pytester.runpytest_subprocess(*args) result.stdout.fnmatch_lines(["*1 passed in *"]) - @pytest.mark.skipif( - not SUPPORTS_BREAKPOINT_BUILTIN, reason="Requires breakpoint() builtin" - ) @pytest.mark.skipif( not _ENVIRON_PYTHONBREAKPOINT == "", reason="Requires breakpoint() default value", @@ -1024,9 +1000,6 @@ def test_1(): assert "reading from stdin while output" not in rest TestPDB.flush(child) - @pytest.mark.skipif( - not SUPPORTS_BREAKPOINT_BUILTIN, reason="Requires breakpoint() builtin" - ) def test_pdb_not_altered(self, pytester: Pytester) -> None: p1 = pytester.makepyfile( """ From b72ad0fa8e6f4461316572cda40917703521ae43 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Sun, 26 Dec 2021 20:59:03 +0100 Subject: [PATCH 050/549] Remove has_flags conditions from src._pytest.assertion.rewrite._read_pyc --- src/_pytest/assertion/rewrite.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index cacbe359b0c..e4007af2594 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -375,31 +375,29 @@ def _read_pyc( except OSError: return None with fp: - # https://www.python.org/dev/peps/pep-0552/ - has_flags = sys.version_info >= (3, 7) try: stat_result = os.stat(source) mtime = int(stat_result.st_mtime) size = stat_result.st_size - data = fp.read(16 if has_flags else 12) + data = fp.read(16) except OSError as e: trace(f"_read_pyc({source}): OSError {e}") return None # Check for invalid or out of date pyc file. - if len(data) != (16 if has_flags else 12): + if len(data) != (16): trace("_read_pyc(%s): invalid pyc (too short)" % source) return None if data[:4] != importlib.util.MAGIC_NUMBER: trace("_read_pyc(%s): invalid pyc (bad magic number)" % source) return None - if has_flags and data[4:8] != b"\x00\x00\x00\x00": + if data[4:8] != b"\x00\x00\x00\x00": trace("_read_pyc(%s): invalid pyc (unsupported flags)" % source) return None - mtime_data = data[8 if has_flags else 4 : 12 if has_flags else 8] + mtime_data = data[8:12] if int.from_bytes(mtime_data, "little") != mtime & 0xFFFFFFFF: trace("_read_pyc(%s): out of date" % source) return None - size_data = data[12 if has_flags else 8 : 16 if has_flags else 12] + size_data = data[12:16] if int.from_bytes(size_data, "little") != size & 0xFFFFFFFF: trace("_read_pyc(%s): invalid pyc (incorrect size)" % source) return None From e5bf3784a43422921a6018d54ce2555bc6273089 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Tue, 28 Dec 2021 12:06:55 +0100 Subject: [PATCH 051/549] Update required Python version in docs. --- README.rst | 2 +- doc/en/getting-started.rst | 2 +- doc/en/index.rst | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 47e780ad63d..f0fe3563219 100644 --- a/README.rst +++ b/README.rst @@ -100,7 +100,7 @@ Features - Can run `unittest `_ (or trial), `nose `_ test suites out of the box -- Python 3.7+ and PyPy3 +- Python 3.7+ or PyPy3 - Rich plugin architecture, with over 850+ `external plugins `_ and thriving community diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index 40060a60da4..47eed9c9354 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -9,7 +9,7 @@ Get Started Install ``pytest`` ---------------------------------------- -``pytest`` requires: Python 3.7, 3.8, 3.9, or PyPy3. +``pytest`` requires: Python 3.7+ or PyPy3. 1. Run the following command in your command line: diff --git a/doc/en/index.rst b/doc/en/index.rst index 46d501ede83..da0d3bd4220 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -17,7 +17,7 @@ The ``pytest`` framework makes it easy to write small, readable tests, and can scale to support complex functional testing for applications and libraries. -**Pythons**: ``pytest`` requires: Python 3.7, 3.8, 3.9, or PyPy3. +``pytest`` requires: Python 3.7+ or PyPy3. **PyPI package name**: :pypi:`pytest` @@ -78,7 +78,7 @@ Features - Can run :ref:`unittest ` (including trial) and :ref:`nose ` test suites out of the box -- Python 3.7+ and PyPy 3 +- Python 3.7+ or PyPy 3 - Rich plugin architecture, with over 800+ :ref:`external plugins ` and thriving community From 4eebfb2f19057d50a0400a71c356243e5fd42954 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Dec 2021 15:16:38 +0000 Subject: [PATCH 052/549] build(deps): Bump django in /testing/plugins_integration Bumps [django](https://github.com/django/django) from 3.2.10 to 4.0. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/3.2.10...4.0) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 64d0ab83d70..4583cf0d3a7 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.4.0 -django==3.2.10 +django==4.0 pytest-asyncio==0.16.0 pytest-bdd==5.0.0 pytest-cov==3.0.0 From 0b7c3d1145d3f9508598aeebee7b1675c330df34 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Tue, 28 Dec 2021 17:09:27 +0100 Subject: [PATCH 053/549] Remove Python 3.6 related warning from filterwarnings. --- pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5d32b755c74..70a9406a66e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,8 +28,6 @@ filterwarnings = [ "default:the imp module is deprecated in favour of importlib:DeprecationWarning:nose.*", # distutils is deprecated in 3.10, scheduled for removal in 3.12 "ignore:The distutils package is deprecated:DeprecationWarning", - # produced by python3.6/site.py itself (3.6.7 on Travis, could not trigger it with 3.6.8)." - "ignore:.*U.*mode is deprecated:DeprecationWarning:(?!(pytest|_pytest))", # produced by pytest-xdist "ignore:.*type argument to addoption.*:DeprecationWarning", # produced on execnet (pytest-xdist) From 1fd3601caa71a58e04fd16d4433c24c05e00fefc Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Thu, 30 Dec 2021 12:37:18 +0200 Subject: [PATCH 054/549] Drop support for EOL Python 3.6 --- pyproject.toml | 2 +- src/_pytest/assertion/rewrite.py | 3 - src/_pytest/capture.py | 6 +- src/_pytest/python.py | 4 +- testing/deprecated_test.py | 4 -- testing/test_assertrewrite.py | 3 - testing/test_capture.py | 8 +-- testing/test_compat.py | 2 +- testing/test_error_diffs.py | 113 +++++++++++++++---------------- testing/test_pathlib.py | 1 - 10 files changed, 63 insertions(+), 83 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 70a9406a66e..3d683aebea7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -111,4 +111,4 @@ template = "changelog/_template.rst" showcontent = true [tool.black] -target-version = ['py36'] +target-version = ['py37'] diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index afdd35980b3..f0922870a4c 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -100,9 +100,6 @@ def find_spec( spec is None # this is a namespace package (without `__init__.py`) # there's nothing to rewrite there - # python3.6: `namespace` - # python3.7+: `None` - or spec.origin == "namespace" or spec.origin is None # we can only rewrite source files or not isinstance(spec.loader, importlib.machinery.SourceFileLoader) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index d82ee9552f1..ee9de373325 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -68,8 +68,8 @@ def _colorama_workaround() -> None: pass -def _py36_windowsconsoleio_workaround(stream: TextIO) -> None: - """Workaround for Windows Unicode console handling on Python>=3.6. +def _windowsconsoleio_workaround(stream: TextIO) -> None: + """Workaround for Windows Unicode console handling. Python 3.6 implemented Unicode console handling for Windows. This works by reading/writing to the raw console handle using @@ -128,7 +128,7 @@ def _reopen_stdio(f, mode): def pytest_load_initial_conftests(early_config: Config): ns = early_config.known_args_namespace if ns.capture == "fd": - _py36_windowsconsoleio_workaround(sys.stdout) + _windowsconsoleio_workaround(sys.stdout) _colorama_workaround() pluginmanager = early_config.pluginmanager capman = CaptureManager(ns.capture) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 8db9e748975..0462665cd52 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -414,7 +414,7 @@ def collect(self) -> Iterable[Union[nodes.Item, nodes.Collector]]: for basecls in self.obj.__mro__: dicts.append(basecls.__dict__) - # In each class, nodes should be definition ordered. Since Python 3.6, + # In each class, nodes should be definition ordered. # __dict__ is definition ordered. seen: Set[str] = set() dict_values: List[List[Union[nodes.Item, nodes.Collector]]] = [] @@ -894,8 +894,6 @@ class InstanceDummy: pass -# Note: module __getattr__ only works on Python>=3.7. Unfortunately -# we can't provide this deprecation warning on Python 3.6. def __getattr__(name: str) -> object: if name == "Instance": warnings.warn(INSTANCE_COLLECTOR, 2) diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index c316b074c4b..07e69e6840f 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -234,10 +234,6 @@ def test_node_ctor_fspath_argument_is_deprecated(pytester: Pytester) -> None: ) -@pytest.mark.skipif( - sys.version_info < (3, 7), - reason="This deprecation can only be emitted on python>=3.7", -) def test_importing_instance_is_deprecated(pytester: Pytester) -> None: with pytest.warns( pytest.PytestDeprecationWarning, diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index a88c7eba33e..c568143f51c 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1123,9 +1123,6 @@ def test_read_pyc(self, tmp_path: Path) -> None: assert _read_pyc(source, pyc) is None # no error - @pytest.mark.skipif( - sys.version_info < (3, 7), reason="Only the Python 3.7 format for simplicity" - ) def test_read_pyc_more_invalid(self, tmp_path: Path) -> None: from _pytest.assertion.rewrite import _read_pyc diff --git a/testing/test_capture.py b/testing/test_capture.py index 1bc1f2f8db2..f0c582b6651 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -1433,19 +1433,19 @@ def test_capattr(): not sys.platform.startswith("win"), reason="only on windows", ) -def test_py36_windowsconsoleio_workaround_non_standard_streams() -> None: +def test_windowsconsoleio_workaround_non_standard_streams() -> None: """ - Ensure _py36_windowsconsoleio_workaround function works with objects that + Ensure _windowsconsoleio_workaround function works with objects that do not implement the full ``io``-based stream protocol, for example execnet channels (#2666). """ - from _pytest.capture import _py36_windowsconsoleio_workaround + from _pytest.capture import _windowsconsoleio_workaround class DummyStream: def write(self, s): pass stream = cast(TextIO, DummyStream()) - _py36_windowsconsoleio_workaround(stream) + _windowsconsoleio_workaround(stream) def test_dontreadfrominput_has_encoding(pytester: Pytester) -> None: diff --git a/testing/test_compat.py b/testing/test_compat.py index 8471a1a50f6..88f0f33efc2 100644 --- a/testing/test_compat.py +++ b/testing/test_compat.py @@ -133,7 +133,7 @@ def test_is_generator_async_gen_syntax(pytester: Pytester) -> None: pytester.makepyfile( """ from _pytest.compat import is_generator - def test_is_generator_py36(): + def test_is_generator(): async def foo(): yield await foo() diff --git a/testing/test_error_diffs.py b/testing/test_error_diffs.py index 1668e929ab4..d880be0dabe 100644 --- a/testing/test_error_diffs.py +++ b/testing/test_error_diffs.py @@ -4,8 +4,6 @@ See https://github.com/pytest-dev/pytest/issues/3333 for details. """ -import sys - import pytest from _pytest.pytester import Pytester @@ -210,68 +208,63 @@ def test_this(): """, id='Test "not in" string', ), -] -if sys.version_info[:2] >= (3, 7): - TESTCASES.extend( - [ - pytest.param( - """ - from dataclasses import dataclass + pytest.param( + """ + from dataclasses import dataclass - @dataclass - class A: - a: int - b: str + @dataclass + class A: + a: int + b: str - def test_this(): - result = A(1, 'spam') - expected = A(2, 'spam') - assert result == expected - """, - """ - > assert result == expected - E AssertionError: assert A(a=1, b='spam') == A(a=2, b='spam') - E Matching attributes: - E ['b'] - E Differing attributes: - E ['a'] - E Drill down into differing attribute a: - E a: 1 != 2 - E +1 - E -2 - """, - id="Compare data classes", - ), - pytest.param( - """ - import attr + def test_this(): + result = A(1, 'spam') + expected = A(2, 'spam') + assert result == expected + """, + """ + > assert result == expected + E AssertionError: assert A(a=1, b='spam') == A(a=2, b='spam') + E Matching attributes: + E ['b'] + E Differing attributes: + E ['a'] + E Drill down into differing attribute a: + E a: 1 != 2 + E +1 + E -2 + """, + id="Compare data classes", + ), + pytest.param( + """ + import attr - @attr.s(auto_attribs=True) - class A: - a: int - b: str + @attr.s(auto_attribs=True) + class A: + a: int + b: str - def test_this(): - result = A(1, 'spam') - expected = A(1, 'eggs') - assert result == expected - """, - """ - > assert result == expected - E AssertionError: assert A(a=1, b='spam') == A(a=1, b='eggs') - E Matching attributes: - E ['a'] - E Differing attributes: - E ['b'] - E Drill down into differing attribute b: - E b: 'spam' != 'eggs' - E - eggs - E + spam - """, - id="Compare attrs classes", - ), - ] - ) + def test_this(): + result = A(1, 'spam') + expected = A(1, 'eggs') + assert result == expected + """, + """ + > assert result == expected + E AssertionError: assert A(a=1, b='spam') == A(a=1, b='eggs') + E Matching attributes: + E ['a'] + E Differing attributes: + E ['b'] + E Drill down into differing attribute b: + E b: 'spam' != 'eggs' + E - eggs + E + spam + """, + id="Compare attrs classes", + ), +] @pytest.mark.parametrize("code, expected", TESTCASES) diff --git a/testing/test_pathlib.py b/testing/test_pathlib.py index 5eb153e847d..24cd71b25a6 100644 --- a/testing/test_pathlib.py +++ b/testing/test_pathlib.py @@ -450,7 +450,6 @@ def test_samefile_false_negatives(tmp_path: Path, monkeypatch: MonkeyPatch) -> N class TestImportLibMode: - @pytest.mark.skipif(sys.version_info < (3, 7), reason="Dataclasses in Python3.7+") def test_importmode_importlib_with_dataclass(self, tmp_path: Path) -> None: """Ensure that importlib mode works with a module containing dataclasses (#7856).""" fn = tmp_path.joinpath("_src/tests/test_dataclass.py") From 61417b2551a81c02b7e853b1d8d5c7ba11bd9bf1 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Thu, 30 Dec 2021 12:37:18 +0200 Subject: [PATCH 055/549] Drop support for EOL Python 3.6 --- testing/python/approx.py | 2 -- testing/test_assertion.py | 7 ------- 2 files changed, 9 deletions(-) diff --git a/testing/python/approx.py b/testing/python/approx.py index 0d411d8a6da..f417a5992cc 100644 --- a/testing/python/approx.py +++ b/testing/python/approx.py @@ -1,5 +1,4 @@ import operator -import sys from contextlib import contextmanager from decimal import Decimal from fractions import Fraction @@ -810,7 +809,6 @@ def test_nonnumeric_false_if_unequal(self, x): assert 1.0 != approx([None]) assert None != approx([1.0]) # noqa: E711 - @pytest.mark.skipif(sys.version_info < (3, 7), reason="requires ordered dicts") def test_nonnumeric_dict_repr(self): """Dicts with non-numerics and infinites have no tolerances""" x1 = {"foo": 1.0000005, "bar": None, "foobar": inf} diff --git a/testing/test_assertion.py b/testing/test_assertion.py index 8a4525cb74a..317a2beb388 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -796,7 +796,6 @@ def test_mojibake(self) -> None: class TestAssert_reprcompare_dataclass: - @pytest.mark.skipif(sys.version_info < (3, 7), reason="Dataclasses in Python3.7+") def test_dataclasses(self, pytester: Pytester) -> None: p = pytester.copy_example("dataclasses/test_compare_dataclasses.py") result = pytester.runpytest(p) @@ -815,7 +814,6 @@ def test_dataclasses(self, pytester: Pytester) -> None: consecutive=True, ) - @pytest.mark.skipif(sys.version_info < (3, 7), reason="Dataclasses in Python3.7+") def test_recursive_dataclasses(self, pytester: Pytester) -> None: p = pytester.copy_example("dataclasses/test_compare_recursive_dataclasses.py") result = pytester.runpytest(p) @@ -834,7 +832,6 @@ def test_recursive_dataclasses(self, pytester: Pytester) -> None: consecutive=True, ) - @pytest.mark.skipif(sys.version_info < (3, 7), reason="Dataclasses in Python3.7+") def test_recursive_dataclasses_verbose(self, pytester: Pytester) -> None: p = pytester.copy_example("dataclasses/test_compare_recursive_dataclasses.py") result = pytester.runpytest(p, "-vv") @@ -867,7 +864,6 @@ def test_recursive_dataclasses_verbose(self, pytester: Pytester) -> None: consecutive=True, ) - @pytest.mark.skipif(sys.version_info < (3, 7), reason="Dataclasses in Python3.7+") def test_dataclasses_verbose(self, pytester: Pytester) -> None: p = pytester.copy_example("dataclasses/test_compare_dataclasses_verbose.py") result = pytester.runpytest(p, "-vv") @@ -881,7 +877,6 @@ def test_dataclasses_verbose(self, pytester: Pytester) -> None: ] ) - @pytest.mark.skipif(sys.version_info < (3, 7), reason="Dataclasses in Python3.7+") def test_dataclasses_with_attribute_comparison_off( self, pytester: Pytester ) -> None: @@ -891,7 +886,6 @@ def test_dataclasses_with_attribute_comparison_off( result = pytester.runpytest(p, "-vv") result.assert_outcomes(failed=0, passed=1) - @pytest.mark.skipif(sys.version_info < (3, 7), reason="Dataclasses in Python3.7+") def test_comparing_two_different_data_classes(self, pytester: Pytester) -> None: p = pytester.copy_example( "dataclasses/test_compare_two_different_dataclasses.py" @@ -899,7 +893,6 @@ def test_comparing_two_different_data_classes(self, pytester: Pytester) -> None: result = pytester.runpytest(p, "-vv") result.assert_outcomes(failed=0, passed=1) - @pytest.mark.skipif(sys.version_info < (3, 7), reason="Dataclasses in Python3.7+") def test_data_classes_with_custom_eq(self, pytester: Pytester) -> None: p = pytester.copy_example( "dataclasses/test_compare_dataclasses_with_custom_eq.py" From cbccc063027c1d255bfd665e62505a83bdd60eb3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Dec 2021 21:12:08 +0000 Subject: [PATCH 056/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.1.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.0.1...v4.1.0) - [github.com/pre-commit/mirrors-mypy: v0.920 → v0.930](https://github.com/pre-commit/mirrors-mypy/compare/v0.920...v0.930) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f853528d537..57896c39532 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: blacken-docs additional_dependencies: [black==20.8b1] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.1.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -48,7 +48,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.920 + rev: v0.930 hooks: - id: mypy files: ^(src/|testing/) From b0aabe4081403ad74e0c0a14a88a76930dbb9a66 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 29 Dec 2021 17:52:16 -0500 Subject: [PATCH 057/549] fix mypy 0.930 errors --- src/_pytest/config/__init__.py | 5 +++-- src/_pytest/monkeypatch.py | 2 +- src/_pytest/pathlib.py | 3 +++ src/_pytest/python.py | 1 + testing/test_conftest.py | 4 ++++ testing/test_pathlib.py | 4 ++++ 6 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 1bdd8effba2..dee3d4974fb 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1429,6 +1429,7 @@ def _getconftest_pathlist( ) except KeyError: return None + assert mod.__file__ is not None modpath = Path(mod.__file__).parent values: List[Path] = [] for relroot in relroots: @@ -1574,7 +1575,7 @@ def _strtobool(val: str) -> bool: @lru_cache(maxsize=50) def parse_warning_filter( arg: str, *, escape: bool -) -> Tuple[str, str, Type[Warning], str, int]: +) -> Tuple["warnings._ActionKind", str, Type[Warning], str, int]: """Parse a warnings filter string. This is copied from warnings._setoption with the following changes: @@ -1616,7 +1617,7 @@ def parse_warning_filter( parts.append("") action_, message, category_, module, lineno_ = (s.strip() for s in parts) try: - action: str = warnings._getaction(action_) # type: ignore[attr-defined] + action: "warnings._ActionKind" = warnings._getaction(action_) # type: ignore[attr-defined] except warnings._OptionError as e: raise UsageError(error_template.format(error=str(e))) try: diff --git a/src/_pytest/monkeypatch.py b/src/_pytest/monkeypatch.py index 31f95a95ab2..91d590fb3df 100644 --- a/src/_pytest/monkeypatch.py +++ b/src/_pytest/monkeypatch.py @@ -55,7 +55,7 @@ def resolve(name: str) -> object: parts = name.split(".") used = parts.pop(0) - found = __import__(used) + found: object = __import__(used) for part in parts: used += "." + part try: diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py index b23e51d4429..def5fa94b2b 100644 --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -539,6 +539,9 @@ def import_path( ignore = os.environ.get("PY_IGNORE_IMPORTMISMATCH", "") if ignore != "1": module_file = mod.__file__ + if module_file is None: + raise ImportPathMismatchError(module_name, module_file, path) + if module_file.endswith((".pyc", ".pyo")): module_file = module_file[:-1] if module_file.endswith(os.path.sep + "__init__.py"): diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 0462665cd52..90f035e8fb1 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -330,6 +330,7 @@ def reportinfo(self) -> Tuple[Union["os.PathLike[str]", str], Optional[int], str if isinstance(compat_co_firstlineno, int): # nose compatibility file_path = sys.modules[obj.__module__].__file__ + assert file_path is not None if file_path.endswith(".pyc"): file_path = file_path[:-1] path: Union["os.PathLike[str]", str] = file_path diff --git a/testing/test_conftest.py b/testing/test_conftest.py index 64c1014a533..92a5ffb72cf 100644 --- a/testing/test_conftest.py +++ b/testing/test_conftest.py @@ -114,6 +114,7 @@ def test_value_access_with_confmod(self, basedir: Path) -> None: "a", startdir, importmode="prepend", rootpath=Path(basedir) ) assert value == 1.5 + assert mod.__file__ is not None path = Path(mod.__file__) assert path.parent == basedir / "adir" / "b" assert path.stem == "conftest" @@ -197,12 +198,14 @@ def test_conftestcutdir(pytester: Pytester) -> None: values = conftest._getconftestmodules( conf.parent, importmode="prepend", rootpath=pytester.path ) + assert values[0].__file__ is not None assert values[0].__file__.startswith(str(conf)) # and all sub paths get updated properly values = conftest._getconftestmodules( p, importmode="prepend", rootpath=pytester.path ) assert len(values) == 1 + assert values[0].__file__ is not None assert values[0].__file__.startswith(str(conf)) @@ -214,6 +217,7 @@ def test_conftestcutdir_inplace_considered(pytester: Pytester) -> None: conf.parent, importmode="prepend", rootpath=pytester.path ) assert len(values) == 1 + assert values[0].__file__ is not None assert values[0].__file__.startswith(str(conf)) diff --git a/testing/test_pathlib.py b/testing/test_pathlib.py index 24cd71b25a6..fe5e08f212f 100644 --- a/testing/test_pathlib.py +++ b/testing/test_pathlib.py @@ -143,6 +143,10 @@ def test_smoke_test(self, path1: Path) -> None: assert obj.x == 42 # type: ignore[attr-defined] assert obj.__name__ == "execfile" + def test_import_path_missing_file(self, path1: Path) -> None: + with pytest.raises(ImportPathMismatchError): + import_path(path1 / "sampledir", root=path1) + def test_renamed_dir_creates_mismatch( self, tmp_path: Path, monkeypatch: MonkeyPatch ) -> None: From 819c67f58ebc0941996e84146d6057fc9cfdb34d Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sat, 1 Jan 2022 23:36:10 +0200 Subject: [PATCH 058/549] Also test branches prefixed test-me- --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3cf726a1ae7..79ce0e2225b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,6 +5,7 @@ on: branches: - main - "[0-9]+.[0-9]+.x" + - "test-me-*" tags: - "[0-9]+.[0-9]+.[0-9]+" - "[0-9]+.[0-9]+.[0-9]+rc[0-9]+" From d60771f986d8abf4aacd0f8a162460dac466aa6d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 3 Jan 2022 15:14:40 +0100 Subject: [PATCH 059/549] ci: Try backporting via pull_request_target (#9430) * ci: Try backporting via pull_request_target * ci: Security improvements --- .github/workflows/backport.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index c1a0554199f..f7840d537cf 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -1,7 +1,13 @@ name: backport on: - pull_request: + # Note that `pull_request_target` has security implications: + # https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ + # In particular: + # - Only allow triggers that can be used only be trusted users + # - Don't execute any code from the target branch + # - Don't use cache + pull_request_target: types: [labeled] # Set permissions at the job level. @@ -9,7 +15,7 @@ permissions: {} jobs: backport: - if: ${{ startsWith(github.event.label.name, 'backport ') }} + if: startsWith(github.event.label.name, 'backport ') && github.event.pull_request.merged runs-on: ubuntu-latest permissions: contents: write From 56081ca07590d049757cd32105e6310d35c1dfcf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 3 Jan 2022 18:57:32 +0100 Subject: [PATCH 060/549] [automated] Update plugin list (#9468) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 68 ++++++++++++++++---------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 7e89ac61778..2419abb2e5a 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -40,7 +40,7 @@ This list contains 975 plugins. :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) :pypi:`pytest-allure-dsl` pytest plugin to test case doc string dls instructions Oct 25, 2020 4 - Beta pytest :pypi:`pytest-allure-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest - :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Oct 21, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-android` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Feb 21, 2019 3 - Alpha pytest :pypi:`pytest-anki` A pytest plugin for testing Anki add-ons Oct 14, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-annotate` pytest-annotate: Generate PyAnnotate annotations from your pytest tests. Nov 29, 2021 3 - Alpha pytest (<7.0.0,>=3.2.0) @@ -57,7 +57,7 @@ This list contains 975 plugins. :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A :pypi:`pytest-approvaltests` A plugin to use approvaltests with pytest Feb 07, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) - :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Dec 06, 2018 4 - Beta pytest + :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Dec 31, 2021 4 - Beta pytest (>=4.6) :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A :pypi:`pytest-assertutil` pytest-assertutil May 10, 2019 N/A N/A @@ -65,7 +65,7 @@ This list contains 975 plugins. :pypi:`pytest-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) :pypi:`pytest-ast-back-to-python` A plugin for pytest devs to view how assertion rewriting recodes the AST Sep 29, 2019 4 - Beta N/A :pypi:`pytest-astropy` Meta-package containing dependencies for testing Sep 21, 2021 5 - Production/Stable pytest (>=4.6) - :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Dec 18, 2019 3 - Alpha pytest (>=2.8) + :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Dec 27, 2021 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio. Oct 15, 2021 4 - Beta pytest (>=5.4.0) :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Oct 12, 2021 4 - Beta N/A @@ -352,7 +352,7 @@ This list contains 975 plugins. :pypi:`pytest-filemarker` A pytest plugin that runs marked tests when files change. Dec 01, 2020 N/A pytest :pypi:`pytest-filter-case` run test cases filter by mark Nov 05, 2020 N/A N/A :pypi:`pytest-filter-subpackage` Pytest plugin for filtering based on sub-packages Jan 09, 2020 3 - Alpha pytest (>=3.0) - :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Apr 21, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Dec 26, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-finer-verdicts` A pytest plugin to treat non-assertion failures as test errors. Jun 18, 2020 N/A pytest (>=5.4.3) :pypi:`pytest-firefox` pytest plugin to manipulate firefox Aug 08, 2017 3 - Alpha pytest (>=3.0.2) :pypi:`pytest-fixture-config` Fixture configuration utils for py.test May 28, 2019 5 - Production/Stable pytest @@ -407,12 +407,12 @@ This list contains 975 plugins. :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Oct 26, 2021 4 - Beta pytest (>=6.1.2,<7.0.0) :pypi:`pytest-helper` Functions to help in using the pytest testing framework May 31, 2019 5 - Production/Stable N/A :pypi:`pytest-helpers` pytest helpers May 17, 2020 N/A pytest - :pypi:`pytest-helpers-namespace` Pytest Helpers Namespace Plugin Apr 29, 2021 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-helpers-namespace` Pytest Helpers Namespace Plugin Dec 29, 2021 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-hidecaptured` Hide captured output May 04, 2018 4 - Beta pytest (>=2.8.5) :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Dec 24, 2021 3 - Alpha pytest (==6.2.5) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Dec 30, 2021 3 - Alpha pytest (==6.2.5) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jul 12, 2021 N/A pytest (>=5.0) :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Aug 29, 2021 4 - Beta N/A @@ -427,7 +427,7 @@ This list contains 975 plugins. :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Dec 15, 2021 3 - Alpha N/A - :pypi:`pytest-httpx` Send responses to httpx. Dec 23, 2021 5 - Production/Stable pytest (==6.*) + :pypi:`pytest-httpx` Send responses to httpx. Dec 27, 2021 5 - Production/Stable pytest (==6.*) :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest @@ -536,7 +536,7 @@ This list contains 975 plugins. :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest May 06, 2021 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-mock-api` A mock API server with configurable routes and responses available as a fixture. Feb 13, 2019 1 - Planning pytest (>=4.0.0) - :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator Aug 10, 2021 5 - Production/Stable N/A + :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator Dec 30, 2021 5 - Production/Stable N/A :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A @@ -628,7 +628,7 @@ This list contains 975 plugins. :pypi:`pytest-perf` pytest-perf Jun 27, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) :pypi:`pytest-persistence` Pytest tool for persistent objects Dec 07, 2021 N/A N/A - :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Dec 25, 2021 5 - Production/Stable pytest + :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Dec 28, 2021 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Nov 10, 2021 4 - Beta pytest (>=6.2) ; extra == 'test' :pypi:`pytest-picked` Run the tests related to the changed files Dec 23, 2020 N/A pytest (>=3.5.0) @@ -663,7 +663,7 @@ This list contains 975 plugins. :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Nov 24, 2021 N/A pytest (>=3.4.1) :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A - :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Jun 17, 2021 5 - Production/Stable pytest (>=6) + :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Dec 28, 2021 5 - Production/Stable pytest (>=6) :pypi:`pytest-profiles` pytest plugin for configuration profiles Dec 09, 2021 4 - Beta pytest (>=3.7.0) :pypi:`pytest-profiling` Profiling plugin for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-progress` pytest plugin for instant test progress status Nov 09, 2021 5 - Production/Stable pytest (>=2.7) @@ -775,13 +775,13 @@ This list contains 975 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Dec 24, 2021 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Dec 31, 2021 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Aug 31, 2020 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Dec 24, 2021 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Dec 31, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -816,7 +816,7 @@ This list contains 975 plugins. :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Dec 02, 2021 4 - Beta pytest (>=3.0.0) :pypi:`pytest-snmpserver` May 12, 2021 N/A N/A - :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Dec 19, 2021 4 - Beta pytest (>=6.2.0) + :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Dec 30, 2021 4 - Beta pytest (>=6.2.0) :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Dec 23, 2021 4 - Beta pytest (>=3.6.3) :pypi:`pytest-soft-assertions` May 05, 2020 3 - Alpha pytest :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) @@ -897,7 +897,7 @@ This list contains 975 plugins. :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) :pypi:`pytest-test-utils` Dec 14, 2021 N/A pytest (>=5) - :pypi:`pytest-tesults` Tesults plugin for pytest Jul 31, 2021 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-tesults` Tesults plugin for pytest Dec 31, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-tezos` pytest-ligo Jan 16, 2020 4 - Beta N/A :pypi:`pytest-thawgun` Pytest plugin for time travel May 26, 2020 3 - Alpha N/A :pypi:`pytest-threadleak` Detects thread leaks Sep 08, 2017 4 - Beta N/A @@ -959,7 +959,7 @@ This list contains 975 plugins. :pypi:`pytest-vyper` Plugin for the vyper smart contract language. May 28, 2020 2 - Pre-Alpha N/A :pypi:`pytest-wa-e2e-plugin` Pytest plugin for testing whatsapp bots with end to end tests Feb 18, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-watch` Local continuous test runner with pytest and watchdog. May 20, 2018 N/A N/A - :pypi:`pytest-watcher` Continiously runs pytest on changes in \*.py files Sep 18, 2021 3 - Alpha N/A + :pypi:`pytest-watcher` Continiously runs pytest on changes in \*.py files Dec 30, 2021 3 - Alpha N/A :pypi:`pytest-wdl` Pytest plugin for testing WDL workflows. Nov 17, 2020 5 - Production/Stable N/A :pypi:`pytest-webdriver` Selenium webdriver fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-wetest` Welian API Automation test framework pytest plugin Nov 10, 2018 4 - Beta N/A @@ -1153,8 +1153,8 @@ This list contains 975 plugins. The pytest plugin aimed to display test coverage of the specs(requirements) in Allure :pypi:`pytest-alphamoon` - *last release*: Oct 21, 2021, - *status*: 4 - Beta, + *last release*: Dec 30, 2021, + *status*: 5 - Production/Stable, *requires*: pytest (>=3.5.0) Static code checks used at Alphamoon @@ -1272,9 +1272,9 @@ This list contains 975 plugins. pyest results colection plugin :pypi:`pytest-arraydiff` - *last release*: Dec 06, 2018, + *last release*: Dec 31, 2021, *status*: 4 - Beta, - *requires*: pytest + *requires*: pytest (>=4.6) pytest plugin to help with comparing array output from tests @@ -1328,9 +1328,9 @@ This list contains 975 plugins. Meta-package containing dependencies for testing :pypi:`pytest-astropy-header` - *last release*: Dec 18, 2019, + *last release*: Dec 27, 2021, *status*: 3 - Alpha, - *requires*: pytest (>=2.8) + *requires*: pytest (>=4.6) pytest plugin to add diagnostic information to the header of the test output @@ -3337,7 +3337,7 @@ This list contains 975 plugins. Pytest plugin for filtering based on sub-packages :pypi:`pytest-find-dependencies` - *last release*: Apr 21, 2021, + *last release*: Dec 26, 2021, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) @@ -3722,7 +3722,7 @@ This list contains 975 plugins. pytest helpers :pypi:`pytest-helpers-namespace` - *last release*: Apr 29, 2021, + *last release*: Dec 29, 2021, *status*: 5 - Production/Stable, *requires*: pytest (>=6.0.0) @@ -3757,7 +3757,7 @@ This list contains 975 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Dec 24, 2021, + *last release*: Dec 30, 2021, *status*: 3 - Alpha, *requires*: pytest (==6.2.5) @@ -3862,7 +3862,7 @@ This list contains 975 plugins. pytest-httpserver is a httpserver for pytest :pypi:`pytest-httpx` - *last release*: Dec 23, 2021, + *last release*: Dec 27, 2021, *status*: 5 - Production/Stable, *requires*: pytest (==6.*) @@ -4625,7 +4625,7 @@ This list contains 975 plugins. A mock API server with configurable routes and responses available as a fixture. :pypi:`pytest-mock-generator` - *last release*: Aug 10, 2021, + *last release*: Dec 30, 2021, *status*: 5 - Production/Stable, *requires*: N/A @@ -5269,9 +5269,9 @@ This list contains 975 plugins. Pytest tool for persistent objects :pypi:`pytest-pg` - *last release*: Dec 25, 2021, + *last release*: Dec 28, 2021, *status*: 5 - Production/Stable, - *requires*: pytest + *requires*: pytest (>=6.0.0) Helps to run PostgreSQL in docker as pytest fixture @@ -5514,7 +5514,7 @@ This list contains 975 plugins. Minitest-style test colors :pypi:`pytest-print` - *last release*: Jun 17, 2021, + *last release*: Dec 28, 2021, *status*: 5 - Production/Stable, *requires*: pytest (>=6) @@ -6298,7 +6298,7 @@ This list contains 975 plugins. :pypi:`pytest-sbase` - *last release*: Dec 24, 2021, + *last release*: Dec 31, 2021, *status*: 5 - Production/Stable, *requires*: N/A @@ -6340,7 +6340,7 @@ This list contains 975 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Dec 24, 2021, + *last release*: Dec 31, 2021, *status*: 5 - Production/Stable, *requires*: N/A @@ -6585,7 +6585,7 @@ This list contains 975 plugins. :pypi:`pytest-snowflake-bdd` - *last release*: Dec 19, 2021, + *last release*: Dec 30, 2021, *status*: 4 - Beta, *requires*: pytest (>=6.2.0) @@ -7152,7 +7152,7 @@ This list contains 975 plugins. :pypi:`pytest-tesults` - *last release*: Jul 31, 2021, + *last release*: Dec 31, 2021, *status*: 5 - Production/Stable, *requires*: pytest (>=3.5.0) @@ -7586,7 +7586,7 @@ This list contains 975 plugins. Local continuous test runner with pytest and watchdog. :pypi:`pytest-watcher` - *last release*: Sep 18, 2021, + *last release*: Dec 30, 2021, *status*: 3 - Alpha, *requires*: N/A From b6350b8b974e47ff67727044f8e965101f54f287 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Jan 2022 21:08:03 +0000 Subject: [PATCH 061/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v2.29.1 → v2.31.0](https://github.com/asottile/pyupgrade/compare/v2.29.1...v2.31.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 57896c39532..70ff318dcbf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,7 +34,7 @@ repos: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.29.1 + rev: v2.31.0 hooks: - id: pyupgrade args: [--py37-plus] From 4038752bf38be9dcb724e028b5d604ac05f64dd5 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 8 Dec 2021 11:01:10 -0300 Subject: [PATCH 062/549] Ensure Config.inifile is available during pytest_cmdline_main Fix #9396 --- changelog/9396.bugfix.rst | 1 + src/_pytest/legacypath.py | 69 +++++++++++++++++++------------------- testing/test_config.py | 1 + testing/test_legacypath.py | 17 ++++++++++ 4 files changed, 54 insertions(+), 34 deletions(-) create mode 100644 changelog/9396.bugfix.rst diff --git a/changelog/9396.bugfix.rst b/changelog/9396.bugfix.rst new file mode 100644 index 00000000000..dcb83bbc14f --- /dev/null +++ b/changelog/9396.bugfix.rst @@ -0,0 +1 @@ +Ensure :attr:`pytest.Config.inifile` is available during the :func:`pytest_cmdline_main <_pytest.hookspec.pytest_cmdline_main>` hook (regression during ``7.0.0rc1``). diff --git a/src/_pytest/legacypath.py b/src/_pytest/legacypath.py index 4c2db941257..37e8c24220e 100644 --- a/src/_pytest/legacypath.py +++ b/src/_pytest/legacypath.py @@ -403,37 +403,17 @@ def Node_fspath_set(self: Node, value: LEGACY_PATH) -> None: self.path = Path(value) -@hookimpl -def pytest_configure(config: Config) -> None: - import pytest - - mp = pytest.MonkeyPatch() - config.add_cleanup(mp.undo) - - if config.pluginmanager.has_plugin("tmpdir"): - # Create TmpdirFactory and attach it to the config object. - # - # This is to comply with existing plugins which expect the handler to be - # available at pytest_configure time, but ideally should be moved entirely - # to the tmpdir_factory session fixture. - try: - tmp_path_factory = config._tmp_path_factory # type: ignore[attr-defined] - except AttributeError: - # tmpdir plugin is blocked. - pass - else: - _tmpdirhandler = TempdirFactory(tmp_path_factory, _ispytest=True) - mp.setattr(config, "_tmpdirhandler", _tmpdirhandler, raising=False) - - config.pluginmanager.register(LegacyTmpdirPlugin, "legacypath-tmpdir") +@hookimpl(tryfirst=True) +def pytest_load_initial_conftests(early_config: Config) -> None: + """Monkeypatch legacy path attributes in several classes, as early as possible.""" + mp = MonkeyPatch() + early_config.add_cleanup(mp.undo) # Add Cache.makedir(). - mp.setattr(pytest.Cache, "makedir", Cache_makedir, raising=False) + mp.setattr(Cache, "makedir", Cache_makedir, raising=False) # Add FixtureRequest.fspath property. - mp.setattr( - pytest.FixtureRequest, "fspath", property(FixtureRequest_fspath), raising=False - ) + mp.setattr(FixtureRequest, "fspath", property(FixtureRequest_fspath), raising=False) # Add TerminalReporter.startdir property. mp.setattr( @@ -441,22 +421,43 @@ def pytest_configure(config: Config) -> None: ) # Add Config.{invocation_dir,rootdir,inifile} properties. - mp.setattr( - pytest.Config, "invocation_dir", property(Config_invocation_dir), raising=False - ) - mp.setattr(pytest.Config, "rootdir", property(Config_rootdir), raising=False) - mp.setattr(pytest.Config, "inifile", property(Config_inifile), raising=False) + mp.setattr(Config, "invocation_dir", property(Config_invocation_dir), raising=False) + mp.setattr(Config, "rootdir", property(Config_rootdir), raising=False) + mp.setattr(Config, "inifile", property(Config_inifile), raising=False) # Add Session.startdir property. - mp.setattr(pytest.Session, "startdir", property(Session_stardir), raising=False) + mp.setattr(Session, "startdir", property(Session_stardir), raising=False) # Add pathlist configuration type. - mp.setattr(pytest.Config, "_getini_unknown_type", Config__getini_unknown_type) + mp.setattr(Config, "_getini_unknown_type", Config__getini_unknown_type) # Add Node.fspath property. mp.setattr(Node, "fspath", property(Node_fspath, Node_fspath_set), raising=False) +@hookimpl +def pytest_configure(config: Config) -> None: + """Installs the LegacyTmpdirPlugin if the ``tmpdir`` plugin is also installed.""" + if config.pluginmanager.has_plugin("tmpdir"): + mp = MonkeyPatch() + config.add_cleanup(mp.undo) + # Create TmpdirFactory and attach it to the config object. + # + # This is to comply with existing plugins which expect the handler to be + # available at pytest_configure time, but ideally should be moved entirely + # to the tmpdir_factory session fixture. + try: + tmp_path_factory = config._tmp_path_factory # type: ignore[attr-defined] + except AttributeError: + # tmpdir plugin is blocked. + pass + else: + _tmpdirhandler = TempdirFactory(tmp_path_factory, _ispytest=True) + mp.setattr(config, "_tmpdirhandler", _tmpdirhandler, raising=False) + + config.pluginmanager.register(LegacyTmpdirPlugin, "legacypath-tmpdir") + + @hookimpl def pytest_plugin_registered(plugin: object, manager: PytestPluginManager) -> None: # pytester is not loaded by default and is commonly loaded from a conftest, diff --git a/testing/test_config.py b/testing/test_config.py index 9a57b919dd9..f691d3ed5bb 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -1268,6 +1268,7 @@ def pytest_load_initial_conftests(self): expected = [ "_pytest.config", m.__module__, + "_pytest.legacypath", "_pytest.pythonpath", "_pytest.capture", "_pytest.warnings", diff --git a/testing/test_legacypath.py b/testing/test_legacypath.py index 1d3fdb4bd9c..fbfd88b7384 100644 --- a/testing/test_legacypath.py +++ b/testing/test_legacypath.py @@ -161,3 +161,20 @@ def test_overriden(pytestconfig): ) result = pytester.runpytest("--override-ini", "paths=foo/bar1.py foo/bar2.py", "-s") result.stdout.fnmatch_lines(["user_path:bar1.py", "user_path:bar2.py"]) + + +def test_inifile_from_cmdline_main_hook(pytester: pytest.Pytester) -> None: + """Ensure Config.inifile is available during pytest_cmdline_main (#9396).""" + p = pytester.makeini( + """ + [pytest] + """ + ) + pytester.makeconftest( + """ + def pytest_cmdline_main(config): + print("pytest_cmdline_main inifile =", config.inifile) + """ + ) + result = pytester.runpytest_subprocess("-s") + result.stdout.fnmatch_lines(f"*pytest_cmdline_main inifile = {p}") From 696f955ff8c3345de5090e0aada6e3223f67969f Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 8 Dec 2021 11:49:04 -0300 Subject: [PATCH 063/549] Split wrappers and non-wrappers in test_load_initial_conftest_last_ordering Seems better to test which one is which explicitly. --- testing/test_config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testing/test_config.py b/testing/test_config.py index f691d3ed5bb..c8e21a8478a 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -1264,16 +1264,16 @@ def pytest_load_initial_conftests(self): m = My() pm.register(m) hc = pm.hook.pytest_load_initial_conftests - values = hc._nonwrappers + hc._wrappers - expected = [ + assert [x.function.__module__ for x in hc._nonwrappers] == [ "_pytest.config", m.__module__, "_pytest.legacypath", "_pytest.pythonpath", + ] + assert [x.function.__module__ for x in hc._wrappers] == [ "_pytest.capture", "_pytest.warnings", ] - assert [x.function.__module__ for x in values] == expected def test_get_plugin_specs_as_list() -> None: From 71baf24b6d41da6704433ca9909b5e6d954564b9 Mon Sep 17 00:00:00 2001 From: Dan Alvizu Date: Tue, 4 Jan 2022 06:55:01 -0700 Subject: [PATCH 064/549] Doc update: clarify -W syntax (#9464) Co-authored-by: Hugo van Kemenade Co-authored-by: Bruno Oliveira --- doc/en/how-to/capture-warnings.rst | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/en/how-to/capture-warnings.rst b/doc/en/how-to/capture-warnings.rst index 7e877b4d3da..efdf10e3394 100644 --- a/doc/en/how-to/capture-warnings.rst +++ b/doc/en/how-to/capture-warnings.rst @@ -42,8 +42,18 @@ Running pytest now produces this output: -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================= 1 passed, 1 warning in 0.12s ======================= -The ``-W`` flag can be passed to control which warnings will be displayed or even turn -them into errors: +Controlling warnings +-------------------- + +Similar to Python's `warning filter`_ and :option:`-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. + +.. _`warning filter`: https://docs.python.org/3/library/warnings.html#warning-filter + +This code sample shows how to treat any ``UserWarning`` category class of warning +as an error: .. code-block:: pytest @@ -96,9 +106,6 @@ all other warnings into errors. When a warning matches more than one option in the list, the action for the last matching option is performed. -Both ``-W`` command-line option and ``filterwarnings`` ini option are based on Python's own -:option:`-W option ` and :func:`warnings.simplefilter`, so please refer to those sections in the Python -documentation for other examples and advanced usage. .. _`filterwarnings`: From b19374bc193fddfe2b0c2da21e4e3a96846f15ea Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 7 Jan 2022 12:15:34 +0200 Subject: [PATCH 065/549] config: fix incorrect cache hit check in _getconftestmodules This made the cache not work as intended, causing a major slowdown. See #9478 for discussion and context. Authored-by: Anthony Sottile --- src/_pytest/config/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index dee3d4974fb..174d80a01ca 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -538,7 +538,7 @@ def _getconftestmodules( # Optimization: avoid repeated searches in the same directory. # Assumes always called with same importmode and rootpath. existing_clist = self._dirpath2confmods.get(directory) - if existing_clist: + if existing_clist is not None: return existing_clist # XXX these days we may rather want to use config.rootpath From 5f23157b39143f25560ee0dfa52a2df49a7cb6c3 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 8 Jan 2022 12:36:43 +0200 Subject: [PATCH 066/549] config: remove always truthy condition --- src/_pytest/config/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 174d80a01ca..5ec4099140e 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -602,7 +602,7 @@ def _importconftest( dirpath = conftestpath.parent if dirpath in self._dirpath2confmods: for path, mods in self._dirpath2confmods.items(): - if path and dirpath in path.parents or path == dirpath: + if dirpath in path.parents or path == dirpath: assert mod not in mods mods.append(mod) self.trace(f"loading conftestmodule {mod!r}") From 1c7644cc7a796dda13c8ee56c3d65d99bd35a39b Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 8 Jan 2022 13:50:52 +0200 Subject: [PATCH 067/549] config: some comments --- src/_pytest/config/__init__.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 5ec4099140e..79b2ad59862 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -345,14 +345,21 @@ def __init__(self) -> None: import _pytest.assertion super().__init__("pytest") - # The objects are module objects, only used generically. - self._conftest_plugins: Set[types.ModuleType] = set() - # State related to local conftest plugins. + # -- State related to local conftest plugins. + # All loaded conftest modules. + self._conftest_plugins: Set[types.ModuleType] = set() + # All conftest modules applicable for a directory. + # This includes the directory's own conftest modules as well + # as those of its parent directories. self._dirpath2confmods: Dict[Path, List[types.ModuleType]] = {} + # The conftest module of a conftest path. self._conftestpath2mod: Dict[Path, types.ModuleType] = {} + # Cutoff directory above which conftests are no longer discovered. self._confcutdir: Optional[Path] = None + # If set, conftest loading is skipped. self._noconftest = False + self._duplicatepaths: Set[Path] = set() # plugins that were explicitly skipped with pytest.skip From 0c98f1923101e5905c54ba07650a043fca374f4b Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 8 Jan 2022 22:41:14 +0200 Subject: [PATCH 068/549] config: make confcutdir check a bit more clear & correct I think this named function makes the code a bit easier to understand. Also change the check to explicitly check for "is a sub-path of" instead of the previous check which only worked assuming that path is within confcutdir or a direct parent of it. --- src/_pytest/config/__init__.py | 25 ++++++++++++++++++------- src/_pytest/main.py | 3 +-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 79b2ad59862..a30ee6cee00 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -521,6 +521,19 @@ def _set_initial_conftests( if not foundanchor: self._try_load_conftest(current, namespace.importmode, rootpath) + def _is_in_confcutdir(self, path: Path) -> bool: + """Whether a path is within the confcutdir. + + When false, should not load conftest. + """ + if self._confcutdir is None: + return True + try: + path.relative_to(self._confcutdir) + except ValueError: + return False + return True + def _try_load_conftest( self, anchor: Path, importmode: Union[str, ImportMode], rootpath: Path ) -> None: @@ -552,14 +565,12 @@ def _getconftestmodules( # and allow users to opt into looking into the rootdir parent # directories instead of requiring to specify confcutdir. clist = [] - confcutdir_parents = self._confcutdir.parents if self._confcutdir else [] for parent in reversed((directory, *directory.parents)): - if parent in confcutdir_parents: - continue - conftestpath = parent / "conftest.py" - if conftestpath.is_file(): - mod = self._importconftest(conftestpath, importmode, rootpath) - clist.append(mod) + if self._is_in_confcutdir(parent): + conftestpath = parent / "conftest.py" + if conftestpath.is_file(): + mod = self._importconftest(conftestpath, importmode, rootpath) + clist.append(mod) self._dirpath2confmods[directory] = clist return clist diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 952c703509d..afe613fd0d9 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -689,9 +689,8 @@ def collect(self) -> Iterator[Union[nodes.Item, nodes.Collector]]: # No point in finding packages when collecting doctests. if not self.config.getoption("doctestmodules", False): pm = self.config.pluginmanager - confcutdir = pm._confcutdir for parent in (argpath, *argpath.parents): - if confcutdir and parent in confcutdir.parents: + if not pm._is_in_confcutdir(argpath): break if parent.is_dir(): From ed83efaf4bd802a0c96d8be0c841d1d508fbffd5 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 9 Jan 2022 00:12:33 +0200 Subject: [PATCH 069/549] testing/test_monkeypatch: fix some patches leaking into pytest code The tests patch `os.path.abspath` which can break some pytest internal code since the patching is not undone immediately. --- testing/test_monkeypatch.py | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/testing/test_monkeypatch.py b/testing/test_monkeypatch.py index 95521818021..49635f95e79 100644 --- a/testing/test_monkeypatch.py +++ b/testing/test_monkeypatch.py @@ -50,21 +50,24 @@ class A: class TestSetattrWithImportPath: def test_string_expression(self, monkeypatch: MonkeyPatch) -> None: - monkeypatch.setattr("os.path.abspath", lambda x: "hello2") - assert os.path.abspath("123") == "hello2" + with monkeypatch.context() as mp: + mp.setattr("os.path.abspath", lambda x: "hello2") + assert os.path.abspath("123") == "hello2" def test_string_expression_class(self, monkeypatch: MonkeyPatch) -> None: - monkeypatch.setattr("_pytest.config.Config", 42) - import _pytest + with monkeypatch.context() as mp: + mp.setattr("_pytest.config.Config", 42) + import _pytest - assert _pytest.config.Config == 42 # type: ignore + assert _pytest.config.Config == 42 # type: ignore def test_unicode_string(self, monkeypatch: MonkeyPatch) -> None: - monkeypatch.setattr("_pytest.config.Config", 42) - import _pytest + with monkeypatch.context() as mp: + mp.setattr("_pytest.config.Config", 42) + import _pytest - assert _pytest.config.Config == 42 # type: ignore - monkeypatch.delattr("_pytest.config.Config") + assert _pytest.config.Config == 42 # type: ignore + mp.delattr("_pytest.config.Config") def test_wrong_target(self, monkeypatch: MonkeyPatch) -> None: with pytest.raises(TypeError): @@ -80,14 +83,16 @@ def test_unknown_attr(self, monkeypatch: MonkeyPatch) -> None: def test_unknown_attr_non_raising(self, monkeypatch: MonkeyPatch) -> None: # https://github.com/pytest-dev/pytest/issues/746 - monkeypatch.setattr("os.path.qweqwe", 42, raising=False) - assert os.path.qweqwe == 42 # type: ignore + with monkeypatch.context() as mp: + mp.setattr("os.path.qweqwe", 42, raising=False) + assert os.path.qweqwe == 42 # type: ignore def test_delattr(self, monkeypatch: MonkeyPatch) -> None: - monkeypatch.delattr("os.path.abspath") - assert not hasattr(os.path, "abspath") - monkeypatch.undo() - assert os.path.abspath + with monkeypatch.context() as mp: + mp.delattr("os.path.abspath") + assert not hasattr(os.path, "abspath") + mp.undo() + assert os.path.abspath def test_delattr() -> None: From d98b695fecd8761ba600cc5e30fb239be5221253 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 9 Jan 2022 00:28:44 +0200 Subject: [PATCH 070/549] config: return Sequence instead of List from _getconftestmodules Nothing should mutate the internal data structure here. --- src/_pytest/config/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index a30ee6cee00..a6a22d2b913 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -546,7 +546,7 @@ def _try_load_conftest( def _getconftestmodules( self, path: Path, importmode: Union[str, ImportMode], rootpath: Path - ) -> List[types.ModuleType]: + ) -> Sequence[types.ModuleType]: if self._noconftest: return [] From f0dab8ba8dd6e3f197e577125d392adfcc8d284b Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 9 Jan 2022 00:12:59 +0000 Subject: [PATCH 071/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 154 +++++++++++++++++++------------ 1 file changed, 97 insertions(+), 57 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 2419abb2e5a..3927fe8dc1b 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,14 +11,14 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 975 plugins. +This list contains 980 plugins. .. only:: not latex =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ name summary last release status requires =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ - :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Dec 22, 2021 N/A pytest (>=6,<7) + :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Nov 30, 2021 N/A pytest (>=5.4.0) :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) @@ -68,7 +68,7 @@ This list contains 975 plugins. :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Dec 27, 2021 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio. Oct 15, 2021 4 - Beta pytest (>=5.4.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Oct 12, 2021 4 - Beta N/A + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jan 03, 2022 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) :pypi:`pytest-async-sqlalchemy` Database testing fixtures using the SQLAlchemy asyncio API Oct 07, 2021 4 - Beta pytest (>=6.0.0) @@ -129,7 +129,7 @@ This list contains 975 plugins. :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A :pypi:`pytest-capture-deprecatedwarnings` pytest plugin to capture all deprecatedwarnings and put them in one file Apr 30, 2019 N/A N/A :pypi:`pytest-capturelogs` A sample Python project Sep 11, 2021 3 - Alpha N/A - :pypi:`pytest-cases` Separate test code from test cases in pytest. Nov 08, 2021 5 - Production/Stable N/A + :pypi:`pytest-cases` Separate test code from test cases in pytest. Jan 07, 2022 5 - Production/Stable N/A :pypi:`pytest-cassandra` Cassandra CCM Test Fixtures for pytest Nov 04, 2017 1 - Planning N/A :pypi:`pytest-catchlog` py.test plugin to catch log messages. This is a fork of pytest-capturelog. Jan 24, 2016 4 - Beta pytest (>=2.6) :pypi:`pytest-catch-server` Pytest plugin with server for catching HTTP requests. Dec 12, 2019 5 - Production/Stable N/A @@ -165,7 +165,7 @@ This list contains 975 plugins. :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-config` Base configurations and utilities for developing your Python project test suite with pytest. Nov 07, 2014 5 - Production/Stable N/A :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Nov 06, 2020 N/A N/A - :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts Sep 28, 2021 4 - Beta N/A + :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts Jan 06, 2022 4 - Beta N/A :pypi:`pytest-consul` pytest plugin with fixtures for testing consul aware apps Nov 24, 2018 3 - Alpha pytest :pypi:`pytest-container` Pytest fixtures for writing container based tests Nov 19, 2021 3 - Alpha pytest (>=3.10) :pypi:`pytest-contextfixture` Define pytest fixtures as context managers. Mar 12, 2013 4 - Beta N/A @@ -291,13 +291,14 @@ This list contains 975 plugins. :pypi:`pytest-elements` Tool to help automate user interfaces Jan 13, 2021 N/A pytest (>=5.4,<6.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Nov 29, 2021 N/A pytest (>=6.2.0) - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Nov 29, 2021 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Nov 29, 2021 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Nov 29, 2021 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Jan 06, 2022 N/A pytest (>=6.2.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jan 06, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jan 06, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jan 06, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jan 06, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Nov 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Nov 29, 2021 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jan 06, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jan 06, 2022 N/A N/A :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Oct 10, 2021 4 - Beta pytest (==6.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -364,6 +365,7 @@ This list contains 975 plugins. :pypi:`pytest-fixture-typecheck` A pytest plugin to assert type annotations at runtime. Aug 24, 2021 N/A pytest :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Dec 16, 2020 4 - Beta pytest (>=3.5) :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. Aug 11, 2021 5 - Production/Stable pytest + :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Jan 04, 2022 4 - Beta pytest (>=3.5) :pypi:`pytest-flakefinder` Runs tests multiple times to expose flakiness. Jul 28, 2020 4 - Beta pytest (>=2.7.1) :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) :pypi:`pytest-flaptastic` Flaptastic py.test plugin Mar 17, 2019 N/A N/A @@ -404,7 +406,7 @@ This list contains 975 plugins. :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Apr 01, 2021 5 - Production/Stable N/A :pypi:`pytest-helm-chart` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jun 15, 2020 4 - Beta pytest (>=5.4.2,<6.0.0) - :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Oct 26, 2021 4 - Beta pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jan 04, 2022 4 - Beta pytest (>=6.1.2,<7.0.0) :pypi:`pytest-helper` Functions to help in using the pytest testing framework May 31, 2019 5 - Production/Stable N/A :pypi:`pytest-helpers` pytest helpers May 17, 2020 N/A pytest :pypi:`pytest-helpers-namespace` Pytest Helpers Namespace Plugin Dec 29, 2021 5 - Production/Stable pytest (>=6.0.0) @@ -412,7 +414,8 @@ This list contains 975 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Dec 30, 2021 3 - Alpha pytest (==6.2.5) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jan 06, 2022 3 - Alpha pytest (==6.2.5) + :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jul 12, 2021 N/A pytest (>=5.0) :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Aug 29, 2021 4 - Beta N/A @@ -435,7 +438,7 @@ This list contains 975 plugins. :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Dec 15, 2021 4 - Beta pytest :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A - :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Dec 24, 2021 N/A N/A + :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 08, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A :pypi:`pytest-image-diff` Jul 28, 2021 3 - Alpha pytest :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A @@ -525,7 +528,7 @@ This list contains 975 plugins. :pypi:`pytest-memprof` Estimates memory consumption of test functions Mar 29, 2019 4 - Beta N/A :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Nov 04, 2021 N/A pytest (>=6.2.5) + :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Jan 05, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Dec 16, 2020 5 - Production/Stable N/A :pypi:`pytest-metadata` pytest plugin for test session metadata Nov 27, 2020 5 - Production/Stable pytest (>=2.9.0) :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest @@ -536,11 +539,11 @@ This list contains 975 plugins. :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest May 06, 2021 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-mock-api` A mock API server with configurable routes and responses available as a fixture. Feb 13, 2019 1 - Planning pytest (>=4.0.0) - :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator Dec 30, 2021 5 - Production/Stable N/A + :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator Jan 05, 2022 5 - Production/Stable N/A :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Dec 22, 2021 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Jan 07, 2022 N/A pytest (>=1.0) :pypi:`pytest-mock-server` Mock server plugin for pytest Apr 06, 2020 4 - Beta N/A :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-modifyjunit` Utility for adding additional properties to junit xml for IDM QE Jan 10, 2019 N/A N/A @@ -554,7 +557,7 @@ This list contains 975 plugins. :pypi:`pytest-moto` Fixtures for integration tests of AWS services,uses moto mocking library. Aug 28, 2015 1 - Planning N/A :pypi:`pytest-motor` A pytest plugin for motor, the non-blocking MongoDB driver. Jul 21, 2021 3 - Alpha pytest :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest - :pypi:`pytest-mpi` pytest plugin to collect information from tests Mar 14, 2021 3 - Alpha pytest + :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 02, 2021 4 - Beta pytest :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Mar 07, 2021 4 - Beta pytest :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest @@ -569,7 +572,7 @@ This list contains 975 plugins. :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Jun 13, 2021 N/A pytest :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Nov 22, 2021 5 - Production/Stable pytest :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) - :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Apr 23, 2019 3 - Alpha pytest (>=3.7.2) + :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) :pypi:`pytest-network` A simple plugin to disable network on socket level. May 07, 2020 N/A N/A :pypi:`pytest-never-sleep` pytest plugin helps to avoid adding tests without mock \`time.sleep\` May 05, 2021 3 - Alpha pytest (>=3.5.1) :pypi:`pytest-nginx` nginx fixture for pytest Aug 12, 2017 5 - Production/Stable N/A @@ -625,10 +628,10 @@ This list contains 975 plugins. :pypi:`pytest-pep257` py.test plugin for pep257 Jul 09, 2016 N/A N/A :pypi:`pytest-pep8` pytest plugin to check PEP8 requirements Apr 27, 2014 N/A N/A :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) - :pypi:`pytest-perf` pytest-perf Jun 27, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' + :pypi:`pytest-perf` pytest-perf Jan 08, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) :pypi:`pytest-persistence` Pytest tool for persistent objects Dec 07, 2021 N/A N/A - :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Dec 28, 2021 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 08, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Nov 10, 2021 4 - Beta pytest (>=6.2) ; extra == 'test' :pypi:`pytest-picked` Run the tests related to the changed files Dec 23, 2020 N/A pytest (>=3.5.0) @@ -711,7 +714,7 @@ This list contains 975 plugins. :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-readme` Test your README.md file Dec 28, 2014 5 - Production/Stable N/A - :pypi:`pytest-reana` Pytest fixtures for REANA. Nov 22, 2021 3 - Alpha N/A + :pypi:`pytest-reana` Pytest fixtures for REANA. Jan 05, 2022 3 - Alpha N/A :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jul 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Dec 07, 2021 5 - Production/Stable pytest @@ -719,7 +722,7 @@ This list contains 975 plugins. :pypi:`pytest-redmine` Pytest plugin for redmine Mar 19, 2018 1 - Planning N/A :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A - :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Jan 27, 2021 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Jan 04, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-regtest` pytest plugin for regression tests Jun 03, 2021 N/A N/A :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Jun 14, 2019 5 - Production/Stable pytest (<5,>=3) @@ -775,13 +778,13 @@ This list contains 975 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Dec 31, 2021 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jan 05, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Aug 31, 2020 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Dec 31, 2021 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jan 05, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -816,7 +819,7 @@ This list contains 975 plugins. :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Dec 02, 2021 4 - Beta pytest (>=3.0.0) :pypi:`pytest-snmpserver` May 12, 2021 N/A N/A - :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Dec 30, 2021 4 - Beta pytest (>=6.2.0) + :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Jan 05, 2022 4 - Beta pytest (>=6.2.0) :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Dec 23, 2021 4 - Beta pytest (>=3.6.3) :pypi:`pytest-soft-assertions` May 05, 2020 3 - Alpha pytest :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) @@ -863,7 +866,8 @@ This list contains 975 plugins. :pypi:`pytest-super-check` Pytest plugin to check your TestCase classes call super in setUp, tearDown, etc. Aug 12, 2021 5 - Production/Stable pytest :pypi:`pytest-svn` SVN repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-symbols` pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. Nov 20, 2017 3 - Alpha N/A - :pypi:`pytest-takeltest` Fixtures for ansible, testinfra and molecule Oct 13, 2021 N/A N/A + :pypi:`pytest-system-statistics` Pytest plugin to track and report system usage statistics Jan 05, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-takeltest` Fixtures for ansible, testinfra and molecule Jan 04, 2022 N/A N/A :pypi:`pytest-talisker` Nov 28, 2021 N/A N/A :pypi:`pytest-tap` Test Anything Protocol (TAP) reporting plugin for pytest Oct 27, 2021 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-tape` easy assertion with expected results saved to yaml files Mar 17, 2021 4 - Beta N/A @@ -883,6 +887,7 @@ This list contains 975 plugins. :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) :pypi:`pytest-testmon` selects tests affected by changed files and methods Oct 22, 2021 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) :pypi:`pytest-testrail2` A small example package Nov 17, 2020 N/A pytest (>=5) :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Dec 17, 2021 N/A pytest (>=5.5) @@ -999,9 +1004,9 @@ This list contains 975 plugins. :pypi:`pytest-accept` - *last release*: Dec 22, 2021, + *last release*: Jan 07, 2022, *status*: N/A, - *requires*: pytest (>=6,<7) + *requires*: pytest (>=6,<8) A pytest-plugin for updating doctest outputs @@ -1349,8 +1354,8 @@ This list contains 975 plugins. Pytest support for asyncio. :pypi:`pytest-asyncio-cooperative` - *last release*: Oct 12, 2021, - *status*: 4 - Beta, + *last release*: Jan 03, 2022, + *status*: N/A, *requires*: N/A Run all your asynchronous tests cooperatively. @@ -1776,7 +1781,7 @@ This list contains 975 plugins. A sample Python project :pypi:`pytest-cases` - *last release*: Nov 08, 2021, + *last release*: Jan 07, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -2028,7 +2033,7 @@ This list contains 975 plugins. Package stands for pytest plugin to upload results into Confluence page. :pypi:`pytest-console-scripts` - *last release*: Sep 28, 2021, + *last release*: Jan 06, 2022, *status*: 4 - Beta, *requires*: N/A @@ -2910,28 +2915,35 @@ This list contains 975 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Nov 29, 2021, + *last release*: Jan 06, 2022, *status*: N/A, *requires*: pytest (>=6.2.0) pytest embedded plugin + :pypi:`pytest-embedded-arduino` + *last release*: Jan 06, 2022, + *status*: N/A, + *requires*: N/A + + pytest embedded plugin for Arduino projects + :pypi:`pytest-embedded-idf` - *last release*: Nov 29, 2021, + *last release*: Jan 06, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Nov 29, 2021, + *last release*: Jan 06, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Nov 29, 2021, + *last release*: Jan 06, 2022, *status*: N/A, *requires*: N/A @@ -2945,14 +2957,14 @@ This list contains 975 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Nov 29, 2021, + *last release*: Jan 06, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Nov 29, 2021, + *last release*: Jan 06, 2022, *status*: N/A, *requires*: N/A @@ -3420,6 +3432,13 @@ This list contains 975 plugins. A pytest fixture for testing flake8 plugins. + :pypi:`pytest-flake8-v2` + *last release*: Jan 04, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=3.5) + + pytest plugin to check FLAKE8 requirements + :pypi:`pytest-flakefinder` *last release*: Jul 28, 2020, *status*: 4 - Beta, @@ -3701,7 +3720,7 @@ This list contains 975 plugins. A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. :pypi:`pytest-helm-charts` - *last release*: Oct 26, 2021, + *last release*: Jan 04, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.1.2,<7.0.0) @@ -3757,12 +3776,19 @@ This list contains 975 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Dec 30, 2021, + *last release*: Jan 06, 2022, *status*: 3 - Alpha, *requires*: pytest (==6.2.5) Experimental package to automatically extract test plugins for Home Assistant custom components + :pypi:`pytest-honey` + *last release*: Jan 07, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + A simple plugin to use with pytest + :pypi:`pytest-honors` *last release*: Mar 06, 2020, *status*: 4 - Beta, @@ -3918,7 +3944,7 @@ This list contains 975 plugins. A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api :pypi:`pytest-idempotent` - *last release*: Dec 24, 2021, + *last release*: Jan 08, 2022, *status*: N/A, *requires*: N/A @@ -4548,7 +4574,7 @@ This list contains 975 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-message` - *last release*: Nov 04, 2021, + *last release*: Jan 05, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) @@ -4625,7 +4651,7 @@ This list contains 975 plugins. A mock API server with configurable routes and responses available as a fixture. :pypi:`pytest-mock-generator` - *last release*: Dec 30, 2021, + *last release*: Jan 05, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4653,7 +4679,7 @@ This list contains 975 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Dec 22, 2021, + *last release*: Jan 07, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -4751,7 +4777,7 @@ This list contains 975 plugins. A test batcher for multiprocessed Pytest runs :pypi:`pytest-mpi` - *last release*: Mar 14, 2021, + *last release*: Jan 08, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -4856,9 +4882,9 @@ This list contains 975 plugins. pytest plugin for visual testing websites using selenium :pypi:`pytest-neo` - *last release*: Apr 23, 2019, + *last release*: Jan 08, 2022, *status*: 3 - Alpha, - *requires*: pytest (>=3.7.2) + *requires*: pytest (>=6.2.0) pytest-neo is a plugin for pytest that shows tests like screen of Matrix. @@ -5248,9 +5274,9 @@ This list contains 975 plugins. Change the exit code of pytest test sessions when a required percent of tests pass. :pypi:`pytest-perf` - *last release*: Jun 27, 2021, + *last release*: Jan 08, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=4.6) ; extra == 'testing' + *requires*: pytest (>=6) ; extra == 'testing' pytest-perf @@ -5269,7 +5295,7 @@ This list contains 975 plugins. Pytest tool for persistent objects :pypi:`pytest-pg` - *last release*: Dec 28, 2021, + *last release*: Jan 08, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.0.0) @@ -5850,7 +5876,7 @@ This list contains 975 plugins. Test your README.md file :pypi:`pytest-reana` - *last release*: Nov 22, 2021, + *last release*: Jan 05, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -5906,7 +5932,7 @@ This list contains 975 plugins. Conveniently run pytest with a dot-formatted test reference. :pypi:`pytest-regressions` - *last release*: Jan 27, 2021, + *last release*: Jan 04, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=3.5.0) @@ -6298,7 +6324,7 @@ This list contains 975 plugins. :pypi:`pytest-sbase` - *last release*: Dec 31, 2021, + *last release*: Jan 05, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6340,7 +6366,7 @@ This list contains 975 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Dec 31, 2021, + *last release*: Jan 05, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6585,7 +6611,7 @@ This list contains 975 plugins. :pypi:`pytest-snowflake-bdd` - *last release*: Dec 30, 2021, + *last release*: Jan 05, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.0) @@ -6913,8 +6939,15 @@ This list contains 975 plugins. pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. + :pypi:`pytest-system-statistics` + *last release*: Jan 05, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=6.0.0) + + Pytest plugin to track and report system usage statistics + :pypi:`pytest-takeltest` - *last release*: Oct 13, 2021, + *last release*: Jan 04, 2022, *status*: N/A, *requires*: N/A @@ -7053,6 +7086,13 @@ This list contains 975 plugins. Plugin to use TestObject Suites with Pytest + :pypi:`pytest-testpluggy` + *last release*: Jan 07, 2022, + *status*: N/A, + *requires*: pytest + + set your encoding + :pypi:`pytest-testrail` *last release*: Aug 27, 2020, *status*: N/A, From f08a77de77fc8e9198d649efb4b71827e39f8b77 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 9 Jan 2022 12:12:19 +0200 Subject: [PATCH 072/549] python: add back `instance` accessor to all python nodes, not just Function Regressed in 062d91ab4 (pytest 7.0.0rc1 only). Fix #9486. --- src/_pytest/python.py | 19 ++++++++++--------- testing/test_collection.py | 25 ++++++++++++++++--------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 90f035e8fb1..513214e08c8 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -283,6 +283,16 @@ def cls(self): node = self.getparent(Class) return node.obj if node is not None else None + @property + def instance(self): + """Python instance object the function is bound to. + + Returns None if not a test method, e.g. for a standalone test function, + a staticmethod, a class or a module. + """ + node = self.getparent(Function) + return getattr(node.obj, "__self__", None) if node is not None else None + @property def obj(self): """Underlying Python object.""" @@ -1693,15 +1703,6 @@ def function(self): """Underlying python 'function' object.""" return getimfunc(self.obj) - @property - def instance(self): - """Python instance object the function is bound to. - - Returns None if not a test method, e.g. for a standalone test function - or a staticmethod. - """ - return getattr(self.obj, "__self__", None) - def _getobj(self): assert self.parent is not None if isinstance(self.parent, Class): diff --git a/testing/test_collection.py b/testing/test_collection.py index 6fd9a708b4e..6a8a5c1cef1 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -64,7 +64,7 @@ def test_fail(): assert 0 assert pytester.collect_by_name(modcol, "doesnotexist") is None - def test_getparent(self, pytester: Pytester) -> None: + def test_getparent_and_accessors(self, pytester: Pytester) -> None: modcol = pytester.getmodulecol( """ class TestClass: @@ -77,14 +77,21 @@ def test_foo(self): fn = pytester.collect_by_name(cls, "test_foo") assert isinstance(fn, pytest.Function) - module_parent = fn.getparent(pytest.Module) - assert module_parent is modcol - - function_parent = fn.getparent(pytest.Function) - assert function_parent is fn - - class_parent = fn.getparent(pytest.Class) - assert class_parent is cls + assert fn.getparent(pytest.Module) is modcol + assert modcol.module is not None + assert modcol.cls is None + assert modcol.instance is None + + assert fn.getparent(pytest.Class) is cls + assert cls.module is not None + assert cls.cls is not None + assert cls.instance is None + + assert fn.getparent(pytest.Function) is fn + assert fn.module is not None + assert fn.cls is not None + assert fn.instance is not None + assert fn.function is not None def test_getcustomfile_roundtrip(self, pytester: Pytester) -> None: hello = pytester.makefile(".xxx", hello="world") From 0ef882364e9249f46d21d1e94867de77096b7c62 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 9 Jan 2022 01:40:57 +0200 Subject: [PATCH 073/549] config: stop resolving symlinks in conftest paths This became the wrong thing to do since 322190fd84e1b86d7b9a2d71f086445ca80c39b3. --- changelog/9493.bugfix.rst | 10 ++++++++++ src/_pytest/config/__init__.py | 11 ++--------- 2 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 changelog/9493.bugfix.rst diff --git a/changelog/9493.bugfix.rst b/changelog/9493.bugfix.rst new file mode 100644 index 00000000000..d99c80b7d2c --- /dev/null +++ b/changelog/9493.bugfix.rst @@ -0,0 +1,10 @@ +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 + +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 :pull:`6523` for details). diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index a6a22d2b913..b75a675b6d8 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -592,15 +592,8 @@ def _rget_with_confmod( def _importconftest( self, conftestpath: Path, importmode: Union[str, ImportMode], rootpath: Path ) -> types.ModuleType: - # Use a resolved Path object as key to avoid loading the same conftest - # twice with build systems that create build directories containing - # symlinks to actual files. - # Using Path().resolve() is better than py.path.realpath because - # it resolves to the correct path/drive in case-insensitive file systems (#5792) - key = conftestpath.resolve() - with contextlib.suppress(KeyError): - return self._conftestpath2mod[key] + return self._conftestpath2mod[conftestpath] pkgpath = resolve_package_path(conftestpath) if pkgpath is None: @@ -616,7 +609,7 @@ def _importconftest( self._check_non_top_pytest_plugins(mod, conftestpath) self._conftest_plugins.add(mod) - self._conftestpath2mod[key] = mod + self._conftestpath2mod[conftestpath] = mod dirpath = conftestpath.parent if dirpath in self._dirpath2confmods: for path, mods in self._dirpath2confmods.items(): From 161bc481178c7dbd59b3ee3de92606a006a269aa Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 9 Jan 2022 00:38:40 +0200 Subject: [PATCH 074/549] config: get rid of _conftestpath2mod It duplicates what PluginManager already knows, and no longer needed now that symlinks are not resolved (see previous commit). --- src/_pytest/config/__init__.py | 9 +++------ testing/test_conftest.py | 21 ++++++++++----------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index b75a675b6d8..3896313e033 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1,7 +1,6 @@ """Command line options, ini-file and conftest.py processing.""" import argparse import collections.abc -import contextlib import copy import enum import inspect @@ -353,8 +352,6 @@ def __init__(self) -> None: # This includes the directory's own conftest modules as well # as those of its parent directories. self._dirpath2confmods: Dict[Path, List[types.ModuleType]] = {} - # The conftest module of a conftest path. - self._conftestpath2mod: Dict[Path, types.ModuleType] = {} # Cutoff directory above which conftests are no longer discovered. self._confcutdir: Optional[Path] = None # If set, conftest loading is skipped. @@ -592,8 +589,9 @@ def _rget_with_confmod( def _importconftest( self, conftestpath: Path, importmode: Union[str, ImportMode], rootpath: Path ) -> types.ModuleType: - with contextlib.suppress(KeyError): - return self._conftestpath2mod[conftestpath] + existing = self.get_plugin(str(conftestpath)) + if existing is not None: + return cast(types.ModuleType, existing) pkgpath = resolve_package_path(conftestpath) if pkgpath is None: @@ -609,7 +607,6 @@ def _importconftest( self._check_non_top_pytest_plugins(mod, conftestpath) self._conftest_plugins.add(mod) - self._conftestpath2mod[conftestpath] = mod dirpath = conftestpath.parent if dirpath in self._dirpath2confmods: for path, mods in self._dirpath2confmods.items(): diff --git a/testing/test_conftest.py b/testing/test_conftest.py index 92a5ffb72cf..4cbc2d14c36 100644 --- a/testing/test_conftest.py +++ b/testing/test_conftest.py @@ -146,10 +146,9 @@ def test_issue151_load_all_conftests(pytester: Pytester) -> None: p = pytester.mkdir(name) p.joinpath("conftest.py").touch() - conftest = PytestPluginManager() - conftest_setinitial(conftest, names) - d = list(conftest._conftestpath2mod.values()) - assert len(d) == len(names) + pm = PytestPluginManager() + conftest_setinitial(pm, names) + assert len(set(pm.get_plugins()) - {pm}) == len(names) def test_conftest_global_import(pytester: Pytester) -> None: @@ -192,7 +191,7 @@ def test_conftestcutdir(pytester: Pytester) -> None: conf.parent, importmode="prepend", rootpath=pytester.path ) assert len(values) == 0 - assert Path(conf) not in conftest._conftestpath2mod + assert not conftest.has_plugin(str(conf)) # but we can still import a conftest directly conftest._importconftest(conf, importmode="prepend", rootpath=pytester.path) values = conftest._getconftestmodules( @@ -226,15 +225,15 @@ def test_setinitial_conftest_subdirs(pytester: Pytester, name: str) -> None: sub = pytester.mkdir(name) subconftest = sub.joinpath("conftest.py") subconftest.touch() - conftest = PytestPluginManager() - conftest_setinitial(conftest, [sub.parent], confcutdir=pytester.path) + pm = PytestPluginManager() + conftest_setinitial(pm, [sub.parent], confcutdir=pytester.path) key = subconftest.resolve() if name not in ("whatever", ".dotdir"): - assert key in conftest._conftestpath2mod - assert len(conftest._conftestpath2mod) == 1 + assert pm.has_plugin(str(key)) + assert len(set(pm.get_plugins()) - {pm}) == 1 else: - assert key not in conftest._conftestpath2mod - assert len(conftest._conftestpath2mod) == 0 + assert not pm.has_plugin(str(key)) + assert len(set(pm.get_plugins()) - {pm}) == 0 def test_conftest_confcutdir(pytester: Pytester) -> None: From 0d5f52b127e79f9a90e811f35dcdcd578a7b6625 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jan 2022 03:02:30 +0000 Subject: [PATCH 075/549] build(deps): Bump django in /testing/plugins_integration Bumps [django](https://github.com/django/django) from 4.0 to 4.0.1. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/4.0...4.0.1) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 4583cf0d3a7..c114a1de87e 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.4.0 -django==4.0 +django==4.0.1 pytest-asyncio==0.16.0 pytest-bdd==5.0.0 pytest-cov==3.0.0 From 8891d1f449ccfd50e528aad734910aa79a327215 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Jan 2022 21:28:04 +0000 Subject: [PATCH 076/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.930 → v0.931](https://github.com/pre-commit/mirrors-mypy/compare/v0.930...v0.931) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 70ff318dcbf..8def093a2c6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -48,7 +48,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.930 + rev: v0.931 hooks: - id: mypy files: ^(src/|testing/) From 0fe0b78a9f77391b8df8c94527bef8ecc8fff407 Mon Sep 17 00:00:00 2001 From: Emmanuel Arias Date: Thu, 13 Jan 2022 12:52:18 -0300 Subject: [PATCH 077/549] Improve on configuration file docs section To avoid confusions the part of that "the configuration file can be locate on your tests folder" is removed. --- changelog/9505.trivial.rst | 2 ++ doc/en/reference/customize.rst | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelog/9505.trivial.rst diff --git a/changelog/9505.trivial.rst b/changelog/9505.trivial.rst new file mode 100644 index 00000000000..51386c226bf --- /dev/null +++ b/changelog/9505.trivial.rst @@ -0,0 +1,2 @@ +Clarify where the configuration files are located. To avoid confusions documentation mentions +that configuration file is located in the root of the repository. diff --git a/doc/en/reference/customize.rst b/doc/en/reference/customize.rst index 22ce24b31e0..626cbaf1709 100644 --- a/doc/en/reference/customize.rst +++ b/doc/en/reference/customize.rst @@ -20,8 +20,7 @@ Configuration file formats -------------------------- Many :ref:`pytest settings ` can be set in a *configuration file*, which -by convention resides on the root of your repository or in your -tests folder. +by convention resides on the root of your repository. A quick example of the configuration files supported by pytest: From 5c2d752e74dbc0e5c39233c0584129709d411112 Mon Sep 17 00:00:00 2001 From: Emmanuel Arias Date: Thu, 13 Jan 2022 13:29:08 -0300 Subject: [PATCH 078/549] improve docs --- doc/en/reference/customize.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/reference/customize.rst b/doc/en/reference/customize.rst index 626cbaf1709..fe10ca066b2 100644 --- a/doc/en/reference/customize.rst +++ b/doc/en/reference/customize.rst @@ -20,7 +20,7 @@ Configuration file formats -------------------------- Many :ref:`pytest settings ` can be set in a *configuration file*, which -by convention resides on the root of your repository. +by convention resides in the root directory of your repository. A quick example of the configuration files supported by pytest: From 2ad1b589af8d3d19af4ed15d5de9779065ea9e62 Mon Sep 17 00:00:00 2001 From: Olga Matoula Date: Thu, 13 Jan 2022 20:32:22 +0200 Subject: [PATCH 079/549] Add docs on pytest.warns(None) deprecation (#9495) * Add docs on pytest.warns(None) deprecation * Add new section for common warnings use cases * Fix references for warnings use cases * Fix reference link --- changelog/9404.doc.rst | 1 + doc/en/deprecations.rst | 6 +++--- doc/en/how-to/capture-warnings.rst | 29 +++++++++++++++++++++++++++++ src/_pytest/deprecated.py | 6 ++++-- testing/deprecated_test.py | 6 ++++-- 5 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 changelog/9404.doc.rst diff --git a/changelog/9404.doc.rst b/changelog/9404.doc.rst new file mode 100644 index 00000000000..70e4c6d5899 --- /dev/null +++ b/changelog/9404.doc.rst @@ -0,0 +1 @@ +Added extra documentation on alternatives to common misuses of `pytest.warns(None)` ahead of its deprecation. diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index 6351d1f6e6a..a667fc4ccdf 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -221,11 +221,11 @@ Using ``pytest.warns(None)`` .. deprecated:: 7.0 -:func:`pytest.warns(None) ` is now deprecated because many people used -it to mean "this code does not emit warnings", but it actually had the effect of -checking that the code emits at least one warning of any type - like ``pytest.warns()`` +:func:`pytest.warns(None) ` is now deprecated because it was frequently misused. +Its correct usage was checking that the code emits at least one warning of any type - like ``pytest.warns()`` or ``pytest.warns(Warning)``. +See :ref:`warns use cases` for examples. The ``--strict`` command-line option ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/en/how-to/capture-warnings.rst b/doc/en/how-to/capture-warnings.rst index efdf10e3394..501edce7a14 100644 --- a/doc/en/how-to/capture-warnings.rst +++ b/doc/en/how-to/capture-warnings.rst @@ -351,6 +351,35 @@ warnings, or index into it to get a particular recorded warning. Full API: :class:`~_pytest.recwarn.WarningsRecorder`. +.. _`warns use cases`: + +Additional use cases of warnings in tests +----------------------------------------- + +Here are some use cases involving warnings that often come up in tests, and suggestions on how to deal with them: + +- To ensure that **any** warning is emitted, use: + +.. code-block:: python + + with pytest.warns(): + pass + +- To ensure that **no** warnings are emitted, use: + +.. code-block:: python + + with warnings.catch_warnings(): + warnings.simplefilter("error") + +- To suppress warnings, use: + +.. code-block:: python + + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + + .. _custom_failure_messages: Custom failure messages diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index f68aea37e4d..4534fbcab82 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -88,8 +88,10 @@ ) WARNS_NONE_ARG = PytestRemovedIn8Warning( - "Passing None to catch any warning has been deprecated, pass no arguments instead:\n" - " Replace pytest.warns(None) by simply pytest.warns()." + "Passing None has been deprecated.\n" + "See https://docs.pytest.org/en/latest/how-to/capture-warnings.html" + "#additional-use-cases-of-warnings-in-tests" + " for alternatives in common use cases." ) KEYWORD_MSG_ARG = UnformattedWarning( diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index 07e69e6840f..4104d19db9a 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -138,8 +138,10 @@ def test_warns_none_is_deprecated(): with pytest.warns( PytestDeprecationWarning, match=re.escape( - "Passing None to catch any warning has been deprecated, pass no arguments instead:\n " - "Replace pytest.warns(None) by simply pytest.warns()." + "Passing None has been deprecated.\n" + "See https://docs.pytest.org/en/latest/how-to/capture-warnings.html" + "#additional-use-cases-of-warnings-in-tests" + " for alternatives in common use cases." ), ): with pytest.warns(None): # type: ignore[call-overload] From 3f4eab3f8f4932cbd31abdaa77cf77bbc3c0d588 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 14 Jan 2022 17:49:38 +0200 Subject: [PATCH 080/549] testing: avoid private pluggy attributes in test --- testing/test_config.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/testing/test_config.py b/testing/test_config.py index c8e21a8478a..bf4b2741eca 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -1264,15 +1264,20 @@ def pytest_load_initial_conftests(self): m = My() pm.register(m) hc = pm.hook.pytest_load_initial_conftests - assert [x.function.__module__ for x in hc._nonwrappers] == [ - "_pytest.config", - m.__module__, - "_pytest.legacypath", - "_pytest.pythonpath", + hookimpls = [ + ( + hookimpl.function.__module__, + "wrapper" if hookimpl.hookwrapper else "nonwrapper", + ) + for hookimpl in hc.get_hookimpls() ] - assert [x.function.__module__ for x in hc._wrappers] == [ - "_pytest.capture", - "_pytest.warnings", + assert hookimpls == [ + ("_pytest.config", "nonwrapper"), + (m.__module__, "nonwrapper"), + ("_pytest.legacypath", "nonwrapper"), + ("_pytest.pythonpath", "nonwrapper"), + ("_pytest.capture", "wrapper"), + ("_pytest.warnings", "wrapper"), ] From 947b5dbc47fca2c8f21fc460888811181fbac788 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 16 Jan 2022 00:13:41 +0000 Subject: [PATCH 081/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 136 ++++++++++++++++++------------- 1 file changed, 80 insertions(+), 56 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 3927fe8dc1b..f8ad9f0bdf7 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 980 plugins. +This list contains 983 plugins. .. only:: not latex @@ -57,7 +57,7 @@ This list contains 980 plugins. :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A :pypi:`pytest-approvaltests` A plugin to use approvaltests with pytest Feb 07, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) - :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Dec 31, 2021 4 - Beta pytest (>=4.6) + :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 4 - Beta pytest (>=4.6) :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A :pypi:`pytest-assertutil` pytest-assertutil May 10, 2019 N/A N/A @@ -67,7 +67,7 @@ This list contains 980 plugins. :pypi:`pytest-astropy` Meta-package containing dependencies for testing Sep 21, 2021 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Dec 27, 2021 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest - :pypi:`pytest-asyncio` Pytest support for asyncio. Oct 15, 2021 4 - Beta pytest (>=5.4.0) + :pypi:`pytest-asyncio` Pytest support for asyncio Jan 13, 2022 4 - Beta pytest (>=5.4.0) :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jan 03, 2022 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) @@ -323,7 +323,7 @@ This list contains 980 plugins. :pypi:`pytest-executable` pytest plugin for testing executables Nov 10, 2021 4 - Beta pytest (<6.3,>=4.3) :pypi:`pytest-execution-timer` A timer for the phases of Pytest's execution. Dec 24, 2021 4 - Beta N/A :pypi:`pytest-expect` py.test plugin to store test expectations and mark tests based on them Apr 21, 2016 4 - Beta N/A - :pypi:`pytest-expecter` Better testing with expecter and pytest. Jul 08, 2020 5 - Production/Stable N/A + :pypi:`pytest-expecter` Better testing with expecter and pytest. Jan 10, 2022 5 - Production/Stable N/A :pypi:`pytest-expectr` This plugin is used to expect multiple assert using pytest framework. Oct 05, 2018 N/A pytest (>=2.4.2) :pypi:`pytest-experiments` A pytest plugin to help developers of research-oriented software projects keep track of the results of their numerical experiments. Dec 13, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) :pypi:`pytest-explicit` A Pytest plugin to ignore certain marked tests by default Jun 15, 2021 5 - Production/Stable pytest @@ -353,7 +353,7 @@ This list contains 980 plugins. :pypi:`pytest-filemarker` A pytest plugin that runs marked tests when files change. Dec 01, 2020 N/A pytest :pypi:`pytest-filter-case` run test cases filter by mark Nov 05, 2020 N/A N/A :pypi:`pytest-filter-subpackage` Pytest plugin for filtering based on sub-packages Jan 09, 2020 3 - Alpha pytest (>=3.0) - :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Dec 26, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Jan 15, 2022 4 - Beta pytest (>=4.3.0) :pypi:`pytest-finer-verdicts` A pytest plugin to treat non-assertion failures as test errors. Jun 18, 2020 N/A pytest (>=5.4.3) :pypi:`pytest-firefox` pytest plugin to manipulate firefox Aug 08, 2017 3 - Alpha pytest (>=3.0.2) :pypi:`pytest-fixture-config` Fixture configuration utils for py.test May 28, 2019 5 - Production/Stable pytest @@ -364,7 +364,7 @@ This list contains 980 plugins. :pypi:`pytest-fixture-tools` Plugin for pytest which provides tools for fixtures Aug 18, 2020 6 - Mature pytest :pypi:`pytest-fixture-typecheck` A pytest plugin to assert type annotations at runtime. Aug 24, 2021 N/A pytest :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Dec 16, 2020 4 - Beta pytest (>=3.5) - :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. Aug 11, 2021 5 - Production/Stable pytest + :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. Jan 10, 2022 5 - Production/Stable pytest :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Jan 04, 2022 4 - Beta pytest (>=3.5) :pypi:`pytest-flakefinder` Runs tests multiple times to expose flakiness. Jul 28, 2020 4 - Beta pytest (>=2.7.1) :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) @@ -388,8 +388,9 @@ This list contains 980 plugins. :pypi:`pytest-gcov` Uses gcov to measure test coverage of a C library Feb 01, 2018 3 - Alpha N/A :pypi:`pytest-gevent` Ensure that gevent is properly patched when invoking pytest Feb 25, 2020 N/A pytest :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) + :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Nov 30, 2021 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Jan 10, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -406,7 +407,7 @@ This list contains 980 plugins. :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Apr 01, 2021 5 - Production/Stable N/A :pypi:`pytest-helm-chart` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jun 15, 2020 4 - Beta pytest (>=5.4.2,<6.0.0) - :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jan 04, 2022 4 - Beta pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jan 10, 2022 4 - Beta pytest (>=6.1.2,<7.0.0) :pypi:`pytest-helper` Functions to help in using the pytest testing framework May 31, 2019 5 - Production/Stable N/A :pypi:`pytest-helpers` pytest helpers May 17, 2020 N/A pytest :pypi:`pytest-helpers-namespace` Pytest Helpers Namespace Plugin Dec 29, 2021 5 - Production/Stable pytest (>=6.0.0) @@ -414,7 +415,7 @@ This list contains 980 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jan 06, 2022 3 - Alpha pytest (==6.2.5) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jan 11, 2022 3 - Alpha pytest (==6.2.5) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jul 12, 2021 N/A pytest (>=5.0) @@ -435,10 +436,10 @@ This list contains 980 plugins. :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A - :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Dec 15, 2021 4 - Beta pytest + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jan 14, 2022 4 - Beta pytest :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A - :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 08, 2022 N/A N/A + :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 10, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A :pypi:`pytest-image-diff` Jul 28, 2021 3 - Alpha pytest :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A @@ -462,7 +463,7 @@ This list contains 980 plugins. :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A :pypi:`pytest-isort` py.test plugin to check import ordering using isort Apr 27, 2021 5 - Production/Stable N/A - :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. Dec 06, 2021 5 - Production/Stable pytest + :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. Jan 10, 2022 5 - Production/Stable pytest :pypi:`pytest-it` Pytest plugin to display test reports as a plaintext spec, inspired by Rspec: https://github.com/mattduck/pytest-it. Jan 22, 2020 4 - Beta N/A :pypi:`pytest-iterassert` Nicer list and iterable assertion messages for pytest May 11, 2020 3 - Alpha N/A :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A @@ -543,8 +544,8 @@ This list contains 980 plugins. :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Jan 07, 2022 N/A pytest (>=1.0) - :pypi:`pytest-mock-server` Mock server plugin for pytest Apr 06, 2020 4 - Beta N/A + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Jan 11, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-modifyjunit` Utility for adding additional properties to junit xml for IDM QE Jan 10, 2019 N/A N/A :pypi:`pytest-modifyscope` pytest plugin to modify fixture scope Apr 12, 2020 N/A pytest @@ -567,7 +568,7 @@ This list contains 980 plugins. :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Mar 21, 2021 4 - Beta pytest (>=3.5) :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" - :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Oct 19, 2021 3 - Alpha pytest (>=6.0.0) + :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Jan 11, 2022 3 - Alpha pytest (>=6.0.0) :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A N/A :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Jun 13, 2021 N/A pytest :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Nov 22, 2021 5 - Production/Stable pytest @@ -605,7 +606,7 @@ This list contains 980 plugins. :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A - :pypi:`pytest-order` pytest plugin to run your tests in a specific order May 30, 2021 4 - Beta pytest (>=5.0) + :pypi:`pytest-order` pytest plugin to run your tests in a specific order Jan 09, 2022 4 - Beta pytest (>=5.0) ; python_version < "3.10" :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Dec 16, 2021 N/A N/A @@ -631,7 +632,7 @@ This list contains 980 plugins. :pypi:`pytest-perf` pytest-perf Jan 08, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) :pypi:`pytest-persistence` Pytest tool for persistent objects Dec 07, 2021 N/A N/A - :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 08, 2022 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 09, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Nov 10, 2021 4 - Beta pytest (>=6.2) ; extra == 'test' :pypi:`pytest-picked` Run the tests related to the changed files Dec 23, 2020 N/A pytest (>=3.5.0) @@ -709,7 +710,7 @@ This list contains 980 plugins. :pypi:`pytest-raisesregexp` Simple pytest plugin to look for regex in Exceptions Dec 18, 2015 N/A N/A :pypi:`pytest-raisin` Plugin enabling the use of exception instances with pytest.raises Jun 25, 2020 N/A pytest :pypi:`pytest-random` py.test plugin to randomize tests Apr 28, 2013 3 - Alpha N/A - :pypi:`pytest-randomly` Pytest plugin to randomly order tests and control random.seed. Nov 30, 2021 5 - Production/Stable pytest + :pypi:`pytest-randomly` Pytest plugin to randomly order tests and control random.seed. Jan 10, 2022 5 - Production/Stable pytest :pypi:`pytest-randomness` Pytest plugin about random seed management May 30, 2019 3 - Alpha N/A :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) @@ -742,7 +743,7 @@ This list contains 980 plugins. :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility Dec 11, 2020 3 - Alpha pytest (>=5.2) :pypi:`pytest-report-me` A pytest plugin to generate report. Dec 31, 2020 N/A pytest :pypi:`pytest-report-parameters` pytest plugin for adding tests' parameters to junit report Jun 18, 2020 3 - Alpha pytest (>=2.4.2) - :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Jun 18, 2021 N/A pytest (>=3.8.0) + :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Jan 11, 2022 N/A pytest (>=3.8.0) :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) @@ -754,9 +755,9 @@ This list contains 980 plugins. :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Oct 10, 2020 5 - Production/Stable N/A :pypi:`pytest-responses` py.test integration for responses Apr 26, 2021 N/A pytest (>=2.5) - :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed Aug 12, 2021 5 - Production/Stable pytest + :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed Jan 10, 2022 5 - Production/Stable pytest :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A - :pypi:`pytest-reverse` Pytest plugin to reverse test order. Aug 12, 2021 5 - Production/Stable pytest + :pypi:`pytest-reverse` Pytest plugin to reverse test order. Jan 10, 2022 5 - Production/Stable pytest :pypi:`pytest-ringo` pytest plugin to test webapplications using the Ringo webframework Sep 27, 2017 3 - Alpha N/A :pypi:`pytest-rng` Fixtures for seeding tests and making randomness reproducible Aug 08, 2019 5 - Production/Stable pytest :pypi:`pytest-roast` pytest plugin for ROAST configuration override and fixtures Jul 29, 2021 5 - Production/Stable pytest @@ -778,13 +779,13 @@ This list contains 980 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jan 05, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jan 12, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Aug 31, 2020 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jan 05, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jan 12, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -822,6 +823,7 @@ This list contains 980 plugins. :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Jan 05, 2022 4 - Beta pytest (>=6.2.0) :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Dec 23, 2021 4 - Beta pytest (>=3.6.3) :pypi:`pytest-soft-assertions` May 05, 2020 3 - Alpha pytest + :pypi:`pytest-solidity` A PyTest library plugin for Solidity language. Jan 15, 2022 1 - Planning pytest (<7,>=6.0.1) ; extra == 'tests' :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) :pypi:`pytest-sorter` A simple plugin to first execute tests that historically failed more Apr 20, 2021 4 - Beta pytest (>=3.1.1) :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Dec 20, 2021 2 - Pre-Alpha pytest @@ -833,7 +835,7 @@ This list contains 980 plugins. :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Oct 13, 2021 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Dec 22, 2021 6 - Mature pytest (>=6.2.4) - :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Nov 09, 2021 4 - Beta pytest (>=5,<7) + :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Jan 10, 2022 4 - Beta pytest (>=5,<7) :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A @@ -859,11 +861,11 @@ This list contains 980 plugins. :pypi:`pytest-study` A pytest plugin to organize long run tests (named studies) without interfering the regular tests Sep 26, 2017 3 - Alpha pytest (>=2.0) :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Nov 07, 2021 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Mar 02, 2021 N/A N/A - :pypi:`pytest-subtests` unittest subTest() support and subtests fixture May 29, 2021 4 - Beta pytest (>=5.3.0) + :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Jan 15, 2022 4 - Beta pytest (>=6.0) :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Jul 06, 2020 3 - Alpha N/A :pypi:`pytest-sugar-bugfix159` Workaround for https://github.com/Frozenball/pytest-sugar/issues/159 Nov 07, 2018 5 - Production/Stable pytest (!=3.7.3,>=3.5); extra == 'testing' - :pypi:`pytest-super-check` Pytest plugin to check your TestCase classes call super in setUp, tearDown, etc. Aug 12, 2021 5 - Production/Stable pytest + :pypi:`pytest-super-check` Pytest plugin to check your TestCase classes call super in setUp, tearDown, etc. Jan 10, 2022 5 - Production/Stable pytest :pypi:`pytest-svn` SVN repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-symbols` pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. Nov 20, 2017 3 - Alpha N/A :pypi:`pytest-system-statistics` Pytest plugin to track and report system usage statistics Jan 05, 2022 4 - Beta pytest (>=6.0.0) @@ -912,6 +914,7 @@ This list contains 980 plugins. :pypi:`pytest-timeouts` Linux-only Pytest plugin to control durations of various test case execution phases Sep 21, 2019 5 - Production/Stable N/A :pypi:`pytest-timer` A timer plugin for pytest Jun 02, 2021 N/A N/A :pypi:`pytest-timestamper` Pytest plugin to add a timestamp prefix to the pytest output Jun 06, 2021 N/A N/A + :pypi:`pytest-timestamps` A simple plugin to view timestamps for each test Jan 14, 2022 N/A pytest (>=5.2) :pypi:`pytest-tipsi-django` Nov 17, 2021 4 - Beta pytest (>=6.0.0) :pypi:`pytest-tipsi-testing` Better fixtures management. Various helpers Nov 04, 2020 4 - Beta pytest (>=3.3.0) :pypi:`pytest-tldr` A pytest plugin that limits the output to just the things you need. Mar 12, 2021 4 - Beta pytest (>=3.5.0) @@ -1277,7 +1280,7 @@ This list contains 980 plugins. pyest results colection plugin :pypi:`pytest-arraydiff` - *last release*: Dec 31, 2021, + *last release*: Jan 13, 2022, *status*: 4 - Beta, *requires*: pytest (>=4.6) @@ -1347,11 +1350,11 @@ This list contains 980 plugins. :pypi:`pytest-asyncio` - *last release*: Oct 15, 2021, + *last release*: Jan 13, 2022, *status*: 4 - Beta, *requires*: pytest (>=5.4.0) - Pytest support for asyncio. + Pytest support for asyncio :pypi:`pytest-asyncio-cooperative` *last release*: Jan 03, 2022, @@ -3139,7 +3142,7 @@ This list contains 980 plugins. py.test plugin to store test expectations and mark tests based on them :pypi:`pytest-expecter` - *last release*: Jul 08, 2020, + *last release*: Jan 10, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -3349,9 +3352,9 @@ This list contains 980 plugins. Pytest plugin for filtering based on sub-packages :pypi:`pytest-find-dependencies` - *last release*: Dec 26, 2021, + *last release*: Jan 15, 2022, *status*: 4 - Beta, - *requires*: pytest (>=3.5.0) + *requires*: pytest (>=4.3.0) A pytest plugin to find dependencies between tests @@ -3426,7 +3429,7 @@ This list contains 980 plugins. pytest plugin to check FLAKE8 requirements :pypi:`pytest-flake8-path` - *last release*: Aug 11, 2021, + *last release*: Jan 10, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -3593,6 +3596,13 @@ This list contains 980 plugins. A flexible framework for executing BDD gherkin tests + :pypi:`pytest-gh-log-group` + *last release*: Jan 11, 2022, + *status*: 3 - Alpha, + *requires*: pytest + + pytest plugin for gh actions + :pypi:`pytest-ghostinspector` *last release*: May 17, 2016, *status*: 3 - Alpha, @@ -3601,7 +3611,7 @@ This list contains 980 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Nov 30, 2021, + *last release*: Jan 10, 2022, *status*: N/A, *requires*: N/A @@ -3720,7 +3730,7 @@ This list contains 980 plugins. A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. :pypi:`pytest-helm-charts` - *last release*: Jan 04, 2022, + *last release*: Jan 10, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.1.2,<7.0.0) @@ -3776,7 +3786,7 @@ This list contains 980 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jan 06, 2022, + *last release*: Jan 11, 2022, *status*: 3 - Alpha, *requires*: pytest (==6.2.5) @@ -3923,7 +3933,7 @@ This list contains 980 plugins. help hypo module for pytest :pypi:`pytest-ibutsu` - *last release*: Dec 15, 2021, + *last release*: Jan 14, 2022, *status*: 4 - Beta, *requires*: pytest @@ -3944,7 +3954,7 @@ This list contains 980 plugins. A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api :pypi:`pytest-idempotent` - *last release*: Jan 08, 2022, + *last release*: Jan 10, 2022, *status*: N/A, *requires*: N/A @@ -4112,7 +4122,7 @@ This list contains 980 plugins. py.test plugin to check import ordering using isort :pypi:`pytest-is-running` - *last release*: Dec 06, 2021, + *last release*: Jan 10, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -4679,16 +4689,16 @@ This list contains 980 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Jan 07, 2022, + *last release*: Jan 11, 2022, *status*: N/A, *requires*: pytest (>=1.0) A pytest plugin for easily instantiating reproducible mock resources. :pypi:`pytest-mock-server` - *last release*: Apr 06, 2020, + *last release*: Jan 09, 2022, *status*: 4 - Beta, - *requires*: N/A + *requires*: pytest (>=3.5.0) Mock server plugin for pytest @@ -4847,7 +4857,7 @@ This list contains 980 plugins. Mypy static type checker plugin for Pytest :pypi:`pytest-mypy-plugins` - *last release*: Oct 19, 2021, + *last release*: Jan 11, 2022, *status*: 3 - Alpha, *requires*: pytest (>=6.0.0) @@ -5113,9 +5123,9 @@ This list contains 980 plugins. A pytest plugin for orchestrating tests :pypi:`pytest-order` - *last release*: May 30, 2021, + *last release*: Jan 09, 2022, *status*: 4 - Beta, - *requires*: pytest (>=5.0) + *requires*: pytest (>=5.0) ; python_version < "3.10" pytest plugin to run your tests in a specific order @@ -5295,7 +5305,7 @@ This list contains 980 plugins. Pytest tool for persistent objects :pypi:`pytest-pg` - *last release*: Jan 08, 2022, + *last release*: Jan 09, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.0.0) @@ -5841,7 +5851,7 @@ This list contains 980 plugins. py.test plugin to randomize tests :pypi:`pytest-randomly` - *last release*: Nov 30, 2021, + *last release*: Jan 10, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6072,7 +6082,7 @@ This list contains 980 plugins. pytest plugin for adding tests' parameters to junit report :pypi:`pytest-reportportal` - *last release*: Jun 18, 2021, + *last release*: Jan 11, 2022, *status*: N/A, *requires*: pytest (>=3.8.0) @@ -6156,7 +6166,7 @@ This list contains 980 plugins. py.test integration for responses :pypi:`pytest-restrict` - *last release*: Aug 12, 2021, + *last release*: Jan 10, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6170,7 +6180,7 @@ This list contains 980 plugins. A RethinkDB plugin for pytest. :pypi:`pytest-reverse` - *last release*: Aug 12, 2021, + *last release*: Jan 10, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6324,7 +6334,7 @@ This list contains 980 plugins. :pypi:`pytest-sbase` - *last release*: Jan 05, 2022, + *last release*: Jan 12, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6366,7 +6376,7 @@ This list contains 980 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Jan 05, 2022, + *last release*: Jan 12, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6631,6 +6641,13 @@ This list contains 980 plugins. + :pypi:`pytest-solidity` + *last release*: Jan 15, 2022, + *status*: 1 - Planning, + *requires*: pytest (<7,>=6.0.1) ; extra == 'tests' + + A PyTest library plugin for Solidity language. + :pypi:`pytest-solr` *last release*: May 11, 2020, *status*: 3 - Alpha, @@ -6709,7 +6726,7 @@ This list contains 980 plugins. Pytest plugin for the splinter automation library :pypi:`pytest-split` - *last release*: Nov 09, 2021, + *last release*: Jan 10, 2022, *status*: 4 - Beta, *requires*: pytest (>=5,<7) @@ -6891,9 +6908,9 @@ This list contains 980 plugins. A hack to explicitly set up and tear down fixtures. :pypi:`pytest-subtests` - *last release*: May 29, 2021, + *last release*: Jan 15, 2022, *status*: 4 - Beta, - *requires*: pytest (>=5.3.0) + *requires*: pytest (>=6.0) unittest subTest() support and subtests fixture @@ -6919,7 +6936,7 @@ This list contains 980 plugins. Workaround for https://github.com/Frozenball/pytest-sugar/issues/159 :pypi:`pytest-super-check` - *last release*: Aug 12, 2021, + *last release*: Jan 10, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -7261,6 +7278,13 @@ This list contains 980 plugins. Pytest plugin to add a timestamp prefix to the pytest output + :pypi:`pytest-timestamps` + *last release*: Jan 14, 2022, + *status*: N/A, + *requires*: pytest (>=5.2) + + A simple plugin to view timestamps for each test + :pypi:`pytest-tipsi-django` *last release*: Nov 17, 2021, *status*: 4 - Beta, From c393f95c9989d5187f07b8e62519bd5467f0f0db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jan 2022 03:02:30 +0000 Subject: [PATCH 082/549] build(deps): Bump anyio[curio,trio] in /testing/plugins_integration Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio) from 3.4.0 to 3.5.0. - [Release notes](https://github.com/agronholm/anyio/releases) - [Changelog](https://github.com/agronholm/anyio/blob/master/docs/versionhistory.rst) - [Commits](https://github.com/agronholm/anyio/compare/3.4.0...3.5.0) --- updated-dependencies: - dependency-name: anyio[curio,trio] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index c114a1de87e..8cf38ee53ca 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,4 +1,4 @@ -anyio[curio,trio]==3.4.0 +anyio[curio,trio]==3.5.0 django==4.0.1 pytest-asyncio==0.16.0 pytest-bdd==5.0.0 From 3f44b4078c6a69c73299f318d9a6816caedd258d Mon Sep 17 00:00:00 2001 From: Brett Holman Date: Tue, 18 Jan 2022 09:46:06 -0700 Subject: [PATCH 083/549] Add test coverage to test rewrite --- changelog/9521.improvement.rst | 1 + testing/test_assertrewrite.py | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 changelog/9521.improvement.rst diff --git a/changelog/9521.improvement.rst b/changelog/9521.improvement.rst new file mode 100644 index 00000000000..0c402ad242b --- /dev/null +++ b/changelog/9521.improvement.rst @@ -0,0 +1 @@ +Add test coverage to assertion rewrite path. diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index c568143f51c..dd1573935fc 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1123,6 +1123,28 @@ def test_read_pyc(self, tmp_path: Path) -> None: assert _read_pyc(source, pyc) is None # no error + def test_read_pyc_success(self, tmp_path: Path, pytester: Pytester) -> None: + """ + Ensure that the _rewrite_test() -> _write_pyc() produces a pyc file + that can be properly read with _read_pyc() + """ + from _pytest.assertion import AssertionState + from _pytest.assertion.rewrite import _read_pyc + from _pytest.assertion.rewrite import _rewrite_test + from _pytest.assertion.rewrite import _write_pyc + + config = pytester.parseconfig() + state = AssertionState(config, "rewrite") + + fn = tmp_path / "source.py" + pyc = Path(str(fn) + "c") + + fn.write_text("def test(): assert True") + + source_stat, co = _rewrite_test(fn, config) + _write_pyc(state, co, source_stat, pyc) + assert _read_pyc(fn, pyc, state.trace) is not None + def test_read_pyc_more_invalid(self, tmp_path: Path) -> None: from _pytest.assertion.rewrite import _read_pyc From 1fd0dcd5108ae4abd960ddadb666f1d6a2d7177f Mon Sep 17 00:00:00 2001 From: Chris NeJame Date: Wed, 19 Jan 2022 09:09:47 -0500 Subject: [PATCH 084/549] fix missing ref to flattened fixture order image --- .../test_fixtures_order_autouse_flat.svg | 56 +++++++++++++++++++ doc/en/reference/fixtures.rst | 3 + 2 files changed, 59 insertions(+) create mode 100644 doc/en/example/fixtures/test_fixtures_order_autouse_flat.svg diff --git a/doc/en/example/fixtures/test_fixtures_order_autouse_flat.svg b/doc/en/example/fixtures/test_fixtures_order_autouse_flat.svg new file mode 100644 index 00000000000..03c4598272a --- /dev/null +++ b/doc/en/example/fixtures/test_fixtures_order_autouse_flat.svg @@ -0,0 +1,56 @@ + + + + + order + + a + + b + + c + + autouse + + d + + e + + f + + g + + test_order + diff --git a/doc/en/reference/fixtures.rst b/doc/en/reference/fixtures.rst index da2c5e009c3..d25979ab95d 100644 --- a/doc/en/reference/fixtures.rst +++ b/doc/en/reference/fixtures.rst @@ -401,6 +401,9 @@ the graph would look like this: Because ``c`` can now be put above ``d`` in the graph, pytest can once again linearize the graph to this: +.. image:: /example/fixtures/test_fixtures_order_autouse_flat.* + :align: center + In this example, ``c`` makes ``b`` and ``a`` effectively autouse fixtures as well. From 6672a103545f28b7d9fc455538769bb127744889 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 19 Jan 2022 15:42:04 +0200 Subject: [PATCH 085/549] fixtures: use node.ihook instead of open-coding it --- src/_pytest/fixtures.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index e0409fcf2d7..be03fb2a820 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -992,8 +992,8 @@ def finish(self, request: SubRequest) -> None: if exc: raise exc finally: - hook = self._fixturemanager.session.gethookproxy(request.node.path) - hook.pytest_fixture_post_finalizer(fixturedef=self, request=request) + ihook = request.node.ihook + ihook.pytest_fixture_post_finalizer(fixturedef=self, request=request) # Even if finalization fails, we invalidate the cached fixture # value and remove all finalizers because they may be bound methods # which will keep instances alive. @@ -1027,8 +1027,8 @@ def execute(self, request: SubRequest) -> FixtureValue: self.finish(request) assert self.cached_result is None - hook = self._fixturemanager.session.gethookproxy(request.node.path) - result = hook.pytest_fixture_setup(fixturedef=self, request=request) + ihook = request.node.ihook + result = ihook.pytest_fixture_setup(fixturedef=self, request=request) return result def cache_key(self, request: SubRequest) -> object: From 4e5fb520b620b9d50479b8e4e9ac85863f1558c0 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 6 Oct 2021 22:39:49 +0300 Subject: [PATCH 086/549] python: remove an unneeded normalize_mark_list call `callspec.mark` is already `List[Mark]` so no need to normalize it. --- src/_pytest/python.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 513214e08c8..98c28b3d2f9 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1666,7 +1666,7 @@ def __init__( # feel free to cry, this was broken for years before # and keywords can't fix it per design self.keywords[mark.name] = mark - self.own_markers.extend(normalize_mark_list(callspec.marks)) + self.own_markers.extend(callspec.marks) if keywords: self.keywords.update(keywords) From e9bb1aa233c882de53172cdd5e762a8a49e427a7 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 7 Oct 2021 00:42:43 +0300 Subject: [PATCH 087/549] python: be consistent with what value marks have in keywords Marks are added to keywords in three places: - `Node.add_marker`: name -> `Mark` - `Function.__init__(callspec)`: name -> `Mark` - `Function.__init__ iter_markers`: name -> True I think it should be consistent, which will also help with some upcoming code cleaning. The `Mark` seems more useful than just a `True`, so switch to that. --- src/_pytest/python.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 98c28b3d2f9..d07c01d7bc9 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1675,7 +1675,7 @@ def __init__( self.keywords.update( { - mark.name: True + mark.name: mark for mark in self.iter_markers() if mark.name not in self.keywords } From 8713c3246212b04ae75739a02c72c581ea5570d7 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 7 Oct 2021 00:37:19 +0300 Subject: [PATCH 088/549] python: unpacked marks need to be added to keywords on all node types (except `Instance`) Currently, `Function` does this manually, but other node types don't get their markers added to their `keywords`, but they should, if only for consistency. --- src/_pytest/python.py | 3 +++ testing/test_collection.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index d07c01d7bc9..71c998c8e54 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -303,6 +303,9 @@ def obj(self): # used to avoid Function marker duplication if self._ALLOW_MARKERS: self.own_markers.extend(get_unpacked_marks(self.obj)) + # This assumes that `obj` is called before there is a chance + # to add custom keys to `self.keywords`, so no fear of overriding. + self.keywords.update({mark.name: mark for mark in self.own_markers}) return obj @obj.setter diff --git a/testing/test_collection.py b/testing/test_collection.py index 6a8a5c1cef1..e79ae384d7a 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -881,6 +881,36 @@ def test_method(self): pass assert item.keywords["kw"] == "method" assert len(item.keywords) == len(set(item.keywords)) + def test_unpacked_marks_added_to_keywords(self, pytester: Pytester) -> None: + item = pytester.getitem( + """ + import pytest + pytestmark = pytest.mark.foo + class TestClass: + pytestmark = pytest.mark.bar + def test_method(self): pass + test_method.pytestmark = pytest.mark.baz + """, + "test_method", + ) + assert isinstance(item, pytest.Function) + cls = item.getparent(pytest.Class) + assert cls is not None + mod = item.getparent(pytest.Module) + assert mod is not None + + assert item.keywords["foo"] == pytest.mark.foo.mark + assert item.keywords["bar"] == pytest.mark.bar.mark + assert item.keywords["baz"] == pytest.mark.baz.mark + + assert cls.keywords["foo"] == pytest.mark.foo.mark + assert cls.keywords["bar"] == pytest.mark.bar.mark + assert "baz" not in cls.keywords + + assert mod.keywords["foo"] == pytest.mark.foo.mark + assert "bar" not in mod.keywords + assert "baz" not in mod.keywords + COLLECTION_ERROR_PY_FILES = dict( test_01_failure=""" From d9bcfa0c2bb0ebf8e0a59c8296625a1eca77da05 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 6 Oct 2021 22:41:04 +0300 Subject: [PATCH 089/549] python: don't redundantly duplicate parent markers to own keywords This does have a slight semantic change: in a node hierarchy parent -> child, if parent has a marker applied, then child is constructed, then `parent.themarker = "overridden"`, previously `child.keywords['themarker']` would return `True`, now it returns `"overridden"`. But that's actually what I would have expected so I see it as more of a bugfix. --- src/_pytest/python.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 71c998c8e54..60b2ae20fd3 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1676,10 +1676,11 @@ def __init__( # todo: this is a hell of a hack # https://github.com/pytest-dev/pytest/issues/4569 + # Take own_markers only; NodeKeywords handles parent traversal on its own. self.keywords.update( { mark.name: mark - for mark in self.iter_markers() + for mark in self.own_markers if mark.name not in self.keywords } ) From 3c69bc919c1cc5c45f52b90ef1ebdd136952d577 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 6 Oct 2021 22:59:34 +0300 Subject: [PATCH 090/549] python: remove broken/ineffectual keywords marks initialization By my analysis, this deleted code block has no effect: 1. `self.keywords` is `update`d with `callspec.marks`. 2. `self.own_markers` is `update`d with `callspec.marks`. 3. `self.keywords` is `update`d with `self.own_markers`. So together steps 2+3 completely undo step 1. --- src/_pytest/python.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 60b2ae20fd3..63701a5355e 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1662,13 +1662,6 @@ def __init__( self.own_markers.extend(get_unpacked_marks(self.obj)) if callspec: self.callspec = callspec - # this is total hostile and a mess - # keywords are broken by design by now - # this will be redeemed later - for mark in callspec.marks: - # feel free to cry, this was broken for years before - # and keywords can't fix it per design - self.keywords[mark.name] = mark self.own_markers.extend(callspec.marks) if keywords: self.keywords.update(keywords) From 456a2538acfe72ba080e1beaf907cbea822153c8 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 6 Oct 2021 22:50:36 +0300 Subject: [PATCH 091/549] python: optimize node keywords initialization If we do the `update`s in the right order, we can avoid the `mark.name not in self.keywords` check, since `self.keywords` starts out clean and `update` will override previously set keywords. --- src/_pytest/python.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 63701a5355e..b71f1bbfc0f 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1658,25 +1658,20 @@ def __init__( # Note: when FunctionDefinition is introduced, we should change ``originalname`` # to a readonly property that returns FunctionDefinition.name. - self.keywords.update(self.obj.__dict__) self.own_markers.extend(get_unpacked_marks(self.obj)) if callspec: self.callspec = callspec self.own_markers.extend(callspec.marks) - if keywords: - self.keywords.update(keywords) # todo: this is a hell of a hack # https://github.com/pytest-dev/pytest/issues/4569 - + # Note: the order of the updates is important here; indicates what + # takes priority (ctor argument over function attributes over markers). # Take own_markers only; NodeKeywords handles parent traversal on its own. - self.keywords.update( - { - mark.name: mark - for mark in self.own_markers - if mark.name not in self.keywords - } - ) + self.keywords.update({mark.name: mark for mark in self.own_markers}) + self.keywords.update(self.obj.__dict__) + if keywords: + self.keywords.update(keywords) if fixtureinfo is None: fixtureinfo = self.session._fixturemanager.getfixtureinfo( From 74571ba55f66cba9ed18945212af4afab6a2cab6 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 6 Oct 2021 23:29:48 +0300 Subject: [PATCH 092/549] Add missing `keywords` type annotations --- src/_pytest/python.py | 2 +- src/_pytest/reports.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index b71f1bbfc0f..9b1d3119b21 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1637,7 +1637,7 @@ def __init__( config: Optional[Config] = None, callspec: Optional[CallSpec2] = None, callobj=NOTSET, - keywords=None, + keywords: Optional[Mapping[str, Any]] = None, session: Optional[Session] = None, fixtureinfo: Optional[FuncFixtureInfo] = None, originalname: Optional[str] = None, diff --git a/src/_pytest/reports.py b/src/_pytest/reports.py index a68e68bc526..725fdf61739 100644 --- a/src/_pytest/reports.py +++ b/src/_pytest/reports.py @@ -7,6 +7,7 @@ from typing import Iterable from typing import Iterator from typing import List +from typing import Mapping from typing import Optional from typing import Tuple from typing import Type @@ -254,7 +255,7 @@ def __init__( self, nodeid: str, location: Tuple[str, Optional[int], str], - keywords, + keywords: Mapping[str, Any], outcome: "Literal['passed', 'failed', 'skipped']", longrepr: Union[ None, ExceptionInfo[BaseException], Tuple[str, int, str], str, TerminalRepr From 6d128cd52ef70e401999acda8d45dd5f6139b071 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 7 Oct 2021 01:15:22 +0300 Subject: [PATCH 093/549] python: use a more memory-friendly generator --- src/_pytest/python.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 9b1d3119b21..6fda4d544e7 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -305,7 +305,7 @@ def obj(self): self.own_markers.extend(get_unpacked_marks(self.obj)) # This assumes that `obj` is called before there is a chance # to add custom keys to `self.keywords`, so no fear of overriding. - self.keywords.update({mark.name: mark for mark in self.own_markers}) + self.keywords.update((mark.name, mark) for mark in self.own_markers) return obj @obj.setter @@ -1668,7 +1668,7 @@ def __init__( # Note: the order of the updates is important here; indicates what # takes priority (ctor argument over function attributes over markers). # Take own_markers only; NodeKeywords handles parent traversal on its own. - self.keywords.update({mark.name: mark for mark in self.own_markers}) + self.keywords.update((mark.name, mark) for mark in self.own_markers) self.keywords.update(self.obj.__dict__) if keywords: self.keywords.update(keywords) From 471634d6bdc2ac6b838d8fd191d274bea2a97c97 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 21 Jan 2022 16:16:40 +0200 Subject: [PATCH 094/549] python: fix confused docstring of `Metafunc._resolve_arg_ids` The docstring (and function name itself) described things as if IDs are being assigned to the argnames, but actually they're assigned to the parameter sets. --- src/_pytest/python.py | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 513214e08c8..da3bd950ddd 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1118,7 +1118,7 @@ def parametrize( It will also override any fixture-function defined scope, allowing to set a dynamic scope using test context or configuration. """ - argnames, parameters = ParameterSet._for_parametrize( + argnames, parametersets = ParameterSet._for_parametrize( argnames, argvalues, self.function, @@ -1150,8 +1150,8 @@ def parametrize( if generated_ids is not None: ids = generated_ids - ids = self._resolve_arg_ids( - argnames, ids, parameters, nodeid=self.definition.nodeid + ids = self._resolve_parameter_set_ids( + argnames, ids, parametersets, nodeid=self.definition.nodeid ) # Store used (possibly generated) ids with parametrize Marks. @@ -1163,7 +1163,9 @@ def parametrize( # of all calls. newcalls = [] for callspec in self._calls or [CallSpec2()]: - for param_index, (param_id, param_set) in enumerate(zip(ids, parameters)): + for param_index, (param_id, param_set) in enumerate( + zip(ids, parametersets) + ): newcallspec = callspec.setmulti( valtypes=arg_values_types, argnames=argnames, @@ -1176,7 +1178,7 @@ def parametrize( newcalls.append(newcallspec) self._calls = newcalls - def _resolve_arg_ids( + def _resolve_parameter_set_ids( self, argnames: Sequence[str], ids: Optional[ @@ -1185,18 +1187,23 @@ def _resolve_arg_ids( Callable[[Any], Optional[object]], ] ], - parameters: Sequence[ParameterSet], + parametersets: Sequence[ParameterSet], nodeid: str, ) -> List[str]: - """Resolve the actual ids for the given argnames, based on the ``ids`` parameter given - to ``parametrize``. + """Resolve the actual ids for the given parameter sets. - :param List[str] argnames: List of argument names passed to ``parametrize()``. - :param ids: The ids parameter of the parametrized call (see docs). - :param List[ParameterSet] parameters: The list of parameter values, same size as ``argnames``. - :param str str: The nodeid of the item that generated this parametrized call. - :rtype: List[str] - :returns: The list of ids for each argname given. + :param argnames: + Argument names passed to ``parametrize()``. + :param ids: + The `ids` parameter of the ``parametrize()`` call (see docs). + :param parametersets: + The parameter sets, each containing a set of values corresponding + to ``argnames``. + :param nodeid str: + The nodeid of the definition item that generated this + parametrization. + :returns: + List with ids for each parameter set given. """ if ids is None: idfn = None @@ -1206,8 +1213,8 @@ def _resolve_arg_ids( ids_ = None else: idfn = None - ids_ = self._validate_ids(ids, parameters, self.function.__name__) - return idmaker(argnames, parameters, idfn, ids_, self.config, nodeid=nodeid) + ids_ = self._validate_ids(ids, parametersets, self.function.__name__) + return idmaker(argnames, parametersets, idfn, ids_, self.config, nodeid=nodeid) def _validate_ids( self, From aee04cd49f9470ea5bf409c9de532b186a084c76 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 22 Jan 2022 00:27:43 +0200 Subject: [PATCH 095/549] config: avoid stat storm in _getconftestmodules Fix #9478. --- src/_pytest/config/__init__.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 3896313e033..59c88885df5 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -330,6 +330,14 @@ def _prepareconfig( raise +def _get_directory(path: Path) -> Path: + """Get the directory of a path - itself if already a directory.""" + if path.is_file(): + return path.parent + else: + return path + + @final class PytestPluginManager(PluginManager): """A :py:class:`pluggy.PluginManager ` with @@ -357,6 +365,11 @@ def __init__(self) -> None: # If set, conftest loading is skipped. self._noconftest = False + # _getconftestmodules()'s call to _get_directory() causes a stat + # storm when it's called potentially thousands of times in a test + # session (#9478), often with the same path, so cache it. + self._get_directory = lru_cache(256)(_get_directory) + self._duplicatepaths: Set[Path] = set() # plugins that were explicitly skipped with pytest.skip @@ -547,10 +560,7 @@ def _getconftestmodules( if self._noconftest: return [] - if path.is_file(): - directory = path.parent - else: - directory = path + directory = self._get_directory(path) # Optimization: avoid repeated searches in the same directory. # Assumes always called with same importmode and rootpath. From dddadefa68fe519ade65dcd675cf17fd440167e9 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 23 Jan 2022 00:12:46 +0000 Subject: [PATCH 096/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 168 +++++++++++++++---------------- 1 file changed, 80 insertions(+), 88 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index f8ad9f0bdf7..7c0f3c86bd5 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 983 plugins. +This list contains 982 plugins. .. only:: not latex @@ -19,7 +19,7 @@ This list contains 983 plugins. name summary last release status requires =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Nov 30, 2021 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Jan 21, 2022 N/A pytest (>=5.4.0) :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) @@ -27,7 +27,7 @@ This list contains 983 plugins. :pypi:`pytest-aggreport` pytest plugin for pytest-repeat that generate aggregate report of the same test cases with additional statistics details. Mar 07, 2021 4 - Beta pytest (>=6.2.2) :pypi:`pytest-aio` Pytest plugin for testing async python code Oct 20, 2021 4 - Beta pytest :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A - :pypi:`pytest-aiohttp` pytest plugin for aiohttp support Dec 05, 2017 N/A pytest + :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Jan 21, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Nov 01, 2020 N/A pytest (>=6) :pypi:`pytest-aiomoto` pytest-aiomoto Dec 10, 2021 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) @@ -67,7 +67,7 @@ This list contains 983 plugins. :pypi:`pytest-astropy` Meta-package containing dependencies for testing Sep 21, 2021 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Dec 27, 2021 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest - :pypi:`pytest-asyncio` Pytest support for asyncio Jan 13, 2022 4 - Beta pytest (>=5.4.0) + :pypi:`pytest-asyncio` Pytest support for asyncio Jan 17, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jan 03, 2022 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) @@ -115,7 +115,7 @@ This list contains 983 plugins. :pypi:`pytest-browsermob-proxy` BrowserMob proxy plugin for py.test. Jun 11, 2013 4 - Beta N/A :pypi:`pytest-browserstack-local` \`\`py.test\`\` plugin to run \`\`BrowserStackLocal\`\` in background. Feb 09, 2018 N/A N/A :pypi:`pytest-bug` Pytest plugin for marking tests as a bug Jun 02, 2020 5 - Production/Stable pytest (>=3.6.0) - :pypi:`pytest-bugtong-tag` pytest-bugtong-tag is a plugin for pytest Apr 23, 2021 N/A N/A + :pypi:`pytest-bugtong-tag` pytest-bugtong-tag is a plugin for pytest Jan 16, 2022 N/A N/A :pypi:`pytest-bugzilla` py.test bugzilla integration plugin May 05, 2010 4 - Beta N/A :pypi:`pytest-bugzilla-notifier` A plugin that allows you to execute create, update, and read information from BugZilla bugs Jun 15, 2018 4 - Beta pytest (>=2.9.2) :pypi:`pytest-buildkite` Plugin for pytest that automatically publishes coverage and pytest report annotations to Buildkite. Jul 13, 2019 4 - Beta pytest (>=3.5.0) @@ -152,7 +152,6 @@ This list contains 983 plugins. :pypi:`pytest-cloud` Distributed tests planner plugin for pytest testing framework. Oct 05, 2020 6 - Mature N/A :pypi:`pytest-cloudflare-worker` pytest plugin for testing cloudflare workers Mar 30, 2021 4 - Beta pytest (>=6.0.0) :pypi:`pytest-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) - :pypi:`pytest-codeblocks` Test code blocks in your READMEs Dec 21, 2021 4 - Beta pytest (>=6) :pypi:`pytest-codecheckers` pytest plugin to add source code sanity checks (pep8 and friends) Feb 13, 2010 N/A N/A :pypi:`pytest-codecov` Pytest plugin for uploading pytest-cov results to codecov.io Oct 27, 2021 4 - Beta pytest (>=4.6.0) :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A @@ -197,7 +196,7 @@ This list contains 983 plugins. :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A :pypi:`pytest-databricks` Pytest plugin for remote Databricks notebooks testing Jul 29, 2020 N/A pytest :pypi:`pytest-datadir` pytest plugin for test data directories and files Oct 22, 2019 5 - Production/Stable pytest (>=2.7.0) - :pypi:`pytest-datadir-mgr` Manager for test data providing downloads, caching of generated files, and a context for temp directories. Aug 16, 2021 5 - Production/Stable pytest + :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Jan 20, 2022 5 - Production/Stable pytest :pypi:`pytest-datadir-ng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Dec 25, 2019 5 - Production/Stable pytest :pypi:`pytest-data-file` Fixture "data" and "case_data" for test from yaml file Dec 04, 2019 N/A N/A :pypi:`pytest-datafiles` py.test plugin to create a 'tmpdir' containing predefined files/directories. Oct 07, 2018 5 - Production/Stable pytest (>=3.6) @@ -239,7 +238,7 @@ This list contains 983 plugins. :pypi:`pytest-django-haystack` Cleanup your Haystack indexes between tests Sep 03, 2017 5 - Production/Stable pytest (>=2.3.4) :pypi:`pytest-django-ifactory` A model instance factory for pytest-django Jan 13, 2021 3 - Alpha N/A :pypi:`pytest-django-lite` The bare minimum to integrate py.test with Django. Jan 30, 2014 N/A N/A - :pypi:`pytest-django-liveserver-ssl` Jul 30, 2021 3 - Alpha N/A + :pypi:`pytest-django-liveserver-ssl` Jan 20, 2022 3 - Alpha N/A :pypi:`pytest-django-model` A Simple Way to Test your Django Models Feb 14, 2019 4 - Beta N/A :pypi:`pytest-django-ordering` A pytest plugin for preserving the order in which Django runs tests. Jul 25, 2019 5 - Production/Stable pytest (>=2.3.0) :pypi:`pytest-django-queries` Generate performance reports from your django database performance tests. Mar 01, 2021 N/A N/A @@ -291,14 +290,14 @@ This list contains 983 plugins. :pypi:`pytest-elements` Tool to help automate user interfaces Jan 13, 2021 N/A pytest (>=5.4,<6.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Jan 06, 2022 N/A pytest (>=6.2.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jan 06, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jan 06, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jan 06, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jan 06, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Jan 21, 2022 N/A pytest (>=6.2.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jan 21, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jan 21, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jan 21, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jan 21, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jan 06, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jan 06, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jan 21, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jan 21, 2022 N/A N/A :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Oct 10, 2021 4 - Beta pytest (==6.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -353,7 +352,7 @@ This list contains 983 plugins. :pypi:`pytest-filemarker` A pytest plugin that runs marked tests when files change. Dec 01, 2020 N/A pytest :pypi:`pytest-filter-case` run test cases filter by mark Nov 05, 2020 N/A N/A :pypi:`pytest-filter-subpackage` Pytest plugin for filtering based on sub-packages Jan 09, 2020 3 - Alpha pytest (>=3.0) - :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Jan 15, 2022 4 - Beta pytest (>=4.3.0) + :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Jan 16, 2022 4 - Beta pytest (>=4.3.0) :pypi:`pytest-finer-verdicts` A pytest plugin to treat non-assertion failures as test errors. Jun 18, 2020 N/A pytest (>=5.4.3) :pypi:`pytest-firefox` pytest plugin to manipulate firefox Aug 08, 2017 3 - Alpha pytest (>=3.0.2) :pypi:`pytest-fixture-config` Fixture configuration utils for py.test May 28, 2019 5 - Production/Stable pytest @@ -365,7 +364,7 @@ This list contains 983 plugins. :pypi:`pytest-fixture-typecheck` A pytest plugin to assert type annotations at runtime. Aug 24, 2021 N/A pytest :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Dec 16, 2020 4 - Beta pytest (>=3.5) :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. Jan 10, 2022 5 - Production/Stable pytest - :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Jan 04, 2022 4 - Beta pytest (>=3.5) + :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Jan 20, 2022 4 - Beta pytest (>=3.5) :pypi:`pytest-flakefinder` Runs tests multiple times to expose flakiness. Jul 28, 2020 4 - Beta pytest (>=2.7.1) :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) :pypi:`pytest-flaptastic` Flaptastic py.test plugin Mar 17, 2019 N/A N/A @@ -415,10 +414,10 @@ This list contains 983 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jan 11, 2022 3 - Alpha pytest (==6.2.5) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jan 18, 2022 3 - Alpha pytest (==6.2.5) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A - :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jul 12, 2021 N/A pytest (>=5.0) + :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jan 20, 2022 N/A pytest (>=5.0) :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Aug 29, 2021 4 - Beta N/A :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) :pypi:`pytest-html` pytest plugin for generating HTML reports Dec 13, 2020 5 - Production/Stable pytest (!=6.0.0,>=5.0) @@ -431,7 +430,7 @@ This list contains 983 plugins. :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Dec 15, 2021 3 - Alpha N/A - :pypi:`pytest-httpx` Send responses to httpx. Dec 27, 2021 5 - Production/Stable pytest (==6.*) + :pypi:`pytest-httpx` Send responses to httpx. Jan 17, 2022 5 - Production/Stable pytest (==6.*) :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest @@ -441,7 +440,7 @@ This list contains 983 plugins. :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 10, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A - :pypi:`pytest-image-diff` Jul 28, 2021 3 - Alpha pytest + :pypi:`pytest-image-diff` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A :pypi:`pytest-influxdb` Plugin for influxdb and pytest integration. Apr 20, 2021 N/A N/A :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A @@ -578,7 +577,7 @@ This list contains 983 plugins. :pypi:`pytest-never-sleep` pytest plugin helps to avoid adding tests without mock \`time.sleep\` May 05, 2021 3 - Alpha pytest (>=3.5.1) :pypi:`pytest-nginx` nginx fixture for pytest Aug 12, 2017 5 - Production/Stable N/A :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A - :pypi:`pytest-ngrok` Jan 22, 2020 3 - Alpha N/A + :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A @@ -586,7 +585,6 @@ This list contains 983 plugins. :pypi:`pytest-nocustom` Run all tests without custom markers Jul 07, 2021 5 - Production/Stable N/A :pypi:`pytest-nodev` Test-driven source code search for Python. Jul 21, 2016 4 - Beta pytest (>=2.8.1) :pypi:`pytest-nogarbage` Ensure a test produces no garbage Aug 29, 2021 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-notebook` A pytest plugin for testing Jupyter Notebooks Sep 16, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-notice` Send pytest execution result email Nov 05, 2020 N/A N/A :pypi:`pytest-notification` A pytest plugin for sending a desktop notification and playing a sound upon completion of tests Jun 19, 2020 N/A pytest (>=4) :pypi:`pytest-notifier` A pytest plugin to notify test result Jun 12, 2020 3 - Alpha pytest @@ -601,7 +599,7 @@ This list contains 983 plugins. :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jan 19, 2020 N/A N/A :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) - :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Nov 04, 2021 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Jan 19, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-operator` Fixtures for Operators Dec 06, 2021 N/A N/A :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) @@ -632,7 +630,7 @@ This list contains 983 plugins. :pypi:`pytest-perf` pytest-perf Jan 08, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) :pypi:`pytest-persistence` Pytest tool for persistent objects Dec 07, 2021 N/A N/A - :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 09, 2022 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 18, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Nov 10, 2021 4 - Beta pytest (>=6.2) ; extra == 'test' :pypi:`pytest-picked` Run the tests related to the changed files Dec 23, 2020 N/A pytest (>=3.5.0) @@ -695,7 +693,7 @@ This list contains 983 plugins. :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Jun 26, 2021 4 - Beta pytest (>=6.2.0) - :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Dec 16, 2021 5 - Production/Stable pytest (>=6.2.3) + :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jan 18, 2022 5 - Production/Stable pytest (>=6.2.3) :pypi:`pytest-qml` Run QML Tests with pytest Dec 02, 2020 4 - Beta pytest (>=6.0.0) :pypi:`pytest-qr` pytest plugin to generate test result QR codes Nov 25, 2021 4 - Beta N/A :pypi:`pytest-qt` pytest support for PyQt and PySide applications Jun 13, 2021 5 - Production/Stable pytest (>=3.0.0) @@ -723,7 +721,7 @@ This list contains 983 plugins. :pypi:`pytest-redmine` Pytest plugin for redmine Mar 19, 2018 1 - Planning N/A :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A - :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Jan 04, 2022 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Jan 19, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-regtest` pytest plugin for regression tests Jun 03, 2021 N/A N/A :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Jun 14, 2019 5 - Production/Stable pytest (<5,>=3) @@ -750,7 +748,7 @@ This list contains 983 plugins. :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Jun 17, 2021 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) - :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Nov 15, 2021 N/A N/A + :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Jan 20, 2022 N/A N/A :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Oct 10, 2020 5 - Production/Stable N/A @@ -779,13 +777,13 @@ This list contains 983 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jan 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jan 20, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Aug 31, 2020 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jan 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jan 20, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -799,6 +797,7 @@ This list contains 983 plugins. :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Nov 07, 2021 N/A N/A + :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Jan 21, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 5 - Production/Stable pytest (>=3.5.1) :pypi:`pytest-shortcuts` Expand command-line shortcuts listed in pytest configuration Oct 29, 2020 4 - Beta pytest (>=3.5.0) @@ -839,7 +838,7 @@ This list contains 983 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Dec 17, 2021 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Jan 21, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Dec 06, 2021 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A @@ -878,7 +877,7 @@ This list contains 983 plugins. :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Nov 10, 2021 N/A pytest (>=6.0) + :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Jan 17, 2022 N/A pytest (>=6.0) :pypi:`pytest-terraform-fixture` generate terraform resources to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-testbook` A plugin to run tests written in Jupyter notebook Dec 11, 2016 3 - Alpha N/A :pypi:`pytest-testconfig` Test configuration plugin for pytest. Jan 11, 2020 4 - Beta pytest (>=3.5.0) @@ -907,14 +906,14 @@ This list contains 983 plugins. :pypi:`pytest-tesults` Tesults plugin for pytest Dec 31, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-tezos` pytest-ligo Jan 16, 2020 4 - Beta N/A :pypi:`pytest-thawgun` Pytest plugin for time travel May 26, 2020 3 - Alpha N/A - :pypi:`pytest-threadleak` Detects thread leaks Sep 08, 2017 4 - Beta N/A + :pypi:`pytest-threadleak` Detects thread leaks Jan 18, 2022 4 - Beta pytest (>=3.1.1) :pypi:`pytest-tick` Ticking on tests Aug 31, 2021 5 - Production/Stable pytest (>=6.2.5,<7.0.0) :pypi:`pytest-timeit` A pytest plugin to time test function runs Oct 13, 2016 4 - Beta N/A - :pypi:`pytest-timeout` pytest plugin to abort hanging tests Dec 13, 2021 5 - Production/Stable pytest (>=5.0.0) + :pypi:`pytest-timeout` pytest plugin to abort hanging tests Jan 18, 2022 5 - Production/Stable pytest (>=5.0.0) :pypi:`pytest-timeouts` Linux-only Pytest plugin to control durations of various test case execution phases Sep 21, 2019 5 - Production/Stable N/A :pypi:`pytest-timer` A timer plugin for pytest Jun 02, 2021 N/A N/A :pypi:`pytest-timestamper` Pytest plugin to add a timestamp prefix to the pytest output Jun 06, 2021 N/A N/A - :pypi:`pytest-timestamps` A simple plugin to view timestamps for each test Jan 14, 2022 N/A pytest (>=5.2) + :pypi:`pytest-timestamps` A simple plugin to view timestamps for each test Jan 16, 2022 N/A pytest (>=5.2) :pypi:`pytest-tipsi-django` Nov 17, 2021 4 - Beta pytest (>=6.0.0) :pypi:`pytest-tipsi-testing` Better fixtures management. Various helpers Nov 04, 2020 4 - Beta pytest (>=3.3.0) :pypi:`pytest-tldr` A pytest plugin that limits the output to just the things you need. Mar 12, 2021 4 - Beta pytest (>=3.5.0) @@ -1014,7 +1013,7 @@ This list contains 983 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: Nov 30, 2021, + *last release*: Jan 21, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1070,11 +1069,11 @@ This list contains 983 plugins. pytest fixtures for writing aiofiles tests with pyfakefs :pypi:`pytest-aiohttp` - *last release*: Dec 05, 2017, - *status*: N/A, - *requires*: pytest + *last release*: Jan 21, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=6.1.0) - pytest plugin for aiohttp support + Pytest plugin for aiohttp support :pypi:`pytest-aiohttp-client` *last release*: Nov 01, 2020, @@ -1350,9 +1349,9 @@ This list contains 983 plugins. :pypi:`pytest-asyncio` - *last release*: Jan 13, 2022, + *last release*: Jan 17, 2022, *status*: 4 - Beta, - *requires*: pytest (>=5.4.0) + *requires*: pytest (>=6.1.0) Pytest support for asyncio @@ -1686,7 +1685,7 @@ This list contains 983 plugins. Pytest plugin for marking tests as a bug :pypi:`pytest-bugtong-tag` - *last release*: Apr 23, 2021, + *last release*: Jan 16, 2022, *status*: N/A, *requires*: N/A @@ -1944,13 +1943,6 @@ This list contains 983 plugins. PyTest plugin for testing Smart Contracts for Ethereum blockchain. - :pypi:`pytest-codeblocks` - *last release*: Dec 21, 2021, - *status*: 4 - Beta, - *requires*: pytest (>=6) - - Test code blocks in your READMEs - :pypi:`pytest-codecheckers` *last release*: Feb 13, 2010, *status*: N/A, @@ -2260,11 +2252,11 @@ This list contains 983 plugins. pytest plugin for test data directories and files :pypi:`pytest-datadir-mgr` - *last release*: Aug 16, 2021, + *last release*: Jan 20, 2022, *status*: 5 - Production/Stable, *requires*: pytest - Manager for test data providing downloads, caching of generated files, and a context for temp directories. + Manager for test data: downloads, artifact caching, and a tmpdir context. :pypi:`pytest-datadir-ng` *last release*: Dec 25, 2019, @@ -2554,7 +2546,7 @@ This list contains 983 plugins. The bare minimum to integrate py.test with Django. :pypi:`pytest-django-liveserver-ssl` - *last release*: Jul 30, 2021, + *last release*: Jan 20, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -2918,35 +2910,35 @@ This list contains 983 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Jan 06, 2022, + *last release*: Jan 21, 2022, *status*: N/A, *requires*: pytest (>=6.2.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Jan 06, 2022, + *last release*: Jan 21, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Jan 06, 2022, + *last release*: Jan 21, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Jan 06, 2022, + *last release*: Jan 21, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Jan 06, 2022, + *last release*: Jan 21, 2022, *status*: N/A, *requires*: N/A @@ -2960,14 +2952,14 @@ This list contains 983 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Jan 06, 2022, + *last release*: Jan 21, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Jan 06, 2022, + *last release*: Jan 21, 2022, *status*: N/A, *requires*: N/A @@ -3352,7 +3344,7 @@ This list contains 983 plugins. Pytest plugin for filtering based on sub-packages :pypi:`pytest-find-dependencies` - *last release*: Jan 15, 2022, + *last release*: Jan 16, 2022, *status*: 4 - Beta, *requires*: pytest (>=4.3.0) @@ -3436,7 +3428,7 @@ This list contains 983 plugins. A pytest fixture for testing flake8 plugins. :pypi:`pytest-flake8-v2` - *last release*: Jan 04, 2022, + *last release*: Jan 20, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.5) @@ -3786,7 +3778,7 @@ This list contains 983 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jan 11, 2022, + *last release*: Jan 18, 2022, *status*: 3 - Alpha, *requires*: pytest (==6.2.5) @@ -3807,7 +3799,7 @@ This list contains 983 plugins. Report on tests that honor constraints, and guard against regressions :pypi:`pytest-hoverfly` - *last release*: Jul 12, 2021, + *last release*: Jan 20, 2022, *status*: N/A, *requires*: pytest (>=5.0) @@ -3898,7 +3890,7 @@ This list contains 983 plugins. pytest-httpserver is a httpserver for pytest :pypi:`pytest-httpx` - *last release*: Dec 27, 2021, + *last release*: Jan 17, 2022, *status*: 5 - Production/Stable, *requires*: pytest (==6.*) @@ -3968,7 +3960,7 @@ This list contains 983 plugins. ignore failures from flaky tests (pytest plugin) :pypi:`pytest-image-diff` - *last release*: Jul 28, 2021, + *last release*: Jan 20, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -4927,9 +4919,9 @@ This list contains 983 plugins. nginx fixture for pytest - iplweb temporary fork :pypi:`pytest-ngrok` - *last release*: Jan 22, 2020, + *last release*: Jan 20, 2022, *status*: 3 - Alpha, - *requires*: N/A + *requires*: pytest @@ -4982,13 +4974,6 @@ This list contains 983 plugins. Ensure a test produces no garbage - :pypi:`pytest-notebook` - *last release*: Sep 16, 2020, - *status*: 4 - Beta, - *requires*: pytest (>=3.5.0) - - A pytest plugin for testing Jupyter Notebooks - :pypi:`pytest-notice` *last release*: Nov 05, 2020, *status*: N/A, @@ -5088,7 +5073,7 @@ This list contains 983 plugins. Pytest plugin for detecting inadvertent open file handles :pypi:`pytest-opentmi` - *last release*: Nov 04, 2021, + *last release*: Jan 19, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) @@ -5305,7 +5290,7 @@ This list contains 983 plugins. Pytest tool for persistent objects :pypi:`pytest-pg` - *last release*: Jan 09, 2022, + *last release*: Jan 18, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.0.0) @@ -5746,7 +5731,7 @@ This list contains 983 plugins. Pytest plugin for uploading test results to your QA Touch Testrun. :pypi:`pytest-qgis` - *last release*: Dec 16, 2021, + *last release*: Jan 18, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2.3) @@ -5942,7 +5927,7 @@ This list contains 983 plugins. Conveniently run pytest with a dot-formatted test reference. :pypi:`pytest-regressions` - *last release*: Jan 04, 2022, + *last release*: Jan 19, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=3.5.0) @@ -6131,7 +6116,7 @@ This list contains 983 plugins. pytest plugin to re-run tests to eliminate flaky failures :pypi:`pytest-resilient-circuits` - *last release*: Nov 15, 2021, + *last release*: Jan 20, 2022, *status*: N/A, *requires*: N/A @@ -6334,7 +6319,7 @@ This list contains 983 plugins. :pypi:`pytest-sbase` - *last release*: Jan 12, 2022, + *last release*: Jan 20, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6376,7 +6361,7 @@ This list contains 983 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Jan 12, 2022, + *last release*: Jan 20, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6473,6 +6458,13 @@ This list contains 983 plugins. A pytest plugin to help with testing shell scripts / black box commands + :pypi:`pytest-shell-utilities` + *last release*: Jan 21, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=6.0.0) + + Pytest plugin to simplify running shell commands against the system + :pypi:`pytest-sheraf` *last release*: Feb 11, 2020, *status*: N/A, @@ -6754,7 +6746,7 @@ This list contains 983 plugins. :pypi:`pytest-splunk-addon` - *last release*: Dec 17, 2021, + *last release*: Jan 21, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7027,7 +7019,7 @@ This list contains 983 plugins. Predictable and repeatable tempdir support. :pypi:`pytest-terraform` - *last release*: Nov 10, 2021, + *last release*: Jan 17, 2022, *status*: N/A, *requires*: pytest (>=6.0) @@ -7230,9 +7222,9 @@ This list contains 983 plugins. Pytest plugin for time travel :pypi:`pytest-threadleak` - *last release*: Sep 08, 2017, + *last release*: Jan 18, 2022, *status*: 4 - Beta, - *requires*: N/A + *requires*: pytest (>=3.1.1) Detects thread leaks @@ -7251,7 +7243,7 @@ This list contains 983 plugins. A pytest plugin to time test function runs :pypi:`pytest-timeout` - *last release*: Dec 13, 2021, + *last release*: Jan 18, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0.0) @@ -7279,7 +7271,7 @@ This list contains 983 plugins. Pytest plugin to add a timestamp prefix to the pytest output :pypi:`pytest-timestamps` - *last release*: Jan 14, 2022, + *last release*: Jan 16, 2022, *status*: N/A, *requires*: pytest (>=5.2) From 7783fb1b1ebd7026d10eaffb3e2a26f07c0d3602 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 23 Jan 2022 20:37:56 +0000 Subject: [PATCH 097/549] build(deps): Bump pytest-asyncio in /testing/plugins_integration Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.16.0 to 0.17.2. - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.16.0...v0.17.2) --- updated-dependencies: - dependency-name: pytest-asyncio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 8cf38ee53ca..ae2fc3d1297 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,6 +1,6 @@ anyio[curio,trio]==3.5.0 django==4.0.1 -pytest-asyncio==0.16.0 +pytest-asyncio==0.17.2 pytest-bdd==5.0.0 pytest-cov==3.0.0 pytest-django==4.5.2 From 9ae64aae56157c832f305353436e1e9432d58131 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sun, 23 Jan 2022 23:07:28 +0200 Subject: [PATCH 098/549] Setup strict asyncio mode --- testing/plugins_integration/pytest.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/testing/plugins_integration/pytest.ini b/testing/plugins_integration/pytest.ini index b42b07d145a..3bacdef62ab 100644 --- a/testing/plugins_integration/pytest.ini +++ b/testing/plugins_integration/pytest.ini @@ -1,5 +1,6 @@ [pytest] addopts = --strict-markers +asyncio_mode = strict filterwarnings = error::pytest.PytestWarning ignore:.*.fspath is deprecated and will be replaced by .*.path.*:pytest.PytestDeprecationWarning From 039c3a201d1b05befb4f1cf60517cf12005e8ef2 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sun, 23 Jan 2022 21:21:26 -0500 Subject: [PATCH 099/549] upgrade flake8-typing-imports Committed via https://github.com/asottile/all-repos --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8def093a2c6..71357f0108e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,7 +26,7 @@ repos: - id: flake8 language_version: python3 additional_dependencies: - - flake8-typing-imports==1.9.0 + - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports rev: v2.6.0 From a17e7083527d1b8743721a7d505da3d390d2b87e Mon Sep 17 00:00:00 2001 From: Akuli Date: Tue, 25 Jan 2022 15:33:22 +0200 Subject: [PATCH 100/549] With -vv, display the full skip/xfail reason instead of "..." (#9537) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- changelog/9536.improvement.rst | 1 + src/_pytest/terminal.py | 22 ++++++++----- testing/test_terminal.py | 56 +++++++++++++++++++++++++++------- 3 files changed, 60 insertions(+), 19 deletions(-) create mode 100644 changelog/9536.improvement.rst diff --git a/changelog/9536.improvement.rst b/changelog/9536.improvement.rst new file mode 100644 index 00000000000..c7769602f54 --- /dev/null +++ b/changelog/9536.improvement.rst @@ -0,0 +1 @@ +When ``-vv`` is given on command line, show skipping and xfail reasons in full instead of truncating them to fit the terminal width. diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index ccbd84d7d71..4bcc968d100 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -542,15 +542,21 @@ def pytest_runtest_logreport(self, report: TestReport) -> None: if not running_xdist: self.write_ensure_prefix(line, word, **markup) if rep.skipped or hasattr(report, "wasxfail"): - available_width = ( - (self._tw.fullwidth - self._tw.width_of_current_line) - - len(" [100%]") - - 1 - ) reason = _get_raw_skip_reason(rep) - reason_ = _format_trimmed(" ({})", reason, available_width) - if reason and reason_ is not None: - self._tw.write(reason_) + if self.config.option.verbose < 2: + available_width = ( + (self._tw.fullwidth - self._tw.width_of_current_line) + - len(" [100%]") + - 1 + ) + formatted_reason = _format_trimmed( + " ({})", reason, available_width + ) + else: + formatted_reason = f" ({reason})" + + if reason and formatted_reason is not None: + self._tw.write(formatted_reason) if self._show_progress_info: self._write_progress_information_filling_space() else: diff --git a/testing/test_terminal.py b/testing/test_terminal.py index b1904816c95..e5f41266280 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -385,21 +385,55 @@ def test_9(): def test_10(): pytest.xfail("It's 🕙 o'clock") + + @pytest.mark.skip( + reason="cannot do foobar because baz is missing due to I don't know what" + ) + def test_long_skip(): + pass + + @pytest.mark.xfail( + reason="cannot do foobar because baz is missing due to I don't know what" + ) + def test_long_xfail(): + print(1 / 0) """ ) + + common_output = [ + "test_verbose_skip_reason.py::test_1 SKIPPED (123) *", + "test_verbose_skip_reason.py::test_2 XPASS (456) *", + "test_verbose_skip_reason.py::test_3 XFAIL (789) *", + "test_verbose_skip_reason.py::test_4 XFAIL *", + "test_verbose_skip_reason.py::test_5 SKIPPED (unconditional skip) *", + "test_verbose_skip_reason.py::test_6 XPASS *", + "test_verbose_skip_reason.py::test_7 SKIPPED *", + "test_verbose_skip_reason.py::test_8 SKIPPED (888 is great) *", + "test_verbose_skip_reason.py::test_9 XFAIL *", + "test_verbose_skip_reason.py::test_10 XFAIL (It's 🕙 o'clock) *", + ] + result = pytester.runpytest("-v") result.stdout.fnmatch_lines( - [ - "test_verbose_skip_reason.py::test_1 SKIPPED (123) *", - "test_verbose_skip_reason.py::test_2 XPASS (456) *", - "test_verbose_skip_reason.py::test_3 XFAIL (789) *", - "test_verbose_skip_reason.py::test_4 XFAIL *", - "test_verbose_skip_reason.py::test_5 SKIPPED (unconditional skip) *", - "test_verbose_skip_reason.py::test_6 XPASS *", - "test_verbose_skip_reason.py::test_7 SKIPPED *", - "test_verbose_skip_reason.py::test_8 SKIPPED (888 is great) *", - "test_verbose_skip_reason.py::test_9 XFAIL *", - "test_verbose_skip_reason.py::test_10 XFAIL (It's 🕙 o'clock) *", + common_output + + [ + "test_verbose_skip_reason.py::test_long_skip SKIPPED (cannot *...) *", + "test_verbose_skip_reason.py::test_long_xfail XFAIL (cannot *...) *", + ] + ) + + result = pytester.runpytest("-vv") + result.stdout.fnmatch_lines( + common_output + + [ + ( + "test_verbose_skip_reason.py::test_long_skip SKIPPED" + " (cannot do foobar because baz is missing due to I don't know what) *" + ), + ( + "test_verbose_skip_reason.py::test_long_xfail XFAIL" + " (cannot do foobar because baz is missing due to I don't know what) *" + ), ] ) From e6166ccc3c4fa45fccf4dde42986676637e76370 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 25 Jan 2022 22:39:13 +0200 Subject: [PATCH 101/549] doc/reference: don't document `pytest.__version__` under "Marks" --- doc/en/reference/reference.rst | 64 ++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index ce97ad5f710..aec384d6d33 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -9,6 +9,39 @@ This page contains the full reference to pytest's API. :depth: 3 :local: +Constants +--------- + +pytest.__version__ +~~~~~~~~~~~~~~~~~~ + +The current pytest version, as a string:: + + >>> import pytest + >>> pytest.__version__ + '7.0.0' + + +.. _`version-tuple`: + +pytest.version_tuple +~~~~~~~~~~~~~~~~~~~~ + +.. versionadded:: 7.0 + +The current pytest version, as a tuple:: + + >>> import pytest + >>> pytest.version_tuple + (7, 0, 0) + +For pre-releases, the last component will be a string with the prerelease version:: + + >>> import pytest + >>> pytest.version_tuple + (7, 0, '0rc1') + + Functions --------- @@ -226,37 +259,6 @@ Marks a test function as *expected to fail*. a new release of a library fixes a known bug). -pytest.__version__ -~~~~~~~~~~~~~~~~~~ - -The current pytest version, as a string:: - - >>> import pytest - >>> pytest.__version__ - '7.0.0' - - -.. _`version-tuple`: - -pytest.version_tuple -~~~~~~~~~~~~~~~~~~~~ - -.. versionadded:: 7.0 - -The current pytest version, as a tuple:: - - >>> import pytest - >>> pytest.version_tuple - (7, 0, 0) - -For pre-releases, the last component will be a string with the prerelease version:: - - >>> import pytest - >>> pytest.version_tuple - (7, 0, '0rc1') - - - Custom marks ~~~~~~~~~~~~ From 52fbf3dbaae4139ae5f82d757b62992e1b4f0b19 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 25 Jan 2022 22:44:04 +0200 Subject: [PATCH 102/549] fixtures: make code flow clearer Make the two cases (direct/indirect fixture) clearer. The try-catch forces the reader to jump around. --- src/_pytest/fixtures.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index be03fb2a820..612fb60fd06 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -597,8 +597,17 @@ def _compute_fixture_value(self, fixturedef: "FixtureDef[object]") -> None: funcitem = self._pyfuncitem scope = fixturedef._scope try: - param = funcitem.callspec.getparam(argname) - except (AttributeError, ValueError): + callspec = funcitem.callspec + except AttributeError: + callspec = None + if callspec is not None and argname in callspec.params: + param = callspec.params[argname] + param_index = callspec.indices[argname] + # If a parametrize invocation set a scope it will override + # the static scope defined with the fixture function. + with suppress(KeyError): + scope = callspec._arg2scope[argname] + else: param = NOTSET param_index = 0 has_params = fixturedef.params is not None @@ -638,12 +647,6 @@ def _compute_fixture_value(self, fixturedef: "FixtureDef[object]") -> None: ) ) fail(msg, pytrace=False) - else: - param_index = funcitem.callspec.indices[argname] - # If a parametrize invocation set a scope it will override - # the static scope defined with the fixture function. - with suppress(KeyError): - scope = funcitem.callspec._arg2scope[argname] subrequest = SubRequest( self, scope, param, param_index, fixturedef, _ispytest=True From acd203453557328d59466c0827ff89c21d52d381 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 25 Jan 2022 23:00:58 +0200 Subject: [PATCH 103/549] fixtures: document FixtureDef's attributes --- src/_pytest/fixtures.py | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 612fb60fd06..ed463729f75 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -930,7 +930,7 @@ def _eval_scope_callable( @final class FixtureDef(Generic[FixtureValue]): - """A container for a factory definition.""" + """A container for a fixture definition.""" def __init__( self, @@ -949,26 +949,52 @@ def __init__( ] = None, ) -> None: self._fixturemanager = fixturemanager + # The "base" node ID for the fixture. + # + # This is a node ID prefix. A fixture is only available to a node (e.g. + # a `Function` item) if the fixture's baseid is a parent of the node's + # nodeid (see the `iterparentnodeids` function for what constitutes a + # "parent" and a "prefix" in this context). + # + # For a fixture found in a Collector's object (e.g. a `Module`s module, + # a `Class`'s class), the baseid is the Collector's nodeid. + # + # For a fixture found in a conftest plugin, the baseid is the conftest's + # directory path relative to the rootdir. + # + # For other plugins, the baseid is the empty string (always matches). self.baseid = baseid or "" + # Whether the fixture was found from a node or a conftest in the + # collection tree. Will be false for fixtures defined in non-conftest + # plugins. self.has_location = baseid is not None + # The fixture factory function. self.func = func + # The name by which the fixture may be requested. self.argname = argname if scope is None: scope = Scope.Function elif callable(scope): scope = _eval_scope_callable(scope, argname, fixturemanager.config) - if isinstance(scope, str): scope = Scope.from_user( scope, descr=f"Fixture '{func.__name__}'", where=baseid ) self._scope = scope + # If the fixture is directly parametrized, the parameter values. self.params: Optional[Sequence[object]] = params - self.argnames: Tuple[str, ...] = getfuncargnames( - func, name=argname, is_method=unittest - ) - self.unittest = unittest + # If the fixture is directly parametrized, a tuple of explicit IDs to + # assign to the parameter values, or a callable to generate an ID given + # a parameter value. self.ids = ids + # The names requested by the fixtures. + self.argnames = getfuncargnames(func, name=argname, is_method=unittest) + # Whether the fixture was collected from a unittest TestCase class. + # Note that it really only makes sense to define autouse fixtures in + # unittest TestCases. + self.unittest = unittest + # If the fixture was executed, the current value of the fixture. + # Can change if the fixture is executed with different parameters. self.cached_result: Optional[_FixtureCachedResult[FixtureValue]] = None self._finalizers: List[Callable[[], object]] = [] From b21b008118fc8cf65b4bcd9b059f1cd704e05c68 Mon Sep 17 00:00:00 2001 From: Tobias Deiminger Date: Thu, 16 Dec 2021 21:02:27 +0100 Subject: [PATCH 104/549] Refactor idmaker functions into class IdMaker This commit only refactors, it does not change or add functionality yet. Public API is retained. Reason or refactoring: User provided parameter IDs (e.g. Metafunc.parametrize(ids=...)) had so far only been used to calculate a unique test ID for each test invocation. That test ID was a joined string where each parameter contributed some partial ID. We're soon going to reuse functionality to generate parameter keys for reorder_items and FixtureDef cache. We will be interested in the partial IDs, and only if they originate from explicit user information. Refactoring makes logic and data accessible for reuse, and increases cohesion in general. --- src/_pytest/python.py | 245 +++++++++++++++++++++---------------- testing/python/metafunc.py | 146 ++++++++++++++-------- 2 files changed, 237 insertions(+), 154 deletions(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index dc8b1d9a712..f5b332e6831 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -929,6 +929,139 @@ def hasnew(obj: object) -> bool: return False +@final +@attr.s(frozen=True, auto_attribs=True, slots=True) +class IdMaker: + """Make IDs for a parametrization.""" + + # The argnames of the parametrization. + argnames: Sequence[str] + # The ParameterSets of the parametrization. + parametersets: Sequence[ParameterSet] + # Optionally, a user-provided callable to make IDs for parameters in a + # ParameterSet. + idfn: Optional[Callable[[Any], Optional[object]]] + # Optionally, explicit IDs for ParameterSets by index. + ids: Optional[Sequence[Union[None, str]]] + # Optionally, the pytest config. + # Used for controlling ASCII escaping, and for calling the + # :hook:`pytest_make_parametrize_id` hook. + config: Optional[Config] + # Optionally, the ID of the node being parametrized. + # Used only for clearer error messages. + nodeid: Optional[str] + + def make_unique_parameterset_ids(self) -> List[str]: + """Make a unique identifier for each ParameterSet, that may be used to + identify the parametrization in a node ID. + + Format is -...-[counter], where prm_x_token is + - user-provided id, if given + - else an id derived from the value, applicable for certain types + - else + The counter suffix is appended only in case a string wouldn't be unique + otherwise. + """ + resolved_ids = list(self._resolve_ids()) + # All IDs must be unique! + if len(resolved_ids) != len(set(resolved_ids)): + # Record the number of occurrences of each ID. + id_counts = Counter(resolved_ids) + # Map the ID to its next suffix. + id_suffixes: Dict[str, int] = defaultdict(int) + # Suffix non-unique IDs to make them unique. + for index, id in enumerate(resolved_ids): + if id_counts[id] > 1: + resolved_ids[index] = f"{id}{id_suffixes[id]}" + id_suffixes[id] += 1 + return resolved_ids + + def _resolve_ids(self) -> Iterable[str]: + """Resolve IDs for all ParameterSets (may contain duplicates).""" + for idx, parameterset in enumerate(self.parametersets): + if parameterset.id is not None: + # ID provided directly - pytest.param(..., id="...") + yield parameterset.id + elif self.ids and idx < len(self.ids) and self.ids[idx] is not None: + # ID provided in the IDs list - parametrize(..., ids=[...]). + id = self.ids[idx] + assert id is not None + yield _ascii_escaped_by_config(id, self.config) + else: + # ID not provided - generate it. + yield "-".join( + self._idval(val, argname, idx) + for val, argname in zip(parameterset.values, self.argnames) + ) + + def _idval(self, val: object, argname: str, idx: int) -> str: + """Make an ID for a parameter in a ParameterSet.""" + idval = self._idval_from_function(val, argname, idx) + if idval is not None: + return idval + idval = self._idval_from_hook(val, argname) + if idval is not None: + return idval + idval = self._idval_from_value(val) + if idval is not None: + return idval + return self._idval_from_argname(argname, idx) + + def _idval_from_function( + self, val: object, argname: str, idx: int + ) -> Optional[str]: + """Try to make an ID for a parameter in a ParameterSet using the + user-provided id callable, if given.""" + if self.idfn is None: + return None + try: + id = self.idfn(val) + except Exception as e: + prefix = f"{self.nodeid}: " if self.nodeid is not None else "" + msg = "error raised while trying to determine id of parameter '{}' at position {}" + msg = prefix + msg.format(argname, idx) + raise ValueError(msg) from e + if id is None: + return None + return self._idval_from_value(id) + + def _idval_from_hook(self, val: object, argname: str) -> Optional[str]: + """Try to make an ID for a parameter in a ParameterSet by calling the + :hook:`pytest_make_parametrize_id` hook.""" + if self.config: + id: Optional[str] = self.config.hook.pytest_make_parametrize_id( + config=self.config, val=val, argname=argname + ) + return id + return None + + def _idval_from_value(self, val: object) -> Optional[str]: + """Try to make an ID for a parameter in a ParameterSet from its value, + if the value type is supported.""" + if isinstance(val, STRING_TYPES): + return _ascii_escaped_by_config(val, self.config) + elif val is None or isinstance(val, (float, int, bool, complex)): + return str(val) + elif isinstance(val, Pattern): + return ascii_escaped(val.pattern) + elif val is NOTSET: + # Fallback to default. Note that NOTSET is an enum.Enum. + pass + elif isinstance(val, enum.Enum): + return str(val) + elif isinstance(getattr(val, "__name__", None), str): + # Name of a class, function, module, etc. + name: str = getattr(val, "__name__") + return name + return None + + @staticmethod + def _idval_from_argname(argname: str, idx: int) -> str: + """Make an ID for a parameter in a ParameterSet from the argument name + and the index of the ParameterSet.""" + return str(argname) + str(idx) + + @final @attr.s(frozen=True, slots=True, auto_attribs=True) class CallSpec2: @@ -1217,12 +1350,15 @@ def _resolve_parameter_set_ids( else: idfn = None ids_ = self._validate_ids(ids, parametersets, self.function.__name__) - return idmaker(argnames, parametersets, idfn, ids_, self.config, nodeid=nodeid) + id_maker = IdMaker( + argnames, parametersets, idfn, ids_, self.config, nodeid=nodeid + ) + return id_maker.make_unique_parameterset_ids() def _validate_ids( self, ids: Iterable[Union[None, str, float, int, bool]], - parameters: Sequence[ParameterSet], + parametersets: Sequence[ParameterSet], func_name: str, ) -> List[Union[None, str]]: try: @@ -1232,12 +1368,12 @@ def _validate_ids( iter(ids) except TypeError as e: raise TypeError("ids must be a callable or an iterable") from e - num_ids = len(parameters) + num_ids = len(parametersets) # num_ids == 0 is a special case: https://github.com/pytest-dev/pytest/issues/1849 - if num_ids != len(parameters) and num_ids != 0: + if num_ids != len(parametersets) and num_ids != 0: msg = "In {}: {} parameter sets specified, with different number of ids: {}" - fail(msg.format(func_name, len(parameters), num_ids), pytrace=False) + fail(msg.format(func_name, len(parametersets), num_ids), pytrace=False) new_ids = [] for idx, id_value in enumerate(itertools.islice(ids, num_ids)): @@ -1374,105 +1510,6 @@ def _ascii_escaped_by_config(val: Union[str, bytes], config: Optional[Config]) - return val if escape_option else ascii_escaped(val) # type: ignore -def _idval( - val: object, - argname: str, - idx: int, - idfn: Optional[Callable[[Any], Optional[object]]], - nodeid: Optional[str], - config: Optional[Config], -) -> str: - if idfn: - try: - generated_id = idfn(val) - if generated_id is not None: - val = generated_id - except Exception as e: - prefix = f"{nodeid}: " if nodeid is not None else "" - msg = "error raised while trying to determine id of parameter '{}' at position {}" - msg = prefix + msg.format(argname, idx) - raise ValueError(msg) from e - elif config: - hook_id: Optional[str] = config.hook.pytest_make_parametrize_id( - config=config, val=val, argname=argname - ) - if hook_id: - return hook_id - - if isinstance(val, STRING_TYPES): - return _ascii_escaped_by_config(val, config) - elif val is None or isinstance(val, (float, int, bool, complex)): - return str(val) - elif isinstance(val, Pattern): - return ascii_escaped(val.pattern) - elif val is NOTSET: - # Fallback to default. Note that NOTSET is an enum.Enum. - pass - elif isinstance(val, enum.Enum): - return str(val) - elif isinstance(getattr(val, "__name__", None), str): - # Name of a class, function, module, etc. - name: str = getattr(val, "__name__") - return name - return str(argname) + str(idx) - - -def _idvalset( - idx: int, - parameterset: ParameterSet, - argnames: Iterable[str], - idfn: Optional[Callable[[Any], Optional[object]]], - ids: Optional[List[Union[None, str]]], - nodeid: Optional[str], - config: Optional[Config], -) -> str: - if parameterset.id is not None: - return parameterset.id - id = None if ids is None or idx >= len(ids) else ids[idx] - if id is None: - this_id = [ - _idval(val, argname, idx, idfn, nodeid=nodeid, config=config) - for val, argname in zip(parameterset.values, argnames) - ] - return "-".join(this_id) - else: - return _ascii_escaped_by_config(id, config) - - -def idmaker( - argnames: Iterable[str], - parametersets: Iterable[ParameterSet], - idfn: Optional[Callable[[Any], Optional[object]]] = None, - ids: Optional[List[Union[None, str]]] = None, - config: Optional[Config] = None, - nodeid: Optional[str] = None, -) -> List[str]: - resolved_ids = [ - _idvalset( - valindex, parameterset, argnames, idfn, ids, config=config, nodeid=nodeid - ) - for valindex, parameterset in enumerate(parametersets) - ] - - # All IDs must be unique! - unique_ids = set(resolved_ids) - if len(unique_ids) != len(resolved_ids): - - # Record the number of occurrences of each test ID. - test_id_counts = Counter(resolved_ids) - - # Map the test ID to its next suffix. - test_id_suffixes: Dict[str, int] = defaultdict(int) - - # Suffix non-unique IDs to make them unique. - for index, test_id in enumerate(resolved_ids): - if test_id_counts[test_id] > 1: - resolved_ids[index] = f"{test_id}{test_id_suffixes[test_id]}" - test_id_suffixes[test_id] += 1 - - return resolved_ids - - def _pretty_fixture_path(func) -> str: cwd = Path.cwd() loc = Path(getlocation(func, str(cwd))) diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index fc0082eb6b9..b6ad4a80924 100644 --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -24,8 +24,7 @@ from _pytest.compat import NOTSET from _pytest.outcomes import fail from _pytest.pytester import Pytester -from _pytest.python import _idval -from _pytest.python import idmaker +from _pytest.python import IdMaker from _pytest.scope import Scope @@ -286,7 +285,7 @@ class A: deadline=400.0 ) # very close to std deadline and CI boxes are not reliable in CPU power def test_idval_hypothesis(self, value) -> None: - escaped = _idval(value, "a", 6, None, nodeid=None, config=None) + escaped = IdMaker([], [], None, None, None, None)._idval(value, "a", 6) assert isinstance(escaped, str) escaped.encode("ascii") @@ -308,7 +307,9 @@ def test_unicode_idval(self) -> None: ), ] for val, expected in values: - assert _idval(val, "a", 6, None, nodeid=None, config=None) == expected + assert ( + IdMaker([], [], None, None, None, None)._idval(val, "a", 6) == expected + ) def test_unicode_idval_with_config(self) -> None: """Unit test for expected behavior to obtain ids with @@ -336,7 +337,7 @@ def getini(self, name): ("ação", MockConfig({option: False}), "a\\xe7\\xe3o"), ] for val, config, expected in values: - actual = _idval(val, "a", 6, None, nodeid=None, config=config) + actual = IdMaker([], [], None, None, config, None)._idval(val, "a", 6) assert actual == expected def test_bytes_idval(self) -> None: @@ -349,7 +350,9 @@ def test_bytes_idval(self) -> None: ("αρά".encode(), r"\xce\xb1\xcf\x81\xce\xac"), ] for val, expected in values: - assert _idval(val, "a", 6, idfn=None, nodeid=None, config=None) == expected + assert ( + IdMaker([], [], None, None, None, None)._idval(val, "a", 6) == expected + ) def test_class_or_function_idval(self) -> None: """Unit test for the expected behavior to obtain ids for parametrized @@ -363,7 +366,9 @@ def test_function(): values = [(TestClass, "TestClass"), (test_function, "test_function")] for val, expected in values: - assert _idval(val, "a", 6, None, nodeid=None, config=None) == expected + assert ( + IdMaker([], [], None, None, None, None)._idval(val, "a", 6) == expected + ) def test_notset_idval(self) -> None: """Test that a NOTSET value (used by an empty parameterset) generates @@ -371,29 +376,43 @@ def test_notset_idval(self) -> None: Regression test for #7686. """ - assert _idval(NOTSET, "a", 0, None, nodeid=None, config=None) == "a0" + assert IdMaker([], [], None, None, None, None)._idval(NOTSET, "a", 0) == "a0" def test_idmaker_autoname(self) -> None: """#250""" - result = idmaker( - ("a", "b"), [pytest.param("string", 1.0), pytest.param("st-ring", 2.0)] - ) + result = IdMaker( + ("a", "b"), + [pytest.param("string", 1.0), pytest.param("st-ring", 2.0)], + None, + None, + None, + None, + ).make_unique_parameterset_ids() assert result == ["string-1.0", "st-ring-2.0"] - result = idmaker( - ("a", "b"), [pytest.param(object(), 1.0), pytest.param(object(), object())] - ) + result = IdMaker( + ("a", "b"), + [pytest.param(object(), 1.0), pytest.param(object(), object())], + None, + None, + None, + None, + ).make_unique_parameterset_ids() assert result == ["a0-1.0", "a1-b1"] # unicode mixing, issue250 - result = idmaker(("a", "b"), [pytest.param({}, b"\xc3\xb4")]) + result = IdMaker( + ("a", "b"), [pytest.param({}, b"\xc3\xb4")], None, None, None, None + ).make_unique_parameterset_ids() assert result == ["a0-\\xc3\\xb4"] def test_idmaker_with_bytes_regex(self) -> None: - result = idmaker(("a"), [pytest.param(re.compile(b"foo"), 1.0)]) + result = IdMaker( + ("a"), [pytest.param(re.compile(b"foo"), 1.0)], None, None, None, None + ).make_unique_parameterset_ids() assert result == ["foo"] def test_idmaker_native_strings(self) -> None: - result = idmaker( + result = IdMaker( ("a", "b"), [ pytest.param(1.0, -1.1), @@ -410,7 +429,11 @@ def test_idmaker_native_strings(self) -> None: pytest.param(b"\xc3\xb4", "other"), pytest.param(1.0j, -2.0j), ], - ) + None, + None, + None, + None, + ).make_unique_parameterset_ids() assert result == [ "1.0--1.1", "2--202", @@ -428,7 +451,7 @@ def test_idmaker_native_strings(self) -> None: ] def test_idmaker_non_printable_characters(self) -> None: - result = idmaker( + result = IdMaker( ("s", "n"), [ pytest.param("\x00", 1), @@ -438,23 +461,33 @@ def test_idmaker_non_printable_characters(self) -> None: pytest.param("\t", 5), pytest.param(b"\t", 6), ], - ) + None, + None, + None, + None, + ).make_unique_parameterset_ids() assert result == ["\\x00-1", "\\x05-2", "\\x00-3", "\\x05-4", "\\t-5", "\\t-6"] def test_idmaker_manual_ids_must_be_printable(self) -> None: - result = idmaker( + result = IdMaker( ("s",), [ pytest.param("x00", id="hello \x00"), pytest.param("x05", id="hello \x05"), ], - ) + None, + None, + None, + None, + ).make_unique_parameterset_ids() assert result == ["hello \\x00", "hello \\x05"] def test_idmaker_enum(self) -> None: enum = pytest.importorskip("enum") e = enum.Enum("Foo", "one, two") - result = idmaker(("a", "b"), [pytest.param(e.one, e.two)]) + result = IdMaker( + ("a", "b"), [pytest.param(e.one, e.two)], None, None, None, None + ).make_unique_parameterset_ids() assert result == ["Foo.one-Foo.two"] def test_idmaker_idfn(self) -> None: @@ -465,15 +498,18 @@ def ids(val: object) -> Optional[str]: return repr(val) return None - result = idmaker( + result = IdMaker( ("a", "b"), [ pytest.param(10.0, IndexError()), pytest.param(20, KeyError()), pytest.param("three", [1, 2, 3]), ], - idfn=ids, - ) + ids, + None, + None, + None, + ).make_unique_parameterset_ids() assert result == ["10.0-IndexError()", "20-KeyError()", "three-b2"] def test_idmaker_idfn_unique_names(self) -> None: @@ -482,15 +518,18 @@ def test_idmaker_idfn_unique_names(self) -> None: def ids(val: object) -> str: return "a" - result = idmaker( + result = IdMaker( ("a", "b"), [ pytest.param(10.0, IndexError()), pytest.param(20, KeyError()), pytest.param("three", [1, 2, 3]), ], - idfn=ids, - ) + ids, + None, + None, + None, + ).make_unique_parameterset_ids() assert result == ["a-a0", "a-a1", "a-a2"] def test_idmaker_with_idfn_and_config(self) -> None: @@ -520,12 +559,9 @@ def getini(self, name): (MockConfig({option: False}), "a\\xe7\\xe3o"), ] for config, expected in values: - result = idmaker( - ("a",), - [pytest.param("string")], - idfn=lambda _: "ação", - config=config, - ) + result = IdMaker( + ("a",), [pytest.param("string")], lambda _: "ação", None, config, None + ).make_unique_parameterset_ids() assert result == [expected] def test_idmaker_with_ids_and_config(self) -> None: @@ -555,12 +591,9 @@ def getini(self, name): (MockConfig({option: False}), "a\\xe7\\xe3o"), ] for config, expected in values: - result = idmaker( - ("a",), - [pytest.param("string")], - ids=["ação"], - config=config, - ) + result = IdMaker( + ("a",), [pytest.param("string")], None, ["ação"], config, None + ).make_unique_parameterset_ids() assert result == [expected] def test_parametrize_ids_exception(self, pytester: Pytester) -> None: @@ -617,23 +650,36 @@ def test_int(arg): ) def test_idmaker_with_ids(self) -> None: - result = idmaker( - ("a", "b"), [pytest.param(1, 2), pytest.param(3, 4)], ids=["a", None] - ) + result = IdMaker( + ("a", "b"), + [pytest.param(1, 2), pytest.param(3, 4)], + None, + ["a", None], + None, + None, + ).make_unique_parameterset_ids() assert result == ["a", "3-4"] def test_idmaker_with_paramset_id(self) -> None: - result = idmaker( + result = IdMaker( ("a", "b"), [pytest.param(1, 2, id="me"), pytest.param(3, 4, id="you")], - ids=["a", None], - ) + None, + ["a", None], + None, + None, + ).make_unique_parameterset_ids() assert result == ["me", "you"] def test_idmaker_with_ids_unique_names(self) -> None: - result = idmaker( - ("a"), map(pytest.param, [1, 2, 3, 4, 5]), ids=["a", "a", "b", "c", "b"] - ) + result = IdMaker( + ("a"), + list(map(pytest.param, [1, 2, 3, 4, 5])), + None, + ["a", "a", "b", "c", "b"], + None, + None, + ).make_unique_parameterset_ids() assert result == ["a0", "a1", "b0", "c", "b1"] def test_parametrize_indirect(self) -> None: From 396a7def751cd7d6c615f9d81d5a49f2b50bfeaa Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 27 Jan 2022 11:49:18 +0100 Subject: [PATCH 105/549] Add additional docs for uncooperative ctor deprecation (#9498) * Add additional docs for uncooperative ctor deprecation Fixes #9488 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Break up long line * Recommend kwonly args Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- doc/en/deprecations.rst | 38 ++++++++++++++++++++++++++++ doc/en/example/nonpython/conftest.py | 4 +-- src/_pytest/nodes.py | 5 +++- 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index a667fc4ccdf..d9fb4d6b04e 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -56,6 +56,10 @@ 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 :ref:`cooperative +constructors ` to avoid hardcoding +arguments they only pass on to the superclass. + .. note:: The name of the :class:`~_pytest.nodes.Node` arguments and attributes (the new attribute being ``path``) is **the opposite** of the situation for @@ -191,6 +195,40 @@ Instead, a separate collector node should be used, which collects the item. See .. _example pr fixing inheritance: https://github.com/asmeurer/pytest-flakes/pull/40/files +.. _uncooperative-constructors-deprecated: + +Constructors of custom :class:`pytest.Node` subclasses should take ``**kwargs`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. deprecated:: 7.0 + +If custom subclasses of nodes like :class:`pytest.Item` override the +``__init__`` method, they should take ``**kwargs``. Thus, + +.. code-block:: python + + class CustomItem(pytest.Item): + def __init__(self, name, parent, additional_arg): + super().__init__(name, parent) + self.additional_arg = additional_arg + +should be turned into: + +.. code-block:: python + + class CustomItem(pytest.Item): + def __init__(self, *, additional_arg, **kwargs): + super().__init__(**kwargs) + self.additional_arg = additional_arg + +to avoid hard-coding the arguments pytest can pass to the superclass. +See :ref:`non-python tests` for a full example. + +For cases without conflicts, no deprecation warning is emitted. For cases with +conflicts (such as :class:`pytest.File` now taking ``path`` instead of +``fspath``, as :ref:`outlined above `), a +deprecation warning is now raised. + Backward compatibilities in ``Parser.addoption`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/en/example/nonpython/conftest.py b/doc/en/example/nonpython/conftest.py index 7ec4134036c..bc39a1f6b20 100644 --- a/doc/en/example/nonpython/conftest.py +++ b/doc/en/example/nonpython/conftest.py @@ -18,8 +18,8 @@ def collect(self): class YamlItem(pytest.Item): - def __init__(self, name, parent, spec): - super().__init__(name, parent) + def __init__(self, *, spec, **kwargs): + super().__init__(**kwargs) self.spec = spec def runtest(self): diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py index 53dea04e795..6e8454ad7c6 100644 --- a/src/_pytest/nodes.py +++ b/src/_pytest/nodes.py @@ -145,7 +145,10 @@ def _create(self, *k, **kw): warnings.warn( PytestDeprecationWarning( - f"{self} is not using a cooperative constructor and only takes {set(known_kw)}" + f"{self} is not using a cooperative constructor and only takes {set(known_kw)}.\n" + "See https://docs.pytest.org/en/stable/deprecations.html" + "#constructors-of-custom-pytest-node-subclasses-should-take-kwargs " + "for more details." ) ) From f064942f2e42a311e67e059a0c981abe697b5bef Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 27 Jan 2022 08:18:36 -0300 Subject: [PATCH 106/549] Make 'warnings' and 'deselected' in assert_outcomes optional (#9475) Fix #9471 --- src/_pytest/pytester.py | 12 ++++++++---- src/_pytest/pytester_assertions.py | 15 +++++++++------ testing/test_pytester.py | 4 ++++ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 5db896c1f76..933d7d35759 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -596,11 +596,15 @@ def assert_outcomes( errors: int = 0, xpassed: int = 0, xfailed: int = 0, - warnings: int = 0, - deselected: int = 0, + warnings: Optional[int] = None, + deselected: Optional[int] = None, ) -> None: - """Assert that the specified outcomes appear with the respective - numbers (0 means it didn't occur) in the text output from a test run.""" + """ + Assert that the specified outcomes appear with the respective + numbers (0 means it didn't occur) in the text output from a test run. + + ``warnings`` and ``deselected`` are only checked if not None. + """ __tracebackhide__ = True from _pytest.pytester_assertions import assert_outcomes diff --git a/src/_pytest/pytester_assertions.py b/src/_pytest/pytester_assertions.py index 6a5aabece47..657e4db5fc3 100644 --- a/src/_pytest/pytester_assertions.py +++ b/src/_pytest/pytester_assertions.py @@ -4,6 +4,7 @@ # hence cannot be subject to assertion rewriting, which requires a # module to not be already imported. from typing import Dict +from typing import Optional from typing import Sequence from typing import Tuple from typing import Union @@ -42,8 +43,8 @@ def assert_outcomes( errors: int = 0, xpassed: int = 0, xfailed: int = 0, - warnings: int = 0, - deselected: int = 0, + warnings: Optional[int] = None, + deselected: Optional[int] = None, ) -> None: """Assert that the specified outcomes appear with the respective numbers (0 means it didn't occur) in the text output from a test run.""" @@ -56,8 +57,6 @@ def assert_outcomes( "errors": outcomes.get("errors", 0), "xpassed": outcomes.get("xpassed", 0), "xfailed": outcomes.get("xfailed", 0), - "warnings": outcomes.get("warnings", 0), - "deselected": outcomes.get("deselected", 0), } expected = { "passed": passed, @@ -66,7 +65,11 @@ def assert_outcomes( "errors": errors, "xpassed": xpassed, "xfailed": xfailed, - "warnings": warnings, - "deselected": deselected, } + if warnings is not None: + obtained["warnings"] = outcomes.get("warnings", 0) + expected["warnings"] = warnings + if deselected is not None: + obtained["deselected"] = outcomes.get("deselected", 0) + expected["deselected"] = deselected assert obtained == expected diff --git a/testing/test_pytester.py b/testing/test_pytester.py index bc6e52aba0e..9f7cf42b77c 100644 --- a/testing/test_pytester.py +++ b/testing/test_pytester.py @@ -835,6 +835,8 @@ def test_with_warning(): ) result = pytester.runpytest() result.assert_outcomes(passed=1, warnings=1) + # If warnings is not passed, it is not checked at all. + result.assert_outcomes(passed=1) def test_pytester_outcomes_deselected(pytester: Pytester) -> None: @@ -849,3 +851,5 @@ def test_two(): ) result = pytester.runpytest("-k", "test_one") result.assert_outcomes(passed=1, deselected=1) + # If deselected is not passed, it is not checked at all. + result.assert_outcomes(passed=1) From 843f03e3caa1f9137fe81edcf0b86f11634f146b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 27 Jan 2022 13:32:37 +0100 Subject: [PATCH 107/549] doc: Add ellipsis to warning usecase list (#9558) I feel like this makes it clearer where the code which was inside 'pytest.warns' is supposed to go. --- doc/en/how-to/capture-warnings.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/en/how-to/capture-warnings.rst b/doc/en/how-to/capture-warnings.rst index 501edce7a14..065c11e610c 100644 --- a/doc/en/how-to/capture-warnings.rst +++ b/doc/en/how-to/capture-warnings.rst @@ -363,7 +363,7 @@ Here are some use cases involving warnings that often come up in tests, and sugg .. code-block:: python with pytest.warns(): - pass + ... - To ensure that **no** warnings are emitted, use: @@ -371,6 +371,7 @@ Here are some use cases involving warnings that often come up in tests, and sugg with warnings.catch_warnings(): warnings.simplefilter("error") + ... - To suppress warnings, use: @@ -378,6 +379,7 @@ Here are some use cases involving warnings that often come up in tests, and sugg with warnings.catch_warnings(): warnings.simplefilter("ignore") + ... .. _custom_failure_messages: From 597bb9376b958ad97d5533af15a72ff992db7c5c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 27 Jan 2022 13:33:09 +0100 Subject: [PATCH 108/549] Add missing cooperative constructor changelog (#9559) This was supposed to be part of #9488, but I only now noticed it was lying around uncommitted in my git dir --- changelog/9488.deprecation.rst | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 changelog/9488.deprecation.rst diff --git a/changelog/9488.deprecation.rst b/changelog/9488.deprecation.rst new file mode 100644 index 00000000000..5c5807ec34a --- /dev/null +++ b/changelog/9488.deprecation.rst @@ -0,0 +1,7 @@ +If custom subclasses of nodes like :class:`pytest.Item` override the +``__init__`` method, they should take ``**kwargs``. See +:ref:`uncooperative-constructors-deprecated` for details. + +Note that a deprection warning is only emitted when there is a conflict in the +arguments pytest expected to pass. This deprecation was already part of pytest +7.0.0rc1 but wasn't documented. From 6e1445b5212ee1d20e05c0715f34f6c28dedf442 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 27 Jan 2022 13:33:20 +0100 Subject: [PATCH 109/549] ci: Bump up timeout (#9560) macOS apparently can be slow, https://github.com/pytest-dev/pytest/runs/4965510831 for #9556 got cancelled at 91% --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 79ce0e2225b..77cee5a8a06 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ permissions: {} jobs: build: runs-on: ${{ matrix.os }} - timeout-minutes: 30 + timeout-minutes: 45 permissions: contents: read From ee9ddff34eab0368adc1cea42d49661061f2ff9b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 27 Jan 2022 13:39:32 +0100 Subject: [PATCH 110/549] doc: Recategorize 7.0.0 changelog items (#9561) --- changelog/{9505.trivial.rst => 9505.doc.rst} | 0 changelog/{9521.improvement.rst => 9521.trivial.rst} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename changelog/{9505.trivial.rst => 9505.doc.rst} (100%) rename changelog/{9521.improvement.rst => 9521.trivial.rst} (100%) diff --git a/changelog/9505.trivial.rst b/changelog/9505.doc.rst similarity index 100% rename from changelog/9505.trivial.rst rename to changelog/9505.doc.rst diff --git a/changelog/9521.improvement.rst b/changelog/9521.trivial.rst similarity index 100% rename from changelog/9521.improvement.rst rename to changelog/9521.trivial.rst From 321747628e268e645f3535ecafeac2dddffdaa81 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 30 Jan 2022 00:12:51 +0000 Subject: [PATCH 111/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 126 ++++++++++++++++++------------- 1 file changed, 75 insertions(+), 51 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 7c0f3c86bd5..540bdb06952 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 982 plugins. +This list contains 985 plugins. .. only:: not latex @@ -19,7 +19,7 @@ This list contains 982 plugins. name summary last release status requires =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Jan 21, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Jan 27, 2022 N/A pytest (>=5.4.0) :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) @@ -47,7 +47,7 @@ This list contains 982 plugins. :pypi:`pytest-ansible` Plugin for py.test to simplify calling ansible modules from tests or fixtures May 25, 2021 5 - Production/Stable N/A :pypi:`pytest-ansible-playbook` Pytest fixture which runs given ansible playbook file. Mar 08, 2019 4 - Beta N/A :pypi:`pytest-ansible-playbook-runner` Pytest fixture which runs given ansible playbook file. Dec 02, 2020 4 - Beta pytest (>=3.1.0) - :pypi:`pytest-antilru` Bust functools.lru_cache when running pytest to avoid test pollution Apr 11, 2019 5 - Production/Stable pytest + :pypi:`pytest-antilru` Bust functools.lru_cache when running pytest to avoid test pollution Jan 29, 2022 5 - Production/Stable pytest :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest :pypi:`pytest-anything` Pytest fixtures to assert anything and something Feb 18, 2021 N/A N/A :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Nov 23, 2021 N/A pytest ; extra == 'test' @@ -68,7 +68,7 @@ This list contains 982 plugins. :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Dec 27, 2021 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio Jan 17, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jan 03, 2022 N/A N/A + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jan 25, 2022 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) :pypi:`pytest-async-sqlalchemy` Database testing fixtures using the SQLAlchemy asyncio API Oct 07, 2021 4 - Beta pytest (>=6.0.0) @@ -95,8 +95,8 @@ This list contains 982 plugins. :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A :pypi:`pytest-benchmark` A \`\`pytest\`\` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer. Apr 17, 2021 5 - Production/Stable pytest (>=3.8) - :pypi:`pytest-bg-process` Pytest plugin to initialize background process Aug 17, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-bigchaindb` A BigchainDB plugin for pytest. Aug 17, 2021 4 - Beta N/A + :pypi:`pytest-bg-process` Pytest plugin to initialize background process Jan 24, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-bigchaindb` A BigchainDB plugin for pytest. Jan 24, 2022 4 - Beta N/A :pypi:`pytest-bigquery-mock` Provides a mock fixture for python bigquery client Aug 05, 2021 N/A pytest (>=5.0) :pypi:`pytest-black` A pytest plugin to enable format checking with black Oct 05, 2020 4 - Beta N/A :pypi:`pytest-black-multipy` Allow '--black' on older Pythons Jan 14, 2021 5 - Production/Stable pytest (!=3.7.3,>=3.5) ; extra == 'testing' @@ -106,6 +106,7 @@ This list contains 982 plugins. :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A :pypi:`pytest-board` Local continuous test runner with pytest and watchdog. Jan 20, 2019 N/A N/A + :pypi:`pytest-bootstrap` Jan 28, 2022 N/A N/A :pypi:`pytest-bpdb` A py.test plug-in to enable drop to bpdb debugger on test failure. Jan 19, 2015 2 - Pre-Alpha N/A :pypi:`pytest-bravado` Pytest-bravado automatically generates from OpenAPI specification client fixtures. Jul 19, 2021 N/A N/A :pypi:`pytest-breakword` Use breakword with pytest Aug 04, 2021 N/A pytest (>=6.2.4,<7.0.0) @@ -209,6 +210,7 @@ This list contains 982 plugins. :pypi:`pytest-dbfixtures` Databases fixtures plugin for py.test. Dec 07, 2016 4 - Beta N/A :pypi:`pytest-db-plugin` Nov 27, 2021 N/A pytest (>=5.0) :pypi:`pytest-dbt-adapter` A pytest plugin for testing dbt adapter plugins Nov 24, 2021 N/A pytest (<7,>=6) + :pypi:`pytest-dbt-core` Pytest extension for dbt. Jan 28, 2022 N/A pytest (>=6.2.5) ; extra == 'test' :pypi:`pytest-dbus-notification` D-BUS notifications for pytest results. Mar 05, 2014 5 - Production/Stable N/A :pypi:`pytest-deadfixtures` A simple plugin to list unused fixtures in pytest Jul 23, 2020 5 - Production/Stable N/A :pypi:`pytest-deepcov` deepcov Mar 30, 2021 N/A N/A @@ -364,7 +366,7 @@ This list contains 982 plugins. :pypi:`pytest-fixture-typecheck` A pytest plugin to assert type annotations at runtime. Aug 24, 2021 N/A pytest :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Dec 16, 2020 4 - Beta pytest (>=3.5) :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. Jan 10, 2022 5 - Production/Stable pytest - :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Jan 20, 2022 4 - Beta pytest (>=3.5) + :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Jan 25, 2022 4 - Beta pytest (>=6.0) :pypi:`pytest-flakefinder` Runs tests multiple times to expose flakiness. Jul 28, 2020 4 - Beta pytest (>=2.7.1) :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) :pypi:`pytest-flaptastic` Flaptastic py.test plugin Mar 17, 2019 N/A N/A @@ -414,7 +416,7 @@ This list contains 982 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jan 18, 2022 3 - Alpha pytest (==6.2.5) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jan 29, 2022 3 - Alpha pytest (==6.2.5) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jan 20, 2022 N/A pytest (>=5.0) @@ -429,8 +431,8 @@ This list contains 982 plugins. :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Dec 25, 2021 5 - Production/Stable N/A :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A - :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Dec 15, 2021 3 - Alpha N/A - :pypi:`pytest-httpx` Send responses to httpx. Jan 17, 2022 5 - Production/Stable pytest (==6.*) + :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Jan 27, 2022 3 - Alpha N/A + :pypi:`pytest-httpx` Send responses to httpx. Jan 26, 2022 5 - Production/Stable pytest (==6.*) :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest @@ -447,7 +449,7 @@ This list contains 982 plugins. :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Sep 30, 2021 N/A N/A - :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Aug 17, 2021 5 - Production/Stable N/A + :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Jan 26, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package May 27, 2021 5 - Production/Stable N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Apr 07, 2021 N/A pytest (>=6.0.2,<7.0.0) @@ -537,7 +539,7 @@ This list contains 982 plugins. :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ml` Test your machine learning! May 04, 2019 4 - Beta N/A :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) - :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest May 06, 2021 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Jan 28, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-mock-api` A mock API server with configurable routes and responses available as a fixture. Feb 13, 2019 1 - Planning pytest (>=4.0.0) :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator Jan 05, 2022 5 - Production/Stable N/A :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest @@ -546,6 +548,7 @@ This list contains 982 plugins. :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Jan 11, 2022 N/A pytest (>=1.0) :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) + :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A :pypi:`pytest-modifyjunit` Utility for adding additional properties to junit xml for IDM QE Jan 10, 2019 N/A N/A :pypi:`pytest-modifyscope` pytest plugin to modify fixture scope Apr 12, 2020 N/A pytest :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Oct 06, 2021 5 - Production/Stable N/A @@ -663,7 +666,7 @@ This list contains 982 plugins. :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Dec 22, 2021 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) - :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Nov 24, 2021 N/A pytest (>=3.4.1) + :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 25, 2022 N/A pytest (>=3.4.1) :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Dec 28, 2021 5 - Production/Stable pytest (>=6) :pypi:`pytest-profiles` pytest plugin for configuration profiles Dec 09, 2021 4 - Beta pytest (>=3.7.0) @@ -683,7 +686,7 @@ This list contains 982 plugins. :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) - :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest. Feb 16, 2021 4 - Beta pytest (>=6.0.2) + :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Jan 27, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-pyq` Pytest fixture "q" for pyq Mar 10, 2020 5 - Production/Stable N/A :pypi:`pytest-pyramid` pytest_pyramid - provides fixtures for testing pyramid applications with pytest test suite Oct 15, 2021 5 - Production/Stable pytest :pypi:`pytest-pyramid-server` Pyramid server fixture for py.test May 28, 2019 5 - Production/Stable pytest @@ -771,19 +774,19 @@ This list contains 982 plugins. :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A - :pypi:`pytest-salt-factories` Pytest Salt Plugin Sep 16, 2021 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Jan 27, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jan 20, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jan 27, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Aug 31, 2020 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jan 20, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jan 27, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -797,7 +800,7 @@ This list contains 982 plugins. :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Nov 07, 2021 N/A N/A - :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Jan 21, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Jan 25, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 5 - Production/Stable pytest (>=3.5.1) :pypi:`pytest-shortcuts` Expand command-line shortcuts listed in pytest configuration Oct 29, 2020 4 - Beta pytest (>=3.5.0) @@ -806,7 +809,7 @@ This list contains 982 plugins. :pypi:`pytest-simple-plugin` Simple pytest plugin Nov 27, 2019 N/A N/A :pypi:`pytest-simple-settings` simple-settings plugin for pytest Nov 17, 2020 4 - Beta pytest :pypi:`pytest-single-file-logging` Allow for multiple processes to log to a single file May 05, 2016 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-skip-markers` Pytest Salt Plugin Oct 04, 2021 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-skip-markers` Pytest Salt Plugin Jan 26, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-skipper` A plugin that selects only tests with changes in execution path Mar 26, 2017 3 - Alpha pytest (>=3.0.6) :pypi:`pytest-skippy` Automatically skip tests that don't need to run! Jan 27, 2018 3 - Alpha pytest (>=2.3.4) :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A @@ -820,7 +823,7 @@ This list contains 982 plugins. :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Dec 02, 2021 4 - Beta pytest (>=3.0.0) :pypi:`pytest-snmpserver` May 12, 2021 N/A N/A :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Jan 05, 2022 4 - Beta pytest (>=6.2.0) - :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Dec 23, 2021 4 - Beta pytest (>=3.6.3) + :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Jan 23, 2022 4 - Beta pytest (>=3.6.3) :pypi:`pytest-soft-assertions` May 05, 2020 3 - Alpha pytest :pypi:`pytest-solidity` A PyTest library plugin for Solidity language. Jan 15, 2022 1 - Planning pytest (<7,>=6.0.1) ; extra == 'tests' :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) @@ -838,7 +841,7 @@ This list contains 982 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Jan 21, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Jan 25, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Dec 06, 2021 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A @@ -858,7 +861,7 @@ This list contains 982 plugins. :pypi:`pytest-stub` Stub packages, modules and attributes. Apr 28, 2020 5 - Production/Stable N/A :pypi:`pytest-stubprocess` Provide stub implementations for subprocesses in Python tests Sep 17, 2018 3 - Alpha pytest (>=3.5.0) :pypi:`pytest-study` A pytest plugin to organize long run tests (named studies) without interfering the regular tests Sep 26, 2017 3 - Alpha pytest (>=2.0) - :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Nov 07, 2021 5 - Production/Stable pytest (>=4.0.0) + :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Jan 23, 2022 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Mar 02, 2021 N/A N/A :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Jan 15, 2022 4 - Beta pytest (>=6.0) :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A @@ -867,7 +870,7 @@ This list contains 982 plugins. :pypi:`pytest-super-check` Pytest plugin to check your TestCase classes call super in setUp, tearDown, etc. Jan 10, 2022 5 - Production/Stable pytest :pypi:`pytest-svn` SVN repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-symbols` pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. Nov 20, 2017 3 - Alpha N/A - :pypi:`pytest-system-statistics` Pytest plugin to track and report system usage statistics Jan 05, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-system-statistics` Pytest plugin to track and report system usage statistics Jan 26, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-takeltest` Fixtures for ansible, testinfra and molecule Jan 04, 2022 N/A N/A :pypi:`pytest-talisker` Nov 28, 2021 N/A N/A :pypi:`pytest-tap` Test Anything Protocol (TAP) reporting plugin for pytest Oct 27, 2021 5 - Production/Stable pytest (>=3.0) @@ -1013,7 +1016,7 @@ This list contains 982 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: Jan 21, 2022, + *last release*: Jan 27, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1209,7 +1212,7 @@ This list contains 982 plugins. Pytest fixture which runs given ansible playbook file. :pypi:`pytest-antilru` - *last release*: Apr 11, 2019, + *last release*: Jan 29, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -1356,7 +1359,7 @@ This list contains 982 plugins. Pytest support for asyncio :pypi:`pytest-asyncio-cooperative` - *last release*: Jan 03, 2022, + *last release*: Jan 25, 2022, *status*: N/A, *requires*: N/A @@ -1545,14 +1548,14 @@ This list contains 982 plugins. A \`\`pytest\`\` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer. :pypi:`pytest-bg-process` - *last release*: Aug 17, 2021, + *last release*: Jan 24, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) Pytest plugin to initialize background process :pypi:`pytest-bigchaindb` - *last release*: Aug 17, 2021, + *last release*: Jan 24, 2022, *status*: 4 - Beta, *requires*: N/A @@ -1621,6 +1624,13 @@ This list contains 982 plugins. Local continuous test runner with pytest and watchdog. + :pypi:`pytest-bootstrap` + *last release*: Jan 28, 2022, + *status*: N/A, + *requires*: N/A + + + :pypi:`pytest-bpdb` *last release*: Jan 19, 2015, *status*: 2 - Pre-Alpha, @@ -2342,6 +2352,13 @@ This list contains 982 plugins. A pytest plugin for testing dbt adapter plugins + :pypi:`pytest-dbt-core` + *last release*: Jan 28, 2022, + *status*: N/A, + *requires*: pytest (>=6.2.5) ; extra == 'test' + + Pytest extension for dbt. + :pypi:`pytest-dbus-notification` *last release*: Mar 05, 2014, *status*: 5 - Production/Stable, @@ -3428,9 +3445,9 @@ This list contains 982 plugins. A pytest fixture for testing flake8 plugins. :pypi:`pytest-flake8-v2` - *last release*: Jan 20, 2022, + *last release*: Jan 25, 2022, *status*: 4 - Beta, - *requires*: pytest (>=3.5) + *requires*: pytest (>=6.0) pytest plugin to check FLAKE8 requirements @@ -3778,7 +3795,7 @@ This list contains 982 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jan 18, 2022, + *last release*: Jan 29, 2022, *status*: 3 - Alpha, *requires*: pytest (==6.2.5) @@ -3883,14 +3900,14 @@ This list contains 982 plugins. A thin wrapper of HTTPretty for pytest :pypi:`pytest-httpserver` - *last release*: Dec 15, 2021, + *last release*: Jan 27, 2022, *status*: 3 - Alpha, *requires*: N/A pytest-httpserver is a httpserver for pytest :pypi:`pytest-httpx` - *last release*: Jan 17, 2022, + *last release*: Jan 26, 2022, *status*: 5 - Production/Stable, *requires*: pytest (==6.*) @@ -4009,7 +4026,7 @@ This list contains 982 plugins. Reuse pytest.ini to store env variables :pypi:`pytest-inmanta` - *last release*: Aug 17, 2021, + *last release*: Jan 26, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4639,7 +4656,7 @@ This list contains 982 plugins. pytest plugin to display test execution output like a mochajs :pypi:`pytest-mock` - *last release*: May 06, 2021, + *last release*: Jan 28, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) @@ -4701,6 +4718,13 @@ This list contains 982 plugins. A set of fixtures to test your requests to HTTP/UDP servers + :pypi:`pytest-modified-env` + *last release*: Jan 29, 2022, + *status*: 4 - Beta, + *requires*: N/A + + Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. + :pypi:`pytest-modifyjunit` *last release*: Jan 10, 2019, *status*: N/A, @@ -5521,7 +5545,7 @@ This list contains 982 plugins. pytest plugin with powerful fixtures :pypi:`pytest-pretty-terminal` - *last release*: Nov 24, 2021, + *last release*: Jan 25, 2022, *status*: N/A, *requires*: pytest (>=3.4.1) @@ -5661,11 +5685,11 @@ This list contains 982 plugins. Core engine for cookiecutter-qa and pytest-play packages :pypi:`pytest-pyppeteer` - *last release*: Feb 16, 2021, - *status*: 4 - Beta, - *requires*: pytest (>=6.0.2) + *last release*: Jan 27, 2022, + *status*: N/A, + *requires*: pytest (>=6.2.5,<7.0.0) - A plugin to run pyppeteer in pytest. + A plugin to run pyppeteer in pytest :pypi:`pytest-pyq` *last release*: Mar 10, 2020, @@ -6277,7 +6301,7 @@ This list contains 982 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Sep 16, 2021, + *last release*: Jan 27, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6319,7 +6343,7 @@ This list contains 982 plugins. :pypi:`pytest-sbase` - *last release*: Jan 20, 2022, + *last release*: Jan 27, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6361,7 +6385,7 @@ This list contains 982 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Jan 20, 2022, + *last release*: Jan 27, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6459,7 +6483,7 @@ This list contains 982 plugins. A pytest plugin to help with testing shell scripts / black box commands :pypi:`pytest-shell-utilities` - *last release*: Jan 21, 2022, + *last release*: Jan 25, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6522,8 +6546,8 @@ This list contains 982 plugins. Allow for multiple processes to log to a single file :pypi:`pytest-skip-markers` - *last release*: Oct 04, 2021, - *status*: 4 - Beta, + *last release*: Jan 26, 2022, + *status*: 5 - Production/Stable, *requires*: pytest (>=6.0.0) Pytest Salt Plugin @@ -6620,7 +6644,7 @@ This list contains 982 plugins. Setup test data and run tests on snowflake in BDD style! :pypi:`pytest-socket` - *last release*: Dec 23, 2021, + *last release*: Jan 23, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.6.3) @@ -6746,7 +6770,7 @@ This list contains 982 plugins. :pypi:`pytest-splunk-addon` - *last release*: Jan 21, 2022, + *last release*: Jan 25, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -6886,7 +6910,7 @@ This list contains 982 plugins. A pytest plugin to organize long run tests (named studies) without interfering the regular tests :pypi:`pytest-subprocess` - *last release*: Nov 07, 2021, + *last release*: Jan 23, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.0.0) @@ -6949,8 +6973,8 @@ This list contains 982 plugins. pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. :pypi:`pytest-system-statistics` - *last release*: Jan 05, 2022, - *status*: 4 - Beta, + *last release*: Jan 26, 2022, + *status*: 5 - Production/Stable, *requires*: pytest (>=6.0.0) Pytest plugin to track and report system usage statistics From b2701a02724514ef5bddaab65af30d85d8d753c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Jan 2022 03:02:08 +0000 Subject: [PATCH 112/549] build(deps): Bump pytest-mock in /testing/plugins_integration Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.6.1 to 3.7.0. - [Release notes](https://github.com/pytest-dev/pytest-mock/releases) - [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.6.1...v3.7.0) --- updated-dependencies: - dependency-name: pytest-mock dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index ae2fc3d1297..8c5d69ff19a 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -6,7 +6,7 @@ pytest-cov==3.0.0 pytest-django==4.5.2 pytest-flakes==4.0.5 pytest-html==3.1.1 -pytest-mock==3.6.1 +pytest-mock==3.7.0 pytest-rerunfailures==10.2 pytest-sugar==0.9.4 pytest-trio==0.7.0 From 3aef0b9de6ed071580a63b441d749162c71037de Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 31 Jan 2022 22:18:51 +0000 Subject: [PATCH 113/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 21.12b0 → 22.1.0](https://github.com/psf/black/compare/21.12b0...22.1.0) - [github.com/asottile/blacken-docs: v1.12.0 → v1.12.1](https://github.com/asottile/blacken-docs/compare/v1.12.0...v1.12.1) - [github.com/asottile/reorder_python_imports: v2.6.0 → v2.7.1](https://github.com/asottile/reorder_python_imports/compare/v2.6.0...v2.7.1) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 71357f0108e..125f5561db4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,11 @@ repos: - repo: https://github.com/psf/black - rev: 21.12b0 + rev: 22.1.0 hooks: - id: black args: [--safe, --quiet] - repo: https://github.com/asottile/blacken-docs - rev: v1.12.0 + rev: v1.12.1 hooks: - id: blacken-docs additional_dependencies: [black==20.8b1] @@ -29,7 +29,7 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v2.6.0 + rev: v2.7.1 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] From 9d2ffe207bfea9a8b57452bafb9961aba67edf7a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 31 Jan 2022 22:20:16 +0000 Subject: [PATCH 114/549] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytest/doctest.py | 2 +- testing/io/test_terminalwriter.py | 2 +- testing/python/approx.py | 2 +- testing/test_assertrewrite.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py index 0784f431b8e..7d37be2acc0 100644 --- a/src/_pytest/doctest.py +++ b/src/_pytest/doctest.py @@ -656,7 +656,7 @@ def _remove_unwanted_precision(self, want: str, got: str) -> str: precision = 0 if fraction is None else len(fraction) if exponent is not None: precision -= int(exponent) - if float(w.group()) == approx(float(g.group()), abs=10 ** -precision): + if float(w.group()) == approx(float(g.group()), abs=10**-precision): # They're close enough. Replace the text we actually # got with the text we want, so that it will match when we # check the string literally. diff --git a/testing/io/test_terminalwriter.py b/testing/io/test_terminalwriter.py index 4866c94a558..6fe718b5341 100644 --- a/testing/io/test_terminalwriter.py +++ b/testing/io/test_terminalwriter.py @@ -56,7 +56,7 @@ def test_terminalwriter_not_unicode() -> None: file = io.TextIOWrapper(buffer, encoding="cp1252") tw = terminalwriter.TerminalWriter(file) tw.write("hello 🌀 wôrld אבג", flush=True) - assert buffer.getvalue() == br"hello \U0001f300 w\xf4rld \u05d0\u05d1\u05d2" + assert buffer.getvalue() == rb"hello \U0001f300 w\xf4rld \u05d0\u05d1\u05d2" win32 = int(sys.platform == "win32") diff --git a/testing/python/approx.py b/testing/python/approx.py index f417a5992cc..eb9bcd874c0 100644 --- a/testing/python/approx.py +++ b/testing/python/approx.py @@ -771,7 +771,7 @@ def test_foo(): def test_expected_value_type_error(self, x, name): with pytest.raises( TypeError, - match=fr"pytest.approx\(\) does not support nested {name}:", + match=rf"pytest.approx\(\) does not support nested {name}:", ): approx(x) diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index dd1573935fc..ae18b4be34a 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1313,7 +1313,7 @@ def test_simple_failure(): @pytest.mark.skipif( - sys.maxsize <= (2 ** 31 - 1), reason="Causes OverflowError on 32bit systems" + sys.maxsize <= (2**31 - 1), reason="Causes OverflowError on 32bit systems" ) @pytest.mark.parametrize("offset", [-1, +1]) def test_source_mtime_long_long(pytester: Pytester, offset) -> None: @@ -1332,7 +1332,7 @@ def test(): pass # use unsigned long timestamp which overflows signed long, # which was the cause of the bug # +1 offset also tests masking of 0xFFFFFFFF - timestamp = 2 ** 32 + offset + timestamp = 2**32 + offset os.utime(str(p), (timestamp, timestamp)) result = pytester.runpytest() assert result.ret == 0 From 12b288d84af798c36842fb4c973c144068e5c6d0 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 3 Feb 2022 11:48:55 +0100 Subject: [PATCH 115/549] releasing: Always set doc_version (#9589) Looks like something (tox?) does not deal with empty arguments being passed to release.py correctly --- scripts/prepare-release-pr.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/prepare-release-pr.py b/scripts/prepare-release-pr.py index 73088397d55..fcfd85b20cc 100644 --- a/scripts/prepare-release-pr.py +++ b/scripts/prepare-release-pr.py @@ -90,13 +90,10 @@ def prepare_release_pr( if prerelease: template_name = "release.pre.rst" - doc_version = release_branch elif is_feature_release: template_name = "release.minor.rst" - doc_version = "" # unused in template else: template_name = "release.patch.rst" - doc_version = "" # unused in template # important to use tox here because we have changed branches, so dependencies # might have changed as well @@ -107,7 +104,7 @@ def prepare_release_pr( "--", version, template_name, - doc_version, + release_branch, # doc_version "--skip-check-links", ] print("Running", " ".join(cmdline)) From 2982753d807b8a2acc3dd6b23ec560384970da7e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 3 Feb 2022 16:33:07 +0100 Subject: [PATCH 116/549] releasing: Add template for major releases (#9596) * releasing: Add template for major releases With pytest 6.0.0, we still used a manual releasing workflow (at least if I remember correctly), and apparently we never wrote a release announcement template for major releases. Instead, the minor release template claimed that the release would contain "breaking changes", which doesn't seem reasonable. Thus, this adds a new major template based on the former minor template, and adjusts the latter to only mention fixes and new features instead. * Update scripts/release.minor.rst Co-authored-by: Bruno Oliveira Co-authored-by: Bruno Oliveira --- scripts/prepare-release-pr.py | 4 +++- scripts/release.major.rst | 24 ++++++++++++++++++++++++ scripts/release.minor.rst | 4 ++-- 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 scripts/release.major.rst diff --git a/scripts/prepare-release-pr.py b/scripts/prepare-release-pr.py index fcfd85b20cc..7a80de7edaa 100644 --- a/scripts/prepare-release-pr.py +++ b/scripts/prepare-release-pr.py @@ -88,7 +88,9 @@ def prepare_release_pr( print(f"Branch {Fore.CYAN}{release_branch}{Fore.RESET} created.") - if prerelease: + if is_major: + template_name = "release.major.rst" + elif prerelease: template_name = "release.pre.rst" elif is_feature_release: template_name = "release.minor.rst" diff --git a/scripts/release.major.rst b/scripts/release.major.rst new file mode 100644 index 00000000000..76e447f0c6d --- /dev/null +++ b/scripts/release.major.rst @@ -0,0 +1,24 @@ +pytest-{version} +======================================= + +The pytest team is proud to announce the {version} release! + +This release contains new features, improvements, bug fixes, and breaking changes, so users +are encouraged to take a look at the CHANGELOG carefully: + + https://docs.pytest.org/en/stable/changelog.html + +For complete documentation, please visit: + + https://docs.pytest.org/en/stable/ + +As usual, you can upgrade from PyPI via: + + pip install -U pytest + +Thanks to all of the contributors to this release: + +{contributors} + +Happy testing, +The pytest Development Team diff --git a/scripts/release.minor.rst b/scripts/release.minor.rst index 76e447f0c6d..9a06d3d4140 100644 --- a/scripts/release.minor.rst +++ b/scripts/release.minor.rst @@ -3,8 +3,8 @@ pytest-{version} The pytest team is proud to announce the {version} release! -This release contains new features, improvements, bug fixes, and breaking changes, so users -are encouraged to take a look at the CHANGELOG carefully: +This release contains new features, improvements, and bug fixes, +the full list of changes is available in the changelog: https://docs.pytest.org/en/stable/changelog.html From dfa7023862242b497a7f4707d3aaf906effe8f11 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 4 Feb 2022 11:48:24 +0100 Subject: [PATCH 117/549] Prepare release 7.0.0 (#9598) (#9604) * Prepare release version 7.0.0 * Add note to changelog Co-authored-by: pytest bot Co-authored-by: Florian Bruhin (cherry picked from commit e37fbe5685d330cbe7819c5a08d0a524df7299bf) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- changelog/9355.bugfix.rst | 1 - changelog/9396.bugfix.rst | 1 - changelog/9404.doc.rst | 1 - changelog/9488.deprecation.rst | 7 --- changelog/9505.doc.rst | 2 - changelog/9521.trivial.rst | 1 - doc/en/announce/index.rst | 1 + doc/en/announce/release-7.0.0.rst | 74 +++++++++++++++++++++++++++++++ doc/en/builtin.rst | 4 +- doc/en/changelog.rst | 45 +++++++++++++++++++ doc/en/getting-started.rst | 2 +- 11 files changed, 123 insertions(+), 16 deletions(-) delete mode 100644 changelog/9355.bugfix.rst delete mode 100644 changelog/9396.bugfix.rst delete mode 100644 changelog/9404.doc.rst delete mode 100644 changelog/9488.deprecation.rst delete mode 100644 changelog/9505.doc.rst delete mode 100644 changelog/9521.trivial.rst create mode 100644 doc/en/announce/release-7.0.0.rst diff --git a/changelog/9355.bugfix.rst b/changelog/9355.bugfix.rst deleted file mode 100644 index a2739369fe0..00000000000 --- a/changelog/9355.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed error message prints function decorators when using assert in Python 3.8 and above. diff --git a/changelog/9396.bugfix.rst b/changelog/9396.bugfix.rst deleted file mode 100644 index dcb83bbc14f..00000000000 --- a/changelog/9396.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Ensure :attr:`pytest.Config.inifile` is available during the :func:`pytest_cmdline_main <_pytest.hookspec.pytest_cmdline_main>` hook (regression during ``7.0.0rc1``). diff --git a/changelog/9404.doc.rst b/changelog/9404.doc.rst deleted file mode 100644 index 70e4c6d5899..00000000000 --- a/changelog/9404.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Added extra documentation on alternatives to common misuses of `pytest.warns(None)` ahead of its deprecation. diff --git a/changelog/9488.deprecation.rst b/changelog/9488.deprecation.rst deleted file mode 100644 index 5c5807ec34a..00000000000 --- a/changelog/9488.deprecation.rst +++ /dev/null @@ -1,7 +0,0 @@ -If custom subclasses of nodes like :class:`pytest.Item` override the -``__init__`` method, they should take ``**kwargs``. See -:ref:`uncooperative-constructors-deprecated` for details. - -Note that a deprection warning is only emitted when there is a conflict in the -arguments pytest expected to pass. This deprecation was already part of pytest -7.0.0rc1 but wasn't documented. diff --git a/changelog/9505.doc.rst b/changelog/9505.doc.rst deleted file mode 100644 index 51386c226bf..00000000000 --- a/changelog/9505.doc.rst +++ /dev/null @@ -1,2 +0,0 @@ -Clarify where the configuration files are located. To avoid confusions documentation mentions -that configuration file is located in the root of the repository. diff --git a/changelog/9521.trivial.rst b/changelog/9521.trivial.rst deleted file mode 100644 index 0c402ad242b..00000000000 --- a/changelog/9521.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Add test coverage to assertion rewrite path. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index ccda9d536e3..75dde1bd6d9 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-7.0.0 release-7.0.0rc1 release-6.2.5 release-6.2.4 diff --git a/doc/en/announce/release-7.0.0.rst b/doc/en/announce/release-7.0.0.rst new file mode 100644 index 00000000000..3ce4335564f --- /dev/null +++ b/doc/en/announce/release-7.0.0.rst @@ -0,0 +1,74 @@ +pytest-7.0.0 +======================================= + +The pytest team is proud to announce the 7.0.0 release! + +This release contains new features, improvements, bug fixes, and breaking changes, so users +are encouraged to take a look at the CHANGELOG carefully: + + https://docs.pytest.org/en/stable/changelog.html + +For complete documentation, please visit: + + https://docs.pytest.org/en/stable/ + +As usual, you can upgrade from PyPI via: + + pip install -U pytest + +Thanks to all of the contributors to this release: + +* Adam J. Stewart +* Alexander King +* Amin Alaee +* Andrew Neitsch +* Anthony Sottile +* Ben Davies +* Bernát Gábor +* Brian Okken +* Bruno Oliveira +* Cristian Vera +* Dan Alvizu +* David Szotten +* Eddie +* Emmanuel Arias +* Emmanuel Meric de Bellefon +* Eric Liu +* Florian Bruhin +* GergelyKalmar +* Graeme Smecher +* Harshna +* Hugo van Kemenade +* Jakub Kulík +* James Myatt +* Jeff Rasley +* Kale Kundert +* Kian Meng, Ang +* Miro Hrončok +* Naveen-Pratap +* Oleg Höfling +* Olga Matoula +* Ran Benita +* Ronny Pfannschmidt +* Simon K +* Srip +* Sören Wegener +* Taneli Hukkinen +* Terje Runde +* Thomas Grainger +* Thomas Hisch +* William Jamir Silva +* Yuval Shimon +* Zac Hatfield-Dodds +* andrewdotn +* denivyruck +* ericluoliu +* oleg.hoefling +* symonk +* ziebam +* Éloi Rivard +* Éric + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index ba173ac196f..c7e7863b218 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -117,10 +117,10 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a `pytest-xdist `__ plugin. See :issue:`7767` for details. - tmpdir_factory [session scope] -- .../_pytest/legacypath.py:292 + tmpdir_factory [session scope] -- .../_pytest/legacypath.py:295 Return a :class:`pytest.TempdirFactory` instance for the test session. - tmpdir -- .../_pytest/legacypath.py:299 + tmpdir -- .../_pytest/legacypath.py:302 Return a temporary directory path object which is unique to each test function invocation, created as a sub directory of the base temporary directory. diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 6896072e1ab..9605d6bcf00 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -28,6 +28,51 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 7.0.0 (2022-02-03) +========================= + +(**Please see the full set of changes for this release also in the 7.0.0rc1 notes below**) + +Deprecations +------------ + +- `#9488 `_: If custom subclasses of nodes like :class:`pytest.Item` override the + ``__init__`` method, they should take ``**kwargs``. See + :ref:`uncooperative-constructors-deprecated` for details. + + Note that a deprection warning is only emitted when there is a conflict in the + arguments pytest expected to pass. This deprecation was already part of pytest + 7.0.0rc1 but wasn't documented. + + + +Bug Fixes +--------- + +- `#9355 `_: Fixed error message prints function decorators when using assert in Python 3.8 and above. + + +- `#9396 `_: Ensure :attr:`pytest.Config.inifile` is available during the :func:`pytest_cmdline_main <_pytest.hookspec.pytest_cmdline_main>` hook (regression during ``7.0.0rc1``). + + + +Improved Documentation +---------------------- + +- `#9404 `_: Added extra documentation on alternatives to common misuses of `pytest.warns(None)` ahead of its deprecation. + + +- `#9505 `_: Clarify where the configuration files are located. To avoid confusions documentation mentions + that configuration file is located in the root of the repository. + + + +Trivial/Internal Changes +------------------------ + +- `#9521 `_: Add test coverage to assertion rewrite path. + + pytest 7.0.0rc1 (2021-12-06) ============================ diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index 47eed9c9354..4c948843a9d 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -22,7 +22,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 7.0.0rc1 + pytest 7.0.0 .. _`simpletest`: From dff1a15881bfc25dfb90c9ec81393dae97c44548 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 4 Feb 2022 12:11:30 +0100 Subject: [PATCH 118/549] ci: Add missing macOS CI envs (#9601) alinsa_vix in Discord noticed that we are not testing Python 3.9 and 3.10 on macOS, which seems strange. Maybe this is due how to macOS CI resources were quite scarce for a while, but I believe this has improved since. --- .github/workflows/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 77cee5a8a06..c8f216c4104 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,6 +48,8 @@ jobs: "macos-py37", "macos-py38", + "macos-py39", + "macos-py310", "docs", "doctesting", @@ -116,6 +118,14 @@ jobs: os: macos-latest tox_env: "py38-xdist" use_coverage: true + - name: "macos-py39" + python: "3.9" + os: macos-latest + tox_env: "py39-xdist" + - name: "macos-py310" + python: "3.10" + os: macos-latest + tox_env: "py310-xdist" - name: "plugins" python: "3.9" From 48f01bdcc29f1ae457616053dbda43cb25a99e5f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 4 Feb 2022 12:12:58 +0100 Subject: [PATCH 119/549] doc: Hide done training (#9602) Only commenting out as I expect to add trainings at PyConDE and possibly PyConIT soon --- doc/en/index.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/en/index.rst b/doc/en/index.rst index da0d3bd4220..9e9cf0b68a8 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -1,10 +1,11 @@ :orphan: -.. sidebar:: Next Open Trainings +.. + .. sidebar:: Next Open Trainings - - `Professional Testing with Python `_, via `Python Academy `_, February 1st to 3rd, 2022, Leipzig (Germany) and remote. + - `Professional Testing with Python `_, via `Python Academy `_, February 1st to 3rd, 2022, Leipzig (Germany) and remote. - Also see `previous talks and blogposts `_. + Also see `previous talks and blogposts `_. .. _features: From b5a168aa0e00c5cd0c2ffd40be0189ec15266d0e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 4 Feb 2022 12:13:33 +0100 Subject: [PATCH 120/549] doc: Streamline remote handling in releasing docs (#9603) The docs already assume an 'upstream' remote, so we can only fetch from there instead of fetching all remotes. We also don't need to hardcode the remote URL. --- RELEASING.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/RELEASING.rst b/RELEASING.rst index f9e4d5f153c..5e7654210d6 100644 --- a/RELEASING.rst +++ b/RELEASING.rst @@ -37,7 +37,7 @@ breaking changes or new features. For a new minor release, first create a new maintenance branch from ``main``:: - git fetch --all + git fetch upstream git branch 7.1.x upstream/main git push upstream 7.1.x @@ -63,7 +63,7 @@ Major releases 1. Create a new maintenance branch from ``main``:: - git fetch --all + git fetch upstream git branch 8.0.x upstream/main git push upstream 8.0.x @@ -136,9 +136,9 @@ Both automatic and manual processes described above follow the same steps from t #. After all tests pass and the PR has been approved, tag the release commit in the ``release-MAJOR.MINOR.PATCH`` branch and push it. This will publish to PyPI:: - git fetch --all + git fetch upstream git tag MAJOR.MINOR.PATCH upstream/release-MAJOR.MINOR.PATCH - git push git@github.com:pytest-dev/pytest.git MAJOR.MINOR.PATCH + git push upstream MAJOR.MINOR.PATCH Wait for the deploy to complete, then make sure it is `available on PyPI `_. @@ -146,7 +146,7 @@ Both automatic and manual processes described above follow the same steps from t #. Cherry-pick the CHANGELOG / announce files to the ``main`` branch:: - git fetch --all --prune + git fetch upstream git checkout upstream/main -b cherry-pick-release git cherry-pick -x -m1 upstream/MAJOR.MINOR.x @@ -158,7 +158,7 @@ Both automatic and manual processes described above follow the same steps from t git checkout main git pull git tag MAJOR.{MINOR+1}.0.dev0 - git push git@github.com:pytest-dev/pytest.git MAJOR.{MINOR+1}.0.dev0 + git push upstream MAJOR.{MINOR+1}.0.dev0 #. Send an email announcement with the contents from:: From 57f8f5d2b313b9601872a1184a809060468a606e Mon Sep 17 00:00:00 2001 From: Gabor Szabo Date: Fri, 4 Feb 2022 14:38:26 +0200 Subject: [PATCH 121/549] Mention basetemp in docs as a way to only keep last temp dir (#9607) Closes #9599 --- doc/en/how-to/tmp_path.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/en/how-to/tmp_path.rst b/doc/en/how-to/tmp_path.rst index ebd74d42e90..b261a55637e 100644 --- a/doc/en/how-to/tmp_path.rst +++ b/doc/en/how-to/tmp_path.rst @@ -121,6 +121,10 @@ the system temporary directory. The base name will be ``pytest-NUM`` where ``NUM`` will be incremented with each test run. Moreover, entries older than 3 temporary directories will be removed. +The number of entries currently cannot be changed, but using the ``--basetemp`` +option will remove the directory before every run, effectively meaning the temporary directories +of only the most recent run will be kept. + You can override the default temporary directory setting like this: .. code-block:: bash From 77a38a3b754e6a82332a1f7bd11bc684c345af28 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 4 Feb 2022 17:36:31 +0100 Subject: [PATCH 122/549] doc: Add changing RTD version to checklist (#9606) I still think it makes sense to always serve docs from the release branch (rather than the latest tagged release), but that means we need to update it on new releases. --- RELEASING.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASING.rst b/RELEASING.rst index 5e7654210d6..66775e7cfbb 100644 --- a/RELEASING.rst +++ b/RELEASING.rst @@ -160,6 +160,8 @@ Both automatic and manual processes described above follow the same steps from t git tag MAJOR.{MINOR+1}.0.dev0 git push upstream MAJOR.{MINOR+1}.0.dev0 +#. For major and minor releases, change the default version in the `Read the Docs Settings `_ to the new branch. + #. Send an email announcement with the contents from:: doc/en/announce/release-.rst From d1b394af88175ae80819e8317165cf17a140618e Mon Sep 17 00:00:00 2001 From: "P. L. Lim" <2090236+pllim@users.noreply.github.com> Date: Fri, 4 Feb 2022 17:45:04 -0500 Subject: [PATCH 123/549] DOC: pytest.warns() fails on zero warning --- doc/en/how-to/capture-warnings.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/how-to/capture-warnings.rst b/doc/en/how-to/capture-warnings.rst index 065c11e610c..8c911424af7 100644 --- a/doc/en/how-to/capture-warnings.rst +++ b/doc/en/how-to/capture-warnings.rst @@ -358,7 +358,7 @@ Additional use cases of warnings in tests Here are some use cases involving warnings that often come up in tests, and suggestions on how to deal with them: -- To ensure that **any** warning is emitted, use: +- To ensure that **at least one** warning is emitted, use: .. code-block:: python From 20c2c30ff241cf3bb48290edd1b7bfebceccd007 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 5 Feb 2022 11:52:36 +0200 Subject: [PATCH 124/549] mark/structures: use class-based NamedTuple syntax Should hopefully work now in Python>=3.7. --- src/_pytest/mark/structures.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index 0e42cd8de5f..ec41b3f99a6 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -72,16 +72,11 @@ def get_empty_parameterset_mark( return mark -class ParameterSet( - NamedTuple( - "ParameterSet", - [ - ("values", Sequence[Union[object, NotSetType]]), - ("marks", Collection[Union["MarkDecorator", "Mark"]]), - ("id", Optional[str]), - ], - ) -): +class ParameterSet(NamedTuple): + values: Sequence[Union[object, NotSetType]] + marks: Collection[Union["MarkDecorator", "Mark"]] + id: Optional[str] + @classmethod def param( cls, From 2c3be75b09d6e88bafc273dc810e4e01165cd054 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 6 Feb 2022 00:13:55 +0000 Subject: [PATCH 125/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 198 ++++++++++++++++++++++--------- 1 file changed, 139 insertions(+), 59 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 540bdb06952..f73ad773cb8 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 985 plugins. +This list contains 995 plugins. .. only:: not latex @@ -19,7 +19,7 @@ This list contains 985 plugins. name summary last release status requires =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Jan 27, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Feb 01, 2022 N/A pytest (>=5.4.0) :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) @@ -77,7 +77,7 @@ This list contains 985 plugins. :pypi:`pytest-austin` Austin plugin for pytest Oct 11, 2020 4 - Beta N/A :pypi:`pytest-autochecklog` automatically check condition and log all the checks Apr 25, 2015 4 - Beta N/A :pypi:`pytest-automation` pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. Oct 01, 2021 N/A pytest - :pypi:`pytest-automock` Pytest plugin for automatical mocks creation Apr 22, 2020 N/A pytest ; extra == 'dev' + :pypi:`pytest-automock` Pytest plugin for automatical mocks creation Feb 01, 2022 N/A pytest ; extra == 'dev' :pypi:`pytest-auto-parametrize` pytest plugin: avoid repeating arguments in parametrize Oct 02, 2016 3 - Alpha N/A :pypi:`pytest-autotest` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Aug 25, 2021 N/A pytest :pypi:`pytest-avoidance` Makes pytest skip tests that don not need rerunning May 23, 2019 4 - Beta pytest (>=3.5.0) @@ -125,11 +125,11 @@ This list contains 985 plugins. :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Nov 03, 2021 4 - Beta pytest (>=5) :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A + :pypi:`pytest-cairo` Feb 04, 2022 N/A pytest :pypi:`pytest-camel-collect` Enable CamelCase-aware pytest class collection Aug 02, 2020 N/A pytest (>=2.9) :pypi:`pytest-canonical-data` A plugin which allows to compare results with canonical results, based on previous runs May 08, 2020 2 - Pre-Alpha pytest (>=3.5.0) :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A :pypi:`pytest-capture-deprecatedwarnings` pytest plugin to capture all deprecatedwarnings and put them in one file Apr 30, 2019 N/A N/A - :pypi:`pytest-capturelogs` A sample Python project Sep 11, 2021 3 - Alpha N/A :pypi:`pytest-cases` Separate test code from test cases in pytest. Jan 07, 2022 5 - Production/Stable N/A :pypi:`pytest-cassandra` Cassandra CCM Test Fixtures for pytest Nov 04, 2017 1 - Planning N/A :pypi:`pytest-catchlog` py.test plugin to catch log messages. This is a fork of pytest-capturelog. Jan 24, 2016 4 - Beta pytest (>=2.6) @@ -167,7 +167,7 @@ This list contains 985 plugins. :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Nov 06, 2020 N/A N/A :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts Jan 06, 2022 4 - Beta N/A :pypi:`pytest-consul` pytest plugin with fixtures for testing consul aware apps Nov 24, 2018 3 - Alpha pytest - :pypi:`pytest-container` Pytest fixtures for writing container based tests Nov 19, 2021 3 - Alpha pytest (>=3.10) + :pypi:`pytest-container` Pytest fixtures for writing container based tests Feb 01, 2022 3 - Alpha pytest (>=3.10) :pypi:`pytest-contextfixture` Define pytest fixtures as context managers. Mar 12, 2013 4 - Beta N/A :pypi:`pytest-contexts` A plugin to run tests written with the Contexts framework using pytest May 19, 2021 4 - Beta N/A :pypi:`pytest-cookies` The pytest plugin for your Cookiecutter templates. 🍪 May 24, 2021 5 - Production/Stable pytest (>=3.3.0) @@ -210,6 +210,7 @@ This list contains 985 plugins. :pypi:`pytest-dbfixtures` Databases fixtures plugin for py.test. Dec 07, 2016 4 - Beta N/A :pypi:`pytest-db-plugin` Nov 27, 2021 N/A pytest (>=5.0) :pypi:`pytest-dbt-adapter` A pytest plugin for testing dbt adapter plugins Nov 24, 2021 N/A pytest (<7,>=6) + :pypi:`pytest-dbt-conventions` A pytest plugin for linting a dbt project's conventions Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-dbt-core` Pytest extension for dbt. Jan 28, 2022 N/A pytest (>=6.2.5) ; extra == 'test' :pypi:`pytest-dbus-notification` D-BUS notifications for pytest results. Mar 05, 2014 5 - Production/Stable N/A :pypi:`pytest-deadfixtures` A simple plugin to list unused fixtures in pytest Jul 23, 2020 5 - Production/Stable N/A @@ -247,7 +248,7 @@ This list contains 985 plugins. :pypi:`pytest-djangorestframework` A djangorestframework plugin for pytest Aug 11, 2019 4 - Beta N/A :pypi:`pytest-django-rq` A pytest plugin to help writing unit test for django-rq Apr 13, 2020 4 - Beta N/A :pypi:`pytest-django-sqlcounts` py.test plugin for reporting the number of SQLs executed per django testcase. Jun 16, 2015 4 - Beta N/A - :pypi:`pytest-django-testing-postgresql` Use a temporary PostgreSQL database with pytest-django Dec 05, 2019 3 - Alpha N/A + :pypi:`pytest-django-testing-postgresql` Use a temporary PostgreSQL database with pytest-django Jan 31, 2022 4 - Beta N/A :pypi:`pytest-doc` A documentation plugin for py.test. Jun 28, 2015 5 - Production/Stable N/A :pypi:`pytest-docfiles` pytest plugin to test codeblocks in your documentation. Dec 22, 2021 4 - Beta pytest (>=3.7.0) :pypi:`pytest-docgen` An RST Documentation Generator for pytest-based test suites Apr 17, 2020 N/A N/A @@ -258,10 +259,12 @@ This list contains 985 plugins. :pypi:`pytest-docker-db` A plugin to use docker databases for pytests Mar 20, 2021 5 - Production/Stable pytest (>=3.1.1) :pypi:`pytest-docker-fixtures` pytest docker fixtures Nov 23, 2021 3 - Alpha N/A :pypi:`pytest-docker-git-fixtures` Pytest fixtures for testing with git scm. Mar 11, 2021 4 - Beta pytest + :pypi:`pytest-docker-haproxy-fixtures` Pytest fixtures for testing with haproxy. Feb 01, 2022 4 - Beta pytest :pypi:`pytest-docker-pexpect` pytest plugin for writing functional tests with pexpect and docker Jan 14, 2019 N/A pytest :pypi:`pytest-docker-postgresql` A simple plugin to use with pytest Sep 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-docker-py` Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. Nov 27, 2018 N/A pytest (==4.0.0) - :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Mar 04, 2021 4 - Beta pytest + :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Feb 01, 2022 4 - Beta pytest + :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 04, 2022 4 - Beta pytest :pypi:`pytest-docker-tools` Docker integration tests for pytest Jul 23, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) :pypi:`pytest-docs` Documentation tool for pytest Nov 11, 2018 4 - Beta pytest (>=3.5.0) :pypi:`pytest-docstyle` pytest plugin to run pydocstyle Mar 23, 2020 3 - Alpha N/A @@ -318,7 +321,7 @@ This list contains 985 plugins. :pypi:`pytest-ethereum` pytest-ethereum: Pytest library for ethereum projects. Jun 24, 2019 3 - Alpha pytest (==3.3.2); extra == 'dev' :pypi:`pytest-eucalyptus` Pytest Plugin for BDD Aug 13, 2019 N/A pytest (>=4.2.0) :pypi:`pytest-eventlet` Applies eventlet monkey-patch as a pytest plugin. Oct 04, 2021 N/A pytest ; extra == 'dev' - :pypi:`pytest-excel` pytest plugin for generating excel reports Oct 06, 2020 5 - Production/Stable N/A + :pypi:`pytest-excel` pytest plugin for generating excel reports Jan 31, 2022 5 - Production/Stable N/A :pypi:`pytest-exceptional` Better exceptions Mar 16, 2017 4 - Beta N/A :pypi:`pytest-exception-script` Walk your code through exception script to check it's resiliency to failures. Aug 04, 2020 3 - Alpha pytest :pypi:`pytest-executable` pytest plugin for testing executables Nov 10, 2021 4 - Beta pytest (<6.3,>=4.3) @@ -416,7 +419,7 @@ This list contains 985 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jan 29, 2022 3 - Alpha pytest (==6.2.5) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Feb 05, 2022 3 - Alpha pytest (==6.2.5) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jan 20, 2022 N/A pytest (>=5.0) @@ -424,6 +427,7 @@ This list contains 985 plugins. :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) :pypi:`pytest-html` pytest plugin for generating HTML reports Dec 13, 2020 5 - Production/Stable pytest (!=6.0.0,>=5.0) :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Jan 31, 2022 5 - Production/Stable N/A :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Apr 25, 2021 N/A N/A :pypi:`pytest-html-thread` pytest plugin for generating HTML reports Dec 29, 2020 5 - Production/Stable N/A @@ -432,7 +436,7 @@ This list contains 985 plugins. :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Jan 27, 2022 3 - Alpha N/A - :pypi:`pytest-httpx` Send responses to httpx. Jan 26, 2022 5 - Production/Stable pytest (==6.*) + :pypi:`pytest-httpx` Send responses to httpx. Feb 05, 2022 5 - Production/Stable pytest (<8.*,>=6.*) :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest @@ -440,7 +444,7 @@ This list contains 985 plugins. :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jan 14, 2022 4 - Beta pytest :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A - :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 10, 2022 N/A N/A + :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 30, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A :pypi:`pytest-image-diff` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A @@ -450,7 +454,7 @@ This list contains 985 plugins. :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Sep 30, 2021 N/A N/A :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Jan 26, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-extensions` Inmanta tests package May 27, 2021 5 - Production/Stable N/A + :pypi:`pytest-inmanta-extensions` Inmanta tests package Feb 03, 2022 5 - Production/Stable N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Apr 07, 2021 N/A pytest (>=6.0.2,<7.0.0) :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) @@ -568,7 +572,7 @@ This list contains 985 plugins. :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Aug 12, 2021 N/A pytest (>=3.6) :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) - :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Mar 21, 2021 4 - Beta pytest (>=3.5) + :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Jan 30, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Jan 11, 2022 3 - Alpha pytest (>=6.0.0) :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A N/A @@ -603,14 +607,14 @@ This list contains 985 plugins. :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Jan 19, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Dec 06, 2021 N/A N/A + :pypi:`pytest-operator` Fixtures for Operators Jan 31, 2022 N/A N/A :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A :pypi:`pytest-order` pytest plugin to run your tests in a specific order Jan 09, 2022 4 - Beta pytest (>=5.0) ; python_version < "3.10" :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A - :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Dec 16, 2021 N/A N/A + :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Jan 31, 2022 N/A N/A :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A :pypi:`pytest-pahrametahrize` Parametrize your tests with a Boston accent. Nov 24, 2021 4 - Beta pytest (>=6.0,<7.0) :pypi:`pytest-parallel` a pytest plugin for parallel and concurrent testing Oct 10, 2021 3 - Alpha pytest (>=3.0.0) @@ -630,7 +634,7 @@ This list contains 985 plugins. :pypi:`pytest-pep257` py.test plugin for pep257 Jul 09, 2016 N/A N/A :pypi:`pytest-pep8` pytest plugin to check PEP8 requirements Apr 27, 2014 N/A N/A :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) - :pypi:`pytest-perf` pytest-perf Jan 08, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-perf` pytest-perf Feb 05, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) :pypi:`pytest-persistence` Pytest tool for persistent objects Dec 07, 2021 N/A N/A :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 18, 2022 5 - Production/Stable pytest (>=6.0.0) @@ -666,13 +670,14 @@ This list contains 985 plugins. :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Dec 22, 2021 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) - :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 25, 2022 N/A pytest (>=3.4.1) + :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 31, 2022 N/A pytest (>=3.4.1) :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Dec 28, 2021 5 - Production/Stable pytest (>=6) :pypi:`pytest-profiles` pytest plugin for configuration profiles Dec 09, 2021 4 - Beta pytest (>=3.7.0) :pypi:`pytest-profiling` Profiling plugin for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-progress` pytest plugin for instant test progress status Nov 09, 2021 5 - Production/Stable pytest (>=2.7) + :pypi:`pytest-progress` pytest plugin for instant test progress status Jan 31, 2022 5 - Production/Stable N/A :pypi:`pytest-prometheus` Report test pass / failures to a Prometheus PushGateway Oct 03, 2017 N/A N/A + :pypi:`pytest-prometheus-pushgateway` Pytest report plugin for Zulip Jan 31, 2022 5 - Production/Stable pytest :pypi:`pytest-prosper` Test helpers for Prosper projects Sep 24, 2018 N/A N/A :pypi:`pytest-pspec` A rspec format reporter for Python ptest Jun 02, 2020 4 - Beta pytest (>=3.0.0) :pypi:`pytest-psqlgraph` pytest plugin for testing applications that use psqlgraph Oct 19, 2021 4 - Beta pytest (>=6.0) @@ -706,6 +711,7 @@ This list contains 985 plugins. :pypi:`pytest-rabbitmq` RabbitMQ process and client fixtures for pytest Jun 02, 2021 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-race` Race conditions tester for pytest Nov 21, 2016 4 - Beta N/A :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A + :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results Feb 04, 2022 N/A pytest (>=3.6) :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Dec 02, 2021 5 - Production/Stable pytest :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) :pypi:`pytest-raisesregexp` Simple pytest plugin to look for regex in Exceptions Dec 18, 2015 N/A N/A @@ -754,7 +760,7 @@ This list contains 985 plugins. :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Jan 20, 2022 N/A N/A :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Oct 10, 2020 5 - Production/Stable N/A + :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Feb 04, 2022 5 - Production/Stable N/A :pypi:`pytest-responses` py.test integration for responses Apr 26, 2021 N/A pytest (>=2.5) :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed Jan 10, 2022 5 - Production/Stable pytest :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A @@ -780,13 +786,13 @@ This list contains 985 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jan 27, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Feb 04, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Aug 31, 2020 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jan 27, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Feb 04, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -800,7 +806,7 @@ This list contains 985 plugins. :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Nov 07, 2021 N/A N/A - :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Jan 25, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Feb 05, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 5 - Production/Stable pytest (>=3.5.1) :pypi:`pytest-shortcuts` Expand command-line shortcuts listed in pytest configuration Oct 29, 2020 4 - Beta pytest (>=3.5.0) @@ -809,7 +815,7 @@ This list contains 985 plugins. :pypi:`pytest-simple-plugin` Simple pytest plugin Nov 27, 2019 N/A N/A :pypi:`pytest-simple-settings` simple-settings plugin for pytest Nov 17, 2020 4 - Beta pytest :pypi:`pytest-single-file-logging` Allow for multiple processes to log to a single file May 05, 2016 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-skip-markers` Pytest Salt Plugin Jan 26, 2022 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-skip-markers` Pytest Salt Plugin Feb 05, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-skipper` A plugin that selects only tests with changes in execution path Mar 26, 2017 3 - Alpha pytest (>=3.0.6) :pypi:`pytest-skippy` Automatically skip tests that don't need to run! Jan 27, 2018 3 - Alpha pytest (>=2.3.4) :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A @@ -871,6 +877,7 @@ This list contains 985 plugins. :pypi:`pytest-svn` SVN repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-symbols` pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. Nov 20, 2017 3 - Alpha N/A :pypi:`pytest-system-statistics` Pytest plugin to track and report system usage statistics Jan 26, 2022 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-system-test-plugin` Pyst - Pytest System-Test Plugin Feb 03, 2022 N/A N/A :pypi:`pytest-takeltest` Fixtures for ansible, testinfra and molecule Jan 04, 2022 N/A N/A :pypi:`pytest-talisker` Nov 28, 2021 N/A N/A :pypi:`pytest-tap` Test Anything Protocol (TAP) reporting plugin for pytest Oct 27, 2021 5 - Production/Stable pytest (>=3.0) @@ -889,7 +896,7 @@ This list contains 985 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Dec 07, 2021 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Oct 22, 2021 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Feb 05, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) @@ -937,9 +944,11 @@ This list contains 985 plugins. :pypi:`pytest-trepan` Pytest plugin for trepan debugger. Jul 28, 2018 5 - Production/Stable N/A :pypi:`pytest-trialtemp` py.test plugin for using the same _trial_temp working directory as trial Jun 08, 2015 N/A N/A :pypi:`pytest-trio` Pytest plugin for trio Oct 16, 2020 N/A N/A + :pypi:`pytest-trytond` Pytest plugin for the Tryton server framework Feb 02, 2022 3 - Alpha pytest (>=5) :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 5 - Production/Stable pytest (>=2.3) + :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Nov 03, 2021 4 - Beta N/A :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) :pypi:`pytest-ubersmith` Easily mock calls to ubersmith at the \`requests\` level. Apr 13, 2015 N/A N/A @@ -1001,8 +1010,9 @@ This list contains 985 plugins. :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A - :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Dec 02, 2021 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Feb 02, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) + :pypi:`pytest-zulip` Pytest report plugin for Zulip Jan 31, 2022 5 - Production/Stable pytest =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ .. only:: latex @@ -1016,7 +1026,7 @@ This list contains 985 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: Jan 27, 2022, + *last release*: Feb 01, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1422,7 +1432,7 @@ This list contains 985 plugins. pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. :pypi:`pytest-automock` - *last release*: Apr 22, 2020, + *last release*: Feb 01, 2022, *status*: N/A, *requires*: pytest ; extra == 'dev' @@ -1757,6 +1767,13 @@ This list contains 985 plugins. Pytest plugin to only run tests affected by changes + :pypi:`pytest-cairo` + *last release*: Feb 04, 2022, + *status*: N/A, + *requires*: pytest + + + :pypi:`pytest-camel-collect` *last release*: Aug 02, 2020, *status*: N/A, @@ -1785,13 +1802,6 @@ This list contains 985 plugins. pytest plugin to capture all deprecatedwarnings and put them in one file - :pypi:`pytest-capturelogs` - *last release*: Sep 11, 2021, - *status*: 3 - Alpha, - *requires*: N/A - - A sample Python project - :pypi:`pytest-cases` *last release*: Jan 07, 2022, *status*: 5 - Production/Stable, @@ -2052,7 +2062,7 @@ This list contains 985 plugins. pytest plugin with fixtures for testing consul aware apps :pypi:`pytest-container` - *last release*: Nov 19, 2021, + *last release*: Feb 01, 2022, *status*: 3 - Alpha, *requires*: pytest (>=3.10) @@ -2352,6 +2362,13 @@ This list contains 985 plugins. A pytest plugin for testing dbt adapter plugins + :pypi:`pytest-dbt-conventions` + *last release*: Feb 04, 2022, + *status*: N/A, + *requires*: pytest (>=6.2.5,<7.0.0) + + A pytest plugin for linting a dbt project's conventions + :pypi:`pytest-dbt-core` *last release*: Jan 28, 2022, *status*: N/A, @@ -2612,8 +2629,8 @@ This list contains 985 plugins. py.test plugin for reporting the number of SQLs executed per django testcase. :pypi:`pytest-django-testing-postgresql` - *last release*: Dec 05, 2019, - *status*: 3 - Alpha, + *last release*: Jan 31, 2022, + *status*: 4 - Beta, *requires*: N/A Use a temporary PostgreSQL database with pytest-django @@ -2688,6 +2705,13 @@ This list contains 985 plugins. Pytest fixtures for testing with git scm. + :pypi:`pytest-docker-haproxy-fixtures` + *last release*: Feb 01, 2022, + *status*: 4 - Beta, + *requires*: pytest + + Pytest fixtures for testing with haproxy. + :pypi:`pytest-docker-pexpect` *last release*: Jan 14, 2019, *status*: N/A, @@ -2710,12 +2734,19 @@ This list contains 985 plugins. Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. :pypi:`pytest-docker-registry-fixtures` - *last release*: Mar 04, 2021, + *last release*: Feb 01, 2022, *status*: 4 - Beta, *requires*: pytest Pytest fixtures for testing with docker registries. + :pypi:`pytest-docker-squid-fixtures` + *last release*: Feb 04, 2022, + *status*: 4 - Beta, + *requires*: pytest + + Pytest fixtures for testing with squid. + :pypi:`pytest-docker-tools` *last release*: Jul 23, 2021, *status*: 4 - Beta, @@ -3109,7 +3140,7 @@ This list contains 985 plugins. Applies eventlet monkey-patch as a pytest plugin. :pypi:`pytest-excel` - *last release*: Oct 06, 2020, + *last release*: Jan 31, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -3795,7 +3826,7 @@ This list contains 985 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jan 29, 2022, + *last release*: Feb 05, 2022, *status*: 3 - Alpha, *requires*: pytest (==6.2.5) @@ -3850,6 +3881,13 @@ This list contains 985 plugins. optimized pytest plugin for generating HTML reports + :pypi:`pytest-html-object-storage` + *last release*: Jan 31, 2022, + *status*: 5 - Production/Stable, + *requires*: N/A + + Pytest report plugin for send HTML report on object-storage + :pypi:`pytest-html-profiling` *last release*: Feb 11, 2020, *status*: 5 - Production/Stable, @@ -3907,9 +3945,9 @@ This list contains 985 plugins. pytest-httpserver is a httpserver for pytest :pypi:`pytest-httpx` - *last release*: Jan 26, 2022, + *last release*: Feb 05, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (==6.*) + *requires*: pytest (<8.*,>=6.*) Send responses to httpx. @@ -3963,7 +4001,7 @@ This list contains 985 plugins. A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api :pypi:`pytest-idempotent` - *last release*: Jan 10, 2022, + *last release*: Jan 30, 2022, *status*: N/A, *requires*: N/A @@ -4033,7 +4071,7 @@ This list contains 985 plugins. A py.test plugin providing fixtures to simplify inmanta modules testing. :pypi:`pytest-inmanta-extensions` - *last release*: May 27, 2021, + *last release*: Feb 03, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4859,9 +4897,9 @@ This list contains 985 plugins. Add the mutation testing feature to pytest :pypi:`pytest-mypy` - *last release*: Mar 21, 2021, + *last release*: Jan 30, 2022, *status*: 4 - Beta, - *requires*: pytest (>=3.5) + *requires*: pytest (>=6.2) ; python_version >= "3.10" Mypy static type checker plugin for Pytest @@ -5104,7 +5142,7 @@ This list contains 985 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: Dec 06, 2021, + *last release*: Jan 31, 2022, *status*: N/A, *requires*: N/A @@ -5153,7 +5191,7 @@ This list contains 985 plugins. OS X notifications for py.test results. :pypi:`pytest-otel` - *last release*: Dec 16, 2021, + *last release*: Jan 31, 2022, *status*: N/A, *requires*: N/A @@ -5293,7 +5331,7 @@ This list contains 985 plugins. Change the exit code of pytest test sessions when a required percent of tests pass. :pypi:`pytest-perf` - *last release*: Jan 08, 2022, + *last release*: Feb 05, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6) ; extra == 'testing' @@ -5545,7 +5583,7 @@ This list contains 985 plugins. pytest plugin with powerful fixtures :pypi:`pytest-pretty-terminal` - *last release*: Jan 25, 2022, + *last release*: Jan 31, 2022, *status*: N/A, *requires*: pytest (>=3.4.1) @@ -5580,9 +5618,9 @@ This list contains 985 plugins. Profiling plugin for py.test :pypi:`pytest-progress` - *last release*: Nov 09, 2021, + *last release*: Jan 31, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=2.7) + *requires*: N/A pytest plugin for instant test progress status @@ -5593,6 +5631,13 @@ This list contains 985 plugins. Report test pass / failures to a Prometheus PushGateway + :pypi:`pytest-prometheus-pushgateway` + *last release*: Jan 31, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest + + Pytest report plugin for Zulip + :pypi:`pytest-prosper` *last release*: Sep 24, 2018, *status*: N/A, @@ -5824,6 +5869,13 @@ This list contains 985 plugins. pytest plugin to implement PEP712 + :pypi:`pytest-rail` + *last release*: Feb 04, 2022, + *status*: N/A, + *requires*: pytest (>=3.6) + + pytest plugin for creating TestRail runs and adding results + :pypi:`pytest-railflow-testrail-reporter` *last release*: Dec 02, 2021, *status*: 5 - Production/Stable, @@ -6161,7 +6213,7 @@ This list contains 985 plugins. Provides path for uniform access to test resources in isolated directory :pypi:`pytest-responsemock` - *last release*: Oct 10, 2020, + *last release*: Feb 04, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6343,7 +6395,7 @@ This list contains 985 plugins. :pypi:`pytest-sbase` - *last release*: Jan 27, 2022, + *last release*: Feb 04, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6385,7 +6437,7 @@ This list contains 985 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Jan 27, 2022, + *last release*: Feb 04, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6483,7 +6535,7 @@ This list contains 985 plugins. A pytest plugin to help with testing shell scripts / black box commands :pypi:`pytest-shell-utilities` - *last release*: Jan 25, 2022, + *last release*: Feb 05, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6546,7 +6598,7 @@ This list contains 985 plugins. Allow for multiple processes to log to a single file :pypi:`pytest-skip-markers` - *last release*: Jan 26, 2022, + *last release*: Feb 05, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.0.0) @@ -6979,6 +7031,13 @@ This list contains 985 plugins. Pytest plugin to track and report system usage statistics + :pypi:`pytest-system-test-plugin` + *last release*: Feb 03, 2022, + *status*: N/A, + *requires*: N/A + + Pyst - Pytest System-Test Plugin + :pypi:`pytest-takeltest` *last release*: Jan 04, 2022, *status*: N/A, @@ -7106,7 +7165,7 @@ This list contains 985 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Oct 22, 2021, + *last release*: Feb 05, 2022, *status*: 4 - Beta, *requires*: N/A @@ -7441,6 +7500,13 @@ This list contains 985 plugins. Pytest plugin for trio + :pypi:`pytest-trytond` + *last release*: Feb 02, 2022, + *status*: 3 - Alpha, + *requires*: pytest (>=5) + + Pytest plugin for the Tryton server framework + :pypi:`pytest-tspwplib` *last release*: Jan 08, 2021, *status*: 4 - Beta, @@ -7462,6 +7528,13 @@ This list contains 985 plugins. A twisted plugin for pytest. + :pypi:`pytest-typechecker` + *last release*: Feb 04, 2022, + *status*: N/A, + *requires*: pytest (>=6.2.5,<7.0.0) + + Run type checkers on specified test files + :pypi:`pytest-typhoon-xray` *last release*: Nov 03, 2021, *status*: 4 - Beta, @@ -7890,7 +7963,7 @@ This list contains 985 plugins. OWASP ZAP plugin for py.test. :pypi:`pytest-zebrunner` - *last release*: Dec 02, 2021, + *last release*: Feb 02, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.5.0) @@ -7902,3 +7975,10 @@ This list contains 985 plugins. *requires*: pytest (~=3.6) Extend py.test for RPC OpenStack testing. + + :pypi:`pytest-zulip` + *last release*: Jan 31, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest + + Pytest report plugin for Zulip From b3692fe40463a81f83f75f4a9e1a68b332b94aea Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 7 Feb 2022 15:10:03 -0500 Subject: [PATCH 126/549] work around test pollution caused by new setuptools mutating global logger level --- testing/test_doctest.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/testing/test_doctest.py b/testing/test_doctest.py index e85f44f93f4..c2c83272079 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -802,11 +802,12 @@ def test_valid_setup_py(self, pytester: Pytester): p = pytester.makepyfile( setup=""" from setuptools import setup, find_packages - setup(name='sample', - version='0.0', - description='description', - packages=find_packages() - ) + if __name__ == '__main__': + setup(name='sample', + version='0.0', + description='description', + packages=find_packages() + ) """ ) result = pytester.runpytest(p, "--doctest-modules") From 15ddccf700ad1318c083eeb543f1c1a419dd1e96 Mon Sep 17 00:00:00 2001 From: Elijah DeLee Date: Fri, 4 Feb 2022 16:06:32 -0500 Subject: [PATCH 127/549] importlib.readers not valid until python 3.10 This exists https://github.com/python/cpython/blob/3.10/Lib/importlib/readers.py and FileReader is in there This is a 404 https://github.com/python/cpython/blob/3.9/Lib/importlib/readers.py This change needs to get backported to the 7.0.z branch(s) too Fixes https://github.com/pytest-dev/pytest/issues/9608 --- src/_pytest/assertion/rewrite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index f0922870a4c..cc11e1d16ac 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -273,7 +273,7 @@ def get_data(self, pathname: Union[str, bytes]) -> bytes: with open(pathname, "rb") as f: return f.read() - if sys.version_info >= (3, 9): + if sys.version_info >= (3, 10): def get_resource_reader(self, name: str) -> importlib.abc.TraversableResources: # type: ignore from types import SimpleNamespace From 5f1a2f33daeab6a8efdc43bda8e5053a87aa47a8 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 4 Feb 2022 18:50:48 -0300 Subject: [PATCH 128/549] Fix invalid importing of `importlib.reader` in Python 3.9 Fix #9608 --- changelog/9608.bugfix.rst | 1 + src/_pytest/assertion/rewrite.py | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 changelog/9608.bugfix.rst diff --git a/changelog/9608.bugfix.rst b/changelog/9608.bugfix.rst new file mode 100644 index 00000000000..f6b02ef53f7 --- /dev/null +++ b/changelog/9608.bugfix.rst @@ -0,0 +1 @@ +Fix invalid importing of ``importlib.reader`` in Python 3.9. diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index cc11e1d16ac..ac461ba39b8 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -44,6 +44,8 @@ if TYPE_CHECKING: from _pytest.assertion import AssertionState +if sys.version_info >= (3, 10): + from importlib.readers import FileReader assertstate_key = StashKey["AssertionState"]() @@ -276,10 +278,7 @@ def get_data(self, pathname: Union[str, bytes]) -> bytes: if sys.version_info >= (3, 10): def get_resource_reader(self, name: str) -> importlib.abc.TraversableResources: # type: ignore - from types import SimpleNamespace - from importlib.readers import FileReader - - return FileReader(SimpleNamespace(path=self._rewritten_names[name])) + return FileReader(types.SimpleNamespace(path=self._rewritten_names[name])) def _write_pyc_fp( From 66dc79efd48e87a420072df44ecb087ff7797358 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 4 Feb 2022 18:56:44 -0300 Subject: [PATCH 129/549] Update changelog/9608.bugfix.rst Co-authored-by: Elijah DeLee --- changelog/9608.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/9608.bugfix.rst b/changelog/9608.bugfix.rst index f6b02ef53f7..4dda46becd2 100644 --- a/changelog/9608.bugfix.rst +++ b/changelog/9608.bugfix.rst @@ -1 +1 @@ -Fix invalid importing of ``importlib.reader`` in Python 3.9. +Fix invalid importing of ``importlib.readers`` in Python 3.9. From f86a87a315d6130bdc9cbc19e4fefcf69836d813 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 4 Feb 2022 19:07:52 -0300 Subject: [PATCH 130/549] Update src/_pytest/assertion/rewrite.py Co-authored-by: Ran Benita --- src/_pytest/assertion/rewrite.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index ac461ba39b8..f4a08a065b2 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -44,7 +44,9 @@ if TYPE_CHECKING: from _pytest.assertion import AssertionState -if sys.version_info >= (3, 10): +if sys.version_info >= (3, 11): + from importlib.resources.readers import FileReader +elif sys.version_info >= (3, 10): from importlib.readers import FileReader assertstate_key = StashKey["AssertionState"]() From d45a19cfdeb0afc767bb641522a436a00903e1ca Mon Sep 17 00:00:00 2001 From: Elijah DeLee Date: Mon, 7 Feb 2022 11:39:19 -0500 Subject: [PATCH 131/549] move function specific imports to function re: review from @asottile that this should only get imported in the function modify the else/if logic since inside the function we already know the python version is >= 3.10, and just have to know if it is 3.11 or greater --- src/_pytest/assertion/rewrite.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index f4a08a065b2..eac7bb79ee8 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -43,11 +43,7 @@ if TYPE_CHECKING: from _pytest.assertion import AssertionState - -if sys.version_info >= (3, 11): - from importlib.resources.readers import FileReader -elif sys.version_info >= (3, 10): - from importlib.readers import FileReader + assertstate_key = StashKey["AssertionState"]() @@ -280,6 +276,11 @@ def get_data(self, pathname: Union[str, bytes]) -> bytes: if sys.version_info >= (3, 10): def get_resource_reader(self, name: str) -> importlib.abc.TraversableResources: # type: ignore + if sys.version_info < (3, 11): + from importlib.readers import FileReader + else: + from importlib.resources.readers import FileReader + return FileReader(types.SimpleNamespace(path=self._rewritten_names[name])) From 2073cce10518c4f04ee5c5d8a7b6697cbbb3688e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Feb 2022 16:40:52 +0000 Subject: [PATCH 132/549] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytest/assertion/rewrite.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index eac7bb79ee8..81096764e04 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -43,7 +43,7 @@ if TYPE_CHECKING: from _pytest.assertion import AssertionState - + assertstate_key = StashKey["AssertionState"]() @@ -280,7 +280,7 @@ def get_resource_reader(self, name: str) -> importlib.abc.TraversableResources: from importlib.readers import FileReader else: from importlib.resources.readers import FileReader - + return FileReader(types.SimpleNamespace(path=self._rewritten_names[name])) From d00ca3f8e57c38b77b554d9826181f45de714ba6 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 7 Feb 2022 00:25:32 +0200 Subject: [PATCH 133/549] unittest: restore `UnitTestFunction.obj` to return unbound rather than bound method This fixes #9610. pytest 7.0.0 (unintentionally) changed `UnitTestFunction.obj`'s' behavior to match `Function.obj`. That is probably a good thing to have, however it evidently causes some regressions as described in the issue, so restore the previous behavior for now. In the future we might want to make this change again, but with proper consideration. --- changelog/9610.bugfix.rst | 3 +++ src/_pytest/unittest.py | 9 +++++++++ testing/test_unittest.py | 26 ++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 changelog/9610.bugfix.rst diff --git a/changelog/9610.bugfix.rst b/changelog/9610.bugfix.rst new file mode 100644 index 00000000000..c8c89c0c961 --- /dev/null +++ b/changelog/9610.bugfix.rst @@ -0,0 +1,3 @@ +Restore `UnitTestFunction.obj` to return unbound rather than bound method. +Fixes a crash during a failed teardown in unittest TestCases with non-default `__init__`. +Regressed in pytest 7.0.0. diff --git a/src/_pytest/unittest.py b/src/_pytest/unittest.py index a05c3b4bc43..851e4943b23 100644 --- a/src/_pytest/unittest.py +++ b/src/_pytest/unittest.py @@ -185,6 +185,15 @@ class TestCaseFunction(Function): _excinfo: Optional[List[_pytest._code.ExceptionInfo[BaseException]]] = None _testcase: Optional["unittest.TestCase"] = None + def _getobj(self): + assert self.parent is not None + # Unlike a regular Function in a Class, where `item.obj` returns + # a *bound* method (attached to an instance), TestCaseFunction's + # `obj` returns an *unbound* method (not attached to an instance). + # This inconsistency is probably not desirable, but needs some + # consideration before changing. + return getattr(self.parent.obj, self.originalname) # type: ignore[attr-defined] + def setup(self) -> None: # A bound method to be called during teardown() if set (see 'runtest()'). self._explicit_tearDown: Optional[Callable[[], None]] = None diff --git a/testing/test_unittest.py b/testing/test_unittest.py index 12bcb9361a4..1601086d5b2 100644 --- a/testing/test_unittest.py +++ b/testing/test_unittest.py @@ -1472,3 +1472,29 @@ def test_cleanup_called_the_right_number_of_times(): passed, skipped, failed = reprec.countoutcomes() assert failed == 2 assert passed == 1 + + +def test_traceback_pruning(pytester: Pytester) -> None: + """Regression test for #9610 - doesn't crash during traceback pruning.""" + pytester.makepyfile( + """ + import unittest + + class MyTestCase(unittest.TestCase): + def __init__(self, test_method): + unittest.TestCase.__init__(self, test_method) + + class TestIt(MyTestCase): + @classmethod + def tearDownClass(cls) -> None: + assert False + + def test_it(self): + pass + """ + ) + reprec = pytester.inline_run() + passed, skipped, failed = reprec.countoutcomes() + assert passed == 1 + assert failed == 1 + assert reprec.ret == 1 From 1612d3d1af1b96517d47efabf60f171553c5479d Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 7 Feb 2022 21:32:02 +0200 Subject: [PATCH 134/549] doc: remove django intersphinx mapping Initially I just wanted to fix http -> https, but I think it's not worth having at all just for this one reference. --- doc/en/conf.py | 5 ----- doc/en/how-to/plugins.rst | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/doc/en/conf.py b/doc/en/conf.py index b316163532a..1adc3493ad5 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -382,7 +382,6 @@ ] -# Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { "pluggy": ("https://pluggy.readthedocs.io/en/stable", None), "python": ("https://docs.python.org/3", None), @@ -390,10 +389,6 @@ "pip": ("https://pip.pypa.io/en/stable", None), "tox": ("https://tox.wiki/en/stable", None), "virtualenv": ("https://virtualenv.pypa.io/en/stable", None), - "django": ( - "http://docs.djangoproject.com/en/stable", - "http://docs.djangoproject.com/en/stable/_objects", - ), "setuptools": ("https://setuptools.pypa.io/en/stable", None), } diff --git a/doc/en/how-to/plugins.rst b/doc/en/how-to/plugins.rst index de31bc04a86..7a1948410e4 100644 --- a/doc/en/how-to/plugins.rst +++ b/doc/en/how-to/plugins.rst @@ -21,7 +21,7 @@ there is no need to activate it. Here is a little annotated list for some popular plugins: * :pypi:`pytest-django`: write tests - for :std:doc:`django ` apps, using pytest integration. + for `django `_ apps, using pytest integration. * :pypi:`pytest-twisted`: write tests for `twisted `_ apps, starting a reactor and From ef7d67b66550df80b800b30165ed7dee6ae82261 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Feb 2022 22:47:20 +0000 Subject: [PATCH 135/549] build(deps): Bump django in /testing/plugins_integration Bumps [django](https://github.com/django/django) from 4.0.1 to 4.0.2. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/4.0.1...4.0.2) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 8c5d69ff19a..f75460f02a8 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.5.0 -django==4.0.1 +django==4.0.2 pytest-asyncio==0.17.2 pytest-bdd==5.0.0 pytest-cov==3.0.0 From b80472c5bc41144335a49dc5f4b26949ffd8128f Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 8 Feb 2022 00:52:42 +0200 Subject: [PATCH 136/549] doc: fix a reference --- doc/en/deprecations.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index d9fb4d6b04e..4eaa80e2f27 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -16,7 +16,7 @@ Deprecated Features ------------------- Below is a complete list of all pytest features which are considered deprecated. Using those features will issue -:class:`PytestWarning` or subclasses, which can be filtered using :ref:`standard warning filters `. +:class:`~pytest.PytestWarning` or subclasses, which can be filtered using :ref:`standard warning filters `. .. _instance-collector-deprecation: From 579785b6cd201b6cb4da6bdf9be6988db0d469b2 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 7 Feb 2022 19:29:01 -0500 Subject: [PATCH 137/549] fix test pollution in test_assertrewrite originally reproduced with this pollution set: ``` testing/test_assertrewrite.py::TestEarlyRewriteBailout::test_pattern_contains_subdirectories testing/test_assertrewrite.py::TestRewriteOnImport::test_remember_rewritten_modules ``` --- testing/test_assertrewrite.py | 20 +++++++++++--------- testing/test_doctest.py | 11 ++++++----- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index ae18b4be34a..8f18e89c94f 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -13,10 +13,12 @@ from pathlib import Path from typing import cast from typing import Dict +from typing import Generator from typing import List from typing import Mapping from typing import Optional from typing import Set +from unittest import mock import _pytest._code import pytest @@ -1376,7 +1378,7 @@ class TestEarlyRewriteBailout: @pytest.fixture def hook( self, pytestconfig, monkeypatch, pytester: Pytester - ) -> AssertionRewritingHook: + ) -> Generator[AssertionRewritingHook, None, None]: """Returns a patched AssertionRewritingHook instance so we can configure its initial paths and track if PathFinder.find_spec has been called. """ @@ -1397,11 +1399,11 @@ def spy_find_spec(name, path): hook = AssertionRewritingHook(pytestconfig) # use default patterns, otherwise we inherit pytest's testing config - hook.fnpats[:] = ["test_*.py", "*_test.py"] - monkeypatch.setattr(hook, "_find_spec", spy_find_spec) - hook.set_session(StubSession()) # type: ignore[arg-type] - pytester.syspathinsert() - return hook + with mock.patch.object(hook, "fnpats", ["test_*.py", "*_test.py"]): + monkeypatch.setattr(hook, "_find_spec", spy_find_spec) + hook.set_session(StubSession()) # type: ignore[arg-type] + pytester.syspathinsert() + yield hook def test_basic(self, pytester: Pytester, hook: AssertionRewritingHook) -> None: """ @@ -1451,9 +1453,9 @@ def test_simple_failure(): } ) pytester.syspathinsert("tests") - hook.fnpats[:] = ["tests/**.py"] - assert hook.find_spec("file") is not None - assert self.find_spec_calls == ["file"] + with mock.patch.object(hook, "fnpats", ["tests/**.py"]): + assert hook.find_spec("file") is not None + assert self.find_spec_calls == ["file"] @pytest.mark.skipif( sys.platform.startswith("win32"), reason="cannot remove cwd on Windows" diff --git a/testing/test_doctest.py b/testing/test_doctest.py index e85f44f93f4..c2c83272079 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -802,11 +802,12 @@ def test_valid_setup_py(self, pytester: Pytester): p = pytester.makepyfile( setup=""" from setuptools import setup, find_packages - setup(name='sample', - version='0.0', - description='description', - packages=find_packages() - ) + if __name__ == '__main__': + setup(name='sample', + version='0.0', + description='description', + packages=find_packages() + ) """ ) result = pytester.runpytest(p, "--doctest-modules") From 2442034a1eca53dae4b3141732660f3384b6d159 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 7 Feb 2022 20:17:14 -0500 Subject: [PATCH 138/549] allow running testids which contain :: in the parametrized portion --- changelog/9642.bugfix.rst | 1 + src/_pytest/main.py | 5 ++++- testing/test_main.py | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 changelog/9642.bugfix.rst diff --git a/changelog/9642.bugfix.rst b/changelog/9642.bugfix.rst new file mode 100644 index 00000000000..0b3c2050c51 --- /dev/null +++ b/changelog/9642.bugfix.rst @@ -0,0 +1 @@ +Fix running tests by id with ``::`` in the parametrize portion. diff --git a/src/_pytest/main.py b/src/_pytest/main.py index afe613fd0d9..8f590754ae0 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -870,7 +870,10 @@ def resolve_collection_argument( If the path doesn't exist, raise UsageError. If the path is a directory and selection parts are present, raise UsageError. """ - strpath, *parts = str(arg).split("::") + base, squacket, rest = str(arg).partition("[") + strpath, *parts = base.split("::") + if parts: + parts[-1] = f"{parts[-1]}{squacket}{rest}" if as_pypath: strpath = search_pypath(strpath) fspath = invocation_path / strpath diff --git a/testing/test_main.py b/testing/test_main.py index 6a13633f6a9..926715a8c47 100644 --- a/testing/test_main.py +++ b/testing/test_main.py @@ -171,6 +171,12 @@ def test_pypath(self, invocation_path: Path) -> None: invocation_path, "pkg::foo::bar", as_pypath=True ) + def test_parametrized_name_with_colons(self, invocation_path: Path) -> None: + ret = resolve_collection_argument( + invocation_path, "src/pkg/test.py::test[a::b]" + ) + assert ret == (invocation_path / "src/pkg/test.py", ["test[a::b]"]) + def test_does_not_exist(self, invocation_path: Path) -> None: """Given a file/module that does not exist raises UsageError.""" with pytest.raises( From 01e1de7a1a79eeac67cf970e84532c2a99839476 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 9 Feb 2022 09:58:38 +0200 Subject: [PATCH 139/549] Rename ``pythonpath`` plugin to ``python_path`` Fix #9636. --- changelog/9636.bugfix.rst | 1 + src/_pytest/config/__init__.py | 2 +- src/_pytest/{pythonpath.py => python_path.py} | 0 testing/test_config.py | 2 +- testing/{test_pythonpath.py => test_python_path.py} | 2 +- 5 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 changelog/9636.bugfix.rst rename src/_pytest/{pythonpath.py => python_path.py} (100%) rename testing/{test_pythonpath.py => test_python_path.py} (98%) diff --git a/changelog/9636.bugfix.rst b/changelog/9636.bugfix.rst new file mode 100644 index 00000000000..2288c37ffc7 --- /dev/null +++ b/changelog/9636.bugfix.rst @@ -0,0 +1 @@ +The ``pythonpath`` plugin was renamed to ``python_path``. This avoids a conflict with the ``pytest-pythonpath`` plugin. diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 59c88885df5..f4818c861cf 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -254,7 +254,7 @@ def directory_arg(path: str, optname: str) -> str: "warnings", "logging", "reports", - "pythonpath", + "python_path", *(["unraisableexception", "threadexception"] if sys.version_info >= (3, 8) else []), "faulthandler", ) diff --git a/src/_pytest/pythonpath.py b/src/_pytest/python_path.py similarity index 100% rename from src/_pytest/pythonpath.py rename to src/_pytest/python_path.py diff --git a/testing/test_config.py b/testing/test_config.py index bf4b2741eca..8013966f071 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -1275,7 +1275,7 @@ def pytest_load_initial_conftests(self): ("_pytest.config", "nonwrapper"), (m.__module__, "nonwrapper"), ("_pytest.legacypath", "nonwrapper"), - ("_pytest.pythonpath", "nonwrapper"), + ("_pytest.python_path", "nonwrapper"), ("_pytest.capture", "wrapper"), ("_pytest.warnings", "wrapper"), ] diff --git a/testing/test_pythonpath.py b/testing/test_python_path.py similarity index 98% rename from testing/test_pythonpath.py rename to testing/test_python_path.py index 97c439ce0c3..5ee0f55e36a 100644 --- a/testing/test_pythonpath.py +++ b/testing/test_python_path.py @@ -81,7 +81,7 @@ def test_no_ini(pytester: Pytester, file_structure) -> None: def test_clean_up(pytester: Pytester) -> None: - """Test that the pythonpath plugin cleans up after itself.""" + """Test that the plugin cleans up after itself.""" # This is tough to test behaviorly because the cleanup really runs last. # So the test make several implementation assumptions: # - Cleanup is done in pytest_unconfigure(). From 6aaa017b1e81f6eccc48ee4f6b52d25c49747554 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 10 Feb 2022 08:58:20 +0100 Subject: [PATCH 140/549] doc: Discourage squashing for release (#9657) Fixes #9655 --- RELEASING.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASING.rst b/RELEASING.rst index 66775e7cfbb..b018dc48932 100644 --- a/RELEASING.rst +++ b/RELEASING.rst @@ -142,7 +142,7 @@ Both automatic and manual processes described above follow the same steps from t Wait for the deploy to complete, then make sure it is `available on PyPI `_. -#. Merge the PR. +#. Merge the PR. **Make sure it's not squash-merged**, so that the tagged commit ends up in the main branch. #. Cherry-pick the CHANGELOG / announce files to the ``main`` branch:: From 88c35123b8a9e802aa75f80de2953bce3224802a Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 8 Feb 2022 10:32:21 -0300 Subject: [PATCH 141/549] Delay warning about collector/item diamond inheritance This allows that warning to be filtered by `filterwarnings`. Fix #9643 --- changelog/9643.bugfix.rst | 2 ++ src/_pytest/nodes.py | 45 +++++++++++++++++++++++++++------------ testing/test_nodes.py | 29 ++++++++++++++----------- 3 files changed, 49 insertions(+), 27 deletions(-) create mode 100644 changelog/9643.bugfix.rst diff --git a/changelog/9643.bugfix.rst b/changelog/9643.bugfix.rst new file mode 100644 index 00000000000..24ca81182ed --- /dev/null +++ b/changelog/9643.bugfix.rst @@ -0,0 +1,2 @@ +Delay issuing a :class:`~pytest.PytestWarning` about diamond inheritance involving :class:`~pytest.Item` and +:class:`~pytest.Collector` so it can be filtered using :ref:`standard warning filters `. diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py index 6e8454ad7c6..e49c1b003e0 100644 --- a/src/_pytest/nodes.py +++ b/src/_pytest/nodes.py @@ -656,20 +656,6 @@ class Item(Node): nextitem = None - def __init_subclass__(cls) -> None: - problems = ", ".join( - base.__name__ for base in cls.__bases__ if issubclass(base, Collector) - ) - if problems: - warnings.warn( - f"{cls.__name__} is an Item subclass and should not be a collector, " - f"however its bases {problems} are collectors.\n" - "Please split the Collectors and the Item into separate node types.\n" - "Pytest Doc example: https://docs.pytest.org/en/latest/example/nonpython.html\n" - "example pull request on a plugin: https://github.com/asmeurer/pytest-flakes/pull/40/", - PytestWarning, - ) - def __init__( self, name, @@ -697,6 +683,37 @@ def __init__( #: for this test. self.user_properties: List[Tuple[str, object]] = [] + self._check_item_and_collector_diamond_inheritance() + + def _check_item_and_collector_diamond_inheritance(self) -> None: + """ + Check if the current type inherits from both File and Collector + at the same time, emitting a warning accordingly (#8447). + """ + cls = type(self) + + # We inject an attribute in the type to avoid issuing this warning + # for the same class more than once, which is not helpful. + # It is a hack, but was deemed acceptable in order to avoid + # flooding the user in the common case. + attr_name = "_pytest_diamond_inheritance_warning_shown" + if getattr(cls, attr_name, False): + return + setattr(cls, attr_name, True) + + problems = ", ".join( + base.__name__ for base in cls.__bases__ if issubclass(base, Collector) + ) + if problems: + warnings.warn( + f"{cls.__name__} is an Item subclass and should not be a collector, " + f"however its bases {problems} are collectors.\n" + "Please split the Collectors and the Item into separate node types.\n" + "Pytest Doc example: https://docs.pytest.org/en/latest/example/nonpython.html\n" + "example pull request on a plugin: https://github.com/asmeurer/pytest-flakes/pull/40/", + PytestWarning, + ) + def runtest(self) -> None: """Run the test case for this item. diff --git a/testing/test_nodes.py b/testing/test_nodes.py index c8afe0252be..df1439e1c49 100644 --- a/testing/test_nodes.py +++ b/testing/test_nodes.py @@ -1,3 +1,5 @@ +import re +import warnings from pathlib import Path from typing import cast from typing import List @@ -58,30 +60,31 @@ def test_subclassing_both_item_and_collector_deprecated( request, tmp_path: Path ) -> None: """ - Verifies we warn on diamond inheritance - as well as correctly managing legacy inheritance ctors with missing args - as found in plugins + Verifies we warn on diamond inheritance as well as correctly managing legacy + inheritance constructors with missing args as found in plugins. """ - with pytest.warns( - PytestWarning, - match=( - "(?m)SoWrong is an Item subclass and should not be a collector, however its bases File are collectors.\n" - "Please split the Collectors and the Item into separate node types.\n.*" - ), - ): + # We do not expect any warnings messages to issued during class definition. + with warnings.catch_warnings(): + warnings.simplefilter("error") class SoWrong(nodes.Item, nodes.File): def __init__(self, fspath, parent): """Legacy ctor with legacy call # don't wana see""" super().__init__(fspath, parent) - with pytest.warns( - PytestWarning, match=".*SoWrong.* not using a cooperative constructor.*" - ): + with pytest.warns(PytestWarning) as rec: SoWrong.from_parent( request.session, fspath=legacy_path(tmp_path / "broken.txt") ) + messages = [str(x.message) for x in rec] + assert any( + re.search(".*SoWrong.* not using a cooperative constructor.*", x) + for x in messages + ) + assert any( + re.search("(?m)SoWrong .* should not be a collector", x) for x in messages + ) @pytest.mark.parametrize( From 2b127394122aabb72d207d071388351989cc7a19 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Feb 2022 03:47:43 +0000 Subject: [PATCH 142/549] build(deps): Bump twisted in /testing/plugins_integration Bumps [twisted](https://github.com/twisted/twisted) from 21.7.0 to 22.1.0. - [Release notes](https://github.com/twisted/twisted/releases) - [Changelog](https://github.com/twisted/twisted/blob/trunk/NEWS.rst) - [Commits](https://github.com/twisted/twisted/compare/twisted-21.7.0...twisted-22.1.0) --- updated-dependencies: - dependency-name: twisted dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index f75460f02a8..3fb8ccf2947 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -11,5 +11,5 @@ pytest-rerunfailures==10.2 pytest-sugar==0.9.4 pytest-trio==0.7.0 pytest-twisted==1.13.4 -twisted==21.7.0 +twisted==22.1.0 pytest-xvfb==2.0.0 From be0c41bf8e45970ad3fcce751e8499b7387931ea Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Fri, 11 Feb 2022 13:49:11 +0200 Subject: [PATCH 143/549] CI: Test latest 3.10 available --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c8f216c4104..2c53ab23d17 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -75,7 +75,7 @@ jobs: os: windows-latest tox_env: "py39-xdist" - name: "windows-py310" - python: "3.10.1" + python: "3.10" os: windows-latest tox_env: "py310-xdist" @@ -101,7 +101,7 @@ jobs: os: ubuntu-latest tox_env: "py39-xdist" - name: "ubuntu-py310" - python: "3.10.1" + python: "3.10" os: ubuntu-latest tox_env: "py310-xdist" - name: "ubuntu-pypy3" From eb8a3ef8495f3d51bccd4830f927689c29e888e6 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Fri, 11 Feb 2022 14:03:22 +0200 Subject: [PATCH 144/549] Only update the plugin for upstream --- .github/workflows/update-plugin-list.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/update-plugin-list.yml b/.github/workflows/update-plugin-list.yml index 17c6364f4bd..193469072ff 100644 --- a/.github/workflows/update-plugin-list.yml +++ b/.github/workflows/update-plugin-list.yml @@ -12,6 +12,7 @@ permissions: {} jobs: createPullRequest: + if: github.repository_owner == 'pytest-dev' runs-on: ubuntu-latest permissions: contents: write From b79eff065ebbd3dd1c20cb06eb76cb6707a0c8d3 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 11 Feb 2022 12:20:42 -0300 Subject: [PATCH 145/549] Enable testing with Python 3.11 (#9511) --- .github/workflows/main.yml | 10 ++++++++++ testing/test_assertion.py | 16 +++++++++++----- testing/test_compat.py | 2 ++ testing/test_doctest.py | 2 ++ testing/test_main.py | 21 +++++++++++++++++++-- testing/test_pytester.py | 4 ++-- tox.ini | 1 + 7 files changed, 47 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c53ab23d17..a69b905683b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,6 +37,7 @@ jobs: "windows-py38", "windows-py39", "windows-py310", + "windows-py311", "ubuntu-py37", "ubuntu-py37-pluggy", @@ -44,6 +45,7 @@ jobs: "ubuntu-py38", "ubuntu-py39", "ubuntu-py310", + "ubuntu-py311", "ubuntu-pypy3", "macos-py37", @@ -78,6 +80,10 @@ jobs: python: "3.10" os: windows-latest tox_env: "py310-xdist" + - name: "windows-py311" + python: "3.11-dev" + os: windows-latest + tox_env: "py311" - name: "ubuntu-py37" python: "3.7" @@ -104,6 +110,10 @@ jobs: python: "3.10" os: ubuntu-latest tox_env: "py310-xdist" + - name: "ubuntu-py311" + python: "3.11-dev" + os: ubuntu-latest + tox_env: "py311" - name: "ubuntu-pypy3" python: "pypy-3.7" os: ubuntu-latest diff --git a/testing/test_assertion.py b/testing/test_assertion.py index 317a2beb388..d57cc26a350 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -1026,7 +1026,7 @@ def __eq__(self, other): # pragma: no cover assert lines is None def test_attrs_with_custom_eq(self) -> None: - @attr.define + @attr.define(slots=False) class SimpleDataObject: field_a = attr.ib() @@ -1648,7 +1648,7 @@ def test_raise_assertion_error(): ) -def test_raise_assertion_error_raisin_repr(pytester: Pytester) -> None: +def test_raise_assertion_error_raising_repr(pytester: Pytester) -> None: pytester.makepyfile( """ class RaisingRepr(object): @@ -1659,9 +1659,15 @@ def test_raising_repr(): """ ) result = pytester.runpytest() - result.stdout.fnmatch_lines( - ["E AssertionError: "] - ) + if sys.version_info >= (3, 11): + # python 3.11 has native support for un-str-able exceptions + result.stdout.fnmatch_lines( + ["E AssertionError: "] + ) + else: + result.stdout.fnmatch_lines( + ["E AssertionError: "] + ) def test_issue_1944(pytester: Pytester) -> None: diff --git a/testing/test_compat.py b/testing/test_compat.py index 88f0f33efc2..8a80fd625dc 100644 --- a/testing/test_compat.py +++ b/testing/test_compat.py @@ -1,4 +1,5 @@ import enum +import sys from functools import partial from functools import wraps from typing import TYPE_CHECKING @@ -91,6 +92,7 @@ def foo(x): assert get_real_func(partial(foo)) is foo +@pytest.mark.skipif(sys.version_info >= (3, 11), reason="couroutine removed") def test_is_generator_asyncio(pytester: Pytester) -> None: pytester.makepyfile( """ diff --git a/testing/test_doctest.py b/testing/test_doctest.py index c2c83272079..67b8ccdb7ec 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -1,4 +1,5 @@ import inspect +import sys import textwrap from pathlib import Path from typing import Callable @@ -200,6 +201,7 @@ def test_doctest_unexpected_exception(self, pytester: Pytester): "Traceback (most recent call last):", ' File "*/doctest.py", line *, in __run', " *", + *((" *^^^^*",) if sys.version_info >= (3, 11) else ()), ' File "", line 1, in ', "ZeroDivisionError: division by zero", "*/test_doctest_unexpected_exception.txt:2: UnexpectedException", diff --git a/testing/test_main.py b/testing/test_main.py index 926715a8c47..2df51bb7bb9 100644 --- a/testing/test_main.py +++ b/testing/test_main.py @@ -1,6 +1,7 @@ import argparse import os import re +import sys from pathlib import Path from typing import Optional @@ -44,16 +45,32 @@ def pytest_internalerror(excrepr, excinfo): assert result.ret == ExitCode.INTERNAL_ERROR assert result.stdout.lines[0] == "INTERNALERROR> Traceback (most recent call last):" + end_lines = ( + result.stdout.lines[-4:] + if sys.version_info >= (3, 11) + else result.stdout.lines[-3:] + ) + if exc == SystemExit: - assert result.stdout.lines[-3:] == [ + assert end_lines == [ f'INTERNALERROR> File "{c1}", line 4, in pytest_sessionstart', 'INTERNALERROR> raise SystemExit("boom")', + *( + ("INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^",) + if sys.version_info >= (3, 11) + else () + ), "INTERNALERROR> SystemExit: boom", ] else: - assert result.stdout.lines[-3:] == [ + assert end_lines == [ f'INTERNALERROR> File "{c1}", line 4, in pytest_sessionstart', 'INTERNALERROR> raise ValueError("boom")', + *( + ("INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^",) + if sys.version_info >= (3, 11) + else () + ), "INTERNALERROR> ValueError: boom", ] if returncode is False: diff --git a/testing/test_pytester.py b/testing/test_pytester.py index 9f7cf42b77c..049f8b22d81 100644 --- a/testing/test_pytester.py +++ b/testing/test_pytester.py @@ -743,8 +743,8 @@ def test_run_result_repr() -> None: # known exit code r = pytester_mod.RunResult(1, outlines, errlines, duration=0.5) - assert ( - repr(r) == "" ) diff --git a/tox.ini b/tox.ini index a1f4cab00e0..93c390ffc57 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,7 @@ envlist = py38 py39 py310 + py311 pypy3 py37-{pexpect,xdist,unittestextras,numpy,pluggymain} doctesting From 8afec9a64d7facc12a7f531f2cb597e6d787e051 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 11 Feb 2022 14:34:02 -0300 Subject: [PATCH 146/549] Add autoflake to pre-commit configuration (#9666) --- .pre-commit-config.yaml | 8 ++++++++ src/_pytest/python.py | 2 -- src/_pytest/python_api.py | 1 - testing/code/test_source.py | 3 --- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 125f5561db4..5de99c99aaf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,6 +20,14 @@ repos: - id: debug-statements exclude: _pytest/(debugging|hookspec).py language_version: python3 +- repo: https://github.com/myint/autoflake + rev: v1.4 + hooks: + - id: autoflake + name: autoflake + args: ["--in-place", "--remove-unused-variables", "--remove-all-unused-imports"] + language: python + files: \.py$ - repo: https://github.com/PyCQA/flake8 rev: 4.0.1 hooks: diff --git a/src/_pytest/python.py b/src/_pytest/python.py index f5b332e6831..23baa9a61f2 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -905,8 +905,6 @@ class InstanceDummy: only to ignore it; this dummy class keeps them working. This will be removed in pytest 8.""" - pass - def __getattr__(name: str) -> object: if name == "Instance": diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index cb72fde1e1f..9891946cd1e 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -131,7 +131,6 @@ def _check_type(self) -> None: # a numeric type. For this reason, the default is to do nothing. The # classes that deal with sequences should reimplement this method to # raise if there are any non-numeric elements in the sequence. - pass def _recursive_list_map(f, x): diff --git a/testing/code/test_source.py b/testing/code/test_source.py index fd2c9fc9719..52417f2f837 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -1,16 +1,13 @@ # flake8: noqa # disable flake check on this file because some constructs are strange # or redundant on purpose and can't be disable on a line-by-line basis -import ast import inspect import linecache import sys import textwrap from pathlib import Path -from types import CodeType from typing import Any from typing import Dict -from typing import Optional import pytest from _pytest._code import Code From 68be31916520c668c9caa3ddc25531709830ae89 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 11 Feb 2022 15:50:54 -0300 Subject: [PATCH 147/549] Merge pull request #9674 from pytest-dev/release-7.0.1 (cherry picked from commit 18d35b817de7a8a0b416eefbb54a323f9ba90d21) --- changelog/9608.bugfix.rst | 1 - changelog/9610.bugfix.rst | 3 --- changelog/9636.bugfix.rst | 1 - changelog/9642.bugfix.rst | 1 - changelog/9643.bugfix.rst | 2 -- doc/en/announce/index.rst | 1 + doc/en/announce/release-7.0.1.rst | 20 ++++++++++++++++++++ doc/en/changelog.rst | 24 ++++++++++++++++++++++++ doc/en/getting-started.rst | 2 +- 9 files changed, 46 insertions(+), 9 deletions(-) delete mode 100644 changelog/9608.bugfix.rst delete mode 100644 changelog/9610.bugfix.rst delete mode 100644 changelog/9636.bugfix.rst delete mode 100644 changelog/9642.bugfix.rst delete mode 100644 changelog/9643.bugfix.rst create mode 100644 doc/en/announce/release-7.0.1.rst diff --git a/changelog/9608.bugfix.rst b/changelog/9608.bugfix.rst deleted file mode 100644 index 4dda46becd2..00000000000 --- a/changelog/9608.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix invalid importing of ``importlib.readers`` in Python 3.9. diff --git a/changelog/9610.bugfix.rst b/changelog/9610.bugfix.rst deleted file mode 100644 index c8c89c0c961..00000000000 --- a/changelog/9610.bugfix.rst +++ /dev/null @@ -1,3 +0,0 @@ -Restore `UnitTestFunction.obj` to return unbound rather than bound method. -Fixes a crash during a failed teardown in unittest TestCases with non-default `__init__`. -Regressed in pytest 7.0.0. diff --git a/changelog/9636.bugfix.rst b/changelog/9636.bugfix.rst deleted file mode 100644 index 2288c37ffc7..00000000000 --- a/changelog/9636.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -The ``pythonpath`` plugin was renamed to ``python_path``. This avoids a conflict with the ``pytest-pythonpath`` plugin. diff --git a/changelog/9642.bugfix.rst b/changelog/9642.bugfix.rst deleted file mode 100644 index 0b3c2050c51..00000000000 --- a/changelog/9642.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix running tests by id with ``::`` in the parametrize portion. diff --git a/changelog/9643.bugfix.rst b/changelog/9643.bugfix.rst deleted file mode 100644 index 24ca81182ed..00000000000 --- a/changelog/9643.bugfix.rst +++ /dev/null @@ -1,2 +0,0 @@ -Delay issuing a :class:`~pytest.PytestWarning` about diamond inheritance involving :class:`~pytest.Item` and -:class:`~pytest.Collector` so it can be filtered using :ref:`standard warning filters `. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 75dde1bd6d9..9505b0b9e46 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-7.0.1 release-7.0.0 release-7.0.0rc1 release-6.2.5 diff --git a/doc/en/announce/release-7.0.1.rst b/doc/en/announce/release-7.0.1.rst new file mode 100644 index 00000000000..5accfbad0d4 --- /dev/null +++ b/doc/en/announce/release-7.0.1.rst @@ -0,0 +1,20 @@ +pytest-7.0.1 +======================================= + +pytest 7.0.1 has just been released to PyPI. + +This is a bug-fix release, being a drop-in replacement. To upgrade:: + + pip install --upgrade pytest + +The full changelog is available at https://docs.pytest.org/en/stable/changelog.html. + +Thanks to all of the contributors to this release: + +* Anthony Sottile +* Bruno Oliveira +* Ran Benita + + +Happy testing, +The pytest Development Team diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 9605d6bcf00..1acdad366da 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -28,6 +28,30 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 7.0.1 (2022-02-11) +========================= + +Bug Fixes +--------- + +- `#9608 `_: Fix invalid importing of ``importlib.readers`` in Python 3.9. + + +- `#9610 `_: Restore `UnitTestFunction.obj` to return unbound rather than bound method. + Fixes a crash during a failed teardown in unittest TestCases with non-default `__init__`. + Regressed in pytest 7.0.0. + + +- `#9636 `_: The ``pythonpath`` plugin was renamed to ``python_path``. This avoids a conflict with the ``pytest-pythonpath`` plugin. + + +- `#9642 `_: Fix running tests by id with ``::`` in the parametrize portion. + + +- `#9643 `_: Delay issuing a :class:`~pytest.PytestWarning` about diamond inheritance involving :class:`~pytest.Item` and + :class:`~pytest.Collector` so it can be filtered using :ref:`standard warning filters `. + + pytest 7.0.0 (2022-02-03) ========================= diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index 4c948843a9d..79b88ced9e1 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -22,7 +22,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 7.0.0 + pytest 7.0.1 .. _`simpletest`: From c3aa4647c742107b2b1acf41c24b29e8c4bc8f99 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 5 Feb 2022 12:25:48 +0200 Subject: [PATCH 148/549] python: unify code to generate ID from value In the following @pytest.mark.parametrize(..., ids=[val]) the ID values are only allowed to be `str`, `float`, `int` or `bool`. In the following @pytest.mark.parametrize(..., [val]) @pytest.mark.parametrize(..., [pytest.param(..., id=val]) a different code path is used, which also allows `bytes`, `complex`, `re.Pattern`, `Enum` and anything with a `__name__`. In the interest of consistency, use the latter code path for all cases. --- changelog/9678.improvement.rst | 3 ++ src/_pytest/fixtures.py | 41 +++++---------------- src/_pytest/python.py | 67 ++++++++++++++++++---------------- testing/python/metafunc.py | 53 +++++++++++++++++++-------- 4 files changed, 85 insertions(+), 79 deletions(-) create mode 100644 changelog/9678.improvement.rst diff --git a/changelog/9678.improvement.rst b/changelog/9678.improvement.rst new file mode 100644 index 00000000000..d7bb1083a4d --- /dev/null +++ b/changelog/9678.improvement.rst @@ -0,0 +1,3 @@ +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. diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index be03fb2a820..fba9085d0c1 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -939,10 +939,7 @@ def __init__( params: Optional[Sequence[object]], unittest: bool = False, ids: Optional[ - Union[ - Tuple[Union[None, str, float, int, bool], ...], - Callable[[Any], Optional[object]], - ] + Union[Tuple[Optional[object], ...], Callable[[Any], Optional[object]]] ] = None, ) -> None: self._fixturemanager = fixturemanager @@ -1093,18 +1090,8 @@ def pytest_fixture_setup( def _ensure_immutable_ids( - ids: Optional[ - Union[ - Iterable[Union[None, str, float, int, bool]], - Callable[[Any], Optional[object]], - ] - ], -) -> Optional[ - Union[ - Tuple[Union[None, str, float, int, bool], ...], - Callable[[Any], Optional[object]], - ] -]: + ids: Optional[Union[Sequence[Optional[object]], Callable[[Any], Optional[object]]]] +) -> Optional[Union[Tuple[Optional[object], ...], Callable[[Any], Optional[object]]]]: if ids is None: return None if callable(ids): @@ -1148,9 +1135,8 @@ class FixtureFunctionMarker: scope: "Union[_ScopeName, Callable[[str, Config], _ScopeName]]" params: Optional[Tuple[object, ...]] = attr.ib(converter=_params_converter) autouse: bool = False - ids: Union[ - Tuple[Union[None, str, float, int, bool], ...], - Callable[[Any], Optional[object]], + ids: Optional[ + Union[Tuple[Optional[object], ...], Callable[[Any], Optional[object]]] ] = attr.ib( default=None, converter=_ensure_immutable_ids, @@ -1191,10 +1177,7 @@ def fixture( params: Optional[Iterable[object]] = ..., autouse: bool = ..., ids: Optional[ - Union[ - Iterable[Union[None, str, float, int, bool]], - Callable[[Any], Optional[object]], - ] + Union[Sequence[Optional[object]], Callable[[Any], Optional[object]]] ] = ..., name: Optional[str] = ..., ) -> FixtureFunction: @@ -1209,10 +1192,7 @@ def fixture( params: Optional[Iterable[object]] = ..., autouse: bool = ..., ids: Optional[ - Union[ - Iterable[Union[None, str, float, int, bool]], - Callable[[Any], Optional[object]], - ] + Union[Sequence[Optional[object]], Callable[[Any], Optional[object]]] ] = ..., name: Optional[str] = None, ) -> FixtureFunctionMarker: @@ -1226,10 +1206,7 @@ def fixture( params: Optional[Iterable[object]] = None, autouse: bool = False, ids: Optional[ - Union[ - Iterable[Union[None, str, float, int, bool]], - Callable[[Any], Optional[object]], - ] + Union[Sequence[Optional[object]], Callable[[Any], Optional[object]]] ] = None, name: Optional[str] = None, ) -> Union[FixtureFunctionMarker, FixtureFunction]: @@ -1271,7 +1248,7 @@ def fixture( the fixture. :param ids: - List of string ids each corresponding to the params so that they are + Sequence of ids each corresponding to the params so that they are part of the test id. If no ids are provided they will be generated automatically from the params. diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 23baa9a61f2..cd951939e7a 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -940,7 +940,7 @@ class IdMaker: # ParameterSet. idfn: Optional[Callable[[Any], Optional[object]]] # Optionally, explicit IDs for ParameterSets by index. - ids: Optional[Sequence[Union[None, str]]] + ids: Optional[Sequence[Optional[object]]] # Optionally, the pytest config. # Used for controlling ASCII escaping, and for calling the # :hook:`pytest_make_parametrize_id` hook. @@ -948,6 +948,9 @@ class IdMaker: # Optionally, the ID of the node being parametrized. # Used only for clearer error messages. nodeid: Optional[str] + # Optionally, the ID of the function being parametrized. + # Used only for clearer error messages. + func_name: Optional[str] def make_unique_parameterset_ids(self) -> List[str]: """Make a unique identifier for each ParameterSet, that may be used to @@ -982,9 +985,7 @@ def _resolve_ids(self) -> Iterable[str]: yield parameterset.id elif self.ids and idx < len(self.ids) and self.ids[idx] is not None: # ID provided in the IDs list - parametrize(..., ids=[...]). - id = self.ids[idx] - assert id is not None - yield _ascii_escaped_by_config(id, self.config) + yield self._idval_from_value_required(self.ids[idx], idx) else: # ID not provided - generate it. yield "-".join( @@ -1053,6 +1054,25 @@ def _idval_from_value(self, val: object) -> Optional[str]: return name return None + def _idval_from_value_required(self, val: object, idx: int) -> str: + """Like _idval_from_value(), but fails if the type is not supported.""" + id = self._idval_from_value(val) + if id is not None: + return id + + # Fail. + if self.func_name is not None: + prefix = f"In {self.func_name}: " + elif self.nodeid is not None: + prefix = f"In {self.nodeid}: " + else: + prefix = "" + msg = ( + f"{prefix}ids contains unsupported value {saferepr(val)} (type: {type(val)!r}) at index {idx}. " + "Supported types are: str, bytes, int, float, complex, bool, enum, regex or anything with a __name__." + ) + fail(msg, pytrace=False) + @staticmethod def _idval_from_argname(argname: str, idx: int) -> str: """Make an ID for a parameter in a ParameterSet from the argument name @@ -1182,10 +1202,7 @@ def parametrize( argvalues: Iterable[Union[ParameterSet, Sequence[object], object]], indirect: Union[bool, Sequence[str]] = False, ids: Optional[ - Union[ - Iterable[Union[None, str, float, int, bool]], - Callable[[Any], Optional[object]], - ] + Union[Iterable[Optional[object]], Callable[[Any], Optional[object]]] ] = None, scope: "Optional[_ScopeName]" = None, *, @@ -1316,10 +1333,7 @@ def _resolve_parameter_set_ids( self, argnames: Sequence[str], ids: Optional[ - Union[ - Iterable[Union[None, str, float, int, bool]], - Callable[[Any], Optional[object]], - ] + Union[Iterable[Optional[object]], Callable[[Any], Optional[object]]] ], parametersets: Sequence[ParameterSet], nodeid: str, @@ -1349,16 +1363,22 @@ def _resolve_parameter_set_ids( idfn = None ids_ = self._validate_ids(ids, parametersets, self.function.__name__) id_maker = IdMaker( - argnames, parametersets, idfn, ids_, self.config, nodeid=nodeid + argnames, + parametersets, + idfn, + ids_, + self.config, + nodeid=nodeid, + func_name=self.function.__name__, ) return id_maker.make_unique_parameterset_ids() def _validate_ids( self, - ids: Iterable[Union[None, str, float, int, bool]], + ids: Iterable[Optional[object]], parametersets: Sequence[ParameterSet], func_name: str, - ) -> List[Union[None, str]]: + ) -> List[Optional[object]]: try: num_ids = len(ids) # type: ignore[arg-type] except TypeError: @@ -1373,22 +1393,7 @@ def _validate_ids( msg = "In {}: {} parameter sets specified, with different number of ids: {}" fail(msg.format(func_name, len(parametersets), num_ids), pytrace=False) - new_ids = [] - for idx, id_value in enumerate(itertools.islice(ids, num_ids)): - if id_value is None or isinstance(id_value, str): - new_ids.append(id_value) - elif isinstance(id_value, (float, int, bool)): - new_ids.append(str(id_value)) - else: - msg = ( # type: ignore[unreachable] - "In {}: ids must be list of string/float/int/bool, " - "found: {} (type: {!r}) at index {}" - ) - fail( - msg.format(func_name, saferepr(id_value), type(id_value), idx), - pytrace=False, - ) - return new_ids + return list(itertools.islice(ids, num_ids)) def _resolve_arg_value_types( self, diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index b6ad4a80924..2fed22718b0 100644 --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -106,8 +106,8 @@ def gen() -> Iterator[Union[int, None, Exc]]: with pytest.raises( fail.Exception, match=( - r"In func: ids must be list of string/float/int/bool, found:" - r" Exc\(from_gen\) \(type: \) at index 2" + r"In func: ids contains unsupported value Exc\(from_gen\) \(type: \) at index 2. " + r"Supported types are: .*" ), ): metafunc.parametrize("x", [1, 2, 3], ids=gen()) # type: ignore[arg-type] @@ -285,7 +285,7 @@ class A: deadline=400.0 ) # very close to std deadline and CI boxes are not reliable in CPU power def test_idval_hypothesis(self, value) -> None: - escaped = IdMaker([], [], None, None, None, None)._idval(value, "a", 6) + escaped = IdMaker([], [], None, None, None, None, None)._idval(value, "a", 6) assert isinstance(escaped, str) escaped.encode("ascii") @@ -308,7 +308,8 @@ def test_unicode_idval(self) -> None: ] for val, expected in values: assert ( - IdMaker([], [], None, None, None, None)._idval(val, "a", 6) == expected + IdMaker([], [], None, None, None, None, None)._idval(val, "a", 6) + == expected ) def test_unicode_idval_with_config(self) -> None: @@ -337,7 +338,7 @@ def getini(self, name): ("ação", MockConfig({option: False}), "a\\xe7\\xe3o"), ] for val, config, expected in values: - actual = IdMaker([], [], None, None, config, None)._idval(val, "a", 6) + actual = IdMaker([], [], None, None, config, None, None)._idval(val, "a", 6) assert actual == expected def test_bytes_idval(self) -> None: @@ -351,7 +352,8 @@ def test_bytes_idval(self) -> None: ] for val, expected in values: assert ( - IdMaker([], [], None, None, None, None)._idval(val, "a", 6) == expected + IdMaker([], [], None, None, None, None, None)._idval(val, "a", 6) + == expected ) def test_class_or_function_idval(self) -> None: @@ -367,7 +369,8 @@ def test_function(): values = [(TestClass, "TestClass"), (test_function, "test_function")] for val, expected in values: assert ( - IdMaker([], [], None, None, None, None)._idval(val, "a", 6) == expected + IdMaker([], [], None, None, None, None, None)._idval(val, "a", 6) + == expected ) def test_notset_idval(self) -> None: @@ -376,7 +379,9 @@ def test_notset_idval(self) -> None: Regression test for #7686. """ - assert IdMaker([], [], None, None, None, None)._idval(NOTSET, "a", 0) == "a0" + assert ( + IdMaker([], [], None, None, None, None, None)._idval(NOTSET, "a", 0) == "a0" + ) def test_idmaker_autoname(self) -> None: """#250""" @@ -387,6 +392,7 @@ def test_idmaker_autoname(self) -> None: None, None, None, + None, ).make_unique_parameterset_ids() assert result == ["string-1.0", "st-ring-2.0"] @@ -397,17 +403,18 @@ def test_idmaker_autoname(self) -> None: None, None, None, + None, ).make_unique_parameterset_ids() assert result == ["a0-1.0", "a1-b1"] # unicode mixing, issue250 result = IdMaker( - ("a", "b"), [pytest.param({}, b"\xc3\xb4")], None, None, None, None + ("a", "b"), [pytest.param({}, b"\xc3\xb4")], None, None, None, None, None ).make_unique_parameterset_ids() assert result == ["a0-\\xc3\\xb4"] def test_idmaker_with_bytes_regex(self) -> None: result = IdMaker( - ("a"), [pytest.param(re.compile(b"foo"), 1.0)], None, None, None, None + ("a"), [pytest.param(re.compile(b"foo"), 1.0)], None, None, None, None, None ).make_unique_parameterset_ids() assert result == ["foo"] @@ -433,6 +440,7 @@ def test_idmaker_native_strings(self) -> None: None, None, None, + None, ).make_unique_parameterset_ids() assert result == [ "1.0--1.1", @@ -465,6 +473,7 @@ def test_idmaker_non_printable_characters(self) -> None: None, None, None, + None, ).make_unique_parameterset_ids() assert result == ["\\x00-1", "\\x05-2", "\\x00-3", "\\x05-4", "\\t-5", "\\t-6"] @@ -479,6 +488,7 @@ def test_idmaker_manual_ids_must_be_printable(self) -> None: None, None, None, + None, ).make_unique_parameterset_ids() assert result == ["hello \\x00", "hello \\x05"] @@ -486,7 +496,7 @@ def test_idmaker_enum(self) -> None: enum = pytest.importorskip("enum") e = enum.Enum("Foo", "one, two") result = IdMaker( - ("a", "b"), [pytest.param(e.one, e.two)], None, None, None, None + ("a", "b"), [pytest.param(e.one, e.two)], None, None, None, None, None ).make_unique_parameterset_ids() assert result == ["Foo.one-Foo.two"] @@ -509,6 +519,7 @@ def ids(val: object) -> Optional[str]: None, None, None, + None, ).make_unique_parameterset_ids() assert result == ["10.0-IndexError()", "20-KeyError()", "three-b2"] @@ -529,6 +540,7 @@ def ids(val: object) -> str: None, None, None, + None, ).make_unique_parameterset_ids() assert result == ["a-a0", "a-a1", "a-a2"] @@ -560,7 +572,13 @@ def getini(self, name): ] for config, expected in values: result = IdMaker( - ("a",), [pytest.param("string")], lambda _: "ação", None, config, None + ("a",), + [pytest.param("string")], + lambda _: "ação", + None, + config, + None, + None, ).make_unique_parameterset_ids() assert result == [expected] @@ -592,7 +610,7 @@ def getini(self, name): ] for config, expected in values: result = IdMaker( - ("a",), [pytest.param("string")], None, ["ação"], config, None + ("a",), [pytest.param("string")], None, ["ação"], config, None, None ).make_unique_parameterset_ids() assert result == [expected] @@ -657,6 +675,7 @@ def test_idmaker_with_ids(self) -> None: ["a", None], None, None, + None, ).make_unique_parameterset_ids() assert result == ["a", "3-4"] @@ -668,6 +687,7 @@ def test_idmaker_with_paramset_id(self) -> None: ["a", None], None, None, + None, ).make_unique_parameterset_ids() assert result == ["me", "you"] @@ -679,6 +699,7 @@ def test_idmaker_with_ids_unique_names(self) -> None: ["a", "a", "b", "c", "b"], None, None, + None, ).make_unique_parameterset_ids() assert result == ["a0", "a1", "b0", "c", "b1"] @@ -1318,7 +1339,7 @@ def test_parametrized_ids_invalid_type(self, pytester: Pytester) -> None: """ import pytest - @pytest.mark.parametrize("x, expected", [(1, 2), (3, 4), (5, 6)], ids=(None, 2, type)) + @pytest.mark.parametrize("x, expected", [(1, 2), (3, 4), (5, 6)], ids=(None, 2, OSError())) def test_ids_numbers(x,expected): assert x * 2 == expected """ @@ -1326,8 +1347,8 @@ def test_ids_numbers(x,expected): result = pytester.runpytest() result.stdout.fnmatch_lines( [ - "In test_ids_numbers: ids must be list of string/float/int/bool," - " found: (type: ) at index 2" + "In test_ids_numbers: ids contains unsupported value OSError() (type: ) at index 2. " + "Supported types are: str, bytes, int, float, complex, bool, enum, regex or anything with a __name__." ] ) From 295e7535c9cc9b01ac4e1f77f7b5d929be13a483 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 13 Feb 2022 00:15:13 +0000 Subject: [PATCH 149/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 176 +++++++++++++++++-------------- 1 file changed, 96 insertions(+), 80 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index f73ad773cb8..b6d4f882a61 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 995 plugins. +This list contains 997 plugins. .. only:: not latex @@ -27,14 +27,14 @@ This list contains 995 plugins. :pypi:`pytest-aggreport` pytest plugin for pytest-repeat that generate aggregate report of the same test cases with additional statistics details. Mar 07, 2021 4 - Beta pytest (>=6.2.2) :pypi:`pytest-aio` Pytest plugin for testing async python code Oct 20, 2021 4 - Beta pytest :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A - :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Jan 21, 2022 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Nov 01, 2020 N/A pytest (>=6) :pypi:`pytest-aiomoto` pytest-aiomoto Dec 10, 2021 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A - :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Dec 21, 2021 N/A pytest (>=1.0) + :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Feb 08, 2022 N/A pytest (>=1.0) :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) @@ -67,7 +67,7 @@ This list contains 995 plugins. :pypi:`pytest-astropy` Meta-package containing dependencies for testing Sep 21, 2021 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Dec 27, 2021 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest - :pypi:`pytest-asyncio` Pytest support for asyncio Jan 17, 2022 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-asyncio` Pytest support for asyncio Feb 10, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jan 25, 2022 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) @@ -130,7 +130,7 @@ This list contains 995 plugins. :pypi:`pytest-canonical-data` A plugin which allows to compare results with canonical results, based on previous runs May 08, 2020 2 - Pre-Alpha pytest (>=3.5.0) :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A :pypi:`pytest-capture-deprecatedwarnings` pytest plugin to capture all deprecatedwarnings and put them in one file Apr 30, 2019 N/A N/A - :pypi:`pytest-cases` Separate test code from test cases in pytest. Jan 07, 2022 5 - Production/Stable N/A + :pypi:`pytest-cases` Separate test code from test cases in pytest. Feb 08, 2022 5 - Production/Stable N/A :pypi:`pytest-cassandra` Cassandra CCM Test Fixtures for pytest Nov 04, 2017 1 - Planning N/A :pypi:`pytest-catchlog` py.test plugin to catch log messages. This is a fork of pytest-capturelog. Jan 24, 2016 4 - Beta pytest (>=2.6) :pypi:`pytest-catch-server` Pytest plugin with server for catching HTTP requests. Dec 12, 2019 5 - Production/Stable N/A @@ -148,7 +148,7 @@ This list contains 995 plugins. :pypi:`pytest-ckan` Backport of CKAN 2.9 pytest plugin and fixtures to CAKN 2.8 Apr 28, 2020 4 - Beta pytest :pypi:`pytest-clarity` A plugin providing an alternative, colourful diff output for failing assertions. Jun 11, 2021 N/A N/A :pypi:`pytest-cldf` Easy quality control for CLDF datasets using pytest May 06, 2019 N/A N/A - :pypi:`pytest-click` Py.test plugin for Click Aug 29, 2020 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-click` Pytest plugin for Click Feb 11, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-clld` Nov 29, 2021 N/A pytest (>=3.6) :pypi:`pytest-cloud` Distributed tests planner plugin for pytest testing framework. Oct 05, 2020 6 - Mature N/A :pypi:`pytest-cloudflare-worker` pytest plugin for testing cloudflare workers Mar 30, 2021 4 - Beta pytest (>=6.0.0) @@ -229,7 +229,7 @@ This list contains 995 plugins. :pypi:`pytest-diff` A simple plugin to use with pytest Mar 30, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-disable` pytest plugin to disable a test and skip it from testrun Sep 10, 2015 4 - Beta N/A :pypi:`pytest-disable-plugin` Disable plugins per test Feb 28, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. Mar 20, 2021 3 - Alpha pytest (!=6.0.0,<7,>=3.3.2) + :pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. Feb 12, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :pypi:`pytest-django` A Django plugin for pytest. Dec 07, 2021 5 - Production/Stable pytest (>=5.4.0) :pypi:`pytest-django-ahead` A Django plugin for pytest. Oct 27, 2016 5 - Production/Stable pytest (>=2.9) :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Aug 04, 2021 4 - Beta N/A @@ -239,7 +239,7 @@ This list contains 995 plugins. :pypi:`pytest-django-factories` Factories for your Django models that can be used as Pytest fixtures. Nov 12, 2020 4 - Beta N/A :pypi:`pytest-django-gcir` A Django plugin for pytest. Mar 06, 2018 5 - Production/Stable N/A :pypi:`pytest-django-haystack` Cleanup your Haystack indexes between tests Sep 03, 2017 5 - Production/Stable pytest (>=2.3.4) - :pypi:`pytest-django-ifactory` A model instance factory for pytest-django Jan 13, 2021 3 - Alpha N/A + :pypi:`pytest-django-ifactory` A model instance factory for pytest-django Feb 09, 2022 3 - Alpha N/A :pypi:`pytest-django-lite` The bare minimum to integrate py.test with Django. Jan 30, 2014 N/A N/A :pypi:`pytest-django-liveserver-ssl` Jan 20, 2022 3 - Alpha N/A :pypi:`pytest-django-model` A Simple Way to Test your Django Models Feb 14, 2019 4 - Beta N/A @@ -258,13 +258,13 @@ This list contains 995 plugins. :pypi:`pytest-docker-compose` Manages Docker containers during your integration tests Jan 26, 2021 5 - Production/Stable pytest (>=3.3) :pypi:`pytest-docker-db` A plugin to use docker databases for pytests Mar 20, 2021 5 - Production/Stable pytest (>=3.1.1) :pypi:`pytest-docker-fixtures` pytest docker fixtures Nov 23, 2021 3 - Alpha N/A - :pypi:`pytest-docker-git-fixtures` Pytest fixtures for testing with git scm. Mar 11, 2021 4 - Beta pytest - :pypi:`pytest-docker-haproxy-fixtures` Pytest fixtures for testing with haproxy. Feb 01, 2022 4 - Beta pytest + :pypi:`pytest-docker-git-fixtures` Pytest fixtures for testing with git scm. Feb 09, 2022 4 - Beta pytest + :pypi:`pytest-docker-haproxy-fixtures` Pytest fixtures for testing with haproxy. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-pexpect` pytest plugin for writing functional tests with pexpect and docker Jan 14, 2019 N/A pytest :pypi:`pytest-docker-postgresql` A simple plugin to use with pytest Sep 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-docker-py` Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. Nov 27, 2018 N/A pytest (==4.0.0) - :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Feb 01, 2022 4 - Beta pytest - :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 04, 2022 4 - Beta pytest + :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Feb 09, 2022 4 - Beta pytest + :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-tools` Docker integration tests for pytest Jul 23, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) :pypi:`pytest-docs` Documentation tool for pytest Nov 11, 2018 4 - Beta pytest (>=3.5.0) :pypi:`pytest-docstyle` pytest plugin to run pydocstyle Mar 23, 2020 3 - Alpha N/A @@ -378,6 +378,7 @@ This list contains 995 plugins. :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) :pypi:`pytest-flyte` Pytest fixtures for simplifying Flyte integration testing May 03, 2021 N/A pytest :pypi:`pytest-focus` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest + :pypi:`pytest-fold` Fold console output and drop user into interactive text user interface Feb 06, 2022 3 - Alpha pytest (>=6.2.5) :pypi:`pytest-forcefail` py.test plugin to make the test failing regardless of pytest.mark.xfail May 15, 2018 4 - Beta N/A :pypi:`pytest-forward-compatability` A name to avoid typosquating pytest-foward-compatibility Sep 06, 2020 N/A N/A :pypi:`pytest-forward-compatibility` A pytest plugin to shim pytest commandline options for fowards compatibility Sep 29, 2020 N/A N/A @@ -419,7 +420,7 @@ This list contains 995 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Feb 05, 2022 3 - Alpha pytest (==6.2.5) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Feb 12, 2022 3 - Alpha pytest (==6.2.5) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jan 20, 2022 N/A pytest (>=5.0) @@ -427,9 +428,9 @@ This list contains 995 plugins. :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) :pypi:`pytest-html` pytest plugin for generating HTML reports Dec 13, 2020 5 - Production/Stable pytest (!=6.0.0,>=5.0) :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Jan 31, 2022 5 - Production/Stable N/A + :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Feb 06, 2022 5 - Production/Stable N/A :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) - :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Apr 25, 2021 N/A N/A + :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 11, 2022 N/A N/A :pypi:`pytest-html-thread` pytest plugin for generating HTML reports Dec 29, 2020 5 - Production/Stable N/A :pypi:`pytest-http` Fixture "http" for http requests Dec 05, 2019 N/A N/A :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Dec 25, 2021 5 - Production/Stable N/A @@ -454,7 +455,7 @@ This list contains 995 plugins. :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Sep 30, 2021 N/A N/A :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Jan 26, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-extensions` Inmanta tests package Feb 03, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-extensions` Inmanta tests package Feb 11, 2022 5 - Production/Stable N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Apr 07, 2021 N/A pytest (>=6.0.2,<7.0.0) :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) @@ -467,7 +468,7 @@ This list contains 995 plugins. :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A - :pypi:`pytest-isort` py.test plugin to check import ordering using isort Apr 27, 2021 5 - Production/Stable N/A + :pypi:`pytest-isort` py.test plugin to check import ordering using isort Feb 08, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. Jan 10, 2022 5 - Production/Stable pytest :pypi:`pytest-it` Pytest plugin to display test reports as a plaintext spec, inspired by Rspec: https://github.com/mattduck/pytest-it. Jan 22, 2020 4 - Beta N/A :pypi:`pytest-iterassert` Nicer list and iterable assertion messages for pytest May 11, 2020 3 - Alpha N/A @@ -530,12 +531,12 @@ This list contains 995 plugins. :pypi:`pytest-matrix` Provide tools for generating tests from combinations of fixtures. Jun 24, 2020 5 - Production/Stable pytest (>=5.4.3,<6.0.0) :pypi:`pytest-mccabe` pytest plugin to run the mccabe code complexity checker. Jul 22, 2020 3 - Alpha pytest (>=5.4.0) :pypi:`pytest-md` Plugin for generating Markdown reports for pytest results Jul 11, 2019 3 - Alpha pytest (>=4.2.1) - :pypi:`pytest-md-report` A pytest plugin to make a test results report with Markdown table format. May 04, 2021 4 - Beta pytest (!=6.0.0,<7,>=3.3.2) + :pypi:`pytest-md-report` A pytest plugin to make a test results report with Markdown table format. Feb 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :pypi:`pytest-memprof` Estimates memory consumption of test functions Mar 29, 2019 4 - Beta N/A :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Jan 05, 2022 N/A pytest (>=6.2.5) - :pypi:`pytest-messenger` Pytest to Slack reporting plugin Dec 16, 2020 5 - Production/Stable N/A + :pypi:`pytest-messenger` Pytest to Slack reporting plugin Feb 07, 2022 5 - Production/Stable N/A :pypi:`pytest-metadata` pytest plugin for test session metadata Nov 27, 2020 5 - Production/Stable pytest (>=2.9.0) :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) @@ -549,7 +550,7 @@ This list contains 995 plugins. :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Jan 11, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Feb 08, 2022 N/A pytest (>=1.0) :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A @@ -565,19 +566,19 @@ This list contains 995 plugins. :pypi:`pytest-motor` A pytest plugin for motor, the non-blocking MongoDB driver. Jul 21, 2021 3 - Alpha pytest :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest - :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 02, 2021 4 - Beta pytest + :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Feb 09, 2022 4 - Beta pytest :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Mar 07, 2021 4 - Beta pytest :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Aug 12, 2021 N/A pytest (>=3.6) :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) - :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Jan 30, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" + :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Feb 07, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Jan 11, 2022 3 - Alpha pytest (>=6.0.0) :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A N/A :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Jun 13, 2021 N/A pytest - :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Nov 22, 2021 5 - Production/Stable pytest + :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 11, 2022 5 - Production/Stable pytest (>=6.2) :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) :pypi:`pytest-network` A simple plugin to disable network on socket level. May 07, 2020 N/A N/A @@ -599,7 +600,7 @@ This list contains 995 plugins. :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Aug 04, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A - :pypi:`pytest-odoo` py.test plugin to run Odoo tests Nov 04, 2021 4 - Beta pytest (>=2.9) + :pypi:`pytest-odoo` py.test plugin to run Odoo tests Feb 08, 2022 4 - Beta N/A :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A :pypi:`pytest-oerp` pytest plugin to test OpenERP modules Feb 28, 2012 3 - Alpha N/A :pypi:`pytest-ok` The ultimate pytest output plugin Apr 01, 2019 4 - Beta N/A @@ -651,7 +652,7 @@ This list contains 995 plugins. :pypi:`pytest-platform-markers` Markers for pytest to skip tests on specific platforms Sep 09, 2019 4 - Beta pytest (>=3.6.0) :pypi:`pytest-play` pytest plugin that let you automate actions and assertions with test metrics reporting executing plain YAML files Jun 12, 2019 5 - Production/Stable N/A :pypi:`pytest-playbook` Pytest plugin for reading playbooks. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) - :pypi:`pytest-playwright` A pytest wrapper with fixtures for Playwright to automate web browsers Oct 28, 2021 N/A pytest + :pypi:`pytest-playwright` A pytest wrapper with fixtures for Playwright to automate web browsers Feb 10, 2022 N/A pytest :pypi:`pytest-playwrights` A pytest wrapper with fixtures for Playwright to automate web browsers Dec 02, 2021 N/A N/A :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Aug 17, 2020 5 - Production/Stable pytest @@ -697,7 +698,7 @@ This list contains 995 plugins. :pypi:`pytest-pyramid-server` Pyramid server fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-pyright` Pytest plugin for type checking code with Pyright Aug 16, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.0) - :pypi:`pytest-pythonpath` pytest plugin for adding to the PYTHONPATH from command line or configs. Aug 22, 2018 5 - Production/Stable N/A + :pypi:`pytest-pythonpath` pytest plugin for adding to the PYTHONPATH from command line or configs. Feb 10, 2022 5 - Production/Stable pytest (<7,>=2.5.2) :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Jun 26, 2021 4 - Beta pytest (>=6.2.0) @@ -708,14 +709,14 @@ This list contains 995 plugins. :pypi:`pytest-qt-app` QT app fixture for py.test Dec 23, 2015 5 - Production/Stable N/A :pypi:`pytest-quarantine` A plugin for pytest to manage expected test failures Nov 24, 2019 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-quickcheck` pytest plugin to generate random data inspired by QuickCheck Nov 15, 2020 4 - Beta pytest (<6.0.0,>=4.0) - :pypi:`pytest-rabbitmq` RabbitMQ process and client fixtures for pytest Jun 02, 2021 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-rabbitmq` RabbitMQ process and client fixtures for pytest Feb 11, 2022 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-race` Race conditions tester for pytest Nov 21, 2016 4 - Beta N/A :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results Feb 04, 2022 N/A pytest (>=3.6) :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Dec 02, 2021 5 - Production/Stable pytest :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) :pypi:`pytest-raisesregexp` Simple pytest plugin to look for regex in Exceptions Dec 18, 2015 N/A N/A - :pypi:`pytest-raisin` Plugin enabling the use of exception instances with pytest.raises Jun 25, 2020 N/A pytest + :pypi:`pytest-raisin` Plugin enabling the use of exception instances with pytest.raises Feb 06, 2022 N/A pytest :pypi:`pytest-random` py.test plugin to randomize tests Apr 28, 2013 3 - Alpha N/A :pypi:`pytest-randomly` Pytest plugin to randomly order tests and control random.seed. Jan 10, 2022 5 - Production/Stable pytest :pypi:`pytest-randomness` Pytest plugin about random seed management May 30, 2019 3 - Alpha N/A @@ -725,7 +726,7 @@ This list contains 995 plugins. :pypi:`pytest-reana` Pytest fixtures for REANA. Jan 05, 2022 3 - Alpha N/A :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jul 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A - :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Dec 07, 2021 5 - Production/Stable pytest + :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-redislite` Pytest plugin for testing code using Redis Sep 19, 2021 4 - Beta pytest :pypi:`pytest-redmine` Pytest plugin for redmine Mar 19, 2018 1 - Planning N/A :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) @@ -786,13 +787,13 @@ This list contains 995 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Feb 04, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Feb 11, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Aug 31, 2020 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Feb 04, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Feb 11, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -826,7 +827,7 @@ This list contains 995 plugins. :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A - :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Dec 02, 2021 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Feb 11, 2022 4 - Beta pytest (>=3.0.0) :pypi:`pytest-snmpserver` May 12, 2021 N/A N/A :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Jan 05, 2022 4 - Beta pytest (>=6.2.0) :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Jan 23, 2022 4 - Beta pytest (>=3.6.3) @@ -840,7 +841,7 @@ This list contains 995 plugins. :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. May 04, 2021 N/A N/A :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Aug 05, 2020 4 - Beta N/A - :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Oct 13, 2021 N/A N/A + :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Dec 22, 2021 6 - Mature pytest (>=6.2.4) :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Jan 10, 2022 4 - Beta pytest (>=5,<7) @@ -848,11 +849,12 @@ This list contains 995 plugins. :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Jan 25, 2022 N/A pytest (>5.4.0,<6.3) - :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Dec 06, 2021 N/A N/A + :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Feb 07, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Mar 13, 2018 3 - Alpha N/A :pypi:`pytest-sql-bigquery` Yet another SQL-testing framework for BigQuery provided by pytest plugin Dec 19, 2019 N/A pytest + :pypi:`pytest-squadcast` Pytest report plugin for Squadcast Feb 11, 2022 5 - Production/Stable pytest :pypi:`pytest-srcpaths` Add paths to sys.path Oct 15, 2021 N/A N/A :pypi:`pytest-ssh` pytest plugin for ssh command run May 27, 2019 N/A pytest :pypi:`pytest-start-from` Start pytest run from a given point Apr 11, 2016 N/A N/A @@ -867,7 +869,7 @@ This list contains 995 plugins. :pypi:`pytest-stub` Stub packages, modules and attributes. Apr 28, 2020 5 - Production/Stable N/A :pypi:`pytest-stubprocess` Provide stub implementations for subprocesses in Python tests Sep 17, 2018 3 - Alpha pytest (>=3.5.0) :pypi:`pytest-study` A pytest plugin to organize long run tests (named studies) without interfering the regular tests Sep 26, 2017 3 - Alpha pytest (>=2.0) - :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Jan 23, 2022 5 - Production/Stable pytest (>=4.0.0) + :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Feb 09, 2022 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Mar 02, 2021 N/A N/A :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Jan 15, 2022 4 - Beta pytest (>=6.0) :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A @@ -894,7 +896,7 @@ This list contains 995 plugins. :pypi:`pytest-testdirectory` A py.test plugin providing temporary directories in unit tests. Nov 06, 2018 5 - Production/Stable pytest :pypi:`pytest-testdox` A testdox format reporter for pytest Dec 05, 2021 5 - Production/Stable pytest (>=4.6.0) :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A - :pypi:`pytest-testinfra` Test infrastructures Dec 07, 2021 5 - Production/Stable pytest (!=3.0.2) + :pypi:`pytest-testinfra` Test infrastructures Feb 10, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) :pypi:`pytest-testmon` selects tests affected by changed files and methods Feb 05, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) @@ -1082,7 +1084,7 @@ This list contains 995 plugins. pytest fixtures for writing aiofiles tests with pyfakefs :pypi:`pytest-aiohttp` - *last release*: Jan 21, 2022, + *last release*: Feb 12, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.1.0) @@ -1131,7 +1133,7 @@ This list contains 995 plugins. :pypi:`pytest-alembic` - *last release*: Dec 21, 2021, + *last release*: Feb 08, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -1362,7 +1364,7 @@ This list contains 995 plugins. :pypi:`pytest-asyncio` - *last release*: Jan 17, 2022, + *last release*: Feb 10, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.1.0) @@ -1803,7 +1805,7 @@ This list contains 995 plugins. pytest plugin to capture all deprecatedwarnings and put them in one file :pypi:`pytest-cases` - *last release*: Jan 07, 2022, + *last release*: Feb 08, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -1929,11 +1931,11 @@ This list contains 995 plugins. Easy quality control for CLDF datasets using pytest :pypi:`pytest-click` - *last release*: Aug 29, 2020, + *last release*: Feb 11, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) - Py.test plugin for Click + Pytest plugin for Click :pypi:`pytest-clld` *last release*: Nov 29, 2021, @@ -2496,9 +2498,9 @@ This list contains 995 plugins. Disable plugins per test :pypi:`pytest-discord` - *last release*: Mar 20, 2021, - *status*: 3 - Alpha, - *requires*: pytest (!=6.0.0,<7,>=3.3.2) + *last release*: Feb 12, 2022, + *status*: 4 - Beta, + *requires*: pytest (!=6.0.0,<8,>=3.3.2) A pytest plugin to notify test results to a Discord channel. @@ -2566,7 +2568,7 @@ This list contains 995 plugins. Cleanup your Haystack indexes between tests :pypi:`pytest-django-ifactory` - *last release*: Jan 13, 2021, + *last release*: Feb 09, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -2699,14 +2701,14 @@ This list contains 995 plugins. pytest docker fixtures :pypi:`pytest-docker-git-fixtures` - *last release*: Mar 11, 2021, + *last release*: Feb 09, 2022, *status*: 4 - Beta, *requires*: pytest Pytest fixtures for testing with git scm. :pypi:`pytest-docker-haproxy-fixtures` - *last release*: Feb 01, 2022, + *last release*: Feb 09, 2022, *status*: 4 - Beta, *requires*: pytest @@ -2734,14 +2736,14 @@ This list contains 995 plugins. Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. :pypi:`pytest-docker-registry-fixtures` - *last release*: Feb 01, 2022, + *last release*: Feb 09, 2022, *status*: 4 - Beta, *requires*: pytest Pytest fixtures for testing with docker registries. :pypi:`pytest-docker-squid-fixtures` - *last release*: Feb 04, 2022, + *last release*: Feb 09, 2022, *status*: 4 - Beta, *requires*: pytest @@ -3538,6 +3540,13 @@ This list contains 995 plugins. A pytest plugin that alerts user of failed test cases with screen notifications + :pypi:`pytest-fold` + *last release*: Feb 06, 2022, + *status*: 3 - Alpha, + *requires*: pytest (>=6.2.5) + + Fold console output and drop user into interactive text user interface + :pypi:`pytest-forcefail` *last release*: May 15, 2018, *status*: 4 - Beta, @@ -3826,7 +3835,7 @@ This list contains 995 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Feb 05, 2022, + *last release*: Feb 12, 2022, *status*: 3 - Alpha, *requires*: pytest (==6.2.5) @@ -3882,7 +3891,7 @@ This list contains 995 plugins. optimized pytest plugin for generating HTML reports :pypi:`pytest-html-object-storage` - *last release*: Jan 31, 2022, + *last release*: Feb 06, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -3896,7 +3905,7 @@ This list contains 995 plugins. Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. :pypi:`pytest-html-reporter` - *last release*: Apr 25, 2021, + *last release*: Feb 11, 2022, *status*: N/A, *requires*: N/A @@ -4071,7 +4080,7 @@ This list contains 995 plugins. A py.test plugin providing fixtures to simplify inmanta modules testing. :pypi:`pytest-inmanta-extensions` - *last release*: Feb 03, 2022, + *last release*: Feb 11, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4162,9 +4171,9 @@ This list contains 995 plugins. THIS PROJECT IS ABANDONED :pypi:`pytest-isort` - *last release*: Apr 27, 2021, + *last release*: Feb 08, 2022, *status*: 5 - Production/Stable, - *requires*: N/A + *requires*: pytest (>=5.0) py.test plugin to check import ordering using isort @@ -4603,9 +4612,9 @@ This list contains 995 plugins. Plugin for generating Markdown reports for pytest results :pypi:`pytest-md-report` - *last release*: May 04, 2021, + *last release*: Feb 06, 2022, *status*: 4 - Beta, - *requires*: pytest (!=6.0.0,<7,>=3.3.2) + *requires*: pytest (!=6.0.0,<8,>=3.3.2) A pytest plugin to make a test results report with Markdown table format. @@ -4638,7 +4647,7 @@ This list contains 995 plugins. Pytest plugin for sending report message of marked tests execution :pypi:`pytest-messenger` - *last release*: Dec 16, 2020, + *last release*: Feb 07, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4736,7 +4745,7 @@ This list contains 995 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Jan 11, 2022, + *last release*: Feb 08, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -4848,7 +4857,7 @@ This list contains 995 plugins. pytest plugin to collect information from tests :pypi:`pytest-mpl` - *last release*: Jul 02, 2021, + *last release*: Feb 09, 2022, *status*: 4 - Beta, *requires*: pytest @@ -4897,7 +4906,7 @@ This list contains 995 plugins. Add the mutation testing feature to pytest :pypi:`pytest-mypy` - *last release*: Jan 30, 2022, + *last release*: Feb 07, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2) ; python_version >= "3.10" @@ -4932,9 +4941,9 @@ This list contains 995 plugins. Pytest plugin to check mypy output. :pypi:`pytest-mysql` - *last release*: Nov 22, 2021, + *last release*: Feb 11, 2022, *status*: 5 - Production/Stable, - *requires*: pytest + *requires*: pytest (>=6.2) MySQL process and client fixtures for pytest @@ -5086,9 +5095,9 @@ This list contains 995 plugins. pytest results data-base and HTML reporter :pypi:`pytest-odoo` - *last release*: Nov 04, 2021, + *last release*: Feb 08, 2022, *status*: 4 - Beta, - *requires*: pytest (>=2.9) + *requires*: N/A py.test plugin to run Odoo tests @@ -5450,7 +5459,7 @@ This list contains 995 plugins. Pytest plugin for reading playbooks. :pypi:`pytest-playwright` - *last release*: Oct 28, 2021, + *last release*: Feb 10, 2022, *status*: N/A, *requires*: pytest @@ -5772,9 +5781,9 @@ This list contains 995 plugins. Pytest plugin for interaction with TestRail :pypi:`pytest-pythonpath` - *last release*: Aug 22, 2018, + *last release*: Feb 10, 2022, *status*: 5 - Production/Stable, - *requires*: N/A + *requires*: pytest (<7,>=2.5.2) pytest plugin for adding to the PYTHONPATH from command line or configs. @@ -5849,7 +5858,7 @@ This list contains 995 plugins. pytest plugin to generate random data inspired by QuickCheck :pypi:`pytest-rabbitmq` - *last release*: Jun 02, 2021, + *last release*: Feb 11, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=3.0.0) @@ -5898,7 +5907,7 @@ This list contains 995 plugins. Simple pytest plugin to look for regex in Exceptions :pypi:`pytest-raisin` - *last release*: Jun 25, 2020, + *last release*: Feb 06, 2022, *status*: N/A, *requires*: pytest @@ -5968,9 +5977,9 @@ This list contains 995 plugins. Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal :pypi:`pytest-redis` - *last release*: Dec 07, 2021, + *last release*: Feb 10, 2022, *status*: 5 - Production/Stable, - *requires*: pytest + *requires*: pytest (>=6.2.0) Redis fixtures and fixture factories for Pytest. @@ -6395,7 +6404,7 @@ This list contains 995 plugins. :pypi:`pytest-sbase` - *last release*: Feb 04, 2022, + *last release*: Feb 11, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6437,7 +6446,7 @@ This list contains 995 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Feb 04, 2022, + *last release*: Feb 11, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6675,7 +6684,7 @@ This list contains 995 plugins. py.test plugin for Snap-CI :pypi:`pytest-snapshot` - *last release*: Dec 02, 2021, + *last release*: Feb 11, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.0.0) @@ -6773,7 +6782,7 @@ This list contains 995 plugins. Doctest plugin for pytest with support for Sphinx-specific doctest-directives :pypi:`pytest-spiratest` - *last release*: Oct 13, 2021, + *last release*: Feb 08, 2022, *status*: N/A, *requires*: N/A @@ -6829,7 +6838,7 @@ This list contains 995 plugins. A Dynamic test tool for Splunk Apps and Add-ons :pypi:`pytest-splunk-addon-ui-smartx` - *last release*: Dec 06, 2021, + *last release*: Feb 07, 2022, *status*: N/A, *requires*: N/A @@ -6863,6 +6872,13 @@ This list contains 995 plugins. Yet another SQL-testing framework for BigQuery provided by pytest plugin + :pypi:`pytest-squadcast` + *last release*: Feb 11, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest + + Pytest report plugin for Squadcast + :pypi:`pytest-srcpaths` *last release*: Oct 15, 2021, *status*: N/A, @@ -6962,7 +6978,7 @@ This list contains 995 plugins. A pytest plugin to organize long run tests (named studies) without interfering the regular tests :pypi:`pytest-subprocess` - *last release*: Jan 23, 2022, + *last release*: Feb 09, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.0.0) @@ -7151,7 +7167,7 @@ This list contains 995 plugins. A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. :pypi:`pytest-testinfra` - *last release*: Dec 07, 2021, + *last release*: Feb 10, 2022, *status*: 5 - Production/Stable, *requires*: pytest (!=3.0.2) From 3e533075868db3700bf0a65abcb7054c640ad39d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Feb 2022 03:02:17 +0000 Subject: [PATCH 150/549] build(deps): Bump pytest-asyncio in /testing/plugins_integration Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.17.2 to 0.18.1. - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.17.2...v0.18.1) --- updated-dependencies: - dependency-name: pytest-asyncio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 3fb8ccf2947..7d63d38f9f1 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,6 +1,6 @@ anyio[curio,trio]==3.5.0 django==4.0.2 -pytest-asyncio==0.17.2 +pytest-asyncio==0.18.1 pytest-bdd==5.0.0 pytest-cov==3.0.0 pytest-django==4.5.2 From 747b8372eabc8909aae411937c6b80536bb214c4 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sun, 13 Feb 2022 09:39:57 -0300 Subject: [PATCH 151/549] Try to import module before creating dummy modules with 'importmode=importlib' The dummy modules we introduce in `insert_missing_modules` (due to #7856 and #7859) would cause problems if the dummy modules actually end up replacing modules which could be imported normally because they are available in `PYTHONPATH`. Now we attempt to first import the module via normal mechanisms, and only introduce the dummy modules if the intermediary modules don't actually exist. Close #9645 --- changelog/9645.bugfix.rst | 1 + src/_pytest/pathlib.py | 19 ++++++++++++++----- testing/test_collection.py | 29 +++++++++++++++++++++++++++++ testing/test_pathlib.py | 19 ++++++++++++------- 4 files changed, 56 insertions(+), 12 deletions(-) create mode 100644 changelog/9645.bugfix.rst diff --git a/changelog/9645.bugfix.rst b/changelog/9645.bugfix.rst new file mode 100644 index 00000000000..089a783dee6 --- /dev/null +++ b/changelog/9645.bugfix.rst @@ -0,0 +1 @@ +Fixed regression where ``--import-mode=importlib`` used together with :envvar:`PYTHONPATH` or :confval:`pythonpath` would cause import errors in test suites. diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py index def5fa94b2b..c5a411b5963 100644 --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -603,11 +603,20 @@ def insert_missing_modules(modules: Dict[str, ModuleType], module_name: str) -> module_parts = module_name.split(".") while module_name: if module_name not in modules: - module = ModuleType( - module_name, - doc="Empty module created by pytest's importmode=importlib.", - ) - modules[module_name] = module + try: + # If sys.meta_path is empty, calling import_module will issue + # a warning and raise ModuleNotFoundError. To avoid the + # warning, we check sys.meta_path explicitly and raise the error + # ourselves to fall back to creating a dummy module. + if not sys.meta_path: + raise ModuleNotFoundError + importlib.import_module(module_name) + except ModuleNotFoundError: + module = ModuleType( + module_name, + doc="Empty module created by pytest's importmode=importlib.", + ) + modules[module_name] = module module_parts.pop(-1) module_name = ".".join(module_parts) diff --git a/testing/test_collection.py b/testing/test_collection.py index e79ae384d7a..a943a44d227 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -1507,6 +1507,35 @@ def test_modules_not_importable_as_side_effect(self, pytester: Pytester) -> None ] ) + def test_using_python_path(self, pytester: Pytester) -> None: + """ + Dummy modules created by insert_missing_modules should not get in + the way of modules that could be imported via python path (#9645). + """ + pytester.makeini( + """ + [pytest] + pythonpath = . + addopts = --import-mode importlib + """ + ) + pytester.makepyfile( + **{ + "tests/__init__.py": "", + "tests/conftest.py": "", + "tests/subpath/__init__.py": "", + "tests/subpath/helper.py": "", + "tests/subpath/test_something.py": """ + import tests.subpath.helper + + def test_something(): + assert True + """, + } + ) + result = pytester.runpytest() + result.stdout.fnmatch_lines("*1 passed in*") + def test_does_not_crash_on_error_from_decorated_function(pytester: Pytester) -> None: """Regression test for an issue around bad exception formatting due to diff --git a/testing/test_pathlib.py b/testing/test_pathlib.py index fe5e08f212f..c901dc6f435 100644 --- a/testing/test_pathlib.py +++ b/testing/test_pathlib.py @@ -562,15 +562,20 @@ def test_module_name_from_path(self, tmp_path: Path) -> None: result = module_name_from_path(Path("/home/foo/test_foo.py"), Path("/bar")) assert result == "home.foo.test_foo" - def test_insert_missing_modules(self) -> None: - modules = {"src.tests.foo": ModuleType("src.tests.foo")} - insert_missing_modules(modules, "src.tests.foo") - assert sorted(modules) == ["src", "src.tests", "src.tests.foo"] + def test_insert_missing_modules( + self, monkeypatch: MonkeyPatch, tmp_path: Path + ) -> None: + monkeypatch.chdir(tmp_path) + # Use 'xxx' and 'xxy' as parent names as they are unlikely to exist and + # don't end up being imported. + modules = {"xxx.tests.foo": ModuleType("xxx.tests.foo")} + insert_missing_modules(modules, "xxx.tests.foo") + assert sorted(modules) == ["xxx", "xxx.tests", "xxx.tests.foo"] mod = ModuleType("mod", doc="My Module") - modules = {"src": mod} - insert_missing_modules(modules, "src") - assert modules == {"src": mod} + modules = {"xxy": mod} + insert_missing_modules(modules, "xxy") + assert modules == {"xxy": mod} modules = {} insert_missing_modules(modules, "") From c9cf2d44245c553258e7e0ed0e446072b3434d1b Mon Sep 17 00:00:00 2001 From: eduardo naufel schettino Date: Tue, 15 Feb 2022 19:17:34 +0800 Subject: [PATCH 152/549] Fix count of selected tests on terminal collection summary (#9628) --- changelog/9626.bugfix.rst | 3 +++ src/_pytest/terminal.py | 4 ++-- testing/test_cacheprovider.py | 2 +- testing/test_terminal.py | 27 +++++++++++++++++++++++++++ 4 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 changelog/9626.bugfix.rst diff --git a/changelog/9626.bugfix.rst b/changelog/9626.bugfix.rst new file mode 100644 index 00000000000..44d3734a1d2 --- /dev/null +++ b/changelog/9626.bugfix.rst @@ -0,0 +1,3 @@ +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. diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 4bcc968d100..b4848c48aba 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -663,7 +663,7 @@ def report_collect(self, final: bool = False) -> None: errors = len(self.stats.get("error", [])) skipped = len(self.stats.get("skipped", [])) deselected = len(self.stats.get("deselected", [])) - selected = self._numcollected - errors - skipped - deselected + selected = self._numcollected - deselected line = "collected " if final else "collecting " line += ( str(self._numcollected) + " item" + ("" if self._numcollected == 1 else "s") @@ -674,7 +674,7 @@ def report_collect(self, final: bool = False) -> None: line += " / %d deselected" % deselected if skipped: line += " / %d skipped" % skipped - if self._numcollected > selected > 0: + if self._numcollected > selected: line += " / %d selected" % selected if self.isatty: self.rewrite(line, bold=True, erase=True) diff --git a/testing/test_cacheprovider.py b/testing/test_cacheprovider.py index cc6d547dfb1..2baa3c8f189 100644 --- a/testing/test_cacheprovider.py +++ b/testing/test_cacheprovider.py @@ -773,7 +773,7 @@ def pytest_sessionfinish(): result = pytester.runpytest("--lf", "--lfnf", "none") result.stdout.fnmatch_lines( [ - "collected 2 items / 2 deselected", + "collected 2 items / 2 deselected / 0 selected", "run-last-failure: no previously failed tests, deselecting all items.", "deselected=2", "* 2 deselected in *", diff --git a/testing/test_terminal.py b/testing/test_terminal.py index e5f41266280..f0e58e5b4c4 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -783,6 +783,33 @@ def test_pass(): result.stdout.no_fnmatch_line("*= 1 deselected =*") assert result.ret == 0 + def test_selected_count_with_error(self, pytester: Pytester) -> None: + pytester.makepyfile( + test_selected_count_3=""" + def test_one(): + pass + def test_two(): + pass + def test_three(): + pass + """, + test_selected_count_error=""" + 5/0 + def test_foo(): + pass + def test_bar(): + pass + """, + ) + result = pytester.runpytest("-k", "test_t") + result.stdout.fnmatch_lines( + [ + "collected 3 items / 1 error / 1 deselected / 2 selected", + "* ERROR collecting test_selected_count_error.py *", + ] + ) + assert result.ret == ExitCode.INTERRUPTED + def test_no_skip_summary_if_failure(self, pytester: Pytester) -> None: pytester.makepyfile( """ From fac8f284cd6ffd44c7d401093c67799766473be1 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 15 Feb 2022 09:43:20 -0300 Subject: [PATCH 153/549] Fix diff output for data types where `-v` would show less information (#9661) Close #5192 --- changelog/5192.improvement.rst | 3 +++ src/_pytest/assertion/util.py | 18 ++----------- testing/acceptance_test.py | 2 -- testing/test_assertion.py | 48 ++++++++++------------------------ testing/test_error_diffs.py | 2 -- 5 files changed, 19 insertions(+), 54 deletions(-) create mode 100644 changelog/5192.improvement.rst diff --git a/changelog/5192.improvement.rst b/changelog/5192.improvement.rst new file mode 100644 index 00000000000..c51077ae5f1 --- /dev/null +++ b/changelog/5192.improvement.rst @@ -0,0 +1,3 @@ +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. diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index 14512a7c5ca..03167ddd471 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -223,8 +223,6 @@ def _compare_eq_any(left: Any, right: Any, verbose: int = 0) -> List[str]: explanation = _compare_eq_set(left, right, verbose) elif isdict(left) and isdict(right): explanation = _compare_eq_dict(left, right, verbose) - elif verbose > 0: - explanation = _compare_eq_verbose(left, right) if isiterable(left) and isiterable(right): expl = _compare_eq_iterable(left, right, verbose) @@ -281,18 +279,6 @@ def _diff_text(left: str, right: str, verbose: int = 0) -> List[str]: return explanation -def _compare_eq_verbose(left: Any, right: Any) -> List[str]: - keepends = True - left_lines = repr(left).splitlines(keepends) - right_lines = repr(right).splitlines(keepends) - - explanation: List[str] = [] - explanation += ["+" + line for line in left_lines] - explanation += ["-" + line for line in right_lines] - - return explanation - - def _surrounding_parens_on_own_lines(lines: List[str]) -> None: """Move opening/closing parenthesis/bracket to own lines.""" opening = lines[0][:1] @@ -308,8 +294,8 @@ def _surrounding_parens_on_own_lines(lines: List[str]) -> None: def _compare_eq_iterable( left: Iterable[Any], right: Iterable[Any], verbose: int = 0 ) -> List[str]: - if not verbose and not running_on_ci(): - return ["Use -v to get the full diff"] + if verbose <= 0 and not running_on_ci(): + return ["Use -v to get more diff"] # dynamic import to speedup pytest import difflib diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 8b8d4a4a6ed..71d3cc23a2e 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -1238,8 +1238,6 @@ def test(): " def check():", "> assert 1 == 2", "E assert 1 == 2", - "E +1", - "E -2", "", "pdb.py:2: AssertionError", "*= 1 failed in *", diff --git a/testing/test_assertion.py b/testing/test_assertion.py index d57cc26a350..d37ee72a2ec 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -83,7 +83,7 @@ def test_dummy_failure(pytester): # how meta! "E assert {'failed': 1,... 'skipped': 0} == {'failed': 0,... 'skipped': 0}", "E Omitting 1 identical items, use -vv to show", "E Differing items:", - "E Use -v to get the full diff", + "E Use -v to get more diff", ] ) # XXX: unstable output. @@ -376,7 +376,7 @@ def test_bytes_diff_normal(self) -> None: assert diff == [ "b'spam' == b'eggs'", "At index 0 diff: b's' != b'e'", - "Use -v to get the full diff", + "Use -v to get more diff", ] def test_bytes_diff_verbose(self) -> None: @@ -444,11 +444,19 @@ def test_iterable_full_diff(self, left, right, expected) -> None: """ expl = callequal(left, right, verbose=0) assert expl is not None - assert expl[-1] == "Use -v to get the full diff" + assert expl[-1] == "Use -v to get more diff" verbose_expl = callequal(left, right, verbose=1) assert verbose_expl is not None assert "\n".join(verbose_expl).endswith(textwrap.dedent(expected).strip()) + def test_iterable_quiet(self) -> None: + expl = callequal([1, 2], [10, 2], verbose=-1) + assert expl == [ + "[1, 2] == [10, 2]", + "At index 0 diff: 1 != 10", + "Use -v to get more diff", + ] + def test_iterable_full_diff_ci( self, monkeypatch: MonkeyPatch, pytester: Pytester ) -> None: @@ -466,7 +474,7 @@ def test_full_diff(): monkeypatch.delenv("CI", raising=False) result = pytester.runpytest() - result.stdout.fnmatch_lines(["E Use -v to get the full diff"]) + result.stdout.fnmatch_lines(["E Use -v to get more diff"]) def test_list_different_lengths(self) -> None: expl = callequal([0, 1], [0, 1, 2]) @@ -699,32 +707,6 @@ def test_list_tuples(self) -> None: assert expl is not None assert len(expl) > 1 - def test_repr_verbose(self) -> None: - class Nums: - def __init__(self, nums): - self.nums = nums - - def __repr__(self): - return str(self.nums) - - list_x = list(range(5000)) - list_y = list(range(5000)) - list_y[len(list_y) // 2] = 3 - nums_x = Nums(list_x) - nums_y = Nums(list_y) - - assert callequal(nums_x, nums_y) is None - - expl = callequal(nums_x, nums_y, verbose=1) - assert expl is not None - assert "+" + repr(nums_x) in expl - assert "-" + repr(nums_y) in expl - - expl = callequal(nums_x, nums_y, verbose=2) - assert expl is not None - assert "+" + repr(nums_x) in expl - assert "-" + repr(nums_y) in expl - def test_list_bad_repr(self) -> None: class A: def __repr__(self): @@ -851,8 +833,6 @@ def test_recursive_dataclasses_verbose(self, pytester: Pytester) -> None: "E ", "E Drill down into differing attribute a:", "E a: 10 != 20", - "E +10", - "E -20", "E ", "E Drill down into differing attribute b:", "E b: 'ten' != 'xxx'", @@ -1059,7 +1039,7 @@ def test_namedtuple(self) -> None: " b: 'b' != 'c'", " - c", " + b", - "Use -v to get the full diff", + "Use -v to get more diff", ] def test_comparing_two_different_namedtuple(self) -> None: @@ -1074,7 +1054,7 @@ def test_comparing_two_different_namedtuple(self) -> None: assert lines == [ "NT1(a=1, b='b') == NT2(a=2, b='b')", "At index 0 diff: 1 != 2", - "Use -v to get the full diff", + "Use -v to get more diff", ] diff --git a/testing/test_error_diffs.py b/testing/test_error_diffs.py index d880be0dabe..eb781210872 100644 --- a/testing/test_error_diffs.py +++ b/testing/test_error_diffs.py @@ -231,8 +231,6 @@ def test_this(): E ['a'] E Drill down into differing attribute a: E a: 1 != 2 - E +1 - E -2 """, id="Compare data classes", ), From 9af3e236955a22ce43f369da4540d9fca2363515 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 15 Feb 2022 10:00:50 -0300 Subject: [PATCH 154/549] Expand warnings output for ResourceWarning (#9682) Fix #9644 --- changelog/9644.improvement.rst | 4 +++ doc/en/how-to/capture-warnings.rst | 15 ++++++++ src/_pytest/warnings.py | 17 +++++++++ testing/test_warnings.py | 55 ++++++++++++++++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 changelog/9644.improvement.rst diff --git a/changelog/9644.improvement.rst b/changelog/9644.improvement.rst new file mode 100644 index 00000000000..6e29fd57a79 --- /dev/null +++ b/changelog/9644.improvement.rst @@ -0,0 +1,4 @@ +More information about the location of resources that led Python to raise :class:`ResourceWarning` can now +be obtained by enabling :mod:`tracemalloc`. + +See :ref:`resource-warnings` for more information. diff --git a/doc/en/how-to/capture-warnings.rst b/doc/en/how-to/capture-warnings.rst index 8c911424af7..4a27767e528 100644 --- a/doc/en/how-to/capture-warnings.rst +++ b/doc/en/how-to/capture-warnings.rst @@ -441,3 +441,18 @@ Please read our :ref:`backwards-compatibility` to learn how we proceed about dep features. The full list of warnings is listed in :ref:`the reference documentation `. + + +.. _`resource-warnings`: + +Resource Warnings +----------------- + +Additional information of the source of a :class:`ResourceWarning` can be obtained when captured by pytest if +:mod:`tracemalloc` module is enabled. + +One convenient way to enable :mod:`tracemalloc` when running tests is to set the :envvar:`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. diff --git a/src/_pytest/warnings.py b/src/_pytest/warnings.py index 154283632cf..4aaa9445293 100644 --- a/src/_pytest/warnings.py +++ b/src/_pytest/warnings.py @@ -81,6 +81,23 @@ def warning_record_to_str(warning_message: warnings.WarningMessage) -> str: warning_message.lineno, warning_message.line, ) + if warning_message.source is not None: + try: + import tracemalloc + except ImportError: + pass + else: + tb = tracemalloc.get_object_traceback(warning_message.source) + if tb is not None: + formatted_tb = "\n".join(tb.format()) + # Use a leading new line to better separate the (large) output + # from the traceback to the previous warning text. + msg += f"\nObject allocated at:\n{formatted_tb}" + else: + # No need for a leading new line. + url = "https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings" + msg += "Enable tracemalloc to get traceback where the object was allocated.\n" + msg += f"See {url} for more info." return msg diff --git a/testing/test_warnings.py b/testing/test_warnings.py index 734e1ebb5cd..7b716bb4546 100644 --- a/testing/test_warnings.py +++ b/testing/test_warnings.py @@ -1,4 +1,5 @@ import os +import sys import warnings from typing import List from typing import Optional @@ -774,3 +775,57 @@ def test_it(): "*Unknown pytest.mark.unknown*", ] ) + + +def test_resource_warning(pytester: Pytester, monkeypatch: pytest.MonkeyPatch) -> None: + # Some platforms (notably PyPy) don't have tracemalloc. + # We choose to explicitly not skip this in case tracemalloc is not + # available, using `importorskip("tracemalloc")` for example, + # because we want to ensure the same code path does not break in those platforms. + try: + import tracemalloc # noqa + + has_tracemalloc = True + except ImportError: + has_tracemalloc = False + + # Explicitly disable PYTHONTRACEMALLOC in case pytest's test suite is running + # with it enabled. + monkeypatch.delenv("PYTHONTRACEMALLOC", raising=False) + + pytester.makepyfile( + """ + def open_file(p): + f = p.open("r") + assert p.read_text() == "hello" + + def test_resource_warning(tmp_path): + p = tmp_path.joinpath("foo.txt") + p.write_text("hello") + open_file(p) + """ + ) + result = pytester.run(sys.executable, "-Xdev", "-m", "pytest") + expected_extra = ( + [ + "*ResourceWarning* unclosed file*", + "*Enable tracemalloc to get traceback where the object was allocated*", + "*See https* for more info.", + ] + if has_tracemalloc + else [] + ) + result.stdout.fnmatch_lines([*expected_extra, "*1 passed*"]) + + monkeypatch.setenv("PYTHONTRACEMALLOC", "20") + + result = pytester.run(sys.executable, "-Xdev", "-m", "pytest") + expected_extra = ( + [ + "*ResourceWarning* unclosed file*", + "*Object allocated at*", + ] + if has_tracemalloc + else [] + ) + result.stdout.fnmatch_lines([*expected_extra, "*1 passed*"]) From 7f50c521b66922529ed2cab8434b865afc8a79dd Mon Sep 17 00:00:00 2001 From: Masaru Tsuchiyama Date: Sun, 20 Feb 2022 17:24:23 +0900 Subject: [PATCH 155/549] fix link of argcomplete page. --- doc/en/how-to/bash-completion.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/how-to/bash-completion.rst b/doc/en/how-to/bash-completion.rst index 245dfd6d9a8..117ff7ec13b 100644 --- a/doc/en/how-to/bash-completion.rst +++ b/doc/en/how-to/bash-completion.rst @@ -5,7 +5,7 @@ How to set up bash completion ============================= When using bash as your shell, ``pytest`` can use argcomplete -(https://argcomplete.readthedocs.io/) for auto-completion. +(https://kislyuk.github.io/argcomplete/) for auto-completion. For this ``argcomplete`` needs to be installed **and** enabled. Install argcomplete using: From 0c80a1c836616b0206a4af2fe72001ff797a5f8f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 23 Feb 2022 08:26:18 -0300 Subject: [PATCH 156/549] [automated] Update plugin list (#9701) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 146 ++++++++++++++++++------------- 1 file changed, 85 insertions(+), 61 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index b6d4f882a61..938246fabc0 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 997 plugins. +This list contains 1000 plugins. .. only:: not latex @@ -19,7 +19,7 @@ This list contains 997 plugins. name summary last release status requires =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Feb 01, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Feb 14, 2022 N/A pytest (>=5.4.0) :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) @@ -106,9 +106,9 @@ This list contains 997 plugins. :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A :pypi:`pytest-board` Local continuous test runner with pytest and watchdog. Jan 20, 2019 N/A N/A - :pypi:`pytest-bootstrap` Jan 28, 2022 N/A N/A + :pypi:`pytest-bootstrap` Feb 19, 2022 N/A N/A :pypi:`pytest-bpdb` A py.test plug-in to enable drop to bpdb debugger on test failure. Jan 19, 2015 2 - Pre-Alpha N/A - :pypi:`pytest-bravado` Pytest-bravado automatically generates from OpenAPI specification client fixtures. Jul 19, 2021 N/A N/A + :pypi:`pytest-bravado` Pytest-bravado automatically generates from OpenAPI specification client fixtures. Feb 15, 2022 N/A N/A :pypi:`pytest-breakword` Use breakword with pytest Aug 04, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-breed-adapter` A simple plugin to connect with breed-server Nov 07, 2018 4 - Beta pytest (>=3.5.0) :pypi:`pytest-briefcase` A pytest plugin for running tests on a Briefcase project. Jun 14, 2020 4 - Beta pytest (>=3.5.0) @@ -123,9 +123,9 @@ This list contains 997 plugins. :pypi:`pytest-builtin-types` Nov 17, 2021 N/A pytest :pypi:`pytest-bwrap` Run your tests in Bubblewrap sandboxes Oct 26, 2018 3 - Alpha N/A :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A - :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Nov 03, 2021 4 - Beta pytest (>=5) + :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Feb 18, 2022 4 - Beta pytest (>=5) :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A - :pypi:`pytest-cairo` Feb 04, 2022 N/A pytest + :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Feb 19, 2022 N/A pytest :pypi:`pytest-camel-collect` Enable CamelCase-aware pytest class collection Aug 02, 2020 N/A pytest (>=2.9) :pypi:`pytest-canonical-data` A plugin which allows to compare results with canonical results, based on previous runs May 08, 2020 2 - Pre-Alpha pytest (>=3.5.0) :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A @@ -253,6 +253,7 @@ This list contains 997 plugins. :pypi:`pytest-docfiles` pytest plugin to test codeblocks in your documentation. Dec 22, 2021 4 - Beta pytest (>=3.7.0) :pypi:`pytest-docgen` An RST Documentation Generator for pytest-based test suites Apr 17, 2020 N/A N/A :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Jun 14, 2021 N/A pytest (<7.0,>=4.0) + :pypi:`pytest-docker-apache-fixtures` Pytest fixtures for testing with apache2 (httpd). Feb 16, 2022 4 - Beta pytest :pypi:`pytest-docker-butla` Jun 16, 2019 3 - Alpha N/A :pypi:`pytest-dockerc` Run, manage and stop Docker Compose project from Docker API Oct 09, 2020 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-docker-compose` Manages Docker containers during your integration tests Jan 26, 2021 5 - Production/Stable pytest (>=3.3) @@ -265,7 +266,7 @@ This list contains 997 plugins. :pypi:`pytest-docker-py` Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. Nov 27, 2018 N/A pytest (==4.0.0) :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 09, 2022 4 - Beta pytest - :pypi:`pytest-docker-tools` Docker integration tests for pytest Jul 23, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) + :pypi:`pytest-docker-tools` Docker integration tests for pytest Feb 17, 2022 4 - Beta pytest (>=6.0.1) :pypi:`pytest-docs` Documentation tool for pytest Nov 11, 2018 4 - Beta pytest (>=3.5.0) :pypi:`pytest-docstyle` pytest plugin to run pydocstyle Mar 23, 2020 3 - Alpha N/A :pypi:`pytest-doctest-custom` A py.test plugin for customizing string representations of doctest results. Jul 25, 2016 4 - Beta N/A @@ -282,6 +283,7 @@ This list contains 997 plugins. :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A :pypi:`pytest-duration-insights` Jun 25, 2021 N/A N/A + :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Feb 14, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-dynamicrerun` A pytest plugin to rerun tests dynamically based off of test outcome and output. Aug 15, 2020 4 - Beta N/A :pypi:`pytest-dynamodb` DynamoDB fixtures for pytest Jun 03, 2021 5 - Production/Stable pytest :pypi:`pytest-easy-addoption` pytest-easy-addoption: Easy way to work with pytest addoption Jan 22, 2020 N/A N/A @@ -369,7 +371,7 @@ This list contains 997 plugins. :pypi:`pytest-fixture-typecheck` A pytest plugin to assert type annotations at runtime. Aug 24, 2021 N/A pytest :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Dec 16, 2020 4 - Beta pytest (>=3.5) :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. Jan 10, 2022 5 - Production/Stable pytest - :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Jan 25, 2022 4 - Beta pytest (>=6.0) + :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Feb 16, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-flakefinder` Runs tests multiple times to expose flakiness. Jul 28, 2020 4 - Beta pytest (>=2.7.1) :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) :pypi:`pytest-flaptastic` Flaptastic py.test plugin Mar 17, 2019 N/A N/A @@ -378,13 +380,13 @@ This list contains 997 plugins. :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) :pypi:`pytest-flyte` Pytest fixtures for simplifying Flyte integration testing May 03, 2021 N/A pytest :pypi:`pytest-focus` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest - :pypi:`pytest-fold` Fold console output and drop user into interactive text user interface Feb 06, 2022 3 - Alpha pytest (>=6.2.5) + :pypi:`pytest-fold` Fold console output and drop user into interactive text user interface Feb 19, 2022 3 - Alpha pytest (>=6.2.5) :pypi:`pytest-forcefail` py.test plugin to make the test failing regardless of pytest.mark.xfail May 15, 2018 4 - Beta N/A :pypi:`pytest-forward-compatability` A name to avoid typosquating pytest-foward-compatibility Sep 06, 2020 N/A N/A :pypi:`pytest-forward-compatibility` A pytest plugin to shim pytest commandline options for fowards compatibility Sep 29, 2020 N/A N/A :pypi:`pytest-freezegun` Wrap tests with fixtures in freeze_time Jul 19, 2020 4 - Beta pytest (>=3.0.0) :pypi:`pytest-freeze-reqs` Check if requirement files are frozen Apr 29, 2021 N/A N/A - :pypi:`pytest-frozen-uuids` Deterministically frozen UUID's for your tests Dec 08, 2021 N/A pytest (>=3.0) + :pypi:`pytest-frozen-uuids` Deterministically frozen UUID's for your tests Feb 14, 2022 N/A pytest (>=3.0) :pypi:`pytest-func-cov` Pytest plugin for measuring function coverage Apr 15, 2021 3 - Alpha pytest (>=5) :pypi:`pytest-funparam` An alternative way to parametrize test cases. Dec 02, 2021 4 - Beta pytest >=4.6.0 :pypi:`pytest-fxa` pytest plugin for Firefox Accounts Aug 28, 2018 5 - Production/Stable N/A @@ -420,7 +422,7 @@ This list contains 997 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Feb 12, 2022 3 - Alpha pytest (==6.2.5) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Feb 19, 2022 3 - Alpha pytest (==6.2.5) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jan 20, 2022 N/A pytest (>=5.0) @@ -430,7 +432,7 @@ This list contains 997 plugins. :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Feb 06, 2022 5 - Production/Stable N/A :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) - :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 11, 2022 N/A N/A + :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A :pypi:`pytest-html-thread` pytest plugin for generating HTML reports Dec 29, 2020 5 - Production/Stable N/A :pypi:`pytest-http` Fixture "http" for http requests Dec 05, 2019 N/A N/A :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Dec 25, 2021 5 - Production/Stable N/A @@ -464,7 +466,7 @@ This list contains 997 plugins. :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) - :pypi:`pytest-invenio` Pytest fixtures for Invenio. May 11, 2021 5 - Production/Stable pytest (<7,>=6) + :pypi:`pytest-invenio` Pytest fixtures for Invenio. Feb 17, 2022 5 - Production/Stable pytest (<7,>=6) :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A @@ -475,7 +477,7 @@ This list contains 997 plugins. :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Dec 02, 2021 3 - Alpha N/A - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Dec 10, 2021 3 - Alpha pytest + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Feb 17, 2022 3 - Alpha pytest :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A @@ -550,7 +552,7 @@ This list contains 997 plugins. :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Feb 08, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Feb 17, 2022 N/A pytest (>=1.0) :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A @@ -578,7 +580,7 @@ This list contains 997 plugins. :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Jan 11, 2022 3 - Alpha pytest (>=6.0.0) :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A N/A :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Jun 13, 2021 N/A pytest - :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 11, 2022 5 - Production/Stable pytest (>=6.2) + :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 15, 2022 5 - Production/Stable pytest (>=6.2) :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) :pypi:`pytest-network` A simple plugin to disable network on socket level. May 07, 2020 N/A N/A @@ -608,7 +610,7 @@ This list contains 997 plugins. :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Jan 19, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Jan 31, 2022 N/A N/A + :pypi:`pytest-operator` Fixtures for Operators Feb 14, 2022 N/A N/A :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -766,6 +768,7 @@ This list contains 997 plugins. :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed Jan 10, 2022 5 - Production/Stable pytest :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A :pypi:`pytest-reverse` Pytest plugin to reverse test order. Jan 10, 2022 5 - Production/Stable pytest + :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) :pypi:`pytest-ringo` pytest plugin to test webapplications using the Ringo webframework Sep 27, 2017 3 - Alpha N/A :pypi:`pytest-rng` Fixtures for seeding tests and making randomness reproducible Aug 08, 2019 5 - Production/Stable pytest :pypi:`pytest-roast` pytest plugin for ROAST configuration override and fixtures Jul 29, 2021 5 - Production/Stable pytest @@ -781,19 +784,19 @@ This list contains 997 plugins. :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A - :pypi:`pytest-salt-factories` Pytest Salt Plugin Jan 27, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Feb 19, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Feb 11, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Feb 15, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Aug 31, 2020 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Feb 11, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Feb 15, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -807,7 +810,7 @@ This list contains 997 plugins. :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Nov 07, 2021 N/A N/A - :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Feb 05, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Feb 17, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 5 - Production/Stable pytest (>=3.5.1) :pypi:`pytest-shortcuts` Expand command-line shortcuts listed in pytest configuration Oct 29, 2020 4 - Beta pytest (>=3.5.0) @@ -816,7 +819,7 @@ This list contains 997 plugins. :pypi:`pytest-simple-plugin` Simple pytest plugin Nov 27, 2019 N/A N/A :pypi:`pytest-simple-settings` simple-settings plugin for pytest Nov 17, 2020 4 - Beta pytest :pypi:`pytest-single-file-logging` Allow for multiple processes to log to a single file May 05, 2016 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-skip-markers` Pytest Salt Plugin Feb 05, 2022 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-skip-markers` Pytest Salt Plugin Feb 16, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-skipper` A plugin that selects only tests with changes in execution path Mar 26, 2017 3 - Alpha pytest (>=3.0.6) :pypi:`pytest-skippy` Automatically skip tests that don't need to run! Jan 27, 2018 3 - Alpha pytest (>=2.3.4) :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A @@ -835,7 +838,7 @@ This list contains 997 plugins. :pypi:`pytest-solidity` A PyTest library plugin for Solidity language. Jan 15, 2022 1 - Planning pytest (<7,>=6.0.1) ; extra == 'tests' :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) :pypi:`pytest-sorter` A simple plugin to first execute tests that historically failed more Apr 20, 2021 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Dec 20, 2021 2 - Pre-Alpha pytest + :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Feb 17, 2022 2 - Pre-Alpha pytest :pypi:`pytest-sourceorder` Test-ordering plugin for pytest Sep 01, 2021 4 - Beta pytest :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. Feb 23, 2020 4 - Beta pytest :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A @@ -848,13 +851,13 @@ This list contains 997 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Jan 25, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Feb 18, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Feb 07, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Mar 13, 2018 3 - Alpha N/A :pypi:`pytest-sql-bigquery` Yet another SQL-testing framework for BigQuery provided by pytest plugin Dec 19, 2019 N/A pytest - :pypi:`pytest-squadcast` Pytest report plugin for Squadcast Feb 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-squadcast` Pytest report plugin for Squadcast Feb 18, 2022 5 - Production/Stable pytest :pypi:`pytest-srcpaths` Add paths to sys.path Oct 15, 2021 N/A N/A :pypi:`pytest-ssh` pytest plugin for ssh command run May 27, 2019 N/A pytest :pypi:`pytest-start-from` Start pytest run from a given point Apr 11, 2016 N/A N/A @@ -871,14 +874,14 @@ This list contains 997 plugins. :pypi:`pytest-study` A pytest plugin to organize long run tests (named studies) without interfering the regular tests Sep 26, 2017 3 - Alpha pytest (>=2.0) :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Feb 09, 2022 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Mar 02, 2021 N/A N/A - :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Jan 15, 2022 4 - Beta pytest (>=6.0) + :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Feb 13, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Jul 06, 2020 3 - Alpha N/A :pypi:`pytest-sugar-bugfix159` Workaround for https://github.com/Frozenball/pytest-sugar/issues/159 Nov 07, 2018 5 - Production/Stable pytest (!=3.7.3,>=3.5); extra == 'testing' :pypi:`pytest-super-check` Pytest plugin to check your TestCase classes call super in setUp, tearDown, etc. Jan 10, 2022 5 - Production/Stable pytest :pypi:`pytest-svn` SVN repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-symbols` pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. Nov 20, 2017 3 - Alpha N/A - :pypi:`pytest-system-statistics` Pytest plugin to track and report system usage statistics Jan 26, 2022 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-system-statistics` Pytest plugin to track and report system usage statistics Feb 16, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-system-test-plugin` Pyst - Pytest System-Test Plugin Feb 03, 2022 N/A N/A :pypi:`pytest-takeltest` Fixtures for ansible, testinfra and molecule Jan 04, 2022 N/A N/A :pypi:`pytest-talisker` Nov 28, 2021 N/A N/A @@ -898,7 +901,7 @@ This list contains 997 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Feb 10, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Feb 05, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Feb 18, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) @@ -951,7 +954,7 @@ This list contains 997 plugins. :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Nov 03, 2021 4 - Beta N/A + :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Feb 14, 2022 4 - Beta N/A :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) :pypi:`pytest-ubersmith` Easily mock calls to ubersmith at the \`requests\` level. Apr 13, 2015 N/A N/A :pypi:`pytest-ui` Text User Interface for running python tests Jul 05, 2021 4 - Beta pytest @@ -1028,7 +1031,7 @@ This list contains 997 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: Feb 01, 2022, + *last release*: Feb 14, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1637,7 +1640,7 @@ This list contains 997 plugins. Local continuous test runner with pytest and watchdog. :pypi:`pytest-bootstrap` - *last release*: Jan 28, 2022, + *last release*: Feb 19, 2022, *status*: N/A, *requires*: N/A @@ -1651,7 +1654,7 @@ This list contains 997 plugins. A py.test plug-in to enable drop to bpdb debugger on test failure. :pypi:`pytest-bravado` - *last release*: Jul 19, 2021, + *last release*: Feb 15, 2022, *status*: N/A, *requires*: N/A @@ -1756,7 +1759,7 @@ This list contains 997 plugins. pytest plugin with mechanisms for caching across test runs :pypi:`pytest-cache-assert` - *last release*: Nov 03, 2021, + *last release*: Feb 18, 2022, *status*: 4 - Beta, *requires*: pytest (>=5) @@ -1770,11 +1773,11 @@ This list contains 997 plugins. Pytest plugin to only run tests affected by changes :pypi:`pytest-cairo` - *last release*: Feb 04, 2022, + *last release*: Feb 19, 2022, *status*: N/A, *requires*: pytest - + Pytest support for cairo-lang and starknet :pypi:`pytest-camel-collect` *last release*: Aug 02, 2020, @@ -2665,6 +2668,13 @@ This list contains 997 plugins. Simple pytest fixtures for Docker and docker-compose based tests + :pypi:`pytest-docker-apache-fixtures` + *last release*: Feb 16, 2022, + *status*: 4 - Beta, + *requires*: pytest + + Pytest fixtures for testing with apache2 (httpd). + :pypi:`pytest-docker-butla` *last release*: Jun 16, 2019, *status*: 3 - Alpha, @@ -2750,9 +2760,9 @@ This list contains 997 plugins. Pytest fixtures for testing with squid. :pypi:`pytest-docker-tools` - *last release*: Jul 23, 2021, + *last release*: Feb 17, 2022, *status*: 4 - Beta, - *requires*: pytest (>=6.0.1,<7.0.0) + *requires*: pytest (>=6.0.1) Docker integration tests for pytest @@ -2868,6 +2878,13 @@ This list contains 997 plugins. + :pypi:`pytest-durations` + *last release*: Feb 14, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest (>=4.6) + + Pytest plugin reporting fixtures and test functions execution time. + :pypi:`pytest-dynamicrerun` *last release*: Aug 15, 2020, *status*: 4 - Beta, @@ -3478,9 +3495,9 @@ This list contains 997 plugins. A pytest fixture for testing flake8 plugins. :pypi:`pytest-flake8-v2` - *last release*: Jan 25, 2022, + *last release*: Feb 16, 2022, *status*: 4 - Beta, - *requires*: pytest (>=6.0) + *requires*: pytest (>=7.0) pytest plugin to check FLAKE8 requirements @@ -3541,7 +3558,7 @@ This list contains 997 plugins. A pytest plugin that alerts user of failed test cases with screen notifications :pypi:`pytest-fold` - *last release*: Feb 06, 2022, + *last release*: Feb 19, 2022, *status*: 3 - Alpha, *requires*: pytest (>=6.2.5) @@ -3583,7 +3600,7 @@ This list contains 997 plugins. Check if requirement files are frozen :pypi:`pytest-frozen-uuids` - *last release*: Dec 08, 2021, + *last release*: Feb 14, 2022, *status*: N/A, *requires*: pytest (>=3.0) @@ -3835,7 +3852,7 @@ This list contains 997 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Feb 12, 2022, + *last release*: Feb 19, 2022, *status*: 3 - Alpha, *requires*: pytest (==6.2.5) @@ -3905,7 +3922,7 @@ This list contains 997 plugins. Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. :pypi:`pytest-html-reporter` - *last release*: Feb 11, 2022, + *last release*: Feb 13, 2022, *status*: N/A, *requires*: N/A @@ -4143,7 +4160,7 @@ This list contains 997 plugins. Pytest plugin for intercepting outgoing connection requests during pytest run. :pypi:`pytest-invenio` - *last release*: May 11, 2021, + *last release*: Feb 17, 2022, *status*: 5 - Production/Stable, *requires*: pytest (<7,>=6) @@ -4220,7 +4237,7 @@ This list contains 997 plugins. py.test JIRA integration plugin, using markers :pypi:`pytest-jira-xray` - *last release*: Dec 10, 2021, + *last release*: Feb 17, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -4745,7 +4762,7 @@ This list contains 997 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Feb 08, 2022, + *last release*: Feb 17, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -4941,7 +4958,7 @@ This list contains 997 plugins. Pytest plugin to check mypy output. :pypi:`pytest-mysql` - *last release*: Feb 11, 2022, + *last release*: Feb 15, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2) @@ -5151,7 +5168,7 @@ This list contains 997 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: Jan 31, 2022, + *last release*: Feb 14, 2022, *status*: N/A, *requires*: N/A @@ -6256,6 +6273,13 @@ This list contains 997 plugins. Pytest plugin to reverse test order. + :pypi:`pytest-rich-reporter` + *last release*: Feb 17, 2022, + *status*: 1 - Planning, + *requires*: pytest (>=5.0.0) + + A pytest plugin using Rich for beautiful test result formatting. + :pypi:`pytest-ringo` *last release*: Sep 27, 2017, *status*: 3 - Alpha, @@ -6362,7 +6386,7 @@ This list contains 997 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Jan 27, 2022, + *last release*: Feb 19, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6404,7 +6428,7 @@ This list contains 997 plugins. :pypi:`pytest-sbase` - *last release*: Feb 11, 2022, + *last release*: Feb 15, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6446,7 +6470,7 @@ This list contains 997 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Feb 11, 2022, + *last release*: Feb 15, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6544,7 +6568,7 @@ This list contains 997 plugins. A pytest plugin to help with testing shell scripts / black box commands :pypi:`pytest-shell-utilities` - *last release*: Feb 05, 2022, + *last release*: Feb 17, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6607,7 +6631,7 @@ This list contains 997 plugins. Allow for multiple processes to log to a single file :pypi:`pytest-skip-markers` - *last release*: Feb 05, 2022, + *last release*: Feb 16, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.0.0) @@ -6740,7 +6764,7 @@ This list contains 997 plugins. A simple plugin to first execute tests that historically failed more :pypi:`pytest-sosu` - *last release*: Dec 20, 2021, + *last release*: Feb 17, 2022, *status*: 2 - Pre-Alpha, *requires*: pytest @@ -6831,7 +6855,7 @@ This list contains 997 plugins. :pypi:`pytest-splunk-addon` - *last release*: Jan 25, 2022, + *last release*: Feb 18, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -6873,7 +6897,7 @@ This list contains 997 plugins. Yet another SQL-testing framework for BigQuery provided by pytest plugin :pypi:`pytest-squadcast` - *last release*: Feb 11, 2022, + *last release*: Feb 18, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6992,9 +7016,9 @@ This list contains 997 plugins. A hack to explicitly set up and tear down fixtures. :pypi:`pytest-subtests` - *last release*: Jan 15, 2022, + *last release*: Feb 13, 2022, *status*: 4 - Beta, - *requires*: pytest (>=6.0) + *requires*: pytest (>=7.0) unittest subTest() support and subtests fixture @@ -7041,7 +7065,7 @@ This list contains 997 plugins. pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. :pypi:`pytest-system-statistics` - *last release*: Jan 26, 2022, + *last release*: Feb 16, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.0.0) @@ -7181,7 +7205,7 @@ This list contains 997 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Feb 05, 2022, + *last release*: Feb 18, 2022, *status*: 4 - Beta, *requires*: N/A @@ -7552,7 +7576,7 @@ This list contains 997 plugins. Run type checkers on specified test files :pypi:`pytest-typhoon-xray` - *last release*: Nov 03, 2021, + *last release*: Feb 14, 2022, *status*: 4 - Beta, *requires*: N/A From 7b6e477e2f55f143a490c7d206eac5a7e005b392 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 23 Feb 2022 15:59:54 +0200 Subject: [PATCH 157/549] Revert "Deprecate raising unittest.SkipTest to skip tests during collection" (#9710) This reverts commit 25e657bfc15aecd8fa8787a028ffc10fc9ac96d5. Turns out that this *is* a working unittest feature, which pytest should support, so undo the deprecation. --- changelog/8242.bugfix.rst | 3 +++ doc/en/changelog.rst | 2 ++ doc/en/deprecations.rst | 13 ------------- src/_pytest/deprecated.py | 5 ----- src/_pytest/runner.py | 7 ------- testing/deprecated_test.py | 17 ----------------- testing/test_nose.py | 2 +- testing/test_unittest.py | 27 +++++++++++++++++++++++++++ 8 files changed, 33 insertions(+), 43 deletions(-) create mode 100644 changelog/8242.bugfix.rst diff --git a/changelog/8242.bugfix.rst b/changelog/8242.bugfix.rst new file mode 100644 index 00000000000..eaa46142eea --- /dev/null +++ b/changelog/8242.bugfix.rst @@ -0,0 +1,3 @@ +The deprecation of raising :class:`unittest.SkipTest` to skip collection of +tests during the pytest collection phase is reverted - this is now a supported +feature again. diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 1acdad366da..41a79ce5b2f 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -211,6 +211,8 @@ Deprecations :class:`unittest.SkipTest` / :meth:`unittest.TestCase.skipTest` / :func:`unittest.skip` in unittest test cases is fully supported. + .. note:: This deprecation has been reverted in pytest 7.1.0. + - `#8315 `_: Several behaviors of :meth:`Parser.addoption ` are now scheduled for removal in pytest 8 (deprecated since pytest 2.4.0): diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index 4eaa80e2f27..1210947159b 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -241,19 +241,6 @@ scheduled for removal in pytest 8 (deprecated since pytest 2.4.0): - ``parser.addoption(..., type="int/string/float/complex")`` - use ``type=int`` etc. instead. -Raising ``unittest.SkipTest`` during collection -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. deprecated:: 7.0 - -Raising :class:`unittest.SkipTest` to skip collection of tests during the -pytest collection phase is deprecated. Use :func:`pytest.skip` instead. - -Note: This deprecation only relates to using `unittest.SkipTest` during test -collection. You are probably not doing that. Ordinary usage of -:class:`unittest.SkipTest` / :meth:`unittest.TestCase.skipTest` / -:func:`unittest.skip` in unittest test cases is fully supported. - Using ``pytest.warns(None)`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index 4534fbcab82..f2d79760ae7 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -47,11 +47,6 @@ # This deprecation is never really meant to be removed. PRIVATE = PytestDeprecationWarning("A private pytest class or function was used.") -UNITTEST_SKIP_DURING_COLLECTION = PytestRemovedIn8Warning( - "Raising unittest.SkipTest to skip tests during collection is deprecated. " - "Use pytest.skip() instead." -) - ARGUMENT_PERCENT_DEFAULT = PytestRemovedIn8Warning( 'pytest now uses argparse. "%default" should be changed to "%(default)s"', ) diff --git a/src/_pytest/runner.py b/src/_pytest/runner.py index e43dd2dc818..df6eecdb129 100644 --- a/src/_pytest/runner.py +++ b/src/_pytest/runner.py @@ -2,7 +2,6 @@ import bdb import os import sys -import warnings from typing import Callable from typing import cast from typing import Dict @@ -28,7 +27,6 @@ from _pytest.compat import final from _pytest.config.argparsing import Parser from _pytest.deprecated import check_ispytest -from _pytest.deprecated import UNITTEST_SKIP_DURING_COLLECTION from _pytest.nodes import Collector from _pytest.nodes import Item from _pytest.nodes import Node @@ -379,11 +377,6 @@ def pytest_make_collect_report(collector: Collector) -> CollectReport: # Type ignored because unittest is loaded dynamically. skip_exceptions.append(unittest.SkipTest) # type: ignore if isinstance(call.excinfo.value, tuple(skip_exceptions)): - if unittest is not None and isinstance( - call.excinfo.value, unittest.SkipTest # type: ignore[attr-defined] - ): - warnings.warn(UNITTEST_SKIP_DURING_COLLECTION, stacklevel=2) - outcome = "skipped" r_ = collector._repr_failure_py(call.excinfo, "line") assert isinstance(r_, ExceptionChainRepr), repr(r_) diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index 4104d19db9a..db649841abe 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -86,23 +86,6 @@ def __init__(self, foo: int, *, _ispytest: bool = False) -> None: PrivateInit(10, _ispytest=True) -def test_raising_unittest_skiptest_during_collection_is_deprecated( - pytester: Pytester, -) -> None: - pytester.makepyfile( - """ - import unittest - raise unittest.SkipTest() - """ - ) - result = pytester.runpytest() - result.stdout.fnmatch_lines( - [ - "*PytestRemovedIn8Warning: Raising unittest.SkipTest*", - ] - ) - - @pytest.mark.parametrize("hooktype", ["hook", "ihook"]) def test_hookproxy_warnings_for_pathlib(tmp_path, hooktype, request): path = legacy_path(tmp_path) diff --git a/testing/test_nose.py b/testing/test_nose.py index 1ded8854bb7..cab5a81a2b9 100644 --- a/testing/test_nose.py +++ b/testing/test_nose.py @@ -345,7 +345,7 @@ def test_failing(): """ ) result = pytester.runpytest(p) - result.assert_outcomes(skipped=1, warnings=1) + result.assert_outcomes(skipped=1, warnings=0) def test_SkipTest_in_test(pytester: Pytester) -> None: diff --git a/testing/test_unittest.py b/testing/test_unittest.py index 1601086d5b2..fb312814542 100644 --- a/testing/test_unittest.py +++ b/testing/test_unittest.py @@ -1498,3 +1498,30 @@ def test_it(self): assert passed == 1 assert failed == 1 assert reprec.ret == 1 + + +def test_raising_unittest_skiptest_during_collection( + pytester: Pytester, +) -> None: + pytester.makepyfile( + """ + import unittest + + class TestIt(unittest.TestCase): + def test_it(self): pass + def test_it2(self): pass + + raise unittest.SkipTest() + + class TestIt2(unittest.TestCase): + def test_it(self): pass + def test_it2(self): pass + """ + ) + reprec = pytester.inline_run() + passed, skipped, failed = reprec.countoutcomes() + assert passed == 0 + # Unittest reports one fake test for a skipped module. + assert skipped == 1 + assert failed == 0 + assert reprec.ret == ExitCode.NO_TESTS_COLLECTED From bcc826d0fbc60ac5b4e5ecc691db42abf5a616df Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 23 Feb 2022 19:03:13 -0300 Subject: [PATCH 158/549] Fix numbering and improve changelog entry for #9362 (#9713) --- changelog/9326.bugfix.rst | 1 - changelog/9362.improvement.rst | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 changelog/9326.bugfix.rst create mode 100644 changelog/9362.improvement.rst diff --git a/changelog/9326.bugfix.rst b/changelog/9326.bugfix.rst deleted file mode 100644 index 1aaa424d371..00000000000 --- a/changelog/9326.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Pytest will now avoid specialized assert formatting when it is detected that the default __eq__ is overridden diff --git a/changelog/9362.improvement.rst b/changelog/9362.improvement.rst new file mode 100644 index 00000000000..ad7f8042ca9 --- /dev/null +++ b/changelog/9362.improvement.rst @@ -0,0 +1 @@ +pytest now avoids specialized assert formatting when it is detected that the default ``__eq__`` is overridden in ``attrs`` or ``dataclasses``. From 5f3d94c47eb0f4487ef52ac520b3c48170220fc6 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 24 Feb 2022 10:16:35 -0300 Subject: [PATCH 159/549] Disallow unordered sequences in pytest.approx (#9709) Fix #9692 --- changelog/9692.improvement.rst | 3 +++ src/_pytest/python_api.py | 40 ++++++++++++++++++++++++---------- testing/python/approx.py | 20 ++++++++++++----- 3 files changed, 45 insertions(+), 18 deletions(-) create mode 100644 changelog/9692.improvement.rst diff --git a/changelog/9692.improvement.rst b/changelog/9692.improvement.rst new file mode 100644 index 00000000000..ecc57a68c22 --- /dev/null +++ b/changelog/9692.improvement.rst @@ -0,0 +1,3 @@ +:func:`pytest.approx` now raises a :class:`TypeError` when given an unordered sequence (such as :class:`set`). + +Note that this implies that custom classes which only implement ``__iter__`` and ``__len__`` are no longer supported as they don't guarantee order. diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 9891946cd1e..ea646811ddf 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -1,5 +1,6 @@ import math import pprint +from collections.abc import Collection from collections.abc import Sized from decimal import Decimal from numbers import Complex @@ -8,7 +9,6 @@ from typing import Callable from typing import cast from typing import Generic -from typing import Iterable from typing import List from typing import Mapping from typing import Optional @@ -306,12 +306,12 @@ def _check_type(self) -> None: raise TypeError(msg.format(key, value, pprint.pformat(self.expected))) -class ApproxSequencelike(ApproxBase): +class ApproxSequenceLike(ApproxBase): """Perform approximate comparisons where the expected value is a sequence of numbers.""" def __repr__(self) -> str: seq_type = type(self.expected) - if seq_type not in (tuple, list, set): + if seq_type not in (tuple, list): seq_type = list return "approx({!r})".format( seq_type(self._approx_scalar(x) for x in self.expected) @@ -515,7 +515,7 @@ class ApproxDecimal(ApproxScalar): def approx(expected, rel=None, abs=None, nan_ok: bool = False) -> ApproxBase: - """Assert that two numbers (or two sets of numbers) are equal to each other + """Assert that two numbers (or two ordered sequences of numbers) are equal to each other within some tolerance. Due to the :std:doc:`tutorial/floatingpoint`, numbers that we @@ -547,16 +547,11 @@ def approx(expected, rel=None, abs=None, nan_ok: bool = False) -> ApproxBase: >>> 0.1 + 0.2 == approx(0.3) True - The same syntax also works for sequences of numbers:: + The same syntax also works for ordered sequences of numbers:: >>> (0.1 + 0.2, 0.2 + 0.4) == approx((0.3, 0.6)) True - Dictionary *values*:: - - >>> {'a': 0.1 + 0.2, 'b': 0.2 + 0.4} == approx({'a': 0.3, 'b': 0.6}) - True - ``numpy`` arrays:: >>> import numpy as np # doctest: +SKIP @@ -569,6 +564,20 @@ def approx(expected, rel=None, abs=None, nan_ok: bool = False) -> ApproxBase: >>> np.array([0.1, 0.2]) + np.array([0.2, 0.1]) == approx(0.3) # doctest: +SKIP True + Only ordered sequences are supported, because ``approx`` needs + to infer the relative position of the sequences without ambiguity. This means + ``sets`` and other unordered sequences are not supported. + + Finally, dictionary *values* can also be compared:: + + >>> {'a': 0.1 + 0.2, 'b': 0.2 + 0.4} == approx({'a': 0.3, 'b': 0.6}) + True + + The comparision will be true if both mappings have the same keys and their + respective values match the expected tolerances. + + **Tolerances** + By default, ``approx`` considers numbers within a relative tolerance of ``1e-6`` (i.e. one part in a million) of its expected value to be equal. This treatment would lead to surprising results if the expected value was @@ -708,12 +717,19 @@ def approx(expected, rel=None, abs=None, nan_ok: bool = False) -> ApproxBase: expected = _as_numpy_array(expected) cls = ApproxNumpy elif ( - isinstance(expected, Iterable) + hasattr(expected, "__getitem__") and isinstance(expected, Sized) # Type ignored because the error is wrong -- not unreachable. and not isinstance(expected, STRING_TYPES) # type: ignore[unreachable] ): - cls = ApproxSequencelike + cls = ApproxSequenceLike + elif ( + isinstance(expected, Collection) + # Type ignored because the error is wrong -- not unreachable. + and not isinstance(expected, STRING_TYPES) # type: ignore[unreachable] + ): + msg = f"pytest.approx() only supports ordered sequences, but got: {repr(expected)}" + raise TypeError(msg) else: cls = ApproxScalar diff --git a/testing/python/approx.py b/testing/python/approx.py index eb9bcd874c0..2eec4e9f7d0 100644 --- a/testing/python/approx.py +++ b/testing/python/approx.py @@ -858,13 +858,21 @@ def test_numpy_scalar_with_array(self): assert approx(expected, rel=5e-7, abs=0) == actual assert approx(expected, rel=5e-8, abs=0) != actual - def test_generic_sized_iterable_object(self): - class MySizedIterable: - def __iter__(self): - return iter([1, 2, 3, 4]) + def test_generic_ordered_sequence(self): + class MySequence: + def __getitem__(self, i): + return [1, 2, 3, 4][i] def __len__(self): return 4 - expected = MySizedIterable() - assert [1, 2, 3, 4] == approx(expected) + expected = MySequence() + assert [1, 2, 3, 4] == approx(expected, abs=1e-4) + + expected_repr = "approx([1 ± 1.0e-06, 2 ± 2.0e-06, 3 ± 3.0e-06, 4 ± 4.0e-06])" + assert repr(approx(expected)) == expected_repr + + def test_allow_ordered_sequences_only(self) -> None: + """pytest.approx() should raise an error on unordered sequences (#9692).""" + with pytest.raises(TypeError, match="only supports ordered sequences"): + assert {1, 2, 3} == approx({1, 2, 3}) From e466a87bb082ea5f7377f84038322e9bc8fba789 Mon Sep 17 00:00:00 2001 From: Kojo Idrissa Date: Fri, 25 Feb 2022 16:13:23 -0600 Subject: [PATCH 160/549] Add the latest book edition of 'Python Testing with pytest' --- AUTHORS | 1 + doc/en/talks.rst | 3 +++ 2 files changed, 4 insertions(+) diff --git a/AUTHORS b/AUTHORS index 9413f9c2e74..2b6ca66de7a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -187,6 +187,7 @@ Kevin Cox Kevin J. Foley Kian-Meng Ang Kodi B. Arfer +Kojo Idrissa Kostis Anagnostopoulos Kristoffer Nordström Kyle Altendorf diff --git a/doc/en/talks.rst b/doc/en/talks.rst index 6843c82bab5..0b195960ab2 100644 --- a/doc/en/talks.rst +++ b/doc/en/talks.rst @@ -11,6 +11,9 @@ Books - `Python Testing with pytest, by Brian Okken (2017) `_. +- `Python Testing with pytest, Second Edition, by Brian Okken (2022) + `_. + Talks and blog postings --------------------------------------------- From 269611e0b43d374643a4b110c55aaee57d71d91a Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 28 Feb 2022 19:35:36 -0500 Subject: [PATCH 161/549] prevent import-time side-effects from setuptools bundled importlib-metadata --- testing/test_doctest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test_doctest.py b/testing/test_doctest.py index 67b8ccdb7ec..1b4809240c0 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -803,8 +803,8 @@ def test_valid_setup_py(self, pytester: Pytester): """ p = pytester.makepyfile( setup=""" - from setuptools import setup, find_packages if __name__ == '__main__': + from setuptools import setup, find_packages setup(name='sample', version='0.0', description='description', From f943d1944a9ece4fc5b1b3a83046380fd2ff3fc4 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 25 Feb 2022 08:15:11 -0300 Subject: [PATCH 162/549] pytester now requests monkeypatch instead of creating its own instance It is tempting to use `monkeypatch` to replace the other mechanisms in pytester which change global state: `CwdSnapshot`, `SysModulesSnapshot`, `SysPathsSnapshot`, however those are more delicate than they look at first glance so leaving those alone for now. Close #9708 --- changelog/9708.bugfix.rst | 1 + src/_pytest/pytester.py | 10 ++++++---- testing/test_pytester.py | 7 +------ 3 files changed, 8 insertions(+), 10 deletions(-) create mode 100644 changelog/9708.bugfix.rst diff --git a/changelog/9708.bugfix.rst b/changelog/9708.bugfix.rst new file mode 100644 index 00000000000..9defbbd578f --- /dev/null +++ b/changelog/9708.bugfix.rst @@ -0,0 +1 @@ +:fixture:`pytester` now requests a :fixture:`monkeypatch` fixture instead of creating one internally. This solves some issues with tests that involve pytest environment variables. diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 933d7d35759..8368f944122 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -477,7 +477,9 @@ def LineMatcher_fixture(request: FixtureRequest) -> Type["LineMatcher"]: @fixture -def pytester(request: FixtureRequest, tmp_path_factory: TempPathFactory) -> "Pytester": +def pytester( + request: FixtureRequest, tmp_path_factory: TempPathFactory, monkeypatch: MonkeyPatch +) -> "Pytester": """ Facilities to write tests/configuration files, execute pytest in isolation, and match against expected output, perfect for black-box testing of pytest plugins. @@ -488,7 +490,7 @@ def pytester(request: FixtureRequest, tmp_path_factory: TempPathFactory) -> "Pyt It is particularly useful for testing plugins. It is similar to the :fixture:`tmp_path` fixture but provides methods which aid in testing pytest itself. """ - return Pytester(request, tmp_path_factory, _ispytest=True) + return Pytester(request, tmp_path_factory, monkeypatch, _ispytest=True) @fixture @@ -683,6 +685,7 @@ def __init__( self, request: FixtureRequest, tmp_path_factory: TempPathFactory, + monkeypatch: MonkeyPatch, *, _ispytest: bool = False, ) -> None: @@ -706,7 +709,7 @@ def __init__( self._method = self._request.config.getoption("--runpytest") self._test_tmproot = tmp_path_factory.mktemp(f"tmp-{name}", numbered=True) - self._monkeypatch = mp = MonkeyPatch() + self._monkeypatch = mp = monkeypatch mp.setenv("PYTEST_DEBUG_TEMPROOT", str(self._test_tmproot)) # Ensure no unexpected caching via tox. mp.delenv("TOX_ENV_DIR", raising=False) @@ -738,7 +741,6 @@ def _finalize(self) -> None: self._sys_modules_snapshot.restore() self._sys_path_snapshot.restore() self._cwd_snapshot.restore() - self._monkeypatch.undo() def __take_sys_modules_snapshot(self) -> SysModulesSnapshot: # Some zope modules used by twisted-related tests keep internal state diff --git a/testing/test_pytester.py b/testing/test_pytester.py index 049f8b22d81..62dad98589d 100644 --- a/testing/test_pytester.py +++ b/testing/test_pytester.py @@ -618,14 +618,9 @@ def test_linematcher_string_api() -> None: def test_pytest_addopts_before_pytester(request, monkeypatch: MonkeyPatch) -> None: - orig = os.environ.get("PYTEST_ADDOPTS", None) monkeypatch.setenv("PYTEST_ADDOPTS", "--orig-unused") - pytester: Pytester = request.getfixturevalue("pytester") + _: Pytester = request.getfixturevalue("pytester") assert "PYTEST_ADDOPTS" not in os.environ - pytester._finalize() - assert os.environ.get("PYTEST_ADDOPTS") == "--orig-unused" - monkeypatch.undo() - assert os.environ.get("PYTEST_ADDOPTS") == orig def test_run_stdin(pytester: Pytester) -> None: From cf0a4f79b070190dd07d690418a5a2a930701dfa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 4 Mar 2022 12:56:11 -0300 Subject: [PATCH 163/549] [automated] Update plugin list (#9717) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 202 +++++++++++++++++-------------- 1 file changed, 113 insertions(+), 89 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 938246fabc0..e36f21c6750 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1000 plugins. +This list contains 1003 plugins. .. only:: not latex @@ -19,7 +19,7 @@ This list contains 1000 plugins. name summary last release status requires =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Feb 14, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Feb 22, 2022 N/A pytest (>=5.4.0) :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) @@ -29,7 +29,7 @@ This list contains 1000 plugins. :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Nov 01, 2020 N/A pytest (>=6) - :pypi:`pytest-aiomoto` pytest-aiomoto Dec 10, 2021 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-aiomoto` pytest-aiomoto Feb 24, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) @@ -38,6 +38,7 @@ This list contains 1000 plugins. :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) + :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Feb 21, 2022 N/A pytest :pypi:`pytest-allure-dsl` pytest plugin to test case doc string dls instructions Oct 25, 2020 4 - Beta pytest :pypi:`pytest-allure-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) @@ -106,7 +107,7 @@ This list contains 1000 plugins. :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A :pypi:`pytest-board` Local continuous test runner with pytest and watchdog. Jan 20, 2019 N/A N/A - :pypi:`pytest-bootstrap` Feb 19, 2022 N/A N/A + :pypi:`pytest-bootstrap` Feb 23, 2022 N/A N/A :pypi:`pytest-bpdb` A py.test plug-in to enable drop to bpdb debugger on test failure. Jan 19, 2015 2 - Pre-Alpha N/A :pypi:`pytest-bravado` Pytest-bravado automatically generates from OpenAPI specification client fixtures. Feb 15, 2022 N/A N/A :pypi:`pytest-breakword` Use breakword with pytest Aug 04, 2021 N/A pytest (>=6.2.4,<7.0.0) @@ -165,7 +166,7 @@ This list contains 1000 plugins. :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-config` Base configurations and utilities for developing your Python project test suite with pytest. Nov 07, 2014 5 - Production/Stable N/A :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Nov 06, 2020 N/A N/A - :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts Jan 06, 2022 4 - Beta N/A + :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts Feb 23, 2022 4 - Beta N/A :pypi:`pytest-consul` pytest plugin with fixtures for testing consul aware apps Nov 24, 2018 3 - Alpha pytest :pypi:`pytest-container` Pytest fixtures for writing container based tests Feb 01, 2022 3 - Alpha pytest (>=3.10) :pypi:`pytest-contextfixture` Define pytest fixtures as context managers. Mar 12, 2013 4 - Beta N/A @@ -227,6 +228,7 @@ This list contains 1000 plugins. :pypi:`pytest-dicom` pytest plugin to provide DICOM fixtures Dec 19, 2018 3 - Alpha pytest :pypi:`pytest-dictsdiff` Jul 26, 2019 N/A N/A :pypi:`pytest-diff` A simple plugin to use with pytest Mar 30, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-diff-selector` Get tests affected by code changes (using git) Feb 24, 2022 4 - Beta pytest (>=6.2.2) ; extra == 'all' :pypi:`pytest-disable` pytest plugin to disable a test and skip it from testrun Sep 10, 2015 4 - Beta N/A :pypi:`pytest-disable-plugin` Disable plugins per test Feb 28, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. Feb 12, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) @@ -272,8 +274,7 @@ This list contains 1000 plugins. :pypi:`pytest-doctest-custom` A py.test plugin for customizing string representations of doctest results. Jul 25, 2016 4 - Beta N/A :pypi:`pytest-doctest-ellipsis-markers` Setup additional values for ELLIPSIS_MARKER for doctests Jan 12, 2018 4 - Beta N/A :pypi:`pytest-doctest-import` A simple pytest plugin to import names and add them to the doctest namespace. Nov 13, 2018 4 - Beta pytest (>=3.3.0) - :pypi:`pytest-doctestplus` Pytest plugin with advanced doctest features. Dec 09, 2021 3 - Alpha pytest (>=4.6) - :pypi:`pytest-doctest-ufunc` A plugin to run doctests in docstrings of Numpy ufuncs Aug 02, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-doctestplus` Pytest plugin with advanced doctest features. Feb 25, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-dolphin` Some extra stuff that we use ininternally Nov 30, 2016 4 - Beta pytest (==3.0.4) :pypi:`pytest-doorstop` A pytest plugin for adding test results into doorstop items. Jun 09, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-dotenv` A py.test plugin that parses environment files before running tests Jun 16, 2020 4 - Beta pytest (>=5.0.0) @@ -297,14 +298,14 @@ This list contains 1000 plugins. :pypi:`pytest-elements` Tool to help automate user interfaces Jan 13, 2021 N/A pytest (>=5.4,<6.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Jan 21, 2022 N/A pytest (>=6.2.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jan 21, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jan 21, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jan 21, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jan 21, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Feb 22, 2022 N/A pytest (>=6.2.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Feb 22, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Feb 22, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Feb 22, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Feb 22, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jan 21, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jan 21, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Feb 22, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Feb 22, 2022 N/A N/A :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Oct 10, 2021 4 - Beta pytest (==6.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -333,7 +334,7 @@ This list contains 1000 plugins. :pypi:`pytest-expectr` This plugin is used to expect multiple assert using pytest framework. Oct 05, 2018 N/A pytest (>=2.4.2) :pypi:`pytest-experiments` A pytest plugin to help developers of research-oriented software projects keep track of the results of their numerical experiments. Dec 13, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) :pypi:`pytest-explicit` A Pytest plugin to ignore certain marked tests by default Jun 15, 2021 5 - Production/Stable pytest - :pypi:`pytest-exploratory` Interactive console for pytest. Aug 03, 2021 N/A pytest (>=5.3) + :pypi:`pytest-exploratory` Interactive console for pytest. Feb 21, 2022 N/A pytest (>=6.2) :pypi:`pytest-external-blockers` a special outcome for tests that are blocked for external reasons Oct 05, 2021 N/A pytest :pypi:`pytest-extra-durations` A pytest plugin to get durations on a per-function basis and per module basis. Apr 21, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-fabric` Provides test utilities to run fabric task tests by using docker containers Sep 12, 2018 5 - Production/Stable N/A @@ -366,12 +367,13 @@ This list contains 1000 plugins. :pypi:`pytest-fixture-maker` Pytest plugin to load fixtures from YAML files Sep 21, 2021 N/A N/A :pypi:`pytest-fixture-marker` A pytest plugin to add markers based on fixtures used. Oct 11, 2020 5 - Production/Stable N/A :pypi:`pytest-fixture-order` pytest plugin to control fixture evaluation order Aug 25, 2020 N/A pytest (>=3.0) + :pypi:`pytest-fixture-rtttg` Warn or fail on fixture name clash Feb 23, 2022 N/A pytest (>=7.0.1,<8.0.0) :pypi:`pytest-fixtures` Common fixtures for pytest May 01, 2019 5 - Production/Stable N/A :pypi:`pytest-fixture-tools` Plugin for pytest which provides tools for fixtures Aug 18, 2020 6 - Mature pytest :pypi:`pytest-fixture-typecheck` A pytest plugin to assert type annotations at runtime. Aug 24, 2021 N/A pytest :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Dec 16, 2020 4 - Beta pytest (>=3.5) :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. Jan 10, 2022 5 - Production/Stable pytest - :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Feb 16, 2022 4 - Beta pytest (>=7.0) + :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Feb 24, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-flakefinder` Runs tests multiple times to expose flakiness. Jul 28, 2020 4 - Beta pytest (>=2.7.1) :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) :pypi:`pytest-flaptastic` Flaptastic py.test plugin Mar 17, 2019 N/A N/A @@ -380,7 +382,7 @@ This list contains 1000 plugins. :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) :pypi:`pytest-flyte` Pytest fixtures for simplifying Flyte integration testing May 03, 2021 N/A pytest :pypi:`pytest-focus` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest - :pypi:`pytest-fold` Fold console output and drop user into interactive text user interface Feb 19, 2022 3 - Alpha pytest (>=6.2.5) + :pypi:`pytest-fold` Fold console output and drop user into interactive text user interface Feb 20, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-forcefail` py.test plugin to make the test failing regardless of pytest.mark.xfail May 15, 2018 4 - Beta N/A :pypi:`pytest-forward-compatability` A name to avoid typosquating pytest-foward-compatibility Sep 06, 2020 N/A N/A :pypi:`pytest-forward-compatibility` A pytest plugin to shim pytest commandline options for fowards compatibility Sep 29, 2020 N/A N/A @@ -397,7 +399,7 @@ This list contains 1000 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Jan 10, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Feb 26, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -422,20 +424,21 @@ This list contains 1000 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Feb 19, 2022 3 - Alpha pytest (==6.2.5) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Feb 26, 2022 3 - Alpha pytest (==7.0.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jan 20, 2022 N/A pytest (>=5.0) - :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Aug 29, 2021 4 - Beta N/A + :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 22, 2022 5 - Production/Stable N/A :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) :pypi:`pytest-html` pytest plugin for generating HTML reports Dec 13, 2020 5 - Production/Stable pytest (!=6.0.0,>=5.0) :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Feb 06, 2022 5 - Production/Stable N/A + :pypi:`pytest-html-merger` Pytest HTML reports merging utility Feb 22, 2022 N/A N/A + :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Feb 23, 2022 5 - Production/Stable N/A :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A :pypi:`pytest-html-thread` pytest plugin for generating HTML reports Dec 29, 2020 5 - Production/Stable N/A :pypi:`pytest-http` Fixture "http" for http requests Dec 05, 2019 N/A N/A - :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Dec 25, 2021 5 - Production/Stable N/A + :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Feb 25, 2022 5 - Production/Stable pytest ; extra == 'test' :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Jan 27, 2022 3 - Alpha N/A @@ -477,7 +480,7 @@ This list contains 1000 plugins. :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Dec 02, 2021 3 - Alpha N/A - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Feb 17, 2022 3 - Alpha pytest + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Feb 26, 2022 3 - Alpha pytest :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A @@ -499,7 +502,7 @@ This list contains 1000 plugins. :pypi:`pytest-leaks` A pytest plugin to trace resource leaks. Nov 27, 2019 1 - Planning N/A :pypi:`pytest-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest. Dec 22, 2018 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Dec 15, 2021 4 - Beta N/A + :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Feb 23, 2022 4 - Beta N/A :pypi:`pytest-libnotify` Pytest plugin that shows notifications about the test run Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-ligo` Jan 16, 2020 4 - Beta N/A :pypi:`pytest-lineno` A pytest plugin to show the line numbers of test functions Dec 04, 2020 N/A pytest @@ -552,7 +555,7 @@ This list contains 1000 plugins. :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Feb 17, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Feb 26, 2022 N/A pytest (>=1.0) :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A @@ -609,7 +612,7 @@ This list contains 1000 plugins. :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jan 19, 2020 N/A N/A :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) - :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Jan 19, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 25, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-operator` Fixtures for Operators Feb 14, 2022 N/A N/A :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) @@ -680,7 +683,7 @@ This list contains 1000 plugins. :pypi:`pytest-profiling` Profiling plugin for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-progress` pytest plugin for instant test progress status Jan 31, 2022 5 - Production/Stable N/A :pypi:`pytest-prometheus` Report test pass / failures to a Prometheus PushGateway Oct 03, 2017 N/A N/A - :pypi:`pytest-prometheus-pushgateway` Pytest report plugin for Zulip Jan 31, 2022 5 - Production/Stable pytest + :pypi:`pytest-prometheus-pushgateway` Pytest report plugin for Zulip Feb 23, 2022 5 - Production/Stable pytest :pypi:`pytest-prosper` Test helpers for Prosper projects Sep 24, 2018 N/A N/A :pypi:`pytest-pspec` A rspec format reporter for Python ptest Jun 02, 2020 4 - Beta pytest (>=3.0.0) :pypi:`pytest-psqlgraph` pytest plugin for testing applications that use psqlgraph Oct 19, 2021 4 - Beta pytest (>=6.0) @@ -715,7 +718,7 @@ This list contains 1000 plugins. :pypi:`pytest-race` Race conditions tester for pytest Nov 21, 2016 4 - Beta N/A :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results Feb 04, 2022 N/A pytest (>=3.6) - :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Dec 02, 2021 5 - Production/Stable pytest + :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Feb 25, 2022 5 - Production/Stable pytest :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) :pypi:`pytest-raisesregexp` Simple pytest plugin to look for regex in Exceptions Dec 18, 2015 N/A N/A :pypi:`pytest-raisin` Plugin enabling the use of exception instances with pytest.raises Feb 06, 2022 N/A pytest @@ -725,7 +728,7 @@ This list contains 1000 plugins. :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-readme` Test your README.md file Dec 28, 2014 5 - Production/Stable N/A - :pypi:`pytest-reana` Pytest fixtures for REANA. Jan 05, 2022 3 - Alpha N/A + :pypi:`pytest-reana` Pytest fixtures for REANA. Feb 26, 2022 3 - Alpha N/A :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jul 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) @@ -753,7 +756,7 @@ This list contains 1000 plugins. :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility Dec 11, 2020 3 - Alpha pytest (>=5.2) :pypi:`pytest-report-me` A pytest plugin to generate report. Dec 31, 2020 N/A pytest :pypi:`pytest-report-parameters` pytest plugin for adding tests' parameters to junit report Jun 18, 2020 3 - Alpha pytest (>=2.4.2) - :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Jan 11, 2022 N/A pytest (>=3.8.0) + :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Feb 22, 2022 N/A pytest (>=3.8.0) :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) @@ -780,7 +783,7 @@ This list contains 1000 plugins. :pypi:`pytest-rts` Coverage-based regression test selection (RTS) plugin for pytest May 17, 2021 N/A pytest :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A - :pypi:`pytest-runner` Invoke py.test as distutils command with dependency resolution May 19, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' + :pypi:`pytest-runner` Invoke py.test as distutils command with dependency resolution Feb 25, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A @@ -790,13 +793,13 @@ This list contains 1000 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Feb 15, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Feb 25, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Aug 31, 2020 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Feb 15, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Feb 25, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -810,7 +813,7 @@ This list contains 1000 plugins. :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Nov 07, 2021 N/A N/A - :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Feb 17, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Feb 21, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 5 - Production/Stable pytest (>=3.5.1) :pypi:`pytest-shortcuts` Expand command-line shortcuts listed in pytest configuration Oct 29, 2020 4 - Beta pytest (>=3.5.0) @@ -819,7 +822,7 @@ This list contains 1000 plugins. :pypi:`pytest-simple-plugin` Simple pytest plugin Nov 27, 2019 N/A N/A :pypi:`pytest-simple-settings` simple-settings plugin for pytest Nov 17, 2020 4 - Beta pytest :pypi:`pytest-single-file-logging` Allow for multiple processes to log to a single file May 05, 2016 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-skip-markers` Pytest Salt Plugin Feb 16, 2022 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-skip-markers` Pytest Salt Plugin Feb 22, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-skipper` A plugin that selects only tests with changes in execution path Mar 26, 2017 3 - Alpha pytest (>=3.0.6) :pypi:`pytest-skippy` Automatically skip tests that don't need to run! Jan 27, 2018 3 - Alpha pytest (>=2.3.4) :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A @@ -838,7 +841,7 @@ This list contains 1000 plugins. :pypi:`pytest-solidity` A PyTest library plugin for Solidity language. Jan 15, 2022 1 - Planning pytest (<7,>=6.0.1) ; extra == 'tests' :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) :pypi:`pytest-sorter` A simple plugin to first execute tests that historically failed more Apr 20, 2021 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Feb 17, 2022 2 - Pre-Alpha pytest + :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Feb 21, 2022 2 - Pre-Alpha pytest :pypi:`pytest-sourceorder` Test-ordering plugin for pytest Sep 01, 2021 4 - Beta pytest :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. Feb 23, 2020 4 - Beta pytest :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A @@ -857,7 +860,7 @@ This list contains 1000 plugins. :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Mar 13, 2018 3 - Alpha N/A :pypi:`pytest-sql-bigquery` Yet another SQL-testing framework for BigQuery provided by pytest plugin Dec 19, 2019 N/A pytest - :pypi:`pytest-squadcast` Pytest report plugin for Squadcast Feb 18, 2022 5 - Production/Stable pytest + :pypi:`pytest-squadcast` Pytest report plugin for Squadcast Feb 22, 2022 5 - Production/Stable pytest :pypi:`pytest-srcpaths` Add paths to sys.path Oct 15, 2021 N/A N/A :pypi:`pytest-ssh` pytest plugin for ssh command run May 27, 2019 N/A pytest :pypi:`pytest-start-from` Start pytest run from a given point Apr 11, 2016 N/A N/A @@ -896,7 +899,7 @@ This list contains 1000 plugins. :pypi:`pytest-terraform-fixture` generate terraform resources to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-testbook` A plugin to run tests written in Jupyter notebook Dec 11, 2016 3 - Alpha N/A :pypi:`pytest-testconfig` Test configuration plugin for pytest. Jan 11, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-testdirectory` A py.test plugin providing temporary directories in unit tests. Nov 06, 2018 5 - Production/Stable pytest + :pypi:`pytest-testdirectory` A py.test plugin providing temporary directories in unit tests. Feb 21, 2022 5 - Production/Stable pytest :pypi:`pytest-testdox` A testdox format reporter for pytest Dec 05, 2021 5 - Production/Stable pytest (>=4.6.0) :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Feb 10, 2022 5 - Production/Stable pytest (!=3.0.2) @@ -1017,7 +1020,7 @@ This list contains 1000 plugins. :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Feb 02, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) - :pypi:`pytest-zulip` Pytest report plugin for Zulip Jan 31, 2022 5 - Production/Stable pytest + :pypi:`pytest-zulip` Pytest report plugin for Zulip Feb 23, 2022 5 - Production/Stable pytest =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ .. only:: latex @@ -1031,7 +1034,7 @@ This list contains 1000 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: Feb 14, 2022, + *last release*: Feb 22, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1101,7 +1104,7 @@ This list contains 1000 plugins. Pytest \`client\` fixture for the Aiohttp :pypi:`pytest-aiomoto` - *last release*: Dec 10, 2021, + *last release*: Feb 24, 2022, *status*: N/A, *requires*: pytest (>=6.2.5,<7.0.0) @@ -1163,6 +1166,13 @@ This list contains 1000 plugins. Plugin for py.test to generate allure xml reports + :pypi:`pytest-allure-collection` + *last release*: Feb 21, 2022, + *status*: N/A, + *requires*: pytest + + pytest plugin to collect allure markers without running any tests + :pypi:`pytest-allure-dsl` *last release*: Oct 25, 2020, *status*: 4 - Beta, @@ -1640,7 +1650,7 @@ This list contains 1000 plugins. Local continuous test runner with pytest and watchdog. :pypi:`pytest-bootstrap` - *last release*: Feb 19, 2022, + *last release*: Feb 23, 2022, *status*: N/A, *requires*: N/A @@ -2053,7 +2063,7 @@ This list contains 1000 plugins. Package stands for pytest plugin to upload results into Confluence page. :pypi:`pytest-console-scripts` - *last release*: Jan 06, 2022, + *last release*: Feb 23, 2022, *status*: 4 - Beta, *requires*: N/A @@ -2486,6 +2496,13 @@ This list contains 1000 plugins. A simple plugin to use with pytest + :pypi:`pytest-diff-selector` + *last release*: Feb 24, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=6.2.2) ; extra == 'all' + + Get tests affected by code changes (using git) + :pypi:`pytest-disable` *last release*: Sep 10, 2015, *status*: 4 - Beta, @@ -2802,19 +2819,12 @@ This list contains 1000 plugins. A simple pytest plugin to import names and add them to the doctest namespace. :pypi:`pytest-doctestplus` - *last release*: Dec 09, 2021, + *last release*: Feb 25, 2022, *status*: 3 - Alpha, *requires*: pytest (>=4.6) Pytest plugin with advanced doctest features. - :pypi:`pytest-doctest-ufunc` - *last release*: Aug 02, 2020, - *status*: 4 - Beta, - *requires*: pytest (>=3.5.0) - - A plugin to run doctests in docstrings of Numpy ufuncs - :pypi:`pytest-dolphin` *last release*: Nov 30, 2016, *status*: 4 - Beta, @@ -2977,35 +2987,35 @@ This list contains 1000 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Jan 21, 2022, + *last release*: Feb 22, 2022, *status*: N/A, *requires*: pytest (>=6.2.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Jan 21, 2022, + *last release*: Feb 22, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Jan 21, 2022, + *last release*: Feb 22, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Jan 21, 2022, + *last release*: Feb 22, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Jan 21, 2022, + *last release*: Feb 22, 2022, *status*: N/A, *requires*: N/A @@ -3019,14 +3029,14 @@ This list contains 1000 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Jan 21, 2022, + *last release*: Feb 22, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Jan 21, 2022, + *last release*: Feb 22, 2022, *status*: N/A, *requires*: N/A @@ -3229,9 +3239,9 @@ This list contains 1000 plugins. A Pytest plugin to ignore certain marked tests by default :pypi:`pytest-exploratory` - *last release*: Aug 03, 2021, + *last release*: Feb 21, 2022, *status*: N/A, - *requires*: pytest (>=5.3) + *requires*: pytest (>=6.2) Interactive console for pytest. @@ -3459,6 +3469,13 @@ This list contains 1000 plugins. pytest plugin to control fixture evaluation order + :pypi:`pytest-fixture-rtttg` + *last release*: Feb 23, 2022, + *status*: N/A, + *requires*: pytest (>=7.0.1,<8.0.0) + + Warn or fail on fixture name clash + :pypi:`pytest-fixtures` *last release*: May 01, 2019, *status*: 5 - Production/Stable, @@ -3495,7 +3512,7 @@ This list contains 1000 plugins. A pytest fixture for testing flake8 plugins. :pypi:`pytest-flake8-v2` - *last release*: Feb 16, 2022, + *last release*: Feb 24, 2022, *status*: 4 - Beta, *requires*: pytest (>=7.0) @@ -3558,8 +3575,8 @@ This list contains 1000 plugins. A pytest plugin that alerts user of failed test cases with screen notifications :pypi:`pytest-fold` - *last release*: Feb 19, 2022, - *status*: 3 - Alpha, + *last release*: Feb 20, 2022, + *status*: 4 - Beta, *requires*: pytest (>=6.2.5) Fold console output and drop user into interactive text user interface @@ -3677,7 +3694,7 @@ This list contains 1000 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Jan 10, 2022, + *last release*: Feb 26, 2022, *status*: N/A, *requires*: N/A @@ -3852,9 +3869,9 @@ This list contains 1000 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Feb 19, 2022, + *last release*: Feb 26, 2022, *status*: 3 - Alpha, - *requires*: pytest (==6.2.5) + *requires*: pytest (==7.0.1) Experimental package to automatically extract test plugins for Home Assistant custom components @@ -3880,8 +3897,8 @@ This list contains 1000 plugins. Simplify working with Hoverfly from pytest :pypi:`pytest-hoverfly-wrapper` - *last release*: Aug 29, 2021, - *status*: 4 - Beta, + *last release*: Feb 22, 2022, + *status*: 5 - Production/Stable, *requires*: N/A Integrates the Hoverfly HTTP proxy into Pytest @@ -3907,8 +3924,15 @@ This list contains 1000 plugins. optimized pytest plugin for generating HTML reports + :pypi:`pytest-html-merger` + *last release*: Feb 22, 2022, + *status*: N/A, + *requires*: N/A + + Pytest HTML reports merging utility + :pypi:`pytest-html-object-storage` - *last release*: Feb 06, 2022, + *last release*: Feb 23, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -3943,9 +3967,9 @@ This list contains 1000 plugins. Fixture "http" for http requests :pypi:`pytest-httpbin` - *last release*: Dec 25, 2021, + *last release*: Feb 25, 2022, *status*: 5 - Production/Stable, - *requires*: N/A + *requires*: pytest ; extra == 'test' Easily test your HTTP library against a local copy of httpbin @@ -4237,7 +4261,7 @@ This list contains 1000 plugins. py.test JIRA integration plugin, using markers :pypi:`pytest-jira-xray` - *last release*: Feb 17, 2022, + *last release*: Feb 26, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -4391,7 +4415,7 @@ This list contains 1000 plugins. A python-libfaketime plugin for pytest. :pypi:`pytest-libiio` - *last release*: Dec 15, 2021, + *last release*: Feb 23, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4762,7 +4786,7 @@ This list contains 1000 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Feb 17, 2022, + *last release*: Feb 26, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -5161,7 +5185,7 @@ This list contains 1000 plugins. Pytest plugin for detecting inadvertent open file handles :pypi:`pytest-opentmi` - *last release*: Jan 19, 2022, + *last release*: Feb 25, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) @@ -5658,7 +5682,7 @@ This list contains 1000 plugins. Report test pass / failures to a Prometheus PushGateway :pypi:`pytest-prometheus-pushgateway` - *last release*: Jan 31, 2022, + *last release*: Feb 23, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -5903,7 +5927,7 @@ This list contains 1000 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-railflow-testrail-reporter` - *last release*: Dec 02, 2021, + *last release*: Feb 25, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -5973,7 +5997,7 @@ This list contains 1000 plugins. Test your README.md file :pypi:`pytest-reana` - *last release*: Jan 05, 2022, + *last release*: Feb 26, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -6169,7 +6193,7 @@ This list contains 1000 plugins. pytest plugin for adding tests' parameters to junit report :pypi:`pytest-reportportal` - *last release*: Jan 11, 2022, + *last release*: Feb 22, 2022, *status*: N/A, *requires*: pytest (>=3.8.0) @@ -6358,9 +6382,9 @@ This list contains 1000 plugins. implement a --failed option for pytest :pypi:`pytest-runner` - *last release*: May 19, 2021, + *last release*: Feb 25, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=4.6) ; extra == 'testing' + *requires*: pytest (>=6) ; extra == 'testing' Invoke py.test as distutils command with dependency resolution @@ -6428,7 +6452,7 @@ This list contains 1000 plugins. :pypi:`pytest-sbase` - *last release*: Feb 15, 2022, + *last release*: Feb 25, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6470,7 +6494,7 @@ This list contains 1000 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Feb 15, 2022, + *last release*: Feb 25, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6568,7 +6592,7 @@ This list contains 1000 plugins. A pytest plugin to help with testing shell scripts / black box commands :pypi:`pytest-shell-utilities` - *last release*: Feb 17, 2022, + *last release*: Feb 21, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6631,7 +6655,7 @@ This list contains 1000 plugins. Allow for multiple processes to log to a single file :pypi:`pytest-skip-markers` - *last release*: Feb 16, 2022, + *last release*: Feb 22, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.0.0) @@ -6764,7 +6788,7 @@ This list contains 1000 plugins. A simple plugin to first execute tests that historically failed more :pypi:`pytest-sosu` - *last release*: Feb 17, 2022, + *last release*: Feb 21, 2022, *status*: 2 - Pre-Alpha, *requires*: pytest @@ -6897,7 +6921,7 @@ This list contains 1000 plugins. Yet another SQL-testing framework for BigQuery provided by pytest plugin :pypi:`pytest-squadcast` - *last release*: Feb 18, 2022, + *last release*: Feb 22, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -7170,7 +7194,7 @@ This list contains 1000 plugins. Test configuration plugin for pytest. :pypi:`pytest-testdirectory` - *last release*: Nov 06, 2018, + *last release*: Feb 21, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -8017,7 +8041,7 @@ This list contains 1000 plugins. Extend py.test for RPC OpenStack testing. :pypi:`pytest-zulip` - *last release*: Jan 31, 2022, + *last release*: Feb 23, 2022, *status*: 5 - Production/Stable, *requires*: pytest From e38d1cac489e42f4bdbecbb50f9f25dc9c36c19f Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 5 Mar 2022 08:57:00 -0300 Subject: [PATCH 164/549] Improve error message for malformed pyproject.toml files Including the file name is enough to let the user know what the problem is. The same is not needed for `.ini` files because the error message includes the path to the file by default. Fix #9730 --- changelog/9730.bugfix.rst | 1 + src/_pytest/config/findpaths.py | 2 +- testing/test_config.py | 12 +++++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 changelog/9730.bugfix.rst diff --git a/changelog/9730.bugfix.rst b/changelog/9730.bugfix.rst new file mode 100644 index 00000000000..df30ab7e360 --- /dev/null +++ b/changelog/9730.bugfix.rst @@ -0,0 +1 @@ +Malformed ``pyproject.toml`` files now produce a clearer error message. diff --git a/src/_pytest/config/findpaths.py b/src/_pytest/config/findpaths.py index 89ade5f23b9..c082e652d92 100644 --- a/src/_pytest/config/findpaths.py +++ b/src/_pytest/config/findpaths.py @@ -70,7 +70,7 @@ def load_config_dict_from_file( try: config = tomli.loads(toml_text) except tomli.TOMLDecodeError as exc: - raise UsageError(str(exc)) from exc + raise UsageError(f"{filepath}: {exc}") from exc result = config.get("tool", {}).get("pytest", {}).get("ini_options", None) if result is not None: diff --git a/testing/test_config.py b/testing/test_config.py index 8013966f071..6784809e097 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -163,7 +163,17 @@ def test_ini_parse_error(self, pytester: Pytester) -> None: pytester.path.joinpath("pytest.ini").write_text("addopts = -x") result = pytester.runpytest() assert result.ret != 0 - result.stderr.fnmatch_lines(["ERROR: *pytest.ini:1: no section header defined"]) + result.stderr.fnmatch_lines("ERROR: *pytest.ini:1: no section header defined") + + def test_toml_parse_error(self, pytester: Pytester) -> None: + pytester.makepyprojecttoml( + """ + \\" + """ + ) + result = pytester.runpytest() + assert result.ret != 0 + result.stderr.fnmatch_lines("ERROR: *pyproject.toml: Invalid statement*") @pytest.mark.xfail(reason="probably not needed") def test_confcutdir(self, pytester: Pytester) -> None: From bc43d66b47b917d43a22e0c703ecfe4eea342263 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 6 Mar 2022 00:01:38 -0300 Subject: [PATCH 165/549] [automated] Update plugin list (#9733) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 166 ++++++++++++++++++------------- 1 file changed, 99 insertions(+), 67 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index e36f21c6750..be6a5318d7f 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1003 plugins. +This list contains 1007 plugins. .. only:: not latex @@ -68,7 +68,7 @@ This list contains 1003 plugins. :pypi:`pytest-astropy` Meta-package containing dependencies for testing Sep 21, 2021 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Dec 27, 2021 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest - :pypi:`pytest-asyncio` Pytest support for asyncio Feb 10, 2022 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-asyncio` Pytest support for asyncio Mar 03, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jan 25, 2022 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) @@ -107,7 +107,7 @@ This list contains 1003 plugins. :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A :pypi:`pytest-board` Local continuous test runner with pytest and watchdog. Jan 20, 2019 N/A N/A - :pypi:`pytest-bootstrap` Feb 23, 2022 N/A N/A + :pypi:`pytest-bootstrap` Mar 04, 2022 N/A N/A :pypi:`pytest-bpdb` A py.test plug-in to enable drop to bpdb debugger on test failure. Jan 19, 2015 2 - Pre-Alpha N/A :pypi:`pytest-bravado` Pytest-bravado automatically generates from OpenAPI specification client fixtures. Feb 15, 2022 N/A N/A :pypi:`pytest-breakword` Use breakword with pytest Aug 04, 2021 N/A pytest (>=6.2.4,<7.0.0) @@ -124,7 +124,7 @@ This list contains 1003 plugins. :pypi:`pytest-builtin-types` Nov 17, 2021 N/A pytest :pypi:`pytest-bwrap` Run your tests in Bubblewrap sandboxes Oct 26, 2018 3 - Alpha N/A :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A - :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Feb 18, 2022 4 - Beta pytest (>=5) + :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Mar 03, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Feb 19, 2022 N/A pytest :pypi:`pytest-camel-collect` Enable CamelCase-aware pytest class collection Aug 02, 2020 N/A pytest (>=2.9) @@ -138,6 +138,7 @@ This list contains 1003 plugins. :pypi:`pytest-celery` pytest-celery a shim pytest plugin to enable celery.contrib.pytest May 06, 2021 N/A N/A :pypi:`pytest-chainmaker` pytest plugin for chainmaker Oct 15, 2021 N/A N/A :pypi:`pytest-chalice` A set of py.test fixtures for AWS Chalice Jul 01, 2020 4 - Beta N/A + :pypi:`pytest-change-demo` turn . into √,turn F into x Mar 02, 2022 N/A pytest :pypi:`pytest-change-report` turn . into √,turn F into x Sep 14, 2020 N/A pytest :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) :pypi:`pytest-checkdocs` check the README when running tests Jul 31, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' @@ -211,7 +212,7 @@ This list contains 1003 plugins. :pypi:`pytest-dbfixtures` Databases fixtures plugin for py.test. Dec 07, 2016 4 - Beta N/A :pypi:`pytest-db-plugin` Nov 27, 2021 N/A pytest (>=5.0) :pypi:`pytest-dbt-adapter` A pytest plugin for testing dbt adapter plugins Nov 24, 2021 N/A pytest (<7,>=6) - :pypi:`pytest-dbt-conventions` A pytest plugin for linting a dbt project's conventions Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-dbt-conventions` A pytest plugin for linting a dbt project's conventions Mar 02, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-dbt-core` Pytest extension for dbt. Jan 28, 2022 N/A pytest (>=6.2.5) ; extra == 'test' :pypi:`pytest-dbus-notification` D-BUS notifications for pytest results. Mar 05, 2014 5 - Production/Stable N/A :pypi:`pytest-deadfixtures` A simple plugin to list unused fixtures in pytest Jul 23, 2020 5 - Production/Stable N/A @@ -294,18 +295,18 @@ This list contains 1003 plugins. :pypi:`pytest-easy-server` Pytest plugin for easy testing against servers May 01, 2021 4 - Beta pytest (<5.0.0,>=4.3.1) ; python_version < "3.5" :pypi:`pytest-ec2` Pytest execution on EC2 instance Oct 22, 2019 3 - Alpha N/A :pypi:`pytest-echo` pytest plugin with mechanisms for echoing environment variables, package version and generic attributes Jan 08, 2020 5 - Production/Stable N/A - :pypi:`pytest-elasticsearch` Elasticsearch fixtures and fixture factories for Pytest. May 12, 2021 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-elasticsearch` Elasticsearch fixtures and fixture factories for Pytest. Mar 01, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-elements` Tool to help automate user interfaces Jan 13, 2021 N/A pytest (>=5.4,<6.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Feb 22, 2022 N/A pytest (>=6.2.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Feb 22, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Feb 22, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Feb 22, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Feb 22, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Mar 04, 2022 N/A pytest (>=6.2.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Mar 04, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Mar 04, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Mar 04, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Mar 04, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Feb 22, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Feb 22, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Mar 04, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Mar 04, 2022 N/A N/A :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Oct 10, 2021 4 - Beta pytest (==6.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -371,9 +372,9 @@ This list contains 1003 plugins. :pypi:`pytest-fixtures` Common fixtures for pytest May 01, 2019 5 - Production/Stable N/A :pypi:`pytest-fixture-tools` Plugin for pytest which provides tools for fixtures Aug 18, 2020 6 - Mature pytest :pypi:`pytest-fixture-typecheck` A pytest plugin to assert type annotations at runtime. Aug 24, 2021 N/A pytest - :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Dec 16, 2020 4 - Beta pytest (>=3.5) + :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Mar 05, 2022 4 - Beta pytest (>=3.5) :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. Jan 10, 2022 5 - Production/Stable pytest - :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Feb 24, 2022 4 - Beta pytest (>=7.0) + :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Mar 01, 2022 5 - Production/Stable pytest (>=7.0) :pypi:`pytest-flakefinder` Runs tests multiple times to expose flakiness. Jul 28, 2020 4 - Beta pytest (>=2.7.1) :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) :pypi:`pytest-flaptastic` Flaptastic py.test plugin Mar 17, 2019 N/A N/A @@ -399,7 +400,7 @@ This list contains 1003 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Feb 26, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Mar 01, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -424,7 +425,7 @@ This list contains 1003 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Feb 26, 2022 3 - Alpha pytest (==7.0.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 05, 2022 3 - Alpha pytest (==7.0.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jan 20, 2022 N/A pytest (>=5.0) @@ -432,8 +433,8 @@ This list contains 1003 plugins. :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) :pypi:`pytest-html` pytest plugin for generating HTML reports Dec 13, 2020 5 - Production/Stable pytest (!=6.0.0,>=5.0) :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-html-merger` Pytest HTML reports merging utility Feb 22, 2022 N/A N/A - :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Feb 23, 2022 5 - Production/Stable N/A + :pypi:`pytest-html-merger` Pytest HTML reports merging utility Mar 02, 2022 N/A N/A + :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Mar 04, 2022 5 - Production/Stable N/A :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A :pypi:`pytest-html-thread` pytest plugin for generating HTML reports Dec 29, 2020 5 - Production/Stable N/A @@ -462,7 +463,7 @@ This list contains 1003 plugins. :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Jan 26, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Feb 11, 2022 5 - Production/Stable N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A - :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Apr 07, 2021 N/A pytest (>=6.0.2,<7.0.0) + :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) :pypi:`pytest-instrument` pytest plugin to instrument tests Apr 05, 2020 5 - Production/Stable pytest (>=5.1.0) :pypi:`pytest-integration` Organizing pytests by integration or not Apr 16, 2020 N/A N/A @@ -514,7 +515,7 @@ This list contains 1003 plugins. :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Aug 25, 2021 5 - Production/Stable pytest :pypi:`pytest-localserver` py.test plugin to test server connections locally. Dec 13, 2021 4 - Beta N/A :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Aug 22, 2019 4 - Beta pytest (>=3.3.0) - :pypi:`pytest-lockable` lockable resource plugin for pytest Nov 09, 2021 5 - Production/Stable pytest + :pypi:`pytest-lockable` lockable resource plugin for pytest Feb 28, 2022 5 - Production/Stable pytest :pypi:`pytest-locker` Used to lock object during testing. Essentially changing assertions from being hard coded to asserting that nothing changed Oct 29, 2021 N/A pytest (>=5.4) :pypi:`pytest-log` print log Aug 15, 2021 N/A pytest (>=3.8) :pypi:`pytest-logbook` py.test plugin to capture logbook log messages Nov 23, 2015 5 - Production/Stable pytest (>=2.8) @@ -523,6 +524,7 @@ This list contains 1003 plugins. :pypi:`pytest-logger` Plugin configuring handlers for loggers from Python logging module. Jul 25, 2019 4 - Beta pytest (>=3.2) :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A + :pypi:`pytest-loguru` Pytest Loguru Feb 27, 2022 5 - Production/Stable N/A :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha pytest (>=6) :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) :pypi:`pytest-marker-bugzilla` py.test bugzilla integration plugin, using markers Jan 09, 2020 N/A N/A @@ -572,7 +574,7 @@ This list contains 1003 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Feb 09, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Mar 07, 2021 4 - Beta pytest + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Feb 28, 2022 4 - Beta pytest :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A @@ -582,7 +584,7 @@ This list contains 1003 plugins. :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Jan 11, 2022 3 - Alpha pytest (>=6.0.0) :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A N/A - :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Jun 13, 2021 N/A pytest + :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Mar 02, 2022 N/A N/A :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 15, 2022 5 - Production/Stable pytest (>=6.2) :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) @@ -612,8 +614,8 @@ This list contains 1003 plugins. :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jan 19, 2020 N/A N/A :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) - :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 25, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Feb 14, 2022 N/A N/A + :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-operator` Fixtures for Operators Mar 02, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -687,7 +689,7 @@ This list contains 1003 plugins. :pypi:`pytest-prosper` Test helpers for Prosper projects Sep 24, 2018 N/A N/A :pypi:`pytest-pspec` A rspec format reporter for Python ptest Jun 02, 2020 4 - Beta pytest (>=3.0.0) :pypi:`pytest-psqlgraph` pytest plugin for testing applications that use psqlgraph Oct 19, 2021 4 - Beta pytest (>=6.0) - :pypi:`pytest-ptera` Use ptera probes in tests Oct 20, 2021 N/A pytest (>=6.2.4,<7.0.0) + :pypi:`pytest-ptera` Use ptera probes in tests Mar 01, 2022 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-pudb` Pytest PuDB debugger integration Oct 25, 2018 3 - Alpha pytest (>=2.0) :pypi:`pytest-purkinje` py.test plugin for purkinje test runner Oct 28, 2017 2 - Pre-Alpha N/A :pypi:`pytest-pycharm` Plugin for py.test to enter PyCharm debugger on uncaught exceptions Aug 13, 2020 5 - Production/Stable pytest (>=2.3) @@ -771,6 +773,7 @@ This list contains 1003 plugins. :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed Jan 10, 2022 5 - Production/Stable pytest :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A :pypi:`pytest-reverse` Pytest plugin to reverse test order. Jan 10, 2022 5 - Production/Stable pytest + :pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) :pypi:`pytest-ringo` pytest plugin to test webapplications using the Ringo webframework Sep 27, 2017 3 - Alpha N/A :pypi:`pytest-rng` Fixtures for seeding tests and making randomness reproducible Aug 08, 2019 5 - Production/Stable pytest @@ -793,13 +796,13 @@ This list contains 1003 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Feb 25, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 02, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Aug 31, 2020 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Feb 25, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 02, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -855,7 +858,7 @@ This list contains 1003 plugins. :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Feb 18, 2022 N/A pytest (>5.4.0,<6.3) - :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Feb 07, 2022 N/A N/A + :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 01, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Mar 13, 2018 3 - Alpha N/A @@ -904,7 +907,7 @@ This list contains 1003 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Feb 10, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Feb 18, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Mar 01, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) @@ -936,6 +939,7 @@ This list contains 1003 plugins. :pypi:`pytest-tipsi-testing` Better fixtures management. Various helpers Nov 04, 2020 4 - Beta pytest (>=3.3.0) :pypi:`pytest-tldr` A pytest plugin that limits the output to just the things you need. Mar 12, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-tm4j-reporter` Cloud Jira Test Management (TM4J) PyTest reporter plugin Sep 01, 2020 N/A pytest + :pypi:`pytest-tmnet` A small example package Mar 01, 2022 N/A N/A :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Nov 17, 2021 N/A N/A :pypi:`pytest-todo` A small plugin for the pytest testing framework, marking TODO comments as failure May 23, 2019 4 - Beta pytest :pypi:`pytest-tomato` Mar 01, 2019 5 - Production/Stable N/A @@ -1020,7 +1024,7 @@ This list contains 1003 plugins. :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Feb 02, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) - :pypi:`pytest-zulip` Pytest report plugin for Zulip Feb 23, 2022 5 - Production/Stable pytest + :pypi:`pytest-zulip` Pytest report plugin for Zulip Mar 04, 2022 5 - Production/Stable pytest =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ .. only:: latex @@ -1377,7 +1381,7 @@ This list contains 1003 plugins. :pypi:`pytest-asyncio` - *last release*: Feb 10, 2022, + *last release*: Mar 03, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.1.0) @@ -1650,7 +1654,7 @@ This list contains 1003 plugins. Local continuous test runner with pytest and watchdog. :pypi:`pytest-bootstrap` - *last release*: Feb 23, 2022, + *last release*: Mar 04, 2022, *status*: N/A, *requires*: N/A @@ -1769,9 +1773,9 @@ This list contains 1003 plugins. pytest plugin with mechanisms for caching across test runs :pypi:`pytest-cache-assert` - *last release*: Feb 18, 2022, + *last release*: Mar 03, 2022, *status*: 4 - Beta, - *requires*: pytest (>=5) + *requires*: pytest (>=5.0.0) Cache assertion data to simplify regression testing of complex serializable data @@ -1866,6 +1870,13 @@ This list contains 1003 plugins. A set of py.test fixtures for AWS Chalice + :pypi:`pytest-change-demo` + *last release*: Mar 02, 2022, + *status*: N/A, + *requires*: pytest + + turn . into √,turn F into x + :pypi:`pytest-change-report` *last release*: Sep 14, 2020, *status*: N/A, @@ -2378,7 +2389,7 @@ This list contains 1003 plugins. A pytest plugin for testing dbt adapter plugins :pypi:`pytest-dbt-conventions` - *last release*: Feb 04, 2022, + *last release*: Mar 02, 2022, *status*: N/A, *requires*: pytest (>=6.2.5,<7.0.0) @@ -2959,9 +2970,9 @@ This list contains 1003 plugins. pytest plugin with mechanisms for echoing environment variables, package version and generic attributes :pypi:`pytest-elasticsearch` - *last release*: May 12, 2021, + *last release*: Mar 01, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=3.0.0) + *requires*: pytest (>=6.2.0) Elasticsearch fixtures and fixture factories for Pytest. @@ -2987,35 +2998,35 @@ This list contains 1003 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Feb 22, 2022, + *last release*: Mar 04, 2022, *status*: N/A, *requires*: pytest (>=6.2.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Feb 22, 2022, + *last release*: Mar 04, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Feb 22, 2022, + *last release*: Mar 04, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Feb 22, 2022, + *last release*: Mar 04, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Feb 22, 2022, + *last release*: Mar 04, 2022, *status*: N/A, *requires*: N/A @@ -3029,14 +3040,14 @@ This list contains 1003 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Feb 22, 2022, + *last release*: Mar 04, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Feb 22, 2022, + *last release*: Mar 04, 2022, *status*: N/A, *requires*: N/A @@ -3498,7 +3509,7 @@ This list contains 1003 plugins. A pytest plugin to assert type annotations at runtime. :pypi:`pytest-flake8` - *last release*: Dec 16, 2020, + *last release*: Mar 05, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.5) @@ -3512,8 +3523,8 @@ This list contains 1003 plugins. A pytest fixture for testing flake8 plugins. :pypi:`pytest-flake8-v2` - *last release*: Feb 24, 2022, - *status*: 4 - Beta, + *last release*: Mar 01, 2022, + *status*: 5 - Production/Stable, *requires*: pytest (>=7.0) pytest plugin to check FLAKE8 requirements @@ -3694,7 +3705,7 @@ This list contains 1003 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Feb 26, 2022, + *last release*: Mar 01, 2022, *status*: N/A, *requires*: N/A @@ -3869,7 +3880,7 @@ This list contains 1003 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Feb 26, 2022, + *last release*: Mar 05, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.0.1) @@ -3925,14 +3936,14 @@ This list contains 1003 plugins. optimized pytest plugin for generating HTML reports :pypi:`pytest-html-merger` - *last release*: Feb 22, 2022, + *last release*: Mar 02, 2022, *status*: N/A, *requires*: N/A Pytest HTML reports merging utility :pypi:`pytest-html-object-storage` - *last release*: Feb 23, 2022, + *last release*: Mar 04, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4135,9 +4146,9 @@ This list contains 1003 plugins. A simple image diff plugin for pytest :pypi:`pytest-insta` - *last release*: Apr 07, 2021, + *last release*: Feb 28, 2022, *status*: N/A, - *requires*: pytest (>=6.0.2,<7.0.0) + *requires*: pytest (>=6.0.2) A practical snapshot testing plugin for pytest @@ -4499,7 +4510,7 @@ This list contains 1003 plugins. Pytest plugin for AWS integration tests :pypi:`pytest-lockable` - *last release*: Nov 09, 2021, + *last release*: Feb 28, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -4561,6 +4572,13 @@ This list contains 1003 plugins. Package for creating a pytest test run reprot + :pypi:`pytest-loguru` + *last release*: Feb 27, 2022, + *status*: 5 - Production/Stable, + *requires*: N/A + + Pytest Loguru + :pypi:`pytest-manual-marker` *last release*: Oct 11, 2021, *status*: 3 - Alpha, @@ -4905,7 +4923,7 @@ This list contains 1003 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Mar 07, 2021, + *last release*: Feb 28, 2022, *status*: 4 - Beta, *requires*: pytest @@ -4975,9 +4993,9 @@ This list contains 1003 plugins. Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. :pypi:`pytest-mypy-testing` - *last release*: Jun 13, 2021, + *last release*: Mar 02, 2022, *status*: N/A, - *requires*: pytest + *requires*: N/A Pytest plugin to check mypy output. @@ -5185,16 +5203,16 @@ This list contains 1003 plugins. Pytest plugin for detecting inadvertent open file handles :pypi:`pytest-opentmi` - *last release*: Feb 25, 2022, + *last release*: Feb 28, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: Feb 14, 2022, + *last release*: Mar 02, 2022, *status*: N/A, - *requires*: N/A + *requires*: pytest Fixtures for Operators @@ -5710,7 +5728,7 @@ This list contains 1003 plugins. pytest plugin for testing applications that use psqlgraph :pypi:`pytest-ptera` - *last release*: Oct 20, 2021, + *last release*: Mar 01, 2022, *status*: N/A, *requires*: pytest (>=6.2.4,<7.0.0) @@ -6297,6 +6315,13 @@ This list contains 1003 plugins. Pytest plugin to reverse test order. + :pypi:`pytest-rich` + *last release*: Mar 03, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=7.0) + + Leverage rich for richer test session output + :pypi:`pytest-rich-reporter` *last release*: Feb 17, 2022, *status*: 1 - Planning, @@ -6452,7 +6477,7 @@ This list contains 1003 plugins. :pypi:`pytest-sbase` - *last release*: Feb 25, 2022, + *last release*: Mar 02, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6494,7 +6519,7 @@ This list contains 1003 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Feb 25, 2022, + *last release*: Mar 02, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6886,7 +6911,7 @@ This list contains 1003 plugins. A Dynamic test tool for Splunk Apps and Add-ons :pypi:`pytest-splunk-addon-ui-smartx` - *last release*: Feb 07, 2022, + *last release*: Mar 01, 2022, *status*: N/A, *requires*: N/A @@ -7229,7 +7254,7 @@ This list contains 1003 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Feb 18, 2022, + *last release*: Mar 01, 2022, *status*: 4 - Beta, *requires*: N/A @@ -7452,6 +7477,13 @@ This list contains 1003 plugins. Cloud Jira Test Management (TM4J) PyTest reporter plugin + :pypi:`pytest-tmnet` + *last release*: Mar 01, 2022, + *status*: N/A, + *requires*: N/A + + A small example package + :pypi:`pytest-tmreport` *last release*: Nov 17, 2021, *status*: N/A, @@ -8041,7 +8073,7 @@ This list contains 1003 plugins. Extend py.test for RPC OpenStack testing. :pypi:`pytest-zulip` - *last release*: Feb 23, 2022, + *last release*: Mar 04, 2022, *status*: 5 - Production/Stable, *requires*: pytest From c0fd2d883940f1292d5e8234803beaacd08315e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Mar 2022 10:29:39 -0300 Subject: [PATCH 166/549] build(deps): Bump pytest-asyncio from 0.18.1 to 0.18.2 in /testing/plugins_integration (#9736) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 7d63d38f9f1..f6d978a8c6a 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,6 +1,6 @@ anyio[curio,trio]==3.5.0 django==4.0.2 -pytest-asyncio==0.18.1 +pytest-asyncio==0.18.2 pytest-bdd==5.0.0 pytest-cov==3.0.0 pytest-django==4.5.2 From 4a8f8ada431974f2837260af3ed36299fd382814 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Mar 2022 13:50:25 +0000 Subject: [PATCH 167/549] build(deps): Bump django from 4.0.2 to 4.0.3 in /testing/plugins_integration (#9737) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index f6d978a8c6a..d7e56e3c5b7 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.5.0 -django==4.0.2 +django==4.0.3 pytest-asyncio==0.18.2 pytest-bdd==5.0.0 pytest-cov==3.0.0 From 7f924b13a50a05b8dc894418fa7faf779201e129 Mon Sep 17 00:00:00 2001 From: Fabian Egli Date: Fri, 11 Mar 2022 11:15:28 +0100 Subject: [PATCH 168/549] Fix typo in deprecation documentation --- doc/en/deprecations.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index 1210947159b..91944b758f9 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -301,7 +301,7 @@ The ``pytest_warning_captured`` hook This hook has an `item` parameter which cannot be serialized by ``pytest-xdist``. -Use the ``pytest_warning_recored`` hook instead, which replaces the ``item`` parameter +Use the ``pytest_warning_recorded`` hook instead, which replaces the ``item`` parameter by a ``nodeid`` parameter. From d306ec0a7e1711d936e5bb98352a430bff758eae Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 12 Mar 2022 16:51:56 +0100 Subject: [PATCH 169/549] Update upcoming trainings (#9744) * Update upcoming trainings * Remove old-ish link * Revert "Remove old-ish link" This reverts commit 30d75f50887ca08d26aa02b6048f5334b40cf251. * Use crossref * Add past training --- doc/en/index.rst | 13 +++++++++---- doc/en/talks.rst | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/doc/en/index.rst b/doc/en/index.rst index 9e9cf0b68a8..03a39aaaae8 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -1,11 +1,16 @@ :orphan: -.. - .. sidebar:: Next Open Trainings +.. sidebar:: Next Open Trainings + + - `PyConDE `__, April 11th 2022 (3h), Berlin, Germany + - `PyConIT `__, June 3rd 2022 (4h), Florence, Italy + - `Professional Testing with Python `_, via `Python Academy `_, March 7th to 9th 2023 (3 day in-depth training), Remote and Leipzig, Germany - - `Professional Testing with Python `_, via `Python Academy `_, February 1st to 3rd, 2022, Leipzig (Germany) and remote. + Also see :doc:`previous talks and blogposts `. - Also see `previous talks and blogposts `_. +.. + - `Europython `__, July 11th to 17th (3h), Dublin, Ireland + - `CH Open Workshoptage `__ (German), September 6th to 8th (1 day), Bern, Switzerland .. _features: diff --git a/doc/en/talks.rst b/doc/en/talks.rst index 0b195960ab2..160345614c8 100644 --- a/doc/en/talks.rst +++ b/doc/en/talks.rst @@ -17,6 +17,8 @@ Books Talks and blog postings --------------------------------------------- +- `pytest: Simple, rapid and fun testing with Python, `_ (@ 4:22:32), Florian Bruhin, WeAreDevelopers World Congress 2021 + - Webinar: `pytest: Test Driven Development für Python (German) `_, Florian Bruhin, via mylearning.ch, 2020 - Webinar: `Simplify Your Tests with Fixtures `_, Oliver Bestwalter, via JetBrains, 2020 From f3053017b9a540fc14fddbb4e40066348ac8c25c Mon Sep 17 00:00:00 2001 From: Aaron Berdy Date: Sat, 12 Mar 2022 14:44:52 -0800 Subject: [PATCH 170/549] fix typo in pytester docs --- src/_pytest/pytester.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 8368f944122..359e2aebd38 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -832,7 +832,7 @@ def makefile(self, ext: str, *args: str, **kwargs: str) -> Path: return self._makefile(ext, args, kwargs) def makeconftest(self, source: str) -> Path: - """Write a contest.py file with 'source' as contents.""" + """Write a conftest.py file with 'source' as contents.""" return self.makepyfile(conftest=source) def makeini(self, source: str) -> Path: From 61f2b265a37f3deb04a09981e6f22818f3b6649a Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 13 Mar 2022 00:15:56 +0000 Subject: [PATCH 171/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 158 +++++++++++++++++++------------ 1 file changed, 99 insertions(+), 59 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index be6a5318d7f..4dd206c87a1 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1007 plugins. +This list contains 1012 plugins. .. only:: not latex @@ -29,12 +29,12 @@ This list contains 1007 plugins. :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Nov 01, 2020 N/A pytest (>=6) - :pypi:`pytest-aiomoto` pytest-aiomoto Feb 24, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-aiomoto` pytest-aiomoto Mar 12, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A - :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Feb 08, 2022 N/A pytest (>=1.0) + :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Mar 12, 2022 N/A pytest (>=1.0) :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) @@ -66,7 +66,7 @@ This list contains 1007 plugins. :pypi:`pytest-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) :pypi:`pytest-ast-back-to-python` A plugin for pytest devs to view how assertion rewriting recodes the AST Sep 29, 2019 4 - Beta N/A :pypi:`pytest-astropy` Meta-package containing dependencies for testing Sep 21, 2021 5 - Production/Stable pytest (>=4.6) - :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Dec 27, 2021 3 - Alpha pytest (>=4.6) + :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio Mar 03, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jan 25, 2022 N/A N/A @@ -102,7 +102,7 @@ This list contains 1007 plugins. :pypi:`pytest-black` A pytest plugin to enable format checking with black Oct 05, 2020 4 - Beta N/A :pypi:`pytest-black-multipy` Allow '--black' on older Pythons Jan 14, 2021 5 - Production/Stable pytest (!=3.7.3,>=3.5) ; extra == 'testing' :pypi:`pytest-blame` A pytest plugin helps developers to debug by providing useful commits history. May 04, 2019 N/A pytest (>=4.4.0) - :pypi:`pytest-blender` Blender Pytest plugin. Oct 29, 2021 N/A pytest (==6.2.5) ; extra == 'dev' + :pypi:`pytest-blender` Blender Pytest plugin. Mar 11, 2022 N/A pytest ; extra == 'dev' :pypi:`pytest-blink1` Pytest plugin to emit notifications via the Blink(1) RGB LED Jan 07, 2018 4 - Beta N/A :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A @@ -126,7 +126,7 @@ This list contains 1007 plugins. :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Mar 03, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A - :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Feb 19, 2022 N/A pytest + :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Mar 08, 2022 N/A pytest :pypi:`pytest-camel-collect` Enable CamelCase-aware pytest class collection Aug 02, 2020 N/A pytest (>=2.9) :pypi:`pytest-canonical-data` A plugin which allows to compare results with canonical results, based on previous runs May 08, 2020 2 - Pre-Alpha pytest (>=3.5.0) :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A @@ -201,6 +201,7 @@ This list contains 1007 plugins. :pypi:`pytest-datadir` pytest plugin for test data directories and files Oct 22, 2019 5 - Production/Stable pytest (>=2.7.0) :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Jan 20, 2022 5 - Production/Stable pytest :pypi:`pytest-datadir-ng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Dec 25, 2019 5 - Production/Stable pytest + :pypi:`pytest-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Mar 09, 2022 N/A pytest (>=7.0.1) :pypi:`pytest-data-file` Fixture "data" and "case_data" for test from yaml file Dec 04, 2019 N/A N/A :pypi:`pytest-datafiles` py.test plugin to create a 'tmpdir' containing predefined files/directories. Oct 07, 2018 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-datafixtures` Data fixtures for pytest made simple Dec 05, 2020 5 - Production/Stable N/A @@ -285,7 +286,7 @@ This list contains 1007 plugins. :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A :pypi:`pytest-duration-insights` Jun 25, 2021 N/A N/A - :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Feb 14, 2022 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Mar 07, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-dynamicrerun` A pytest plugin to rerun tests dynamically based off of test outcome and output. Aug 15, 2020 4 - Beta N/A :pypi:`pytest-dynamodb` DynamoDB fixtures for pytest Jun 03, 2021 5 - Production/Stable pytest :pypi:`pytest-easy-addoption` pytest-easy-addoption: Easy way to work with pytest addoption Jan 22, 2020 N/A N/A @@ -299,14 +300,14 @@ This list contains 1007 plugins. :pypi:`pytest-elements` Tool to help automate user interfaces Jan 13, 2021 N/A pytest (>=5.4,<6.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Mar 04, 2022 N/A pytest (>=6.2.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Mar 04, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Mar 04, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Mar 04, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Mar 04, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Mar 08, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Mar 08, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Mar 08, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Mar 08, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Mar 08, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Mar 04, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Mar 04, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Mar 08, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Mar 08, 2022 N/A N/A :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Oct 10, 2021 4 - Beta pytest (==6.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -425,7 +426,7 @@ This list contains 1007 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 05, 2022 3 - Alpha pytest (==7.0.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 12, 2022 3 - Alpha pytest (==7.0.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jan 20, 2022 N/A pytest (>=5.0) @@ -481,7 +482,7 @@ This list contains 1007 plugins. :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Dec 02, 2021 3 - Alpha N/A - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Feb 26, 2022 3 - Alpha pytest + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Mar 09, 2022 3 - Alpha pytest :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A @@ -553,7 +554,7 @@ This list contains 1007 plugins. :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Jan 28, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-mock-api` A mock API server with configurable routes and responses available as a fixture. Feb 13, 2019 1 - Planning pytest (>=4.0.0) - :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator Jan 05, 2022 5 - Production/Stable N/A + :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator Mar 08, 2022 5 - Production/Stable N/A :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A @@ -589,11 +590,13 @@ This list contains 1007 plugins. :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) :pypi:`pytest-network` A simple plugin to disable network on socket level. May 07, 2020 N/A N/A + :pypi:`pytest-network-endpoints` Network endpoints plugin for pytest Mar 06, 2022 N/A pytest :pypi:`pytest-never-sleep` pytest plugin helps to avoid adding tests without mock \`time.sleep\` May 05, 2021 3 - Alpha pytest (>=3.5.1) :pypi:`pytest-nginx` nginx fixture for pytest Aug 12, 2017 5 - Production/Stable N/A :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Mar 08, 2022 N/A pytest (==6.2.5) :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A :pypi:`pytest-nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Jul 07, 2021 N/A N/A @@ -676,7 +679,7 @@ This list contains 1007 plugins. :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Aug 19, 2021 5 - Production/Stable pytest :pypi:`pytest-portion` Select a portion of the collected tests Jan 28, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest - :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Dec 22, 2021 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 31, 2022 N/A pytest (>=3.4.1) :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A @@ -765,10 +768,11 @@ This list contains 1007 plugins. :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Jun 17, 2021 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) - :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Jan 20, 2022 N/A N/A + :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A + :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Mar 07, 2022 N/A N/A :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Feb 04, 2022 5 - Production/Stable N/A + :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A :pypi:`pytest-responses` py.test integration for responses Apr 26, 2021 N/A pytest (>=2.5) :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed Jan 10, 2022 5 - Production/Stable pytest :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A @@ -790,19 +794,19 @@ This list contains 1007 plugins. :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A - :pypi:`pytest-salt-factories` Pytest Salt Plugin Feb 19, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Mar 12, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 02, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 12, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Aug 31, 2020 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 02, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 12, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -857,8 +861,8 @@ This list contains 1007 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Feb 18, 2022 N/A pytest (>5.4.0,<6.3) - :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 01, 2022 N/A N/A + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Mar 08, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 09, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Mar 13, 2018 3 - Alpha N/A @@ -907,12 +911,12 @@ This list contains 1007 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Feb 10, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Mar 01, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Mar 11, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) :pypi:`pytest-testrail2` A small example package Nov 17, 2020 N/A pytest (>=5) - :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Dec 17, 2021 N/A pytest (>=5.5) + :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Mar 11, 2022 N/A pytest (>=5.5) :pypi:`pytest-testrail-api-client` TestRail Api Python Client Dec 14, 2021 N/A pytest :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A @@ -958,10 +962,11 @@ This list contains 1007 plugins. :pypi:`pytest-trio` Pytest plugin for trio Oct 16, 2020 N/A N/A :pypi:`pytest-trytond` Pytest plugin for the Tryton server framework Feb 02, 2022 3 - Alpha pytest (>=5) :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Mar 11, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Feb 14, 2022 4 - Beta N/A + :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Mar 07, 2022 4 - Beta N/A :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) :pypi:`pytest-ubersmith` Easily mock calls to ubersmith at the \`requests\` level. Apr 13, 2015 N/A N/A :pypi:`pytest-ui` Text User Interface for running python tests Jul 05, 2021 4 - Beta pytest @@ -1022,7 +1027,7 @@ This list contains 1007 plugins. :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A - :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Feb 02, 2022 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Mar 10, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-zulip` Pytest report plugin for Zulip Mar 04, 2022 5 - Production/Stable pytest =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ @@ -1108,7 +1113,7 @@ This list contains 1007 plugins. Pytest \`client\` fixture for the Aiohttp :pypi:`pytest-aiomoto` - *last release*: Feb 24, 2022, + *last release*: Mar 12, 2022, *status*: N/A, *requires*: pytest (>=6.2.5,<7.0.0) @@ -1143,7 +1148,7 @@ This list contains 1007 plugins. :pypi:`pytest-alembic` - *last release*: Feb 08, 2022, + *last release*: Mar 12, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -1367,7 +1372,7 @@ This list contains 1007 plugins. Meta-package containing dependencies for testing :pypi:`pytest-astropy-header` - *last release*: Dec 27, 2021, + *last release*: Mar 10, 2022, *status*: 3 - Alpha, *requires*: pytest (>=4.6) @@ -1619,9 +1624,9 @@ This list contains 1007 plugins. A pytest plugin helps developers to debug by providing useful commits history. :pypi:`pytest-blender` - *last release*: Oct 29, 2021, + *last release*: Mar 11, 2022, *status*: N/A, - *requires*: pytest (==6.2.5) ; extra == 'dev' + *requires*: pytest ; extra == 'dev' Blender Pytest plugin. @@ -1787,7 +1792,7 @@ This list contains 1007 plugins. Pytest plugin to only run tests affected by changes :pypi:`pytest-cairo` - *last release*: Feb 19, 2022, + *last release*: Mar 08, 2022, *status*: N/A, *requires*: pytest @@ -2311,6 +2316,13 @@ This list contains 1007 plugins. Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. + :pypi:`pytest-data-extractor` + *last release*: Mar 09, 2022, + *status*: N/A, + *requires*: pytest (>=7.0.1) + + A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) + :pypi:`pytest-data-file` *last release*: Dec 04, 2019, *status*: N/A, @@ -2900,7 +2912,7 @@ This list contains 1007 plugins. :pypi:`pytest-durations` - *last release*: Feb 14, 2022, + *last release*: Mar 07, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.6) @@ -2998,35 +3010,35 @@ This list contains 1007 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Mar 04, 2022, + *last release*: Mar 08, 2022, *status*: N/A, - *requires*: pytest (>=6.2.0) + *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Mar 04, 2022, + *last release*: Mar 08, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Mar 04, 2022, + *last release*: Mar 08, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Mar 04, 2022, + *last release*: Mar 08, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Mar 04, 2022, + *last release*: Mar 08, 2022, *status*: N/A, *requires*: N/A @@ -3040,14 +3052,14 @@ This list contains 1007 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Mar 04, 2022, + *last release*: Mar 08, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Mar 04, 2022, + *last release*: Mar 08, 2022, *status*: N/A, *requires*: N/A @@ -3880,7 +3892,7 @@ This list contains 1007 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Mar 05, 2022, + *last release*: Mar 12, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.0.1) @@ -4272,7 +4284,7 @@ This list contains 1007 plugins. py.test JIRA integration plugin, using markers :pypi:`pytest-jira-xray` - *last release*: Feb 26, 2022, + *last release*: Mar 09, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -4776,7 +4788,7 @@ This list contains 1007 plugins. A mock API server with configurable routes and responses available as a fixture. :pypi:`pytest-mock-generator` - *last release*: Jan 05, 2022, + *last release*: Mar 08, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -5027,6 +5039,13 @@ This list contains 1007 plugins. A simple plugin to disable network on socket level. + :pypi:`pytest-network-endpoints` + *last release*: Mar 06, 2022, + *status*: N/A, + *requires*: pytest + + Network endpoints plugin for pytest + :pypi:`pytest-never-sleep` *last release*: May 05, 2021, *status*: 3 - Alpha, @@ -5062,6 +5081,13 @@ This list contains 1007 plugins. pytest ngs fixtures + :pypi:`pytest-nhsd-apim` + *last release*: Mar 08, 2022, + *status*: N/A, + *requires*: pytest (==6.2.5) + + Pytest plugin accessing NHSDigital's APIM proxies + :pypi:`pytest-nice` *last release*: May 04, 2019, *status*: 4 - Beta, @@ -5637,7 +5663,7 @@ This list contains 1007 plugins. Run PostgreSQL in Docker container in Pytest. :pypi:`pytest-postgresql` - *last release*: Dec 22, 2021, + *last release*: Mar 11, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2.0) @@ -6259,8 +6285,15 @@ This list contains 1007 plugins. pytest plugin to re-run tests to eliminate flaky failures + :pypi:`pytest-rerunfailures-all-logs` + *last release*: Mar 07, 2022, + *status*: 5 - Production/Stable, + *requires*: N/A + + pytest plugin to re-run tests to eliminate flaky failures + :pypi:`pytest-resilient-circuits` - *last release*: Jan 20, 2022, + *last release*: Mar 07, 2022, *status*: N/A, *requires*: N/A @@ -6281,7 +6314,7 @@ This list contains 1007 plugins. Provides path for uniform access to test resources in isolated directory :pypi:`pytest-responsemock` - *last release*: Feb 04, 2022, + *last release*: Mar 10, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6435,7 +6468,7 @@ This list contains 1007 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Feb 19, 2022, + *last release*: Mar 12, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6477,7 +6510,7 @@ This list contains 1007 plugins. :pypi:`pytest-sbase` - *last release*: Mar 02, 2022, + *last release*: Mar 12, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6519,7 +6552,7 @@ This list contains 1007 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Mar 02, 2022, + *last release*: Mar 12, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6904,14 +6937,14 @@ This list contains 1007 plugins. :pypi:`pytest-splunk-addon` - *last release*: Feb 18, 2022, + *last release*: Mar 08, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) A Dynamic test tool for Splunk Apps and Add-ons :pypi:`pytest-splunk-addon-ui-smartx` - *last release*: Mar 01, 2022, + *last release*: Mar 09, 2022, *status*: N/A, *requires*: N/A @@ -7254,7 +7287,7 @@ This list contains 1007 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Mar 01, 2022, + *last release*: Mar 11, 2022, *status*: 4 - Beta, *requires*: N/A @@ -7289,7 +7322,7 @@ This list contains 1007 plugins. A small example package :pypi:`pytest-testrail-api` - *last release*: Dec 17, 2021, + *last release*: Mar 11, 2022, *status*: N/A, *requires*: pytest (>=5.5) @@ -7610,6 +7643,13 @@ This list contains 1007 plugins. A simple plugin to use with tspwplib + :pypi:`pytest-tst` + *last release*: Mar 11, 2022, + *status*: N/A, + *requires*: pytest (>=5.0.0) + + Customize pytest options, output and exit code to make it compatible with tst + :pypi:`pytest-tstcls` *last release*: Mar 23, 2020, *status*: 5 - Production/Stable, @@ -7632,7 +7672,7 @@ This list contains 1007 plugins. Run type checkers on specified test files :pypi:`pytest-typhoon-xray` - *last release*: Feb 14, 2022, + *last release*: Mar 07, 2022, *status*: 4 - Beta, *requires*: N/A @@ -8059,7 +8099,7 @@ This list contains 1007 plugins. OWASP ZAP plugin for py.test. :pypi:`pytest-zebrunner` - *last release*: Feb 02, 2022, + *last release*: Mar 10, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.5.0) From d87e1e67dd2beddbed276074c4908ce06c4080d1 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 13 Mar 2022 16:58:05 +0200 Subject: [PATCH 172/549] Merge pull request #9758 from pytest-dev/release-7.1.0 Prepare release 7.1.0 (cherry picked from commit 7d4d1ecde6cdc3feae9ee076ee5aab4e05393fa6) --- changelog/5192.improvement.rst | 3 - changelog/8242.bugfix.rst | 3 - changelog/8838.breaking.rst | 15 ----- changelog/9362.improvement.rst | 1 - changelog/9437.breaking.rst | 1 - changelog/9493.bugfix.rst | 10 ---- changelog/9536.improvement.rst | 1 - changelog/9626.bugfix.rst | 3 - changelog/9644.improvement.rst | 4 -- changelog/9645.bugfix.rst | 1 - changelog/9678.improvement.rst | 3 - changelog/9692.improvement.rst | 3 - changelog/9708.bugfix.rst | 1 - changelog/9730.bugfix.rst | 1 - doc/en/announce/index.rst | 1 + doc/en/announce/release-7.1.0.rst | 48 ++++++++++++++++ doc/en/builtin.rst | 4 +- doc/en/changelog.rst | 92 +++++++++++++++++++++++++++++++ doc/en/example/reportingdemo.rst | 6 +- doc/en/getting-started.rst | 2 +- doc/en/how-to/assert.rst | 2 +- doc/en/how-to/output.rst | 4 +- 22 files changed, 150 insertions(+), 59 deletions(-) delete mode 100644 changelog/5192.improvement.rst delete mode 100644 changelog/8242.bugfix.rst delete mode 100644 changelog/8838.breaking.rst delete mode 100644 changelog/9362.improvement.rst delete mode 100644 changelog/9437.breaking.rst delete mode 100644 changelog/9493.bugfix.rst delete mode 100644 changelog/9536.improvement.rst delete mode 100644 changelog/9626.bugfix.rst delete mode 100644 changelog/9644.improvement.rst delete mode 100644 changelog/9645.bugfix.rst delete mode 100644 changelog/9678.improvement.rst delete mode 100644 changelog/9692.improvement.rst delete mode 100644 changelog/9708.bugfix.rst delete mode 100644 changelog/9730.bugfix.rst create mode 100644 doc/en/announce/release-7.1.0.rst diff --git a/changelog/5192.improvement.rst b/changelog/5192.improvement.rst deleted file mode 100644 index c51077ae5f1..00000000000 --- a/changelog/5192.improvement.rst +++ /dev/null @@ -1,3 +0,0 @@ -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. diff --git a/changelog/8242.bugfix.rst b/changelog/8242.bugfix.rst deleted file mode 100644 index eaa46142eea..00000000000 --- a/changelog/8242.bugfix.rst +++ /dev/null @@ -1,3 +0,0 @@ -The deprecation of raising :class:`unittest.SkipTest` to skip collection of -tests during the pytest collection phase is reverted - this is now a supported -feature again. diff --git a/changelog/8838.breaking.rst b/changelog/8838.breaking.rst deleted file mode 100644 index f5c1fead874..00000000000 --- a/changelog/8838.breaking.rst +++ /dev/null @@ -1,15 +0,0 @@ -As per our policy, the following features have been deprecated in the 6.X series and are now -removed: - -* ``pytest._fillfuncargs`` function. - -* ``pytest_warning_captured`` hook - use ``pytest_warning_recorded`` instead. - -* ``-k -foobar`` syntax - use ``-k 'not foobar'`` instead. - -* ``-k foobar:`` syntax. - -* ``pytest.collect`` module - import from ``pytest`` directly. - -For more information consult -`Deprecations and Removals `__ in the docs. diff --git a/changelog/9362.improvement.rst b/changelog/9362.improvement.rst deleted file mode 100644 index ad7f8042ca9..00000000000 --- a/changelog/9362.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -pytest now avoids specialized assert formatting when it is detected that the default ``__eq__`` is overridden in ``attrs`` or ``dataclasses``. diff --git a/changelog/9437.breaking.rst b/changelog/9437.breaking.rst deleted file mode 100644 index 60d4337f420..00000000000 --- a/changelog/9437.breaking.rst +++ /dev/null @@ -1 +0,0 @@ -Dropped support for Python 3.6, which reached `end-of-life `__ at 2021-12-23. diff --git a/changelog/9493.bugfix.rst b/changelog/9493.bugfix.rst deleted file mode 100644 index d99c80b7d2c..00000000000 --- a/changelog/9493.bugfix.rst +++ /dev/null @@ -1,10 +0,0 @@ -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 - -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 :pull:`6523` for details). diff --git a/changelog/9536.improvement.rst b/changelog/9536.improvement.rst deleted file mode 100644 index c7769602f54..00000000000 --- a/changelog/9536.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -When ``-vv`` is given on command line, show skipping and xfail reasons in full instead of truncating them to fit the terminal width. diff --git a/changelog/9626.bugfix.rst b/changelog/9626.bugfix.rst deleted file mode 100644 index 44d3734a1d2..00000000000 --- a/changelog/9626.bugfix.rst +++ /dev/null @@ -1,3 +0,0 @@ -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. diff --git a/changelog/9644.improvement.rst b/changelog/9644.improvement.rst deleted file mode 100644 index 6e29fd57a79..00000000000 --- a/changelog/9644.improvement.rst +++ /dev/null @@ -1,4 +0,0 @@ -More information about the location of resources that led Python to raise :class:`ResourceWarning` can now -be obtained by enabling :mod:`tracemalloc`. - -See :ref:`resource-warnings` for more information. diff --git a/changelog/9645.bugfix.rst b/changelog/9645.bugfix.rst deleted file mode 100644 index 089a783dee6..00000000000 --- a/changelog/9645.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed regression where ``--import-mode=importlib`` used together with :envvar:`PYTHONPATH` or :confval:`pythonpath` would cause import errors in test suites. diff --git a/changelog/9678.improvement.rst b/changelog/9678.improvement.rst deleted file mode 100644 index d7bb1083a4d..00000000000 --- a/changelog/9678.improvement.rst +++ /dev/null @@ -1,3 +0,0 @@ -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. diff --git a/changelog/9692.improvement.rst b/changelog/9692.improvement.rst deleted file mode 100644 index ecc57a68c22..00000000000 --- a/changelog/9692.improvement.rst +++ /dev/null @@ -1,3 +0,0 @@ -:func:`pytest.approx` now raises a :class:`TypeError` when given an unordered sequence (such as :class:`set`). - -Note that this implies that custom classes which only implement ``__iter__`` and ``__len__`` are no longer supported as they don't guarantee order. diff --git a/changelog/9708.bugfix.rst b/changelog/9708.bugfix.rst deleted file mode 100644 index 9defbbd578f..00000000000 --- a/changelog/9708.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -:fixture:`pytester` now requests a :fixture:`monkeypatch` fixture instead of creating one internally. This solves some issues with tests that involve pytest environment variables. diff --git a/changelog/9730.bugfix.rst b/changelog/9730.bugfix.rst deleted file mode 100644 index df30ab7e360..00000000000 --- a/changelog/9730.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Malformed ``pyproject.toml`` files now produce a clearer error message. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 9505b0b9e46..e55dd33e81e 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-7.1.0 release-7.0.1 release-7.0.0 release-7.0.0rc1 diff --git a/doc/en/announce/release-7.1.0.rst b/doc/en/announce/release-7.1.0.rst new file mode 100644 index 00000000000..3361e1c8a32 --- /dev/null +++ b/doc/en/announce/release-7.1.0.rst @@ -0,0 +1,48 @@ +pytest-7.1.0 +======================================= + +The pytest team is proud to announce the 7.1.0 release! + +This release contains new features, improvements, and bug fixes, +the full list of changes is available in the changelog: + + https://docs.pytest.org/en/stable/changelog.html + +For complete documentation, please visit: + + https://docs.pytest.org/en/stable/ + +As usual, you can upgrade from PyPI via: + + pip install -U pytest + +Thanks to all of the contributors to this release: + +* Akuli +* Andrew Svetlov +* Anthony Sottile +* Brett Holman +* Bruno Oliveira +* Chris NeJame +* Dan Alvizu +* Elijah DeLee +* Emmanuel Arias +* Fabian Egli +* Florian Bruhin +* Gabor Szabo +* Hasan Ramezani +* Hugo van Kemenade +* Kian Meng, Ang +* Kojo Idrissa +* Masaru Tsuchiyama +* Olga Matoula +* P. L. Lim +* Ran Benita +* Tobias Deiminger +* Yuval Shimon +* eduardo naufel schettino +* Éric + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index c7e7863b218..455ae88121f 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -65,7 +65,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a Fixture that returns a :py:class:`dict` that will be injected into the namespace of doctests. - pytestconfig [session scope] -- .../_pytest/fixtures.py:1365 + pytestconfig [session scope] -- .../_pytest/fixtures.py:1334 Session-scoped fixture that returns the session's :class:`pytest.Config` object. @@ -134,7 +134,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a .. _legacy_path: https://py.readthedocs.io/en/latest/path.html - caplog -- .../_pytest/logging.py:483 + caplog -- .../_pytest/logging.py:487 Access and control log capturing. Captured logs are available through the following properties/methods:: diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 41a79ce5b2f..64a22cbc7b5 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -28,6 +28,98 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 7.1.0 (2022-03-13) +========================= + +Breaking Changes +---------------- + +- `#8838 `_: As per our policy, the following features have been deprecated in the 6.X series and are now + removed: + + * ``pytest._fillfuncargs`` function. + + * ``pytest_warning_captured`` hook - use ``pytest_warning_recorded`` instead. + + * ``-k -foobar`` syntax - use ``-k 'not foobar'`` instead. + + * ``-k foobar:`` syntax. + + * ``pytest.collect`` module - import from ``pytest`` directly. + + For more information consult + `Deprecations and Removals `__ in the docs. + + +- `#9437 `_: Dropped support for Python 3.6, which reached `end-of-life `__ at 2021-12-23. + + + +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 :class:`ResourceWarning` can now + be obtained by enabling :mod:`tracemalloc`. + + See :ref:`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 `_: :func:`pytest.approx` now raises a :class:`TypeError` when given an unordered sequence (such as :class:`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 :class:`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 + tests/real/test_it.py + tests/link -> tests/real + + 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 :pull:`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 :envvar:`PYTHONPATH` or :confval:`pythonpath` would cause import errors in test suites. + + +- `#9708 `_: :fixture:`pytester` now requests a :fixture:`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) ========================= diff --git a/doc/en/example/reportingdemo.rst b/doc/en/example/reportingdemo.rst index cab93143615..4c1ae1c05af 100644 --- a/doc/en/example/reportingdemo.rst +++ b/doc/en/example/reportingdemo.rst @@ -155,7 +155,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert [0, 1, 2] == [0, 1, 3] E assert [0, 1, 2] == [0, 1, 3] E At index 2 diff: 2 != 3 - E Use -v to get the full diff + E Use -v to get more diff failure_demo.py:63: AssertionError ______________ TestSpecialisedExplanations.test_eq_list_long _______________ @@ -168,7 +168,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert a == b E assert [0, 0, 0, 0, 0, 0, ...] == [0, 0, 0, 0, 0, 0, ...] E At index 100 diff: 1 != 2 - E Use -v to get the full diff + E Use -v to get more diff failure_demo.py:68: AssertionError _________________ TestSpecialisedExplanations.test_eq_dict _________________ @@ -215,7 +215,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert [1, 2] == [1, 2, 3] E assert [1, 2] == [1, 2, 3] E Right contains one more item: 3 - E Use -v to get the full diff + E Use -v to get more diff failure_demo.py:77: AssertionError _________________ TestSpecialisedExplanations.test_in_list _________________ diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index 79b88ced9e1..73f6fc53b48 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -22,7 +22,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 7.0.1 + pytest 7.1.0 .. _`simpletest`: diff --git a/doc/en/how-to/assert.rst b/doc/en/how-to/assert.rst index cb70db6b8ed..65f16129142 100644 --- a/doc/en/how-to/assert.rst +++ b/doc/en/how-to/assert.rst @@ -201,7 +201,7 @@ if you run this module: E '1' E Extra items in the right set: E '5' - E Use -v to get the full diff + E Use -v to get more diff test_assert2.py:4: AssertionError ========================= short test summary info ========================== diff --git a/doc/en/how-to/output.rst b/doc/en/how-to/output.rst index 4b90988f49d..dc3a86ba29d 100644 --- a/doc/en/how-to/output.rst +++ b/doc/en/how-to/output.rst @@ -84,7 +84,7 @@ Executing pytest normally gives us this output (we are skipping the header to fo > assert fruits1 == fruits2 E AssertionError: assert ['banana', 'a...elon', 'kiwi'] == ['banana', 'a...elon', 'kiwi'] E At index 2 diff: 'grapes' != 'orange' - E Use -v to get the full diff + E Use -v to get more diff test_verbosity_example.py:8: AssertionError ____________________________ test_numbers_fail _____________________________ @@ -99,7 +99,7 @@ Executing pytest normally gives us this output (we are skipping the header to fo E {'1': 1, '2': 2, '3': 3, '4': 4} E Right contains 4 more items: E {'10': 10, '20': 20, '30': 30, '40': 40} - E Use -v to get the full diff + E Use -v to get more diff test_verbosity_example.py:14: AssertionError ___________________________ test_long_text_fail ____________________________ From e75cdae2bc92c8b1c53114addf5fd23a4dad796d Mon Sep 17 00:00:00 2001 From: Rowin Date: Mon, 14 Mar 2022 13:26:17 +0100 Subject: [PATCH 173/549] Typo correction A word was missing in the docstring of the warns function. --- src/_pytest/recwarn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index 175b571a80c..b460668fea0 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -110,7 +110,7 @@ def warns( r"""Assert that code raises a particular class of warning. Specifically, the parameter ``expected_warning`` can be a warning class or - sequence of warning classes, and the inside the ``with`` block must issue a warning of that class or + sequence of warning classes, and the code inside the ``with`` block must issue a warning of that class or classes. This helper produces a list of :class:`warnings.WarningMessage` objects, From 37fa0fb4d34eb99df13434c533b096740693fafb Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 14 Mar 2022 22:27:52 +0200 Subject: [PATCH 174/549] testing: fix tests when run under `-v` or `-vv` Regressed in fac8f284cd6ffd44c7d401093c67799766473be1, didn't notice since we don't run tests in CI with `-v`. --- testing/test_assertrewrite.py | 48 +++++++---------------------------- 1 file changed, 9 insertions(+), 39 deletions(-) diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 8f18e89c94f..a515bbae96b 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -204,16 +204,8 @@ def f3() -> None: def f4() -> None: assert sys == 42 # type: ignore[comparison-overlap] - verbose = request.config.getoption("verbose") msg = getmsg(f4, {"sys": sys}) - if verbose > 0: - assert msg == ( - "assert == 42\n" - " +\n" - " -42" - ) - else: - assert msg == "assert sys == 42" + assert msg == "assert sys == 42" def f5() -> None: assert cls == 42 # type: ignore[name-defined] # noqa: F821 @@ -224,20 +216,7 @@ class X: msg = getmsg(f5, {"cls": X}) assert msg is not None lines = msg.splitlines() - if verbose > 1: - assert lines == [ - f"assert {X!r} == 42", - f" +{X!r}", - " -42", - ] - elif verbose > 0: - assert lines == [ - "assert .X'> == 42", - f" +{X!r}", - " -42", - ] - else: - assert lines == ["assert cls == 42"] + assert lines == ["assert cls == 42"] def test_assertrepr_compare_same_width(self, request) -> None: """Should use same width/truncation with same initial width.""" @@ -279,14 +258,11 @@ def f() -> None: msg = getmsg(f, {"cls": Y}) assert msg is not None lines = msg.splitlines() - if request.config.getoption("verbose") > 0: - assert lines == ["assert 3 == 2", " +3", " -2"] - else: - assert lines == [ - "assert 3 == 2", - " + where 3 = Y.foo", - " + where Y = cls()", - ] + assert lines == [ + "assert 3 == 2", + " + where 3 = Y.foo", + " + where Y = cls()", + ] def test_assert_already_has_message(self) -> None: def f(): @@ -663,10 +639,7 @@ def f(): assert len(values) == 11 msg = getmsg(f) - if request.config.getoption("verbose") > 0: - assert msg == "assert 10 == 11\n +10\n -11" - else: - assert msg == "assert 10 == 11\n + where 10 = len([0, 1, 2, 3, 4, 5, ...])" + assert msg == "assert 10 == 11\n + where 10 = len([0, 1, 2, 3, 4, 5, ...])" def test_custom_reprcompare(self, monkeypatch) -> None: def my_reprcompare1(op, left, right) -> str: @@ -732,10 +705,7 @@ def __repr__(self): msg = getmsg(f) assert msg is not None lines = util._format_lines([msg]) - if request.config.getoption("verbose") > 0: - assert lines == ["assert 0 == 1\n +0\n -1"] - else: - assert lines == ["assert 0 == 1\n + where 1 = \\n{ \\n~ \\n}.a"] + assert lines == ["assert 0 == 1\n + where 1 = \\n{ \\n~ \\n}.a"] def test_custom_repr_non_ascii(self) -> None: def f() -> None: From abfae83130a6905638d41a0fe879d4018dd9c4ab Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 14 Mar 2022 20:48:34 +0000 Subject: [PATCH 175/549] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- extra/setup-py.test/setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/extra/setup-py.test/setup.py b/extra/setup-py.test/setup.py index d0560ce1f5f..97883852e2e 100644 --- a/extra/setup-py.test/setup.py +++ b/extra/setup-py.test/setup.py @@ -1,4 +1,5 @@ import sys + from distutils.core import setup if __name__ == "__main__": From d52a6e6074844581f5f89653bd4071fb6ea847d3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Mar 2022 21:34:40 +0200 Subject: [PATCH 176/549] [pre-commit.ci] pre-commit autoupdate (#9769) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/asottile/reorder_python_imports: v2.7.1 → v3.0.1](https://github.com/asottile/reorder_python_imports/compare/v2.7.1...v3.0.1) - [github.com/asottile/pyupgrade: v2.31.0 → v2.31.1](https://github.com/asottile/pyupgrade/compare/v2.31.0...v2.31.1) - [github.com/pre-commit/mirrors-mypy: v0.931 → v0.940](https://github.com/pre-commit/mirrors-mypy/compare/v0.931...v0.940) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix mypy errors Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bruno Oliveira --- .pre-commit-config.yaml | 6 +++--- extra/setup-py.test/setup.py | 1 + src/_pytest/config/__init__.py | 4 +++- src/_pytest/mark/structures.py | 4 ++-- testing/test_assertrewrite.py | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5de99c99aaf..261c525c822 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,12 +37,12 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v2.7.1 + rev: v3.0.1 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.31.0 + rev: v2.31.1 hooks: - id: pyupgrade args: [--py37-plus] @@ -56,7 +56,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.931 + rev: v0.940 hooks: - id: mypy files: ^(src/|testing/) diff --git a/extra/setup-py.test/setup.py b/extra/setup-py.test/setup.py index d0560ce1f5f..97883852e2e 100644 --- a/extra/setup-py.test/setup.py +++ b/extra/setup-py.test/setup.py @@ -1,4 +1,5 @@ import sys + from distutils.core import setup if __name__ == "__main__": diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index f4818c861cf..1141897348d 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -309,7 +309,9 @@ def _prepareconfig( elif isinstance(args, os.PathLike): args = [os.fspath(args)] elif not isinstance(args, list): - msg = "`args` parameter expected to be a list of strings, got: {!r} (type: {})" + msg = ( # type:ignore[unreachable] + "`args` parameter expected to be a list of strings, got: {!r} (type: {})" + ) raise TypeError(msg.format(args, type(args))) config = get_config(args, plugins) diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index ec41b3f99a6..b8cbf0d1875 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -397,7 +397,7 @@ def store_mark(obj, mark: Mark) -> None: from _pytest.scope import _ScopeName class _SkipMarkDecorator(MarkDecorator): - @overload # type: ignore[override,misc] + @overload # type: ignore[override,misc,no-overload-impl] def __call__(self, arg: Markable) -> Markable: ... @@ -415,7 +415,7 @@ def __call__( # type: ignore[override] ... class _XfailMarkDecorator(MarkDecorator): - @overload # type: ignore[override,misc] + @overload # type: ignore[override,misc,no-overload-impl] def __call__(self, arg: Markable) -> Markable: ... diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 8f18e89c94f..1f89658e18a 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1059,7 +1059,7 @@ def atomic_write_failed(fn, mode="r", overwrite=False): e = OSError() e.errno = 10 raise e - yield + yield # type:ignore[unreachable] monkeypatch.setattr( _pytest.assertion.rewrite, "atomic_write", atomic_write_failed From 1d70b022f07c51ffcde24739807f4d36a6eb621a Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 16 Mar 2022 22:27:56 +0200 Subject: [PATCH 177/549] config: restore pre-pytest 7.1.0 confcutdir exclusion behavior The change from `path not in confuctdir.parents` to the `relative_to` check in 0c98f1923101e5905c54ba07650a043fca374f4b broke picking up conftest files when running against an installed package/site-packages. See the issue for more details. Fix #9767. --- changelog/9767.bugfix.rst | 1 + src/_pytest/config/__init__.py | 6 +----- testing/test_conftest.py | 28 ++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 changelog/9767.bugfix.rst diff --git a/changelog/9767.bugfix.rst b/changelog/9767.bugfix.rst new file mode 100644 index 00000000000..7de316980b8 --- /dev/null +++ b/changelog/9767.bugfix.rst @@ -0,0 +1 @@ +Fixed a regression in pytest 7.1.0 where some conftest.py files outside of the source tree (e.g. in the `site-packages` directory) were not picked up. diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 1141897348d..05abaa8eda6 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -540,11 +540,7 @@ def _is_in_confcutdir(self, path: Path) -> bool: """ if self._confcutdir is None: return True - try: - path.relative_to(self._confcutdir) - except ValueError: - return False - return True + return path not in self._confcutdir.parents def _try_load_conftest( self, anchor: Path, importmode: Union[str, ImportMode], rootpath: Path diff --git a/testing/test_conftest.py b/testing/test_conftest.py index 4cbc2d14c36..68048204581 100644 --- a/testing/test_conftest.py +++ b/testing/test_conftest.py @@ -252,6 +252,34 @@ def pytest_addoption(parser): result.stdout.no_fnmatch_line("*warning: could not load initial*") +def test_installed_conftest_is_picked_up(pytester: Pytester, tmp_path: Path) -> None: + """When using `--pyargs` to run tests in an installed packages (located e.g. + in a site-packages in the PYTHONPATH), conftest files in there are picked + up. + + Regression test for #9767. + """ + # pytester dir - the source tree. + # tmp_path - the simulated site-packages dir (not in source tree). + + pytester.syspathinsert(tmp_path) + pytester.makepyprojecttoml("[tool.pytest.ini_options]") + tmp_path.joinpath("foo").mkdir() + tmp_path.joinpath("foo", "__init__.py").touch() + tmp_path.joinpath("foo", "conftest.py").write_text( + textwrap.dedent( + """\ + import pytest + @pytest.fixture + def fix(): return None + """ + ) + ) + tmp_path.joinpath("foo", "test_it.py").write_text("def test_it(fix): pass") + result = pytester.runpytest("--pyargs", "foo") + assert result.ret == 0 + + def test_conftest_symlink(pytester: Pytester) -> None: """`conftest.py` discovery follows normal path resolution and does not resolve symlinks.""" # Structure: From a18655f7292da608ba4358a887b642be117a1176 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 17 Mar 2022 23:17:11 +0200 Subject: [PATCH 178/549] Merge pull request #9785 from pytest-dev/release-7.1.1 Prepare release 7.1.1 (cherry picked from commit b9462ed7d0b665778c908ab311015a49ece4f20e) --- changelog/9767.bugfix.rst | 1 - doc/en/announce/index.rst | 1 + doc/en/announce/release-7.1.1.rst | 18 ++++++++++++++++++ doc/en/changelog.rst | 9 +++++++++ doc/en/getting-started.rst | 2 +- 5 files changed, 29 insertions(+), 2 deletions(-) delete mode 100644 changelog/9767.bugfix.rst create mode 100644 doc/en/announce/release-7.1.1.rst diff --git a/changelog/9767.bugfix.rst b/changelog/9767.bugfix.rst deleted file mode 100644 index 7de316980b8..00000000000 --- a/changelog/9767.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed a regression in pytest 7.1.0 where some conftest.py files outside of the source tree (e.g. in the `site-packages` directory) were not picked up. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index e55dd33e81e..0da8b4037ed 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-7.1.1 release-7.1.0 release-7.0.1 release-7.0.0 diff --git a/doc/en/announce/release-7.1.1.rst b/doc/en/announce/release-7.1.1.rst new file mode 100644 index 00000000000..d271c4557a2 --- /dev/null +++ b/doc/en/announce/release-7.1.1.rst @@ -0,0 +1,18 @@ +pytest-7.1.1 +======================================= + +pytest 7.1.1 has just been released to PyPI. + +This is a bug-fix release, being a drop-in replacement. To upgrade:: + + pip install --upgrade pytest + +The full changelog is available at https://docs.pytest.org/en/stable/changelog.html. + +Thanks to all of the contributors to this release: + +* Ran Benita + + +Happy testing, +The pytest Development Team diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 64a22cbc7b5..6ff85883e41 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -28,6 +28,15 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 7.1.1 (2022-03-17) +========================= + +Bug Fixes +--------- + +- `#9767 `_: Fixed a regression in pytest 7.1.0 where some conftest.py files outside of the source tree (e.g. in the `site-packages` directory) were not picked up. + + pytest 7.1.0 (2022-03-13) ========================= diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index 73f6fc53b48..b856803f1f1 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -22,7 +22,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 7.1.0 + pytest 7.1.1 .. _`simpletest`: From 8f64a39d0aab74b2de2bacee03f76e4b90555fa5 Mon Sep 17 00:00:00 2001 From: Florian Best Date: Fri, 18 Mar 2022 22:00:14 +0100 Subject: [PATCH 179/549] [style]: fix typo in docstring --- src/_pytest/python_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index ea646811ddf..be15761339e 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -573,7 +573,7 @@ def approx(expected, rel=None, abs=None, nan_ok: bool = False) -> ApproxBase: >>> {'a': 0.1 + 0.2, 'b': 0.2 + 0.4} == approx({'a': 0.3, 'b': 0.6}) True - The comparision will be true if both mappings have the same keys and their + The comparison will be true if both mappings have the same keys and their respective values match the expected tolerances. **Tolerances** From b75cbee290ffd5a5e7fb3a247220d812d7f0fe71 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Sat, 19 Mar 2022 11:55:39 +0000 Subject: [PATCH 180/549] Remove newlines from left/right operands with '-vv' (#9743) The left/right operands produced when `verbose > 1` should not contain newlines, because they are used to build the `summary` string. The `assertrepr_compare` function returns a list of lines, and the summary is one of those lines and should not contain newlines itself. Fix #9742 Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bruno Oliveira --- AUTHORS | 1 + changelog/9742.improvement.rst | 1 + src/_pytest/_io/saferepr.py | 17 +++++++++++++++++ src/_pytest/assertion/util.py | 6 +++--- testing/io/test_saferepr.py | 21 +++++++++++++++++++++ testing/test_assertion.py | 15 +++++++++++++++ 6 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 changelog/9742.improvement.rst diff --git a/AUTHORS b/AUTHORS index 2b6ca66de7a..1c82b006de1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -289,6 +289,7 @@ Ruaridh Williamson Russel Winder Ryan Wooden Saiprasad Kale +Samuel Colvin Samuel Dion-Girardeau Samuel Searles-Bryant Samuele Pedroni diff --git a/changelog/9742.improvement.rst b/changelog/9742.improvement.rst new file mode 100644 index 00000000000..a1abfc27469 --- /dev/null +++ b/changelog/9742.improvement.rst @@ -0,0 +1 @@ +Display assertion message without escaped newline characters with ``-vv``. diff --git a/src/_pytest/_io/saferepr.py b/src/_pytest/_io/saferepr.py index e7ff5cab203..a27e8c2a6a5 100644 --- a/src/_pytest/_io/saferepr.py +++ b/src/_pytest/_io/saferepr.py @@ -107,6 +107,23 @@ def saferepr(obj: object, maxsize: Optional[int] = DEFAULT_REPR_MAX_SIZE) -> str return SafeRepr(maxsize).repr(obj) +def saferepr_unlimited(obj: object) -> str: + """Return an unlimited-size safe repr-string for the given object. + + As with saferepr, failing __repr__ functions of user instances + will be represented with a short exception info. + + This function is a wrapper around simple repr. + + Note: a cleaner solution would be to alter ``saferepr``this way + when maxsize=None, but that might affect some other code. + """ + try: + return repr(obj) + except Exception as exc: + return _format_repr_exception(exc, obj) + + class AlwaysDispatchingPrettyPrinter(pprint.PrettyPrinter): """PrettyPrinter that always dispatches (regardless of width).""" diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index 03167ddd471..75026730df4 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -14,8 +14,8 @@ import _pytest._code from _pytest import outcomes from _pytest._io.saferepr import _pformat_dispatch -from _pytest._io.saferepr import safeformat from _pytest._io.saferepr import saferepr +from _pytest._io.saferepr import saferepr_unlimited from _pytest.config import Config # The _reprcompare attribute on the util module is used by the new assertion @@ -160,8 +160,8 @@ def assertrepr_compare(config, op: str, left: Any, right: Any) -> Optional[List[ """Return specialised explanations for some operators/operands.""" verbose = config.getoption("verbose") if verbose > 1: - left_repr = safeformat(left) - right_repr = safeformat(right) + left_repr = saferepr_unlimited(left) + right_repr = saferepr_unlimited(right) else: # XXX: "15 chars indentation" is wrong # ("E AssertionError: assert "); should use term width. diff --git a/testing/io/test_saferepr.py b/testing/io/test_saferepr.py index 63d3af822b1..24746bc2235 100644 --- a/testing/io/test_saferepr.py +++ b/testing/io/test_saferepr.py @@ -2,6 +2,7 @@ from _pytest._io.saferepr import _pformat_dispatch from _pytest._io.saferepr import DEFAULT_REPR_MAX_SIZE from _pytest._io.saferepr import saferepr +from _pytest._io.saferepr import saferepr_unlimited def test_simple_repr(): @@ -179,3 +180,23 @@ def __repr__(self): assert saferepr(SomeClass()).startswith( "<[RuntimeError() raised in repr()] SomeClass object at 0x" ) + + +def test_saferepr_unlimited(): + dict5 = {f"v{i}": i for i in range(5)} + assert saferepr_unlimited(dict5) == "{'v0': 0, 'v1': 1, 'v2': 2, 'v3': 3, 'v4': 4}" + + dict_long = {f"v{i}": i for i in range(1_000)} + r = saferepr_unlimited(dict_long) + assert "..." not in r + assert "\n" not in r + + +def test_saferepr_unlimited_exc(): + class A: + def __repr__(self): + raise ValueError(42) + + assert saferepr_unlimited(A()).startswith( + "<[ValueError(42) raised in repr()] A object at 0x" + ) diff --git a/testing/test_assertion.py b/testing/test_assertion.py index d37ee72a2ec..4825ede778b 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -1695,3 +1695,18 @@ def test(): "*= 1 failed in*", ] ) + + +def test_reprcompare_verbose_long() -> None: + a = {f"v{i}": i for i in range(11)} + b = a.copy() + b["v2"] += 10 + lines = callop("==", a, b, verbose=2) + assert lines is not None + assert lines[0] == ( + "{'v0': 0, 'v1': 1, 'v2': 2, 'v3': 3, 'v4': 4, 'v5': 5, " + "'v6': 6, 'v7': 7, 'v8': 8, 'v9': 9, 'v10': 10}" + " == " + "{'v0': 0, 'v1': 1, 'v2': 12, 'v3': 3, 'v4': 4, 'v5': 5, " + "'v6': 6, 'v7': 7, 'v8': 8, 'v9': 9, 'v10': 10}" + ) From 4c16b5af0361e222e907aac34a492cdc544fdf93 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 19 Mar 2022 08:56:05 -0300 Subject: [PATCH 181/549] Split test/deploy workflows This will trigger a deploy directly when a tag is pushed, avoiding having to wait for another lenghty build. This is safe since we only push release tags after the release PR has passed all its tests. See comments in #9793. --- .github/workflows/deploy.yml | 56 ++++++++++++++++++++++++ .github/workflows/{main.yml => test.yml} | 45 +------------------ README.rst | 4 +- 3 files changed, 59 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/deploy.yml rename .github/workflows/{main.yml => test.yml} (82%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000000..54c74863f84 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,56 @@ +name: deploy + +on: + push: + tags: + # These tags are protected, see: + # https://github.com/pytest-dev/pytest/settings/tag_protection + - "[0-9]+.[0-9]+.[0-9]+" + - "[0-9]+.[0-9]+.[0-9]+rc[0-9]+" + + +# Set permissions at the job level. +permissions: {} + +jobs: + + deploy: + if: github.repository == 'pytest-dev/pytest' + + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + contents: write + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.7" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install --upgrade build tox + + - name: Build package + run: | + python -m build + + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_token }} + + - name: Publish GitHub release notes + env: + GH_RELEASE_NOTES_TOKEN: ${{ github.token }} + run: | + sudo apt-get install pandoc + tox -e publish-gh-release-notes diff --git a/.github/workflows/main.yml b/.github/workflows/test.yml similarity index 82% rename from .github/workflows/main.yml rename to .github/workflows/test.yml index a69b905683b..0c5fda16e4a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: main +name: test on: push: @@ -187,46 +187,3 @@ jobs: fail_ci_if_error: true files: ./coverage.xml verbose: true - - deploy: - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pytest' - - runs-on: ubuntu-latest - timeout-minutes: 30 - permissions: - contents: write - - needs: [build] - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.7" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install --upgrade build tox - - - name: Build package - run: | - python -m build - - - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.pypi_token }} - - - name: Publish GitHub release notes - env: - GH_RELEASE_NOTES_TOKEN: ${{ github.token }} - run: | - sudo apt-get install pandoc - tox -e publish-gh-release-notes diff --git a/README.rst b/README.rst index f0fe3563219..034034a40b8 100644 --- a/README.rst +++ b/README.rst @@ -20,8 +20,8 @@ :target: https://codecov.io/gh/pytest-dev/pytest :alt: Code coverage Status -.. image:: https://github.com/pytest-dev/pytest/workflows/main/badge.svg - :target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Amain +.. image:: https://github.com/pytest-dev/pytest/workflows/test/badge.svg + :target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Atest .. image:: https://results.pre-commit.ci/badge/github/pytest-dev/pytest/main.svg :target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest/main From e503faeb6ee20a7ed92715ea9f438308aea23da2 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 20 Mar 2022 00:17:32 +0000 Subject: [PATCH 182/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 180 ++++++++++++++++++------------- 1 file changed, 106 insertions(+), 74 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 4dd206c87a1..71e4d234729 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1012 plugins. +This list contains 1016 plugins. .. only:: not latex @@ -29,7 +29,7 @@ This list contains 1012 plugins. :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Nov 01, 2020 N/A pytest (>=6) - :pypi:`pytest-aiomoto` pytest-aiomoto Mar 12, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-aiomoto` pytest-aiomoto Mar 13, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) @@ -69,7 +69,7 @@ This list contains 1012 plugins. :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio Mar 03, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jan 25, 2022 N/A N/A + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Mar 16, 2022 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) :pypi:`pytest-async-sqlalchemy` Database testing fixtures using the SQLAlchemy asyncio API Oct 07, 2021 4 - Beta pytest (>=6.0.0) @@ -85,7 +85,7 @@ This list contains 1012 plugins. :pypi:`pytest-aws` pytest plugin for testing AWS resource configurations Oct 04, 2017 4 - Beta N/A :pypi:`pytest-aws-config` Protect your AWS credentials in unit tests May 28, 2021 N/A N/A :pypi:`pytest-axe` pytest plugin for axe-selenium-python Nov 12, 2018 N/A pytest (>=3.0.0) - :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Jul 23, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Mar 16, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Jun 19, 2020 5 - Production/Stable pytest (>=2.7.3) :pypi:`pytest-bdd` BDD for pytest Oct 25, 2021 6 - Mature pytest (>=4.3) @@ -131,7 +131,8 @@ This list contains 1012 plugins. :pypi:`pytest-canonical-data` A plugin which allows to compare results with canonical results, based on previous runs May 08, 2020 2 - Pre-Alpha pytest (>=3.5.0) :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A :pypi:`pytest-capture-deprecatedwarnings` pytest plugin to capture all deprecatedwarnings and put them in one file Apr 30, 2019 N/A N/A - :pypi:`pytest-cases` Separate test code from test cases in pytest. Feb 08, 2022 5 - Production/Stable N/A + :pypi:`pytest-capture-warnings` pytest plugin to capture all warnings and put them in one file of your choice Mar 16, 2022 N/A pytest + :pypi:`pytest-cases` Separate test code from test cases in pytest. Mar 14, 2022 5 - Production/Stable N/A :pypi:`pytest-cassandra` Cassandra CCM Test Fixtures for pytest Nov 04, 2017 1 - Planning N/A :pypi:`pytest-catchlog` py.test plugin to catch log messages. This is a fork of pytest-capturelog. Jan 24, 2016 4 - Beta pytest (>=2.6) :pypi:`pytest-catch-server` Pytest plugin with server for catching HTTP requests. Dec 12, 2019 5 - Production/Stable N/A @@ -167,7 +168,7 @@ This list contains 1012 plugins. :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-config` Base configurations and utilities for developing your Python project test suite with pytest. Nov 07, 2014 5 - Production/Stable N/A :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Nov 06, 2020 N/A N/A - :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts Feb 23, 2022 4 - Beta N/A + :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts Mar 18, 2022 4 - Beta N/A :pypi:`pytest-consul` pytest plugin with fixtures for testing consul aware apps Nov 24, 2018 3 - Alpha pytest :pypi:`pytest-container` Pytest fixtures for writing container based tests Feb 01, 2022 3 - Alpha pytest (>=3.10) :pypi:`pytest-contextfixture` Define pytest fixtures as context managers. Mar 12, 2013 4 - Beta N/A @@ -180,7 +181,8 @@ This list contains 1012 plugins. :pypi:`pytest-coverage` Jun 17, 2015 N/A N/A :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' - :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Dec 06, 2021 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) + :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Mar 14, 2022 N/A N/A :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest @@ -269,6 +271,7 @@ This list contains 1012 plugins. :pypi:`pytest-docker-postgresql` A simple plugin to use with pytest Sep 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-docker-py` Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. Nov 27, 2018 N/A pytest (==4.0.0) :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Feb 09, 2022 4 - Beta pytest + :pypi:`pytest-docker-service` pytest plugin to start docker container Mar 15, 2022 3 - Alpha pytest :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-tools` Docker integration tests for pytest Feb 17, 2022 4 - Beta pytest (>=6.0.1) :pypi:`pytest-docs` Documentation tool for pytest Nov 11, 2018 4 - Beta pytest (>=3.5.0) @@ -300,14 +303,14 @@ This list contains 1012 plugins. :pypi:`pytest-elements` Tool to help automate user interfaces Jan 13, 2021 N/A pytest (>=5.4,<6.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Mar 08, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Mar 08, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Mar 08, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Mar 08, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Mar 08, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Mar 18, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Mar 18, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Mar 18, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Mar 18, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Mar 18, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Mar 08, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Mar 08, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Mar 18, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Mar 18, 2022 N/A N/A :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Oct 10, 2021 4 - Beta pytest (==6.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -373,7 +376,7 @@ This list contains 1012 plugins. :pypi:`pytest-fixtures` Common fixtures for pytest May 01, 2019 5 - Production/Stable N/A :pypi:`pytest-fixture-tools` Plugin for pytest which provides tools for fixtures Aug 18, 2020 6 - Mature pytest :pypi:`pytest-fixture-typecheck` A pytest plugin to assert type annotations at runtime. Aug 24, 2021 N/A pytest - :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Mar 05, 2022 4 - Beta pytest (>=3.5) + :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Mar 18, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. Jan 10, 2022 5 - Production/Stable pytest :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Mar 01, 2022 5 - Production/Stable pytest (>=7.0) :pypi:`pytest-flakefinder` Runs tests multiple times to expose flakiness. Jul 28, 2020 4 - Beta pytest (>=2.7.1) @@ -395,6 +398,7 @@ This list contains 1012 plugins. :pypi:`pytest-funparam` An alternative way to parametrize test cases. Dec 02, 2021 4 - Beta pytest >=4.6.0 :pypi:`pytest-fxa` pytest plugin for Firefox Accounts Aug 28, 2018 5 - Production/Stable N/A :pypi:`pytest-fxtest` Oct 27, 2020 N/A N/A + :pypi:`pytest-gather-fixtures` set up asynchronous pytest fixtures concurrently Mar 15, 2022 N/A pytest (>=6.0.0,<7.0.0) :pypi:`pytest-gc` The garbage collector plugin for py.test Feb 01, 2018 N/A N/A :pypi:`pytest-gcov` Uses gcov to measure test coverage of a C library Feb 01, 2018 3 - Alpha N/A :pypi:`pytest-gevent` Ensure that gevent is properly patched when invoking pytest Feb 25, 2020 N/A pytest @@ -426,7 +430,7 @@ This list contains 1012 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 12, 2022 3 - Alpha pytest (==7.0.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 16, 2022 3 - Alpha pytest (==7.0.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jan 20, 2022 N/A pytest (>=5.0) @@ -440,7 +444,7 @@ This list contains 1012 plugins. :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A :pypi:`pytest-html-thread` pytest plugin for generating HTML reports Dec 29, 2020 5 - Production/Stable N/A :pypi:`pytest-http` Fixture "http" for http requests Dec 05, 2019 N/A N/A - :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Feb 25, 2022 5 - Production/Stable pytest ; extra == 'test' + :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Mar 16, 2022 5 - Production/Stable pytest ; extra == 'test' :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Jan 27, 2022 3 - Alpha N/A @@ -454,7 +458,7 @@ This list contains 1012 plugins. :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 30, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A - :pypi:`pytest-image-diff` Jan 20, 2022 3 - Alpha pytest + :pypi:`pytest-image-diff` Mar 17, 2022 3 - Alpha pytest :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A :pypi:`pytest-influxdb` Plugin for influxdb and pytest integration. Apr 20, 2021 N/A N/A :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A @@ -487,7 +491,7 @@ This list contains 1012 plugins. :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A :pypi:`pytest-jsonlint` UNKNOWN Aug 04, 2016 N/A N/A - :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Sep 24, 2021 4 - Beta pytest (>=3.8.0) + :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Mar 15, 2022 4 - Beta pytest (>=3.8.0) :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 24, 2021 N/A pytest :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Jan 24, 2021 5 - Production/Stable N/A @@ -596,7 +600,7 @@ This list contains 1012 plugins. :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Mar 08, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Mar 15, 2022 N/A pytest (==6.2.5) :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A :pypi:`pytest-nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Jul 07, 2021 N/A N/A @@ -608,7 +612,7 @@ This list contains 1012 plugins. :pypi:`pytest-notifier` A pytest plugin to notify test result Jun 12, 2020 3 - Alpha pytest :pypi:`pytest-notimplemented` Pytest markers for not implemented features and tests. Aug 27, 2019 N/A pytest (>=5.1,<6.0) :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A - :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Aug 04, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Mar 16, 2022 4 - Beta pytest (>=4.6.0) :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A :pypi:`pytest-odoo` py.test plugin to run Odoo tests Feb 08, 2022 4 - Beta N/A :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A @@ -618,7 +622,7 @@ This list contains 1012 plugins. :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Mar 02, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Operators Mar 17, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -633,7 +637,7 @@ This list contains 1012 plugins. :pypi:`pytest-param` pytest plugin to test all, first, last or random params Sep 11, 2016 4 - Beta pytest (>=2.6.0) :pypi:`pytest-paramark` Configure pytest fixtures using a combination of"parametrize" and markers Jan 10, 2020 4 - Beta pytest (>=4.5.0) :pypi:`pytest-parametrization` Simpler PyTest parametrization Nov 30, 2021 5 - Production/Stable pytest - :pypi:`pytest-parametrize-cases` A more user-friendly way to write parametrized tests. Dec 12, 2020 N/A pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-parametrize-cases` A more user-friendly way to write parametrized tests. Mar 13, 2022 N/A pytest (>=6.1.2) :pypi:`pytest-parametrized` Pytest plugin for parametrizing tests with default iterables. Oct 19, 2020 5 - Production/Stable pytest :pypi:`pytest-parawtf` Finally spell paramete?ri[sz]e correctly Dec 03, 2018 4 - Beta pytest (>=3.6.0) :pypi:`pytest-pass` Check out https://github.com/elilutsky/pytest-pass Dec 04, 2019 N/A N/A @@ -647,7 +651,7 @@ This list contains 1012 plugins. :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) :pypi:`pytest-perf` pytest-perf Feb 05, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) - :pypi:`pytest-persistence` Pytest tool for persistent objects Dec 07, 2021 N/A N/A + :pypi:`pytest-persistence` Pytest tool for persistent objects Mar 14, 2022 N/A N/A :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 18, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Nov 10, 2021 4 - Beta pytest (>=6.2) ; extra == 'test' @@ -662,7 +666,7 @@ This list contains 1012 plugins. :pypi:`pytest-platform-markers` Markers for pytest to skip tests on specific platforms Sep 09, 2019 4 - Beta pytest (>=3.6.0) :pypi:`pytest-play` pytest plugin that let you automate actions and assertions with test metrics reporting executing plain YAML files Jun 12, 2019 5 - Production/Stable N/A :pypi:`pytest-playbook` Pytest plugin for reading playbooks. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) - :pypi:`pytest-playwright` A pytest wrapper with fixtures for Playwright to automate web browsers Feb 10, 2022 N/A pytest + :pypi:`pytest-playwright` A pytest wrapper with fixtures for Playwright to automate web browsers Mar 16, 2022 N/A pytest :pypi:`pytest-playwrights` A pytest wrapper with fixtures for Playwright to automate web browsers Dec 02, 2021 N/A N/A :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Aug 17, 2020 5 - Production/Stable pytest @@ -696,9 +700,9 @@ This list contains 1012 plugins. :pypi:`pytest-pudb` Pytest PuDB debugger integration Oct 25, 2018 3 - Alpha pytest (>=2.0) :pypi:`pytest-purkinje` py.test plugin for purkinje test runner Oct 28, 2017 2 - Pre-Alpha N/A :pypi:`pytest-pycharm` Plugin for py.test to enter PyCharm debugger on uncaught exceptions Aug 13, 2020 5 - Production/Stable pytest (>=2.3) - :pypi:`pytest-pycodestyle` pytest plugin to run pycodestyle Aug 10, 2020 3 - Alpha N/A + :pypi:`pytest-pycodestyle` pytest plugin to run pycodestyle Mar 13, 2022 3 - Alpha N/A :pypi:`pytest-pydev` py.test plugin to connect to a remote debug server with PyDev or PyCharm. Nov 15, 2017 3 - Alpha N/A - :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Aug 10, 2020 3 - Alpha N/A + :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Mar 13, 2022 3 - Alpha N/A :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) @@ -712,7 +716,7 @@ This list contains 1012 plugins. :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Jun 26, 2021 4 - Beta pytest (>=6.2.0) - :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jan 18, 2022 5 - Production/Stable pytest (>=6.2.3) + :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Mar 17, 2022 5 - Production/Stable pytest (>=6.2.3) :pypi:`pytest-qml` Run QML Tests with pytest Dec 02, 2020 4 - Beta pytest (>=6.0.0) :pypi:`pytest-qr` pytest plugin to generate test result QR codes Nov 25, 2021 4 - Beta N/A :pypi:`pytest-qt` pytest support for PyQt and PySide applications Jun 13, 2021 5 - Production/Stable pytest (>=3.0.0) @@ -800,13 +804,13 @@ This list contains 1012 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 18, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A - :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Aug 31, 2020 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 18, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -857,12 +861,12 @@ This list contains 1012 plugins. :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Dec 22, 2021 6 - Mature pytest (>=6.2.4) - :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Jan 10, 2022 4 - Beta pytest (>=5,<7) + :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Mar 13, 2022 4 - Beta pytest (>=5,<8) :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Mar 08, 2022 N/A pytest (>5.4.0,<6.3) - :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 09, 2022 N/A N/A + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Mar 16, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Mar 13, 2018 3 - Alpha N/A @@ -962,7 +966,7 @@ This list contains 1012 plugins. :pypi:`pytest-trio` Pytest plugin for trio Oct 16, 2020 N/A N/A :pypi:`pytest-trytond` Pytest plugin for the Tryton server framework Feb 02, 2022 3 - Alpha pytest (>=5) :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Mar 11, 2022 N/A pytest (>=5.0.0) + :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Mar 13, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) @@ -1113,7 +1117,7 @@ This list contains 1012 plugins. Pytest \`client\` fixture for the Aiohttp :pypi:`pytest-aiomoto` - *last release*: Mar 12, 2022, + *last release*: Mar 13, 2022, *status*: N/A, *requires*: pytest (>=6.2.5,<7.0.0) @@ -1393,7 +1397,7 @@ This list contains 1012 plugins. Pytest support for asyncio :pypi:`pytest-asyncio-cooperative` - *last release*: Jan 25, 2022, + *last release*: Mar 16, 2022, *status*: N/A, *requires*: N/A @@ -1505,9 +1509,9 @@ This list contains 1012 plugins. pytest plugin for axe-selenium-python :pypi:`pytest-azurepipelines` - *last release*: Jul 23, 2020, + *last release*: Mar 16, 2022, *status*: 4 - Beta, - *requires*: pytest (>=3.5.0) + *requires*: pytest (>=5.0.0) Formatting PyTest output for Azure Pipelines UI @@ -1826,8 +1830,15 @@ This list contains 1012 plugins. pytest plugin to capture all deprecatedwarnings and put them in one file + :pypi:`pytest-capture-warnings` + *last release*: Mar 16, 2022, + *status*: N/A, + *requires*: pytest + + pytest plugin to capture all warnings and put them in one file of your choice + :pypi:`pytest-cases` - *last release*: Feb 08, 2022, + *last release*: Mar 14, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -2079,7 +2090,7 @@ This list contains 1012 plugins. Package stands for pytest plugin to upload results into Confluence page. :pypi:`pytest-console-scripts` - *last release*: Feb 23, 2022, + *last release*: Mar 18, 2022, *status*: 4 - Beta, *requires*: N/A @@ -2170,12 +2181,19 @@ This list contains 1012 plugins. Pytest plugin for excluding tests based on coverage data :pypi:`pytest-cpp` - *last release*: Dec 06, 2021, + *last release*: Mar 18, 2022, *status*: 5 - Production/Stable, *requires*: pytest (!=5.4.0,!=5.4.1) Use pytest's runner to discover and execute C++ tests + :pypi:`pytest-cppython` + *last release*: Mar 14, 2022, + *status*: N/A, + *requires*: N/A + + A pytest plugin that imports CPPython testing types + :pypi:`pytest-cram` *last release*: Aug 08, 2020, *status*: N/A, @@ -2792,6 +2810,13 @@ This list contains 1012 plugins. Pytest fixtures for testing with docker registries. + :pypi:`pytest-docker-service` + *last release*: Mar 15, 2022, + *status*: 3 - Alpha, + *requires*: pytest + + pytest plugin to start docker container + :pypi:`pytest-docker-squid-fixtures` *last release*: Feb 09, 2022, *status*: 4 - Beta, @@ -3010,35 +3035,35 @@ This list contains 1012 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Mar 08, 2022, + *last release*: Mar 18, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Mar 08, 2022, + *last release*: Mar 18, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Mar 08, 2022, + *last release*: Mar 18, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Mar 08, 2022, + *last release*: Mar 18, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Mar 08, 2022, + *last release*: Mar 18, 2022, *status*: N/A, *requires*: N/A @@ -3052,14 +3077,14 @@ This list contains 1012 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Mar 08, 2022, + *last release*: Mar 18, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Mar 08, 2022, + *last release*: Mar 18, 2022, *status*: N/A, *requires*: N/A @@ -3521,9 +3546,9 @@ This list contains 1012 plugins. A pytest plugin to assert type annotations at runtime. :pypi:`pytest-flake8` - *last release*: Mar 05, 2022, + *last release*: Mar 18, 2022, *status*: 4 - Beta, - *requires*: pytest (>=3.5) + *requires*: pytest (>=7.0) pytest plugin to check FLAKE8 requirements @@ -3674,6 +3699,13 @@ This list contains 1012 plugins. + :pypi:`pytest-gather-fixtures` + *last release*: Mar 15, 2022, + *status*: N/A, + *requires*: pytest (>=6.0.0,<7.0.0) + + set up asynchronous pytest fixtures concurrently + :pypi:`pytest-gc` *last release*: Feb 01, 2018, *status*: N/A, @@ -3892,7 +3924,7 @@ This list contains 1012 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Mar 12, 2022, + *last release*: Mar 16, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.0.1) @@ -3990,7 +4022,7 @@ This list contains 1012 plugins. Fixture "http" for http requests :pypi:`pytest-httpbin` - *last release*: Feb 25, 2022, + *last release*: Mar 16, 2022, *status*: 5 - Production/Stable, *requires*: pytest ; extra == 'test' @@ -4088,7 +4120,7 @@ This list contains 1012 plugins. ignore failures from flaky tests (pytest plugin) :pypi:`pytest-image-diff` - *last release*: Jan 20, 2022, + *last release*: Mar 17, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -4319,7 +4351,7 @@ This list contains 1012 plugins. UNKNOWN :pypi:`pytest-json-report` - *last release*: Sep 24, 2021, + *last release*: Mar 15, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.8.0) @@ -5082,7 +5114,7 @@ This list contains 1012 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Mar 08, 2022, + *last release*: Mar 15, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -5166,9 +5198,9 @@ This list contains 1012 plugins. A PyTest Reporter to send test runs to Notion.so :pypi:`pytest-nunit` - *last release*: Aug 04, 2020, + *last release*: Mar 16, 2022, *status*: 4 - Beta, - *requires*: pytest (>=3.5.0) + *requires*: pytest (>=4.6.0) A pytest plugin for generating NUnit3 test result XML output @@ -5236,7 +5268,7 @@ This list contains 1012 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: Mar 02, 2022, + *last release*: Mar 17, 2022, *status*: N/A, *requires*: pytest @@ -5341,9 +5373,9 @@ This list contains 1012 plugins. Simpler PyTest parametrization :pypi:`pytest-parametrize-cases` - *last release*: Dec 12, 2020, + *last release*: Mar 13, 2022, *status*: N/A, - *requires*: pytest (>=6.1.2,<7.0.0) + *requires*: pytest (>=6.1.2) A more user-friendly way to write parametrized tests. @@ -5439,7 +5471,7 @@ This list contains 1012 plugins. A simple plugin to ensure the execution of critical sections of code has not been impacted :pypi:`pytest-persistence` - *last release*: Dec 07, 2021, + *last release*: Mar 14, 2022, *status*: N/A, *requires*: N/A @@ -5544,7 +5576,7 @@ This list contains 1012 plugins. Pytest plugin for reading playbooks. :pypi:`pytest-playwright` - *last release*: Feb 10, 2022, + *last release*: Mar 16, 2022, *status*: N/A, *requires*: pytest @@ -5782,7 +5814,7 @@ This list contains 1012 plugins. Plugin for py.test to enter PyCharm debugger on uncaught exceptions :pypi:`pytest-pycodestyle` - *last release*: Aug 10, 2020, + *last release*: Mar 13, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -5796,7 +5828,7 @@ This list contains 1012 plugins. py.test plugin to connect to a remote debug server with PyDev or PyCharm. :pypi:`pytest-pydocstyle` - *last release*: Aug 10, 2020, + *last release*: Mar 13, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -5894,7 +5926,7 @@ This list contains 1012 plugins. Pytest plugin for uploading test results to your QA Touch Testrun. :pypi:`pytest-qgis` - *last release*: Jan 18, 2022, + *last release*: Mar 17, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2.3) @@ -6510,7 +6542,7 @@ This list contains 1012 plugins. :pypi:`pytest-sbase` - *last release*: Mar 12, 2022, + *last release*: Mar 18, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6524,7 +6556,7 @@ This list contains 1012 plugins. pytest plugin for test scenarios :pypi:`pytest-schema` - *last release*: Aug 31, 2020, + *last release*: Mar 14, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=3.5.0) @@ -6552,7 +6584,7 @@ This list contains 1012 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Mar 12, 2022, + *last release*: Mar 18, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6909,9 +6941,9 @@ This list contains 1012 plugins. Pytest plugin for the splinter automation library :pypi:`pytest-split` - *last release*: Jan 10, 2022, + *last release*: Mar 13, 2022, *status*: 4 - Beta, - *requires*: pytest (>=5,<7) + *requires*: pytest (>=5,<8) Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. @@ -6937,14 +6969,14 @@ This list contains 1012 plugins. :pypi:`pytest-splunk-addon` - *last release*: Mar 08, 2022, + *last release*: Mar 16, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) A Dynamic test tool for Splunk Apps and Add-ons :pypi:`pytest-splunk-addon-ui-smartx` - *last release*: Mar 09, 2022, + *last release*: Mar 16, 2022, *status*: N/A, *requires*: N/A @@ -7644,7 +7676,7 @@ This list contains 1012 plugins. A simple plugin to use with tspwplib :pypi:`pytest-tst` - *last release*: Mar 11, 2022, + *last release*: Mar 13, 2022, *status*: N/A, *requires*: pytest (>=5.0.0) From 3297bb24a9ad50aa20345ca5b58806ac782a9c36 Mon Sep 17 00:00:00 2001 From: Kian Eliasi Date: Mon, 21 Mar 2022 03:31:59 +0330 Subject: [PATCH 183/549] Remove unnecessary numpy import (#9798) Fix #9726 --- AUTHORS | 1 + changelog/9726.bugfix.rst | 1 + src/_pytest/python_api.py | 3 +-- testing/python/approx.py | 32 +++++++++++++++++--------------- 4 files changed, 20 insertions(+), 17 deletions(-) create mode 100644 changelog/9726.bugfix.rst diff --git a/AUTHORS b/AUTHORS index 1c82b006de1..69e71fa10d4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -185,6 +185,7 @@ Katerina Koukiou Keri Volans Kevin Cox Kevin J. Foley +Kian Eliasi Kian-Meng Ang Kodi B. Arfer Kojo Idrissa diff --git a/changelog/9726.bugfix.rst b/changelog/9726.bugfix.rst new file mode 100644 index 00000000000..66c04c4d90c --- /dev/null +++ b/changelog/9726.bugfix.rst @@ -0,0 +1 @@ +An unnecessary ``numpy`` import inside :func:`pytest.approx` was removed. diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index be15761339e..5fa21961924 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -319,7 +319,6 @@ def __repr__(self) -> str: def _repr_compare(self, other_side: Sequence[float]) -> List[str]: import math - import numpy as np if len(self.expected) != len(other_side): return [ @@ -340,7 +339,7 @@ def _repr_compare(self, other_side: Sequence[float]) -> List[str]: abs_diff = abs(approx_value.expected - other_value) max_abs_diff = max(max_abs_diff, abs_diff) if other_value == 0.0: - max_rel_diff = np.inf + max_rel_diff = math.inf else: max_rel_diff = max(max_rel_diff, abs_diff / abs(other_value)) different_ids.append(i) diff --git a/testing/python/approx.py b/testing/python/approx.py index 2eec4e9f7d0..7b4fbad156e 100644 --- a/testing/python/approx.py +++ b/testing/python/approx.py @@ -92,9 +92,7 @@ def do_assert(lhs, rhs, expected_message, verbosity_level=0): class TestApprox: - def test_error_messages(self, assert_approx_raises_regex): - np = pytest.importorskip("numpy") - + def test_error_messages_native_dtypes(self, assert_approx_raises_regex): assert_approx_raises_regex( 2.0, 1.0, @@ -135,6 +133,22 @@ def test_error_messages(self, assert_approx_raises_regex): ], ) + # Specific test for comparison with 0.0 (relative diff will be 'inf') + assert_approx_raises_regex( + [0.0], + [1.0], + [ + r" comparison failed. Mismatched elements: 1 / 1:", + rf" Max absolute difference: {SOME_FLOAT}", + r" Max relative difference: inf", + r" Index \| Obtained\s+\| Expected ", + rf"\s*0\s*\| {SOME_FLOAT} \| {SOME_FLOAT} ± {SOME_FLOAT}", + ], + ) + + def test_error_messages_numpy_dtypes(self, assert_approx_raises_regex): + np = pytest.importorskip("numpy") + a = np.linspace(0, 100, 20) b = np.linspace(0, 100, 20) a[10] += 0.5 @@ -175,18 +189,6 @@ def test_error_messages(self, assert_approx_raises_regex): ) # Specific test for comparison with 0.0 (relative diff will be 'inf') - assert_approx_raises_regex( - [0.0], - [1.0], - [ - r" comparison failed. Mismatched elements: 1 / 1:", - rf" Max absolute difference: {SOME_FLOAT}", - r" Max relative difference: inf", - r" Index \| Obtained\s+\| Expected ", - rf"\s*0\s*\| {SOME_FLOAT} \| {SOME_FLOAT} ± {SOME_FLOAT}", - ], - ) - assert_approx_raises_regex( np.array([0.0]), np.array([1.0]), From e9dd3dffab6576d61f2b4a10c58722eed1793cbd Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Mon, 21 Mar 2022 03:32:39 +0100 Subject: [PATCH 184/549] Enhance errors for exception/warnings matching (#8508) Co-authored-by: Florian Bruhin --- changelog/8508.improvement.rst | 2 ++ src/_pytest/_code/code.py | 9 +++++---- src/_pytest/recwarn.py | 36 +++++++++++++++++----------------- testing/code/test_excinfo.py | 14 +++++++------ testing/python/raises.py | 17 +++++++++------- testing/test_recwarn.py | 25 ++++++++++------------- 6 files changed, 53 insertions(+), 50 deletions(-) create mode 100644 changelog/8508.improvement.rst diff --git a/changelog/8508.improvement.rst b/changelog/8508.improvement.rst new file mode 100644 index 00000000000..36fb945829c --- /dev/null +++ b/changelog/8508.improvement.rst @@ -0,0 +1,2 @@ +Introduce multiline display for warning matching via :py:func:`pytest.warns` and +enhance match comparison for :py:func:`_pytest._code.ExceptionInfo.match` as returned by :py:func:`pytest.raises`. diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index 5b758a88480..304a5cbd751 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -672,10 +672,11 @@ def match(self, regexp: Union[str, Pattern[str]]) -> "Literal[True]": If it matches `True` is returned, otherwise an `AssertionError` is raised. """ __tracebackhide__ = True - msg = "Regex pattern {!r} does not match {!r}." - if regexp == str(self.value): - msg += " Did you mean to `re.escape()` the regex?" - assert re.search(regexp, str(self.value)), msg.format(regexp, str(self.value)) + value = str(self.value) + msg = f"Regex pattern did not match.\n Regex: {regexp!r}\n Input: {value!r}" + if regexp == value: + msg += "\n Did you mean to `re.escape()` the regex?" + assert re.search(regexp, value), msg # Return True to allow for "assert excinfo.match()". return True diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index b460668fea0..49e1de2827f 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -1,6 +1,7 @@ """Record warnings during test function execution.""" import re import warnings +from pprint import pformat from types import TracebackType from typing import Any from typing import Callable @@ -142,10 +143,11 @@ def warns( __tracebackhide__ = True if not args: if kwargs: - msg = "Unexpected keyword arguments passed to pytest.warns: " - msg += ", ".join(sorted(kwargs)) - msg += "\nUse context-manager form instead?" - raise TypeError(msg) + argnames = ", ".join(sorted(kwargs)) + raise TypeError( + f"Unexpected keyword arguments passed to pytest.warns: {argnames}" + "\nUse context-manager form instead?" + ) return WarningsChecker(expected_warning, match_expr=match, _ispytest=True) else: func = args[0] @@ -191,7 +193,7 @@ def pop(self, cls: Type[Warning] = Warning) -> "warnings.WarningMessage": if issubclass(w.category, cls): return self._list.pop(i) __tracebackhide__ = True - raise AssertionError("%r not found in warning list" % cls) + raise AssertionError(f"{cls!r} not found in warning list") def clear(self) -> None: """Clear the list of recorded warnings.""" @@ -202,7 +204,7 @@ def clear(self) -> None: def __enter__(self) -> "WarningsRecorder": # type: ignore if self._entered: __tracebackhide__ = True - raise RuntimeError("Cannot enter %r twice" % self) + raise RuntimeError(f"Cannot enter {self!r} twice") _list = super().__enter__() # record=True means it's None. assert _list is not None @@ -218,7 +220,7 @@ def __exit__( ) -> None: if not self._entered: __tracebackhide__ = True - raise RuntimeError("Cannot exit %r without entering first" % self) + raise RuntimeError(f"Cannot exit {self!r} without entering first") super().__exit__(exc_type, exc_val, exc_tb) @@ -268,16 +270,17 @@ def __exit__( __tracebackhide__ = True + def found_str(): + return pformat([record.message for record in self], indent=2) + # only check if we're not currently handling an exception if exc_type is None and exc_val is None and exc_tb is None: if self.expected_warning is not None: if not any(issubclass(r.category, self.expected_warning) for r in self): __tracebackhide__ = True fail( - "DID NOT WARN. No warnings of type {} were emitted. " - "The list of emitted warnings is: {}.".format( - self.expected_warning, [each.message for each in self] - ) + f"DID NOT WARN. No warnings of type {self.expected_warning} were emitted.\n" + f"The list of emitted warnings is: {found_str()}." ) elif self.match_expr is not None: for r in self: @@ -286,11 +289,8 @@ def __exit__( break else: fail( - "DID NOT WARN. No warnings of type {} matching" - " ('{}') were emitted. The list of emitted warnings" - " is: {}.".format( - self.expected_warning, - self.match_expr, - [each.message for each in self], - ) + f"""\ +DID NOT WARN. No warnings of type {self.expected_warning} matching the regex were emitted. + Regex: {self.match_expr} + Emitted warnings: {found_str()}""" ) diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index 61aa4406ad2..af72857f3e7 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -420,18 +420,20 @@ def test_division_zero(): excinfo.match(r'[123]+') """ ) - result = pytester.runpytest() + result = pytester.runpytest("--tb=short") assert result.ret != 0 - exc_msg = "Regex pattern '[[]123[]]+' does not match 'division by zero'." - result.stdout.fnmatch_lines([f"E * AssertionError: {exc_msg}"]) + match = [ + r"E .* AssertionError: Regex pattern did not match.", + r"E .* Regex: '\[123\]\+'", + r"E .* Input: 'division by zero'", + ] + result.stdout.re_match_lines(match) result.stdout.no_fnmatch_line("*__tracebackhide__ = True*") result = pytester.runpytest("--fulltrace") assert result.ret != 0 - result.stdout.fnmatch_lines( - ["*__tracebackhide__ = True*", f"E * AssertionError: {exc_msg}"] - ) + result.stdout.re_match_lines([r".*__tracebackhide__ = True.*", *match]) class TestFormattedExcinfo: diff --git a/testing/python/raises.py b/testing/python/raises.py index 2d62e91091b..112dec06cdc 100644 --- a/testing/python/raises.py +++ b/testing/python/raises.py @@ -191,10 +191,12 @@ def test_raises_match(self) -> None: int("asdf") msg = "with base 16" - expr = "Regex pattern {!r} does not match \"invalid literal for int() with base 10: 'asdf'\".".format( - msg + expr = ( + "Regex pattern did not match.\n" + f" Regex: {msg!r}\n" + " Input: \"invalid literal for int() with base 10: 'asdf'\"" ) - with pytest.raises(AssertionError, match=re.escape(expr)): + with pytest.raises(AssertionError, match="(?m)" + re.escape(expr)): with pytest.raises(ValueError, match=msg): int("asdf", base=10) @@ -217,7 +219,7 @@ def test_match_failure_string_quoting(self): with pytest.raises(AssertionError, match="'foo"): raise AssertionError("'bar") (msg,) = excinfo.value.args - assert msg == 'Regex pattern "\'foo" does not match "\'bar".' + assert msg == '''Regex pattern did not match.\n Regex: "'foo"\n Input: "'bar"''' def test_match_failure_exact_string_message(self): message = "Oh here is a message with (42) numbers in parameters" @@ -226,9 +228,10 @@ def test_match_failure_exact_string_message(self): raise AssertionError(message) (msg,) = excinfo.value.args assert msg == ( - "Regex pattern 'Oh here is a message with (42) numbers in " - "parameters' does not match 'Oh here is a message with (42) " - "numbers in parameters'. Did you mean to `re.escape()` the regex?" + "Regex pattern did not match.\n" + " Regex: 'Oh here is a message with (42) numbers in parameters'\n" + " Input: 'Oh here is a message with (42) numbers in parameters'\n" + " Did you mean to `re.escape()` the regex?" ) def test_raises_match_wrong_type(self): diff --git a/testing/test_recwarn.py b/testing/test_recwarn.py index c5a8ae90fc1..7e0f836a634 100644 --- a/testing/test_recwarn.py +++ b/testing/test_recwarn.py @@ -1,4 +1,3 @@ -import re import warnings from typing import Optional @@ -263,7 +262,7 @@ def test_as_contextmanager(self) -> None: with pytest.warns(RuntimeWarning): warnings.warn("user", UserWarning) excinfo.match( - r"DID NOT WARN. No warnings of type \(.+RuntimeWarning.+,\) were emitted. " + r"DID NOT WARN. No warnings of type \(.+RuntimeWarning.+,\) were emitted.\n" r"The list of emitted warnings is: \[UserWarning\('user',?\)\]." ) @@ -271,15 +270,15 @@ def test_as_contextmanager(self) -> None: with pytest.warns(UserWarning): warnings.warn("runtime", RuntimeWarning) excinfo.match( - r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) were emitted. " - r"The list of emitted warnings is: \[RuntimeWarning\('runtime',?\)\]." + r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) were emitted.\n" + r"The list of emitted warnings is: \[RuntimeWarning\('runtime',?\)]." ) with pytest.raises(pytest.fail.Exception) as excinfo: with pytest.warns(UserWarning): pass excinfo.match( - r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) were emitted. " + r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) were emitted.\n" r"The list of emitted warnings is: \[\]." ) @@ -289,18 +288,14 @@ def test_as_contextmanager(self) -> None: warnings.warn("runtime", RuntimeWarning) warnings.warn("import", ImportWarning) - message_template = ( - "DID NOT WARN. No warnings of type {0} were emitted. " - "The list of emitted warnings is: {1}." - ) - excinfo.match( - re.escape( - message_template.format( - warning_classes, [each.message for each in warninfo] - ) - ) + messages = [each.message for each in warninfo] + expected_str = ( + f"DID NOT WARN. No warnings of type {warning_classes} were emitted.\n" + f"The list of emitted warnings is: {messages}." ) + assert str(excinfo.value) == expected_str + def test_record(self) -> None: with pytest.warns(UserWarning) as record: warnings.warn("user", UserWarning) From 0ebfa1d76dc09e075b854176873127553e6dfa1b Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Sun, 20 Mar 2022 21:01:26 -0700 Subject: [PATCH 185/549] Fix CI for Python 3.11 Getting the current working directory has no side-effects, so these context managers were no-ops. Discovered because Path.__enter__ is deprecated in Python 3.11, for removal in 3.13. --- testing/test_collection.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/testing/test_collection.py b/testing/test_collection.py index a943a44d227..aa3bf7ba58e 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -660,8 +660,7 @@ def test_pkgfile(self, pytester: Pytester) -> None: subdir = tmp_path.joinpath("subdir") x = ensure_file(subdir / "x.py") ensure_file(subdir / "__init__.py") - with subdir.cwd(): - config = pytester.parseconfigure(x) + config = pytester.parseconfigure(x) col = pytester.getnode(config, x) assert col is not None assert col.name == "x.py" @@ -1188,8 +1187,7 @@ def test_1(): """ % (str(subdir),) ) - with pytester.path.cwd(): - result = pytester.runpytest() + result = pytester.runpytest() result.stdout.fnmatch_lines(["*1 passed in*"]) assert result.ret == 0 @@ -1200,8 +1198,7 @@ def test_1(): testpaths = . """ ) - with pytester.path.cwd(): - result = pytester.runpytest("--collect-only") + result = pytester.runpytest("--collect-only") result.stdout.fnmatch_lines(["collected 1 item"]) @@ -1224,8 +1221,7 @@ def test_collect_pyargs_with_testpaths( ) ) monkeypatch.setenv("PYTHONPATH", str(pytester.path), prepend=os.pathsep) - with root.cwd(): - result = pytester.runpytest_subprocess() + result = pytester.runpytest_subprocess() result.stdout.fnmatch_lines(["*1 passed in*"]) From 3c359455e23bda499d9bc2dcde1f16f26dcc4684 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 21 Mar 2022 12:38:20 -0300 Subject: [PATCH 186/549] Change directories during some tests in test_collection.py As discussed in https://github.com/pytest-dev/pytest/pull/9800, this uses monkeypatch to change directories for two tests in `test_collection.py`, to preserve their original purpose (even if just removing it doesn't seem to affect the outcome). --- testing/test_collection.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/testing/test_collection.py b/testing/test_collection.py index aa3bf7ba58e..9099ec57fca 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -651,7 +651,7 @@ def test_global_file(self, pytester: Pytester) -> None: for parent in col.listchain(): assert parent.config is config - def test_pkgfile(self, pytester: Pytester) -> None: + def test_pkgfile(self, pytester: Pytester, monkeypatch: MonkeyPatch) -> None: """Verify nesting when a module is within a package. The parent chain should match: Module -> Package -> Session. Session's parent should always be None. @@ -660,7 +660,9 @@ def test_pkgfile(self, pytester: Pytester) -> None: subdir = tmp_path.joinpath("subdir") x = ensure_file(subdir / "x.py") ensure_file(subdir / "__init__.py") - config = pytester.parseconfigure(x) + with monkeypatch.context() as mp: + mp.chdir(subdir) + config = pytester.parseconfigure(x) col = pytester.getnode(config, x) assert col is not None assert col.name == "x.py" @@ -1221,7 +1223,9 @@ def test_collect_pyargs_with_testpaths( ) ) monkeypatch.setenv("PYTHONPATH", str(pytester.path), prepend=os.pathsep) - result = pytester.runpytest_subprocess() + with monkeypatch.context() as mp: + mp.chdir(root) + result = pytester.runpytest_subprocess() result.stdout.fnmatch_lines(["*1 passed in*"]) From 67ab7124803a48388b0c78ff310743a80dee8cd2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 21 Mar 2022 23:41:24 +0000 Subject: [PATCH 187/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.940 → v0.941](https://github.com/pre-commit/mirrors-mypy/compare/v0.940...v0.941) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 261c525c822..045c82bba90 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -56,7 +56,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.940 + rev: v0.941 hooks: - id: mypy files: ^(src/|testing/) From cccb9d8530c8e06da7a6d35c24aed02f66dbf8a6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Mar 2022 08:00:11 +0000 Subject: [PATCH 188/549] build(deps): Bump twisted in /testing/plugins_integration Bumps [twisted](https://github.com/twisted/twisted) from 22.1.0 to 22.2.0. - [Release notes](https://github.com/twisted/twisted/releases) - [Changelog](https://github.com/twisted/twisted/blob/twisted-22.2.0/NEWS.rst) - [Commits](https://github.com/twisted/twisted/compare/twisted-22.1.0...twisted-22.2.0) --- updated-dependencies: - dependency-name: twisted dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index d7e56e3c5b7..357fa539f32 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -11,5 +11,5 @@ pytest-rerunfailures==10.2 pytest-sugar==0.9.4 pytest-trio==0.7.0 pytest-twisted==1.13.4 -twisted==22.1.0 +twisted==22.2.0 pytest-xvfb==2.0.0 From 592fee22630e2b5606cf2642a3a5a0722715fe3a Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 27 Mar 2022 00:19:03 +0000 Subject: [PATCH 189/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 102 ++++++++++++++++++------------- 1 file changed, 59 insertions(+), 43 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 71e4d234729..dc79e62c806 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1016 plugins. +This list contains 1018 plugins. .. only:: not latex @@ -19,7 +19,7 @@ This list contains 1016 plugins. name summary last release status requires =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Feb 22, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Mar 25, 2022 N/A pytest (>=5.4.0) :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) @@ -61,6 +61,7 @@ This list contains 1016 plugins. :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 4 - Beta pytest (>=4.6) :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A + :pypi:`pytest-assertions` Pytest Assertions Mar 21, 2022 N/A N/A :pypi:`pytest-assertutil` pytest-assertutil May 10, 2019 N/A N/A :pypi:`pytest-assert-utils` Useful assertion utilities for use with pytest Sep 21, 2021 3 - Alpha N/A :pypi:`pytest-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) @@ -68,7 +69,7 @@ This list contains 1016 plugins. :pypi:`pytest-astropy` Meta-package containing dependencies for testing Sep 21, 2021 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest - :pypi:`pytest-asyncio` Pytest support for asyncio Mar 03, 2022 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-asyncio` Pytest support for asyncio Mar 25, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Mar 16, 2022 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) @@ -132,7 +133,7 @@ This list contains 1016 plugins. :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A :pypi:`pytest-capture-deprecatedwarnings` pytest plugin to capture all deprecatedwarnings and put them in one file Apr 30, 2019 N/A N/A :pypi:`pytest-capture-warnings` pytest plugin to capture all warnings and put them in one file of your choice Mar 16, 2022 N/A pytest - :pypi:`pytest-cases` Separate test code from test cases in pytest. Mar 14, 2022 5 - Production/Stable N/A + :pypi:`pytest-cases` Separate test code from test cases in pytest. Mar 21, 2022 5 - Production/Stable N/A :pypi:`pytest-cassandra` Cassandra CCM Test Fixtures for pytest Nov 04, 2017 1 - Planning N/A :pypi:`pytest-catchlog` py.test plugin to catch log messages. This is a fork of pytest-capturelog. Jan 24, 2016 4 - Beta pytest (>=2.6) :pypi:`pytest-catch-server` Pytest plugin with server for catching HTTP requests. Dec 12, 2019 5 - Production/Stable N/A @@ -195,7 +196,7 @@ This list contains 1016 plugins. :pypi:`pytest-custom-nodeid` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 07, 2021 N/A N/A :pypi:`pytest-custom-report` Configure the symbols displayed for test outcomes Jan 30, 2019 N/A pytest :pypi:`pytest-custom-scheduling` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 01, 2021 N/A N/A - :pypi:`pytest-cython` A plugin for testing Cython extension modules Jan 26, 2021 4 - Beta pytest (>=2.7.3) + :pypi:`pytest-cython` A plugin for testing Cython extension modules Mar 26, 2022 5 - Production/Stable pytest (>=4.6.0) :pypi:`pytest-darker` A pytest plugin for checking of modified code using Darker Aug 16, 2020 N/A pytest (>=6.0.1) ; extra == 'test' :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A @@ -271,7 +272,7 @@ This list contains 1016 plugins. :pypi:`pytest-docker-postgresql` A simple plugin to use with pytest Sep 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-docker-py` Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. Nov 27, 2018 N/A pytest (==4.0.0) :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Feb 09, 2022 4 - Beta pytest - :pypi:`pytest-docker-service` pytest plugin to start docker container Mar 15, 2022 3 - Alpha pytest + :pypi:`pytest-docker-service` pytest plugin to start docker container Mar 21, 2022 3 - Alpha pytest :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-tools` Docker integration tests for pytest Feb 17, 2022 4 - Beta pytest (>=6.0.1) :pypi:`pytest-docs` Documentation tool for pytest Nov 11, 2018 4 - Beta pytest (>=3.5.0) @@ -346,7 +347,7 @@ This list contains 1016 plugins. :pypi:`pytest-factory` Use factories for test setup with py.test Sep 06, 2020 3 - Alpha pytest (>4.3) :pypi:`pytest-factoryboy` Factory Boy support for pytest. Dec 30, 2020 6 - Mature pytest (>=4.6) :pypi:`pytest-factoryboy-fixtures` Generates pytest fixtures that allow the use of type hinting Jun 25, 2020 N/A N/A - :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Dec 11, 2020 4 - Beta pytest (>=5.0) + :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-failed-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A :pypi:`pytest-failed-to-verify` A pytest plugin that helps better distinguishing real test failures from setup flakiness. Aug 08, 2019 5 - Production/Stable pytest (>=4.1.0) :pypi:`pytest-fail-slow` Fail tests that take too long to run Dec 10, 2021 4 - Beta pytest (>=6.0) @@ -405,7 +406,7 @@ This list contains 1016 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Mar 01, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Mar 25, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -430,7 +431,7 @@ This list contains 1016 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 16, 2022 3 - Alpha pytest (==7.0.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 24, 2022 3 - Alpha pytest (==7.0.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jan 20, 2022 N/A pytest (>=5.0) @@ -438,7 +439,7 @@ This list contains 1016 plugins. :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) :pypi:`pytest-html` pytest plugin for generating HTML reports Dec 13, 2020 5 - Production/Stable pytest (!=6.0.0,>=5.0) :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-html-merger` Pytest HTML reports merging utility Mar 02, 2022 N/A N/A + :pypi:`pytest-html-merger` Pytest HTML reports merging utility Mar 22, 2022 N/A N/A :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Mar 04, 2022 5 - Production/Stable N/A :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A @@ -475,7 +476,7 @@ This list contains 1016 plugins. :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) - :pypi:`pytest-invenio` Pytest fixtures for Invenio. Feb 17, 2022 5 - Production/Stable pytest (<7,>=6) + :pypi:`pytest-invenio` Pytest fixtures for Invenio. Mar 23, 2022 5 - Production/Stable pytest (<7,>=6) :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A @@ -549,7 +550,7 @@ This list contains 1016 plugins. :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Jan 05, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Feb 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-metadata` pytest plugin for test session metadata Nov 27, 2020 5 - Production/Stable pytest (>=2.9.0) + :pypi:`pytest-metadata` pytest plugin for test session metadata Mar 26, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Sep 26, 2020 N/A pytest (>=6.0.1,<7.0.0) @@ -584,6 +585,7 @@ This list contains 1016 plugins. :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Aug 12, 2021 N/A pytest (>=3.6) + :pypi:`pytest-multithreading-allure` pytest_multithreading_allure Mar 22, 2022 N/A N/A :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Feb 07, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" @@ -622,14 +624,14 @@ This list contains 1016 plugins. :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Mar 17, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Operators Mar 25, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A :pypi:`pytest-order` pytest plugin to run your tests in a specific order Jan 09, 2022 4 - Beta pytest (>=5.0) ; python_version < "3.10" :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A - :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Jan 31, 2022 N/A N/A + :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Mar 24, 2022 N/A N/A :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A :pypi:`pytest-pahrametahrize` Parametrize your tests with a Boston accent. Nov 24, 2021 4 - Beta pytest (>=6.0,<7.0) :pypi:`pytest-parallel` a pytest plugin for parallel and concurrent testing Oct 10, 2021 3 - Alpha pytest (>=3.0.0) @@ -727,7 +729,7 @@ This list contains 1016 plugins. :pypi:`pytest-race` Race conditions tester for pytest Nov 21, 2016 4 - Beta N/A :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results Feb 04, 2022 N/A pytest (>=3.6) - :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Feb 25, 2022 5 - Production/Stable pytest + :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Mar 24, 2022 5 - Production/Stable pytest :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) :pypi:`pytest-raisesregexp` Simple pytest plugin to look for regex in Exceptions Dec 18, 2015 N/A N/A :pypi:`pytest-raisin` Plugin enabling the use of exception instances with pytest.raises Feb 06, 2022 N/A pytest @@ -798,19 +800,19 @@ This list contains 1016 plugins. :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A - :pypi:`pytest-salt-factories` Pytest Salt Plugin Mar 12, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Mar 22, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 18, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 26, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 18, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 26, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -865,7 +867,7 @@ This list contains 1016 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Mar 16, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Mar 23, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A @@ -1031,7 +1033,7 @@ This list contains 1016 plugins. :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A - :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Mar 10, 2022 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Mar 21, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-zulip` Pytest report plugin for Zulip Mar 04, 2022 5 - Production/Stable pytest =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ @@ -1047,7 +1049,7 @@ This list contains 1016 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: Feb 22, 2022, + *last release*: Mar 25, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1340,6 +1342,13 @@ This list contains 1016 plugins. test Answer Set Programming programs + :pypi:`pytest-assertions` + *last release*: Mar 21, 2022, + *status*: N/A, + *requires*: N/A + + Pytest Assertions + :pypi:`pytest-assertutil` *last release*: May 10, 2019, *status*: N/A, @@ -1390,7 +1399,7 @@ This list contains 1016 plugins. :pypi:`pytest-asyncio` - *last release*: Mar 03, 2022, + *last release*: Mar 25, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.1.0) @@ -1838,7 +1847,7 @@ This list contains 1016 plugins. pytest plugin to capture all warnings and put them in one file of your choice :pypi:`pytest-cases` - *last release*: Mar 14, 2022, + *last release*: Mar 21, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -2279,9 +2288,9 @@ This list contains 1016 plugins. Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report :pypi:`pytest-cython` - *last release*: Jan 26, 2021, - *status*: 4 - Beta, - *requires*: pytest (>=2.7.3) + *last release*: Mar 26, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest (>=4.6.0) A plugin for testing Cython extension modules @@ -2811,7 +2820,7 @@ This list contains 1016 plugins. Pytest fixtures for testing with docker registries. :pypi:`pytest-docker-service` - *last release*: Mar 15, 2022, + *last release*: Mar 21, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -3336,8 +3345,8 @@ This list contains 1016 plugins. Generates pytest fixtures that allow the use of type hinting :pypi:`pytest-factoryboy-state` - *last release*: Dec 11, 2020, - *status*: 4 - Beta, + *last release*: Mar 22, 2022, + *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) Simple factoryboy random state management @@ -3749,7 +3758,7 @@ This list contains 1016 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Mar 01, 2022, + *last release*: Mar 25, 2022, *status*: N/A, *requires*: N/A @@ -3924,7 +3933,7 @@ This list contains 1016 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Mar 16, 2022, + *last release*: Mar 24, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.0.1) @@ -3980,7 +3989,7 @@ This list contains 1016 plugins. optimized pytest plugin for generating HTML reports :pypi:`pytest-html-merger` - *last release*: Mar 02, 2022, + *last release*: Mar 22, 2022, *status*: N/A, *requires*: N/A @@ -4239,7 +4248,7 @@ This list contains 1016 plugins. Pytest plugin for intercepting outgoing connection requests during pytest run. :pypi:`pytest-invenio` - *last release*: Feb 17, 2022, + *last release*: Mar 23, 2022, *status*: 5 - Production/Stable, *requires*: pytest (<7,>=6) @@ -4757,9 +4766,9 @@ This list contains 1016 plugins. Pytest to Slack reporting plugin :pypi:`pytest-metadata` - *last release*: Nov 27, 2020, + *last release*: Mar 26, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=2.9.0) + *requires*: pytest (>=3.0.0,<8.0.0) pytest plugin for test session metadata @@ -5001,6 +5010,13 @@ This list contains 1016 plugins. a pytest plugin for th and concurrent testing + :pypi:`pytest-multithreading-allure` + *last release*: Mar 22, 2022, + *status*: N/A, + *requires*: N/A + + pytest_multithreading_allure + :pypi:`pytest-mutagen` *last release*: Jul 24, 2020, *status*: N/A, @@ -5268,7 +5284,7 @@ This list contains 1016 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: Mar 17, 2022, + *last release*: Mar 25, 2022, *status*: N/A, *requires*: pytest @@ -5317,7 +5333,7 @@ This list contains 1016 plugins. OS X notifications for py.test results. :pypi:`pytest-otel` - *last release*: Jan 31, 2022, + *last release*: Mar 24, 2022, *status*: N/A, *requires*: N/A @@ -6003,7 +6019,7 @@ This list contains 1016 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-railflow-testrail-reporter` - *last release*: Feb 25, 2022, + *last release*: Mar 24, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6500,7 +6516,7 @@ This list contains 1016 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Mar 12, 2022, + *last release*: Mar 22, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6542,7 +6558,7 @@ This list contains 1016 plugins. :pypi:`pytest-sbase` - *last release*: Mar 18, 2022, + *last release*: Mar 26, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6584,7 +6600,7 @@ This list contains 1016 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Mar 18, 2022, + *last release*: Mar 26, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6969,7 +6985,7 @@ This list contains 1016 plugins. :pypi:`pytest-splunk-addon` - *last release*: Mar 16, 2022, + *last release*: Mar 23, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -8131,7 +8147,7 @@ This list contains 1016 plugins. OWASP ZAP plugin for py.test. :pypi:`pytest-zebrunner` - *last release*: Mar 10, 2022, + *last release*: Mar 21, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.5.0) From 1f10c59cd3a716bda3c7d4a91cdaa6fb9e910ef8 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sun, 27 Mar 2022 16:30:57 +0200 Subject: [PATCH 190/549] Clarify error message in case no collectors are found for a file --- src/_pytest/main.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 8f590754ae0..fc42beb5ab4 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -645,9 +645,12 @@ def perform_collect( self.trace.root.indent -= 1 if self._notfound: errors = [] - for arg, cols in self._notfound: - line = f"(no name {arg!r} in any of {cols!r})" - errors.append(f"not found: {arg}\n{line}") + for arg, collectors in self._notfound: + if cols: + errors.append(f"not found: {arg}\n(no name {arg!r} in any of {collectors!r})") + else: + errors.append(f"found no collectors for {arg}") + raise UsageError(*errors) if not genitems: items = rep.result From 0eae340e139058b1337908f6df86aaf71e7213ff Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 27 Mar 2022 14:41:11 +0000 Subject: [PATCH 191/549] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytest/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/_pytest/main.py b/src/_pytest/main.py index fc42beb5ab4..67bd0489804 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -647,10 +647,12 @@ def perform_collect( errors = [] for arg, collectors in self._notfound: if cols: - errors.append(f"not found: {arg}\n(no name {arg!r} in any of {collectors!r})") + errors.append( + f"not found: {arg}\n(no name {arg!r} in any of {collectors!r})" + ) else: errors.append(f"found no collectors for {arg}") - + raise UsageError(*errors) if not genitems: items = rep.result From 63c73380281e7201dde2be62dad6c6d58841c139 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sun, 27 Mar 2022 16:56:23 +0200 Subject: [PATCH 192/549] Fix rename issue --- src/_pytest/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 67bd0489804..f2f0c667141 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -646,7 +646,7 @@ def perform_collect( if self._notfound: errors = [] for arg, collectors in self._notfound: - if cols: + if collectors: errors.append( f"not found: {arg}\n(no name {arg!r} in any of {collectors!r})" ) From 31595e8733bf28ae41f7a222fbf24596bf361338 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 29 Mar 2022 12:33:13 +0200 Subject: [PATCH 193/549] Fix tests --- testing/acceptance_test.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 71d3cc23a2e..92661b0f23a 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -186,8 +186,7 @@ def test_not_collectable_arguments(self, pytester: Pytester) -> None: assert result.ret == ExitCode.USAGE_ERROR result.stderr.fnmatch_lines( [ - f"ERROR: not found: {p2}", - f"(no name {str(p2)!r} in any of [[][]])", + f"ERROR: found no collectors for {p2}", "", ] ) From 141b301d3d085b8833827133cbe02f8dd13de36b Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 29 Mar 2022 12:34:15 +0200 Subject: [PATCH 194/549] Fix more tests --- testing/test_config.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testing/test_config.py b/testing/test_config.py index 6784809e097..b2c74085eae 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -1855,8 +1855,7 @@ def test_config_blocked_default_plugins(pytester: Pytester, plugin: str) -> None assert result.ret == ExitCode.USAGE_ERROR result.stderr.fnmatch_lines( [ - "ERROR: not found: */test_config_blocked_default_plugins.py", - "(no name '*/test_config_blocked_default_plugins.py' in any of [])", + "ERROR: found no collectors for */test_config_blocked_default_plugins.py", ] ) return From 3fcdbaf0c5ece9a3f193de793c3f1abee6b57358 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 29 Mar 2022 12:37:23 +0200 Subject: [PATCH 195/549] Add changelog --- changelog/9823.improvement.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/9823.improvement.rst diff --git a/changelog/9823.improvement.rst b/changelog/9823.improvement.rst new file mode 100644 index 00000000000..0a14cab6743 --- /dev/null +++ b/changelog/9823.improvement.rst @@ -0,0 +1 @@ +Improved error message that is shown when no collector is found for a given file. From 387ec02021e91ae11a89ec5fc578dc5251ea2468 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 29 Mar 2022 12:38:34 +0200 Subject: [PATCH 196/549] Add to AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 69e71fa10d4..0dbc728eba1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -325,6 +325,7 @@ Thomas Grainger Thomas Hisch Tim Hoffmann Tim Strazny +Tobias Diez Tom Dalton Tom Viner Tomáš Gavenčiak From 79725c9102f47102f1cf2aa086d935c1e2665089 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 3 Apr 2022 00:17:36 +0000 Subject: [PATCH 197/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 128 +++++++++++++++++++------------ 1 file changed, 80 insertions(+), 48 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index dc79e62c806..cf2b056d63b 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1018 plugins. +This list contains 1022 plugins. .. only:: not latex @@ -70,7 +70,7 @@ This list contains 1018 plugins. :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio Mar 25, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Mar 16, 2022 N/A N/A + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Mar 30, 2022 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) :pypi:`pytest-async-sqlalchemy` Database testing fixtures using the SQLAlchemy asyncio API Oct 07, 2021 4 - Beta pytest (>=6.0.0) @@ -88,7 +88,7 @@ This list contains 1018 plugins. :pypi:`pytest-axe` pytest plugin for axe-selenium-python Nov 12, 2018 N/A pytest (>=3.0.0) :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Mar 16, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-base-url` pytest plugin for URL based testing Jun 19, 2020 5 - Production/Stable pytest (>=2.7.3) + :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-bdd` BDD for pytest Oct 25, 2021 6 - Mature pytest (>=4.3) :pypi:`pytest-bdd-splinter` Common steps for pytest bdd and splinter integration Aug 12, 2019 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-bdd-web` A simple plugin to use with pytest Jan 02, 2020 4 - Beta pytest (>=3.5.0) @@ -127,7 +127,7 @@ This list contains 1018 plugins. :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Mar 03, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A - :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Mar 08, 2022 N/A pytest + :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 02, 2022 N/A pytest :pypi:`pytest-camel-collect` Enable CamelCase-aware pytest class collection Aug 02, 2020 N/A pytest (>=2.9) :pypi:`pytest-canonical-data` A plugin which allows to compare results with canonical results, based on previous runs May 08, 2020 2 - Pre-Alpha pytest (>=3.5.0) :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A @@ -160,6 +160,7 @@ This list contains 1018 plugins. :pypi:`pytest-codecheckers` pytest plugin to add source code sanity checks (pep8 and friends) Feb 13, 2010 N/A N/A :pypi:`pytest-codecov` Pytest plugin for uploading pytest-cov results to codecov.io Oct 27, 2021 4 - Beta pytest (>=4.6.0) :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A + :pypi:`pytest-codeowners` Pytest plugin for selecting tests by GitHub CODEOWNERS. Mar 30, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-codestyle` pytest plugin to run pycodestyle Mar 23, 2020 3 - Alpha N/A :pypi:`pytest-collect-formatter` Formatter for pytest collect output Mar 29, 2021 5 - Production/Stable N/A :pypi:`pytest-collect-formatter2` Formatter for pytest collect output May 31, 2021 5 - Production/Stable N/A @@ -236,7 +237,7 @@ This list contains 1018 plugins. :pypi:`pytest-diff-selector` Get tests affected by code changes (using git) Feb 24, 2022 4 - Beta pytest (>=6.2.2) ; extra == 'all' :pypi:`pytest-disable` pytest plugin to disable a test and skip it from testrun Sep 10, 2015 4 - Beta N/A :pypi:`pytest-disable-plugin` Disable plugins per test Feb 28, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. Feb 12, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) + :pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. Mar 27, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :pypi:`pytest-django` A Django plugin for pytest. Dec 07, 2021 5 - Production/Stable pytest (>=5.4.0) :pypi:`pytest-django-ahead` A Django plugin for pytest. Oct 27, 2016 5 - Production/Stable pytest (>=2.9) :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Aug 04, 2021 4 - Beta N/A @@ -259,7 +260,7 @@ This list contains 1018 plugins. :pypi:`pytest-doc` A documentation plugin for py.test. Jun 28, 2015 5 - Production/Stable N/A :pypi:`pytest-docfiles` pytest plugin to test codeblocks in your documentation. Dec 22, 2021 4 - Beta pytest (>=3.7.0) :pypi:`pytest-docgen` An RST Documentation Generator for pytest-based test suites Apr 17, 2020 N/A N/A - :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Jun 14, 2021 N/A pytest (<7.0,>=4.0) + :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Mar 28, 2022 N/A pytest (<8.0,>=4.0) :pypi:`pytest-docker-apache-fixtures` Pytest fixtures for testing with apache2 (httpd). Feb 16, 2022 4 - Beta pytest :pypi:`pytest-docker-butla` Jun 16, 2019 3 - Alpha N/A :pypi:`pytest-dockerc` Run, manage and stop Docker Compose project from Docker API Oct 09, 2020 5 - Production/Stable pytest (>=3.0) @@ -406,7 +407,7 @@ This list contains 1018 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Mar 25, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Apr 01, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -416,6 +417,7 @@ This list contains 1018 plugins. :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Nov 26, 2021 4 - Beta pytest :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest :pypi:`pytest-golden` Plugin for pytest that offloads expected outputs to data files Nov 23, 2020 N/A pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-google-chat` Notify google chat channel for test results Mar 27, 2022 4 - Beta pytest :pypi:`pytest-graphql-schema` Get graphql schema as fixture for pytest Oct 18, 2019 N/A N/A :pypi:`pytest-greendots` Green progress dots Feb 08, 2014 3 - Alpha N/A :pypi:`pytest-growl` Growl notifications for pytest results. Jan 13, 2014 5 - Production/Stable N/A @@ -431,10 +433,10 @@ This list contains 1018 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 24, 2022 3 - Alpha pytest (==7.0.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Apr 02, 2022 3 - Alpha pytest (==7.1.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A - :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jan 20, 2022 N/A pytest (>=5.0) + :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 22, 2022 5 - Production/Stable N/A :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) :pypi:`pytest-html` pytest plugin for generating HTML reports Dec 13, 2020 5 - Production/Stable pytest (!=6.0.0,>=5.0) @@ -466,7 +468,7 @@ This list contains 1018 plugins. :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Sep 30, 2021 N/A N/A - :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Jan 26, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Mar 30, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Feb 11, 2022 5 - Production/Stable N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) @@ -476,7 +478,7 @@ This list contains 1018 plugins. :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) - :pypi:`pytest-invenio` Pytest fixtures for Invenio. Mar 23, 2022 5 - Production/Stable pytest (<7,>=6) + :pypi:`pytest-invenio` Pytest fixtures for Invenio. Mar 29, 2022 5 - Production/Stable pytest (<7,>=6) :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A @@ -531,6 +533,7 @@ This list contains 1018 plugins. :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-loguru` Pytest Loguru Feb 27, 2022 5 - Production/Stable N/A + :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Apr 02, 2022 3 - Alpha pytest :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha pytest (>=6) :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) :pypi:`pytest-marker-bugzilla` py.test bugzilla integration plugin, using markers Jan 09, 2020 N/A N/A @@ -563,13 +566,13 @@ This list contains 1018 plugins. :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Feb 26, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Mar 30, 2022 N/A pytest (>=1.0) :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A :pypi:`pytest-modifyjunit` Utility for adding additional properties to junit xml for IDM QE Jan 10, 2019 N/A N/A :pypi:`pytest-modifyscope` pytest plugin to modify fixture scope Apr 12, 2020 N/A pytest - :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Oct 06, 2021 5 - Production/Stable N/A + :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Mar 29, 2022 5 - Production/Stable pytest (>=7.0.0) :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Jun 07, 2021 5 - Production/Stable pytest :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures Dec 07, 2019 5 - Production/Stable pytest (>=2.5.2) :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Dec 23, 2021 5 - Production/Stable pytest @@ -739,7 +742,7 @@ This list contains 1018 plugins. :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-readme` Test your README.md file Dec 28, 2014 5 - Production/Stable N/A - :pypi:`pytest-reana` Pytest fixtures for REANA. Feb 26, 2022 3 - Alpha N/A + :pypi:`pytest-reana` Pytest fixtures for REANA. Mar 31, 2022 3 - Alpha N/A :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jul 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) @@ -800,19 +803,19 @@ This list contains 1018 plugins. :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A - :pypi:`pytest-salt-factories` Pytest Salt Plugin Mar 22, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Mar 28, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 26, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 31, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) - :pypi:`pytest-selenium` pytest plugin for Selenium Sep 19, 2020 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 26, 2022 5 - Production/Stable N/A + :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 31, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -825,7 +828,7 @@ This list contains 1018 plugins. :pypi:`pytest-session_to_file` pytest-session_to_file is a py.test plugin for capturing and saving to file the stdout of py.test. Oct 01, 2015 3 - Alpha N/A :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest - :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Nov 07, 2021 N/A N/A + :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Feb 21, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 5 - Production/Stable pytest (>=3.5.1) @@ -859,7 +862,7 @@ This list contains 1018 plugins. :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. Feb 23, 2020 4 - Beta pytest :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. May 04, 2021 N/A N/A - :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Aug 05, 2020 4 - Beta N/A + :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Mar 30, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Dec 22, 2021 6 - Mature pytest (>=6.2.4) @@ -984,7 +987,7 @@ This list contains 1018 plugins. :pypi:`pytest-utils` Some helpers for pytest. Dec 04, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) :pypi:`pytest-vagrant` A py.test plugin providing access to vagrant. Sep 07, 2021 5 - Production/Stable pytest :pypi:`pytest-valgrind` May 19, 2021 N/A N/A - :pypi:`pytest-variables` pytest plugin for providing variables to tests/fixtures Oct 23, 2019 5 - Production/Stable pytest (>=2.4.2) + :pypi:`pytest-variables` pytest plugin for providing variables to tests/fixtures Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-variant` Variant support for Pytest Jun 20, 2021 N/A N/A :pypi:`pytest-vcr` Plugin for managing VCR.py cassettes Apr 26, 2019 5 - Production/Stable pytest (>=3.6.0) :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Aug 13, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) @@ -1009,6 +1012,7 @@ This list contains 1018 plugins. :pypi:`pytest-wholenodeid` pytest addon for displaying the whole node id for failures Aug 26, 2015 4 - Beta pytest (>=2.0) :pypi:`pytest-win32consoletitle` Pytest progress in console title (Win32 only) Aug 08, 2021 N/A N/A :pypi:`pytest-winnotify` Windows tray notifications for py.test results. Apr 22, 2016 N/A N/A + :pypi:`pytest-wiremock` A pytest plugin for programmatically using wiremock in integration tests Mar 27, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-with-docker` pytest with docker helpers. Nov 09, 2021 N/A pytest :pypi:`pytest-workflow` A pytest plugin for configuring workflow/pipeline tests using YAML files Dec 03, 2021 5 - Production/Stable pytest (>=5.4.0) :pypi:`pytest-xdist` pytest xdist plugin for distributed testing and loop-on-failing modes Dec 10, 2021 5 - Production/Stable pytest (>=6.2.0) @@ -1406,7 +1410,7 @@ This list contains 1018 plugins. Pytest support for asyncio :pypi:`pytest-asyncio-cooperative` - *last release*: Mar 16, 2022, + *last release*: Mar 30, 2022, *status*: N/A, *requires*: N/A @@ -1532,9 +1536,9 @@ This list contains 1018 plugins. A bandit plugin for pytest :pypi:`pytest-base-url` - *last release*: Jun 19, 2020, + *last release*: Mar 27, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=2.7.3) + *requires*: pytest (>=3.0.0,<8.0.0) pytest plugin for URL based testing @@ -1805,7 +1809,7 @@ This list contains 1018 plugins. Pytest plugin to only run tests affected by changes :pypi:`pytest-cairo` - *last release*: Mar 08, 2022, + *last release*: Apr 02, 2022, *status*: N/A, *requires*: pytest @@ -2035,6 +2039,13 @@ This list contains 1018 plugins. Automatically create pytest test signatures + :pypi:`pytest-codeowners` + *last release*: Mar 30, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=6.0.0) + + Pytest plugin for selecting tests by GitHub CODEOWNERS. + :pypi:`pytest-codestyle` *last release*: Mar 23, 2020, *status*: 3 - Alpha, @@ -2568,7 +2579,7 @@ This list contains 1018 plugins. Disable plugins per test :pypi:`pytest-discord` - *last release*: Feb 12, 2022, + *last release*: Mar 27, 2022, *status*: 4 - Beta, *requires*: pytest (!=6.0.0,<8,>=3.3.2) @@ -2729,9 +2740,9 @@ This list contains 1018 plugins. An RST Documentation Generator for pytest-based test suites :pypi:`pytest-docker` - *last release*: Jun 14, 2021, + *last release*: Mar 28, 2022, *status*: N/A, - *requires*: pytest (<7.0,>=4.0) + *requires*: pytest (<8.0,>=4.0) Simple pytest fixtures for Docker and docker-compose based tests @@ -3758,7 +3769,7 @@ This list contains 1018 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Mar 25, 2022, + *last release*: Apr 01, 2022, *status*: N/A, *requires*: N/A @@ -3827,6 +3838,13 @@ This list contains 1018 plugins. Plugin for pytest that offloads expected outputs to data files + :pypi:`pytest-google-chat` + *last release*: Mar 27, 2022, + *status*: 4 - Beta, + *requires*: pytest + + Notify google chat channel for test results + :pypi:`pytest-graphql-schema` *last release*: Oct 18, 2019, *status*: N/A, @@ -3933,9 +3951,9 @@ This list contains 1018 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Mar 24, 2022, + *last release*: Apr 02, 2022, *status*: 3 - Alpha, - *requires*: pytest (==7.0.1) + *requires*: pytest (==7.1.1) Experimental package to automatically extract test plugins for Home Assistant custom components @@ -3954,7 +3972,7 @@ This list contains 1018 plugins. Report on tests that honor constraints, and guard against regressions :pypi:`pytest-hoverfly` - *last release*: Jan 20, 2022, + *last release*: Mar 28, 2022, *status*: N/A, *requires*: pytest (>=5.0) @@ -4178,7 +4196,7 @@ This list contains 1018 plugins. Reuse pytest.ini to store env variables :pypi:`pytest-inmanta` - *last release*: Jan 26, 2022, + *last release*: Mar 30, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4248,7 +4266,7 @@ This list contains 1018 plugins. Pytest plugin for intercepting outgoing connection requests during pytest run. :pypi:`pytest-invenio` - *last release*: Mar 23, 2022, + *last release*: Mar 29, 2022, *status*: 5 - Production/Stable, *requires*: pytest (<7,>=6) @@ -4632,6 +4650,13 @@ This list contains 1018 plugins. Pytest Loguru + :pypi:`pytest-lsp` + *last release*: Apr 02, 2022, + *status*: 3 - Alpha, + *requires*: pytest + + Pytest plugin for end-to-end testing of language servers + :pypi:`pytest-manual-marker` *last release*: Oct 11, 2021, *status*: 3 - Alpha, @@ -4857,7 +4882,7 @@ This list contains 1018 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Feb 26, 2022, + *last release*: Mar 30, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -4899,9 +4924,9 @@ This list contains 1018 plugins. pytest plugin to modify fixture scope :pypi:`pytest-molecule` - *last release*: Oct 06, 2021, + *last release*: Mar 29, 2022, *status*: 5 - Production/Stable, - *requires*: N/A + *requires*: pytest (>=7.0.0) PyTest Molecule Plugin :: discover and run molecule tests @@ -6089,7 +6114,7 @@ This list contains 1018 plugins. Test your README.md file :pypi:`pytest-reana` - *last release*: Feb 26, 2022, + *last release*: Mar 31, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -6516,7 +6541,7 @@ This list contains 1018 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Mar 22, 2022, + *last release*: Mar 28, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6558,7 +6583,7 @@ This list contains 1018 plugins. :pypi:`pytest-sbase` - *last release*: Mar 26, 2022, + *last release*: Mar 31, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6593,14 +6618,14 @@ This list contains 1018 plugins. A pytest plugin which allows to (de-)select tests from a file. :pypi:`pytest-selenium` - *last release*: Sep 19, 2020, + *last release*: Mar 28, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=5.0.0) + *requires*: pytest (>=6.0.0,<7.0.0) pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Mar 26, 2022, + *last release*: Mar 31, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6691,7 +6716,7 @@ This list contains 1018 plugins. :pypi:`pytest-shell` - *last release*: Nov 07, 2021, + *last release*: Mar 27, 2022, *status*: N/A, *requires*: N/A @@ -6929,9 +6954,9 @@ This list contains 1018 plugins. Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. :pypi:`pytest-sphinx` - *last release*: Aug 05, 2020, + *last release*: Mar 30, 2022, *status*: 4 - Beta, - *requires*: N/A + *requires*: pytest (>=7.0.0) Doctest plugin for pytest with support for Sphinx-specific doctest-directives @@ -7804,9 +7829,9 @@ This list contains 1018 plugins. :pypi:`pytest-variables` - *last release*: Oct 23, 2019, + *last release*: Mar 27, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=2.4.2) + *requires*: pytest (>=3.0.0,<8.0.0) pytest plugin for providing variables to tests/fixtures @@ -7978,6 +8003,13 @@ This list contains 1018 plugins. Windows tray notifications for py.test results. + :pypi:`pytest-wiremock` + *last release*: Mar 27, 2022, + *status*: N/A, + *requires*: pytest (>=7.1.1,<8.0.0) + + A pytest plugin for programmatically using wiremock in integration tests + :pypi:`pytest-with-docker` *last release*: Nov 09, 2021, *status*: N/A, From e2269f8a5c0a0f078ddb11c496ce1fdbe832c76f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 Apr 2022 20:26:44 +0000 Subject: [PATCH 198/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 22.1.0 → 22.3.0](https://github.com/psf/black/compare/22.1.0...22.3.0) - [github.com/asottile/setup-cfg-fmt: v1.20.0 → v1.20.1](https://github.com/asottile/setup-cfg-fmt/compare/v1.20.0...v1.20.1) - [github.com/pre-commit/mirrors-mypy: v0.941 → v0.942](https://github.com/pre-commit/mirrors-mypy/compare/v0.941...v0.942) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 045c82bba90..f4eae861ff5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 22.1.0 + rev: 22.3.0 hooks: - id: black args: [--safe, --quiet] @@ -47,7 +47,7 @@ repos: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.20.0 + rev: v1.20.1 hooks: - id: setup-cfg-fmt args: [--max-py-version=3.10] @@ -56,7 +56,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.941 + rev: v0.942 hooks: - id: mypy files: ^(src/|testing/) From 1527130476fcb0d7f3fda5c40daae5dde28825c2 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 8 Apr 2022 17:08:30 -0400 Subject: [PATCH 199/549] temporarily pin jinja2 version for docs build --- doc/en/requirements.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/en/requirements.txt b/doc/en/requirements.txt index 5b49cb7fccc..89446634e03 100644 --- a/doc/en/requirements.txt +++ b/doc/en/requirements.txt @@ -5,3 +5,6 @@ sphinx-removed-in>=0.2.0 sphinx>=3.1,<4 sphinxcontrib-trio sphinxcontrib-svg2pdfconverter + +# XXX: sphinx<4 is broken with latest jinja2 +jinja2<3.1 From 8fa775bcee5753d30abb69d266cc36c5524ece2f Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 8 Apr 2022 17:00:31 -0400 Subject: [PATCH 200/549] fix comparison of dataclasses with `InitVar` --- changelog/9820.bugfix.rst | 1 + src/_pytest/assertion/util.py | 6 ++++-- .../dataclasses/test_compare_initvar.py | 12 ++++++++++++ testing/test_assertion.py | 7 +++++++ 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 changelog/9820.bugfix.rst create mode 100644 testing/example_scripts/dataclasses/test_compare_initvar.py diff --git a/changelog/9820.bugfix.rst b/changelog/9820.bugfix.rst new file mode 100644 index 00000000000..03af940f2c4 --- /dev/null +++ b/changelog/9820.bugfix.rst @@ -0,0 +1 @@ +Fix comparison of ``dataclasses`` with ``InitVar``. diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index 75026730df4..0c34b83ea01 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -437,8 +437,10 @@ def _compare_eq_cls(left: Any, right: Any, verbose: int) -> List[str]: if not has_default_eq(left): return [] if isdatacls(left): - all_fields = left.__dataclass_fields__ - fields_to_check = [field for field, info in all_fields.items() if info.compare] + import dataclasses + + all_fields = dataclasses.fields(left) + fields_to_check = [info.name for info in all_fields if info.compare] elif isattrs(left): all_fields = left.__attrs_attrs__ fields_to_check = [field.name for field in all_fields if getattr(field, "eq")] diff --git a/testing/example_scripts/dataclasses/test_compare_initvar.py b/testing/example_scripts/dataclasses/test_compare_initvar.py new file mode 100644 index 00000000000..d859634ddd5 --- /dev/null +++ b/testing/example_scripts/dataclasses/test_compare_initvar.py @@ -0,0 +1,12 @@ +from dataclasses import dataclass +from dataclasses import InitVar + + +@dataclass +class Foo: + init_only: InitVar[int] + real_attr: int + + +def test_demonstrate(): + assert Foo(1, 2) == Foo(1, 3) diff --git a/testing/test_assertion.py b/testing/test_assertion.py index 4825ede778b..2bc06d65a2b 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -882,6 +882,13 @@ def test_data_classes_with_custom_eq(self, pytester: Pytester) -> None: result.assert_outcomes(failed=1, passed=0) result.stdout.no_re_match_line(".*Differing attributes.*") + def test_data_classes_with_initvar(self, pytester: Pytester) -> None: + p = pytester.copy_example("dataclasses/test_compare_initvar.py") + # issue 9820 + result = pytester.runpytest(p, "-vv") + result.assert_outcomes(failed=1, passed=0) + result.stdout.no_re_match_line(".*AttributeError.*") + class TestAssert_reprcompare_attrsclass: def test_attrs(self) -> None: From 765583dc347da832e8070b6f49a2e8523a233204 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 10 Apr 2022 00:17:14 +0000 Subject: [PATCH 201/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 124 ++++++++++++++++++------------- 1 file changed, 74 insertions(+), 50 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index cf2b056d63b..e8d116cb869 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1022 plugins. +This list contains 1025 plugins. .. only:: not latex @@ -19,7 +19,7 @@ This list contains 1022 plugins. name summary last release status requires =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Mar 25, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Apr 04, 2022 N/A pytest (>=5.4.0) :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) @@ -70,7 +70,7 @@ This list contains 1022 plugins. :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio Mar 25, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Mar 30, 2022 N/A N/A + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Apr 07, 2022 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) :pypi:`pytest-async-sqlalchemy` Database testing fixtures using the SQLAlchemy asyncio API Oct 07, 2021 4 - Beta pytest (>=6.0.0) @@ -127,7 +127,7 @@ This list contains 1022 plugins. :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Mar 03, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A - :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 02, 2022 N/A pytest + :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 08, 2022 N/A pytest :pypi:`pytest-camel-collect` Enable CamelCase-aware pytest class collection Aug 02, 2020 N/A pytest (>=2.9) :pypi:`pytest-canonical-data` A plugin which allows to compare results with canonical results, based on previous runs May 08, 2020 2 - Pre-Alpha pytest (>=3.5.0) :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A @@ -145,7 +145,7 @@ This list contains 1022 plugins. :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) :pypi:`pytest-checkdocs` check the README when running tests Jul 31, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) - :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest (>=4.6) + :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest (>=7.0) :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest :pypi:`pytest-circleci` py.test plugin for CircleCI May 03, 2019 N/A N/A :pypi:`pytest-circleci-parallelized` Parallelize pytest across CircleCI workers. Mar 26, 2019 N/A N/A @@ -260,7 +260,7 @@ This list contains 1022 plugins. :pypi:`pytest-doc` A documentation plugin for py.test. Jun 28, 2015 5 - Production/Stable N/A :pypi:`pytest-docfiles` pytest plugin to test codeblocks in your documentation. Dec 22, 2021 4 - Beta pytest (>=3.7.0) :pypi:`pytest-docgen` An RST Documentation Generator for pytest-based test suites Apr 17, 2020 N/A N/A - :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Mar 28, 2022 N/A pytest (<8.0,>=4.0) + :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Apr 09, 2022 N/A pytest (<8.0,>=4.0) :pypi:`pytest-docker-apache-fixtures` Pytest fixtures for testing with apache2 (httpd). Feb 16, 2022 4 - Beta pytest :pypi:`pytest-docker-butla` Jun 16, 2019 3 - Alpha N/A :pypi:`pytest-dockerc` Run, manage and stop Docker Compose project from Docker API Oct 09, 2020 5 - Production/Stable pytest (>=3.0) @@ -272,7 +272,7 @@ This list contains 1022 plugins. :pypi:`pytest-docker-pexpect` pytest plugin for writing functional tests with pexpect and docker Jan 14, 2019 N/A pytest :pypi:`pytest-docker-postgresql` A simple plugin to use with pytest Sep 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-docker-py` Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. Nov 27, 2018 N/A pytest (==4.0.0) - :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Feb 09, 2022 4 - Beta pytest + :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Apr 08, 2022 4 - Beta pytest :pypi:`pytest-docker-service` pytest plugin to start docker container Mar 21, 2022 3 - Alpha pytest :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-tools` Docker integration tests for pytest Feb 17, 2022 4 - Beta pytest (>=6.0.1) @@ -303,6 +303,7 @@ This list contains 1022 plugins. :pypi:`pytest-echo` pytest plugin with mechanisms for echoing environment variables, package version and generic attributes Jan 08, 2020 5 - Production/Stable N/A :pypi:`pytest-elasticsearch` Elasticsearch fixtures and fixture factories for Pytest. Mar 01, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-elements` Tool to help automate user interfaces Jan 13, 2021 N/A pytest (>=5.4,<6.0) + :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest :pypi:`pytest-embedded` pytest embedded plugin Mar 18, 2022 N/A pytest (>=7.0) @@ -367,7 +368,7 @@ This list contains 1022 plugins. :pypi:`pytest-filemarker` A pytest plugin that runs marked tests when files change. Dec 01, 2020 N/A pytest :pypi:`pytest-filter-case` run test cases filter by mark Nov 05, 2020 N/A N/A :pypi:`pytest-filter-subpackage` Pytest plugin for filtering based on sub-packages Jan 09, 2020 3 - Alpha pytest (>=3.0) - :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Jan 16, 2022 4 - Beta pytest (>=4.3.0) + :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Apr 09, 2022 4 - Beta pytest (>=4.3.0) :pypi:`pytest-finer-verdicts` A pytest plugin to treat non-assertion failures as test errors. Jun 18, 2020 N/A pytest (>=5.4.3) :pypi:`pytest-firefox` pytest plugin to manipulate firefox Aug 08, 2017 3 - Alpha pytest (>=3.0.2) :pypi:`pytest-fixture-config` Fixture configuration utils for py.test May 28, 2019 5 - Production/Stable pytest @@ -389,7 +390,6 @@ This list contains 1022 plugins. :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) :pypi:`pytest-flyte` Pytest fixtures for simplifying Flyte integration testing May 03, 2021 N/A pytest :pypi:`pytest-focus` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest - :pypi:`pytest-fold` Fold console output and drop user into interactive text user interface Feb 20, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-forcefail` py.test plugin to make the test failing regardless of pytest.mark.xfail May 15, 2018 4 - Beta N/A :pypi:`pytest-forward-compatability` A name to avoid typosquating pytest-foward-compatibility Sep 06, 2020 N/A N/A :pypi:`pytest-forward-compatibility` A pytest plugin to shim pytest commandline options for fowards compatibility Sep 29, 2020 N/A N/A @@ -407,7 +407,7 @@ This list contains 1022 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Apr 01, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Apr 06, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -433,7 +433,7 @@ This list contains 1022 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Apr 02, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Apr 09, 2022 3 - Alpha pytest (==7.1.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -441,7 +441,7 @@ This list contains 1022 plugins. :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) :pypi:`pytest-html` pytest plugin for generating HTML reports Dec 13, 2020 5 - Production/Stable pytest (!=6.0.0,>=5.0) :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-html-merger` Pytest HTML reports merging utility Mar 22, 2022 N/A N/A + :pypi:`pytest-html-merger` Pytest HTML reports merging utility Apr 03, 2022 N/A N/A :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Mar 04, 2022 5 - Production/Stable N/A :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A @@ -478,7 +478,7 @@ This list contains 1022 plugins. :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) - :pypi:`pytest-invenio` Pytest fixtures for Invenio. Mar 29, 2022 5 - Production/Stable pytest (<7,>=6) + :pypi:`pytest-invenio` Pytest fixtures for Invenio. Apr 04, 2022 5 - Production/Stable pytest (<7,>=6) :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A @@ -488,7 +488,7 @@ This list contains 1022 plugins. :pypi:`pytest-iterassert` Nicer list and iterable assertion messages for pytest May 11, 2020 3 - Alpha N/A :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) - :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Dec 02, 2021 3 - Alpha N/A + :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Mar 09, 2022 3 - Alpha pytest :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) @@ -536,6 +536,7 @@ This list contains 1022 plugins. :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Apr 02, 2022 3 - Alpha pytest :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha pytest (>=6) :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) + :pypi:`pytest-markdown-docs` Run markdown code fences through pytest Apr 07, 2022 N/A N/A :pypi:`pytest-marker-bugzilla` py.test bugzilla integration plugin, using markers Jan 09, 2020 N/A N/A :pypi:`pytest-markers-presence` A simple plugin to detect missed pytest tags and markers" Feb 04, 2021 4 - Beta pytest (>=6.0) :pypi:`pytest-markfiltration` UNKNOWN Nov 08, 2011 3 - Alpha N/A @@ -556,7 +557,7 @@ This list contains 1022 plugins. :pypi:`pytest-metadata` pytest plugin for test session metadata Mar 26, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) - :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Sep 26, 2020 N/A pytest (>=6.0.1,<7.0.0) + :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ml` Test your machine learning! May 04, 2019 4 - Beta N/A :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) @@ -627,7 +628,7 @@ This list contains 1022 plugins. :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Mar 25, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Operators Apr 06, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -656,7 +657,7 @@ This list contains 1022 plugins. :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) :pypi:`pytest-perf` pytest-perf Feb 05, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) - :pypi:`pytest-persistence` Pytest tool for persistent objects Mar 14, 2022 N/A N/A + :pypi:`pytest-persistence` Pytest tool for persistent objects Apr 04, 2022 N/A N/A :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 18, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Nov 10, 2021 4 - Beta pytest (>=6.2) ; extra == 'test' @@ -746,7 +747,7 @@ This list contains 1022 plugins. :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jul 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) - :pypi:`pytest-redislite` Pytest plugin for testing code using Redis Sep 19, 2021 4 - Beta pytest + :pypi:`pytest-redislite` Pytest plugin for testing code using Redis Apr 05, 2022 4 - Beta pytest :pypi:`pytest-redmine` Pytest plugin for redmine Mar 19, 2018 1 - Planning N/A :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A @@ -803,19 +804,19 @@ This list contains 1022 plugins. :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A - :pypi:`pytest-salt-factories` Pytest Salt Plugin Mar 28, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Apr 06, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 31, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Apr 05, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 31, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Apr 05, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -870,7 +871,7 @@ This list contains 1022 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Mar 23, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Apr 05, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A @@ -953,6 +954,7 @@ This list contains 1022 plugins. :pypi:`pytest-tldr` A pytest plugin that limits the output to just the things you need. Mar 12, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-tm4j-reporter` Cloud Jira Test Management (TM4J) PyTest reporter plugin Sep 01, 2020 N/A pytest :pypi:`pytest-tmnet` A small example package Mar 01, 2022 N/A N/A + :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Nov 17, 2021 N/A N/A :pypi:`pytest-todo` A small plugin for the pytest testing framework, marking TODO comments as failure May 23, 2019 4 - Beta pytest :pypi:`pytest-tomato` Mar 01, 2019 5 - Production/Stable N/A @@ -975,6 +977,7 @@ This list contains 1022 plugins. :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Mar 07, 2022 4 - Beta N/A :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) :pypi:`pytest-ubersmith` Easily mock calls to ubersmith at the \`requests\` level. Apr 13, 2015 N/A N/A @@ -1053,7 +1056,7 @@ This list contains 1022 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: Mar 25, 2022, + *last release*: Apr 04, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1410,7 +1413,7 @@ This list contains 1022 plugins. Pytest support for asyncio :pypi:`pytest-asyncio-cooperative` - *last release*: Mar 30, 2022, + *last release*: Apr 07, 2022, *status*: N/A, *requires*: N/A @@ -1809,7 +1812,7 @@ This list contains 1022 plugins. Pytest plugin to only run tests affected by changes :pypi:`pytest-cairo` - *last release*: Apr 02, 2022, + *last release*: Apr 08, 2022, *status*: N/A, *requires*: pytest @@ -1937,7 +1940,7 @@ This list contains 1022 plugins. :pypi:`pytest-check-links` *last release*: Jul 29, 2020, *status*: N/A, - *requires*: pytest (>=4.6) + *requires*: pytest (>=7.0) Check links in files @@ -2740,7 +2743,7 @@ This list contains 1022 plugins. An RST Documentation Generator for pytest-based test suites :pypi:`pytest-docker` - *last release*: Mar 28, 2022, + *last release*: Apr 09, 2022, *status*: N/A, *requires*: pytest (<8.0,>=4.0) @@ -2824,7 +2827,7 @@ This list contains 1022 plugins. Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. :pypi:`pytest-docker-registry-fixtures` - *last release*: Feb 09, 2022, + *last release*: Apr 08, 2022, *status*: 4 - Beta, *requires*: pytest @@ -3040,6 +3043,13 @@ This list contains 1022 plugins. Tool to help automate user interfaces + :pypi:`pytest-eliot` + *last release*: Apr 05, 2022, + *status*: 1 - Planning, + *requires*: pytest (>=5.4.0) + + An eliot plugin for pytest. + :pypi:`pytest-elk-reporter` *last release*: Jan 24, 2021, *status*: 4 - Beta, @@ -3489,7 +3499,7 @@ This list contains 1022 plugins. Pytest plugin for filtering based on sub-packages :pypi:`pytest-find-dependencies` - *last release*: Jan 16, 2022, + *last release*: Apr 09, 2022, *status*: 4 - Beta, *requires*: pytest (>=4.3.0) @@ -3642,13 +3652,6 @@ This list contains 1022 plugins. A pytest plugin that alerts user of failed test cases with screen notifications - :pypi:`pytest-fold` - *last release*: Feb 20, 2022, - *status*: 4 - Beta, - *requires*: pytest (>=6.2.5) - - Fold console output and drop user into interactive text user interface - :pypi:`pytest-forcefail` *last release*: May 15, 2018, *status*: 4 - Beta, @@ -3769,7 +3772,7 @@ This list contains 1022 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Apr 01, 2022, + *last release*: Apr 06, 2022, *status*: N/A, *requires*: N/A @@ -3951,7 +3954,7 @@ This list contains 1022 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Apr 02, 2022, + *last release*: Apr 09, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4007,7 +4010,7 @@ This list contains 1022 plugins. optimized pytest plugin for generating HTML reports :pypi:`pytest-html-merger` - *last release*: Mar 22, 2022, + *last release*: Apr 03, 2022, *status*: N/A, *requires*: N/A @@ -4266,7 +4269,7 @@ This list contains 1022 plugins. Pytest plugin for intercepting outgoing connection requests during pytest run. :pypi:`pytest-invenio` - *last release*: Mar 29, 2022, + *last release*: Apr 04, 2022, *status*: 5 - Production/Stable, *requires*: pytest (<7,>=6) @@ -4336,7 +4339,7 @@ This list contains 1022 plugins. A custom jest-pytest oriented Pytest reporter :pypi:`pytest-jira` - *last release*: Dec 02, 2021, + *last release*: Apr 07, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -4671,6 +4674,13 @@ This list contains 1022 plugins. Test your markdown docs with pytest + :pypi:`pytest-markdown-docs` + *last release*: Apr 07, 2022, + *status*: N/A, + *requires*: N/A + + Run markdown code fences through pytest + :pypi:`pytest-marker-bugzilla` *last release*: Jan 09, 2020, *status*: N/A, @@ -4812,9 +4822,9 @@ This list contains 1022 plugins. Mimesis integration with the pytest test runner :pypi:`pytest-minecraft` - *last release*: Sep 26, 2020, + *last release*: Apr 06, 2022, *status*: N/A, - *requires*: pytest (>=6.0.1,<7.0.0) + *requires*: pytest (>=6.0.1) A pytest plugin for running tests against Minecraft releases @@ -5309,7 +5319,7 @@ This list contains 1022 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: Mar 25, 2022, + *last release*: Apr 06, 2022, *status*: N/A, *requires*: pytest @@ -5512,7 +5522,7 @@ This list contains 1022 plugins. A simple plugin to ensure the execution of critical sections of code has not been impacted :pypi:`pytest-persistence` - *last release*: Mar 14, 2022, + *last release*: Apr 04, 2022, *status*: N/A, *requires*: N/A @@ -6142,7 +6152,7 @@ This list contains 1022 plugins. Redis fixtures and fixture factories for Pytest. :pypi:`pytest-redislite` - *last release*: Sep 19, 2021, + *last release*: Apr 05, 2022, *status*: 4 - Beta, *requires*: pytest @@ -6541,7 +6551,7 @@ This list contains 1022 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Mar 28, 2022, + *last release*: Apr 06, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6583,7 +6593,7 @@ This list contains 1022 plugins. :pypi:`pytest-sbase` - *last release*: Mar 31, 2022, + *last release*: Apr 05, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6625,7 +6635,7 @@ This list contains 1022 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Mar 31, 2022, + *last release*: Apr 05, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7010,7 +7020,7 @@ This list contains 1022 plugins. :pypi:`pytest-splunk-addon` - *last release*: Mar 23, 2022, + *last release*: Apr 05, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7590,6 +7600,13 @@ This list contains 1022 plugins. A small example package + :pypi:`pytest-tmp-files` + *last release*: Apr 03, 2022, + *status*: N/A, + *requires*: pytest + + Utilities to create temporary file hierarchies in pytest. + :pypi:`pytest-tmreport` *last release*: Nov 17, 2021, *status*: N/A, @@ -7744,6 +7761,13 @@ This list contains 1022 plugins. Run type checkers on specified test files + :pypi:`pytest-typhoon-config` + *last release*: Apr 07, 2022, + *status*: 5 - Production/Stable, + *requires*: N/A + + A Typhoon HIL plugin that facilitates test parameter configuration at runtime + :pypi:`pytest-typhoon-xray` *last release*: Mar 07, 2022, *status*: 4 - Beta, From 61dfdfcc3f2ca0f02a789c242dc168868e711dd3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Apr 2022 21:28:05 +0000 Subject: [PATCH 202/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.1.0 → v4.2.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.1.0...v4.2.0) - [github.com/asottile/pyupgrade: v2.31.1 → v2.32.0](https://github.com/asottile/pyupgrade/compare/v2.31.1...v2.32.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f4eae861ff5..c0fd36df3fd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: blacken-docs additional_dependencies: [black==20.8b1] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.2.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -42,7 +42,7 @@ repos: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.31.1 + rev: v2.32.0 hooks: - id: pyupgrade args: [--py37-plus] From 99e20713fdfd44450a7bbaf3f1b9f916fb309ea1 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 12 Apr 2022 17:26:30 +0300 Subject: [PATCH 203/549] Docs: link to easy issues in contributing guide --- CONTRIBUTING.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index e72cbfe2401..262396728b8 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -50,6 +50,8 @@ Fix bugs -------- Look through the `GitHub issues for bugs `_. +See also the `"status: easy" issues `_ +that are friendly to new contributors. :ref:`Talk ` to developers to find out how you can fix specific bugs. To indicate that you are going to work on a particular issue, add a comment to that effect on the specific issue. From 61095e4ba6e3429cd910bf548f646af38bf18ebc Mon Sep 17 00:00:00 2001 From: gresm <78505251+gresm@users.noreply.github.com> Date: Sat, 16 Apr 2022 15:51:21 +0200 Subject: [PATCH 204/549] Update goodpractices.rst Fix example package tree. --- doc/en/explanation/goodpractices.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 32a14991ae2..92110f4f901 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -196,7 +196,7 @@ want to distribute them along with your application: __init__.py app.py view.py - test/ + tests/ __init__.py test_app.py test_view.py From 2e8a3198289e56d4055aac2f8ef7af1e42b71545 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sun, 17 Apr 2022 11:11:17 -0700 Subject: [PATCH 205/549] Use tomllib on Python 3.11 (#9741) --- changelog/9741.improvement.rst | 3 +++ setup.cfg | 2 +- src/_pytest/config/findpaths.py | 10 +++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 changelog/9741.improvement.rst diff --git a/changelog/9741.improvement.rst b/changelog/9741.improvement.rst new file mode 100644 index 00000000000..1f9ab3eadf2 --- /dev/null +++ b/changelog/9741.improvement.rst @@ -0,0 +1,3 @@ +On Python 3.11, use the standard library's :mod:`tomllib` to parse TOML. + +:mod:`tomli`` is no longer a dependency on Python 3.11. diff --git a/setup.cfg b/setup.cfg index fe6ea4095bc..c4f5bd9d29f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -46,10 +46,10 @@ install_requires = packaging pluggy>=0.12,<2.0 py>=1.8.2 - tomli>=1.0.0 atomicwrites>=1.0;sys_platform=="win32" colorama;sys_platform=="win32" importlib-metadata>=0.12;python_version<"3.8" + tomli>=1.0.0;python_version<"3.11" python_requires = >=3.7 package_dir = =src diff --git a/src/_pytest/config/findpaths.py b/src/_pytest/config/findpaths.py index c082e652d92..ead344baac5 100644 --- a/src/_pytest/config/findpaths.py +++ b/src/_pytest/config/findpaths.py @@ -1,4 +1,5 @@ import os +import sys from pathlib import Path from typing import Dict from typing import Iterable @@ -64,12 +65,15 @@ def load_config_dict_from_file( # '.toml' files are considered if they contain a [tool.pytest.ini_options] table. elif filepath.suffix == ".toml": - import tomli + if sys.version_info >= (3, 11): + import tomllib + else: + import tomli as tomllib toml_text = filepath.read_text(encoding="utf-8") try: - config = tomli.loads(toml_text) - except tomli.TOMLDecodeError as exc: + config = tomllib.loads(toml_text) + except tomllib.TOMLDecodeError as exc: raise UsageError(f"{filepath}: {exc}") from exc result = config.get("tool", {}).get("pytest", {}).get("ini_options", None) From ace71037ab03a39e0aae074b24e7f2c1c86d5e7c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 03:01:56 +0000 Subject: [PATCH 206/549] build(deps): Bump django in /testing/plugins_integration Bumps [django](https://github.com/django/django) from 4.0.3 to 4.0.4. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/4.0.3...4.0.4) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 357fa539f32..6ccc16c4253 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.5.0 -django==4.0.3 +django==4.0.4 pytest-asyncio==0.18.2 pytest-bdd==5.0.0 pytest-cov==3.0.0 From 86b62067b770b0ddf242312da63f7a3722239d70 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Apr 2022 03:01:59 +0000 Subject: [PATCH 207/549] build(deps): Bump twisted in /testing/plugins_integration Bumps [twisted](https://github.com/twisted/twisted) from 22.2.0 to 22.4.0. - [Release notes](https://github.com/twisted/twisted/releases) - [Changelog](https://github.com/twisted/twisted/blob/trunk/NEWS.rst) - [Commits](https://github.com/twisted/twisted/compare/twisted-22.2.0...twisted-22.4.0) --- updated-dependencies: - dependency-name: twisted dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 357fa539f32..e37d9242fdf 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -11,5 +11,5 @@ pytest-rerunfailures==10.2 pytest-sugar==0.9.4 pytest-trio==0.7.0 pytest-twisted==1.13.4 -twisted==22.2.0 +twisted==22.4.0 pytest-xvfb==2.0.0 From 5800d39053af398eebcefdb668e767acb7944f01 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Wed, 20 Apr 2022 19:07:10 +0300 Subject: [PATCH 208/549] Increase stacklevel to point at user's code (#9869) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- changelog/9869.bugfix.rst | 2 ++ src/_pytest/nodes.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelog/9869.bugfix.rst diff --git a/changelog/9869.bugfix.rst b/changelog/9869.bugfix.rst new file mode 100644 index 00000000000..9761d7f161b --- /dev/null +++ b/changelog/9869.bugfix.rst @@ -0,0 +1,2 @@ +Increase ``stacklevel`` for the ``NODE_CTOR_FSPATH_ARG`` deprecation to point to the +user's code, not pytest. diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py index e49c1b003e0..1a168043a4f 100644 --- a/src/_pytest/nodes.py +++ b/src/_pytest/nodes.py @@ -111,7 +111,7 @@ def _imply_path( NODE_CTOR_FSPATH_ARG.format( node_type_name=node_type.__name__, ), - stacklevel=3, + stacklevel=6, ) if path is not None: if fspath is not None: From 6a3168e770287cc3bb53090d3dc3feb78d78563a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 13:08:36 -0300 Subject: [PATCH 209/549] [automated] Update plugin list (#9864) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 186 +++++++++++++++++++------------ 1 file changed, 113 insertions(+), 73 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index e8d116cb869..5f3bcf78f0a 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1025 plugins. +This list contains 1030 plugins. .. only:: not latex @@ -34,7 +34,7 @@ This list contains 1025 plugins. :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A - :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Mar 12, 2022 N/A pytest (>=1.0) + :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Apr 10, 2022 N/A pytest (>=1.0) :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) @@ -48,6 +48,7 @@ This list contains 1025 plugins. :pypi:`pytest-ansible` Plugin for py.test to simplify calling ansible modules from tests or fixtures May 25, 2021 5 - Production/Stable N/A :pypi:`pytest-ansible-playbook` Pytest fixture which runs given ansible playbook file. Mar 08, 2019 4 - Beta N/A :pypi:`pytest-ansible-playbook-runner` Pytest fixture which runs given ansible playbook file. Dec 02, 2020 4 - Beta pytest (>=3.1.0) + :pypi:`pytest-ansible-units` A pytest plugin for running unit tests within an ansible collection Apr 14, 2022 N/A N/A :pypi:`pytest-antilru` Bust functools.lru_cache when running pytest to avoid test pollution Jan 29, 2022 5 - Production/Stable pytest :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest :pypi:`pytest-anything` Pytest fixtures to assert anything and something Feb 18, 2021 N/A N/A @@ -63,14 +64,14 @@ This list contains 1025 plugins. :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A :pypi:`pytest-assertions` Pytest Assertions Mar 21, 2022 N/A N/A :pypi:`pytest-assertutil` pytest-assertutil May 10, 2019 N/A N/A - :pypi:`pytest-assert-utils` Useful assertion utilities for use with pytest Sep 21, 2021 3 - Alpha N/A + :pypi:`pytest-assert-utils` Useful assertion utilities for use with pytest Apr 14, 2022 3 - Alpha N/A :pypi:`pytest-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) :pypi:`pytest-ast-back-to-python` A plugin for pytest devs to view how assertion rewriting recodes the AST Sep 29, 2019 4 - Beta N/A - :pypi:`pytest-astropy` Meta-package containing dependencies for testing Sep 21, 2021 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio Mar 25, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Apr 07, 2022 N/A N/A + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Apr 14, 2022 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) :pypi:`pytest-async-sqlalchemy` Database testing fixtures using the SQLAlchemy asyncio API Oct 07, 2021 4 - Beta pytest (>=6.0.0) @@ -117,7 +118,7 @@ This list contains 1025 plugins. :pypi:`pytest-browser` A pytest plugin for console based browser test selection just after the collection phase Dec 10, 2016 3 - Alpha N/A :pypi:`pytest-browsermob-proxy` BrowserMob proxy plugin for py.test. Jun 11, 2013 4 - Beta N/A :pypi:`pytest-browserstack-local` \`\`py.test\`\` plugin to run \`\`BrowserStackLocal\`\` in background. Feb 09, 2018 N/A N/A - :pypi:`pytest-bug` Pytest plugin for marking tests as a bug Jun 02, 2020 5 - Production/Stable pytest (>=3.6.0) + :pypi:`pytest-bug` Pytest plugin for marking tests as a bug Apr 13, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-bugtong-tag` pytest-bugtong-tag is a plugin for pytest Jan 16, 2022 N/A N/A :pypi:`pytest-bugzilla` py.test bugzilla integration plugin May 05, 2010 4 - Beta N/A :pypi:`pytest-bugzilla-notifier` A plugin that allows you to execute create, update, and read information from BugZilla bugs Jun 15, 2018 4 - Beta pytest (>=2.9.2) @@ -142,6 +143,7 @@ This list contains 1025 plugins. :pypi:`pytest-chalice` A set of py.test fixtures for AWS Chalice Jul 01, 2020 4 - Beta N/A :pypi:`pytest-change-demo` turn . into √,turn F into x Mar 02, 2022 N/A pytest :pypi:`pytest-change-report` turn . into √,turn F into x Sep 14, 2020 N/A pytest + :pypi:`pytest-change-xds` turn . into √,turn F into x Apr 16, 2022 N/A pytest :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) :pypi:`pytest-checkdocs` check the README when running tests Jul 31, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) @@ -158,7 +160,7 @@ This list contains 1025 plugins. :pypi:`pytest-cloudflare-worker` pytest plugin for testing cloudflare workers Mar 30, 2021 4 - Beta pytest (>=6.0.0) :pypi:`pytest-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) :pypi:`pytest-codecheckers` pytest plugin to add source code sanity checks (pep8 and friends) Feb 13, 2010 N/A N/A - :pypi:`pytest-codecov` Pytest plugin for uploading pytest-cov results to codecov.io Oct 27, 2021 4 - Beta pytest (>=4.6.0) + :pypi:`pytest-codecov` Pytest plugin for uploading pytest-cov results to codecov.io Apr 12, 2022 4 - Beta pytest (>=4.6.0) :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A :pypi:`pytest-codeowners` Pytest plugin for selecting tests by GitHub CODEOWNERS. Mar 30, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-codestyle` pytest plugin to run pycodestyle Mar 23, 2020 3 - Alpha N/A @@ -169,7 +171,7 @@ This list contains 1025 plugins. :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method Nov 12, 2020 N/A pytest (>=3.6,<7) :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-config` Base configurations and utilities for developing your Python project test suite with pytest. Nov 07, 2014 5 - Production/Stable N/A - :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Nov 06, 2020 N/A N/A + :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Apr 14, 2022 N/A N/A :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts Mar 18, 2022 4 - Beta N/A :pypi:`pytest-consul` pytest plugin with fixtures for testing consul aware apps Nov 24, 2018 3 - Alpha pytest :pypi:`pytest-container` Pytest fixtures for writing container based tests Feb 01, 2022 3 - Alpha pytest (>=3.10) @@ -184,7 +186,7 @@ This list contains 1025 plugins. :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Mar 14, 2022 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Apr 16, 2022 N/A N/A :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest @@ -306,16 +308,16 @@ This list contains 1025 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Mar 18, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Mar 18, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Mar 18, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Mar 18, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Mar 18, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Apr 15, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Apr 15, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Apr 15, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Apr 15, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Apr 15, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Mar 18, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Mar 18, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Apr 15, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Apr 15, 2022 N/A N/A :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) - :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Oct 10, 2021 4 - Beta pytest (==6.0.1) + :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-encode` set your encoding and logger Nov 06, 2021 N/A N/A :pypi:`pytest-encode-kane` set your encoding and logger Nov 16, 2021 N/A pytest @@ -400,14 +402,14 @@ This list contains 1025 plugins. :pypi:`pytest-funparam` An alternative way to parametrize test cases. Dec 02, 2021 4 - Beta pytest >=4.6.0 :pypi:`pytest-fxa` pytest plugin for Firefox Accounts Aug 28, 2018 5 - Production/Stable N/A :pypi:`pytest-fxtest` Oct 27, 2020 N/A N/A - :pypi:`pytest-gather-fixtures` set up asynchronous pytest fixtures concurrently Mar 15, 2022 N/A pytest (>=6.0.0,<7.0.0) + :pypi:`pytest-gather-fixtures` set up asynchronous pytest fixtures concurrently Apr 12, 2022 N/A pytest (>=6.0.0) :pypi:`pytest-gc` The garbage collector plugin for py.test Feb 01, 2018 N/A N/A :pypi:`pytest-gcov` Uses gcov to measure test coverage of a C library Feb 01, 2018 3 - Alpha N/A :pypi:`pytest-gevent` Ensure that gevent is properly patched when invoking pytest Feb 25, 2020 N/A pytest :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Apr 06, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Apr 13, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -433,7 +435,7 @@ This list contains 1025 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Apr 09, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Apr 15, 2022 3 - Alpha pytest (==7.1.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -469,7 +471,7 @@ This list contains 1025 plugins. :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Sep 30, 2021 N/A N/A :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Mar 30, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-extensions` Inmanta tests package Feb 11, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) @@ -511,7 +513,7 @@ This list contains 1025 plugins. :pypi:`pytest-leaks` A pytest plugin to trace resource leaks. Nov 27, 2019 1 - Planning N/A :pypi:`pytest-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest. Dec 22, 2018 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Feb 23, 2022 4 - Beta N/A + :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Apr 14, 2022 4 - Beta N/A :pypi:`pytest-libnotify` Pytest plugin that shows notifications about the test run Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-ligo` Jan 16, 2020 4 - Beta N/A :pypi:`pytest-lineno` A pytest plugin to show the line numbers of test functions Dec 04, 2020 N/A pytest @@ -532,7 +534,7 @@ This list contains 1025 plugins. :pypi:`pytest-logger` Plugin configuring handlers for loggers from Python logging module. Jul 25, 2019 4 - Beta pytest (>=3.2) :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A - :pypi:`pytest-loguru` Pytest Loguru Feb 27, 2022 5 - Production/Stable N/A + :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Apr 02, 2022 3 - Alpha pytest :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha pytest (>=6) :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) @@ -567,7 +569,7 @@ This list contains 1025 plugins. :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Mar 30, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Apr 11, 2022 N/A pytest (>=1.0) :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A @@ -628,7 +630,7 @@ This list contains 1025 plugins. :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Apr 06, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Operators Apr 12, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -660,7 +662,7 @@ This list contains 1025 plugins. :pypi:`pytest-persistence` Pytest tool for persistent objects Apr 04, 2022 N/A N/A :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 18, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Nov 10, 2021 4 - Beta pytest (>=6.2) ; extra == 'test' + :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Apr 15, 2022 4 - Beta pytest (>=5.4.3) :pypi:`pytest-picked` Run the tests related to the changed files Dec 23, 2020 N/A pytest (>=3.5.0) :pypi:`pytest-pigeonhole` Jun 25, 2018 5 - Production/Stable pytest (>=3.4) :pypi:`pytest-pikachu` Show surprise when tests are passing Aug 05, 2021 5 - Production/Stable pytest @@ -691,6 +693,7 @@ This list contains 1025 plugins. :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) + :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 16, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 31, 2022 N/A pytest (>=3.4.1) :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Dec 28, 2021 5 - Production/Stable pytest (>=6) @@ -733,7 +736,7 @@ This list contains 1025 plugins. :pypi:`pytest-race` Race conditions tester for pytest Nov 21, 2016 4 - Beta N/A :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results Feb 04, 2022 N/A pytest (>=3.6) - :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Mar 24, 2022 5 - Production/Stable pytest + :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Apr 12, 2022 5 - Production/Stable pytest :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) :pypi:`pytest-raisesregexp` Simple pytest plugin to look for regex in Exceptions Dec 18, 2015 N/A N/A :pypi:`pytest-raisin` Plugin enabling the use of exception instances with pytest.raises Feb 06, 2022 N/A pytest @@ -771,7 +774,7 @@ This list contains 1025 plugins. :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility Dec 11, 2020 3 - Alpha pytest (>=5.2) :pypi:`pytest-report-me` A pytest plugin to generate report. Dec 31, 2020 N/A pytest :pypi:`pytest-report-parameters` pytest plugin for adding tests' parameters to junit report Jun 18, 2020 3 - Alpha pytest (>=2.4.2) - :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Feb 22, 2022 N/A pytest (>=3.8.0) + :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Apr 12, 2022 N/A pytest (>=3.8.0) :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) @@ -779,7 +782,7 @@ This list contains 1025 plugins. :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Mar 07, 2022 N/A N/A + :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Apr 13, 2022 N/A N/A :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A @@ -810,13 +813,13 @@ This list contains 1025 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Apr 05, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Apr 13, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Apr 05, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Apr 13, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -858,7 +861,7 @@ This list contains 1025 plugins. :pypi:`pytest-solidity` A PyTest library plugin for Solidity language. Jan 15, 2022 1 - Planning pytest (<7,>=6.0.1) ; extra == 'tests' :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) :pypi:`pytest-sorter` A simple plugin to first execute tests that historically failed more Apr 20, 2021 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Feb 21, 2022 2 - Pre-Alpha pytest + :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Apr 11, 2022 2 - Pre-Alpha pytest :pypi:`pytest-sourceorder` Test-ordering plugin for pytest Sep 01, 2021 4 - Beta pytest :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. Feb 23, 2020 4 - Beta pytest :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A @@ -871,7 +874,7 @@ This list contains 1025 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Apr 05, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Apr 13, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A @@ -919,7 +922,7 @@ This list contains 1025 plugins. :pypi:`pytest-testdirectory` A py.test plugin providing temporary directories in unit tests. Feb 21, 2022 5 - Production/Stable pytest :pypi:`pytest-testdox` A testdox format reporter for pytest Dec 05, 2021 5 - Production/Stable pytest (>=4.6.0) :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A - :pypi:`pytest-testinfra` Test infrastructures Feb 10, 2022 5 - Production/Stable pytest (!=3.0.2) + :pypi:`pytest-testinfra` Test infrastructures Apr 12, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) :pypi:`pytest-testmon` selects tests affected by changed files and methods Mar 11, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) @@ -975,6 +978,7 @@ This list contains 1025 plugins. :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Mar 13, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A + :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, automatically launched after your test run is finished Apr 14, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A @@ -986,6 +990,7 @@ This list contains 1025 plugins. :pypi:`pytest-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) :pypi:`pytest-unmarked` Run only unmarked tests Aug 27, 2019 5 - Production/Stable N/A :pypi:`pytest-unordered` Test equality of unordered collections in pytest Mar 28, 2021 4 - Beta N/A + :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Apr 12, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-upload-report` pytest-upload-report is a plugin for pytest that upload your test report for test results. Jun 18, 2021 5 - Production/Stable N/A :pypi:`pytest-utils` Some helpers for pytest. Dec 04, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) :pypi:`pytest-vagrant` A py.test plugin providing access to vagrant. Sep 07, 2021 5 - Production/Stable pytest @@ -1040,7 +1045,7 @@ This list contains 1025 plugins. :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A - :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Mar 21, 2022 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Apr 15, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-zulip` Pytest report plugin for Zulip Mar 04, 2022 5 - Production/Stable pytest =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ @@ -1161,7 +1166,7 @@ This list contains 1025 plugins. :pypi:`pytest-alembic` - *last release*: Mar 12, 2022, + *last release*: Apr 10, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -1258,6 +1263,13 @@ This list contains 1025 plugins. Pytest fixture which runs given ansible playbook file. + :pypi:`pytest-ansible-units` + *last release*: Apr 14, 2022, + *status*: N/A, + *requires*: N/A + + A pytest plugin for running unit tests within an ansible collection + :pypi:`pytest-antilru` *last release*: Jan 29, 2022, *status*: 5 - Production/Stable, @@ -1364,7 +1376,7 @@ This list contains 1025 plugins. pytest-assertutil :pypi:`pytest-assert-utils` - *last release*: Sep 21, 2021, + *last release*: Apr 14, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -1385,7 +1397,7 @@ This list contains 1025 plugins. A plugin for pytest devs to view how assertion rewriting recodes the AST :pypi:`pytest-astropy` - *last release*: Sep 21, 2021, + *last release*: Apr 12, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.6) @@ -1413,7 +1425,7 @@ This list contains 1025 plugins. Pytest support for asyncio :pypi:`pytest-asyncio-cooperative` - *last release*: Apr 07, 2022, + *last release*: Apr 14, 2022, *status*: N/A, *requires*: N/A @@ -1742,9 +1754,9 @@ This list contains 1025 plugins. \`\`py.test\`\` plugin to run \`\`BrowserStackLocal\`\` in background. :pypi:`pytest-bug` - *last release*: Jun 02, 2020, + *last release*: Apr 13, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=3.6.0) + *requires*: pytest (>=6.2.0) Pytest plugin for marking tests as a bug @@ -1916,6 +1928,13 @@ This list contains 1025 plugins. turn . into √,turn F into x + :pypi:`pytest-change-xds` + *last release*: Apr 16, 2022, + *status*: N/A, + *requires*: pytest + + turn . into √,turn F into x + :pypi:`pytest-chdir` *last release*: Jan 28, 2020, *status*: N/A, @@ -2029,7 +2048,7 @@ This list contains 1025 plugins. pytest plugin to add source code sanity checks (pep8 and friends) :pypi:`pytest-codecov` - *last release*: Oct 27, 2021, + *last release*: Apr 12, 2022, *status*: 4 - Beta, *requires*: pytest (>=4.6.0) @@ -2106,7 +2125,7 @@ This list contains 1025 plugins. Base configurations and utilities for developing your Python project test suite with pytest. :pypi:`pytest-confluence-report` - *last release*: Nov 06, 2020, + *last release*: Apr 14, 2022, *status*: N/A, *requires*: N/A @@ -2211,7 +2230,7 @@ This list contains 1025 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Mar 14, 2022, + *last release*: Apr 16, 2022, *status*: N/A, *requires*: N/A @@ -3065,35 +3084,35 @@ This list contains 1025 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Mar 18, 2022, + *last release*: Apr 15, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Mar 18, 2022, + *last release*: Apr 15, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Mar 18, 2022, + *last release*: Apr 15, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Mar 18, 2022, + *last release*: Apr 15, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Mar 18, 2022, + *last release*: Apr 15, 2022, *status*: N/A, *requires*: N/A @@ -3107,14 +3126,14 @@ This list contains 1025 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Mar 18, 2022, + *last release*: Apr 15, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Mar 18, 2022, + *last release*: Apr 15, 2022, *status*: N/A, *requires*: N/A @@ -3128,9 +3147,9 @@ This list contains 1025 plugins. A pytest plugin that adds emojis to your test result report :pypi:`pytest-emoji-output` - *last release*: Oct 10, 2021, + *last release*: Apr 12, 2022, *status*: 4 - Beta, - *requires*: pytest (==6.0.1) + *requires*: pytest (==7.0.1) Pytest plugin to represent test output with emoji support @@ -3723,9 +3742,9 @@ This list contains 1025 plugins. :pypi:`pytest-gather-fixtures` - *last release*: Mar 15, 2022, + *last release*: Apr 12, 2022, *status*: N/A, - *requires*: pytest (>=6.0.0,<7.0.0) + *requires*: pytest (>=6.0.0) set up asynchronous pytest fixtures concurrently @@ -3772,7 +3791,7 @@ This list contains 1025 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Apr 06, 2022, + *last release*: Apr 13, 2022, *status*: N/A, *requires*: N/A @@ -3954,7 +3973,7 @@ This list contains 1025 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Apr 09, 2022, + *last release*: Apr 15, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4206,7 +4225,7 @@ This list contains 1025 plugins. A py.test plugin providing fixtures to simplify inmanta modules testing. :pypi:`pytest-inmanta-extensions` - *last release*: Feb 11, 2022, + *last release*: Apr 12, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4500,7 +4519,7 @@ This list contains 1025 plugins. A python-libfaketime plugin for pytest. :pypi:`pytest-libiio` - *last release*: Feb 23, 2022, + *last release*: Apr 14, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4647,7 +4666,7 @@ This list contains 1025 plugins. Package for creating a pytest test run reprot :pypi:`pytest-loguru` - *last release*: Feb 27, 2022, + *last release*: Apr 12, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4892,7 +4911,7 @@ This list contains 1025 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Mar 30, 2022, + *last release*: Apr 11, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -5319,7 +5338,7 @@ This list contains 1025 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: Apr 06, 2022, + *last release*: Apr 12, 2022, *status*: N/A, *requires*: pytest @@ -5543,9 +5562,9 @@ This list contains 1025 plugins. Pytest plugins and helpers for tests using a Postgres database. :pypi:`pytest-phmdoctest` - *last release*: Nov 10, 2021, + *last release*: Apr 15, 2022, *status*: 4 - Beta, - *requires*: pytest (>=6.2) ; extra == 'test' + *requires*: pytest (>=5.4.3) pytest plugin to test Python examples in Markdown using phmdoctest. @@ -5759,6 +5778,13 @@ This list contains 1025 plugins. pytest plugin with powerful fixtures + :pypi:`pytest-prefer-nested-dup-tests` + *last release*: Apr 16, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=7.1.1,<8.0.0) + + A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. + :pypi:`pytest-pretty-terminal` *last release*: Jan 31, 2022, *status*: N/A, @@ -6054,7 +6080,7 @@ This list contains 1025 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-railflow-testrail-reporter` - *last release*: Mar 24, 2022, + *last release*: Apr 12, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6320,7 +6346,7 @@ This list contains 1025 plugins. pytest plugin for adding tests' parameters to junit report :pypi:`pytest-reportportal` - *last release*: Feb 22, 2022, + *last release*: Apr 12, 2022, *status*: N/A, *requires*: pytest (>=3.8.0) @@ -6376,7 +6402,7 @@ This list contains 1025 plugins. pytest plugin to re-run tests to eliminate flaky failures :pypi:`pytest-resilient-circuits` - *last release*: Mar 07, 2022, + *last release*: Apr 13, 2022, *status*: N/A, *requires*: N/A @@ -6593,7 +6619,7 @@ This list contains 1025 plugins. :pypi:`pytest-sbase` - *last release*: Apr 05, 2022, + *last release*: Apr 13, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6635,7 +6661,7 @@ This list contains 1025 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Apr 05, 2022, + *last release*: Apr 13, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6929,7 +6955,7 @@ This list contains 1025 plugins. A simple plugin to first execute tests that historically failed more :pypi:`pytest-sosu` - *last release*: Feb 21, 2022, + *last release*: Apr 11, 2022, *status*: 2 - Pre-Alpha, *requires*: pytest @@ -7020,7 +7046,7 @@ This list contains 1025 plugins. :pypi:`pytest-splunk-addon` - *last release*: Apr 05, 2022, + *last release*: Apr 13, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7356,7 +7382,7 @@ This list contains 1025 plugins. A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. :pypi:`pytest-testinfra` - *last release*: Feb 10, 2022, + *last release*: Apr 12, 2022, *status*: 5 - Production/Stable, *requires*: pytest (!=3.0.2) @@ -7747,6 +7773,13 @@ This list contains 1025 plugins. Test Class Base + :pypi:`pytest-tui` + *last release*: Apr 14, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=6.2.5) + + Text User Interface (TUI) for Pytest, automatically launched after your test run is finished + :pypi:`pytest-twisted` *last release*: Aug 30, 2021, *status*: 5 - Production/Stable, @@ -7824,6 +7857,13 @@ This list contains 1025 plugins. Test equality of unordered collections in pytest + :pypi:`pytest-unstable` + *last release*: Apr 12, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + Set a test as unstable to return 0 even if it failed + :pypi:`pytest-upload-report` *last release*: Jun 18, 2021, *status*: 5 - Production/Stable, @@ -8203,7 +8243,7 @@ This list contains 1025 plugins. OWASP ZAP plugin for py.test. :pypi:`pytest-zebrunner` - *last release*: Mar 21, 2022, + *last release*: Apr 15, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.5.0) From 1ea70817526e1ddf599623cb272d87ba88b0e241 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 13:08:56 -0300 Subject: [PATCH 210/549] build(deps): Bump pytest-asyncio in /testing/plugins_integration (#9824) Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.18.2 to 0.18.3. - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Changelog](https://github.com/pytest-dev/pytest-asyncio/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.18.2...v0.18.3) --- updated-dependencies: - dependency-name: pytest-asyncio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index d1f446ca563..6d1b02920a0 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,6 +1,6 @@ anyio[curio,trio]==3.5.0 django==4.0.4 -pytest-asyncio==0.18.2 +pytest-asyncio==0.18.3 pytest-bdd==5.0.0 pytest-cov==3.0.0 pytest-django==4.5.2 From 988197c7954d6e4123c1650cab090ba8f529d6f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20M=C3=BCller?= Date: Wed, 20 Apr 2022 20:09:37 +0200 Subject: [PATCH 211/549] fix: move 'import getpass' statement to try-clause --- src/_pytest/tmpdir.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index f901fd5727c..4cf3714bcd1 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -158,9 +158,9 @@ def getbasetemp(self) -> Path: def get_user() -> Optional[str]: """Return the current user name, or None if getuser() does not work in the current environment (see #1010).""" - import getpass - try: + # In some exotic environments, getpass may not be importable. + import getpass return getpass.getuser() except (ImportError, KeyError): return None From 8514fab409fbcf43ec9e8cd7a39a27635a4b6e97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20M=C3=BCller?= Date: Wed, 20 Apr 2022 20:15:29 +0200 Subject: [PATCH 212/549] Update AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 69e71fa10d4..5ab1c2f7a03 100644 --- a/AUTHORS +++ b/AUTHORS @@ -256,6 +256,7 @@ Ondřej Súkup Oscar Benjamin Parth Patel Patrick Hayes +Paul Müller Pauli Virtanen Pavel Karateev Paweł Adamczak From ac9b65d890044656a592c41391c0734f4e67f9df Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 18:15:48 +0000 Subject: [PATCH 213/549] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytest/tmpdir.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index 4cf3714bcd1..12dc463a2a2 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -161,6 +161,7 @@ def get_user() -> Optional[str]: try: # In some exotic environments, getpass may not be importable. import getpass + return getpass.getuser() except (ImportError, KeyError): return None From 2b9f8f2f9b98b492f438ec5d4b0284706aae8498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20M=C3=BCller?= Date: Wed, 20 Apr 2022 20:20:53 +0200 Subject: [PATCH 214/549] Create 9871.bugfix.rst --- changelog/9871.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/9871.bugfix.rst diff --git a/changelog/9871.bugfix.rst b/changelog/9871.bugfix.rst new file mode 100644 index 00000000000..0986414f2bf --- /dev/null +++ b/changelog/9871.bugfix.rst @@ -0,0 +1 @@ +Handle ``ImportError`` for ``getpass`` import in ``_pytest.tempdir.get_user`` From 715d0ca9d0aa6a6136487336193c98e2604a0353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20M=C3=BCller?= Date: Wed, 20 Apr 2022 20:21:44 +0200 Subject: [PATCH 215/549] cleanup --- src/_pytest/tmpdir.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index 12dc463a2a2..4cf3714bcd1 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -161,7 +161,6 @@ def get_user() -> Optional[str]: try: # In some exotic environments, getpass may not be importable. import getpass - return getpass.getuser() except (ImportError, KeyError): return None From 12971a37e121c5761bbecab32dbca24231a59065 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 18:23:03 +0000 Subject: [PATCH 216/549] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytest/tmpdir.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index 4cf3714bcd1..12dc463a2a2 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -161,6 +161,7 @@ def get_user() -> Optional[str]: try: # In some exotic environments, getpass may not be importable. import getpass + return getpass.getuser() except (ImportError, KeyError): return None From 1285caadf29ab7801ff24ace711de7b66fc20a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20M=C3=BCller?= Date: Thu, 21 Apr 2022 00:18:47 +0200 Subject: [PATCH 217/549] Update 9871.bugfix.rst --- changelog/9871.bugfix.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog/9871.bugfix.rst b/changelog/9871.bugfix.rst index 0986414f2bf..ed787b3da34 100644 --- a/changelog/9871.bugfix.rst +++ b/changelog/9871.bugfix.rst @@ -1 +1,2 @@ -Handle ``ImportError`` for ``getpass`` import in ``_pytest.tempdir.get_user`` +Fix a bizarre (and fortunately rare) bug where the `temp_path` fixture could raise +an internal error while attempting to get the current user's username. From 0347957aa7fe18a7417f16176933c636889baa52 Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Fri, 22 Apr 2022 11:15:27 -0700 Subject: [PATCH 218/549] Fix wrong `log_file` docs (#9878) Co-authored-by: Bruno Oliveira --- doc/en/how-to/logging.rst | 2 ++ doc/en/reference/reference.rst | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/en/how-to/logging.rst b/doc/en/how-to/logging.rst index 2e8734fa6a3..5a089c2fba0 100644 --- a/doc/en/how-to/logging.rst +++ b/doc/en/how-to/logging.rst @@ -198,6 +198,8 @@ option names are: If you need to record the whole test suite logging calls to a file, you can pass ``--log-file=/path/to/log/file``. This log file is opened in write mode which means that it will be overwritten at each run tests session. +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 as seen in diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index aec384d6d33..167c8fed9a3 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1514,7 +1514,7 @@ passed multiple times. The expected format is ``name=value``. For example:: - Sets a file name relative to the ``pytest.ini`` file where log messages should be written to, in addition + Sets a file name relative to the current working directory where log messages should be written to, in addition to the other logging facilities that are active. .. code-block:: ini From e598429c7305b5fe70165c999489e04d558b0969 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Fri, 22 Apr 2022 14:38:36 -0700 Subject: [PATCH 219/549] Use safe_getattr() in getfixturemarker() --- src/_pytest/fixtures.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index ee3e93f1908..022dbc15f27 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -223,15 +223,10 @@ def add_funcarg_pseudo_fixture_def( def getfixturemarker(obj: object) -> Optional["FixtureFunctionMarker"]: """Return fixturemarker or None if it doesn't exist or raised exceptions.""" - try: - fixturemarker: Optional[FixtureFunctionMarker] = getattr( - obj, "_pytestfixturefunction", None - ) - except TEST_OUTCOME: - # some objects raise errors like request (from flask import request) - # we don't expect them to be fixture functions - return None - return fixturemarker + return cast( + Optional[FixtureFunctionMarker], + safe_getattr(obj, "_pytestfixturefunction", None), + ) # Parametrized fixture key, helper alias for code below. From 246815de13791f5ea299963ee304ed35e5c28ae3 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 23 Apr 2022 11:37:08 -0300 Subject: [PATCH 220/549] Prepare release version 7.1.2 (#9881) Co-authored-by: pytest bot (cherry picked from commit df9df5574913b2e7753b8cf6ebbf06ed9fbde10d) --- changelog/9726.bugfix.rst | 1 - changelog/9820.bugfix.rst | 1 - changelog/9869.bugfix.rst | 2 -- changelog/9871.bugfix.rst | 2 -- doc/en/announce/index.rst | 1 + doc/en/announce/release-7.1.2.rst | 23 +++++++++++++++++++++++ doc/en/builtin.rst | 4 ++-- doc/en/changelog.rst | 20 ++++++++++++++++++++ doc/en/getting-started.rst | 2 +- 9 files changed, 47 insertions(+), 9 deletions(-) delete mode 100644 changelog/9726.bugfix.rst delete mode 100644 changelog/9820.bugfix.rst delete mode 100644 changelog/9869.bugfix.rst delete mode 100644 changelog/9871.bugfix.rst create mode 100644 doc/en/announce/release-7.1.2.rst diff --git a/changelog/9726.bugfix.rst b/changelog/9726.bugfix.rst deleted file mode 100644 index 66c04c4d90c..00000000000 --- a/changelog/9726.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -An unnecessary ``numpy`` import inside :func:`pytest.approx` was removed. diff --git a/changelog/9820.bugfix.rst b/changelog/9820.bugfix.rst deleted file mode 100644 index 03af940f2c4..00000000000 --- a/changelog/9820.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix comparison of ``dataclasses`` with ``InitVar``. diff --git a/changelog/9869.bugfix.rst b/changelog/9869.bugfix.rst deleted file mode 100644 index 9761d7f161b..00000000000 --- a/changelog/9869.bugfix.rst +++ /dev/null @@ -1,2 +0,0 @@ -Increase ``stacklevel`` for the ``NODE_CTOR_FSPATH_ARG`` deprecation to point to the -user's code, not pytest. diff --git a/changelog/9871.bugfix.rst b/changelog/9871.bugfix.rst deleted file mode 100644 index ed787b3da34..00000000000 --- a/changelog/9871.bugfix.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix a bizarre (and fortunately rare) bug where the `temp_path` fixture could raise -an internal error while attempting to get the current user's username. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 0da8b4037ed..bcc0b45664b 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-7.1.2 release-7.1.1 release-7.1.0 release-7.0.1 diff --git a/doc/en/announce/release-7.1.2.rst b/doc/en/announce/release-7.1.2.rst new file mode 100644 index 00000000000..ba33cdc694b --- /dev/null +++ b/doc/en/announce/release-7.1.2.rst @@ -0,0 +1,23 @@ +pytest-7.1.2 +======================================= + +pytest 7.1.2 has just been released to PyPI. + +This is a bug-fix release, being a drop-in replacement. To upgrade:: + + pip install --upgrade pytest + +The full changelog is available at https://docs.pytest.org/en/stable/changelog.html. + +Thanks to all of the contributors to this release: + +* Anthony Sottile +* Bruno Oliveira +* Hugo van Kemenade +* Kian Eliasi +* Ran Benita +* Zac Hatfield-Dodds + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index 455ae88121f..77ae5a13028 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -170,10 +170,10 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a See https://docs.python.org/library/how-to/capture-warnings.html for information on warning categories. - tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:183 + tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:184 Return a :class:`pytest.TempPathFactory` instance for the test session. - tmp_path -- .../_pytest/tmpdir.py:198 + tmp_path -- .../_pytest/tmpdir.py:199 Return a temporary directory path object which is unique to each test function invocation, created as a sub directory of the base temporary directory. diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 6ff85883e41..46e18d32255 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -28,6 +28,26 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 7.1.2 (2022-04-23) +========================= + +Bug Fixes +--------- + +- `#9726 `_: An unnecessary ``numpy`` import inside :func:`pytest.approx` was removed. + + +- `#9820 `_: Fix comparison of ``dataclasses`` with ``InitVar``. + + +- `#9869 `_: Increase ``stacklevel`` for the ``NODE_CTOR_FSPATH_ARG`` deprecation to point to the + user's code, not pytest. + + +- `#9871 `_: Fix a bizarre (and fortunately rare) bug where the `temp_path` fixture could raise + an internal error while attempting to get the current user's username. + + pytest 7.1.1 (2022-03-17) ========================= diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index b856803f1f1..f7e03cc8b67 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -22,7 +22,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 7.1.1 + pytest 7.1.2 .. _`simpletest`: From 21091a45d014d369be422050309ccbf3f8572c57 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 24 Apr 2022 00:19:03 +0000 Subject: [PATCH 221/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 114 +++++++++++++++++++------------ 1 file changed, 69 insertions(+), 45 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 5f3bcf78f0a..bbddba7db58 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1030 plugins. +This list contains 1033 plugins. .. only:: not latex @@ -62,7 +62,7 @@ This list contains 1030 plugins. :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 4 - Beta pytest (>=4.6) :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A - :pypi:`pytest-assertions` Pytest Assertions Mar 21, 2022 N/A N/A + :pypi:`pytest-assertions` Pytest Assertions Apr 22, 2022 N/A N/A :pypi:`pytest-assertutil` pytest-assertutil May 10, 2019 N/A N/A :pypi:`pytest-assert-utils` Useful assertion utilities for use with pytest Apr 14, 2022 3 - Alpha N/A :pypi:`pytest-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) @@ -128,7 +128,7 @@ This list contains 1030 plugins. :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Mar 03, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A - :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 08, 2022 N/A pytest + :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 17, 2022 N/A pytest :pypi:`pytest-camel-collect` Enable CamelCase-aware pytest class collection Aug 02, 2020 N/A pytest (>=2.9) :pypi:`pytest-canonical-data` A plugin which allows to compare results with canonical results, based on previous runs May 08, 2020 2 - Pre-Alpha pytest (>=3.5.0) :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A @@ -171,7 +171,7 @@ This list contains 1030 plugins. :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method Nov 12, 2020 N/A pytest (>=3.6,<7) :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-config` Base configurations and utilities for developing your Python project test suite with pytest. Nov 07, 2014 5 - Production/Stable N/A - :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Apr 14, 2022 N/A N/A + :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Apr 17, 2022 N/A N/A :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts Mar 18, 2022 4 - Beta N/A :pypi:`pytest-consul` pytest plugin with fixtures for testing consul aware apps Nov 24, 2018 3 - Alpha pytest :pypi:`pytest-container` Pytest fixtures for writing container based tests Feb 01, 2022 3 - Alpha pytest (>=3.10) @@ -186,7 +186,7 @@ This list contains 1030 plugins. :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Apr 16, 2022 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Apr 17, 2022 N/A N/A :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest @@ -293,7 +293,7 @@ This list contains 1030 plugins. :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A :pypi:`pytest-duration-insights` Jun 25, 2021 N/A N/A - :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Mar 07, 2022 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Apr 22, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-dynamicrerun` A pytest plugin to rerun tests dynamically based off of test outcome and output. Aug 15, 2020 4 - Beta N/A :pypi:`pytest-dynamodb` DynamoDB fixtures for pytest Jun 03, 2021 5 - Production/Stable pytest :pypi:`pytest-easy-addoption` pytest-easy-addoption: Easy way to work with pytest addoption Jan 22, 2020 N/A N/A @@ -397,7 +397,7 @@ This list contains 1030 plugins. :pypi:`pytest-forward-compatibility` A pytest plugin to shim pytest commandline options for fowards compatibility Sep 29, 2020 N/A N/A :pypi:`pytest-freezegun` Wrap tests with fixtures in freeze_time Jul 19, 2020 4 - Beta pytest (>=3.0.0) :pypi:`pytest-freeze-reqs` Check if requirement files are frozen Apr 29, 2021 N/A N/A - :pypi:`pytest-frozen-uuids` Deterministically frozen UUID's for your tests Feb 14, 2022 N/A pytest (>=3.0) + :pypi:`pytest-frozen-uuids` Deterministically frozen UUID's for your tests Apr 17, 2022 N/A pytest (>=3.0) :pypi:`pytest-func-cov` Pytest plugin for measuring function coverage Apr 15, 2021 3 - Alpha pytest (>=5) :pypi:`pytest-funparam` An alternative way to parametrize test cases. Dec 02, 2021 4 - Beta pytest >=4.6.0 :pypi:`pytest-fxa` pytest plugin for Firefox Accounts Aug 28, 2018 5 - Production/Stable N/A @@ -435,7 +435,7 @@ This list contains 1030 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Apr 15, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Apr 21, 2022 3 - Alpha pytest (==7.1.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -461,6 +461,7 @@ This list contains 1030 plugins. :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jan 14, 2022 4 - Beta pytest :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A + :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Apr 20, 2022 5 - Production/Stable N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 30, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A :pypi:`pytest-image-diff` Mar 17, 2022 3 - Alpha pytest @@ -480,7 +481,7 @@ This list contains 1030 plugins. :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) - :pypi:`pytest-invenio` Pytest fixtures for Invenio. Apr 04, 2022 5 - Production/Stable pytest (<7,>=6) + :pypi:`pytest-invenio` Pytest fixtures for Invenio. Apr 22, 2022 5 - Production/Stable pytest (<7,>=6) :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A @@ -510,6 +511,7 @@ This list contains 1030 plugins. :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A :pypi:`pytest-lazy-fixture` It helps to use fixtures in pytest.mark.parametrize Feb 01, 2020 4 - Beta pytest (>=3.2.5) :pypi:`pytest-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest + :pypi:`pytest-leak-finder` Find the previous test that makes another to fail Apr 18, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-leaks` A pytest plugin to trace resource leaks. Nov 27, 2019 1 - Planning N/A :pypi:`pytest-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest. Dec 22, 2018 4 - Beta pytest (>=3.0.0) @@ -535,7 +537,7 @@ This list contains 1030 plugins. :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Apr 02, 2022 3 - Alpha pytest + :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Apr 18, 2022 3 - Alpha pytest :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha pytest (>=6) :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) :pypi:`pytest-markdown-docs` Run markdown code fences through pytest Apr 07, 2022 N/A N/A @@ -552,6 +554,7 @@ This list contains 1030 plugins. :pypi:`pytest-md` Plugin for generating Markdown reports for pytest results Jul 11, 2019 3 - Alpha pytest (>=4.2.1) :pypi:`pytest-md-report` A pytest plugin to make a test results report with Markdown table format. Feb 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :pypi:`pytest-memprof` Estimates memory consumption of test functions Mar 29, 2019 4 - Beta N/A + :pypi:`pytest-memray` A simple plugin to use with pytest Apr 19, 2022 N/A N/A :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Jan 05, 2022 N/A pytest (>=6.2.5) @@ -585,7 +588,7 @@ This list contains 1030 plugins. :pypi:`pytest-motor` A pytest plugin for motor, the non-blocking MongoDB driver. Jul 21, 2021 3 - Alpha pytest :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest - :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Feb 09, 2022 4 - Beta pytest + :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Apr 22, 2022 4 - Beta pytest :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Feb 28, 2022 4 - Beta pytest :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A @@ -630,7 +633,7 @@ This list contains 1030 plugins. :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Apr 12, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Operators Apr 22, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -659,7 +662,7 @@ This list contains 1030 plugins. :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) :pypi:`pytest-perf` pytest-perf Feb 05, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) - :pypi:`pytest-persistence` Pytest tool for persistent objects Apr 04, 2022 N/A N/A + :pypi:`pytest-persistence` Pytest tool for persistent objects Apr 22, 2022 N/A N/A :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 18, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Apr 15, 2022 4 - Beta pytest (>=5.4.3) @@ -688,12 +691,12 @@ This list contains 1030 plugins. :pypi:`pytest-ponyorm` PonyORM in Pytest Oct 31, 2018 N/A pytest (>=3.1.1) :pypi:`pytest-poo` Visualize your crappy tests Mar 25, 2021 5 - Production/Stable pytest (>=2.3.4) :pypi:`pytest-poo-fail` Visualize your failed tests with poo Feb 12, 2015 5 - Production/Stable N/A - :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Aug 19, 2021 5 - Production/Stable pytest + :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Apr 20, 2022 5 - Production/Stable pytest :pypi:`pytest-portion` Select a portion of the collected tests Jan 28, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) - :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 16, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) + :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 17, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 31, 2022 N/A pytest (>=3.4.1) :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Dec 28, 2021 5 - Production/Stable pytest (>=6) @@ -813,13 +816,13 @@ This list contains 1030 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Apr 13, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Apr 22, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Apr 13, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Apr 22, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -853,7 +856,7 @@ This list contains 1030 plugins. :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A - :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Feb 11, 2022 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Apr 23, 2022 4 - Beta pytest (>=3.0.0) :pypi:`pytest-snmpserver` May 12, 2021 N/A N/A :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Jan 05, 2022 4 - Beta pytest (>=6.2.0) :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Jan 23, 2022 4 - Beta pytest (>=3.6.3) @@ -870,11 +873,11 @@ This list contains 1030 plugins. :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Dec 22, 2021 6 - Mature pytest (>=6.2.4) - :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Mar 13, 2022 4 - Beta pytest (>=5,<8) + :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Apr 22, 2022 4 - Beta pytest (>=5,<8) :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Apr 13, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Apr 19, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A @@ -920,7 +923,7 @@ This list contains 1030 plugins. :pypi:`pytest-testbook` A plugin to run tests written in Jupyter notebook Dec 11, 2016 3 - Alpha N/A :pypi:`pytest-testconfig` Test configuration plugin for pytest. Jan 11, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testdirectory` A py.test plugin providing temporary directories in unit tests. Feb 21, 2022 5 - Production/Stable pytest - :pypi:`pytest-testdox` A testdox format reporter for pytest Dec 05, 2021 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-testdox` A testdox format reporter for pytest Apr 19, 2022 5 - Production/Stable pytest (>=4.6.0) :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Apr 12, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) @@ -998,10 +1001,10 @@ This list contains 1030 plugins. :pypi:`pytest-variables` pytest plugin for providing variables to tests/fixtures Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-variant` Variant support for Pytest Jun 20, 2021 N/A N/A :pypi:`pytest-vcr` Plugin for managing VCR.py cassettes Apr 26, 2019 5 - Production/Stable pytest (>=3.6.0) - :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Aug 13, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) + :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Apr 21, 2022 4 - Beta pytest (>=6.2.2,<7.0.0) :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest - :pypi:`pytest-ver` Pytest module with Verification Report Aug 30, 2021 2 - Pre-Alpha N/A + :pypi:`pytest-ver` Pytest module with Verification Report Apr 17, 2022 2 - Pre-Alpha N/A :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) :pypi:`pytest-virtualenv` Virtualenv fixture for py.test May 28, 2019 5 - Production/Stable pytest @@ -1362,7 +1365,7 @@ This list contains 1030 plugins. test Answer Set Programming programs :pypi:`pytest-assertions` - *last release*: Mar 21, 2022, + *last release*: Apr 22, 2022, *status*: N/A, *requires*: N/A @@ -1824,7 +1827,7 @@ This list contains 1030 plugins. Pytest plugin to only run tests affected by changes :pypi:`pytest-cairo` - *last release*: Apr 08, 2022, + *last release*: Apr 17, 2022, *status*: N/A, *requires*: pytest @@ -2125,7 +2128,7 @@ This list contains 1030 plugins. Base configurations and utilities for developing your Python project test suite with pytest. :pypi:`pytest-confluence-report` - *last release*: Apr 14, 2022, + *last release*: Apr 17, 2022, *status*: N/A, *requires*: N/A @@ -2230,7 +2233,7 @@ This list contains 1030 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Apr 16, 2022, + *last release*: Apr 17, 2022, *status*: N/A, *requires*: N/A @@ -2979,7 +2982,7 @@ This list contains 1030 plugins. :pypi:`pytest-durations` - *last release*: Mar 07, 2022, + *last release*: Apr 22, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.6) @@ -3707,7 +3710,7 @@ This list contains 1030 plugins. Check if requirement files are frozen :pypi:`pytest-frozen-uuids` - *last release*: Feb 14, 2022, + *last release*: Apr 17, 2022, *status*: N/A, *requires*: pytest (>=3.0) @@ -3973,7 +3976,7 @@ This list contains 1030 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Apr 15, 2022, + *last release*: Apr 21, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4154,6 +4157,13 @@ This list contains 1030 plugins. A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api + :pypi:`pytest-idem` + *last release*: Apr 20, 2022, + *status*: 5 - Production/Stable, + *requires*: N/A + + A pytest plugin to help with testing idem projects + :pypi:`pytest-idempotent` *last release*: Jan 30, 2022, *status*: N/A, @@ -4288,7 +4298,7 @@ This list contains 1030 plugins. Pytest plugin for intercepting outgoing connection requests during pytest run. :pypi:`pytest-invenio` - *last release*: Apr 04, 2022, + *last release*: Apr 22, 2022, *status*: 5 - Production/Stable, *requires*: pytest (<7,>=6) @@ -4497,6 +4507,13 @@ This list contains 1030 plugins. python-ldap fixtures for pytest + :pypi:`pytest-leak-finder` + *last release*: Apr 18, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + Find the previous test that makes another to fail + :pypi:`pytest-leaks` *last release*: Nov 27, 2019, *status*: 1 - Planning, @@ -4673,7 +4690,7 @@ This list contains 1030 plugins. Pytest Loguru :pypi:`pytest-lsp` - *last release*: Apr 02, 2022, + *last release*: Apr 18, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -4791,6 +4808,13 @@ This list contains 1030 plugins. Estimates memory consumption of test functions + :pypi:`pytest-memray` + *last release*: Apr 19, 2022, + *status*: N/A, + *requires*: N/A + + A simple plugin to use with pytest + :pypi:`pytest-menu` *last release*: Oct 04, 2017, *status*: 3 - Alpha, @@ -5023,7 +5047,7 @@ This list contains 1030 plugins. pytest plugin to collect information from tests :pypi:`pytest-mpl` - *last release*: Feb 09, 2022, + *last release*: Apr 22, 2022, *status*: 4 - Beta, *requires*: pytest @@ -5338,7 +5362,7 @@ This list contains 1030 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: Apr 12, 2022, + *last release*: Apr 22, 2022, *status*: N/A, *requires*: pytest @@ -5541,7 +5565,7 @@ This list contains 1030 plugins. A simple plugin to ensure the execution of critical sections of code has not been impacted :pypi:`pytest-persistence` - *last release*: Apr 04, 2022, + *last release*: Apr 22, 2022, *status*: N/A, *requires*: N/A @@ -5744,7 +5768,7 @@ This list contains 1030 plugins. Visualize your failed tests with poo :pypi:`pytest-pop` - *last release*: Aug 19, 2021, + *last release*: Apr 20, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -5779,7 +5803,7 @@ This list contains 1030 plugins. pytest plugin with powerful fixtures :pypi:`pytest-prefer-nested-dup-tests` - *last release*: Apr 16, 2022, + *last release*: Apr 17, 2022, *status*: 4 - Beta, *requires*: pytest (>=7.1.1,<8.0.0) @@ -6619,7 +6643,7 @@ This list contains 1030 plugins. :pypi:`pytest-sbase` - *last release*: Apr 13, 2022, + *last release*: Apr 22, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6661,7 +6685,7 @@ This list contains 1030 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Apr 13, 2022, + *last release*: Apr 22, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6899,7 +6923,7 @@ This list contains 1030 plugins. py.test plugin for Snap-CI :pypi:`pytest-snapshot` - *last release*: Feb 11, 2022, + *last release*: Apr 23, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.0.0) @@ -7018,7 +7042,7 @@ This list contains 1030 plugins. Pytest plugin for the splinter automation library :pypi:`pytest-split` - *last release*: Mar 13, 2022, + *last release*: Apr 22, 2022, *status*: 4 - Beta, *requires*: pytest (>=5,<8) @@ -7046,7 +7070,7 @@ This list contains 1030 plugins. :pypi:`pytest-splunk-addon` - *last release*: Apr 13, 2022, + *last release*: Apr 19, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7368,7 +7392,7 @@ This list contains 1030 plugins. A py.test plugin providing temporary directories in unit tests. :pypi:`pytest-testdox` - *last release*: Dec 05, 2021, + *last release*: Apr 19, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.6.0) @@ -7914,7 +7938,7 @@ This list contains 1030 plugins. Plugin for managing VCR.py cassettes :pypi:`pytest-vcr-delete-on-fail` - *last release*: Aug 13, 2021, + *last release*: Apr 21, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.2,<7.0.0) @@ -7935,7 +7959,7 @@ This list contains 1030 plugins. py.test fixture for creating a virtual environment :pypi:`pytest-ver` - *last release*: Aug 30, 2021, + *last release*: Apr 17, 2022, *status*: 2 - Pre-Alpha, *requires*: N/A From f6db7ae74900e0dbf39553ebd531b23c31d07db0 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Mon, 25 Apr 2022 17:18:33 -0700 Subject: [PATCH 222/549] Let mkdir() and mkpydir() receive PathLike names These pytester utility methods were annotated to only receive `str` names, but they naturally support os.PathLike values, as well. This makes writing some pytester calls a little nicer, such as when creating a directory based on a `.joinpath()` call. We previously needed to cast that intermediate value to a `str`. --- src/_pytest/pytester.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 359e2aebd38..4493bdb80dc 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -904,13 +904,13 @@ def syspathinsert( self._monkeypatch.syspath_prepend(str(path)) - def mkdir(self, name: str) -> Path: + def mkdir(self, name: Union[str, "os.PathLike[str]"]) -> Path: """Create a new (sub)directory.""" p = self.path / name p.mkdir() return p - def mkpydir(self, name: str) -> Path: + def mkpydir(self, name: Union[str, "os.PathLike[str]"]) -> Path: """Create a new python package. This creates a (sub)directory with an empty ``__init__.py`` file so it From e580534df00884857798e857beae1130abc74256 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 28 Apr 2022 16:30:16 +0200 Subject: [PATCH 223/549] doc: Reformat/Modernize some code (#9900) Found because I was curious what https://pypi.org/project/shed/ does with pytest. --- doc/en/example/attic.rst | 2 +- doc/en/example/markers.rst | 7 +++--- doc/en/example/parametrize.rst | 1 + doc/en/example/simple.rst | 12 ++++++---- doc/en/how-to/assert.rst | 2 +- doc/en/how-to/cache.rst | 1 - doc/en/how-to/capture-warnings.rst | 1 + doc/en/how-to/doctest.rst | 1 - doc/en/how-to/fixtures.rst | 28 ++++++++++++++---------- doc/en/how-to/logging.rst | 6 +---- doc/en/how-to/skipping.rst | 2 ++ doc/en/how-to/unittest.rst | 5 +++-- doc/en/how-to/usage.rst | 3 ++- doc/en/how-to/writing_hook_functions.rst | 6 ++--- doc/en/how-to/writing_plugins.rst | 2 +- doc/en/how-to/xunit_setup.rst | 2 +- 16 files changed, 45 insertions(+), 36 deletions(-) diff --git a/doc/en/example/attic.rst b/doc/en/example/attic.rst index 2ea87006204..2b1f2766dce 100644 --- a/doc/en/example/attic.rst +++ b/doc/en/example/attic.rst @@ -25,7 +25,7 @@ example: specifying and selecting acceptance tests self.tmpdir = request.config.mktemp(request.function.__name__, numbered=True) def run(self, *cmd): - """ called by test code to execute an acceptance test. """ + """called by test code to execute an acceptance test.""" self.tmpdir.chdir() return subprocess.check_output(cmd).decode() diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index 3226c0871e0..2260dbf423b 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -375,7 +375,7 @@ specifies via named environments: envnames = [mark.args[0] for mark in item.iter_markers(name="env")] if envnames: if item.config.getoption("-E") not in envnames: - pytest.skip("test requires env in {!r}".format(envnames)) + pytest.skip(f"test requires env in {envnames!r}") A test file using this local plugin: @@ -528,7 +528,7 @@ test function. From a conftest file we can read it like this: def pytest_runtest_setup(item): for mark in item.iter_markers(name="glob"): - print("glob args={} kwargs={}".format(mark.args, mark.kwargs)) + print(f"glob args={mark.args} kwargs={mark.kwargs}") sys.stdout.flush() Let's run this without capturing output and see what we get: @@ -558,6 +558,7 @@ for your particular platform, you could use the following plugin: # content of conftest.py # import sys + import pytest ALL = set("darwin linux win32".split()) @@ -567,7 +568,7 @@ for your particular platform, you could use the following plugin: supported_platforms = ALL.intersection(mark.name for mark in item.iter_markers()) plat = sys.platform if supported_platforms and plat not in supported_platforms: - pytest.skip("cannot run on platform {}".format(plat)) + pytest.skip(f"cannot run on platform {plat}") then tests will be skipped if they were specified for a different platform. Let's do a little test file to show how this looks like: diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index 66d72f3cc0d..24dd5ecaa38 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -663,6 +663,7 @@ as a complement to ``raises``. For example: .. code-block:: python from contextlib import contextmanager + import pytest diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index a70f3404992..ba1acdfd164 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -342,7 +342,7 @@ Example: def checkconfig(x): __tracebackhide__ = True if not hasattr(x, "config"): - pytest.fail("not configured: {}".format(x)) + pytest.fail(f"not configured: {x}") def test_something(): @@ -376,6 +376,7 @@ this to make sure unexpected exception types aren't hidden: .. code-block:: python import operator + import pytest @@ -386,7 +387,7 @@ this to make sure unexpected exception types aren't hidden: def checkconfig(x): __tracebackhide__ = operator.methodcaller("errisinstance", ConfigException) if not hasattr(x, "config"): - raise ConfigException("not configured: {}".format(x)) + raise ConfigException(f"not configured: {x}") def test_something(): @@ -565,6 +566,7 @@ an ``incremental`` marker which is to be used on classes: # content of conftest.py from typing import Dict, Tuple + import pytest # store history of failures per test class name and per index in parametrize (if parametrize used) @@ -608,7 +610,7 @@ an ``incremental`` marker which is to be used on classes: test_name = _test_failed_incremental[cls_name].get(parametrize_index, None) # if name found, test has failed for the combination of class name & test name if test_name is not None: - pytest.xfail("previous test failed ({})".format(test_name)) + pytest.xfail(f"previous test failed ({test_name})") These two hook implementations work together to abort incremental-marked @@ -802,9 +804,10 @@ case we just write some information out to a ``failures`` file: # content of conftest.py - import pytest import os.path + import pytest + @pytest.hookimpl(tryfirst=True, hookwrapper=True) def pytest_runtest_makereport(item, call): @@ -1066,6 +1069,7 @@ like ``pytest-timeout`` they must be imported explicitly and passed on to pytest # contents of app_main.py import sys + import pytest_timeout # Third party plugin if len(sys.argv) > 1 and sys.argv[1] == "--pytest": diff --git a/doc/en/how-to/assert.rst b/doc/en/how-to/assert.rst index 65f16129142..1b10c131389 100644 --- a/doc/en/how-to/assert.rst +++ b/doc/en/how-to/assert.rst @@ -238,7 +238,7 @@ file which provides an alternative explanation for ``Foo`` objects: if isinstance(left, Foo) and isinstance(right, Foo) and op == "==": return [ "Comparing Foo instances:", - " vals: {} != {}".format(left.val, right.val), + f" vals: {left.val} != {right.val}", ] now, given this test module: diff --git a/doc/en/how-to/cache.rst b/doc/en/how-to/cache.rst index e7994645dd3..529d97d53fb 100644 --- a/doc/en/how-to/cache.rst +++ b/doc/en/how-to/cache.rst @@ -199,7 +199,6 @@ across pytest invocations: # content of test_caching.py import pytest - import time def expensive_computation(): diff --git a/doc/en/how-to/capture-warnings.rst b/doc/en/how-to/capture-warnings.rst index 4a27767e528..ad5c1f3c3df 100644 --- a/doc/en/how-to/capture-warnings.rst +++ b/doc/en/how-to/capture-warnings.rst @@ -253,6 +253,7 @@ which works in a similar manner to :ref:`raises `: .. code-block:: python import warnings + import pytest diff --git a/doc/en/how-to/doctest.rst b/doc/en/how-to/doctest.rst index ce0b5a5f649..112c9305e27 100644 --- a/doc/en/how-to/doctest.rst +++ b/doc/en/how-to/doctest.rst @@ -239,7 +239,6 @@ which can then be used in your doctests directly: >>> len(a) 10 """ - pass 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. diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index 08013877455..14bf12cf982 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -398,9 +398,10 @@ access the fixture function: .. code-block:: python # content of conftest.py - import pytest import smtplib + import pytest + @pytest.fixture(scope="module") def smtp_connection(): @@ -609,10 +610,10 @@ Here's what that might look like: .. code-block:: python # content of test_emaillib.py - import pytest - from emaillib import Email, MailAdminClient + import pytest + @pytest.fixture def mail_admin(): @@ -683,10 +684,10 @@ Here's how the previous example would look using the ``addfinalizer`` method: .. code-block:: python # content of test_emaillib.py - import pytest - from emaillib import Email, MailAdminClient + import pytest + @pytest.fixture def mail_admin(): @@ -752,10 +753,10 @@ above): .. code-block:: python # content of test_emaillib.py - import pytest - from emaillib import Email, MailAdminClient + import pytest + @pytest.fixture def setup(): @@ -1030,16 +1031,17 @@ read an optional server URL from the test module which uses our fixture: .. code-block:: python # content of conftest.py - import pytest import smtplib + import pytest + @pytest.fixture(scope="module") def smtp_connection(request): server = getattr(request.module, "smtpserver", "smtp.gmail.com") smtp_connection = smtplib.SMTP(server, 587, timeout=5) yield smtp_connection - print("finalizing {} ({})".format(smtp_connection, server)) + print(f"finalizing {smtp_connection} ({server})") smtp_connection.close() We use the ``request.module`` attribute to optionally obtain an @@ -1193,15 +1195,16 @@ through the special :py:class:`request ` object: .. code-block:: python # content of conftest.py - import pytest import smtplib + import pytest + @pytest.fixture(scope="module", params=["smtp.gmail.com", "mail.python.org"]) def smtp_connection(request): smtp_connection = smtplib.SMTP(request.param, 587, timeout=5) yield smtp_connection - print("finalizing {}".format(smtp_connection)) + print(f"finalizing {smtp_connection}") smtp_connection.close() The main change is the declaration of ``params`` with @@ -1503,7 +1506,7 @@ to show the setup/teardown flow: def test_2(otherarg, modarg): - print(" RUN test2 with otherarg {} and modarg {}".format(otherarg, modarg)) + print(f" RUN test2 with otherarg {otherarg} and modarg {modarg}") Let's run the tests in verbose mode and with looking at the print-output: @@ -1604,6 +1607,7 @@ and declare its use in a test module via a ``usefixtures`` marker: # content of test_setenv.py import os + import pytest diff --git a/doc/en/how-to/logging.rst b/doc/en/how-to/logging.rst index 5a089c2fba0..87cebb8f20e 100644 --- a/doc/en/how-to/logging.rst +++ b/doc/en/how-to/logging.rst @@ -73,7 +73,6 @@ messages. This is supported by the ``caplog`` fixture: def test_foo(caplog): caplog.set_level(logging.INFO) - pass By default the level is set on the root logger, however as a convenience it is also possible to set the log level of any @@ -83,7 +82,6 @@ logger: def test_foo(caplog): caplog.set_level(logging.CRITICAL, logger="root.baz") - pass The log levels set are restored automatically at the end of the test. @@ -161,9 +159,7 @@ the records for the ``setup`` and ``call`` stages during teardown like so: x.message for x in caplog.get_records(when) if x.levelno == logging.WARNING ] if messages: - pytest.fail( - "warning messages encountered during testing: {}".format(messages) - ) + pytest.fail(f"warning messages encountered during testing: {messages}") diff --git a/doc/en/how-to/skipping.rst b/doc/en/how-to/skipping.rst index b1274dd4cb5..1fc6f5e0889 100644 --- a/doc/en/how-to/skipping.rst +++ b/doc/en/how-to/skipping.rst @@ -69,6 +69,7 @@ It is also possible to skip the whole module using .. code-block:: python import sys + import pytest if not sys.platform.startswith("win"): @@ -409,6 +410,7 @@ test instances when using parametrize: .. code-block:: python import sys + import pytest diff --git a/doc/en/how-to/unittest.rst b/doc/en/how-to/unittest.rst index bff75110778..b6393707160 100644 --- a/doc/en/how-to/unittest.rst +++ b/doc/en/how-to/unittest.rst @@ -115,6 +115,7 @@ fixture definition: # content of test_unittest_db.py import unittest + import pytest @@ -194,10 +195,10 @@ creation of a per-test temporary directory: .. code-block:: python # content of test_unittest_cleandir.py - import os - import pytest import unittest + import pytest + class MyTest(unittest.TestCase): @pytest.fixture(autouse=True) diff --git a/doc/en/how-to/usage.rst b/doc/en/how-to/usage.rst index 3522b258dce..c56bef4a6f5 100644 --- a/doc/en/how-to/usage.rst +++ b/doc/en/how-to/usage.rst @@ -183,9 +183,10 @@ You can specify additional plugins to ``pytest.main``: .. code-block:: python # content of myinvoke.py - import pytest import sys + import pytest + class MyPlugin: def pytest_sessionfinish(self): diff --git a/doc/en/how-to/writing_hook_functions.rst b/doc/en/how-to/writing_hook_functions.rst index f615fced861..da2961c9708 100644 --- a/doc/en/how-to/writing_hook_functions.rst +++ b/doc/en/how-to/writing_hook_functions.rst @@ -194,7 +194,7 @@ class or module can then be passed to the ``pluginmanager`` using the ``pytest_a .. code-block:: python def pytest_addhooks(pluginmanager): - """ This example assumes the hooks are grouped in the 'sample_hook' module. """ + """This example assumes the hooks are grouped in the 'sample_hook' module.""" from my_app.tests import sample_hook pluginmanager.add_hookspecs(sample_hook) @@ -253,14 +253,14 @@ and use pytest_addoption as follows: # default value @hookspec(firstresult=True) def pytest_config_file_default_value(): - """ Return the default value for the config file command line option. """ + """Return the default value for the config file command line option.""" # contents of myplugin.py def pytest_addhooks(pluginmanager): - """ This example assumes the hooks are grouped in the 'hooks' module. """ + """This example assumes the hooks are grouped in the 'hooks' module.""" from . import hooks pluginmanager.add_hookspecs(hooks) diff --git a/doc/en/how-to/writing_plugins.rst b/doc/en/how-to/writing_plugins.rst index b2d2b6563d6..3e43d3252b7 100644 --- a/doc/en/how-to/writing_plugins.rst +++ b/doc/en/how-to/writing_plugins.rst @@ -367,7 +367,7 @@ string value of ``Hello World!`` if we do not supply a value or ``Hello def _hello(name=None): if not name: name = request.config.getoption("name") - return "Hello {name}!".format(name=name) + return f"Hello {name}!" return _hello diff --git a/doc/en/how-to/xunit_setup.rst b/doc/en/how-to/xunit_setup.rst index 5a97b2c85f1..eb432a4053d 100644 --- a/doc/en/how-to/xunit_setup.rst +++ b/doc/en/how-to/xunit_setup.rst @@ -32,7 +32,7 @@ which will usually be called once for all the functions: .. code-block:: python def setup_module(module): - """ setup any state specific to the execution of the given module.""" + """setup any state specific to the execution of the given module.""" def teardown_module(module): From 97383d2d5d666e4d84dea3dbc0dff4a53fe071a2 Mon Sep 17 00:00:00 2001 From: johnkangw <72617548+johnkangw@users.noreply.github.com> Date: Sat, 30 Apr 2022 17:20:31 -0600 Subject: [PATCH 224/549] Mention use of re_assert for strings in approx docs --- src/_pytest/python_api.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 5fa21961924..622e5cefdd0 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -666,6 +666,11 @@ def approx(expected, rel=None, abs=None, nan_ok: bool = False) -> ApproxBase: specialised test helpers in :std:doc:`numpy:reference/routines.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 `_. + .. warning:: .. versionchanged:: 3.2 From 3444d35c540c635401f92db724d004e2a7d20920 Mon Sep 17 00:00:00 2001 From: Babak Keyvani Date: Sat, 30 Apr 2022 17:56:36 -0600 Subject: [PATCH 225/549] improve `pytest.raises` --- AUTHORS | 1 + changelog/8646.improvments.rst | 2 ++ src/_pytest/python_api.py | 7 +++++++ testing/python/raises.py | 4 ++++ 4 files changed, 14 insertions(+) create mode 100644 changelog/8646.improvments.rst diff --git a/AUTHORS b/AUTHORS index 1a8c5306f75..86a814a137b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -44,6 +44,7 @@ Aron Coyle Aron Curzon Aviral Verma Aviv Palivoda +Babak Keyvani Barney Gale Ben Gartner Ben Webb diff --git a/changelog/8646.improvments.rst b/changelog/8646.improvments.rst new file mode 100644 index 00000000000..9691c143429 --- /dev/null +++ b/changelog/8646.improvments.rst @@ -0,0 +1,2 @@ +Improve :py:func:`pytest.raises`. Previously passing an empty tuple would give a confusing +error. We now raise immediately with a more helpful message. diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 5fa21961924..410877c88eb 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -899,6 +899,13 @@ def raises( """ __tracebackhide__ = True + if expected_exception == (): + raise ValueError( + "Passing expected_exception=() is an error, because it's impossible to " + "raise an exception which is not an instance of any type. Raising exceptions " + "is already understood as failing the test, so you don't need any special " + "code to say 'this should never raise an exception'." + ) if isinstance(expected_exception, type): excepted_exceptions: Tuple[Type[E], ...] = (expected_exception,) else: diff --git a/testing/python/raises.py b/testing/python/raises.py index 112dec06cdc..e1680623aee 100644 --- a/testing/python/raises.py +++ b/testing/python/raises.py @@ -19,6 +19,10 @@ def test_raises_function(self): excinfo = pytest.raises(ValueError, int, "hello") assert "invalid literal" in str(excinfo.value) + def test_raises_does_not_allow_empty_tuple(self): + with pytest.raises(ValueError): + pytest.raises(expected_exception=()) + def test_raises_callable_no_exception(self) -> None: class A: def __call__(self): From 306b33e7550ce8db4e260d35f57b38387ebb0c37 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 1 May 2022 00:24:20 +0000 Subject: [PATCH 226/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 154 ++++++++++++++++++++----------- 1 file changed, 101 insertions(+), 53 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index bbddba7db58..e78bf13b0e3 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1033 plugins. +This list contains 1039 plugins. .. only:: not latex @@ -19,7 +19,7 @@ This list contains 1033 plugins. name summary last release status requires =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Apr 04, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Apr 26, 2022 N/A pytest (>=5.4.0) :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) @@ -53,7 +53,7 @@ This list contains 1033 plugins. :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest :pypi:`pytest-anything` Pytest fixtures to assert anything and something Feb 18, 2021 N/A N/A :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Nov 23, 2021 N/A pytest ; extra == 'test' - :pypi:`pytest-api` PyTest-API Python Web Framework built for testing purposes. May 04, 2021 N/A N/A + :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions Apr 28, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-appengine` AppEngine integration that works well with pytest-django Feb 27, 2017 N/A N/A :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A @@ -62,7 +62,7 @@ This list contains 1033 plugins. :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 4 - Beta pytest (>=4.6) :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A - :pypi:`pytest-assertions` Pytest Assertions Apr 22, 2022 N/A N/A + :pypi:`pytest-assertions` Pytest Assertions Apr 27, 2022 N/A N/A :pypi:`pytest-assertutil` pytest-assertutil May 10, 2019 N/A N/A :pypi:`pytest-assert-utils` Useful assertion utilities for use with pytest Apr 14, 2022 3 - Alpha N/A :pypi:`pytest-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) @@ -308,14 +308,14 @@ This list contains 1033 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Apr 15, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Apr 15, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Apr 15, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Apr 15, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Apr 15, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Apr 25, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Apr 25, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Apr 25, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Apr 25, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Apr 25, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Apr 15, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Apr 15, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Apr 25, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Apr 25, 2022 N/A N/A :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -354,7 +354,7 @@ This list contains 1033 plugins. :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-failed-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A :pypi:`pytest-failed-to-verify` A pytest plugin that helps better distinguishing real test failures from setup flakiness. Aug 08, 2019 5 - Production/Stable pytest (>=4.1.0) - :pypi:`pytest-fail-slow` Fail tests that take too long to run Dec 10, 2021 4 - Beta pytest (>=6.0) + :pypi:`pytest-fail-slow` Fail tests that take too long to run Apr 25, 2022 4 - Beta pytest (>=6.0) :pypi:`pytest-faker` Faker integration with the pytest framework. Dec 19, 2016 6 - Mature N/A :pypi:`pytest-falcon` Pytest helpers for Falcon. Sep 07, 2016 4 - Beta N/A :pypi:`pytest-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A @@ -388,7 +388,7 @@ This list contains 1033 plugins. :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) :pypi:`pytest-flaptastic` Flaptastic py.test plugin Mar 17, 2019 N/A N/A :pypi:`pytest-flask` A set of py.test fixtures to test Flask applications. Feb 27, 2021 5 - Production/Stable pytest (>=5.2) - :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 04, 2019 4 - Beta pytest (>=3.2.1) + :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) :pypi:`pytest-flyte` Pytest fixtures for simplifying Flyte integration testing May 03, 2021 N/A pytest :pypi:`pytest-focus` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest @@ -409,7 +409,7 @@ This list contains 1033 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Apr 13, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Apr 27, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -435,7 +435,7 @@ This list contains 1033 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Apr 21, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Apr 25, 2022 3 - Alpha pytest (==7.1.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -470,9 +470,10 @@ This list contains 1033 plugins. :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A - :pypi:`pytest-ini` Reuse pytest.ini to store env variables Sep 30, 2021 N/A N/A - :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Mar 30, 2022 5 - Production/Stable N/A + :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A + :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Apr 26, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) @@ -500,6 +501,7 @@ This list contains 1033 plugins. :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Mar 15, 2022 4 - Beta pytest (>=3.8.0) :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 24, 2021 N/A pytest :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest + :pypi:`pytest-kexi` Apr 29, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Jan 24, 2021 5 - Production/Stable N/A :pypi:`pytest-kivy` Kivy GUI tests fixtures using pytest Jul 06, 2021 4 - Beta pytest (>=3.6) :pypi:`pytest-knows` A pytest plugin that can automaticly skip test case based on dependence info calculated by trace Aug 22, 2014 N/A N/A @@ -632,6 +634,7 @@ This list contains 1033 plugins. :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jan 19, 2020 N/A N/A :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) + :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry Apr 28, 2022 N/A pytest :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-operator` Fixtures for Operators Apr 22, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A @@ -641,6 +644,7 @@ This list contains 1033 plugins. :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Mar 24, 2022 N/A N/A + :pypi:`pytest-owner` Add owner mark for tests Apr 25, 2022 N/A N/A :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A :pypi:`pytest-pahrametahrize` Parametrize your tests with a Boston accent. Nov 24, 2021 4 - Beta pytest (>=6.0,<7.0) :pypi:`pytest-parallel` a pytest plugin for parallel and concurrent testing Oct 10, 2021 3 - Alpha pytest (>=3.0.0) @@ -680,6 +684,7 @@ This list contains 1033 plugins. :pypi:`pytest-playwright` A pytest wrapper with fixtures for Playwright to automate web browsers Mar 16, 2022 N/A pytest :pypi:`pytest-playwrights` A pytest wrapper with fixtures for Playwright to automate web browsers Dec 02, 2021 N/A N/A :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A + :pypi:`pytest-playwright-visual` A pytest fixture for visual testing with Playwright Apr 28, 2022 N/A N/A :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Aug 17, 2020 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Mar 19, 2020 5 - Production/Stable pytest (>=3.50) @@ -696,7 +701,7 @@ This list contains 1033 plugins. :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) - :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 17, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) + :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 27, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 31, 2022 N/A pytest (>=3.4.1) :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Dec 28, 2021 5 - Production/Stable pytest (>=6) @@ -718,7 +723,7 @@ This list contains 1033 plugins. :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) - :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Jan 27, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-pyq` Pytest fixture "q" for pyq Mar 10, 2020 5 - Production/Stable N/A :pypi:`pytest-pyramid` pytest_pyramid - provides fixtures for testing pyramid applications with pytest test suite Oct 15, 2021 5 - Production/Stable pytest :pypi:`pytest-pyramid-server` Pyramid server fixture for py.test May 28, 2019 5 - Production/Stable pytest @@ -777,7 +782,7 @@ This list contains 1033 plugins. :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility Dec 11, 2020 3 - Alpha pytest (>=5.2) :pypi:`pytest-report-me` A pytest plugin to generate report. Dec 31, 2020 N/A pytest :pypi:`pytest-report-parameters` pytest plugin for adding tests' parameters to junit report Jun 18, 2020 3 - Alpha pytest (>=2.4.2) - :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Apr 12, 2022 N/A pytest (>=3.8.0) + :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Apr 26, 2022 N/A pytest (>=3.8.0) :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) @@ -816,14 +821,14 @@ This list contains 1033 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Apr 22, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Apr 25, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Apr 22, 2022 5 - Production/Stable N/A - :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Dec 16, 2021 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Apr 25, 2022 5 - Production/Stable N/A + :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest @@ -848,7 +853,7 @@ This list contains 1033 plugins. :pypi:`pytest-skip-markers` Pytest Salt Plugin Feb 22, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-skipper` A plugin that selects only tests with changes in execution path Mar 26, 2017 3 - Alpha pytest (>=3.0.6) :pypi:`pytest-skippy` Automatically skip tests that don't need to run! Jan 27, 2018 3 - Alpha pytest (>=2.3.4) - :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A + :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Apr 26, 2022 N/A N/A :pypi:`pytest-slack` Pytest to Slack reporting plugin Dec 15, 2020 5 - Production/Stable N/A :pypi:`pytest-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A :pypi:`pytest-smartcollect` A plugin for collecting tests that touch changed code Oct 04, 2018 N/A pytest (>=3.5.0) @@ -937,6 +942,7 @@ This list contains 1033 plugins. :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) + :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Apr 29, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Oct 08, 2021 N/A pytest (>=3.6) :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A @@ -979,9 +985,9 @@ This list contains 1033 plugins. :pypi:`pytest-trio` Pytest plugin for trio Oct 16, 2020 N/A N/A :pypi:`pytest-trytond` Pytest plugin for the Tryton server framework Feb 02, 2022 3 - Alpha pytest (>=5) :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Mar 13, 2022 N/A pytest (>=5.0.0) + :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Apr 27, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A - :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, automatically launched after your test run is finished Apr 14, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, automatically launched after your test run is finished Apr 29, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A @@ -1064,7 +1070,7 @@ This list contains 1033 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: Apr 04, 2022, + *last release*: Apr 26, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1302,11 +1308,11 @@ This list contains 1033 plugins. Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures :pypi:`pytest-api` - *last release*: May 04, 2021, + *last release*: Apr 28, 2022, *status*: N/A, - *requires*: N/A + *requires*: pytest (>=7.1.1,<8.0.0) - PyTest-API Python Web Framework built for testing purposes. + An ASGI middleware to populate OpenAPI Specification examples from pytest functions :pypi:`pytest-apistellar` *last release*: Jun 18, 2019, @@ -1365,7 +1371,7 @@ This list contains 1033 plugins. test Answer Set Programming programs :pypi:`pytest-assertions` - *last release*: Apr 22, 2022, + *last release*: Apr 27, 2022, *status*: N/A, *requires*: N/A @@ -3087,35 +3093,35 @@ This list contains 1033 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Apr 15, 2022, + *last release*: Apr 25, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Apr 15, 2022, + *last release*: Apr 25, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Apr 15, 2022, + *last release*: Apr 25, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Apr 15, 2022, + *last release*: Apr 25, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Apr 15, 2022, + *last release*: Apr 25, 2022, *status*: N/A, *requires*: N/A @@ -3129,14 +3135,14 @@ This list contains 1033 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Apr 15, 2022, + *last release*: Apr 25, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Apr 15, 2022, + *last release*: Apr 25, 2022, *status*: N/A, *requires*: N/A @@ -3409,7 +3415,7 @@ This list contains 1033 plugins. A pytest plugin that helps better distinguishing real test failures from setup flakiness. :pypi:`pytest-fail-slow` - *last release*: Dec 10, 2021, + *last release*: Apr 25, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0) @@ -3647,7 +3653,7 @@ This list contains 1033 plugins. A set of py.test fixtures to test Flask applications. :pypi:`pytest-flask-sqlalchemy` - *last release*: Apr 04, 2019, + *last release*: Apr 30, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.2.1) @@ -3794,7 +3800,7 @@ This list contains 1033 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Apr 13, 2022, + *last release*: Apr 27, 2022, *status*: N/A, *requires*: N/A @@ -3976,7 +3982,7 @@ This list contains 1033 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Apr 21, 2022, + *last release*: Apr 25, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4221,14 +4227,14 @@ This list contains 1033 plugins. pytest stack validation prior to testing executing :pypi:`pytest-ini` - *last release*: Sep 30, 2021, + *last release*: Apr 26, 2022, *status*: N/A, *requires*: N/A Reuse pytest.ini to store env variables :pypi:`pytest-inmanta` - *last release*: Mar 30, 2022, + *last release*: Apr 26, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4241,6 +4247,13 @@ This list contains 1033 plugins. Inmanta tests package + :pypi:`pytest-inmanta-lsm` + *last release*: Apr 29, 2022, + *status*: 5 - Production/Stable, + *requires*: N/A + + Common fixtures for inmanta LSM related modules + :pypi:`pytest-Inomaly` *last release*: Feb 13, 2018, *status*: 4 - Beta, @@ -4430,6 +4443,13 @@ This list contains 1033 plugins. A plugin to send pytest events to Kafka + :pypi:`pytest-kexi` + *last release*: Apr 29, 2022, + *status*: N/A, + *requires*: pytest (>=7.1.2,<8.0.0) + + + :pypi:`pytest-kind` *last release*: Jan 24, 2021, *status*: 5 - Production/Stable, @@ -5354,6 +5374,13 @@ This list contains 1033 plugins. Pytest plugin for detecting inadvertent open file handles + :pypi:`pytest-opentelemetry` + *last release*: Apr 28, 2022, + *status*: N/A, + *requires*: pytest + + A pytest plugin for instrumenting test runs via OpenTelemetry + :pypi:`pytest-opentmi` *last release*: Feb 28, 2022, *status*: 5 - Production/Stable, @@ -5417,6 +5444,13 @@ This list contains 1033 plugins. pytest-otel report OpenTelemetry traces about test executed + :pypi:`pytest-owner` + *last release*: Apr 25, 2022, + *status*: N/A, + *requires*: N/A + + Add owner mark for tests + :pypi:`pytest-pact` *last release*: Jan 07, 2019, *status*: 4 - Beta, @@ -5690,6 +5724,13 @@ This list contains 1033 plugins. A pytest wrapper for snapshot testing with playwright + :pypi:`pytest-playwright-visual` + *last release*: Apr 28, 2022, + *status*: N/A, + *requires*: N/A + + A pytest fixture for visual testing with Playwright + :pypi:`pytest-plt` *last release*: Aug 17, 2020, *status*: 5 - Production/Stable, @@ -5803,7 +5844,7 @@ This list contains 1033 plugins. pytest plugin with powerful fixtures :pypi:`pytest-prefer-nested-dup-tests` - *last release*: Apr 17, 2022, + *last release*: Apr 27, 2022, *status*: 4 - Beta, *requires*: pytest (>=7.1.1,<8.0.0) @@ -5957,7 +5998,7 @@ This list contains 1033 plugins. Core engine for cookiecutter-qa and pytest-play packages :pypi:`pytest-pyppeteer` - *last release*: Jan 27, 2022, + *last release*: Apr 28, 2022, *status*: N/A, *requires*: pytest (>=6.2.5,<7.0.0) @@ -6370,7 +6411,7 @@ This list contains 1033 plugins. pytest plugin for adding tests' parameters to junit report :pypi:`pytest-reportportal` - *last release*: Apr 12, 2022, + *last release*: Apr 26, 2022, *status*: N/A, *requires*: pytest (>=3.8.0) @@ -6643,7 +6684,7 @@ This list contains 1033 plugins. :pypi:`pytest-sbase` - *last release*: Apr 22, 2022, + *last release*: Apr 25, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6685,14 +6726,14 @@ This list contains 1033 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Apr 22, 2022, + *last release*: Apr 25, 2022, *status*: 5 - Production/Stable, *requires*: N/A A complete web automation framework for end-to-end testing. :pypi:`pytest-selenium-enhancer` - *last release*: Dec 16, 2021, + *last release*: Apr 29, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6867,7 +6908,7 @@ This list contains 1033 plugins. Automatically skip tests that don't need to run! :pypi:`pytest-skip-slow` - *last release*: Sep 28, 2021, + *last release*: Apr 26, 2022, *status*: N/A, *requires*: N/A @@ -7489,6 +7530,13 @@ This list contains 1033 plugins. pytest plugin for creating TestRail runs and adding results + :pypi:`pytest-testrail-integrator` + *last release*: Apr 29, 2022, + *status*: N/A, + *requires*: pytest (>=6.2.5) + + Pytest plugin for sending report to testrail system. + :pypi:`pytest-testrail-ns` *last release*: Oct 08, 2021, *status*: N/A, @@ -7784,7 +7832,7 @@ This list contains 1033 plugins. A simple plugin to use with tspwplib :pypi:`pytest-tst` - *last release*: Mar 13, 2022, + *last release*: Apr 27, 2022, *status*: N/A, *requires*: pytest (>=5.0.0) @@ -7798,7 +7846,7 @@ This list contains 1033 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: Apr 14, 2022, + *last release*: Apr 29, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.5) From 2ba8fd5bc50f293fea11a863c2b8c4dc3488762b Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sun, 1 May 2022 01:05:41 -0600 Subject: [PATCH 227/549] Re-export importlib.metadata from _pytest.compat (#9906) I'm fixing a bug in mypy's --no-implicit-reexport logic in https://github.com/python/mypy/pull/12704 and mypy-primer flagged this --- changelog/9906.trivial.rst | 1 + src/_pytest/compat.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelog/9906.trivial.rst diff --git a/changelog/9906.trivial.rst b/changelog/9906.trivial.rst new file mode 100644 index 00000000000..8911b7190f6 --- /dev/null +++ b/changelog/9906.trivial.rst @@ -0,0 +1 @@ +Made ``_pytest.compat`` re-export ``importlib_metadata`` in the eyes of type checkers. diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index e4c2a5fdac1..8b77de28f10 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -50,9 +50,11 @@ class NotSetType(enum.Enum): # fmt: on if sys.version_info >= (3, 8): - from importlib import metadata as importlib_metadata + import importlib.metadata + + importlib_metadata = importlib.metadata else: - import importlib_metadata # noqa: F401 + import importlib_metadata as importlib_metadata # noqa: F401 def _format_args(func: Callable[..., Any]) -> str: From f25b9f619b7e7198a67e5bcc996fccf37377930c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 May 2022 20:47:02 +0000 Subject: [PATCH 228/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v3.0.1 → v3.1.0](https://github.com/asottile/reorder_python_imports/compare/v3.0.1...v3.1.0) - [github.com/pre-commit/mirrors-mypy: v0.942 → v0.950](https://github.com/pre-commit/mirrors-mypy/compare/v0.942...v0.950) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c0fd36df3fd..30fa24ae03b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v3.0.1 + rev: v3.1.0 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] @@ -56,7 +56,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.942 + rev: v0.950 hooks: - id: mypy files: ^(src/|testing/) From 2f62e6ec9625b86c7bc79047f92ad43a1ef8f401 Mon Sep 17 00:00:00 2001 From: Peyman Salehi Date: Tue, 3 May 2022 20:56:46 +0430 Subject: [PATCH 229/549] Fix default encoding in cacheprovider --- changelog/9910.trivial.rst | 1 + src/_pytest/cacheprovider.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 changelog/9910.trivial.rst diff --git a/changelog/9910.trivial.rst b/changelog/9910.trivial.rst new file mode 100644 index 00000000000..4b1a4683c1e --- /dev/null +++ b/changelog/9910.trivial.rst @@ -0,0 +1 @@ +Fix default encoding warning (``EncodingWarning``) in ``cacheprovider`` diff --git a/src/_pytest/cacheprovider.py b/src/_pytest/cacheprovider.py index 681d02b4093..4dad599d0e3 100755 --- a/src/_pytest/cacheprovider.py +++ b/src/_pytest/cacheprovider.py @@ -157,7 +157,7 @@ def get(self, key: str, default): """ path = self._getvaluepath(key) try: - with path.open("r") as f: + with path.open("r", encoding="UTF-8") as f: return json.load(f) except (ValueError, OSError): return default @@ -184,9 +184,9 @@ def set(self, key: str, value: object) -> None: return if not cache_dir_exists_already: self._ensure_supporting_files() - data = json.dumps(value, indent=2) + data = json.dumps(value, ensure_ascii=False, indent=2) try: - f = path.open("w") + f = path.open("w", encoding="UTF-8") except OSError: self.warn("cache could not write path {path}", path=path, _ispytest=True) else: @@ -196,7 +196,7 @@ def set(self, key: str, value: object) -> None: def _ensure_supporting_files(self) -> None: """Create supporting files in the cache dir that are not really part of the cache.""" readme_path = self._cachedir / "README.md" - readme_path.write_text(README_CONTENT) + readme_path.write_text(README_CONTENT, encoding="UTF-8") gitignore_path = self._cachedir.joinpath(".gitignore") msg = "# Created by pytest automatically.\n*\n" From 5f9d68c8d93b792116fc474cb4ec3072b7baa6f1 Mon Sep 17 00:00:00 2001 From: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com> Date: Fri, 6 May 2022 19:25:44 -0400 Subject: [PATCH 230/549] Clarify precision when using NUMBER option in --doctest-modules (#9914) Fix #9892 --- doc/en/how-to/doctest.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/en/how-to/doctest.rst b/doc/en/how-to/doctest.rst index 112c9305e27..021ba274fbc 100644 --- a/doc/en/how-to/doctest.rst +++ b/doc/en/how-to/doctest.rst @@ -126,14 +126,17 @@ pytest also introduces new options: in expected doctest output. * ``NUMBER``: when enabled, floating-point numbers only need to match as far as - the precision you have written in the expected doctest output. For example, - the following output would only need to match to 2 decimal places:: + the precision you have written in the expected doctest output. The numbers are + compared using :func:`pytest.approx` with relative tolerance equal to the + precision. For example, the following output would only need to match to 2 + decimal places when comparing ``3.14`` to + ``pytest.approx(math.pi, rel=10**-2)``:: >>> math.pi 3.14 - If you wrote ``3.1416`` then the actual output would need to match to 4 - decimal places; and so on. + If you wrote ``3.1416`` then the actual output would need to match to + approximately 4 decimal places; and so on. This avoids false positives caused by limited floating-point precision, like this:: From 23c8f3d2346a70b3f1946949e0979c49e20a06df Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 8 May 2022 00:18:36 +0000 Subject: [PATCH 231/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 160 ++++++++++++++++++------------- 1 file changed, 96 insertions(+), 64 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index e78bf13b0e3..2bdd41d975a 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1039 plugins. +This list contains 1043 plugins. .. only:: not latex @@ -53,7 +53,7 @@ This list contains 1039 plugins. :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest :pypi:`pytest-anything` Pytest fixtures to assert anything and something Feb 18, 2021 N/A N/A :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Nov 23, 2021 N/A pytest ; extra == 'test' - :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions Apr 28, 2022 N/A pytest (>=7.1.1,<8.0.0) + :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 07, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-appengine` AppEngine integration that works well with pytest-django Feb 27, 2017 N/A N/A :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A @@ -71,7 +71,7 @@ This list contains 1039 plugins. :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio Mar 25, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Apr 14, 2022 N/A N/A + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. May 02, 2022 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) :pypi:`pytest-async-sqlalchemy` Database testing fixtures using the SQLAlchemy asyncio API Oct 07, 2021 4 - Beta pytest (>=6.0.0) @@ -126,14 +126,14 @@ This list contains 1039 plugins. :pypi:`pytest-builtin-types` Nov 17, 2021 N/A pytest :pypi:`pytest-bwrap` Run your tests in Bubblewrap sandboxes Oct 26, 2018 3 - Alpha N/A :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A - :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Mar 03, 2022 4 - Beta pytest (>=5.0.0) + :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data May 02, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 17, 2022 N/A pytest :pypi:`pytest-camel-collect` Enable CamelCase-aware pytest class collection Aug 02, 2020 N/A pytest (>=2.9) :pypi:`pytest-canonical-data` A plugin which allows to compare results with canonical results, based on previous runs May 08, 2020 2 - Pre-Alpha pytest (>=3.5.0) :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A :pypi:`pytest-capture-deprecatedwarnings` pytest plugin to capture all deprecatedwarnings and put them in one file Apr 30, 2019 N/A N/A - :pypi:`pytest-capture-warnings` pytest plugin to capture all warnings and put them in one file of your choice Mar 16, 2022 N/A pytest + :pypi:`pytest-capture-warnings` pytest plugin to capture all warnings and put them in one file of your choice May 03, 2022 N/A pytest :pypi:`pytest-cases` Separate test code from test cases in pytest. Mar 21, 2022 5 - Production/Stable N/A :pypi:`pytest-cassandra` Cassandra CCM Test Fixtures for pytest Nov 04, 2017 1 - Planning N/A :pypi:`pytest-catchlog` py.test plugin to catch log messages. This is a fork of pytest-capturelog. Jan 24, 2016 4 - Beta pytest (>=2.6) @@ -186,7 +186,7 @@ This list contains 1039 plugins. :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Apr 17, 2022 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types May 06, 2022 N/A N/A :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest @@ -200,6 +200,7 @@ This list contains 1039 plugins. :pypi:`pytest-custom-report` Configure the symbols displayed for test outcomes Jan 30, 2019 N/A pytest :pypi:`pytest-custom-scheduling` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 01, 2021 N/A N/A :pypi:`pytest-cython` A plugin for testing Cython extension modules Mar 26, 2022 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-cython-collect` May 04, 2022 N/A pytest :pypi:`pytest-darker` A pytest plugin for checking of modified code using Darker Aug 16, 2020 N/A pytest (>=6.0.1) ; extra == 'test' :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A @@ -209,7 +210,7 @@ This list contains 1039 plugins. :pypi:`pytest-datadir-ng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Dec 25, 2019 5 - Production/Stable pytest :pypi:`pytest-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Mar 09, 2022 N/A pytest (>=7.0.1) :pypi:`pytest-data-file` Fixture "data" and "case_data" for test from yaml file Dec 04, 2019 N/A N/A - :pypi:`pytest-datafiles` py.test plugin to create a 'tmpdir' containing predefined files/directories. Oct 07, 2018 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-datafiles` py.test plugin to create a 'tmpdir' containing predefined files/directories. May 01, 2022 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-datafixtures` Data fixtures for pytest made simple Dec 05, 2020 5 - Production/Stable N/A :pypi:`pytest-data-from-files` pytest plugin to provide data from files loaded automatically Oct 13, 2021 4 - Beta pytest :pypi:`pytest-dataplugin` A pytest plugin for managing an archive of test data. Sep 16, 2017 1 - Planning N/A @@ -247,6 +248,7 @@ This list contains 1039 plugins. :pypi:`pytest-django-casperjs` Integrate CasperJS with your django tests as a pytest fixture. Mar 15, 2015 2 - Pre-Alpha N/A :pypi:`pytest-django-dotenv` Pytest plugin used to setup environment variables with django-dotenv Nov 26, 2019 4 - Beta pytest (>=2.6.0) :pypi:`pytest-django-factories` Factories for your Django models that can be used as Pytest fixtures. Nov 12, 2020 4 - Beta N/A + :pypi:`pytest-django-filefield` Replaces FileField.storage with something you can patch globally. May 06, 2022 5 - Production/Stable pytest >= 5.2 :pypi:`pytest-django-gcir` A Django plugin for pytest. Mar 06, 2018 5 - Production/Stable N/A :pypi:`pytest-django-haystack` Cleanup your Haystack indexes between tests Sep 03, 2017 5 - Production/Stable pytest (>=2.3.4) :pypi:`pytest-django-ifactory` A model instance factory for pytest-django Feb 09, 2022 3 - Alpha N/A @@ -308,14 +310,14 @@ This list contains 1039 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Apr 25, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Apr 25, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Apr 25, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Apr 25, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Apr 25, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin May 07, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects May 07, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project May 07, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag May 07, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip May 07, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Apr 25, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Apr 25, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports May 07, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports May 07, 2022 N/A N/A :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -349,7 +351,7 @@ This list contains 1039 plugins. :pypi:`pytest-extra-durations` A pytest plugin to get durations on a per-function basis and per module basis. Apr 21, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-fabric` Provides test utilities to run fabric task tests by using docker containers Sep 12, 2018 5 - Production/Stable N/A :pypi:`pytest-factory` Use factories for test setup with py.test Sep 06, 2020 3 - Alpha pytest (>4.3) - :pypi:`pytest-factoryboy` Factory Boy support for pytest. Dec 30, 2020 6 - Mature pytest (>=4.6) + :pypi:`pytest-factoryboy` Factory Boy support for pytest. May 02, 2022 6 - Mature pytest (>=5.0.0) :pypi:`pytest-factoryboy-fixtures` Generates pytest fixtures that allow the use of type hinting Jun 25, 2020 N/A N/A :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-failed-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A @@ -409,7 +411,7 @@ This list contains 1039 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Apr 27, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. May 04, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -435,7 +437,7 @@ This list contains 1039 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Apr 25, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components May 07, 2022 3 - Alpha pytest (==7.1.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -461,7 +463,7 @@ This list contains 1039 plugins. :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jan 14, 2022 4 - Beta pytest :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A - :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Apr 20, 2022 5 - Production/Stable N/A + :pypi:`pytest-idem` A pytest plugin to help with testing idem projects May 04, 2022 5 - Production/Stable N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 30, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A :pypi:`pytest-image-diff` Mar 17, 2022 3 - Alpha pytest @@ -482,7 +484,7 @@ This list contains 1039 plugins. :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) - :pypi:`pytest-invenio` Pytest fixtures for Invenio. Apr 22, 2022 5 - Production/Stable pytest (<7,>=6) + :pypi:`pytest-invenio` Pytest fixtures for Invenio. May 05, 2022 5 - Production/Stable pytest (<7,>=6) :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A @@ -527,7 +529,7 @@ This list contains 1039 plugins. :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) :pypi:`pytest-live` Live results for pytest Mar 08, 2020 N/A pytest :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Aug 25, 2021 5 - Production/Stable pytest - :pypi:`pytest-localserver` py.test plugin to test server connections locally. Dec 13, 2021 4 - Beta N/A + :pypi:`pytest-localserver` py.test plugin to test server connections locally. May 05, 2022 4 - Beta N/A :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Aug 22, 2019 4 - Beta pytest (>=3.3.0) :pypi:`pytest-lockable` lockable resource plugin for pytest Feb 28, 2022 5 - Production/Stable pytest :pypi:`pytest-locker` Used to lock object during testing. Essentially changing assertions from being hard coded to asserting that nothing changed Oct 29, 2021 N/A pytest (>=5.4) @@ -559,7 +561,7 @@ This list contains 1039 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest Apr 19, 2022 N/A N/A :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Jan 05, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution May 03, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Feb 07, 2022 5 - Production/Stable N/A :pypi:`pytest-metadata` pytest plugin for test session metadata Mar 26, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest @@ -634,9 +636,9 @@ This list contains 1039 plugins. :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jan 19, 2020 N/A N/A :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) - :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry Apr 28, 2022 N/A pytest + :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Apr 22, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Operators May 04, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -709,7 +711,7 @@ This list contains 1039 plugins. :pypi:`pytest-profiling` Profiling plugin for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-progress` pytest plugin for instant test progress status Jan 31, 2022 5 - Production/Stable N/A :pypi:`pytest-prometheus` Report test pass / failures to a Prometheus PushGateway Oct 03, 2017 N/A N/A - :pypi:`pytest-prometheus-pushgateway` Pytest report plugin for Zulip Feb 23, 2022 5 - Production/Stable pytest + :pypi:`pytest-prometheus-pushgateway` Pytest report plugin for Zulip May 05, 2022 5 - Production/Stable pytest :pypi:`pytest-prosper` Test helpers for Prosper projects Sep 24, 2018 N/A N/A :pypi:`pytest-pspec` A rspec format reporter for Python ptest Jun 02, 2020 4 - Beta pytest (>=3.0.0) :pypi:`pytest-psqlgraph` pytest plugin for testing applications that use psqlgraph Oct 19, 2021 4 - Beta pytest (>=6.0) @@ -743,7 +745,7 @@ This list contains 1039 plugins. :pypi:`pytest-rabbitmq` RabbitMQ process and client fixtures for pytest Feb 11, 2022 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-race` Race conditions tester for pytest Nov 21, 2016 4 - Beta N/A :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A - :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results Feb 04, 2022 N/A pytest (>=3.6) + :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results May 02, 2022 N/A pytest (>=3.6) :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Apr 12, 2022 5 - Production/Stable pytest :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) :pypi:`pytest-raisesregexp` Simple pytest plugin to look for regex in Exceptions Dec 18, 2015 N/A N/A @@ -807,7 +809,7 @@ This list contains 1039 plugins. :pypi:`pytest-rotest` Pytest integration with rotest Sep 08, 2019 N/A pytest (>=3.5.0) :pypi:`pytest-rpc` Extend py.test for RPC OpenStack testing. Feb 22, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-rst` Test code from RST documents with pytest Sep 21, 2021 N/A pytest - :pypi:`pytest-rt` pytest data collector plugin for Testgr Dec 22, 2021 N/A N/A + :pypi:`pytest-rt` pytest data collector plugin for Testgr May 05, 2022 N/A N/A :pypi:`pytest-rts` Coverage-based regression test selection (RTS) plugin for pytest May 17, 2021 N/A pytest :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A @@ -821,13 +823,13 @@ This list contains 1039 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Apr 25, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. May 02, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Apr 25, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. May 02, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -858,6 +860,7 @@ This list contains 1039 plugins. :pypi:`pytest-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A :pypi:`pytest-smartcollect` A plugin for collecting tests that touch changed code Oct 04, 2018 N/A pytest (>=3.5.0) :pypi:`pytest-smartcov` Smart coverage plugin for pytest. Sep 30, 2017 3 - Alpha N/A + :pypi:`pytest-smell` Automated bad smell detection tool for Pytest May 02, 2022 N/A N/A :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A @@ -942,11 +945,12 @@ This list contains 1039 plugins. :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) - :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Apr 29, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. May 05, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Oct 08, 2021 N/A pytest (>=3.6) :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A :pypi:`pytest-testreport` Nov 12, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-testreport-new` May 05, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) :pypi:`pytest-test-utils` Dec 14, 2021 N/A pytest (>=5) @@ -987,7 +991,7 @@ This list contains 1039 plugins. :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Apr 27, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A - :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, automatically launched after your test run is finished Apr 29, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, automatically launched after your test run is finished May 02, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A @@ -1043,7 +1047,7 @@ This list contains 1039 plugins. :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Jul 28, 2021 4 - Beta pytest (>=2.8) :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) - :pypi:`pytest-xray-server` Oct 27, 2021 3 - Alpha pytest (>=5.3.1) + :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) :pypi:`pytest-xvfb` A pytest plugin to run Xvfb for tests. Jun 09, 2020 4 - Beta pytest (>=2.8.1) :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) @@ -1056,7 +1060,7 @@ This list contains 1039 plugins. :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Apr 15, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) - :pypi:`pytest-zulip` Pytest report plugin for Zulip Mar 04, 2022 5 - Production/Stable pytest + :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ .. only:: latex @@ -1308,7 +1312,7 @@ This list contains 1039 plugins. Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures :pypi:`pytest-api` - *last release*: Apr 28, 2022, + *last release*: May 07, 2022, *status*: N/A, *requires*: pytest (>=7.1.1,<8.0.0) @@ -1434,7 +1438,7 @@ This list contains 1039 plugins. Pytest support for asyncio :pypi:`pytest-asyncio-cooperative` - *last release*: Apr 14, 2022, + *last release*: May 02, 2022, *status*: N/A, *requires*: N/A @@ -1819,7 +1823,7 @@ This list contains 1039 plugins. pytest plugin with mechanisms for caching across test runs :pypi:`pytest-cache-assert` - *last release*: Mar 03, 2022, + *last release*: May 02, 2022, *status*: 4 - Beta, *requires*: pytest (>=5.0.0) @@ -1868,7 +1872,7 @@ This list contains 1039 plugins. pytest plugin to capture all deprecatedwarnings and put them in one file :pypi:`pytest-capture-warnings` - *last release*: Mar 16, 2022, + *last release*: May 03, 2022, *status*: N/A, *requires*: pytest @@ -2239,7 +2243,7 @@ This list contains 1039 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Apr 17, 2022, + *last release*: May 06, 2022, *status*: N/A, *requires*: N/A @@ -2336,6 +2340,13 @@ This list contains 1039 plugins. A plugin for testing Cython extension modules + :pypi:`pytest-cython-collect` + *last release*: May 04, 2022, + *status*: N/A, + *requires*: pytest + + + :pypi:`pytest-darker` *last release*: Aug 16, 2020, *status*: N/A, @@ -2400,7 +2411,7 @@ This list contains 1039 plugins. Fixture "data" and "case_data" for test from yaml file :pypi:`pytest-datafiles` - *last release*: Oct 07, 2018, + *last release*: May 01, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=3.6) @@ -2665,6 +2676,13 @@ This list contains 1039 plugins. Factories for your Django models that can be used as Pytest fixtures. + :pypi:`pytest-django-filefield` + *last release*: May 06, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest >= 5.2 + + Replaces FileField.storage with something you can patch globally. + :pypi:`pytest-django-gcir` *last release*: Mar 06, 2018, *status*: 5 - Production/Stable, @@ -3093,35 +3111,35 @@ This list contains 1039 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Apr 25, 2022, + *last release*: May 07, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Apr 25, 2022, + *last release*: May 07, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Apr 25, 2022, + *last release*: May 07, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Apr 25, 2022, + *last release*: May 07, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Apr 25, 2022, + *last release*: May 07, 2022, *status*: N/A, *requires*: N/A @@ -3135,14 +3153,14 @@ This list contains 1039 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Apr 25, 2022, + *last release*: May 07, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Apr 25, 2022, + *last release*: May 07, 2022, *status*: N/A, *requires*: N/A @@ -3380,9 +3398,9 @@ This list contains 1039 plugins. Use factories for test setup with py.test :pypi:`pytest-factoryboy` - *last release*: Dec 30, 2020, + *last release*: May 02, 2022, *status*: 6 - Mature, - *requires*: pytest (>=4.6) + *requires*: pytest (>=5.0.0) Factory Boy support for pytest. @@ -3800,7 +3818,7 @@ This list contains 1039 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Apr 27, 2022, + *last release*: May 04, 2022, *status*: N/A, *requires*: N/A @@ -3982,7 +4000,7 @@ This list contains 1039 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Apr 25, 2022, + *last release*: May 07, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4164,7 +4182,7 @@ This list contains 1039 plugins. A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api :pypi:`pytest-idem` - *last release*: Apr 20, 2022, + *last release*: May 04, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4311,7 +4329,7 @@ This list contains 1039 plugins. Pytest plugin for intercepting outgoing connection requests during pytest run. :pypi:`pytest-invenio` - *last release*: Apr 22, 2022, + *last release*: May 05, 2022, *status*: 5 - Production/Stable, *requires*: pytest (<7,>=6) @@ -4626,7 +4644,7 @@ This list contains 1039 plugins. A PyTest plugin which provides an FTP fixture for your tests :pypi:`pytest-localserver` - *last release*: Dec 13, 2021, + *last release*: May 05, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4850,7 +4868,7 @@ This list contains 1039 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-message` - *last release*: Jan 05, 2022, + *last release*: May 03, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) @@ -5375,7 +5393,7 @@ This list contains 1039 plugins. Pytest plugin for detecting inadvertent open file handles :pypi:`pytest-opentelemetry` - *last release*: Apr 28, 2022, + *last release*: May 03, 2022, *status*: N/A, *requires*: pytest @@ -5389,7 +5407,7 @@ This list contains 1039 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: Apr 22, 2022, + *last release*: May 04, 2022, *status*: N/A, *requires*: pytest @@ -5900,7 +5918,7 @@ This list contains 1039 plugins. Report test pass / failures to a Prometheus PushGateway :pypi:`pytest-prometheus-pushgateway` - *last release*: Feb 23, 2022, + *last release*: May 05, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6138,7 +6156,7 @@ This list contains 1039 plugins. pytest plugin to implement PEP712 :pypi:`pytest-rail` - *last release*: Feb 04, 2022, + *last release*: May 02, 2022, *status*: N/A, *requires*: pytest (>=3.6) @@ -6586,7 +6604,7 @@ This list contains 1039 plugins. Test code from RST documents with pytest :pypi:`pytest-rt` - *last release*: Dec 22, 2021, + *last release*: May 05, 2022, *status*: N/A, *requires*: N/A @@ -6684,7 +6702,7 @@ This list contains 1039 plugins. :pypi:`pytest-sbase` - *last release*: Apr 25, 2022, + *last release*: May 02, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6726,7 +6744,7 @@ This list contains 1039 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Apr 25, 2022, + *last release*: May 02, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6942,6 +6960,13 @@ This list contains 1039 plugins. Smart coverage plugin for pytest. + :pypi:`pytest-smell` + *last release*: May 02, 2022, + *status*: N/A, + *requires*: N/A + + Automated bad smell detection tool for Pytest + :pypi:`pytest-smtp` *last release*: Feb 20, 2021, *status*: N/A, @@ -7531,7 +7556,7 @@ This list contains 1039 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-testrail-integrator` - *last release*: Apr 29, 2022, + *last release*: May 05, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) @@ -7565,6 +7590,13 @@ This list contains 1039 plugins. + :pypi:`pytest-testreport-new` + *last release*: May 05, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + + :pypi:`pytest-testslide` *last release*: Jan 07, 2021, *status*: 5 - Production/Stable, @@ -7846,7 +7878,7 @@ This list contains 1039 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: Apr 29, 2022, + *last release*: May 02, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.5) @@ -8238,7 +8270,7 @@ This list contains 1039 plugins. :pypi:`pytest-xray-server` - *last release*: Oct 27, 2021, + *last release*: May 03, 2022, *status*: 3 - Alpha, *requires*: pytest (>=5.3.1) @@ -8329,7 +8361,7 @@ This list contains 1039 plugins. Extend py.test for RPC OpenStack testing. :pypi:`pytest-zulip` - *last release*: Mar 04, 2022, + *last release*: May 07, 2022, *status*: 5 - Production/Stable, *requires*: pytest From 644a81af37af40539aab436814ba6604b5bd5047 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 9 May 2022 12:52:57 +0300 Subject: [PATCH 232/549] testing: fix Path.rglob("") failures in Python 3.11b1 Fix #9930. --- testing/test_conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test_conftest.py b/testing/test_conftest.py index 68048204581..d2bf860c6fe 100644 --- a/testing/test_conftest.py +++ b/testing/test_conftest.py @@ -553,7 +553,7 @@ def test_no_conftest(fxtr): ) ) print("created directory structure:") - for x in pytester.path.rglob(""): + for x in pytester.path.glob("**/"): print(" " + str(x.relative_to(pytester.path))) return {"runner": runner, "package": package, "swc": swc, "snc": snc} From 31a9c5c66709609f8adfa81a9e3e4bf1147e0369 Mon Sep 17 00:00:00 2001 From: Babak Keyvani Date: Mon, 9 May 2022 21:15:02 -0400 Subject: [PATCH 233/549] improve `pytest.raises` - cont'd a few more iterations on error message and related tests. --- src/_pytest/python_api.py | 9 ++++----- testing/python/raises.py | 6 +++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 410877c88eb..bef9ec47bac 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -899,12 +899,11 @@ def raises( """ __tracebackhide__ = True - if expected_exception == (): + if not expected_exception: raise ValueError( - "Passing expected_exception=() is an error, because it's impossible to " - "raise an exception which is not an instance of any type. Raising exceptions " - "is already understood as failing the test, so you don't need any special " - "code to say 'this should never raise an exception'." + f"Expected an exception type or a tuple of exception types, but got `{expected_exception!r}`. " + f"Raising exceptions is already understood as failing the test, so you don't need " + f"any special code to say 'this should never raise an exception'." ) if isinstance(expected_exception, type): excepted_exceptions: Tuple[Type[E], ...] = (expected_exception,) diff --git a/testing/python/raises.py b/testing/python/raises.py index e1680623aee..b3fa0fc0e99 100644 --- a/testing/python/raises.py +++ b/testing/python/raises.py @@ -19,8 +19,12 @@ def test_raises_function(self): excinfo = pytest.raises(ValueError, int, "hello") assert "invalid literal" in str(excinfo.value) + def test_raises_does_not_allow_none(self): + with pytest.raises(ValueError, match="Expected an exception type or"): + pytest.raises(expected_exception=None) + def test_raises_does_not_allow_empty_tuple(self): - with pytest.raises(ValueError): + with pytest.raises(ValueError, match="Expected an exception type or"): pytest.raises(expected_exception=()) def test_raises_callable_no_exception(self) -> None: From a4a8763ebf882a8cf16433fcacbf58c9c88c4aa8 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Tue, 10 May 2022 16:27:21 +0200 Subject: [PATCH 234/549] Consistently add **Tutorial**: in front of how-to links in reference Up to now, some had the prefix, some didn't. I think it's good to have this prefix to give more context, otherwise the links sometimes blend into the description. In one case, the link goes to an example, so I used `**Example**:` there. --- doc/en/reference/reference.rst | 54 +++++++++++++++++----------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 167c8fed9a3..38ee93e044f 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -92,7 +92,7 @@ pytest.param pytest.raises ~~~~~~~~~~~~~ -**Tutorial**: :ref:`assertraises`. +**Tutorial**: :ref:`assertraises` .. autofunction:: pytest.raises(expected_exception: Exception [, *, match]) :with: excinfo @@ -100,7 +100,7 @@ pytest.raises pytest.deprecated_call ~~~~~~~~~~~~~~~~~~~~~~ -**Tutorial**: :ref:`ensuring_function_triggers`. +**Tutorial**: :ref:`ensuring_function_triggers` .. autofunction:: pytest.deprecated_call() :with: @@ -108,7 +108,7 @@ pytest.deprecated_call pytest.register_assert_rewrite ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -**Tutorial**: :ref:`assertion-rewriting`. +**Tutorial**: :ref:`assertion-rewriting` .. autofunction:: pytest.register_assert_rewrite @@ -123,7 +123,7 @@ pytest.warns pytest.freeze_includes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -**Tutorial**: :ref:`freezing-pytest`. +**Tutorial**: :ref:`freezing-pytest` .. autofunction:: pytest.freeze_includes @@ -143,7 +143,7 @@ fixtures or plugins. pytest.mark.filterwarnings ~~~~~~~~~~~~~~~~~~~~~~~~~~ -**Tutorial**: :ref:`filterwarnings`. +**Tutorial**: :ref:`filterwarnings` Add warning filters to marked test items. @@ -169,7 +169,7 @@ Add warning filters to marked test items. pytest.mark.parametrize ~~~~~~~~~~~~~~~~~~~~~~~ -:ref:`parametrize`. +**Tutorial**: :ref:`parametrize` This mark has the same signature as :py:meth:`pytest.Metafunc.parametrize`; see there. @@ -179,7 +179,7 @@ This mark has the same signature as :py:meth:`pytest.Metafunc.parametrize`; see pytest.mark.skip ~~~~~~~~~~~~~~~~ -:ref:`skip`. +**Tutorial**: :ref:`skip` Unconditionally skip a test function. @@ -193,7 +193,7 @@ Unconditionally skip a test function. pytest.mark.skipif ~~~~~~~~~~~~~~~~~~ -:ref:`skipif`. +**Tutorial**: :ref:`skipif` Skip a test function if a condition is ``True``. @@ -209,7 +209,7 @@ Skip a test function if a condition is ``True``. pytest.mark.usefixtures ~~~~~~~~~~~~~~~~~~~~~~~ -**Tutorial**: :ref:`usefixtures`. +**Tutorial**: :ref:`usefixtures` Mark a test function as using the given fixture names. @@ -231,7 +231,7 @@ Mark a test function as using the given fixture names. pytest.mark.xfail ~~~~~~~~~~~~~~~~~~ -**Tutorial**: :ref:`xfail`. +**Tutorial**: :ref:`xfail` Marks a test function as *expected to fail*. @@ -297,7 +297,7 @@ When :meth:`Node.iter_markers <_pytest.nodes.Node.iter_markers>` or :meth:`Node. Fixtures -------- -**Tutorial**: :ref:`fixture`. +**Tutorial**: :ref:`fixture` Fixtures are requested by test functions or other fixtures by declaring them as argument names. @@ -338,7 +338,7 @@ For more details, consult the full :ref:`fixtures docs `. config.cache ~~~~~~~~~~~~ -**Tutorial**: :ref:`cache`. +**Tutorial**: :ref:`cache` The ``config.cache`` object allows other plugins and fixtures to store and retrieve values across test runs. To access it from fixtures @@ -358,7 +358,7 @@ Under the hood, the cache plugin uses the simple capsys ~~~~~~ -:ref:`captures`. +**Tutorial**: :ref:`captures` .. autofunction:: _pytest.capture.capsys() :no-auto-options: @@ -383,7 +383,7 @@ capsys capsysbinary ~~~~~~~~~~~~ -:ref:`captures`. +**Tutorial**: :ref:`captures` .. autofunction:: _pytest.capture.capsysbinary() :no-auto-options: @@ -405,7 +405,7 @@ capsysbinary capfd ~~~~~~ -:ref:`captures`. +**Tutorial**: :ref:`captures` .. autofunction:: _pytest.capture.capfd() :no-auto-options: @@ -427,7 +427,7 @@ capfd capfdbinary ~~~~~~~~~~~~ -:ref:`captures`. +**Tutorial**: :ref:`captures` .. autofunction:: _pytest.capture.capfdbinary() :no-auto-options: @@ -449,7 +449,7 @@ capfdbinary doctest_namespace ~~~~~~~~~~~~~~~~~ -:ref:`doctest`. +**Tutorial**: :ref:`doctest` .. autofunction:: _pytest.doctest.doctest_namespace() @@ -469,7 +469,7 @@ doctest_namespace request ~~~~~~~ -:ref:`request example`. +**Example**: :ref:`request example` The ``request`` fixture is a special fixture providing information of the requesting test function. @@ -490,7 +490,7 @@ pytestconfig record_property ~~~~~~~~~~~~~~~~~~~ -**Tutorial**: :ref:`record_property example`. +**Tutorial**: :ref:`record_property example` .. autofunction:: _pytest.junitxml.record_property() @@ -500,7 +500,7 @@ record_property record_testsuite_property ~~~~~~~~~~~~~~~~~~~~~~~~~ -**Tutorial**: :ref:`record_testsuite_property example`. +**Tutorial**: :ref:`record_testsuite_property example` .. autofunction:: _pytest.junitxml.record_testsuite_property() @@ -510,7 +510,7 @@ record_testsuite_property caplog ~~~~~~ -:ref:`logging`. +**Tutorial**: :ref:`logging` .. autofunction:: _pytest.logging.caplog() :no-auto-options: @@ -526,7 +526,7 @@ caplog monkeypatch ~~~~~~~~~~~ -:ref:`monkeypatching`. +**Tutorial**: :ref:`monkeypatching` .. autofunction:: _pytest.monkeypatch.monkeypatch() :no-auto-options: @@ -612,7 +612,7 @@ Each recorded warning is an instance of :class:`warnings.WarningMessage`. tmp_path ~~~~~~~~ -:ref:`tmp_path` +**Tutorial**: :ref:`tmp_path` .. autofunction:: _pytest.tmpdir.tmp_path() :no-auto-options: @@ -623,7 +623,7 @@ tmp_path tmp_path_factory ~~~~~~~~~~~~~~~~ -:ref:`tmp_path_factory example` +**Tutorial**: :ref:`tmp_path_factory example` .. _`tmp_path_factory factory api`: @@ -638,7 +638,7 @@ tmp_path_factory tmpdir ~~~~~~ -:ref:`tmpdir and tmpdir_factory` +**Tutorial**: :ref:`tmpdir and tmpdir_factory` .. autofunction:: _pytest.legacypath.LegacyTmpdirPlugin.tmpdir() :no-auto-options: @@ -649,7 +649,7 @@ tmpdir tmpdir_factory ~~~~~~~~~~~~~~ -:ref:`tmpdir and tmpdir_factory` +**Tutorial**: :ref:`tmpdir and tmpdir_factory` ``tmpdir_factory`` is an instance of :class:`~pytest.TempdirFactory`: @@ -662,7 +662,7 @@ tmpdir_factory Hooks ----- -:ref:`writing-plugins`. +**Tutorial**: :ref:`writing-plugins` .. currentmodule:: _pytest.hookspec From 231e2206352233028fc38a01ab47c42e231b1449 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Tue, 10 May 2022 17:46:25 +0200 Subject: [PATCH 235/549] Move documentation contents from reference.rst to docstrings It's better to have the documentation in one place, instead of having some in the docstring and some additional information added to the reference documentation in `reference.rst`. --- doc/en/reference/reference.rst | 62 ---------------------------------- src/_pytest/capture.py | 53 ++++++++++++++++++++++++++--- src/_pytest/doctest.py | 13 ++++++- src/_pytest/recwarn.py | 7 ++++ 4 files changed, 68 insertions(+), 67 deletions(-) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 38ee93e044f..d082697258c 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -363,17 +363,6 @@ capsys .. autofunction:: _pytest.capture.capsys() :no-auto-options: - Returns an instance of :class:`CaptureFixture[str] `. - - Example: - - .. code-block:: python - - def test_output(capsys): - print("hello") - captured = capsys.readouterr() - assert captured.out == "hello\n" - .. autoclass:: pytest.CaptureFixture() :members: @@ -388,18 +377,6 @@ capsysbinary .. autofunction:: _pytest.capture.capsysbinary() :no-auto-options: - Returns an instance of :class:`CaptureFixture[bytes] `. - - Example: - - .. code-block:: python - - def test_output(capsysbinary): - print("hello") - captured = capsysbinary.readouterr() - assert captured.out == b"hello\n" - - .. fixture:: capfd capfd @@ -410,18 +387,6 @@ capfd .. autofunction:: _pytest.capture.capfd() :no-auto-options: - Returns an instance of :class:`CaptureFixture[str] `. - - Example: - - .. code-block:: python - - def test_system_echo(capfd): - os.system('echo "hello"') - captured = capfd.readouterr() - assert captured.out == "hello\n" - - .. fixture:: capfdbinary capfdbinary @@ -432,17 +397,6 @@ capfdbinary .. autofunction:: _pytest.capture.capfdbinary() :no-auto-options: - Returns an instance of :class:`CaptureFixture[bytes] `. - - Example: - - .. code-block:: python - - def test_system_echo(capfdbinary): - os.system('echo "hello"') - captured = capfdbinary.readouterr() - assert captured.out == b"hello\n" - .. fixture:: doctest_namespace @@ -453,16 +407,6 @@ doctest_namespace .. autofunction:: _pytest.doctest.doctest_namespace() - Usually this fixture is used in conjunction with another ``autouse`` fixture: - - .. code-block:: python - - @pytest.fixture(autouse=True) - def add_np(doctest_namespace): - doctest_namespace["np"] = numpy - - For more details: :ref:`doctest_namespace`. - .. fixture:: request @@ -600,12 +544,6 @@ recwarn .. autoclass:: pytest.WarningsRecorder() :members: -Each recorded warning is an instance of :class:`warnings.WarningMessage`. - -.. note:: - ``DeprecationWarning`` and ``PendingDeprecationWarning`` are treated - differently; see :ref:`ensuring_function_triggers`. - .. fixture:: tmp_path diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index ee9de373325..2a3c4143be4 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -876,11 +876,22 @@ def disabled(self) -> Generator[None, None, None]: @fixture def capsys(request: SubRequest) -> Generator[CaptureFixture[str], None, None]: - """Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``. + r"""Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``. The captured output is made available via ``capsys.readouterr()`` method calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``text`` objects. + + Returns an instance of :class:`CaptureFixture[str] `. + + Example: + + .. code-block:: python + + def test_output(capsys): + print("hello") + captured = capsys.readouterr() + assert captured.out == "hello\n" """ capman = request.config.pluginmanager.getplugin("capturemanager") capture_fixture = CaptureFixture[str](SysCapture, request, _ispytest=True) @@ -893,11 +904,22 @@ def capsys(request: SubRequest) -> Generator[CaptureFixture[str], None, None]: @fixture def capsysbinary(request: SubRequest) -> Generator[CaptureFixture[bytes], None, None]: - """Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``. + r"""Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``. The captured output is made available via ``capsysbinary.readouterr()`` method calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``bytes`` objects. + + Returns an instance of :class:`CaptureFixture[bytes] `. + + Example: + + .. code-block:: python + + def test_output(capsysbinary): + print("hello") + captured = capsysbinary.readouterr() + assert captured.out == b"hello\n" """ capman = request.config.pluginmanager.getplugin("capturemanager") capture_fixture = CaptureFixture[bytes](SysCaptureBinary, request, _ispytest=True) @@ -910,11 +932,22 @@ def capsysbinary(request: SubRequest) -> Generator[CaptureFixture[bytes], None, @fixture def capfd(request: SubRequest) -> Generator[CaptureFixture[str], None, None]: - """Enable text capturing of writes to file descriptors ``1`` and ``2``. + r"""Enable text capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``text`` objects. + + Returns an instance of :class:`CaptureFixture[str] `. + + Example: + + .. code-block:: python + + def test_system_echo(capfd): + os.system('echo "hello"') + captured = capfd.readouterr() + assert captured.out == "hello\n" """ capman = request.config.pluginmanager.getplugin("capturemanager") capture_fixture = CaptureFixture[str](FDCapture, request, _ispytest=True) @@ -927,11 +960,23 @@ def capfd(request: SubRequest) -> Generator[CaptureFixture[str], None, None]: @fixture def capfdbinary(request: SubRequest) -> Generator[CaptureFixture[bytes], None, None]: - """Enable bytes capturing of writes to file descriptors ``1`` and ``2``. + r"""Enable bytes capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``byte`` objects. + + Returns an instance of :class:`CaptureFixture[bytes] `. + + Example: + + .. code-block:: python + + def test_system_echo(capfdbinary): + os.system('echo "hello"') + captured = capfdbinary.readouterr() + assert captured.out == b"hello\n" + """ capman = request.config.pluginmanager.getplugin("capturemanager") capture_fixture = CaptureFixture[bytes](FDCaptureBinary, request, _ispytest=True) diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py index 7d37be2acc0..aa071cde883 100644 --- a/src/_pytest/doctest.py +++ b/src/_pytest/doctest.py @@ -730,5 +730,16 @@ def _get_report_choice(key: str) -> int: @pytest.fixture(scope="session") def doctest_namespace() -> Dict[str, Any]: """Fixture that returns a :py:class:`dict` that will be injected into the - namespace of doctests.""" + namespace of doctests. + + Usually this fixture is used in conjunction with another ``autouse`` fixture: + + .. code-block:: python + + @pytest.fixture(autouse=True) + def add_np(doctest_namespace): + doctest_namespace["np"] = numpy + + For more details: :ref:`doctest_namespace`. + """ return dict() diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index 49e1de2827f..9c6e7e91daf 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -160,7 +160,14 @@ def warns( class WarningsRecorder(warnings.catch_warnings): """A context manager to record raised warnings. + Each recorded warning is an instance of :class:`warnings.WarningMessage`. + Adapted from `warnings.catch_warnings`. + + .. note:: + ``DeprecationWarning`` and ``PendingDeprecationWarning`` are treated + differently; see :ref:`ensuring_function_triggers`. + """ def __init__(self, *, _ispytest: bool = False) -> None: From 29462b1277fdae847b0527cf8e05a40c69810d39 Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Tue, 10 May 2022 23:24:13 -0700 Subject: [PATCH 236/549] type-ignore in error-message test --- testing/python/raises.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testing/python/raises.py b/testing/python/raises.py index b3fa0fc0e99..f1f6ece4ee0 100644 --- a/testing/python/raises.py +++ b/testing/python/raises.py @@ -21,7 +21,9 @@ def test_raises_function(self): def test_raises_does_not_allow_none(self): with pytest.raises(ValueError, match="Expected an exception type or"): - pytest.raises(expected_exception=None) + # We're testing that this invalid usage gives a helpful error, + # so we can ignore Mypy telling us that None is invalid. + pytest.raises(expected_exception=None) # type: ignore def test_raises_does_not_allow_empty_tuple(self): with pytest.raises(ValueError, match="Expected an exception type or"): From 58af76122fe26a02f7cc3dd8178615b2c575e15c Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Tue, 10 May 2022 23:27:06 -0700 Subject: [PATCH 237/549] Move changelog file --- changelog/{8646.improvments.rst => 8646.improvment.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog/{8646.improvments.rst => 8646.improvment.rst} (100%) diff --git a/changelog/8646.improvments.rst b/changelog/8646.improvment.rst similarity index 100% rename from changelog/8646.improvments.rst rename to changelog/8646.improvment.rst From a29f4aff98ad019182d34965aa51ebfda11fb9ce Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Tue, 10 May 2022 23:27:33 -0700 Subject: [PATCH 238/549] Update 8646.improvement.rst --- changelog/{8646.improvment.rst => 8646.improvement.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog/{8646.improvment.rst => 8646.improvement.rst} (100%) diff --git a/changelog/8646.improvment.rst b/changelog/8646.improvement.rst similarity index 100% rename from changelog/8646.improvment.rst rename to changelog/8646.improvement.rst From a88c0f3bb056cb987eb217e934b6b9db481d8783 Mon Sep 17 00:00:00 2001 From: Pax <13646646+paxcodes@users.noreply.github.com> Date: Wed, 11 May 2022 01:02:36 -0700 Subject: [PATCH 239/549] Add link to python docs on logging levels (#9925) --- doc/en/how-to/logging.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/en/how-to/logging.rst b/doc/en/how-to/logging.rst index 87cebb8f20e..c99835a2baf 100644 --- a/doc/en/how-to/logging.rst +++ b/doc/en/how-to/logging.rst @@ -176,8 +176,8 @@ 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 as seen in python's documentation or an integer -as the logging level num. +accepts the logging level names or numeric values as seen in +:ref:`logging's documentation `. Additionally, you can also specify ``--log-cli-format`` and ``--log-cli-date-format`` which mirror and default to ``--log-format`` and @@ -198,9 +198,8 @@ Note that relative paths for the log-file location, whether passed on the CLI or 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 as seen in -python's documentation(ie, uppercased level names) or an integer as the logging -level num. +``--log-file-level``. This setting accepts the logging level names or numeric +values as seen in :ref:`logging's documentation `. Additionally, you can also specify ``--log-file-format`` and ``--log-file-date-format`` which are equal to ``--log-format`` and From 16781f9b8c001786d3e3fac9b89821118dc68f94 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 11 May 2022 10:52:41 -0300 Subject: [PATCH 240/549] [pre-commit.ci] pre-commit autoupdate (#9936) [pre-commit.ci] pre-commit autoupdate --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 30fa24ae03b..c5856cdd8c7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.32.0 + rev: v2.32.1 hooks: - id: pyupgrade args: [--py37-plus] From c5432a18e7871be19330cdf65912c9063ee486bd Mon Sep 17 00:00:00 2001 From: Ruth Comer Date: Thu, 12 May 2022 12:16:25 +0100 Subject: [PATCH 241/549] doc: link to pytest-subtests --- doc/en/how-to/unittest.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/en/how-to/unittest.rst b/doc/en/how-to/unittest.rst index b6393707160..658c69a14fd 100644 --- a/doc/en/how-to/unittest.rst +++ b/doc/en/how-to/unittest.rst @@ -27,12 +27,15 @@ Almost all ``unittest`` features are supported: * ``setUpClass/tearDownClass``; * ``setUpModule/tearDownModule``; +.. _`pytest-subtests`: https://github.com/pytest-dev/pytest-subtests .. _`load_tests protocol`: https://docs.python.org/3/library/unittest.html#load-tests-protocol +Additionally, :ref:`subtests ` are supported by the +`pytest-subtests`_ plugin. + Up to this point pytest does not have support for the following features: * `load_tests protocol`_; -* :ref:`subtests `; Benefits out of the box ----------------------- From 69fb79e741f00714d3ac14ee853c5506f154e94f Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 12 May 2022 09:55:40 -0300 Subject: [PATCH 242/549] Add colors to summary (#9875) Fix #9873 --- src/_pytest/terminal.py | 66 ++++++++++++++++++++++++++-------------- testing/test_skipping.py | 23 ++++++-------- testing/test_terminal.py | 10 ++++-- 3 files changed, 60 insertions(+), 39 deletions(-) diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index b4848c48aba..41a9861a3ce 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -35,6 +35,7 @@ from _pytest import timing from _pytest._code import ExceptionInfo from _pytest._code.code import ExceptionRepr +from _pytest._io import TerminalWriter from _pytest._io.wcwidth import wcswidth from _pytest.compat import final from _pytest.config import _PluggyPlugin @@ -1074,33 +1075,43 @@ def short_test_summary(self) -> None: if not self.reportchars: return - def show_simple(stat, lines: List[str]) -> None: + def show_simple(lines: List[str], *, stat: str) -> None: failed = self.stats.get(stat, []) if not failed: return - termwidth = self._tw.fullwidth config = self.config for rep in failed: - line = _get_line_with_reprcrash_message(config, rep, termwidth) + color = _color_for_type.get(stat, _color_for_type_default) + line = _get_line_with_reprcrash_message( + config, rep, self._tw, {color: True} + ) lines.append(line) def show_xfailed(lines: List[str]) -> None: xfailed = self.stats.get("xfailed", []) for rep in xfailed: verbose_word = rep._get_verbose_word(self.config) - pos = _get_pos(self.config, rep) - lines.append(f"{verbose_word} {pos}") + markup_word = self._tw.markup( + verbose_word, **{_color_for_type["warnings"]: True} + ) + nodeid = _get_node_id_with_markup(self._tw, self.config, rep) + line = f"{markup_word} {nodeid}" reason = rep.wasxfail if reason: - lines.append(" " + str(reason)) + line += " - " + str(reason) + + lines.append(line) def show_xpassed(lines: List[str]) -> None: xpassed = self.stats.get("xpassed", []) for rep in xpassed: verbose_word = rep._get_verbose_word(self.config) - pos = _get_pos(self.config, rep) + markup_word = self._tw.markup( + verbose_word, **{_color_for_type["warnings"]: True} + ) + nodeid = _get_node_id_with_markup(self._tw, self.config, rep) reason = rep.wasxfail - lines.append(f"{verbose_word} {pos} {reason}") + lines.append(f"{markup_word} {nodeid} {reason}") def show_skipped(lines: List[str]) -> None: skipped: List[CollectReport] = self.stats.get("skipped", []) @@ -1108,24 +1119,27 @@ def show_skipped(lines: List[str]) -> None: if not fskips: return verbose_word = skipped[0]._get_verbose_word(self.config) + markup_word = self._tw.markup( + verbose_word, **{_color_for_type["warnings"]: True} + ) + prefix = "Skipped: " for num, fspath, lineno, reason in fskips: - if reason.startswith("Skipped: "): - reason = reason[9:] + if reason.startswith(prefix): + reason = reason[len(prefix) :] if lineno is not None: lines.append( - "%s [%d] %s:%d: %s" - % (verbose_word, num, fspath, lineno, reason) + "%s [%d] %s:%d: %s" % (markup_word, num, fspath, lineno, reason) ) else: - lines.append("%s [%d] %s: %s" % (verbose_word, num, fspath, reason)) + lines.append("%s [%d] %s: %s" % (markup_word, num, fspath, reason)) REPORTCHAR_ACTIONS: Mapping[str, Callable[[List[str]], None]] = { "x": show_xfailed, "X": show_xpassed, - "f": partial(show_simple, "failed"), + "f": partial(show_simple, stat="failed"), "s": show_skipped, - "p": partial(show_simple, "passed"), - "E": partial(show_simple, "error"), + "p": partial(show_simple, stat="passed"), + "E": partial(show_simple, stat="error"), } lines: List[str] = [] @@ -1135,7 +1149,7 @@ def show_skipped(lines: List[str]) -> None: action(lines) if lines: - self.write_sep("=", "short test summary info") + self.write_sep("=", "short test summary info", cyan=True, bold=True) for line in lines: self.write_line(line) @@ -1249,9 +1263,14 @@ def _build_collect_only_summary_stats_line( return parts, main_color -def _get_pos(config: Config, rep: BaseReport): +def _get_node_id_with_markup(tw: TerminalWriter, config: Config, rep: BaseReport): nodeid = config.cwd_relative_nodeid(rep.nodeid) - return nodeid + path, *parts = nodeid.split("::") + if parts: + parts_markup = tw.markup("::".join(parts), bold=True) + return path + "::" + parts_markup + else: + return path def _format_trimmed(format: str, msg: str, available_width: int) -> Optional[str]: @@ -1280,13 +1299,14 @@ def _format_trimmed(format: str, msg: str, available_width: int) -> Optional[str def _get_line_with_reprcrash_message( - config: Config, rep: BaseReport, termwidth: int + config: Config, rep: BaseReport, tw: TerminalWriter, word_markup: Dict[str, bool] ) -> str: """Get summary line for a report, trying to add reprcrash message.""" verbose_word = rep._get_verbose_word(config) - pos = _get_pos(config, rep) + word = tw.markup(verbose_word, **word_markup) + node = _get_node_id_with_markup(tw, config, rep) - line = f"{verbose_word} {pos}" + line = f"{word} {node}" line_width = wcswidth(line) try: @@ -1295,7 +1315,7 @@ def _get_line_with_reprcrash_message( except AttributeError: pass else: - available_width = termwidth - line_width + available_width = tw.fullwidth - line_width msg = _format_trimmed(" - {}", msg, available_width) if msg is not None: line += msg diff --git a/testing/test_skipping.py b/testing/test_skipping.py index 3010943607c..6415480ef4f 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -441,10 +441,8 @@ def test_this_false(): result = pytester.runpytest(p, "-rx") result.stdout.fnmatch_lines( [ - "*test_one*test_this*", - "*NOTRUN*noway", - "*test_one*test_this_true*", - "*NOTRUN*condition:*True*", + "*test_one*test_this - reason: *NOTRUN* noway", + "*test_one*test_this_true - reason: *NOTRUN* condition: True", "*1 passed*", ] ) @@ -461,9 +459,7 @@ def setup_module(mod): """ ) result = pytester.runpytest(p, "-rx") - result.stdout.fnmatch_lines( - ["*test_one*test_this*", "*NOTRUN*hello", "*1 xfailed*"] - ) + result.stdout.fnmatch_lines(["*test_one*test_this*NOTRUN*hello", "*1 xfailed*"]) def test_xfail_xpass(self, pytester: Pytester) -> None: p = pytester.makepyfile( @@ -489,7 +485,7 @@ def test_this(): result = pytester.runpytest(p) result.stdout.fnmatch_lines(["*1 xfailed*"]) result = pytester.runpytest(p, "-rx") - result.stdout.fnmatch_lines(["*XFAIL*test_this*", "*reason:*hello*"]) + result.stdout.fnmatch_lines(["*XFAIL*test_this*reason:*hello*"]) result = pytester.runpytest(p, "--runxfail") result.stdout.fnmatch_lines(["*1 pass*"]) @@ -507,7 +503,7 @@ def test_this(): result = pytester.runpytest(p) result.stdout.fnmatch_lines(["*1 xfailed*"]) result = pytester.runpytest(p, "-rx") - result.stdout.fnmatch_lines(["*XFAIL*test_this*", "*reason:*hello*"]) + result.stdout.fnmatch_lines(["*XFAIL*test_this*reason:*hello*"]) result = pytester.runpytest(p, "--runxfail") result.stdout.fnmatch_lines( """ @@ -543,7 +539,7 @@ def test_this(arg): """ ) result = pytester.runpytest(p, "-rxX") - result.stdout.fnmatch_lines(["*XFAIL*test_this*", "*NOTRUN*"]) + result.stdout.fnmatch_lines(["*XFAIL*test_this*NOTRUN*"]) def test_dynamic_xfail_set_during_funcarg_setup(self, pytester: Pytester) -> None: p = pytester.makepyfile( @@ -622,7 +618,7 @@ def test_foo(): """ ) result = pytester.runpytest(p, "-rxX") - result.stdout.fnmatch_lines(["*XFAIL*", "*unsupported feature*"]) + result.stdout.fnmatch_lines(["*XFAIL*unsupported feature*"]) assert result.ret == 0 @pytest.mark.parametrize("strict", [True, False]) @@ -1185,7 +1181,7 @@ def test_boolean(): """ ) result = pytester.runpytest("-rsx") - result.stdout.fnmatch_lines(["*SKIP*x == 3*", "*XFAIL*test_boolean*", "*x == 3*"]) + result.stdout.fnmatch_lines(["*SKIP*x == 3*", "*XFAIL*test_boolean*x == 3*"]) def test_default_markers(pytester: Pytester) -> None: @@ -1297,8 +1293,7 @@ def test_func(): result = pytester.runpytest("-rxs") result.stdout.fnmatch_lines( """ - *XFAIL* - *True123* + *XFAIL*True123* *1 xfail* """ ) diff --git a/testing/test_terminal.py b/testing/test_terminal.py index f0e58e5b4c4..5b464d68bfb 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -2319,7 +2319,7 @@ def test_line_with_reprcrash(monkeypatch: MonkeyPatch) -> None: def mock_get_pos(*args): return mocked_pos - monkeypatch.setattr(_pytest.terminal, "_get_pos", mock_get_pos) + monkeypatch.setattr(_pytest.terminal, "_get_node_id_with_markup", mock_get_pos) class config: pass @@ -2333,10 +2333,16 @@ class reprcrash: pass def check(msg, width, expected): + class DummyTerminalWriter: + fullwidth = width + + def markup(self, word: str, **markup: str): + return word + __tracebackhide__ = True if msg: rep.longrepr.reprcrash.message = msg # type: ignore - actual = _get_line_with_reprcrash_message(config, rep(), width) # type: ignore + actual = _get_line_with_reprcrash_message(config, rep(), DummyTerminalWriter(), {}) # type: ignore assert actual == expected if actual != f"{mocked_verbose_word} {mocked_pos}": From 56c266640ef4ee60659f81af36bc95f6e6ca9cfa Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 13 May 2022 06:15:52 -0500 Subject: [PATCH 243/549] Do not truncate crash messages in short test summary on CI (#9933) Closes #9920 --- changelog/9920.improvement.rst | 1 + src/_pytest/terminal.py | 8 ++++++-- testing/test_terminal.py | 18 ++++++++++++++++-- 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 changelog/9920.improvement.rst diff --git a/changelog/9920.improvement.rst b/changelog/9920.improvement.rst new file mode 100644 index 00000000000..ed47e872cac --- /dev/null +++ b/changelog/9920.improvement.rst @@ -0,0 +1 @@ +Display full crash messages in ``short test summary info``, when runng in a CI environment. diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 41a9861a3ce..bb07b3ce7c6 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -37,6 +37,7 @@ from _pytest._code.code import ExceptionRepr from _pytest._io import TerminalWriter from _pytest._io.wcwidth import wcswidth +from _pytest.assertion.util import running_on_ci from _pytest.compat import final from _pytest.config import _PluggyPlugin from _pytest.config import Config @@ -1315,8 +1316,11 @@ def _get_line_with_reprcrash_message( except AttributeError: pass else: - available_width = tw.fullwidth - line_width - msg = _format_trimmed(" - {}", msg, available_width) + if not running_on_ci(): + available_width = tw.fullwidth - line_width + msg = _format_trimmed(" - {}", msg, available_width) + else: + msg = f" - {msg}" if msg is not None: line += msg diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 5b464d68bfb..9a8dd4d9ac9 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -1139,7 +1139,21 @@ def test(): assert result.stdout.lines.count(expected) == 1 -def test_fail_extra_reporting(pytester: Pytester, monkeypatch) -> None: +@pytest.mark.parametrize( + ("use_ci", "expected_message"), + ( + (True, f"- AssertionError: {'this_failed'*100}"), + (False, "- AssertionError: this_failedt..."), + ), + ids=("on CI", "not on CI"), +) +def test_fail_extra_reporting( + pytester: Pytester, monkeypatch, use_ci: bool, expected_message: str +) -> None: + if use_ci: + monkeypatch.setenv("CI", "true") + else: + monkeypatch.delenv("CI", raising=False) monkeypatch.setenv("COLUMNS", "80") pytester.makepyfile("def test_this(): assert 0, 'this_failed' * 100") result = pytester.runpytest("-rN") @@ -1148,7 +1162,7 @@ def test_fail_extra_reporting(pytester: Pytester, monkeypatch) -> None: result.stdout.fnmatch_lines( [ "*test summary*", - "FAILED test_fail_extra_reporting.py::test_this - AssertionError: this_failedt...", + f"FAILED test_fail_extra_reporting.py::test_this {expected_message}", ] ) From cc0fbbefa0f8a6b390e89ef0d4d64dd78783a5c1 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 14 May 2022 07:50:40 -0300 Subject: [PATCH 244/549] Add CHANGELOG for #9873 (#9953) --- changelog/9873.improvement.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/9873.improvement.rst diff --git a/changelog/9873.improvement.rst b/changelog/9873.improvement.rst new file mode 100644 index 00000000000..431f9861b62 --- /dev/null +++ b/changelog/9873.improvement.rst @@ -0,0 +1 @@ +Some coloring has been added to the short test summary. From 5d20e285387d1256c253333bee74eba775eee3b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 May 2022 03:02:09 +0000 Subject: [PATCH 245/549] build(deps): Bump anyio[curio,trio] in /testing/plugins_integration Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio) from 3.5.0 to 3.6.1. - [Release notes](https://github.com/agronholm/anyio/releases) - [Changelog](https://github.com/agronholm/anyio/blob/master/docs/versionhistory.rst) - [Commits](https://github.com/agronholm/anyio/compare/3.5.0...3.6.1) --- updated-dependencies: - dependency-name: anyio[curio,trio] dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 6d1b02920a0..0386a613a93 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,4 +1,4 @@ -anyio[curio,trio]==3.5.0 +anyio[curio,trio]==3.6.1 django==4.0.4 pytest-asyncio==0.18.3 pytest-bdd==5.0.0 From 5d28a5864001fd6405202217c246f8da925835e5 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Mon, 16 May 2022 10:17:18 +0200 Subject: [PATCH 246/549] Remove docs on Python 2.7 and 3.4 Support (#9957) This extensive explanation is not need anymore because they are now unsupported for a long time. Instead add as short section on Python version compatibility in the backward compatibility docs. --- doc/en/backwards-compatibility.rst | 15 +++++ doc/en/changelog.rst | 12 +++- doc/en/contents.rst | 1 - doc/en/py27-py34-deprecation.rst | 99 ------------------------------ 4 files changed, 24 insertions(+), 103 deletions(-) delete mode 100644 doc/en/py27-py34-deprecation.rst diff --git a/doc/en/backwards-compatibility.rst b/doc/en/backwards-compatibility.rst index 3a0ff126164..64bcbf5bd49 100644 --- a/doc/en/backwards-compatibility.rst +++ b/doc/en/backwards-compatibility.rst @@ -77,3 +77,18 @@ Deprecation Roadmap Features currently deprecated and removed in previous releases can be found in :ref:`deprecations`. We track future deprecation and removal of features using milestones and the `deprecation `_ and `removal `_ labels on GitHub. + + +Python version support +====================== + +Released pytest versions support all Python versions that are actively maintained at the time of the release: + +============== =================== +pytest version min. Python version +============== =================== +7.1+ 3.7+ +6.2 - 7.0 3.6+ +5.0 - 6.1 3.5+ +3.3 - 4.6 2.7, 3.4+ +============== =================== diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 46e18d32255..01c6d6983a2 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -2618,7 +2618,8 @@ Important This release is a Python3.5+ only release. -For more details, see our :std:doc:`Python 2.7 and 3.4 support plan `. +For more details, see our `Python 2.7 and 3.4 support plan +`_. Removals -------- @@ -2842,7 +2843,11 @@ Features - :issue:`6870`: New ``Config.invocation_args`` attribute containing the unchanged arguments passed to ``pytest.main()``. - Remark: while this is technically a new feature and according to our :ref:`policy ` it should not have been backported, we have opened an exception in this particular case because it fixes a serious interaction with ``pytest-xdist``, so it can also be considered a bugfix. + Remark: while this is technically a new feature and according to our + `policy `_ + it should not have been backported, we have opened an exception in this + particular case because it fixes a serious interaction with ``pytest-xdist``, + so it can also be considered a bugfix. Trivial/Internal Changes ------------------------ @@ -3014,7 +3019,8 @@ Important The ``4.6.X`` series will be the last series to support **Python 2 and Python 3.4**. -For more details, see our :std:doc:`Python 2.7 and 3.4 support plan `. +For more details, see our `Python 2.7 and 3.4 support plan +`_. Features diff --git a/doc/en/contents.rst b/doc/en/contents.rst index 049d44ba9d8..ae42884f658 100644 --- a/doc/en/contents.rst +++ b/doc/en/contents.rst @@ -85,7 +85,6 @@ Further topics backwards-compatibility deprecations - py27-py34-deprecation contributing development_guide diff --git a/doc/en/py27-py34-deprecation.rst b/doc/en/py27-py34-deprecation.rst deleted file mode 100644 index 660b078e30e..00000000000 --- a/doc/en/py27-py34-deprecation.rst +++ /dev/null @@ -1,99 +0,0 @@ -Python 2.7 and 3.4 support -========================== - -It is demanding on the maintainers of an open source project to support many Python versions, as -there's extra cost of keeping code compatible between all versions, while holding back on -features only made possible on newer Python versions. - -In case of Python 2 and 3, the difference between the languages makes it even more prominent, -because many new Python 3 features cannot be used in a Python 2/3 compatible code base. - -Python 2.7 EOL has been reached :pep:`in 2020 <0373#maintenance-releases>`, with -the last release made in April, 2020. - -Python 3.4 EOL has been reached :pep:`in 2019 <0429#release-schedule>`, with the last release made in March, 2019. - -For those reasons, in Jun 2019 it was decided that **pytest 4.6** series will be the last to support Python 2.7 and 3.4. - -What this means for general users ---------------------------------- - -Thanks to the `python_requires`_ setuptools option, -Python 2.7 and Python 3.4 users using a modern pip version -will install the last pytest 4.6.X version automatically even if 5.0 or later versions -are available on PyPI. - -Users should ensure they are using the latest pip and setuptools versions for this to work. - -Maintenance of 4.6.X versions ------------------------------ - -Until January 2020, the pytest core team ported many bug-fixes from the main release into the -``4.6.x`` branch, with several 4.6.X releases being made along the year. - -From now on, the core team will **no longer actively backport patches**, but the ``4.6.x`` -branch will continue to exist so the community itself can contribute patches. - -The core team will be happy to accept those patches, and make new 4.6.X releases **until mid-2020** -(but consider that date as a ballpark, after that date the team might still decide to make new releases -for critical bugs). - -.. _`python_requires`: https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires - -Technical aspects -~~~~~~~~~~~~~~~~~ - -(This section is a transcript from :issue:`5275`). - -In this section we describe the technical aspects of the Python 2.7 and 3.4 support plan. - -.. _what goes into 4.6.x releases: - -What goes into 4.6.X releases -+++++++++++++++++++++++++++++ - -New 4.6.X releases will contain bug fixes only. - -When will 4.6.X releases happen -+++++++++++++++++++++++++++++++ - -New 4.6.X releases will happen after we have a few bugs in place to release, or if a few weeks have -passed (say a single bug has been fixed a month after the latest 4.6.X release). - -No hard rules here, just ballpark. - -Who will handle applying bug fixes -++++++++++++++++++++++++++++++++++ - -We core maintainers expect that people still using Python 2.7/3.4 and being affected by -bugs to step up and provide patches and/or port bug fixes from the active branches. - -We will be happy to guide users interested in doing so, so please don't hesitate to ask. - -**Backporting changes into 4.6** - -Please follow these instructions: - -#. ``git fetch --all --prune`` - -#. ``git checkout origin/4.6.x -b backport-XXXX`` # use the PR number here - -#. Locate the merge commit on the PR, in the *merged* message, for example: - - nicoddemus merged commit 0f8b462 into pytest-dev:features - -#. ``git cherry-pick -m1 REVISION`` # use the revision you found above (``0f8b462``). - -#. Open a PR targeting ``4.6.x``: - - * Prefix the message with ``[4.6]`` so it is an obvious backport - * Delete the PR body, it usually contains a duplicate commit message. - -**Providing new PRs to 4.6** - -Fresh pull requests to ``4.6.x`` will be accepted provided that -the equivalent code in the active branches does not contain that bug (for example, a bug is specific -to Python 2 only). - -Bug fixes that also happen in the mainstream version should be first fixed -there, and then backported as per instructions above. From 7b977f4beb014240770691f6cbb9fd3d83c16b88 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 May 2022 08:46:51 -0300 Subject: [PATCH 247/549] [automated] Update plugin list (#9959) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 2198 +++++++++++++++--------------- 1 file changed, 1115 insertions(+), 1083 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 2bdd41d975a..6def59d1b14 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,1057 +11,1061 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1043 plugins. +This list contains 1047 plugins. .. only:: not latex - =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ - name summary last release status requires - =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ - :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Apr 26, 2022 N/A pytest (>=5.4.0) - :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) - :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-agent` Service that exposes a REST API that can be used to interract remotely with Pytest. It is shipped with a dashboard that enables running tests in a more convenient way. Nov 25, 2021 N/A N/A - :pypi:`pytest-aggreport` pytest plugin for pytest-repeat that generate aggregate report of the same test cases with additional statistics details. Mar 07, 2021 4 - Beta pytest (>=6.2.2) - :pypi:`pytest-aio` Pytest plugin for testing async python code Oct 20, 2021 4 - Beta pytest - :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A - :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Nov 01, 2020 N/A pytest (>=6) - :pypi:`pytest-aiomoto` pytest-aiomoto Mar 13, 2022 N/A pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) - :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A - :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Apr 10, 2022 N/A pytest (>=1.0) - :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest - :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) - :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) - :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Feb 21, 2022 N/A pytest - :pypi:`pytest-allure-dsl` pytest plugin to test case doc string dls instructions Oct 25, 2020 4 - Beta pytest - :pypi:`pytest-allure-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest - :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-android` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Feb 21, 2019 3 - Alpha pytest - :pypi:`pytest-anki` A pytest plugin for testing Anki add-ons Oct 14, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-annotate` pytest-annotate: Generate PyAnnotate annotations from your pytest tests. Nov 29, 2021 3 - Alpha pytest (<7.0.0,>=3.2.0) - :pypi:`pytest-ansible` Plugin for py.test to simplify calling ansible modules from tests or fixtures May 25, 2021 5 - Production/Stable N/A - :pypi:`pytest-ansible-playbook` Pytest fixture which runs given ansible playbook file. Mar 08, 2019 4 - Beta N/A - :pypi:`pytest-ansible-playbook-runner` Pytest fixture which runs given ansible playbook file. Dec 02, 2020 4 - Beta pytest (>=3.1.0) - :pypi:`pytest-ansible-units` A pytest plugin for running unit tests within an ansible collection Apr 14, 2022 N/A N/A - :pypi:`pytest-antilru` Bust functools.lru_cache when running pytest to avoid test pollution Jan 29, 2022 5 - Production/Stable pytest - :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest - :pypi:`pytest-anything` Pytest fixtures to assert anything and something Feb 18, 2021 N/A N/A - :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Nov 23, 2021 N/A pytest ; extra == 'test' - :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 07, 2022 N/A pytest (>=7.1.1,<8.0.0) - :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A - :pypi:`pytest-appengine` AppEngine integration that works well with pytest-django Feb 27, 2017 N/A N/A - :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A - :pypi:`pytest-approvaltests` A plugin to use approvaltests with pytest Feb 07, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) - :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 4 - Beta pytest (>=4.6) - :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) - :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A - :pypi:`pytest-assertions` Pytest Assertions Apr 27, 2022 N/A N/A - :pypi:`pytest-assertutil` pytest-assertutil May 10, 2019 N/A N/A - :pypi:`pytest-assert-utils` Useful assertion utilities for use with pytest Apr 14, 2022 3 - Alpha N/A - :pypi:`pytest-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) - :pypi:`pytest-ast-back-to-python` A plugin for pytest devs to view how assertion rewriting recodes the AST Sep 29, 2019 4 - Beta N/A - :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) - :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) - :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest - :pypi:`pytest-asyncio` Pytest support for asyncio Mar 25, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. May 02, 2022 N/A N/A - :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) - :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) - :pypi:`pytest-async-sqlalchemy` Database testing fixtures using the SQLAlchemy asyncio API Oct 07, 2021 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-atomic` Skip rest of tests if previous test failed. Nov 24, 2018 4 - Beta N/A - :pypi:`pytest-attrib` pytest plugin to select tests based on attributes similar to the nose-attrib plugin May 24, 2016 4 - Beta N/A - :pypi:`pytest-austin` Austin plugin for pytest Oct 11, 2020 4 - Beta N/A - :pypi:`pytest-autochecklog` automatically check condition and log all the checks Apr 25, 2015 4 - Beta N/A - :pypi:`pytest-automation` pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. Oct 01, 2021 N/A pytest - :pypi:`pytest-automock` Pytest plugin for automatical mocks creation Feb 01, 2022 N/A pytest ; extra == 'dev' - :pypi:`pytest-auto-parametrize` pytest plugin: avoid repeating arguments in parametrize Oct 02, 2016 3 - Alpha N/A - :pypi:`pytest-autotest` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Aug 25, 2021 N/A pytest - :pypi:`pytest-avoidance` Makes pytest skip tests that don not need rerunning May 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-aws` pytest plugin for testing AWS resource configurations Oct 04, 2017 4 - Beta N/A - :pypi:`pytest-aws-config` Protect your AWS credentials in unit tests May 28, 2021 N/A N/A - :pypi:`pytest-axe` pytest plugin for axe-selenium-python Nov 12, 2018 N/A pytest (>=3.0.0) - :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Mar 16, 2022 4 - Beta pytest (>=5.0.0) - :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) - :pypi:`pytest-bdd` BDD for pytest Oct 25, 2021 6 - Mature pytest (>=4.3) - :pypi:`pytest-bdd-splinter` Common steps for pytest bdd and splinter integration Aug 12, 2019 5 - Production/Stable pytest (>=4.0.0) - :pypi:`pytest-bdd-web` A simple plugin to use with pytest Jan 02, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A - :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest - :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A - :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A - :pypi:`pytest-benchmark` A \`\`pytest\`\` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer. Apr 17, 2021 5 - Production/Stable pytest (>=3.8) - :pypi:`pytest-bg-process` Pytest plugin to initialize background process Jan 24, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-bigchaindb` A BigchainDB plugin for pytest. Jan 24, 2022 4 - Beta N/A - :pypi:`pytest-bigquery-mock` Provides a mock fixture for python bigquery client Aug 05, 2021 N/A pytest (>=5.0) - :pypi:`pytest-black` A pytest plugin to enable format checking with black Oct 05, 2020 4 - Beta N/A - :pypi:`pytest-black-multipy` Allow '--black' on older Pythons Jan 14, 2021 5 - Production/Stable pytest (!=3.7.3,>=3.5) ; extra == 'testing' - :pypi:`pytest-blame` A pytest plugin helps developers to debug by providing useful commits history. May 04, 2019 N/A pytest (>=4.4.0) - :pypi:`pytest-blender` Blender Pytest plugin. Mar 11, 2022 N/A pytest ; extra == 'dev' - :pypi:`pytest-blink1` Pytest plugin to emit notifications via the Blink(1) RGB LED Jan 07, 2018 4 - Beta N/A - :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest - :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A - :pypi:`pytest-board` Local continuous test runner with pytest and watchdog. Jan 20, 2019 N/A N/A - :pypi:`pytest-bootstrap` Mar 04, 2022 N/A N/A - :pypi:`pytest-bpdb` A py.test plug-in to enable drop to bpdb debugger on test failure. Jan 19, 2015 2 - Pre-Alpha N/A - :pypi:`pytest-bravado` Pytest-bravado automatically generates from OpenAPI specification client fixtures. Feb 15, 2022 N/A N/A - :pypi:`pytest-breakword` Use breakword with pytest Aug 04, 2021 N/A pytest (>=6.2.4,<7.0.0) - :pypi:`pytest-breed-adapter` A simple plugin to connect with breed-server Nov 07, 2018 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-briefcase` A pytest plugin for running tests on a Briefcase project. Jun 14, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-browser` A pytest plugin for console based browser test selection just after the collection phase Dec 10, 2016 3 - Alpha N/A - :pypi:`pytest-browsermob-proxy` BrowserMob proxy plugin for py.test. Jun 11, 2013 4 - Beta N/A - :pypi:`pytest-browserstack-local` \`\`py.test\`\` plugin to run \`\`BrowserStackLocal\`\` in background. Feb 09, 2018 N/A N/A - :pypi:`pytest-bug` Pytest plugin for marking tests as a bug Apr 13, 2022 5 - Production/Stable pytest (>=6.2.0) - :pypi:`pytest-bugtong-tag` pytest-bugtong-tag is a plugin for pytest Jan 16, 2022 N/A N/A - :pypi:`pytest-bugzilla` py.test bugzilla integration plugin May 05, 2010 4 - Beta N/A - :pypi:`pytest-bugzilla-notifier` A plugin that allows you to execute create, update, and read information from BugZilla bugs Jun 15, 2018 4 - Beta pytest (>=2.9.2) - :pypi:`pytest-buildkite` Plugin for pytest that automatically publishes coverage and pytest report annotations to Buildkite. Jul 13, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-builtin-types` Nov 17, 2021 N/A pytest - :pypi:`pytest-bwrap` Run your tests in Bubblewrap sandboxes Oct 26, 2018 3 - Alpha N/A - :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A - :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data May 02, 2022 4 - Beta pytest (>=5.0.0) - :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A - :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 17, 2022 N/A pytest - :pypi:`pytest-camel-collect` Enable CamelCase-aware pytest class collection Aug 02, 2020 N/A pytest (>=2.9) - :pypi:`pytest-canonical-data` A plugin which allows to compare results with canonical results, based on previous runs May 08, 2020 2 - Pre-Alpha pytest (>=3.5.0) - :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A - :pypi:`pytest-capture-deprecatedwarnings` pytest plugin to capture all deprecatedwarnings and put them in one file Apr 30, 2019 N/A N/A - :pypi:`pytest-capture-warnings` pytest plugin to capture all warnings and put them in one file of your choice May 03, 2022 N/A pytest - :pypi:`pytest-cases` Separate test code from test cases in pytest. Mar 21, 2022 5 - Production/Stable N/A - :pypi:`pytest-cassandra` Cassandra CCM Test Fixtures for pytest Nov 04, 2017 1 - Planning N/A - :pypi:`pytest-catchlog` py.test plugin to catch log messages. This is a fork of pytest-capturelog. Jan 24, 2016 4 - Beta pytest (>=2.6) - :pypi:`pytest-catch-server` Pytest plugin with server for catching HTTP requests. Dec 12, 2019 5 - Production/Stable N/A - :pypi:`pytest-celery` pytest-celery a shim pytest plugin to enable celery.contrib.pytest May 06, 2021 N/A N/A - :pypi:`pytest-chainmaker` pytest plugin for chainmaker Oct 15, 2021 N/A N/A - :pypi:`pytest-chalice` A set of py.test fixtures for AWS Chalice Jul 01, 2020 4 - Beta N/A - :pypi:`pytest-change-demo` turn . into √,turn F into x Mar 02, 2022 N/A pytest - :pypi:`pytest-change-report` turn . into √,turn F into x Sep 14, 2020 N/A pytest - :pypi:`pytest-change-xds` turn . into √,turn F into x Apr 16, 2022 N/A pytest - :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) - :pypi:`pytest-checkdocs` check the README when running tests Jul 31, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' - :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) - :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest (>=7.0) - :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest - :pypi:`pytest-circleci` py.test plugin for CircleCI May 03, 2019 N/A N/A - :pypi:`pytest-circleci-parallelized` Parallelize pytest across CircleCI workers. Mar 26, 2019 N/A N/A - :pypi:`pytest-ckan` Backport of CKAN 2.9 pytest plugin and fixtures to CAKN 2.8 Apr 28, 2020 4 - Beta pytest - :pypi:`pytest-clarity` A plugin providing an alternative, colourful diff output for failing assertions. Jun 11, 2021 N/A N/A - :pypi:`pytest-cldf` Easy quality control for CLDF datasets using pytest May 06, 2019 N/A N/A - :pypi:`pytest-click` Pytest plugin for Click Feb 11, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-clld` Nov 29, 2021 N/A pytest (>=3.6) - :pypi:`pytest-cloud` Distributed tests planner plugin for pytest testing framework. Oct 05, 2020 6 - Mature N/A - :pypi:`pytest-cloudflare-worker` pytest plugin for testing cloudflare workers Mar 30, 2021 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) - :pypi:`pytest-codecheckers` pytest plugin to add source code sanity checks (pep8 and friends) Feb 13, 2010 N/A N/A - :pypi:`pytest-codecov` Pytest plugin for uploading pytest-cov results to codecov.io Apr 12, 2022 4 - Beta pytest (>=4.6.0) - :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A - :pypi:`pytest-codeowners` Pytest plugin for selecting tests by GitHub CODEOWNERS. Mar 30, 2022 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-codestyle` pytest plugin to run pycodestyle Mar 23, 2020 3 - Alpha N/A - :pypi:`pytest-collect-formatter` Formatter for pytest collect output Mar 29, 2021 5 - Production/Stable N/A - :pypi:`pytest-collect-formatter2` Formatter for pytest collect output May 31, 2021 5 - Production/Stable N/A - :pypi:`pytest-colordots` Colorizes the progress indicators Oct 06, 2017 5 - Production/Stable N/A - :pypi:`pytest-commander` An interactive GUI test runner for PyTest Aug 17, 2021 N/A pytest (<7.0.0,>=6.2.4) - :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method Nov 12, 2020 N/A pytest (>=3.6,<7) - :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-config` Base configurations and utilities for developing your Python project test suite with pytest. Nov 07, 2014 5 - Production/Stable N/A - :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Apr 17, 2022 N/A N/A - :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts Mar 18, 2022 4 - Beta N/A - :pypi:`pytest-consul` pytest plugin with fixtures for testing consul aware apps Nov 24, 2018 3 - Alpha pytest - :pypi:`pytest-container` Pytest fixtures for writing container based tests Feb 01, 2022 3 - Alpha pytest (>=3.10) - :pypi:`pytest-contextfixture` Define pytest fixtures as context managers. Mar 12, 2013 4 - Beta N/A - :pypi:`pytest-contexts` A plugin to run tests written with the Contexts framework using pytest May 19, 2021 4 - Beta N/A - :pypi:`pytest-cookies` The pytest plugin for your Cookiecutter templates. 🍪 May 24, 2021 5 - Production/Stable pytest (>=3.3.0) - :pypi:`pytest-couchdbkit` py.test extension for per-test couchdb databases using couchdbkit Apr 17, 2012 N/A N/A - :pypi:`pytest-count` count erros and send email Jan 12, 2018 4 - Beta N/A - :pypi:`pytest-cov` Pytest plugin for measuring coverage. Oct 04, 2021 5 - Production/Stable pytest (>=4.6) - :pypi:`pytest-cover` Pytest plugin for measuring coverage. Forked from \`pytest-cov\`. Aug 01, 2015 5 - Production/Stable N/A - :pypi:`pytest-coverage` Jun 17, 2015 N/A N/A - :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' - :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types May 06, 2022 N/A N/A - :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A - :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) - :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest - :pypi:`pytest-crontab` add crontab task in crontab Dec 09, 2019 N/A N/A - :pypi:`pytest-csv` CSV output for pytest. Apr 22, 2021 N/A pytest (>=6.0) - :pypi:`pytest-curio` Pytest support for curio. Oct 07, 2020 N/A N/A - :pypi:`pytest-curl-report` pytest plugin to generate curl command line report Dec 11, 2016 4 - Beta N/A - :pypi:`pytest-custom-concurrency` Custom grouping concurrence for pytest Feb 08, 2021 N/A N/A - :pypi:`pytest-custom-exit-code` Exit pytest test session with custom exit code in different scenarios Aug 07, 2019 4 - Beta pytest (>=4.0.2) - :pypi:`pytest-custom-nodeid` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 07, 2021 N/A N/A - :pypi:`pytest-custom-report` Configure the symbols displayed for test outcomes Jan 30, 2019 N/A pytest - :pypi:`pytest-custom-scheduling` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 01, 2021 N/A N/A - :pypi:`pytest-cython` A plugin for testing Cython extension modules Mar 26, 2022 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-cython-collect` May 04, 2022 N/A pytest - :pypi:`pytest-darker` A pytest plugin for checking of modified code using Darker Aug 16, 2020 N/A pytest (>=6.0.1) ; extra == 'test' - :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A - :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A - :pypi:`pytest-databricks` Pytest plugin for remote Databricks notebooks testing Jul 29, 2020 N/A pytest - :pypi:`pytest-datadir` pytest plugin for test data directories and files Oct 22, 2019 5 - Production/Stable pytest (>=2.7.0) - :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Jan 20, 2022 5 - Production/Stable pytest - :pypi:`pytest-datadir-ng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Dec 25, 2019 5 - Production/Stable pytest - :pypi:`pytest-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Mar 09, 2022 N/A pytest (>=7.0.1) - :pypi:`pytest-data-file` Fixture "data" and "case_data" for test from yaml file Dec 04, 2019 N/A N/A - :pypi:`pytest-datafiles` py.test plugin to create a 'tmpdir' containing predefined files/directories. May 01, 2022 5 - Production/Stable pytest (>=3.6) - :pypi:`pytest-datafixtures` Data fixtures for pytest made simple Dec 05, 2020 5 - Production/Stable N/A - :pypi:`pytest-data-from-files` pytest plugin to provide data from files loaded automatically Oct 13, 2021 4 - Beta pytest - :pypi:`pytest-dataplugin` A pytest plugin for managing an archive of test data. Sep 16, 2017 1 - Planning N/A - :pypi:`pytest-datarecorder` A py.test plugin recording and comparing test output. Apr 20, 2020 5 - Production/Stable pytest - :pypi:`pytest-datatest` A pytest plugin for test driven data-wrangling (this is the development version of datatest's pytest integration). Oct 15, 2020 4 - Beta pytest (>=3.3) - :pypi:`pytest-db` Session scope fixture "db" for mysql query or change Dec 04, 2019 N/A N/A - :pypi:`pytest-dbfixtures` Databases fixtures plugin for py.test. Dec 07, 2016 4 - Beta N/A - :pypi:`pytest-db-plugin` Nov 27, 2021 N/A pytest (>=5.0) - :pypi:`pytest-dbt-adapter` A pytest plugin for testing dbt adapter plugins Nov 24, 2021 N/A pytest (<7,>=6) - :pypi:`pytest-dbt-conventions` A pytest plugin for linting a dbt project's conventions Mar 02, 2022 N/A pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-dbt-core` Pytest extension for dbt. Jan 28, 2022 N/A pytest (>=6.2.5) ; extra == 'test' - :pypi:`pytest-dbus-notification` D-BUS notifications for pytest results. Mar 05, 2014 5 - Production/Stable N/A - :pypi:`pytest-deadfixtures` A simple plugin to list unused fixtures in pytest Jul 23, 2020 5 - Production/Stable N/A - :pypi:`pytest-deepcov` deepcov Mar 30, 2021 N/A N/A - :pypi:`pytest-defer` Aug 24, 2021 N/A N/A - :pypi:`pytest-demo-plugin` pytest示例插件 May 15, 2021 N/A N/A - :pypi:`pytest-dependency` Manage dependencies of tests Feb 14, 2020 4 - Beta N/A - :pypi:`pytest-depends` Tests that depend on other tests Apr 05, 2020 5 - Production/Stable pytest (>=3) - :pypi:`pytest-deprecate` Mark tests as testing a deprecated feature with a warning note. Jul 01, 2019 N/A N/A - :pypi:`pytest-describe` Describe-style plugin for pytest Nov 13, 2021 4 - Beta pytest (>=4.0.0) - :pypi:`pytest-describe-it` plugin for rich text descriptions Jul 19, 2019 4 - Beta pytest - :pypi:`pytest-devpi-server` DevPI server fixture for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-diamond` pytest plugin for diamond Aug 31, 2015 4 - Beta N/A - :pypi:`pytest-dicom` pytest plugin to provide DICOM fixtures Dec 19, 2018 3 - Alpha pytest - :pypi:`pytest-dictsdiff` Jul 26, 2019 N/A N/A - :pypi:`pytest-diff` A simple plugin to use with pytest Mar 30, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-diff-selector` Get tests affected by code changes (using git) Feb 24, 2022 4 - Beta pytest (>=6.2.2) ; extra == 'all' - :pypi:`pytest-disable` pytest plugin to disable a test and skip it from testrun Sep 10, 2015 4 - Beta N/A - :pypi:`pytest-disable-plugin` Disable plugins per test Feb 28, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. Mar 27, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) - :pypi:`pytest-django` A Django plugin for pytest. Dec 07, 2021 5 - Production/Stable pytest (>=5.4.0) - :pypi:`pytest-django-ahead` A Django plugin for pytest. Oct 27, 2016 5 - Production/Stable pytest (>=2.9) - :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Aug 04, 2021 4 - Beta N/A - :pypi:`pytest-django-cache-xdist` A djangocachexdist plugin for pytest May 12, 2020 4 - Beta N/A - :pypi:`pytest-django-casperjs` Integrate CasperJS with your django tests as a pytest fixture. Mar 15, 2015 2 - Pre-Alpha N/A - :pypi:`pytest-django-dotenv` Pytest plugin used to setup environment variables with django-dotenv Nov 26, 2019 4 - Beta pytest (>=2.6.0) - :pypi:`pytest-django-factories` Factories for your Django models that can be used as Pytest fixtures. Nov 12, 2020 4 - Beta N/A - :pypi:`pytest-django-filefield` Replaces FileField.storage with something you can patch globally. May 06, 2022 5 - Production/Stable pytest >= 5.2 - :pypi:`pytest-django-gcir` A Django plugin for pytest. Mar 06, 2018 5 - Production/Stable N/A - :pypi:`pytest-django-haystack` Cleanup your Haystack indexes between tests Sep 03, 2017 5 - Production/Stable pytest (>=2.3.4) - :pypi:`pytest-django-ifactory` A model instance factory for pytest-django Feb 09, 2022 3 - Alpha N/A - :pypi:`pytest-django-lite` The bare minimum to integrate py.test with Django. Jan 30, 2014 N/A N/A - :pypi:`pytest-django-liveserver-ssl` Jan 20, 2022 3 - Alpha N/A - :pypi:`pytest-django-model` A Simple Way to Test your Django Models Feb 14, 2019 4 - Beta N/A - :pypi:`pytest-django-ordering` A pytest plugin for preserving the order in which Django runs tests. Jul 25, 2019 5 - Production/Stable pytest (>=2.3.0) - :pypi:`pytest-django-queries` Generate performance reports from your django database performance tests. Mar 01, 2021 N/A N/A - :pypi:`pytest-djangorestframework` A djangorestframework plugin for pytest Aug 11, 2019 4 - Beta N/A - :pypi:`pytest-django-rq` A pytest plugin to help writing unit test for django-rq Apr 13, 2020 4 - Beta N/A - :pypi:`pytest-django-sqlcounts` py.test plugin for reporting the number of SQLs executed per django testcase. Jun 16, 2015 4 - Beta N/A - :pypi:`pytest-django-testing-postgresql` Use a temporary PostgreSQL database with pytest-django Jan 31, 2022 4 - Beta N/A - :pypi:`pytest-doc` A documentation plugin for py.test. Jun 28, 2015 5 - Production/Stable N/A - :pypi:`pytest-docfiles` pytest plugin to test codeblocks in your documentation. Dec 22, 2021 4 - Beta pytest (>=3.7.0) - :pypi:`pytest-docgen` An RST Documentation Generator for pytest-based test suites Apr 17, 2020 N/A N/A - :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Apr 09, 2022 N/A pytest (<8.0,>=4.0) - :pypi:`pytest-docker-apache-fixtures` Pytest fixtures for testing with apache2 (httpd). Feb 16, 2022 4 - Beta pytest - :pypi:`pytest-docker-butla` Jun 16, 2019 3 - Alpha N/A - :pypi:`pytest-dockerc` Run, manage and stop Docker Compose project from Docker API Oct 09, 2020 5 - Production/Stable pytest (>=3.0) - :pypi:`pytest-docker-compose` Manages Docker containers during your integration tests Jan 26, 2021 5 - Production/Stable pytest (>=3.3) - :pypi:`pytest-docker-db` A plugin to use docker databases for pytests Mar 20, 2021 5 - Production/Stable pytest (>=3.1.1) - :pypi:`pytest-docker-fixtures` pytest docker fixtures Nov 23, 2021 3 - Alpha N/A - :pypi:`pytest-docker-git-fixtures` Pytest fixtures for testing with git scm. Feb 09, 2022 4 - Beta pytest - :pypi:`pytest-docker-haproxy-fixtures` Pytest fixtures for testing with haproxy. Feb 09, 2022 4 - Beta pytest - :pypi:`pytest-docker-pexpect` pytest plugin for writing functional tests with pexpect and docker Jan 14, 2019 N/A pytest - :pypi:`pytest-docker-postgresql` A simple plugin to use with pytest Sep 24, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-docker-py` Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. Nov 27, 2018 N/A pytest (==4.0.0) - :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Apr 08, 2022 4 - Beta pytest - :pypi:`pytest-docker-service` pytest plugin to start docker container Mar 21, 2022 3 - Alpha pytest - :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 09, 2022 4 - Beta pytest - :pypi:`pytest-docker-tools` Docker integration tests for pytest Feb 17, 2022 4 - Beta pytest (>=6.0.1) - :pypi:`pytest-docs` Documentation tool for pytest Nov 11, 2018 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-docstyle` pytest plugin to run pydocstyle Mar 23, 2020 3 - Alpha N/A - :pypi:`pytest-doctest-custom` A py.test plugin for customizing string representations of doctest results. Jul 25, 2016 4 - Beta N/A - :pypi:`pytest-doctest-ellipsis-markers` Setup additional values for ELLIPSIS_MARKER for doctests Jan 12, 2018 4 - Beta N/A - :pypi:`pytest-doctest-import` A simple pytest plugin to import names and add them to the doctest namespace. Nov 13, 2018 4 - Beta pytest (>=3.3.0) - :pypi:`pytest-doctestplus` Pytest plugin with advanced doctest features. Feb 25, 2022 3 - Alpha pytest (>=4.6) - :pypi:`pytest-dolphin` Some extra stuff that we use ininternally Nov 30, 2016 4 - Beta pytest (==3.0.4) - :pypi:`pytest-doorstop` A pytest plugin for adding test results into doorstop items. Jun 09, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-dotenv` A py.test plugin that parses environment files before running tests Jun 16, 2020 4 - Beta pytest (>=5.0.0) - :pypi:`pytest-drf` A Django REST framework plugin for pytest. Nov 12, 2020 5 - Production/Stable pytest (>=3.6) - :pypi:`pytest-drivings` Tool to allow webdriver automation to be ran locally or remotely Jan 13, 2021 N/A N/A - :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection May 23, 2020 4 - Beta pytest (>=2.7) - :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest - :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A - :pypi:`pytest-duration-insights` Jun 25, 2021 N/A N/A - :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Apr 22, 2022 5 - Production/Stable pytest (>=4.6) - :pypi:`pytest-dynamicrerun` A pytest plugin to rerun tests dynamically based off of test outcome and output. Aug 15, 2020 4 - Beta N/A - :pypi:`pytest-dynamodb` DynamoDB fixtures for pytest Jun 03, 2021 5 - Production/Stable pytest - :pypi:`pytest-easy-addoption` pytest-easy-addoption: Easy way to work with pytest addoption Jan 22, 2020 N/A N/A - :pypi:`pytest-easy-api` Simple API testing with pytest Mar 26, 2018 N/A N/A - :pypi:`pytest-easyMPI` Package that supports mpi tests in pytest Oct 21, 2020 N/A N/A - :pypi:`pytest-easyread` pytest plugin that makes terminal printouts of the reports easier to read Nov 17, 2017 N/A N/A - :pypi:`pytest-easy-server` Pytest plugin for easy testing against servers May 01, 2021 4 - Beta pytest (<5.0.0,>=4.3.1) ; python_version < "3.5" - :pypi:`pytest-ec2` Pytest execution on EC2 instance Oct 22, 2019 3 - Alpha N/A - :pypi:`pytest-echo` pytest plugin with mechanisms for echoing environment variables, package version and generic attributes Jan 08, 2020 5 - Production/Stable N/A - :pypi:`pytest-elasticsearch` Elasticsearch fixtures and fixture factories for Pytest. Mar 01, 2022 5 - Production/Stable pytest (>=6.2.0) - :pypi:`pytest-elements` Tool to help automate user interfaces Jan 13, 2021 N/A pytest (>=5.4,<6.0) - :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) - :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin May 07, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects May 07, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project May 07, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag May 07, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip May 07, 2022 N/A N/A - :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports May 07, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports May 07, 2022 N/A N/A - :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) - :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) - :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' - :pypi:`pytest-encode` set your encoding and logger Nov 06, 2021 N/A N/A - :pypi:`pytest-encode-kane` set your encoding and logger Nov 16, 2021 N/A pytest - :pypi:`pytest-enhancements` Improvements for pytest (rejected upstream) Oct 30, 2019 4 - Beta N/A - :pypi:`pytest-env` py.test plugin that allows you to add environment variables. Jun 16, 2017 4 - Beta N/A - :pypi:`pytest-envfiles` A py.test plugin that parses environment files before running tests Oct 08, 2015 3 - Alpha N/A - :pypi:`pytest-env-info` Push information about the running pytest into envvars Nov 25, 2017 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-envraw` py.test plugin that allows you to add environment variables. Aug 27, 2020 4 - Beta pytest (>=2.6.0) - :pypi:`pytest-envvars` Pytest plugin to validate use of envvars on your tests Jun 13, 2020 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-env-yaml` Apr 02, 2019 N/A N/A - :pypi:`pytest-eradicate` pytest plugin to check for commented out code Sep 08, 2020 N/A pytest (>=2.4.2) - :pypi:`pytest-error-for-skips` Pytest plugin to treat skipped tests a test failure Dec 19, 2019 4 - Beta pytest (>=4.6) - :pypi:`pytest-eth` PyTest plugin for testing Smart Contracts for Ethereum Virtual Machine (EVM). Aug 14, 2020 1 - Planning N/A - :pypi:`pytest-ethereum` pytest-ethereum: Pytest library for ethereum projects. Jun 24, 2019 3 - Alpha pytest (==3.3.2); extra == 'dev' - :pypi:`pytest-eucalyptus` Pytest Plugin for BDD Aug 13, 2019 N/A pytest (>=4.2.0) - :pypi:`pytest-eventlet` Applies eventlet monkey-patch as a pytest plugin. Oct 04, 2021 N/A pytest ; extra == 'dev' - :pypi:`pytest-excel` pytest plugin for generating excel reports Jan 31, 2022 5 - Production/Stable N/A - :pypi:`pytest-exceptional` Better exceptions Mar 16, 2017 4 - Beta N/A - :pypi:`pytest-exception-script` Walk your code through exception script to check it's resiliency to failures. Aug 04, 2020 3 - Alpha pytest - :pypi:`pytest-executable` pytest plugin for testing executables Nov 10, 2021 4 - Beta pytest (<6.3,>=4.3) - :pypi:`pytest-execution-timer` A timer for the phases of Pytest's execution. Dec 24, 2021 4 - Beta N/A - :pypi:`pytest-expect` py.test plugin to store test expectations and mark tests based on them Apr 21, 2016 4 - Beta N/A - :pypi:`pytest-expecter` Better testing with expecter and pytest. Jan 10, 2022 5 - Production/Stable N/A - :pypi:`pytest-expectr` This plugin is used to expect multiple assert using pytest framework. Oct 05, 2018 N/A pytest (>=2.4.2) - :pypi:`pytest-experiments` A pytest plugin to help developers of research-oriented software projects keep track of the results of their numerical experiments. Dec 13, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-explicit` A Pytest plugin to ignore certain marked tests by default Jun 15, 2021 5 - Production/Stable pytest - :pypi:`pytest-exploratory` Interactive console for pytest. Feb 21, 2022 N/A pytest (>=6.2) - :pypi:`pytest-external-blockers` a special outcome for tests that are blocked for external reasons Oct 05, 2021 N/A pytest - :pypi:`pytest-extra-durations` A pytest plugin to get durations on a per-function basis and per module basis. Apr 21, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-fabric` Provides test utilities to run fabric task tests by using docker containers Sep 12, 2018 5 - Production/Stable N/A - :pypi:`pytest-factory` Use factories for test setup with py.test Sep 06, 2020 3 - Alpha pytest (>4.3) - :pypi:`pytest-factoryboy` Factory Boy support for pytest. May 02, 2022 6 - Mature pytest (>=5.0.0) - :pypi:`pytest-factoryboy-fixtures` Generates pytest fixtures that allow the use of type hinting Jun 25, 2020 N/A N/A - :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-failed-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A - :pypi:`pytest-failed-to-verify` A pytest plugin that helps better distinguishing real test failures from setup flakiness. Aug 08, 2019 5 - Production/Stable pytest (>=4.1.0) - :pypi:`pytest-fail-slow` Fail tests that take too long to run Apr 25, 2022 4 - Beta pytest (>=6.0) - :pypi:`pytest-faker` Faker integration with the pytest framework. Dec 19, 2016 6 - Mature N/A - :pypi:`pytest-falcon` Pytest helpers for Falcon. Sep 07, 2016 4 - Beta N/A - :pypi:`pytest-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A - :pypi:`pytest-fantasy` Pytest plugin for Flask Fantasy Framework Mar 14, 2019 N/A N/A - :pypi:`pytest-fastapi` Dec 27, 2020 N/A N/A - :pypi:`pytest-fastest` Use SCM and coverage to run only needed tests Mar 05, 2020 N/A N/A - :pypi:`pytest-fast-first` Pytest plugin that runs fast tests first Apr 02, 2021 3 - Alpha pytest - :pypi:`pytest-faulthandler` py.test plugin that activates the fault handler module for tests (dummy package) Jul 04, 2019 6 - Mature pytest (>=5.0) - :pypi:`pytest-fauxfactory` Integration of fauxfactory into pytest. Dec 06, 2017 5 - Production/Stable pytest (>=3.2) - :pypi:`pytest-figleaf` py.test figleaf coverage plugin Jan 18, 2010 5 - Production/Stable N/A - :pypi:`pytest-filecov` A pytest plugin to detect unused files Jun 27, 2021 4 - Beta pytest - :pypi:`pytest-filedata` easily load data from files Jan 17, 2019 4 - Beta N/A - :pypi:`pytest-filemarker` A pytest plugin that runs marked tests when files change. Dec 01, 2020 N/A pytest - :pypi:`pytest-filter-case` run test cases filter by mark Nov 05, 2020 N/A N/A - :pypi:`pytest-filter-subpackage` Pytest plugin for filtering based on sub-packages Jan 09, 2020 3 - Alpha pytest (>=3.0) - :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Apr 09, 2022 4 - Beta pytest (>=4.3.0) - :pypi:`pytest-finer-verdicts` A pytest plugin to treat non-assertion failures as test errors. Jun 18, 2020 N/A pytest (>=5.4.3) - :pypi:`pytest-firefox` pytest plugin to manipulate firefox Aug 08, 2017 3 - Alpha pytest (>=3.0.2) - :pypi:`pytest-fixture-config` Fixture configuration utils for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-fixture-maker` Pytest plugin to load fixtures from YAML files Sep 21, 2021 N/A N/A - :pypi:`pytest-fixture-marker` A pytest plugin to add markers based on fixtures used. Oct 11, 2020 5 - Production/Stable N/A - :pypi:`pytest-fixture-order` pytest plugin to control fixture evaluation order Aug 25, 2020 N/A pytest (>=3.0) - :pypi:`pytest-fixture-rtttg` Warn or fail on fixture name clash Feb 23, 2022 N/A pytest (>=7.0.1,<8.0.0) - :pypi:`pytest-fixtures` Common fixtures for pytest May 01, 2019 5 - Production/Stable N/A - :pypi:`pytest-fixture-tools` Plugin for pytest which provides tools for fixtures Aug 18, 2020 6 - Mature pytest - :pypi:`pytest-fixture-typecheck` A pytest plugin to assert type annotations at runtime. Aug 24, 2021 N/A pytest - :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Mar 18, 2022 4 - Beta pytest (>=7.0) - :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. Jan 10, 2022 5 - Production/Stable pytest - :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Mar 01, 2022 5 - Production/Stable pytest (>=7.0) - :pypi:`pytest-flakefinder` Runs tests multiple times to expose flakiness. Jul 28, 2020 4 - Beta pytest (>=2.7.1) - :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) - :pypi:`pytest-flaptastic` Flaptastic py.test plugin Mar 17, 2019 N/A N/A - :pypi:`pytest-flask` A set of py.test fixtures to test Flask applications. Feb 27, 2021 5 - Production/Stable pytest (>=5.2) - :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) - :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) - :pypi:`pytest-flyte` Pytest fixtures for simplifying Flyte integration testing May 03, 2021 N/A pytest - :pypi:`pytest-focus` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest - :pypi:`pytest-forcefail` py.test plugin to make the test failing regardless of pytest.mark.xfail May 15, 2018 4 - Beta N/A - :pypi:`pytest-forward-compatability` A name to avoid typosquating pytest-foward-compatibility Sep 06, 2020 N/A N/A - :pypi:`pytest-forward-compatibility` A pytest plugin to shim pytest commandline options for fowards compatibility Sep 29, 2020 N/A N/A - :pypi:`pytest-freezegun` Wrap tests with fixtures in freeze_time Jul 19, 2020 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-freeze-reqs` Check if requirement files are frozen Apr 29, 2021 N/A N/A - :pypi:`pytest-frozen-uuids` Deterministically frozen UUID's for your tests Apr 17, 2022 N/A pytest (>=3.0) - :pypi:`pytest-func-cov` Pytest plugin for measuring function coverage Apr 15, 2021 3 - Alpha pytest (>=5) - :pypi:`pytest-funparam` An alternative way to parametrize test cases. Dec 02, 2021 4 - Beta pytest >=4.6.0 - :pypi:`pytest-fxa` pytest plugin for Firefox Accounts Aug 28, 2018 5 - Production/Stable N/A - :pypi:`pytest-fxtest` Oct 27, 2020 N/A N/A - :pypi:`pytest-gather-fixtures` set up asynchronous pytest fixtures concurrently Apr 12, 2022 N/A pytest (>=6.0.0) - :pypi:`pytest-gc` The garbage collector plugin for py.test Feb 01, 2018 N/A N/A - :pypi:`pytest-gcov` Uses gcov to measure test coverage of a C library Feb 01, 2018 3 - Alpha N/A - :pypi:`pytest-gevent` Ensure that gevent is properly patched when invoking pytest Feb 25, 2020 N/A pytest - :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) - :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest - :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. May 04, 2022 N/A N/A - :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A - :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest - :pypi:`pytest-github` Plugin for py.test that associates tests with github issues using a marker. Mar 07, 2019 5 - Production/Stable N/A - :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Dec 08, 2021 N/A pytest (>=4.0.0) - :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A - :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Nov 26, 2021 4 - Beta pytest - :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest - :pypi:`pytest-golden` Plugin for pytest that offloads expected outputs to data files Nov 23, 2020 N/A pytest (>=6.1.2,<7.0.0) - :pypi:`pytest-google-chat` Notify google chat channel for test results Mar 27, 2022 4 - Beta pytest - :pypi:`pytest-graphql-schema` Get graphql schema as fixture for pytest Oct 18, 2019 N/A N/A - :pypi:`pytest-greendots` Green progress dots Feb 08, 2014 3 - Alpha N/A - :pypi:`pytest-growl` Growl notifications for pytest results. Jan 13, 2014 5 - Production/Stable N/A - :pypi:`pytest-grpc` pytest plugin for grpc May 01, 2020 N/A pytest (>=3.6.0) - :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest - :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Apr 01, 2021 5 - Production/Stable N/A - :pypi:`pytest-helm-chart` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jun 15, 2020 4 - Beta pytest (>=5.4.2,<6.0.0) - :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jan 10, 2022 4 - Beta pytest (>=6.1.2,<7.0.0) - :pypi:`pytest-helper` Functions to help in using the pytest testing framework May 31, 2019 5 - Production/Stable N/A - :pypi:`pytest-helpers` pytest helpers May 17, 2020 N/A pytest - :pypi:`pytest-helpers-namespace` Pytest Helpers Namespace Plugin Dec 29, 2021 5 - Production/Stable pytest (>=6.0.0) - :pypi:`pytest-hidecaptured` Hide captured output May 04, 2018 4 - Beta pytest (>=2.8.5) - :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest - :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest - :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components May 07, 2022 3 - Alpha pytest (==7.1.1) - :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A - :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) - :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 22, 2022 5 - Production/Stable N/A - :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) - :pypi:`pytest-html` pytest plugin for generating HTML reports Dec 13, 2020 5 - Production/Stable pytest (!=6.0.0,>=5.0) - :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-html-merger` Pytest HTML reports merging utility Apr 03, 2022 N/A N/A - :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Mar 04, 2022 5 - Production/Stable N/A - :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) - :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A - :pypi:`pytest-html-thread` pytest plugin for generating HTML reports Dec 29, 2020 5 - Production/Stable N/A - :pypi:`pytest-http` Fixture "http" for http requests Dec 05, 2019 N/A N/A - :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Mar 16, 2022 5 - Production/Stable pytest ; extra == 'test' - :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A - :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A - :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Jan 27, 2022 3 - Alpha N/A - :pypi:`pytest-httpx` Send responses to httpx. Feb 05, 2022 5 - Production/Stable pytest (<8.*,>=6.*) - :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) - :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A - :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest - :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A - :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jan 14, 2022 4 - Beta pytest - :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A - :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A - :pypi:`pytest-idem` A pytest plugin to help with testing idem projects May 04, 2022 5 - Production/Stable N/A - :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 30, 2022 N/A N/A - :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A - :pypi:`pytest-image-diff` Mar 17, 2022 3 - Alpha pytest - :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A - :pypi:`pytest-influxdb` Plugin for influxdb and pytest integration. Apr 20, 2021 N/A N/A - :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A - :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A - :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A - :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A - :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Apr 26, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Apr 29, 2022 5 - Production/Stable N/A - :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A - :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) - :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) - :pypi:`pytest-instrument` pytest plugin to instrument tests Apr 05, 2020 5 - Production/Stable pytest (>=5.1.0) - :pypi:`pytest-integration` Organizing pytests by integration or not Apr 16, 2020 N/A N/A - :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) - :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A - :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) - :pypi:`pytest-invenio` Pytest fixtures for Invenio. May 05, 2022 5 - Production/Stable pytest (<7,>=6) - :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A - :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A - :pypi:`pytest-isort` py.test plugin to check import ordering using isort Feb 08, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. Jan 10, 2022 5 - Production/Stable pytest - :pypi:`pytest-it` Pytest plugin to display test reports as a plaintext spec, inspired by Rspec: https://github.com/mattduck/pytest-it. Jan 22, 2020 4 - Beta N/A - :pypi:`pytest-iterassert` Nicer list and iterable assertion messages for pytest May 11, 2020 3 - Alpha N/A - :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A - :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) - :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Mar 09, 2022 3 - Alpha pytest - :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest - :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) - :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A - :pypi:`pytest-jsonlint` UNKNOWN Aug 04, 2016 N/A N/A - :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Mar 15, 2022 4 - Beta pytest (>=3.8.0) - :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 24, 2021 N/A pytest - :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest - :pypi:`pytest-kexi` Apr 29, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Jan 24, 2021 5 - Production/Stable N/A - :pypi:`pytest-kivy` Kivy GUI tests fixtures using pytest Jul 06, 2021 4 - Beta pytest (>=3.6) - :pypi:`pytest-knows` A pytest plugin that can automaticly skip test case based on dependence info calculated by trace Aug 22, 2014 N/A N/A - :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A - :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A - :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) - :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. Aug 23, 2021 3 - Alpha pytest (>=3.6,<7) - :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A - :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A - :pypi:`pytest-lazy-fixture` It helps to use fixtures in pytest.mark.parametrize Feb 01, 2020 4 - Beta pytest (>=3.2.5) - :pypi:`pytest-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest - :pypi:`pytest-leak-finder` Find the previous test that makes another to fail Apr 18, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-leaks` A pytest plugin to trace resource leaks. Nov 27, 2019 1 - Planning N/A - :pypi:`pytest-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest - :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest. Dec 22, 2018 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Apr 14, 2022 4 - Beta N/A - :pypi:`pytest-libnotify` Pytest plugin that shows notifications about the test run Apr 02, 2021 3 - Alpha pytest - :pypi:`pytest-ligo` Jan 16, 2020 4 - Beta N/A - :pypi:`pytest-lineno` A pytest plugin to show the line numbers of test functions Dec 04, 2020 N/A pytest - :pypi:`pytest-line-profiler` Profile code executed by pytest May 03, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-lisa` Pytest plugin for organizing tests. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) - :pypi:`pytest-listener` A simple network listener May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-live` Live results for pytest Mar 08, 2020 N/A pytest - :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Aug 25, 2021 5 - Production/Stable pytest - :pypi:`pytest-localserver` py.test plugin to test server connections locally. May 05, 2022 4 - Beta N/A - :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Aug 22, 2019 4 - Beta pytest (>=3.3.0) - :pypi:`pytest-lockable` lockable resource plugin for pytest Feb 28, 2022 5 - Production/Stable pytest - :pypi:`pytest-locker` Used to lock object during testing. Essentially changing assertions from being hard coded to asserting that nothing changed Oct 29, 2021 N/A pytest (>=5.4) - :pypi:`pytest-log` print log Aug 15, 2021 N/A pytest (>=3.8) - :pypi:`pytest-logbook` py.test plugin to capture logbook log messages Nov 23, 2015 5 - Production/Stable pytest (>=2.8) - :pypi:`pytest-logdog` Pytest plugin to test logging Jun 15, 2021 1 - Planning pytest (>=6.2.0) - :pypi:`pytest-logfest` Pytest plugin providing three logger fixtures with basic or full writing to log files Jul 21, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-logger` Plugin configuring handlers for loggers from Python logging module. Jul 25, 2019 4 - Beta pytest (>=3.2) - :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A - :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A - :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Apr 18, 2022 3 - Alpha pytest - :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha pytest (>=6) - :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) - :pypi:`pytest-markdown-docs` Run markdown code fences through pytest Apr 07, 2022 N/A N/A - :pypi:`pytest-marker-bugzilla` py.test bugzilla integration plugin, using markers Jan 09, 2020 N/A N/A - :pypi:`pytest-markers-presence` A simple plugin to detect missed pytest tags and markers" Feb 04, 2021 4 - Beta pytest (>=6.0) - :pypi:`pytest-markfiltration` UNKNOWN Nov 08, 2011 3 - Alpha N/A - :pypi:`pytest-mark-no-py3` pytest plugin and bowler codemod to help migrate tests to Python 3 May 17, 2019 N/A pytest - :pypi:`pytest-marks` UNKNOWN Nov 23, 2012 3 - Alpha N/A - :pypi:`pytest-matcher` Match test output against patterns stored in files Dec 10, 2021 5 - Production/Stable N/A - :pypi:`pytest-match-skip` Skip matching marks. Matches partial marks using wildcards. May 15, 2019 4 - Beta pytest (>=4.4.1) - :pypi:`pytest-mat-report` this is report Jan 20, 2021 N/A N/A - :pypi:`pytest-matrix` Provide tools for generating tests from combinations of fixtures. Jun 24, 2020 5 - Production/Stable pytest (>=5.4.3,<6.0.0) - :pypi:`pytest-mccabe` pytest plugin to run the mccabe code complexity checker. Jul 22, 2020 3 - Alpha pytest (>=5.4.0) - :pypi:`pytest-md` Plugin for generating Markdown reports for pytest results Jul 11, 2019 3 - Alpha pytest (>=4.2.1) - :pypi:`pytest-md-report` A pytest plugin to make a test results report with Markdown table format. Feb 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) - :pypi:`pytest-memprof` Estimates memory consumption of test functions Mar 29, 2019 4 - Beta N/A - :pypi:`pytest-memray` A simple plugin to use with pytest Apr 19, 2022 N/A N/A - :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) - :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution May 03, 2022 N/A pytest (>=6.2.5) - :pypi:`pytest-messenger` Pytest to Slack reporting plugin Feb 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-metadata` pytest plugin for test session metadata Mar 26, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) - :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest - :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) - :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) - :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-ml` Test your machine learning! May 04, 2019 4 - Beta N/A - :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) - :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Jan 28, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-mock-api` A mock API server with configurable routes and responses available as a fixture. Feb 13, 2019 1 - Planning pytest (>=4.0.0) - :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator Mar 08, 2022 5 - Production/Stable N/A - :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest - :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A - :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Apr 11, 2022 N/A pytest (>=1.0) - :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) - :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A - :pypi:`pytest-modifyjunit` Utility for adding additional properties to junit xml for IDM QE Jan 10, 2019 N/A N/A - :pypi:`pytest-modifyscope` pytest plugin to modify fixture scope Apr 12, 2020 N/A pytest - :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Mar 29, 2022 5 - Production/Stable pytest (>=7.0.0) - :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Jun 07, 2021 5 - Production/Stable pytest - :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures Dec 07, 2019 5 - Production/Stable pytest (>=2.5.2) - :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Dec 23, 2021 5 - Production/Stable pytest - :pypi:`pytest-monkeyplus` pytest's monkeypatch subclass with extra functionalities Sep 18, 2012 5 - Production/Stable N/A - :pypi:`pytest-monkeytype` pytest-monkeytype: Generate Monkeytype annotations from your pytest tests. Jul 29, 2020 4 - Beta N/A - :pypi:`pytest-moto` Fixtures for integration tests of AWS services,uses moto mocking library. Aug 28, 2015 1 - Planning N/A - :pypi:`pytest-motor` A pytest plugin for motor, the non-blocking MongoDB driver. Jul 21, 2021 3 - Alpha pytest - :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest - :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest - :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Apr 22, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Feb 28, 2022 4 - Beta pytest - :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest - :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A - :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A - :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Aug 12, 2021 N/A pytest (>=3.6) - :pypi:`pytest-multithreading-allure` pytest_multithreading_allure Mar 22, 2022 N/A N/A - :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) - :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Feb 07, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" - :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" - :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Jan 11, 2022 3 - Alpha pytest (>=6.0.0) - :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A N/A - :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Mar 02, 2022 N/A N/A - :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 15, 2022 5 - Production/Stable pytest (>=6.2) - :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) - :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) - :pypi:`pytest-network` A simple plugin to disable network on socket level. May 07, 2020 N/A N/A - :pypi:`pytest-network-endpoints` Network endpoints plugin for pytest Mar 06, 2022 N/A pytest - :pypi:`pytest-never-sleep` pytest plugin helps to avoid adding tests without mock \`time.sleep\` May 05, 2021 3 - Alpha pytest (>=3.5.1) - :pypi:`pytest-nginx` nginx fixture for pytest Aug 12, 2017 5 - Production/Stable N/A - :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A - :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest - :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Mar 15, 2022 N/A pytest (==6.2.5) - :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest - :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A - :pypi:`pytest-nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Jul 07, 2021 N/A N/A - :pypi:`pytest-nocustom` Run all tests without custom markers Jul 07, 2021 5 - Production/Stable N/A - :pypi:`pytest-nodev` Test-driven source code search for Python. Jul 21, 2016 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-nogarbage` Ensure a test produces no garbage Aug 29, 2021 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-notice` Send pytest execution result email Nov 05, 2020 N/A N/A - :pypi:`pytest-notification` A pytest plugin for sending a desktop notification and playing a sound upon completion of tests Jun 19, 2020 N/A pytest (>=4) - :pypi:`pytest-notifier` A pytest plugin to notify test result Jun 12, 2020 3 - Alpha pytest - :pypi:`pytest-notimplemented` Pytest markers for not implemented features and tests. Aug 27, 2019 N/A pytest (>=5.1,<6.0) - :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A - :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Mar 16, 2022 4 - Beta pytest (>=4.6.0) - :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A - :pypi:`pytest-odoo` py.test plugin to run Odoo tests Feb 08, 2022 4 - Beta N/A - :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A - :pypi:`pytest-oerp` pytest plugin to test OpenERP modules Feb 28, 2012 3 - Alpha N/A - :pypi:`pytest-ok` The ultimate pytest output plugin Apr 01, 2019 4 - Beta N/A - :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jan 19, 2020 N/A N/A - :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A - :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) - :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest - :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators May 04, 2022 N/A pytest - :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A - :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) - :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A - :pypi:`pytest-order` pytest plugin to run your tests in a specific order Jan 09, 2022 4 - Beta pytest (>=5.0) ; python_version < "3.10" - :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest - :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A - :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Mar 24, 2022 N/A N/A - :pypi:`pytest-owner` Add owner mark for tests Apr 25, 2022 N/A N/A - :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A - :pypi:`pytest-pahrametahrize` Parametrize your tests with a Boston accent. Nov 24, 2021 4 - Beta pytest (>=6.0,<7.0) - :pypi:`pytest-parallel` a pytest plugin for parallel and concurrent testing Oct 10, 2021 3 - Alpha pytest (>=3.0.0) - :pypi:`pytest-parallel-39` a pytest plugin for parallel and concurrent testing Jul 12, 2021 3 - Alpha pytest (>=3.0.0) - :pypi:`pytest-param` pytest plugin to test all, first, last or random params Sep 11, 2016 4 - Beta pytest (>=2.6.0) - :pypi:`pytest-paramark` Configure pytest fixtures using a combination of"parametrize" and markers Jan 10, 2020 4 - Beta pytest (>=4.5.0) - :pypi:`pytest-parametrization` Simpler PyTest parametrization Nov 30, 2021 5 - Production/Stable pytest - :pypi:`pytest-parametrize-cases` A more user-friendly way to write parametrized tests. Mar 13, 2022 N/A pytest (>=6.1.2) - :pypi:`pytest-parametrized` Pytest plugin for parametrizing tests with default iterables. Oct 19, 2020 5 - Production/Stable pytest - :pypi:`pytest-parawtf` Finally spell paramete?ri[sz]e correctly Dec 03, 2018 4 - Beta pytest (>=3.6.0) - :pypi:`pytest-pass` Check out https://github.com/elilutsky/pytest-pass Dec 04, 2019 N/A N/A - :pypi:`pytest-passrunner` Pytest plugin providing the 'run_on_pass' marker Feb 10, 2021 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-paste-config` Allow setting the path to a paste config file Sep 18, 2013 3 - Alpha N/A - :pypi:`pytest-patches` A contextmanager pytest fixture for handling multiple mock patches Aug 30, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-pdb` pytest plugin which adds pdb helper commands related to pytest. Jul 31, 2018 N/A N/A - :pypi:`pytest-peach` pytest plugin for fuzzing with Peach API Security Apr 12, 2019 4 - Beta pytest (>=2.8.7) - :pypi:`pytest-pep257` py.test plugin for pep257 Jul 09, 2016 N/A N/A - :pypi:`pytest-pep8` pytest plugin to check PEP8 requirements Apr 27, 2014 N/A N/A - :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) - :pypi:`pytest-perf` pytest-perf Feb 05, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' - :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) - :pypi:`pytest-persistence` Pytest tool for persistent objects Apr 22, 2022 N/A N/A - :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 18, 2022 5 - Production/Stable pytest (>=6.0.0) - :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Apr 15, 2022 4 - Beta pytest (>=5.4.3) - :pypi:`pytest-picked` Run the tests related to the changed files Dec 23, 2020 N/A pytest (>=3.5.0) - :pypi:`pytest-pigeonhole` Jun 25, 2018 5 - Production/Stable pytest (>=3.4) - :pypi:`pytest-pikachu` Show surprise when tests are passing Aug 05, 2021 5 - Production/Stable pytest - :pypi:`pytest-pilot` Slice in your test base thanks to powerful markers. Oct 09, 2020 5 - Production/Stable N/A - :pypi:`pytest-pings` 🦊 The pytest plugin for Firefox Telemetry 📊 Jun 29, 2019 3 - Alpha pytest (>=5.0.0) - :pypi:`pytest-pinned` A simple pytest plugin for pinning tests Sep 17, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-pinpoint` A pytest plugin which runs SBFL algorithms to detect faults. Sep 25, 2020 N/A pytest (>=4.4.0) - :pypi:`pytest-pipeline` Pytest plugin for functional testing of data analysispipelines Jan 24, 2017 3 - Alpha N/A - :pypi:`pytest-platform-markers` Markers for pytest to skip tests on specific platforms Sep 09, 2019 4 - Beta pytest (>=3.6.0) - :pypi:`pytest-play` pytest plugin that let you automate actions and assertions with test metrics reporting executing plain YAML files Jun 12, 2019 5 - Production/Stable N/A - :pypi:`pytest-playbook` Pytest plugin for reading playbooks. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) - :pypi:`pytest-playwright` A pytest wrapper with fixtures for Playwright to automate web browsers Mar 16, 2022 N/A pytest - :pypi:`pytest-playwrights` A pytest wrapper with fixtures for Playwright to automate web browsers Dec 02, 2021 N/A N/A - :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A - :pypi:`pytest-playwright-visual` A pytest fixture for visual testing with Playwright Apr 28, 2022 N/A N/A - :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Aug 17, 2020 5 - Production/Stable pytest - :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Mar 19, 2020 5 - Production/Stable pytest (>=3.50) - :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A - :pypi:`pytest-pointers` Pytest plugin to define functions you test with special marks for better navigation and reports Oct 14, 2021 N/A N/A - :pypi:`pytest-polarion-cfme` pytest plugin for collecting test cases and recording test results Nov 13, 2017 3 - Alpha N/A - :pypi:`pytest-polarion-collect` pytest plugin for collecting polarion test cases data Jun 18, 2020 3 - Alpha pytest - :pypi:`pytest-polecat` Provides Polecat pytest fixtures Aug 12, 2019 4 - Beta N/A - :pypi:`pytest-ponyorm` PonyORM in Pytest Oct 31, 2018 N/A pytest (>=3.1.1) - :pypi:`pytest-poo` Visualize your crappy tests Mar 25, 2021 5 - Production/Stable pytest (>=2.3.4) - :pypi:`pytest-poo-fail` Visualize your failed tests with poo Feb 12, 2015 5 - Production/Stable N/A - :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Apr 20, 2022 5 - Production/Stable pytest - :pypi:`pytest-portion` Select a portion of the collected tests Jan 28, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest - :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) - :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) - :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 27, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) - :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 31, 2022 N/A pytest (>=3.4.1) - :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A - :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Dec 28, 2021 5 - Production/Stable pytest (>=6) - :pypi:`pytest-profiles` pytest plugin for configuration profiles Dec 09, 2021 4 - Beta pytest (>=3.7.0) - :pypi:`pytest-profiling` Profiling plugin for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-progress` pytest plugin for instant test progress status Jan 31, 2022 5 - Production/Stable N/A - :pypi:`pytest-prometheus` Report test pass / failures to a Prometheus PushGateway Oct 03, 2017 N/A N/A - :pypi:`pytest-prometheus-pushgateway` Pytest report plugin for Zulip May 05, 2022 5 - Production/Stable pytest - :pypi:`pytest-prosper` Test helpers for Prosper projects Sep 24, 2018 N/A N/A - :pypi:`pytest-pspec` A rspec format reporter for Python ptest Jun 02, 2020 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-psqlgraph` pytest plugin for testing applications that use psqlgraph Oct 19, 2021 4 - Beta pytest (>=6.0) - :pypi:`pytest-ptera` Use ptera probes in tests Mar 01, 2022 N/A pytest (>=6.2.4,<7.0.0) - :pypi:`pytest-pudb` Pytest PuDB debugger integration Oct 25, 2018 3 - Alpha pytest (>=2.0) - :pypi:`pytest-purkinje` py.test plugin for purkinje test runner Oct 28, 2017 2 - Pre-Alpha N/A - :pypi:`pytest-pycharm` Plugin for py.test to enter PyCharm debugger on uncaught exceptions Aug 13, 2020 5 - Production/Stable pytest (>=2.3) - :pypi:`pytest-pycodestyle` pytest plugin to run pycodestyle Mar 13, 2022 3 - Alpha N/A - :pypi:`pytest-pydev` py.test plugin to connect to a remote debug server with PyDev or PyCharm. Nov 15, 2017 3 - Alpha N/A - :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Mar 13, 2022 3 - Alpha N/A - :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) - :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A - :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) - :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-pyq` Pytest fixture "q" for pyq Mar 10, 2020 5 - Production/Stable N/A - :pypi:`pytest-pyramid` pytest_pyramid - provides fixtures for testing pyramid applications with pytest test suite Oct 15, 2021 5 - Production/Stable pytest - :pypi:`pytest-pyramid-server` Pyramid server fixture for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-pyright` Pytest plugin for type checking code with Pyright Aug 16, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.0) - :pypi:`pytest-pythonpath` pytest plugin for adding to the PYTHONPATH from command line or configs. Feb 10, 2022 5 - Production/Stable pytest (<7,>=2.5.2) - :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest - :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) - :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Jun 26, 2021 4 - Beta pytest (>=6.2.0) - :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Mar 17, 2022 5 - Production/Stable pytest (>=6.2.3) - :pypi:`pytest-qml` Run QML Tests with pytest Dec 02, 2020 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-qr` pytest plugin to generate test result QR codes Nov 25, 2021 4 - Beta N/A - :pypi:`pytest-qt` pytest support for PyQt and PySide applications Jun 13, 2021 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-qt-app` QT app fixture for py.test Dec 23, 2015 5 - Production/Stable N/A - :pypi:`pytest-quarantine` A plugin for pytest to manage expected test failures Nov 24, 2019 5 - Production/Stable pytest (>=4.6) - :pypi:`pytest-quickcheck` pytest plugin to generate random data inspired by QuickCheck Nov 15, 2020 4 - Beta pytest (<6.0.0,>=4.0) - :pypi:`pytest-rabbitmq` RabbitMQ process and client fixtures for pytest Feb 11, 2022 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-race` Race conditions tester for pytest Nov 21, 2016 4 - Beta N/A - :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A - :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results May 02, 2022 N/A pytest (>=3.6) - :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Apr 12, 2022 5 - Production/Stable pytest - :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) - :pypi:`pytest-raisesregexp` Simple pytest plugin to look for regex in Exceptions Dec 18, 2015 N/A N/A - :pypi:`pytest-raisin` Plugin enabling the use of exception instances with pytest.raises Feb 06, 2022 N/A pytest - :pypi:`pytest-random` py.test plugin to randomize tests Apr 28, 2013 3 - Alpha N/A - :pypi:`pytest-randomly` Pytest plugin to randomly order tests and control random.seed. Jan 10, 2022 5 - Production/Stable pytest - :pypi:`pytest-randomness` Pytest plugin about random seed management May 30, 2019 3 - Alpha N/A - :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A - :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-readme` Test your README.md file Dec 28, 2014 5 - Production/Stable N/A - :pypi:`pytest-reana` Pytest fixtures for REANA. Mar 31, 2022 3 - Alpha N/A - :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jul 08, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A - :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) - :pypi:`pytest-redislite` Pytest plugin for testing code using Redis Apr 05, 2022 4 - Beta pytest - :pypi:`pytest-redmine` Pytest plugin for redmine Mar 19, 2018 1 - Planning N/A - :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A - :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Jan 19, 2022 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-regtest` pytest plugin for regression tests Jun 03, 2021 N/A N/A - :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A - :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Jun 14, 2019 5 - Production/Stable pytest (<5,>=3) - :pypi:`pytest-remfiles` Pytest plugin to create a temporary directory with remote files Jul 01, 2019 5 - Production/Stable N/A - :pypi:`pytest-remotedata` Pytest plugin for controlling remote data access. Dec 21, 2021 3 - Alpha pytest (>=4.6) - :pypi:`pytest-remote-response` Pytest plugin for capturing and mocking connection requests. Jun 30, 2021 4 - Beta pytest (>=4.6) - :pypi:`pytest-remove-stale-bytecode` py.test plugin to remove stale byte code files. Mar 04, 2020 4 - Beta pytest - :pypi:`pytest-reorder` Reorder tests depending on their paths and names. May 31, 2018 4 - Beta pytest - :pypi:`pytest-repeat` pytest plugin for repeating tests Oct 31, 2020 5 - Production/Stable pytest (>=3.6) - :pypi:`pytest-replay` Saves previous test runs and allow re-execute previous pytest runs to reproduce crashes or flaky tests Jun 09, 2021 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-repo-health` A pytest plugin to report on repository standards conformance Dec 16, 2021 3 - Alpha pytest - :pypi:`pytest-report` Creates json report that is compatible with atom.io's linter message format May 11, 2016 4 - Beta N/A - :pypi:`pytest-reporter` Generate Pytest reports with templates Jul 22, 2021 4 - Beta pytest - :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest Jun 08, 2021 4 - Beta N/A - :pypi:`pytest-reportinfra` Pytest plugin for reportinfra Aug 11, 2019 3 - Alpha N/A - :pypi:`pytest-reporting` A plugin to report summarized results in a table format Oct 25, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility Dec 11, 2020 3 - Alpha pytest (>=5.2) - :pypi:`pytest-report-me` A pytest plugin to generate report. Dec 31, 2020 N/A pytest - :pypi:`pytest-report-parameters` pytest plugin for adding tests' parameters to junit report Jun 18, 2020 3 - Alpha pytest (>=2.4.2) - :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Apr 26, 2022 N/A pytest (>=3.8.0) - :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) - :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Jun 17, 2021 5 - Production/Stable pytest (>=4.6) - :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) - :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) - :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Apr 13, 2022 N/A N/A - :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A - :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A - :pypi:`pytest-responses` py.test integration for responses Apr 26, 2021 N/A pytest (>=2.5) - :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed Jan 10, 2022 5 - Production/Stable pytest - :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A - :pypi:`pytest-reverse` Pytest plugin to reverse test order. Jan 10, 2022 5 - Production/Stable pytest - :pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0) - :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) - :pypi:`pytest-ringo` pytest plugin to test webapplications using the Ringo webframework Sep 27, 2017 3 - Alpha N/A - :pypi:`pytest-rng` Fixtures for seeding tests and making randomness reproducible Aug 08, 2019 5 - Production/Stable pytest - :pypi:`pytest-roast` pytest plugin for ROAST configuration override and fixtures Jul 29, 2021 5 - Production/Stable pytest - :pypi:`pytest-rocketchat` Pytest to Rocket.Chat reporting plugin Apr 18, 2021 5 - Production/Stable N/A - :pypi:`pytest-rotest` Pytest integration with rotest Sep 08, 2019 N/A pytest (>=3.5.0) - :pypi:`pytest-rpc` Extend py.test for RPC OpenStack testing. Feb 22, 2019 4 - Beta pytest (~=3.6) - :pypi:`pytest-rst` Test code from RST documents with pytest Sep 21, 2021 N/A pytest - :pypi:`pytest-rt` pytest data collector plugin for Testgr May 05, 2022 N/A N/A - :pypi:`pytest-rts` Coverage-based regression test selection (RTS) plugin for pytest May 17, 2021 N/A pytest - :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest - :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A - :pypi:`pytest-runner` Invoke py.test as distutils command with dependency resolution Feb 25, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' - :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A N/A - :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A - :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A - :pypi:`pytest-salt-factories` Pytest Salt Plugin Apr 06, 2022 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) - :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) - :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) - :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A - :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. May 02, 2022 5 - Production/Stable N/A - :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A - :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A - :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) - :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. May 02, 2022 5 - Production/Stable N/A - :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A - :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A - :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A - :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest - :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. Nov 27, 2021 4 - Beta N/A - :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A - :pypi:`pytest-session2file` pytest-session2file (aka: pytest-session_to_file for v0.1.0 - v0.1.2) is a py.test plugin for capturing and saving to file the stdout of py.test. Jan 26, 2021 3 - Alpha pytest - :pypi:`pytest-session-fixture-globalize` py.test plugin to make session fixtures behave as if written in conftest, even if it is written in some modules May 15, 2018 4 - Beta N/A - :pypi:`pytest-session_to_file` pytest-session_to_file is a py.test plugin for capturing and saving to file the stdout of py.test. Oct 01, 2015 3 - Alpha N/A - :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A - :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest - :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A - :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Feb 21, 2022 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest - :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 5 - Production/Stable pytest (>=3.5.1) - :pypi:`pytest-shortcuts` Expand command-line shortcuts listed in pytest configuration Oct 29, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-shutil` A goodie-bag of unix shell and environment tools for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-simplehttpserver` Simple pytest fixture to spin up an HTTP server Jun 24, 2021 4 - Beta N/A - :pypi:`pytest-simple-plugin` Simple pytest plugin Nov 27, 2019 N/A N/A - :pypi:`pytest-simple-settings` simple-settings plugin for pytest Nov 17, 2020 4 - Beta pytest - :pypi:`pytest-single-file-logging` Allow for multiple processes to log to a single file May 05, 2016 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-skip-markers` Pytest Salt Plugin Feb 22, 2022 5 - Production/Stable pytest (>=6.0.0) - :pypi:`pytest-skipper` A plugin that selects only tests with changes in execution path Mar 26, 2017 3 - Alpha pytest (>=3.0.6) - :pypi:`pytest-skippy` Automatically skip tests that don't need to run! Jan 27, 2018 3 - Alpha pytest (>=2.3.4) - :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Apr 26, 2022 N/A N/A - :pypi:`pytest-slack` Pytest to Slack reporting plugin Dec 15, 2020 5 - Production/Stable N/A - :pypi:`pytest-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A - :pypi:`pytest-smartcollect` A plugin for collecting tests that touch changed code Oct 04, 2018 N/A pytest (>=3.5.0) - :pypi:`pytest-smartcov` Smart coverage plugin for pytest. Sep 30, 2017 3 - Alpha N/A - :pypi:`pytest-smell` Automated bad smell detection tool for Pytest May 02, 2022 N/A N/A - :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest - :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) - :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A - :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Apr 23, 2022 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-snmpserver` May 12, 2021 N/A N/A - :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Jan 05, 2022 4 - Beta pytest (>=6.2.0) - :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Jan 23, 2022 4 - Beta pytest (>=3.6.3) - :pypi:`pytest-soft-assertions` May 05, 2020 3 - Alpha pytest - :pypi:`pytest-solidity` A PyTest library plugin for Solidity language. Jan 15, 2022 1 - Planning pytest (<7,>=6.0.1) ; extra == 'tests' - :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) - :pypi:`pytest-sorter` A simple plugin to first execute tests that historically failed more Apr 20, 2021 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Apr 11, 2022 2 - Pre-Alpha pytest - :pypi:`pytest-sourceorder` Test-ordering plugin for pytest Sep 01, 2021 4 - Beta pytest - :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. Feb 23, 2020 4 - Beta pytest - :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A - :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. May 04, 2021 N/A N/A - :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Mar 30, 2022 4 - Beta pytest (>=7.0.0) - :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A - :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A - :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Dec 22, 2021 6 - Mature pytest (>=6.2.4) - :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Apr 22, 2022 4 - Beta pytest (>=5,<8) - :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) - :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) - :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Apr 19, 2022 N/A pytest (>5.4.0,<6.3) - :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A - :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) - :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A - :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Mar 13, 2018 3 - Alpha N/A - :pypi:`pytest-sql-bigquery` Yet another SQL-testing framework for BigQuery provided by pytest plugin Dec 19, 2019 N/A pytest - :pypi:`pytest-squadcast` Pytest report plugin for Squadcast Feb 22, 2022 5 - Production/Stable pytest - :pypi:`pytest-srcpaths` Add paths to sys.path Oct 15, 2021 N/A N/A - :pypi:`pytest-ssh` pytest plugin for ssh command run May 27, 2019 N/A pytest - :pypi:`pytest-start-from` Start pytest run from a given point Apr 11, 2016 N/A N/A - :pypi:`pytest-statsd` pytest plugin for reporting to graphite Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-stepfunctions` A small description May 08, 2021 4 - Beta pytest - :pypi:`pytest-steps` Create step-wise / incremental tests in pytest. Sep 23, 2021 5 - Production/Stable N/A - :pypi:`pytest-stepwise` Run a test suite one failing test at a time. Dec 01, 2015 4 - Beta N/A - :pypi:`pytest-stoq` A plugin to pytest stoq Feb 09, 2021 4 - Beta N/A - :pypi:`pytest-stress` A Pytest plugin that allows you to loop tests for a user defined amount of time. Dec 07, 2019 4 - Beta pytest (>=3.6.0) - :pypi:`pytest-structlog` Structured logging assertions Sep 21, 2021 N/A pytest - :pypi:`pytest-structmpd` provide structured temporary directory Oct 17, 2018 N/A N/A - :pypi:`pytest-stub` Stub packages, modules and attributes. Apr 28, 2020 5 - Production/Stable N/A - :pypi:`pytest-stubprocess` Provide stub implementations for subprocesses in Python tests Sep 17, 2018 3 - Alpha pytest (>=3.5.0) - :pypi:`pytest-study` A pytest plugin to organize long run tests (named studies) without interfering the regular tests Sep 26, 2017 3 - Alpha pytest (>=2.0) - :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Feb 09, 2022 5 - Production/Stable pytest (>=4.0.0) - :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Mar 02, 2021 N/A N/A - :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Feb 13, 2022 4 - Beta pytest (>=7.0) - :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A - :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Jul 06, 2020 3 - Alpha N/A - :pypi:`pytest-sugar-bugfix159` Workaround for https://github.com/Frozenball/pytest-sugar/issues/159 Nov 07, 2018 5 - Production/Stable pytest (!=3.7.3,>=3.5); extra == 'testing' - :pypi:`pytest-super-check` Pytest plugin to check your TestCase classes call super in setUp, tearDown, etc. Jan 10, 2022 5 - Production/Stable pytest - :pypi:`pytest-svn` SVN repository fixture for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-symbols` pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. Nov 20, 2017 3 - Alpha N/A - :pypi:`pytest-system-statistics` Pytest plugin to track and report system usage statistics Feb 16, 2022 5 - Production/Stable pytest (>=6.0.0) - :pypi:`pytest-system-test-plugin` Pyst - Pytest System-Test Plugin Feb 03, 2022 N/A N/A - :pypi:`pytest-takeltest` Fixtures for ansible, testinfra and molecule Jan 04, 2022 N/A N/A - :pypi:`pytest-talisker` Nov 28, 2021 N/A N/A - :pypi:`pytest-tap` Test Anything Protocol (TAP) reporting plugin for pytest Oct 27, 2021 5 - Production/Stable pytest (>=3.0) - :pypi:`pytest-tape` easy assertion with expected results saved to yaml files Mar 17, 2021 4 - Beta N/A - :pypi:`pytest-target` Pytest plugin for remote target orchestration. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) - :pypi:`pytest-tblineinfo` tblineinfo is a py.test plugin that insert the node id in the final py.test report when --tb=line option is used Dec 01, 2015 3 - Alpha pytest (>=2.0) - :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A - :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A - :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Jan 17, 2022 N/A pytest (>=6.0) - :pypi:`pytest-terraform-fixture` generate terraform resources to use with pytest Nov 14, 2018 4 - Beta N/A - :pypi:`pytest-testbook` A plugin to run tests written in Jupyter notebook Dec 11, 2016 3 - Alpha N/A - :pypi:`pytest-testconfig` Test configuration plugin for pytest. Jan 11, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-testdirectory` A py.test plugin providing temporary directories in unit tests. Feb 21, 2022 5 - Production/Stable pytest - :pypi:`pytest-testdox` A testdox format reporter for pytest Apr 19, 2022 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A - :pypi:`pytest-testinfra` Test infrastructures Apr 12, 2022 5 - Production/Stable pytest (!=3.0.2) - :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Mar 11, 2022 4 - Beta N/A - :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest - :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) - :pypi:`pytest-testrail2` A small example package Nov 17, 2020 N/A pytest (>=5) - :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Mar 11, 2022 N/A pytest (>=5.5) - :pypi:`pytest-testrail-api-client` TestRail Api Python Client Dec 14, 2021 N/A pytest - :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A - :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A - :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) - :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. May 05, 2022 N/A pytest (>=6.2.5) - :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Oct 08, 2021 N/A pytest (>=3.6) - :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest - :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A - :pypi:`pytest-testreport` Nov 12, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-testreport-new` May 05, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) - :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) - :pypi:`pytest-test-utils` Dec 14, 2021 N/A pytest (>=5) - :pypi:`pytest-tesults` Tesults plugin for pytest Dec 31, 2021 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-tezos` pytest-ligo Jan 16, 2020 4 - Beta N/A - :pypi:`pytest-thawgun` Pytest plugin for time travel May 26, 2020 3 - Alpha N/A - :pypi:`pytest-threadleak` Detects thread leaks Jan 18, 2022 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-tick` Ticking on tests Aug 31, 2021 5 - Production/Stable pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-timeit` A pytest plugin to time test function runs Oct 13, 2016 4 - Beta N/A - :pypi:`pytest-timeout` pytest plugin to abort hanging tests Jan 18, 2022 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-timeouts` Linux-only Pytest plugin to control durations of various test case execution phases Sep 21, 2019 5 - Production/Stable N/A - :pypi:`pytest-timer` A timer plugin for pytest Jun 02, 2021 N/A N/A - :pypi:`pytest-timestamper` Pytest plugin to add a timestamp prefix to the pytest output Jun 06, 2021 N/A N/A - :pypi:`pytest-timestamps` A simple plugin to view timestamps for each test Jan 16, 2022 N/A pytest (>=5.2) - :pypi:`pytest-tipsi-django` Nov 17, 2021 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-tipsi-testing` Better fixtures management. Various helpers Nov 04, 2020 4 - Beta pytest (>=3.3.0) - :pypi:`pytest-tldr` A pytest plugin that limits the output to just the things you need. Mar 12, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-tm4j-reporter` Cloud Jira Test Management (TM4J) PyTest reporter plugin Sep 01, 2020 N/A pytest - :pypi:`pytest-tmnet` A small example package Mar 01, 2022 N/A N/A - :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest - :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Nov 17, 2021 N/A N/A - :pypi:`pytest-todo` A small plugin for the pytest testing framework, marking TODO comments as failure May 23, 2019 4 - Beta pytest - :pypi:`pytest-tomato` Mar 01, 2019 5 - Production/Stable N/A - :pypi:`pytest-toolbelt` This is just a collection of utilities for pytest, but don't really belong in pytest proper. Aug 12, 2019 3 - Alpha N/A - :pypi:`pytest-toolbox` Numerous useful plugins for pytest. Apr 07, 2018 N/A pytest (>=3.5.0) - :pypi:`pytest-tornado` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Jun 17, 2020 5 - Production/Stable pytest (>=3.6) - :pypi:`pytest-tornado5` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Nov 16, 2018 5 - Production/Stable pytest (>=3.6) - :pypi:`pytest-tornado-yen3` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Oct 15, 2018 5 - Production/Stable N/A - :pypi:`pytest-tornasync` py.test plugin for testing Python 3.5+ Tornado code Jul 15, 2019 3 - Alpha pytest (>=3.0) - :pypi:`pytest-track` Feb 26, 2021 3 - Alpha pytest (>=3.0) - :pypi:`pytest-translations` Test your translation files. Nov 05, 2021 5 - Production/Stable N/A - :pypi:`pytest-travis-fold` Folds captured output sections in Travis CI build log Nov 29, 2017 4 - Beta pytest (>=2.6.0) - :pypi:`pytest-trello` Plugin for py.test that integrates trello using markers Nov 20, 2015 5 - Production/Stable N/A - :pypi:`pytest-trepan` Pytest plugin for trepan debugger. Jul 28, 2018 5 - Production/Stable N/A - :pypi:`pytest-trialtemp` py.test plugin for using the same _trial_temp working directory as trial Jun 08, 2015 N/A N/A - :pypi:`pytest-trio` Pytest plugin for trio Oct 16, 2020 N/A N/A - :pypi:`pytest-trytond` Pytest plugin for the Tryton server framework Feb 02, 2022 3 - Alpha pytest (>=5) - :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Apr 27, 2022 N/A pytest (>=5.0.0) - :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A - :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, automatically launched after your test run is finished May 02, 2022 4 - Beta pytest (>=6.2.5) - :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 5 - Production/Stable pytest (>=2.3) - :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Mar 07, 2022 4 - Beta N/A - :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) - :pypi:`pytest-ubersmith` Easily mock calls to ubersmith at the \`requests\` level. Apr 13, 2015 N/A N/A - :pypi:`pytest-ui` Text User Interface for running python tests Jul 05, 2021 4 - Beta pytest - :pypi:`pytest-unhandled-exception-exit-code` Plugin for py.test set a different exit code on uncaught exceptions Jun 22, 2020 5 - Production/Stable pytest (>=2.3) - :pypi:`pytest-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) - :pypi:`pytest-unmarked` Run only unmarked tests Aug 27, 2019 5 - Production/Stable N/A - :pypi:`pytest-unordered` Test equality of unordered collections in pytest Mar 28, 2021 4 - Beta N/A - :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Apr 12, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-upload-report` pytest-upload-report is a plugin for pytest that upload your test report for test results. Jun 18, 2021 5 - Production/Stable N/A - :pypi:`pytest-utils` Some helpers for pytest. Dec 04, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-vagrant` A py.test plugin providing access to vagrant. Sep 07, 2021 5 - Production/Stable pytest - :pypi:`pytest-valgrind` May 19, 2021 N/A N/A - :pypi:`pytest-variables` pytest plugin for providing variables to tests/fixtures Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) - :pypi:`pytest-variant` Variant support for Pytest Jun 20, 2021 N/A N/A - :pypi:`pytest-vcr` Plugin for managing VCR.py cassettes Apr 26, 2019 5 - Production/Stable pytest (>=3.6.0) - :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Apr 21, 2022 4 - Beta pytest (>=6.2.2,<7.0.0) - :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest - :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest - :pypi:`pytest-ver` Pytest module with Verification Report Apr 17, 2022 2 - Pre-Alpha N/A - :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) - :pypi:`pytest-virtualenv` Virtualenv fixture for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-voluptuous` Pytest plugin for asserting data against voluptuous schema. Jun 09, 2020 N/A pytest - :pypi:`pytest-vscodedebug` A pytest plugin to easily enable debugging tests within Visual Studio Code Dec 04, 2020 4 - Beta N/A - :pypi:`pytest-vts` pytest plugin for automatic recording of http stubbed tests Jun 05, 2019 N/A pytest (>=2.3) - :pypi:`pytest-vw` pytest-vw makes your failing test cases succeed under CI tools scrutiny Oct 07, 2015 4 - Beta N/A - :pypi:`pytest-vyper` Plugin for the vyper smart contract language. May 28, 2020 2 - Pre-Alpha N/A - :pypi:`pytest-wa-e2e-plugin` Pytest plugin for testing whatsapp bots with end to end tests Feb 18, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-watch` Local continuous test runner with pytest and watchdog. May 20, 2018 N/A N/A - :pypi:`pytest-watcher` Continiously runs pytest on changes in \*.py files Dec 30, 2021 3 - Alpha N/A - :pypi:`pytest-wdl` Pytest plugin for testing WDL workflows. Nov 17, 2020 5 - Production/Stable N/A - :pypi:`pytest-webdriver` Selenium webdriver fixture for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-wetest` Welian API Automation test framework pytest plugin Nov 10, 2018 4 - Beta N/A - :pypi:`pytest-whirlwind` Testing Tornado. Jun 12, 2020 N/A N/A - :pypi:`pytest-wholenodeid` pytest addon for displaying the whole node id for failures Aug 26, 2015 4 - Beta pytest (>=2.0) - :pypi:`pytest-win32consoletitle` Pytest progress in console title (Win32 only) Aug 08, 2021 N/A N/A - :pypi:`pytest-winnotify` Windows tray notifications for py.test results. Apr 22, 2016 N/A N/A - :pypi:`pytest-wiremock` A pytest plugin for programmatically using wiremock in integration tests Mar 27, 2022 N/A pytest (>=7.1.1,<8.0.0) - :pypi:`pytest-with-docker` pytest with docker helpers. Nov 09, 2021 N/A pytest - :pypi:`pytest-workflow` A pytest plugin for configuring workflow/pipeline tests using YAML files Dec 03, 2021 5 - Production/Stable pytest (>=5.4.0) - :pypi:`pytest-xdist` pytest xdist plugin for distributed testing and loop-on-failing modes Dec 10, 2021 5 - Production/Stable pytest (>=6.2.0) - :pypi:`pytest-xdist-debug-for-graingert` pytest xdist plugin for distributed testing and loop-on-failing modes Jul 24, 2019 5 - Production/Stable pytest (>=4.4.0) - :pypi:`pytest-xdist-forked` forked from pytest-xdist Feb 10, 2020 5 - Production/Stable pytest (>=4.4.0) - :pypi:`pytest-xdist-tracker` pytest plugin helps to reproduce failures for particular xdist node Nov 18, 2021 3 - Alpha pytest (>=3.5.1) - :pypi:`pytest-xfaillist` Maintain a xfaillist in an additional file to avoid merge-conflicts. Sep 17, 2021 N/A pytest (>=6.2.2,<7.0.0) - :pypi:`pytest-xfiles` Pytest fixtures providing data read from function, module or package related (x)files. Feb 27, 2018 N/A N/A - :pypi:`pytest-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A - :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest - :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Jul 28, 2021 4 - Beta pytest (>=2.8) - :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A - :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) - :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) - :pypi:`pytest-xvfb` A pytest plugin to run Xvfb for tests. Jun 09, 2020 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest - :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-yamlwsgi` Run tests against wsgi apps defined in yaml May 11, 2010 N/A N/A - :pypi:`pytest-yapf` Run yapf Jul 06, 2017 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) - :pypi:`pytest-yield` PyTest plugin to run tests concurrently, each \`yield\` switch context to other one Jan 23, 2019 N/A N/A - :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A - :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) - :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A - :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Apr 15, 2022 5 - Production/Stable pytest (>=4.5.0) - :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) - :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest - =============================================== ======================================================================================================================================================================== ============== ===================== ================================================ + =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ + name summary last release status requires + =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ + :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Apr 26, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) + :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-agent` Service that exposes a REST API that can be used to interract remotely with Pytest. It is shipped with a dashboard that enables running tests in a more convenient way. Nov 25, 2021 N/A N/A + :pypi:`pytest-aggreport` pytest plugin for pytest-repeat that generate aggregate report of the same test cases with additional statistics details. Mar 07, 2021 4 - Beta pytest (>=6.2.2) + :pypi:`pytest-aio` Pytest plugin for testing async python code Oct 20, 2021 4 - Beta pytest + :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A + :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Nov 01, 2020 N/A pytest (>=6) + :pypi:`pytest-aiomoto` pytest-aiomoto Mar 13, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) + :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A + :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Apr 10, 2022 N/A pytest (>=1.0) + :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest + :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) + :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) + :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Feb 21, 2022 N/A pytest + :pypi:`pytest-allure-dsl` pytest plugin to test case doc string dls instructions Oct 25, 2020 4 - Beta pytest + :pypi:`pytest-allure-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest + :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-android` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Feb 21, 2019 3 - Alpha pytest + :pypi:`pytest-anki` A pytest plugin for testing Anki add-ons Oct 14, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-annotate` pytest-annotate: Generate PyAnnotate annotations from your pytest tests. Nov 29, 2021 3 - Alpha pytest (<7.0.0,>=3.2.0) + :pypi:`pytest-ansible` Plugin for py.test to simplify calling ansible modules from tests or fixtures May 25, 2021 5 - Production/Stable N/A + :pypi:`pytest-ansible-playbook` Pytest fixture which runs given ansible playbook file. Mar 08, 2019 4 - Beta N/A + :pypi:`pytest-ansible-playbook-runner` Pytest fixture which runs given ansible playbook file. Dec 02, 2020 4 - Beta pytest (>=3.1.0) + :pypi:`pytest-ansible-units` A pytest plugin for running unit tests within an ansible collection Apr 14, 2022 N/A N/A + :pypi:`pytest-antilru` Bust functools.lru_cache when running pytest to avoid test pollution Jan 29, 2022 5 - Production/Stable pytest + :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest + :pypi:`pytest-anything` Pytest fixtures to assert anything and something Feb 18, 2021 N/A N/A + :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Nov 23, 2021 N/A pytest ; extra == 'test' + :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 12, 2022 N/A pytest (>=7.1.1,<8.0.0) + :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A + :pypi:`pytest-appengine` AppEngine integration that works well with pytest-django Feb 27, 2017 N/A N/A + :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A + :pypi:`pytest-approvaltests` A plugin to use approvaltests with pytest May 08, 2022 4 - Beta pytest (>=7.0.1) + :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) + :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 4 - Beta pytest (>=4.6) + :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) + :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A + :pypi:`pytest-assertions` Pytest Assertions Apr 27, 2022 N/A N/A + :pypi:`pytest-assertutil` pytest-assertutil May 10, 2019 N/A N/A + :pypi:`pytest-assert-utils` Useful assertion utilities for use with pytest Apr 14, 2022 3 - Alpha N/A + :pypi:`pytest-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) + :pypi:`pytest-ast-back-to-python` A plugin for pytest devs to view how assertion rewriting recodes the AST Sep 29, 2019 4 - Beta N/A + :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) + :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest + :pypi:`pytest-asyncio` Pytest support for asyncio Mar 25, 2022 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. May 02, 2022 N/A N/A + :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) + :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) + :pypi:`pytest-async-sqlalchemy` Database testing fixtures using the SQLAlchemy asyncio API Oct 07, 2021 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-atomic` Skip rest of tests if previous test failed. Nov 24, 2018 4 - Beta N/A + :pypi:`pytest-attrib` pytest plugin to select tests based on attributes similar to the nose-attrib plugin May 24, 2016 4 - Beta N/A + :pypi:`pytest-austin` Austin plugin for pytest Oct 11, 2020 4 - Beta N/A + :pypi:`pytest-autochecklog` automatically check condition and log all the checks Apr 25, 2015 4 - Beta N/A + :pypi:`pytest-automation` pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. May 12, 2022 N/A pytest (>=7.0.0) + :pypi:`pytest-automock` Pytest plugin for automatical mocks creation Feb 01, 2022 N/A pytest ; extra == 'dev' + :pypi:`pytest-auto-parametrize` pytest plugin: avoid repeating arguments in parametrize Oct 02, 2016 3 - Alpha N/A + :pypi:`pytest-autotest` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Aug 25, 2021 N/A pytest + :pypi:`pytest-avoidance` Makes pytest skip tests that don not need rerunning May 23, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-aws` pytest plugin for testing AWS resource configurations Oct 04, 2017 4 - Beta N/A + :pypi:`pytest-aws-config` Protect your AWS credentials in unit tests May 28, 2021 N/A N/A + :pypi:`pytest-axe` pytest plugin for axe-selenium-python Nov 12, 2018 N/A pytest (>=3.0.0) + :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Mar 16, 2022 4 - Beta pytest (>=5.0.0) + :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) + :pypi:`pytest-bdd` BDD for pytest Oct 25, 2021 6 - Mature pytest (>=4.3) + :pypi:`pytest-bdd-splinter` Common steps for pytest bdd and splinter integration Aug 12, 2019 5 - Production/Stable pytest (>=4.0.0) + :pypi:`pytest-bdd-web` A simple plugin to use with pytest Jan 02, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A + :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest + :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A + :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A + :pypi:`pytest-benchmark` A \`\`pytest\`\` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer. Apr 17, 2021 5 - Production/Stable pytest (>=3.8) + :pypi:`pytest-bg-process` Pytest plugin to initialize background process Jan 24, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-bigchaindb` A BigchainDB plugin for pytest. Jan 24, 2022 4 - Beta N/A + :pypi:`pytest-bigquery-mock` Provides a mock fixture for python bigquery client Aug 05, 2021 N/A pytest (>=5.0) + :pypi:`pytest-black` A pytest plugin to enable format checking with black Oct 05, 2020 4 - Beta N/A + :pypi:`pytest-black-multipy` Allow '--black' on older Pythons Jan 14, 2021 5 - Production/Stable pytest (!=3.7.3,>=3.5) ; extra == 'testing' + :pypi:`pytest-blame` A pytest plugin helps developers to debug by providing useful commits history. May 04, 2019 N/A pytest (>=4.4.0) + :pypi:`pytest-blender` Blender Pytest plugin. May 12, 2022 N/A pytest ; extra == 'dev' + :pypi:`pytest-blink1` Pytest plugin to emit notifications via the Blink(1) RGB LED Jan 07, 2018 4 - Beta N/A + :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest + :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A + :pypi:`pytest-board` Local continuous test runner with pytest and watchdog. Jan 20, 2019 N/A N/A + :pypi:`pytest-bootstrap` Mar 04, 2022 N/A N/A + :pypi:`pytest-bpdb` A py.test plug-in to enable drop to bpdb debugger on test failure. Jan 19, 2015 2 - Pre-Alpha N/A + :pypi:`pytest-bravado` Pytest-bravado automatically generates from OpenAPI specification client fixtures. Feb 15, 2022 N/A N/A + :pypi:`pytest-breakword` Use breakword with pytest Aug 04, 2021 N/A pytest (>=6.2.4,<7.0.0) + :pypi:`pytest-breed-adapter` A simple plugin to connect with breed-server Nov 07, 2018 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-briefcase` A pytest plugin for running tests on a Briefcase project. Jun 14, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-browser` A pytest plugin for console based browser test selection just after the collection phase Dec 10, 2016 3 - Alpha N/A + :pypi:`pytest-browsermob-proxy` BrowserMob proxy plugin for py.test. Jun 11, 2013 4 - Beta N/A + :pypi:`pytest-browserstack-local` \`\`py.test\`\` plugin to run \`\`BrowserStackLocal\`\` in background. Feb 09, 2018 N/A N/A + :pypi:`pytest-bug` Pytest plugin for marking tests as a bug Apr 13, 2022 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-bugtong-tag` pytest-bugtong-tag is a plugin for pytest Jan 16, 2022 N/A N/A + :pypi:`pytest-bugzilla` py.test bugzilla integration plugin May 05, 2010 4 - Beta N/A + :pypi:`pytest-bugzilla-notifier` A plugin that allows you to execute create, update, and read information from BugZilla bugs Jun 15, 2018 4 - Beta pytest (>=2.9.2) + :pypi:`pytest-buildkite` Plugin for pytest that automatically publishes coverage and pytest report annotations to Buildkite. Jul 13, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-builtin-types` Nov 17, 2021 N/A pytest + :pypi:`pytest-bwrap` Run your tests in Bubblewrap sandboxes Oct 26, 2018 3 - Alpha N/A + :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A + :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data May 02, 2022 4 - Beta pytest (>=5.0.0) + :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A + :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 17, 2022 N/A pytest + :pypi:`pytest-camel-collect` Enable CamelCase-aware pytest class collection Aug 02, 2020 N/A pytest (>=2.9) + :pypi:`pytest-canonical-data` A plugin which allows to compare results with canonical results, based on previous runs May 08, 2020 2 - Pre-Alpha pytest (>=3.5.0) + :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A + :pypi:`pytest-capture-deprecatedwarnings` pytest plugin to capture all deprecatedwarnings and put them in one file Apr 30, 2019 N/A N/A + :pypi:`pytest-capture-warnings` pytest plugin to capture all warnings and put them in one file of your choice May 03, 2022 N/A pytest + :pypi:`pytest-cases` Separate test code from test cases in pytest. May 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-cassandra` Cassandra CCM Test Fixtures for pytest Nov 04, 2017 1 - Planning N/A + :pypi:`pytest-catchlog` py.test plugin to catch log messages. This is a fork of pytest-capturelog. Jan 24, 2016 4 - Beta pytest (>=2.6) + :pypi:`pytest-catch-server` Pytest plugin with server for catching HTTP requests. Dec 12, 2019 5 - Production/Stable N/A + :pypi:`pytest-celery` pytest-celery a shim pytest plugin to enable celery.contrib.pytest May 06, 2021 N/A N/A + :pypi:`pytest-chainmaker` pytest plugin for chainmaker Oct 15, 2021 N/A N/A + :pypi:`pytest-chalice` A set of py.test fixtures for AWS Chalice Jul 01, 2020 4 - Beta N/A + :pypi:`pytest-change-demo` turn . into √,turn F into x Mar 02, 2022 N/A pytest + :pypi:`pytest-change-report` turn . into √,turn F into x Sep 14, 2020 N/A pytest + :pypi:`pytest-change-xds` turn . into √,turn F into x Apr 16, 2022 N/A pytest + :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) + :pypi:`pytest-checkdocs` check the README when running tests Jul 31, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' + :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) + :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest (>=7.0) + :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest + :pypi:`pytest-circleci` py.test plugin for CircleCI May 03, 2019 N/A N/A + :pypi:`pytest-circleci-parallelized` Parallelize pytest across CircleCI workers. Mar 26, 2019 N/A N/A + :pypi:`pytest-ckan` Backport of CKAN 2.9 pytest plugin and fixtures to CAKN 2.8 Apr 28, 2020 4 - Beta pytest + :pypi:`pytest-clarity` A plugin providing an alternative, colourful diff output for failing assertions. Jun 11, 2021 N/A N/A + :pypi:`pytest-cldf` Easy quality control for CLDF datasets using pytest May 06, 2019 N/A N/A + :pypi:`pytest-click` Pytest plugin for Click Feb 11, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-clld` Nov 29, 2021 N/A pytest (>=3.6) + :pypi:`pytest-cloud` Distributed tests planner plugin for pytest testing framework. Oct 05, 2020 6 - Mature N/A + :pypi:`pytest-cloudflare-worker` pytest plugin for testing cloudflare workers Mar 30, 2021 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) + :pypi:`pytest-codecheckers` pytest plugin to add source code sanity checks (pep8 and friends) Feb 13, 2010 N/A N/A + :pypi:`pytest-codecov` Pytest plugin for uploading pytest-cov results to codecov.io Apr 12, 2022 4 - Beta pytest (>=4.6.0) + :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A + :pypi:`pytest-codeowners` Pytest plugin for selecting tests by GitHub CODEOWNERS. Mar 30, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-codestyle` pytest plugin to run pycodestyle Mar 23, 2020 3 - Alpha N/A + :pypi:`pytest-collect-formatter` Formatter for pytest collect output Mar 29, 2021 5 - Production/Stable N/A + :pypi:`pytest-collect-formatter2` Formatter for pytest collect output May 31, 2021 5 - Production/Stable N/A + :pypi:`pytest-colordots` Colorizes the progress indicators Oct 06, 2017 5 - Production/Stable N/A + :pypi:`pytest-commander` An interactive GUI test runner for PyTest Aug 17, 2021 N/A pytest (<7.0.0,>=6.2.4) + :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method Nov 12, 2020 N/A pytest (>=3.6,<7) + :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-config` Base configurations and utilities for developing your Python project test suite with pytest. Nov 07, 2014 5 - Production/Stable N/A + :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Apr 17, 2022 N/A N/A + :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts Mar 18, 2022 4 - Beta N/A + :pypi:`pytest-consul` pytest plugin with fixtures for testing consul aware apps Nov 24, 2018 3 - Alpha pytest + :pypi:`pytest-container` Pytest fixtures for writing container based tests Feb 01, 2022 3 - Alpha pytest (>=3.10) + :pypi:`pytest-contextfixture` Define pytest fixtures as context managers. Mar 12, 2013 4 - Beta N/A + :pypi:`pytest-contexts` A plugin to run tests written with the Contexts framework using pytest May 19, 2021 4 - Beta N/A + :pypi:`pytest-cookies` The pytest plugin for your Cookiecutter templates. 🍪 May 24, 2021 5 - Production/Stable pytest (>=3.3.0) + :pypi:`pytest-couchdbkit` py.test extension for per-test couchdb databases using couchdbkit Apr 17, 2012 N/A N/A + :pypi:`pytest-count` count erros and send email Jan 12, 2018 4 - Beta N/A + :pypi:`pytest-cov` Pytest plugin for measuring coverage. Oct 04, 2021 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-cover` Pytest plugin for measuring coverage. Forked from \`pytest-cov\`. Aug 01, 2015 5 - Production/Stable N/A + :pypi:`pytest-coverage` Jun 17, 2015 N/A N/A + :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' + :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types May 13, 2022 N/A N/A + :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A + :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) + :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest + :pypi:`pytest-crontab` add crontab task in crontab Dec 09, 2019 N/A N/A + :pypi:`pytest-csv` CSV output for pytest. Apr 22, 2021 N/A pytest (>=6.0) + :pypi:`pytest-curio` Pytest support for curio. Oct 07, 2020 N/A N/A + :pypi:`pytest-curl-report` pytest plugin to generate curl command line report Dec 11, 2016 4 - Beta N/A + :pypi:`pytest-custom-concurrency` Custom grouping concurrence for pytest Feb 08, 2021 N/A N/A + :pypi:`pytest-custom-exit-code` Exit pytest test session with custom exit code in different scenarios Aug 07, 2019 4 - Beta pytest (>=4.0.2) + :pypi:`pytest-custom-nodeid` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 07, 2021 N/A N/A + :pypi:`pytest-custom-report` Configure the symbols displayed for test outcomes Jan 30, 2019 N/A pytest + :pypi:`pytest-custom-scheduling` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 01, 2021 N/A N/A + :pypi:`pytest-cython` A plugin for testing Cython extension modules Mar 26, 2022 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-cython-collect` May 04, 2022 N/A pytest + :pypi:`pytest-darker` A pytest plugin for checking of modified code using Darker Aug 16, 2020 N/A pytest (>=6.0.1) ; extra == 'test' + :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A + :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A + :pypi:`pytest-databricks` Pytest plugin for remote Databricks notebooks testing Jul 29, 2020 N/A pytest + :pypi:`pytest-datadir` pytest plugin for test data directories and files Oct 22, 2019 5 - Production/Stable pytest (>=2.7.0) + :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Jan 20, 2022 5 - Production/Stable pytest + :pypi:`pytest-datadir-ng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Dec 25, 2019 5 - Production/Stable pytest + :pypi:`pytest-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Mar 09, 2022 N/A pytest (>=7.0.1) + :pypi:`pytest-data-file` Fixture "data" and "case_data" for test from yaml file Dec 04, 2019 N/A N/A + :pypi:`pytest-datafiles` py.test plugin to create a 'tmpdir' containing predefined files/directories. May 01, 2022 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-datafixtures` Data fixtures for pytest made simple Dec 05, 2020 5 - Production/Stable N/A + :pypi:`pytest-data-from-files` pytest plugin to provide data from files loaded automatically Oct 13, 2021 4 - Beta pytest + :pypi:`pytest-dataplugin` A pytest plugin for managing an archive of test data. Sep 16, 2017 1 - Planning N/A + :pypi:`pytest-datarecorder` A py.test plugin recording and comparing test output. Apr 20, 2020 5 - Production/Stable pytest + :pypi:`pytest-datatest` A pytest plugin for test driven data-wrangling (this is the development version of datatest's pytest integration). Oct 15, 2020 4 - Beta pytest (>=3.3) + :pypi:`pytest-db` Session scope fixture "db" for mysql query or change Dec 04, 2019 N/A N/A + :pypi:`pytest-dbfixtures` Databases fixtures plugin for py.test. Dec 07, 2016 4 - Beta N/A + :pypi:`pytest-db-plugin` Nov 27, 2021 N/A pytest (>=5.0) + :pypi:`pytest-dbt-adapter` A pytest plugin for testing dbt adapter plugins Nov 24, 2021 N/A pytest (<7,>=6) + :pypi:`pytest-dbt-conventions` A pytest plugin for linting a dbt project's conventions Mar 02, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-dbt-core` Pytest extension for dbt. Jan 28, 2022 N/A pytest (>=6.2.5) ; extra == 'test' + :pypi:`pytest-dbus-notification` D-BUS notifications for pytest results. Mar 05, 2014 5 - Production/Stable N/A + :pypi:`pytest-deadfixtures` A simple plugin to list unused fixtures in pytest Jul 23, 2020 5 - Production/Stable N/A + :pypi:`pytest-deepcov` deepcov Mar 30, 2021 N/A N/A + :pypi:`pytest-defer` Aug 24, 2021 N/A N/A + :pypi:`pytest-demo-plugin` pytest示例插件 May 15, 2021 N/A N/A + :pypi:`pytest-dependency` Manage dependencies of tests Feb 14, 2020 4 - Beta N/A + :pypi:`pytest-depends` Tests that depend on other tests Apr 05, 2020 5 - Production/Stable pytest (>=3) + :pypi:`pytest-deprecate` Mark tests as testing a deprecated feature with a warning note. Jul 01, 2019 N/A N/A + :pypi:`pytest-describe` Describe-style plugin for pytest Nov 13, 2021 4 - Beta pytest (>=4.0.0) + :pypi:`pytest-describe-it` plugin for rich text descriptions Jul 19, 2019 4 - Beta pytest + :pypi:`pytest-devpi-server` DevPI server fixture for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-diamond` pytest plugin for diamond Aug 31, 2015 4 - Beta N/A + :pypi:`pytest-dicom` pytest plugin to provide DICOM fixtures Dec 19, 2018 3 - Alpha pytest + :pypi:`pytest-dictsdiff` Jul 26, 2019 N/A N/A + :pypi:`pytest-diff` A simple plugin to use with pytest Mar 30, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-diff-selector` Get tests affected by code changes (using git) Feb 24, 2022 4 - Beta pytest (>=6.2.2) ; extra == 'all' + :pypi:`pytest-disable` pytest plugin to disable a test and skip it from testrun Sep 10, 2015 4 - Beta N/A + :pypi:`pytest-disable-plugin` Disable plugins per test Feb 28, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. Mar 27, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) + :pypi:`pytest-django` A Django plugin for pytest. Dec 07, 2021 5 - Production/Stable pytest (>=5.4.0) + :pypi:`pytest-django-ahead` A Django plugin for pytest. Oct 27, 2016 5 - Production/Stable pytest (>=2.9) + :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Aug 04, 2021 4 - Beta N/A + :pypi:`pytest-django-cache-xdist` A djangocachexdist plugin for pytest May 12, 2020 4 - Beta N/A + :pypi:`pytest-django-casperjs` Integrate CasperJS with your django tests as a pytest fixture. Mar 15, 2015 2 - Pre-Alpha N/A + :pypi:`pytest-django-dotenv` Pytest plugin used to setup environment variables with django-dotenv Nov 26, 2019 4 - Beta pytest (>=2.6.0) + :pypi:`pytest-django-factories` Factories for your Django models that can be used as Pytest fixtures. Nov 12, 2020 4 - Beta N/A + :pypi:`pytest-django-filefield` Replaces FileField.storage with something you can patch globally. May 09, 2022 5 - Production/Stable pytest >= 5.2 + :pypi:`pytest-django-gcir` A Django plugin for pytest. Mar 06, 2018 5 - Production/Stable N/A + :pypi:`pytest-django-haystack` Cleanup your Haystack indexes between tests Sep 03, 2017 5 - Production/Stable pytest (>=2.3.4) + :pypi:`pytest-django-ifactory` A model instance factory for pytest-django Feb 09, 2022 3 - Alpha N/A + :pypi:`pytest-django-lite` The bare minimum to integrate py.test with Django. Jan 30, 2014 N/A N/A + :pypi:`pytest-django-liveserver-ssl` Jan 20, 2022 3 - Alpha N/A + :pypi:`pytest-django-model` A Simple Way to Test your Django Models Feb 14, 2019 4 - Beta N/A + :pypi:`pytest-django-ordering` A pytest plugin for preserving the order in which Django runs tests. Jul 25, 2019 5 - Production/Stable pytest (>=2.3.0) + :pypi:`pytest-django-queries` Generate performance reports from your django database performance tests. Mar 01, 2021 N/A N/A + :pypi:`pytest-djangorestframework` A djangorestframework plugin for pytest Aug 11, 2019 4 - Beta N/A + :pypi:`pytest-django-rq` A pytest plugin to help writing unit test for django-rq Apr 13, 2020 4 - Beta N/A + :pypi:`pytest-django-sqlcounts` py.test plugin for reporting the number of SQLs executed per django testcase. Jun 16, 2015 4 - Beta N/A + :pypi:`pytest-django-testing-postgresql` Use a temporary PostgreSQL database with pytest-django Jan 31, 2022 4 - Beta N/A + :pypi:`pytest-doc` A documentation plugin for py.test. Jun 28, 2015 5 - Production/Stable N/A + :pypi:`pytest-docfiles` pytest plugin to test codeblocks in your documentation. Dec 22, 2021 4 - Beta pytest (>=3.7.0) + :pypi:`pytest-docgen` An RST Documentation Generator for pytest-based test suites Apr 17, 2020 N/A N/A + :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Apr 09, 2022 N/A pytest (<8.0,>=4.0) + :pypi:`pytest-docker-apache-fixtures` Pytest fixtures for testing with apache2 (httpd). Feb 16, 2022 4 - Beta pytest + :pypi:`pytest-docker-butla` Jun 16, 2019 3 - Alpha N/A + :pypi:`pytest-dockerc` Run, manage and stop Docker Compose project from Docker API Oct 09, 2020 5 - Production/Stable pytest (>=3.0) + :pypi:`pytest-docker-compose` Manages Docker containers during your integration tests Jan 26, 2021 5 - Production/Stable pytest (>=3.3) + :pypi:`pytest-docker-db` A plugin to use docker databases for pytests Mar 20, 2021 5 - Production/Stable pytest (>=3.1.1) + :pypi:`pytest-docker-fixtures` pytest docker fixtures Nov 23, 2021 3 - Alpha N/A + :pypi:`pytest-docker-git-fixtures` Pytest fixtures for testing with git scm. Feb 09, 2022 4 - Beta pytest + :pypi:`pytest-docker-haproxy-fixtures` Pytest fixtures for testing with haproxy. Feb 09, 2022 4 - Beta pytest + :pypi:`pytest-docker-pexpect` pytest plugin for writing functional tests with pexpect and docker Jan 14, 2019 N/A pytest + :pypi:`pytest-docker-postgresql` A simple plugin to use with pytest Sep 24, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-docker-py` Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. Nov 27, 2018 N/A pytest (==4.0.0) + :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Apr 08, 2022 4 - Beta pytest + :pypi:`pytest-docker-service` pytest plugin to start docker container Mar 21, 2022 3 - Alpha pytest + :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 09, 2022 4 - Beta pytest + :pypi:`pytest-docker-tools` Docker integration tests for pytest Feb 17, 2022 4 - Beta pytest (>=6.0.1) + :pypi:`pytest-docs` Documentation tool for pytest Nov 11, 2018 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-docstyle` pytest plugin to run pydocstyle Mar 23, 2020 3 - Alpha N/A + :pypi:`pytest-doctest-custom` A py.test plugin for customizing string representations of doctest results. Jul 25, 2016 4 - Beta N/A + :pypi:`pytest-doctest-ellipsis-markers` Setup additional values for ELLIPSIS_MARKER for doctests Jan 12, 2018 4 - Beta N/A + :pypi:`pytest-doctest-import` A simple pytest plugin to import names and add them to the doctest namespace. Nov 13, 2018 4 - Beta pytest (>=3.3.0) + :pypi:`pytest-doctestplus` Pytest plugin with advanced doctest features. Feb 25, 2022 3 - Alpha pytest (>=4.6) + :pypi:`pytest-dolphin` Some extra stuff that we use ininternally Nov 30, 2016 4 - Beta pytest (==3.0.4) + :pypi:`pytest-doorstop` A pytest plugin for adding test results into doorstop items. Jun 09, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-dotenv` A py.test plugin that parses environment files before running tests Jun 16, 2020 4 - Beta pytest (>=5.0.0) + :pypi:`pytest-drf` A Django REST framework plugin for pytest. Nov 12, 2020 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-drivings` Tool to allow webdriver automation to be ran locally or remotely Jan 13, 2021 N/A N/A + :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection May 23, 2020 4 - Beta pytest (>=2.7) + :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest + :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A + :pypi:`pytest-duration-insights` Jun 25, 2021 N/A N/A + :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Apr 22, 2022 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-dynamicrerun` A pytest plugin to rerun tests dynamically based off of test outcome and output. Aug 15, 2020 4 - Beta N/A + :pypi:`pytest-dynamodb` DynamoDB fixtures for pytest Jun 03, 2021 5 - Production/Stable pytest + :pypi:`pytest-easy-addoption` pytest-easy-addoption: Easy way to work with pytest addoption Jan 22, 2020 N/A N/A + :pypi:`pytest-easy-api` Simple API testing with pytest Mar 26, 2018 N/A N/A + :pypi:`pytest-easyMPI` Package that supports mpi tests in pytest Oct 21, 2020 N/A N/A + :pypi:`pytest-easyread` pytest plugin that makes terminal printouts of the reports easier to read Nov 17, 2017 N/A N/A + :pypi:`pytest-easy-server` Pytest plugin for easy testing against servers May 01, 2021 4 - Beta pytest (<5.0.0,>=4.3.1) ; python_version < "3.5" + :pypi:`pytest-ec2` Pytest execution on EC2 instance Oct 22, 2019 3 - Alpha N/A + :pypi:`pytest-echo` pytest plugin with mechanisms for echoing environment variables, package version and generic attributes Jan 08, 2020 5 - Production/Stable N/A + :pypi:`pytest-elasticsearch` Elasticsearch fixtures and fixture factories for Pytest. Mar 01, 2022 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-elements` Tool to help automate user interfaces Jan 13, 2021 N/A pytest (>=5.4,<6.0) + :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) + :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest + :pypi:`pytest-embedded` pytest embedded plugin May 09, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects May 09, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project May 09, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag May 09, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip May 09, 2022 N/A N/A + :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports May 09, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports May 09, 2022 N/A N/A + :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) + :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) + :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-encode` set your encoding and logger Nov 06, 2021 N/A N/A + :pypi:`pytest-encode-kane` set your encoding and logger Nov 16, 2021 N/A pytest + :pypi:`pytest-enhancements` Improvements for pytest (rejected upstream) Oct 30, 2019 4 - Beta N/A + :pypi:`pytest-env` py.test plugin that allows you to add environment variables. Jun 16, 2017 4 - Beta N/A + :pypi:`pytest-envfiles` A py.test plugin that parses environment files before running tests Oct 08, 2015 3 - Alpha N/A + :pypi:`pytest-env-info` Push information about the running pytest into envvars Nov 25, 2017 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-envraw` py.test plugin that allows you to add environment variables. Aug 27, 2020 4 - Beta pytest (>=2.6.0) + :pypi:`pytest-envvars` Pytest plugin to validate use of envvars on your tests Jun 13, 2020 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-env-yaml` Apr 02, 2019 N/A N/A + :pypi:`pytest-eradicate` pytest plugin to check for commented out code Sep 08, 2020 N/A pytest (>=2.4.2) + :pypi:`pytest-error-for-skips` Pytest plugin to treat skipped tests a test failure Dec 19, 2019 4 - Beta pytest (>=4.6) + :pypi:`pytest-eth` PyTest plugin for testing Smart Contracts for Ethereum Virtual Machine (EVM). Aug 14, 2020 1 - Planning N/A + :pypi:`pytest-ethereum` pytest-ethereum: Pytest library for ethereum projects. Jun 24, 2019 3 - Alpha pytest (==3.3.2); extra == 'dev' + :pypi:`pytest-eucalyptus` Pytest Plugin for BDD Aug 13, 2019 N/A pytest (>=4.2.0) + :pypi:`pytest-eventlet` Applies eventlet monkey-patch as a pytest plugin. Oct 04, 2021 N/A pytest ; extra == 'dev' + :pypi:`pytest-excel` pytest plugin for generating excel reports Jan 31, 2022 5 - Production/Stable N/A + :pypi:`pytest-exceptional` Better exceptions Mar 16, 2017 4 - Beta N/A + :pypi:`pytest-exception-script` Walk your code through exception script to check it's resiliency to failures. Aug 04, 2020 3 - Alpha pytest + :pypi:`pytest-executable` pytest plugin for testing executables Nov 10, 2021 4 - Beta pytest (<6.3,>=4.3) + :pypi:`pytest-execution-timer` A timer for the phases of Pytest's execution. Dec 24, 2021 4 - Beta N/A + :pypi:`pytest-expect` py.test plugin to store test expectations and mark tests based on them Apr 21, 2016 4 - Beta N/A + :pypi:`pytest-expecter` Better testing with expecter and pytest. Jan 10, 2022 5 - Production/Stable N/A + :pypi:`pytest-expectr` This plugin is used to expect multiple assert using pytest framework. Oct 05, 2018 N/A pytest (>=2.4.2) + :pypi:`pytest-experiments` A pytest plugin to help developers of research-oriented software projects keep track of the results of their numerical experiments. Dec 13, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-explicit` A Pytest plugin to ignore certain marked tests by default Jun 15, 2021 5 - Production/Stable pytest + :pypi:`pytest-exploratory` Interactive console for pytest. Feb 21, 2022 N/A pytest (>=6.2) + :pypi:`pytest-external-blockers` a special outcome for tests that are blocked for external reasons Oct 05, 2021 N/A pytest + :pypi:`pytest-extra-durations` A pytest plugin to get durations on a per-function basis and per module basis. Apr 21, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-fabric` Provides test utilities to run fabric task tests by using docker containers Sep 12, 2018 5 - Production/Stable N/A + :pypi:`pytest-factory` Use factories for test setup with py.test Sep 06, 2020 3 - Alpha pytest (>4.3) + :pypi:`pytest-factoryboy` Factory Boy support for pytest. May 13, 2022 6 - Mature pytest (>=5.0.0) + :pypi:`pytest-factoryboy-fixtures` Generates pytest fixtures that allow the use of type hinting Jun 25, 2020 N/A N/A + :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-failed-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A + :pypi:`pytest-failed-to-verify` A pytest plugin that helps better distinguishing real test failures from setup flakiness. Aug 08, 2019 5 - Production/Stable pytest (>=4.1.0) + :pypi:`pytest-fail-slow` Fail tests that take too long to run Apr 25, 2022 4 - Beta pytest (>=6.0) + :pypi:`pytest-faker` Faker integration with the pytest framework. Dec 19, 2016 6 - Mature N/A + :pypi:`pytest-falcon` Pytest helpers for Falcon. Sep 07, 2016 4 - Beta N/A + :pypi:`pytest-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A + :pypi:`pytest-fantasy` Pytest plugin for Flask Fantasy Framework Mar 14, 2019 N/A N/A + :pypi:`pytest-fastapi` Dec 27, 2020 N/A N/A + :pypi:`pytest-fastapi-deps` A fixture which allows easy replacement of fastapi dependencies for testing May 09, 2022 5 - Production/Stable pytest + :pypi:`pytest-fastest` Use SCM and coverage to run only needed tests Mar 05, 2020 N/A N/A + :pypi:`pytest-fast-first` Pytest plugin that runs fast tests first Apr 02, 2021 3 - Alpha pytest + :pypi:`pytest-faulthandler` py.test plugin that activates the fault handler module for tests (dummy package) Jul 04, 2019 6 - Mature pytest (>=5.0) + :pypi:`pytest-fauxfactory` Integration of fauxfactory into pytest. Dec 06, 2017 5 - Production/Stable pytest (>=3.2) + :pypi:`pytest-figleaf` py.test figleaf coverage plugin Jan 18, 2010 5 - Production/Stable N/A + :pypi:`pytest-filecov` A pytest plugin to detect unused files Jun 27, 2021 4 - Beta pytest + :pypi:`pytest-filedata` easily load data from files Jan 17, 2019 4 - Beta N/A + :pypi:`pytest-filemarker` A pytest plugin that runs marked tests when files change. Dec 01, 2020 N/A pytest + :pypi:`pytest-filter-case` run test cases filter by mark Nov 05, 2020 N/A N/A + :pypi:`pytest-filter-subpackage` Pytest plugin for filtering based on sub-packages Jan 09, 2020 3 - Alpha pytest (>=3.0) + :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Apr 09, 2022 4 - Beta pytest (>=4.3.0) + :pypi:`pytest-finer-verdicts` A pytest plugin to treat non-assertion failures as test errors. Jun 18, 2020 N/A pytest (>=5.4.3) + :pypi:`pytest-firefox` pytest plugin to manipulate firefox Aug 08, 2017 3 - Alpha pytest (>=3.0.2) + :pypi:`pytest-fixture-config` Fixture configuration utils for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-fixture-maker` Pytest plugin to load fixtures from YAML files Sep 21, 2021 N/A N/A + :pypi:`pytest-fixture-marker` A pytest plugin to add markers based on fixtures used. Oct 11, 2020 5 - Production/Stable N/A + :pypi:`pytest-fixture-order` pytest plugin to control fixture evaluation order Aug 25, 2020 N/A pytest (>=3.0) + :pypi:`pytest-fixture-rtttg` Warn or fail on fixture name clash Feb 23, 2022 N/A pytest (>=7.0.1,<8.0.0) + :pypi:`pytest-fixtures` Common fixtures for pytest May 01, 2019 5 - Production/Stable N/A + :pypi:`pytest-fixture-tools` Plugin for pytest which provides tools for fixtures Aug 18, 2020 6 - Mature pytest + :pypi:`pytest-fixture-typecheck` A pytest plugin to assert type annotations at runtime. Aug 24, 2021 N/A pytest + :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Mar 18, 2022 4 - Beta pytest (>=7.0) + :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Mar 01, 2022 5 - Production/Stable pytest (>=7.0) + :pypi:`pytest-flakefinder` Runs tests multiple times to expose flakiness. Jul 28, 2020 4 - Beta pytest (>=2.7.1) + :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) + :pypi:`pytest-flaptastic` Flaptastic py.test plugin Mar 17, 2019 N/A N/A + :pypi:`pytest-flask` A set of py.test fixtures to test Flask applications. Feb 27, 2021 5 - Production/Stable pytest (>=5.2) + :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) + :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) + :pypi:`pytest-flyte` Pytest fixtures for simplifying Flyte integration testing May 03, 2021 N/A pytest + :pypi:`pytest-focus` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest + :pypi:`pytest-forcefail` py.test plugin to make the test failing regardless of pytest.mark.xfail May 15, 2018 4 - Beta N/A + :pypi:`pytest-forward-compatability` A name to avoid typosquating pytest-foward-compatibility Sep 06, 2020 N/A N/A + :pypi:`pytest-forward-compatibility` A pytest plugin to shim pytest commandline options for fowards compatibility Sep 29, 2020 N/A N/A + :pypi:`pytest-freezegun` Wrap tests with fixtures in freeze_time Jul 19, 2020 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-freeze-reqs` Check if requirement files are frozen Apr 29, 2021 N/A N/A + :pypi:`pytest-frozen-uuids` Deterministically frozen UUID's for your tests Apr 17, 2022 N/A pytest (>=3.0) + :pypi:`pytest-func-cov` Pytest plugin for measuring function coverage Apr 15, 2021 3 - Alpha pytest (>=5) + :pypi:`pytest-funparam` An alternative way to parametrize test cases. Dec 02, 2021 4 - Beta pytest >=4.6.0 + :pypi:`pytest-fxa` pytest plugin for Firefox Accounts Aug 28, 2018 5 - Production/Stable N/A + :pypi:`pytest-fxtest` Oct 27, 2020 N/A N/A + :pypi:`pytest-gather-fixtures` set up asynchronous pytest fixtures concurrently Apr 12, 2022 N/A pytest (>=6.0.0) + :pypi:`pytest-gc` The garbage collector plugin for py.test Feb 01, 2018 N/A N/A + :pypi:`pytest-gcov` Uses gcov to measure test coverage of a C library Feb 01, 2018 3 - Alpha N/A + :pypi:`pytest-gevent` Ensure that gevent is properly patched when invoking pytest Feb 25, 2020 N/A pytest + :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) + :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest + :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. May 04, 2022 N/A N/A + :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A + :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest + :pypi:`pytest-github` Plugin for py.test that associates tests with github issues using a marker. Mar 07, 2019 5 - Production/Stable N/A + :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Dec 08, 2021 N/A pytest (>=4.0.0) + :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A + :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Nov 26, 2021 4 - Beta pytest + :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest + :pypi:`pytest-golden` Plugin for pytest that offloads expected outputs to data files Nov 23, 2020 N/A pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-google-chat` Notify google chat channel for test results Mar 27, 2022 4 - Beta pytest + :pypi:`pytest-graphql-schema` Get graphql schema as fixture for pytest Oct 18, 2019 N/A N/A + :pypi:`pytest-greendots` Green progress dots Feb 08, 2014 3 - Alpha N/A + :pypi:`pytest-growl` Growl notifications for pytest results. Jan 13, 2014 5 - Production/Stable N/A + :pypi:`pytest-grpc` pytest plugin for grpc May 01, 2020 N/A pytest (>=3.6.0) + :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest + :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Apr 01, 2021 5 - Production/Stable N/A + :pypi:`pytest-helm-chart` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jun 15, 2020 4 - Beta pytest (>=5.4.2,<6.0.0) + :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. May 11, 2022 4 - Beta pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-helper` Functions to help in using the pytest testing framework May 31, 2019 5 - Production/Stable N/A + :pypi:`pytest-helpers` pytest helpers May 17, 2020 N/A pytest + :pypi:`pytest-helpers-namespace` Pytest Helpers Namespace Plugin Dec 29, 2021 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-hidecaptured` Hide captured output May 04, 2018 4 - Beta pytest (>=2.8.5) + :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest + :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest + :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components May 13, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A + :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) + :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 22, 2022 5 - Production/Stable N/A + :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) + :pypi:`pytest-html` pytest plugin for generating HTML reports Dec 13, 2020 5 - Production/Stable pytest (!=6.0.0,>=5.0) + :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-html-merger` Pytest HTML reports merging utility Apr 03, 2022 N/A N/A + :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Mar 04, 2022 5 - Production/Stable N/A + :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) + :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A + :pypi:`pytest-html-thread` pytest plugin for generating HTML reports Dec 29, 2020 5 - Production/Stable N/A + :pypi:`pytest-http` Fixture "http" for http requests Dec 05, 2019 N/A N/A + :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Mar 16, 2022 5 - Production/Stable pytest ; extra == 'test' + :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A + :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A + :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Jan 27, 2022 3 - Alpha N/A + :pypi:`pytest-httpx` Send responses to httpx. Feb 05, 2022 5 - Production/Stable pytest (<8.*,>=6.*) + :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) + :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A + :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest + :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jan 14, 2022 4 - Beta pytest + :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A + :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A + :pypi:`pytest-idem` A pytest plugin to help with testing idem projects May 04, 2022 5 - Production/Stable N/A + :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 30, 2022 N/A N/A + :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A + :pypi:`pytest-image-diff` Mar 17, 2022 3 - Alpha pytest + :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A + :pypi:`pytest-influxdb` Plugin for influxdb and pytest integration. Apr 20, 2021 N/A N/A + :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A + :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A + :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A + :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A + :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. May 13, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Apr 29, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules May 10, 2022 4 - Beta N/A + :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A + :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) + :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) + :pypi:`pytest-instrument` pytest plugin to instrument tests Apr 05, 2020 5 - Production/Stable pytest (>=5.1.0) + :pypi:`pytest-integration` Organizing pytests by integration or not Apr 16, 2020 N/A N/A + :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) + :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A + :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) + :pypi:`pytest-invenio` Pytest fixtures for Invenio. May 05, 2022 5 - Production/Stable pytest (<7,>=6) + :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A + :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A + :pypi:`pytest-isort` py.test plugin to check import ordering using isort Feb 08, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-it` Pytest plugin to display test reports as a plaintext spec, inspired by Rspec: https://github.com/mattduck/pytest-it. Jan 22, 2020 4 - Beta N/A + :pypi:`pytest-iterassert` Nicer list and iterable assertion messages for pytest May 11, 2020 3 - Alpha N/A + :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A + :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) + :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY May 11, 2022 4 - Beta pytest + :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest + :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) + :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A + :pypi:`pytest-jsonlint` UNKNOWN Aug 04, 2016 N/A N/A + :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Mar 15, 2022 4 - Beta pytest (>=3.8.0) + :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 24, 2021 N/A pytest + :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest + :pypi:`pytest-kexi` Apr 29, 2022 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Jan 24, 2021 5 - Production/Stable N/A + :pypi:`pytest-kivy` Kivy GUI tests fixtures using pytest Jul 06, 2021 4 - Beta pytest (>=3.6) + :pypi:`pytest-knows` A pytest plugin that can automaticly skip test case based on dependence info calculated by trace Aug 22, 2014 N/A N/A + :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A + :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A + :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) + :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. Aug 23, 2021 3 - Alpha pytest (>=3.6,<7) + :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A + :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A + :pypi:`pytest-lazy-fixture` It helps to use fixtures in pytest.mark.parametrize Feb 01, 2020 4 - Beta pytest (>=3.2.5) + :pypi:`pytest-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest + :pypi:`pytest-leak-finder` Find the previous test that makes another to fail Apr 18, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-leaks` A pytest plugin to trace resource leaks. Nov 27, 2019 1 - Planning N/A + :pypi:`pytest-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest + :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest. Dec 22, 2018 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Apr 14, 2022 4 - Beta N/A + :pypi:`pytest-libnotify` Pytest plugin that shows notifications about the test run Apr 02, 2021 3 - Alpha pytest + :pypi:`pytest-ligo` Jan 16, 2020 4 - Beta N/A + :pypi:`pytest-lineno` A pytest plugin to show the line numbers of test functions Dec 04, 2020 N/A pytest + :pypi:`pytest-line-profiler` Profile code executed by pytest May 03, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-lisa` Pytest plugin for organizing tests. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-listener` A simple network listener May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-live` Live results for pytest Mar 08, 2020 N/A pytest + :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Aug 25, 2021 5 - Production/Stable pytest + :pypi:`pytest-localserver` py.test plugin to test server connections locally. May 05, 2022 4 - Beta N/A + :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Aug 22, 2019 4 - Beta pytest (>=3.3.0) + :pypi:`pytest-lockable` lockable resource plugin for pytest Feb 28, 2022 5 - Production/Stable pytest + :pypi:`pytest-locker` Used to lock object during testing. Essentially changing assertions from being hard coded to asserting that nothing changed Oct 29, 2021 N/A pytest (>=5.4) + :pypi:`pytest-log` print log Aug 15, 2021 N/A pytest (>=3.8) + :pypi:`pytest-logbook` py.test plugin to capture logbook log messages Nov 23, 2015 5 - Production/Stable pytest (>=2.8) + :pypi:`pytest-logdog` Pytest plugin to test logging Jun 15, 2021 1 - Planning pytest (>=6.2.0) + :pypi:`pytest-logfest` Pytest plugin providing three logger fixtures with basic or full writing to log files Jul 21, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-logger` Plugin configuring handlers for loggers from Python logging module. Jul 25, 2019 4 - Beta pytest (>=3.2) + :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A + :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A + :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Apr 18, 2022 3 - Alpha pytest + :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha pytest (>=6) + :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) + :pypi:`pytest-markdown-docs` Run markdown code fences through pytest May 12, 2022 N/A N/A + :pypi:`pytest-marker-bugzilla` py.test bugzilla integration plugin, using markers Jan 09, 2020 N/A N/A + :pypi:`pytest-markers-presence` A simple plugin to detect missed pytest tags and markers" Feb 04, 2021 4 - Beta pytest (>=6.0) + :pypi:`pytest-markfiltration` UNKNOWN Nov 08, 2011 3 - Alpha N/A + :pypi:`pytest-mark-no-py3` pytest plugin and bowler codemod to help migrate tests to Python 3 May 17, 2019 N/A pytest + :pypi:`pytest-marks` UNKNOWN Nov 23, 2012 3 - Alpha N/A + :pypi:`pytest-matcher` Match test output against patterns stored in files Dec 10, 2021 5 - Production/Stable N/A + :pypi:`pytest-match-skip` Skip matching marks. Matches partial marks using wildcards. May 15, 2019 4 - Beta pytest (>=4.4.1) + :pypi:`pytest-mat-report` this is report Jan 20, 2021 N/A N/A + :pypi:`pytest-matrix` Provide tools for generating tests from combinations of fixtures. Jun 24, 2020 5 - Production/Stable pytest (>=5.4.3,<6.0.0) + :pypi:`pytest-mccabe` pytest plugin to run the mccabe code complexity checker. Jul 22, 2020 3 - Alpha pytest (>=5.4.0) + :pypi:`pytest-md` Plugin for generating Markdown reports for pytest results Jul 11, 2019 3 - Alpha pytest (>=4.2.1) + :pypi:`pytest-md-report` A pytest plugin to make a test results report with Markdown table format. Feb 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) + :pypi:`pytest-memprof` Estimates memory consumption of test functions Mar 29, 2019 4 - Beta N/A + :pypi:`pytest-memray` A simple plugin to use with pytest Apr 19, 2022 N/A N/A + :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) + :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A + :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution May 03, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-messenger` Pytest to Slack reporting plugin Feb 07, 2022 5 - Production/Stable N/A + :pypi:`pytest-metadata` pytest plugin for test session metadata Mar 26, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) + :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest + :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) + :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) + :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-ml` Test your machine learning! May 04, 2019 4 - Beta N/A + :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) + :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Jan 28, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-mock-api` A mock API server with configurable routes and responses available as a fixture. Feb 13, 2019 1 - Planning pytest (>=4.0.0) + :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator Mar 08, 2022 5 - Production/Stable N/A + :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest + :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A + :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Apr 11, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) + :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A + :pypi:`pytest-modifyjunit` Utility for adding additional properties to junit xml for IDM QE Jan 10, 2019 N/A N/A + :pypi:`pytest-modifyscope` pytest plugin to modify fixture scope Apr 12, 2020 N/A pytest + :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Mar 29, 2022 5 - Production/Stable pytest (>=7.0.0) + :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Jun 07, 2021 5 - Production/Stable pytest + :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures Dec 07, 2019 5 - Production/Stable pytest (>=2.5.2) + :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Dec 23, 2021 5 - Production/Stable pytest + :pypi:`pytest-monkeyplus` pytest's monkeypatch subclass with extra functionalities Sep 18, 2012 5 - Production/Stable N/A + :pypi:`pytest-monkeytype` pytest-monkeytype: Generate Monkeytype annotations from your pytest tests. Jul 29, 2020 4 - Beta N/A + :pypi:`pytest-moto` Fixtures for integration tests of AWS services,uses moto mocking library. Aug 28, 2015 1 - Planning N/A + :pypi:`pytest-motor` A pytest plugin for motor, the non-blocking MongoDB driver. Jul 21, 2021 3 - Alpha pytest + :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest + :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest + :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Apr 22, 2022 4 - Beta pytest + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Feb 28, 2022 4 - Beta pytest + :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest + :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A + :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A + :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Aug 12, 2021 N/A pytest (>=3.6) + :pypi:`pytest-multithreading-allure` pytest_multithreading_allure Mar 22, 2022 N/A N/A + :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) + :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Feb 07, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" + :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" + :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Jan 11, 2022 3 - Alpha pytest (>=6.0.0) + :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A N/A + :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Mar 02, 2022 N/A N/A + :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 15, 2022 5 - Production/Stable pytest (>=6.2) + :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) + :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) + :pypi:`pytest-network` A simple plugin to disable network on socket level. May 07, 2020 N/A N/A + :pypi:`pytest-network-endpoints` Network endpoints plugin for pytest Mar 06, 2022 N/A pytest + :pypi:`pytest-never-sleep` pytest plugin helps to avoid adding tests without mock \`time.sleep\` May 05, 2021 3 - Alpha pytest (>=3.5.1) + :pypi:`pytest-nginx` nginx fixture for pytest Aug 12, 2017 5 - Production/Stable N/A + :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A + :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest + :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Mar 15, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest + :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A + :pypi:`pytest-nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Jul 07, 2021 N/A N/A + :pypi:`pytest-nocustom` Run all tests without custom markers Jul 07, 2021 5 - Production/Stable N/A + :pypi:`pytest-nodev` Test-driven source code search for Python. Jul 21, 2016 4 - Beta pytest (>=2.8.1) + :pypi:`pytest-nogarbage` Ensure a test produces no garbage Aug 29, 2021 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-notice` Send pytest execution result email Nov 05, 2020 N/A N/A + :pypi:`pytest-notification` A pytest plugin for sending a desktop notification and playing a sound upon completion of tests Jun 19, 2020 N/A pytest (>=4) + :pypi:`pytest-notifier` A pytest plugin to notify test result Jun 12, 2020 3 - Alpha pytest + :pypi:`pytest-notimplemented` Pytest markers for not implemented features and tests. Aug 27, 2019 N/A pytest (>=5.1,<6.0) + :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A + :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Mar 16, 2022 4 - Beta pytest (>=4.6.0) + :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A + :pypi:`pytest-odoo` py.test plugin to run Odoo tests Feb 08, 2022 4 - Beta N/A + :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A + :pypi:`pytest-oerp` pytest plugin to test OpenERP modules Feb 28, 2012 3 - Alpha N/A + :pypi:`pytest-ok` The ultimate pytest output plugin Apr 01, 2019 4 - Beta N/A + :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jan 19, 2020 N/A N/A + :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A + :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) + :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest + :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-operator` Fixtures for Operators May 04, 2022 N/A pytest + :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A + :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) + :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A + :pypi:`pytest-order` pytest plugin to run your tests in a specific order Jan 09, 2022 4 - Beta pytest (>=5.0) ; python_version < "3.10" + :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest + :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A + :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Mar 24, 2022 N/A N/A + :pypi:`pytest-owner` Add owner mark for tests Apr 25, 2022 N/A N/A + :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A + :pypi:`pytest-pahrametahrize` Parametrize your tests with a Boston accent. Nov 24, 2021 4 - Beta pytest (>=6.0,<7.0) + :pypi:`pytest-parallel` a pytest plugin for parallel and concurrent testing Oct 10, 2021 3 - Alpha pytest (>=3.0.0) + :pypi:`pytest-parallel-39` a pytest plugin for parallel and concurrent testing Jul 12, 2021 3 - Alpha pytest (>=3.0.0) + :pypi:`pytest-param` pytest plugin to test all, first, last or random params Sep 11, 2016 4 - Beta pytest (>=2.6.0) + :pypi:`pytest-paramark` Configure pytest fixtures using a combination of"parametrize" and markers Jan 10, 2020 4 - Beta pytest (>=4.5.0) + :pypi:`pytest-parametrization` Simpler PyTest parametrization Nov 30, 2021 5 - Production/Stable pytest + :pypi:`pytest-parametrize-cases` A more user-friendly way to write parametrized tests. Mar 13, 2022 N/A pytest (>=6.1.2) + :pypi:`pytest-parametrized` Pytest plugin for parametrizing tests with default iterables. Oct 19, 2020 5 - Production/Stable pytest + :pypi:`pytest-parawtf` Finally spell paramete?ri[sz]e correctly Dec 03, 2018 4 - Beta pytest (>=3.6.0) + :pypi:`pytest-pass` Check out https://github.com/elilutsky/pytest-pass Dec 04, 2019 N/A N/A + :pypi:`pytest-passrunner` Pytest plugin providing the 'run_on_pass' marker Feb 10, 2021 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-paste-config` Allow setting the path to a paste config file Sep 18, 2013 3 - Alpha N/A + :pypi:`pytest-patches` A contextmanager pytest fixture for handling multiple mock patches Aug 30, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-pdb` pytest plugin which adds pdb helper commands related to pytest. Jul 31, 2018 N/A N/A + :pypi:`pytest-peach` pytest plugin for fuzzing with Peach API Security Apr 12, 2019 4 - Beta pytest (>=2.8.7) + :pypi:`pytest-pep257` py.test plugin for pep257 Jul 09, 2016 N/A N/A + :pypi:`pytest-pep8` pytest plugin to check PEP8 requirements Apr 27, 2014 N/A N/A + :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) + :pypi:`pytest-perf` pytest-perf Feb 05, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) + :pypi:`pytest-persistence` Pytest tool for persistent objects Apr 22, 2022 N/A N/A + :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 18, 2022 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Apr 15, 2022 4 - Beta pytest (>=5.4.3) + :pypi:`pytest-picked` Run the tests related to the changed files Dec 23, 2020 N/A pytest (>=3.5.0) + :pypi:`pytest-pigeonhole` Jun 25, 2018 5 - Production/Stable pytest (>=3.4) + :pypi:`pytest-pikachu` Show surprise when tests are passing Aug 05, 2021 5 - Production/Stable pytest + :pypi:`pytest-pilot` Slice in your test base thanks to powerful markers. Oct 09, 2020 5 - Production/Stable N/A + :pypi:`pytest-pings` 🦊 The pytest plugin for Firefox Telemetry 📊 Jun 29, 2019 3 - Alpha pytest (>=5.0.0) + :pypi:`pytest-pinned` A simple pytest plugin for pinning tests Sep 17, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-pinpoint` A pytest plugin which runs SBFL algorithms to detect faults. Sep 25, 2020 N/A pytest (>=4.4.0) + :pypi:`pytest-pipeline` Pytest plugin for functional testing of data analysispipelines Jan 24, 2017 3 - Alpha N/A + :pypi:`pytest-platform-markers` Markers for pytest to skip tests on specific platforms Sep 09, 2019 4 - Beta pytest (>=3.6.0) + :pypi:`pytest-play` pytest plugin that let you automate actions and assertions with test metrics reporting executing plain YAML files Jun 12, 2019 5 - Production/Stable N/A + :pypi:`pytest-playbook` Pytest plugin for reading playbooks. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-playwright` A pytest wrapper with fixtures for Playwright to automate web browsers Mar 16, 2022 N/A pytest + :pypi:`pytest-playwrights` A pytest wrapper with fixtures for Playwright to automate web browsers Dec 02, 2021 N/A N/A + :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A + :pypi:`pytest-playwright-visual` A pytest fixture for visual testing with Playwright Apr 28, 2022 N/A N/A + :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Aug 17, 2020 5 - Production/Stable pytest + :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Mar 19, 2020 5 - Production/Stable pytest (>=3.50) + :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A + :pypi:`pytest-pointers` Pytest plugin to define functions you test with special marks for better navigation and reports Oct 14, 2021 N/A N/A + :pypi:`pytest-polarion-cfme` pytest plugin for collecting test cases and recording test results Nov 13, 2017 3 - Alpha N/A + :pypi:`pytest-polarion-collect` pytest plugin for collecting polarion test cases data Jun 18, 2020 3 - Alpha pytest + :pypi:`pytest-polecat` Provides Polecat pytest fixtures Aug 12, 2019 4 - Beta N/A + :pypi:`pytest-ponyorm` PonyORM in Pytest Oct 31, 2018 N/A pytest (>=3.1.1) + :pypi:`pytest-poo` Visualize your crappy tests Mar 25, 2021 5 - Production/Stable pytest (>=2.3.4) + :pypi:`pytest-poo-fail` Visualize your failed tests with poo Feb 12, 2015 5 - Production/Stable N/A + :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Apr 20, 2022 5 - Production/Stable pytest + :pypi:`pytest-portion` Select a portion of the collected tests Jan 28, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest + :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) + :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 27, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) + :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 31, 2022 N/A pytest (>=3.4.1) + :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A + :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Dec 28, 2021 5 - Production/Stable pytest (>=6) + :pypi:`pytest-profiles` pytest plugin for configuration profiles Dec 09, 2021 4 - Beta pytest (>=3.7.0) + :pypi:`pytest-profiling` Profiling plugin for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-progress` pytest plugin for instant test progress status Jan 31, 2022 5 - Production/Stable N/A + :pypi:`pytest-prometheus` Report test pass / failures to a Prometheus PushGateway Oct 03, 2017 N/A N/A + :pypi:`pytest-prometheus-pushgateway` Pytest report plugin for Zulip May 05, 2022 5 - Production/Stable pytest + :pypi:`pytest-prosper` Test helpers for Prosper projects Sep 24, 2018 N/A N/A + :pypi:`pytest-pspec` A rspec format reporter for Python ptest Jun 02, 2020 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-psqlgraph` pytest plugin for testing applications that use psqlgraph Oct 19, 2021 4 - Beta pytest (>=6.0) + :pypi:`pytest-ptera` Use ptera probes in tests Mar 01, 2022 N/A pytest (>=6.2.4,<7.0.0) + :pypi:`pytest-pudb` Pytest PuDB debugger integration Oct 25, 2018 3 - Alpha pytest (>=2.0) + :pypi:`pytest-purkinje` py.test plugin for purkinje test runner Oct 28, 2017 2 - Pre-Alpha N/A + :pypi:`pytest-pycharm` Plugin for py.test to enter PyCharm debugger on uncaught exceptions Aug 13, 2020 5 - Production/Stable pytest (>=2.3) + :pypi:`pytest-pycodestyle` pytest plugin to run pycodestyle Mar 13, 2022 3 - Alpha N/A + :pypi:`pytest-pydev` py.test plugin to connect to a remote debug server with PyDev or PyCharm. Nov 15, 2017 3 - Alpha N/A + :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Mar 13, 2022 3 - Alpha N/A + :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) + :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A + :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) + :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-pyq` Pytest fixture "q" for pyq Mar 10, 2020 5 - Production/Stable N/A + :pypi:`pytest-pyramid` pytest_pyramid - provides fixtures for testing pyramid applications with pytest test suite Oct 15, 2021 5 - Production/Stable pytest + :pypi:`pytest-pyramid-server` Pyramid server fixture for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-pyright` Pytest plugin for type checking code with Pyright Aug 16, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.0) + :pypi:`pytest-pythonpath` pytest plugin for adding to the PYTHONPATH from command line or configs. Feb 10, 2022 5 - Production/Stable pytest (<7,>=2.5.2) + :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest + :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) + :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Jun 26, 2021 4 - Beta pytest (>=6.2.0) + :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Mar 17, 2022 5 - Production/Stable pytest (>=6.2.3) + :pypi:`pytest-qml` Run QML Tests with pytest Dec 02, 2020 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-qr` pytest plugin to generate test result QR codes Nov 25, 2021 4 - Beta N/A + :pypi:`pytest-qt` pytest support for PyQt and PySide applications Jun 13, 2021 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-qt-app` QT app fixture for py.test Dec 23, 2015 5 - Production/Stable N/A + :pypi:`pytest-quarantine` A plugin for pytest to manage expected test failures Nov 24, 2019 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-quickcheck` pytest plugin to generate random data inspired by QuickCheck Nov 15, 2020 4 - Beta pytest (<6.0.0,>=4.0) + :pypi:`pytest-rabbitmq` RabbitMQ process and client fixtures for pytest Feb 11, 2022 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-race` Race conditions tester for pytest Nov 21, 2016 4 - Beta N/A + :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A + :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results May 02, 2022 N/A pytest (>=3.6) + :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Apr 12, 2022 5 - Production/Stable pytest + :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) + :pypi:`pytest-raisesregexp` Simple pytest plugin to look for regex in Exceptions Dec 18, 2015 N/A N/A + :pypi:`pytest-raisin` Plugin enabling the use of exception instances with pytest.raises Feb 06, 2022 N/A pytest + :pypi:`pytest-random` py.test plugin to randomize tests Apr 28, 2013 3 - Alpha N/A + :pypi:`pytest-randomly` Pytest plugin to randomly order tests and control random.seed. May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-randomness` Pytest plugin about random seed management May 30, 2019 3 - Alpha N/A + :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A + :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-readme` Test your README.md file Dec 28, 2014 5 - Production/Stable N/A + :pypi:`pytest-reana` Pytest fixtures for REANA. Mar 31, 2022 3 - Alpha N/A + :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jul 08, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A + :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-redislite` Pytest plugin for testing code using Redis Apr 05, 2022 4 - Beta pytest + :pypi:`pytest-redmine` Pytest plugin for redmine Mar 19, 2018 1 - Planning N/A + :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A + :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Jan 19, 2022 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-regtest` pytest plugin for regression tests Jun 03, 2021 N/A N/A + :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A + :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Jun 14, 2019 5 - Production/Stable pytest (<5,>=3) + :pypi:`pytest-remfiles` Pytest plugin to create a temporary directory with remote files Jul 01, 2019 5 - Production/Stable N/A + :pypi:`pytest-remotedata` Pytest plugin for controlling remote data access. Dec 21, 2021 3 - Alpha pytest (>=4.6) + :pypi:`pytest-remote-response` Pytest plugin for capturing and mocking connection requests. Jun 30, 2021 4 - Beta pytest (>=4.6) + :pypi:`pytest-remove-stale-bytecode` py.test plugin to remove stale byte code files. Mar 04, 2020 4 - Beta pytest + :pypi:`pytest-reorder` Reorder tests depending on their paths and names. May 31, 2018 4 - Beta pytest + :pypi:`pytest-repeat` pytest plugin for repeating tests Oct 31, 2020 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-replay` Saves previous test runs and allow re-execute previous pytest runs to reproduce crashes or flaky tests Jun 09, 2021 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-repo-health` A pytest plugin to report on repository standards conformance Dec 16, 2021 3 - Alpha pytest + :pypi:`pytest-report` Creates json report that is compatible with atom.io's linter message format May 11, 2016 4 - Beta N/A + :pypi:`pytest-reporter` Generate Pytest reports with templates Jul 22, 2021 4 - Beta pytest + :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest Jun 08, 2021 4 - Beta N/A + :pypi:`pytest-reportinfra` Pytest plugin for reportinfra Aug 11, 2019 3 - Alpha N/A + :pypi:`pytest-reporting` A plugin to report summarized results in a table format Oct 25, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility Dec 11, 2020 3 - Alpha pytest (>=5.2) + :pypi:`pytest-report-me` A pytest plugin to generate report. Dec 31, 2020 N/A pytest + :pypi:`pytest-report-parameters` pytest plugin for adding tests' parameters to junit report Jun 18, 2020 3 - Alpha pytest (>=2.4.2) + :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Apr 26, 2022 N/A pytest (>=3.8.0) + :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) + :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Jun 17, 2021 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) + :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) + :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A + :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Apr 13, 2022 N/A N/A + :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A + :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A + :pypi:`pytest-responses` py.test integration for responses Apr 26, 2021 N/A pytest (>=2.5) + :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A + :pypi:`pytest-reverse` Pytest plugin to reverse test order. May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0) + :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) + :pypi:`pytest-ringo` pytest plugin to test webapplications using the Ringo webframework Sep 27, 2017 3 - Alpha N/A + :pypi:`pytest-rng` Fixtures for seeding tests and making randomness reproducible Aug 08, 2019 5 - Production/Stable pytest + :pypi:`pytest-roast` pytest plugin for ROAST configuration override and fixtures Jul 29, 2021 5 - Production/Stable pytest + :pypi:`pytest-rocketchat` Pytest to Rocket.Chat reporting plugin Apr 18, 2021 5 - Production/Stable N/A + :pypi:`pytest-rotest` Pytest integration with rotest Sep 08, 2019 N/A pytest (>=3.5.0) + :pypi:`pytest-rpc` Extend py.test for RPC OpenStack testing. Feb 22, 2019 4 - Beta pytest (~=3.6) + :pypi:`pytest-rst` Test code from RST documents with pytest Sep 21, 2021 N/A pytest + :pypi:`pytest-rt` pytest data collector plugin for Testgr May 05, 2022 N/A N/A + :pypi:`pytest-rts` Coverage-based regression test selection (RTS) plugin for pytest May 17, 2021 N/A pytest + :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest + :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A + :pypi:`pytest-runner` Invoke py.test as distutils command with dependency resolution Feb 25, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A N/A + :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). May 10, 2022 3 - Alpha N/A + :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A + :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A + :pypi:`pytest-salt-factories` Pytest Salt Plugin May 09, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) + :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) + :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) + :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A + :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. May 14, 2022 5 - Production/Stable N/A + :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A + :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A + :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) + :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. May 14, 2022 5 - Production/Stable N/A + :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A + :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A + :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A + :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest + :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A + :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A + :pypi:`pytest-session2file` pytest-session2file (aka: pytest-session_to_file for v0.1.0 - v0.1.2) is a py.test plugin for capturing and saving to file the stdout of py.test. Jan 26, 2021 3 - Alpha pytest + :pypi:`pytest-session-fixture-globalize` py.test plugin to make session fixtures behave as if written in conftest, even if it is written in some modules May 15, 2018 4 - Beta N/A + :pypi:`pytest-session_to_file` pytest-session_to_file is a py.test plugin for capturing and saving to file the stdout of py.test. Oct 01, 2015 3 - Alpha N/A + :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A + :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest + :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A + :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Feb 21, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest + :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 5 - Production/Stable pytest (>=3.5.1) + :pypi:`pytest-shortcuts` Expand command-line shortcuts listed in pytest configuration Oct 29, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-shutil` A goodie-bag of unix shell and environment tools for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-simplehttpserver` Simple pytest fixture to spin up an HTTP server Jun 24, 2021 4 - Beta N/A + :pypi:`pytest-simple-plugin` Simple pytest plugin Nov 27, 2019 N/A N/A + :pypi:`pytest-simple-settings` simple-settings plugin for pytest Nov 17, 2020 4 - Beta pytest + :pypi:`pytest-single-file-logging` Allow for multiple processes to log to a single file May 05, 2016 4 - Beta pytest (>=2.8.1) + :pypi:`pytest-skip-markers` Pytest Salt Plugin May 09, 2022 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-skipper` A plugin that selects only tests with changes in execution path Mar 26, 2017 3 - Alpha pytest (>=3.0.6) + :pypi:`pytest-skippy` Automatically skip tests that don't need to run! Jan 27, 2018 3 - Alpha pytest (>=2.3.4) + :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Apr 26, 2022 N/A N/A + :pypi:`pytest-slack` Pytest to Slack reporting plugin Dec 15, 2020 5 - Production/Stable N/A + :pypi:`pytest-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A + :pypi:`pytest-smartcollect` A plugin for collecting tests that touch changed code Oct 04, 2018 N/A pytest (>=3.5.0) + :pypi:`pytest-smartcov` Smart coverage plugin for pytest. Sep 30, 2017 3 - Alpha N/A + :pypi:`pytest-smell` Automated bad smell detection tool for Pytest May 02, 2022 N/A N/A + :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest + :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) + :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A + :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Apr 23, 2022 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-snmpserver` May 12, 2021 N/A N/A + :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Jan 05, 2022 4 - Beta pytest (>=6.2.0) + :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Jan 23, 2022 4 - Beta pytest (>=3.6.3) + :pypi:`pytest-soft-assertions` May 05, 2020 3 - Alpha pytest + :pypi:`pytest-solidity` A PyTest library plugin for Solidity language. Jan 15, 2022 1 - Planning pytest (<7,>=6.0.1) ; extra == 'tests' + :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) + :pypi:`pytest-sorter` A simple plugin to first execute tests that historically failed more Apr 20, 2021 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Apr 11, 2022 2 - Pre-Alpha pytest + :pypi:`pytest-sourceorder` Test-ordering plugin for pytest Sep 01, 2021 4 - Beta pytest + :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. Feb 23, 2020 4 - Beta pytest + :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A + :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. May 04, 2021 N/A N/A + :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Mar 30, 2022 4 - Beta pytest (>=7.0.0) + :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A + :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A + :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Dec 22, 2021 6 - Mature pytest (>=6.2.4) + :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Apr 22, 2022 4 - Beta pytest (>=5,<8) + :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) + :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) + :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Apr 19, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A + :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) + :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A + :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Mar 13, 2018 3 - Alpha N/A + :pypi:`pytest-sql-bigquery` Yet another SQL-testing framework for BigQuery provided by pytest plugin Dec 19, 2019 N/A pytest + :pypi:`pytest-squadcast` Pytest report plugin for Squadcast Feb 22, 2022 5 - Production/Stable pytest + :pypi:`pytest-srcpaths` Add paths to sys.path Oct 15, 2021 N/A N/A + :pypi:`pytest-ssh` pytest plugin for ssh command run May 27, 2019 N/A pytest + :pypi:`pytest-start-from` Start pytest run from a given point Apr 11, 2016 N/A N/A + :pypi:`pytest-statsd` pytest plugin for reporting to graphite Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-stepfunctions` A small description May 08, 2021 4 - Beta pytest + :pypi:`pytest-steps` Create step-wise / incremental tests in pytest. Sep 23, 2021 5 - Production/Stable N/A + :pypi:`pytest-stepwise` Run a test suite one failing test at a time. Dec 01, 2015 4 - Beta N/A + :pypi:`pytest-stoq` A plugin to pytest stoq Feb 09, 2021 4 - Beta N/A + :pypi:`pytest-stress` A Pytest plugin that allows you to loop tests for a user defined amount of time. Dec 07, 2019 4 - Beta pytest (>=3.6.0) + :pypi:`pytest-structlog` Structured logging assertions Sep 21, 2021 N/A pytest + :pypi:`pytest-structmpd` provide structured temporary directory Oct 17, 2018 N/A N/A + :pypi:`pytest-stub` Stub packages, modules and attributes. Apr 28, 2020 5 - Production/Stable N/A + :pypi:`pytest-stubprocess` Provide stub implementations for subprocesses in Python tests Sep 17, 2018 3 - Alpha pytest (>=3.5.0) + :pypi:`pytest-study` A pytest plugin to organize long run tests (named studies) without interfering the regular tests Sep 26, 2017 3 - Alpha pytest (>=2.0) + :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Feb 09, 2022 5 - Production/Stable pytest (>=4.0.0) + :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Mar 02, 2021 N/A N/A + :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Feb 13, 2022 4 - Beta pytest (>=7.0) + :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A + :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Jul 06, 2020 3 - Alpha N/A + :pypi:`pytest-sugar-bugfix159` Workaround for https://github.com/Frozenball/pytest-sugar/issues/159 Nov 07, 2018 5 - Production/Stable pytest (!=3.7.3,>=3.5); extra == 'testing' + :pypi:`pytest-super-check` Pytest plugin to check your TestCase classes call super in setUp, tearDown, etc. May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-svn` SVN repository fixture for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-symbols` pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. Nov 20, 2017 3 - Alpha N/A + :pypi:`pytest-system-statistics` Pytest plugin to track and report system usage statistics Feb 16, 2022 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-system-test-plugin` Pyst - Pytest System-Test Plugin Feb 03, 2022 N/A N/A + :pypi:`pytest-takeltest` Fixtures for ansible, testinfra and molecule Jan 04, 2022 N/A N/A + :pypi:`pytest-talisker` Nov 28, 2021 N/A N/A + :pypi:`pytest-tap` Test Anything Protocol (TAP) reporting plugin for pytest Oct 27, 2021 5 - Production/Stable pytest (>=3.0) + :pypi:`pytest-tape` easy assertion with expected results saved to yaml files Mar 17, 2021 4 - Beta N/A + :pypi:`pytest-target` Pytest plugin for remote target orchestration. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-tblineinfo` tblineinfo is a py.test plugin that insert the node id in the final py.test report when --tb=line option is used Dec 01, 2015 3 - Alpha pytest (>=2.0) + :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A + :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A + :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) + :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Jan 17, 2022 N/A pytest (>=6.0) + :pypi:`pytest-terraform-fixture` generate terraform resources to use with pytest Nov 14, 2018 4 - Beta N/A + :pypi:`pytest-testbook` A plugin to run tests written in Jupyter notebook Dec 11, 2016 3 - Alpha N/A + :pypi:`pytest-testconfig` Test configuration plugin for pytest. Jan 11, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-testdirectory` A py.test plugin providing temporary directories in unit tests. Feb 21, 2022 5 - Production/Stable pytest + :pypi:`pytest-testdox` A testdox format reporter for pytest Apr 19, 2022 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A + :pypi:`pytest-testinfra` Test infrastructures Apr 12, 2022 5 - Production/Stable pytest (!=3.0.2) + :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) + :pypi:`pytest-testmon` selects tests affected by changed files and methods Mar 11, 2022 4 - Beta N/A + :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest + :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) + :pypi:`pytest-testrail2` A small example package Nov 17, 2020 N/A pytest (>=5) + :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Mar 11, 2022 N/A pytest (>=5.5) + :pypi:`pytest-testrail-api-client` TestRail Api Python Client Dec 14, 2021 N/A pytest + :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A + :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A + :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) + :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. May 10, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Oct 08, 2021 N/A pytest (>=3.6) + :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest + :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A + :pypi:`pytest-testreport` Nov 12, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-testreport-new` May 05, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) + :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) + :pypi:`pytest-test-utils` Dec 14, 2021 N/A pytest (>=5) + :pypi:`pytest-tesults` Tesults plugin for pytest Dec 31, 2021 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-tezos` pytest-ligo Jan 16, 2020 4 - Beta N/A + :pypi:`pytest-th2-bdd` pytest_th2_bdd May 13, 2022 N/A N/A + :pypi:`pytest-thawgun` Pytest plugin for time travel May 26, 2020 3 - Alpha N/A + :pypi:`pytest-threadleak` Detects thread leaks Jan 18, 2022 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-tick` Ticking on tests Aug 31, 2021 5 - Production/Stable pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-timeit` A pytest plugin to time test function runs Oct 13, 2016 4 - Beta N/A + :pypi:`pytest-timeout` pytest plugin to abort hanging tests Jan 18, 2022 5 - Production/Stable pytest (>=5.0.0) + :pypi:`pytest-timeouts` Linux-only Pytest plugin to control durations of various test case execution phases Sep 21, 2019 5 - Production/Stable N/A + :pypi:`pytest-timer` A timer plugin for pytest Jun 02, 2021 N/A N/A + :pypi:`pytest-timestamper` Pytest plugin to add a timestamp prefix to the pytest output Jun 06, 2021 N/A N/A + :pypi:`pytest-timestamps` A simple plugin to view timestamps for each test Jan 16, 2022 N/A pytest (>=5.2) + :pypi:`pytest-tipsi-django` Nov 17, 2021 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-tipsi-testing` Better fixtures management. Various helpers Nov 04, 2020 4 - Beta pytest (>=3.3.0) + :pypi:`pytest-tldr` A pytest plugin that limits the output to just the things you need. Mar 12, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-tm4j-reporter` Cloud Jira Test Management (TM4J) PyTest reporter plugin Sep 01, 2020 N/A pytest + :pypi:`pytest-tmnet` A small example package Mar 01, 2022 N/A N/A + :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest + :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Nov 17, 2021 N/A N/A + :pypi:`pytest-todo` A small plugin for the pytest testing framework, marking TODO comments as failure May 23, 2019 4 - Beta pytest + :pypi:`pytest-tomato` Mar 01, 2019 5 - Production/Stable N/A + :pypi:`pytest-toolbelt` This is just a collection of utilities for pytest, but don't really belong in pytest proper. Aug 12, 2019 3 - Alpha N/A + :pypi:`pytest-toolbox` Numerous useful plugins for pytest. Apr 07, 2018 N/A pytest (>=3.5.0) + :pypi:`pytest-tornado` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Jun 17, 2020 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-tornado5` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Nov 16, 2018 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-tornado-yen3` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Oct 15, 2018 5 - Production/Stable N/A + :pypi:`pytest-tornasync` py.test plugin for testing Python 3.5+ Tornado code Jul 15, 2019 3 - Alpha pytest (>=3.0) + :pypi:`pytest-track` Feb 26, 2021 3 - Alpha pytest (>=3.0) + :pypi:`pytest-translations` Test your translation files. Nov 05, 2021 5 - Production/Stable N/A + :pypi:`pytest-travis-fold` Folds captured output sections in Travis CI build log Nov 29, 2017 4 - Beta pytest (>=2.6.0) + :pypi:`pytest-trello` Plugin for py.test that integrates trello using markers Nov 20, 2015 5 - Production/Stable N/A + :pypi:`pytest-trepan` Pytest plugin for trepan debugger. Jul 28, 2018 5 - Production/Stable N/A + :pypi:`pytest-trialtemp` py.test plugin for using the same _trial_temp working directory as trial Jun 08, 2015 N/A N/A + :pypi:`pytest-trio` Pytest plugin for trio Oct 16, 2020 N/A N/A + :pypi:`pytest-trytond` Pytest plugin for the Tryton server framework Feb 02, 2022 3 - Alpha pytest (>=5) + :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Apr 27, 2022 N/A pytest (>=5.0.0) + :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A + :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, automatically launched after your test run is finished May 02, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 5 - Production/Stable pytest (>=2.3) + :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A + :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Mar 07, 2022 4 - Beta N/A + :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) + :pypi:`pytest-ubersmith` Easily mock calls to ubersmith at the \`requests\` level. Apr 13, 2015 N/A N/A + :pypi:`pytest-ui` Text User Interface for running python tests Jul 05, 2021 4 - Beta pytest + :pypi:`pytest-unhandled-exception-exit-code` Plugin for py.test set a different exit code on uncaught exceptions Jun 22, 2020 5 - Production/Stable pytest (>=2.3) + :pypi:`pytest-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) + :pypi:`pytest-unmarked` Run only unmarked tests Aug 27, 2019 5 - Production/Stable N/A + :pypi:`pytest-unordered` Test equality of unordered collections in pytest Mar 28, 2021 4 - Beta N/A + :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Apr 12, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-upload-report` pytest-upload-report is a plugin for pytest that upload your test report for test results. Jun 18, 2021 5 - Production/Stable N/A + :pypi:`pytest-utils` Some helpers for pytest. Dec 04, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-vagrant` A py.test plugin providing access to vagrant. Sep 07, 2021 5 - Production/Stable pytest + :pypi:`pytest-valgrind` May 19, 2021 N/A N/A + :pypi:`pytest-variables` pytest plugin for providing variables to tests/fixtures Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) + :pypi:`pytest-variant` Variant support for Pytest Jun 20, 2021 N/A N/A + :pypi:`pytest-vcr` Plugin for managing VCR.py cassettes Apr 26, 2019 5 - Production/Stable pytest (>=3.6.0) + :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Apr 21, 2022 4 - Beta pytest (>=6.2.2,<7.0.0) + :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest + :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest + :pypi:`pytest-ver` Pytest module with Verification Report Apr 17, 2022 2 - Pre-Alpha N/A + :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) + :pypi:`pytest-virtualenv` Virtualenv fixture for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-voluptuous` Pytest plugin for asserting data against voluptuous schema. Jun 09, 2020 N/A pytest + :pypi:`pytest-vscodedebug` A pytest plugin to easily enable debugging tests within Visual Studio Code Dec 04, 2020 4 - Beta N/A + :pypi:`pytest-vts` pytest plugin for automatic recording of http stubbed tests Jun 05, 2019 N/A pytest (>=2.3) + :pypi:`pytest-vw` pytest-vw makes your failing test cases succeed under CI tools scrutiny Oct 07, 2015 4 - Beta N/A + :pypi:`pytest-vyper` Plugin for the vyper smart contract language. May 28, 2020 2 - Pre-Alpha N/A + :pypi:`pytest-wa-e2e-plugin` Pytest plugin for testing whatsapp bots with end to end tests Feb 18, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-watch` Local continuous test runner with pytest and watchdog. May 20, 2018 N/A N/A + :pypi:`pytest-watcher` Continiously runs pytest on changes in \*.py files Dec 30, 2021 3 - Alpha N/A + :pypi:`pytest-wdl` Pytest plugin for testing WDL workflows. Nov 17, 2020 5 - Production/Stable N/A + :pypi:`pytest-webdriver` Selenium webdriver fixture for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-wetest` Welian API Automation test framework pytest plugin Nov 10, 2018 4 - Beta N/A + :pypi:`pytest-whirlwind` Testing Tornado. Jun 12, 2020 N/A N/A + :pypi:`pytest-wholenodeid` pytest addon for displaying the whole node id for failures Aug 26, 2015 4 - Beta pytest (>=2.0) + :pypi:`pytest-win32consoletitle` Pytest progress in console title (Win32 only) Aug 08, 2021 N/A N/A + :pypi:`pytest-winnotify` Windows tray notifications for py.test results. Apr 22, 2016 N/A N/A + :pypi:`pytest-wiremock` A pytest plugin for programmatically using wiremock in integration tests Mar 27, 2022 N/A pytest (>=7.1.1,<8.0.0) + :pypi:`pytest-with-docker` pytest with docker helpers. Nov 09, 2021 N/A pytest + :pypi:`pytest-workflow` A pytest plugin for configuring workflow/pipeline tests using YAML files Dec 03, 2021 5 - Production/Stable pytest (>=5.4.0) + :pypi:`pytest-xdist` pytest xdist plugin for distributed testing and loop-on-failing modes Dec 10, 2021 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-xdist-debug-for-graingert` pytest xdist plugin for distributed testing and loop-on-failing modes Jul 24, 2019 5 - Production/Stable pytest (>=4.4.0) + :pypi:`pytest-xdist-forked` forked from pytest-xdist Feb 10, 2020 5 - Production/Stable pytest (>=4.4.0) + :pypi:`pytest-xdist-tracker` pytest plugin helps to reproduce failures for particular xdist node Nov 18, 2021 3 - Alpha pytest (>=3.5.1) + :pypi:`pytest-xfaillist` Maintain a xfaillist in an additional file to avoid merge-conflicts. Sep 17, 2021 N/A pytest (>=6.2.2,<7.0.0) + :pypi:`pytest-xfiles` Pytest fixtures providing data read from function, module or package related (x)files. Feb 27, 2018 N/A N/A + :pypi:`pytest-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A + :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest + :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Jul 28, 2021 4 - Beta pytest (>=2.8) + :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A + :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) + :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) + :pypi:`pytest-xvfb` A pytest plugin to run Xvfb for tests. Jun 09, 2020 4 - Beta pytest (>=2.8.1) + :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest + :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-yamlwsgi` Run tests against wsgi apps defined in yaml May 11, 2010 N/A N/A + :pypi:`pytest-yapf` Run yapf Jul 06, 2017 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) + :pypi:`pytest-yield` PyTest plugin to run tests concurrently, each \`yield\` switch context to other one Jan 23, 2019 N/A N/A + :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A + :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) + :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A + :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Apr 15, 2022 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) + :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest + =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ .. only:: latex @@ -1312,7 +1316,7 @@ This list contains 1043 plugins. Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures :pypi:`pytest-api` - *last release*: May 07, 2022, + *last release*: May 12, 2022, *status*: N/A, *requires*: pytest (>=7.1.1,<8.0.0) @@ -1340,9 +1344,9 @@ This list contains 1043 plugins. Pytest plugin for appium :pypi:`pytest-approvaltests` - *last release*: Feb 07, 2021, + *last release*: May 08, 2022, *status*: 4 - Beta, - *requires*: pytest (>=3.5.0) + *requires*: pytest (>=7.0.1) A plugin to use approvaltests with pytest @@ -1494,9 +1498,9 @@ This list contains 1043 plugins. automatically check condition and log all the checks :pypi:`pytest-automation` - *last release*: Oct 01, 2021, + *last release*: May 12, 2022, *status*: N/A, - *requires*: pytest + *requires*: pytest (>=7.0.0) pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. @@ -1669,7 +1673,7 @@ This list contains 1043 plugins. A pytest plugin helps developers to debug by providing useful commits history. :pypi:`pytest-blender` - *last release*: Mar 11, 2022, + *last release*: May 12, 2022, *status*: N/A, *requires*: pytest ; extra == 'dev' @@ -1879,7 +1883,7 @@ This list contains 1043 plugins. pytest plugin to capture all warnings and put them in one file of your choice :pypi:`pytest-cases` - *last release*: Mar 21, 2022, + *last release*: May 12, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -2243,7 +2247,7 @@ This list contains 1043 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: May 06, 2022, + *last release*: May 13, 2022, *status*: N/A, *requires*: N/A @@ -2677,7 +2681,7 @@ This list contains 1043 plugins. Factories for your Django models that can be used as Pytest fixtures. :pypi:`pytest-django-filefield` - *last release*: May 06, 2022, + *last release*: May 09, 2022, *status*: 5 - Production/Stable, *requires*: pytest >= 5.2 @@ -3111,35 +3115,35 @@ This list contains 1043 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: May 07, 2022, + *last release*: May 09, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: May 07, 2022, + *last release*: May 09, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: May 07, 2022, + *last release*: May 09, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: May 07, 2022, + *last release*: May 09, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: May 07, 2022, + *last release*: May 09, 2022, *status*: N/A, *requires*: N/A @@ -3153,14 +3157,14 @@ This list contains 1043 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: May 07, 2022, + *last release*: May 09, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: May 07, 2022, + *last release*: May 09, 2022, *status*: N/A, *requires*: N/A @@ -3398,7 +3402,7 @@ This list contains 1043 plugins. Use factories for test setup with py.test :pypi:`pytest-factoryboy` - *last release*: May 02, 2022, + *last release*: May 13, 2022, *status*: 6 - Mature, *requires*: pytest (>=5.0.0) @@ -3474,6 +3478,13 @@ This list contains 1043 plugins. + :pypi:`pytest-fastapi-deps` + *last release*: May 09, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest + + A fixture which allows easy replacement of fastapi dependencies for testing + :pypi:`pytest-fastest` *last release*: Mar 05, 2020, *status*: N/A, @@ -3629,7 +3640,7 @@ This list contains 1043 plugins. pytest plugin to check FLAKE8 requirements :pypi:`pytest-flake8-path` - *last release*: Jan 10, 2022, + *last release*: May 11, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -3944,7 +3955,7 @@ This list contains 1043 plugins. A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. :pypi:`pytest-helm-charts` - *last release*: Jan 10, 2022, + *last release*: May 11, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.1.2,<7.0.0) @@ -4000,7 +4011,7 @@ This list contains 1043 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: May 07, 2022, + *last release*: May 13, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4252,7 +4263,7 @@ This list contains 1043 plugins. Reuse pytest.ini to store env variables :pypi:`pytest-inmanta` - *last release*: Apr 26, 2022, + *last release*: May 13, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4272,6 +4283,13 @@ This list contains 1043 plugins. Common fixtures for inmanta LSM related modules + :pypi:`pytest-inmanta-yang` + *last release*: May 10, 2022, + *status*: 4 - Beta, + *requires*: N/A + + Common fixtures used in inmanta yang related modules + :pypi:`pytest-Inomaly` *last release*: Feb 13, 2018, *status*: 4 - Beta, @@ -4364,7 +4382,7 @@ This list contains 1043 plugins. py.test plugin to check import ordering using isort :pypi:`pytest-is-running` - *last release*: Jan 10, 2022, + *last release*: May 11, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -4406,8 +4424,8 @@ This list contains 1043 plugins. py.test JIRA integration plugin, using markers :pypi:`pytest-jira-xray` - *last release*: Mar 09, 2022, - *status*: 3 - Alpha, + *last release*: May 11, 2022, + *status*: 4 - Beta, *requires*: pytest pytest plugin to integrate tests with JIRA XRAY @@ -4749,7 +4767,7 @@ This list contains 1043 plugins. Test your markdown docs with pytest :pypi:`pytest-markdown-docs` - *last release*: Apr 07, 2022, + *last release*: May 12, 2022, *status*: N/A, *requires*: N/A @@ -6198,7 +6216,7 @@ This list contains 1043 plugins. py.test plugin to randomize tests :pypi:`pytest-randomly` - *last release*: Jan 10, 2022, + *last release*: May 11, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6520,7 +6538,7 @@ This list contains 1043 plugins. py.test integration for responses :pypi:`pytest-restrict` - *last release*: Jan 10, 2022, + *last release*: May 11, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6534,7 +6552,7 @@ This list contains 1043 plugins. A RethinkDB plugin for pytest. :pypi:`pytest-reverse` - *last release*: Jan 10, 2022, + *last release*: May 11, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6645,6 +6663,13 @@ This list contains 1043 plugins. Call runtime_xfail() to mark running test as xfail. + :pypi:`pytest-saccharin` + *last release*: May 10, 2022, + *status*: 3 - Alpha, + *requires*: N/A + + pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). + :pypi:`pytest-salt` *last release*: Jan 27, 2020, *status*: 4 - Beta, @@ -6660,7 +6685,7 @@ This list contains 1043 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Apr 06, 2022, + *last release*: May 09, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6702,7 +6727,7 @@ This list contains 1043 plugins. :pypi:`pytest-sbase` - *last release*: May 02, 2022, + *last release*: May 14, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6744,7 +6769,7 @@ This list contains 1043 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: May 02, 2022, + *last release*: May 14, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6786,7 +6811,7 @@ This list contains 1043 plugins. Extensible server fixures for py.test :pypi:`pytest-serverless` - *last release*: Nov 27, 2021, + *last release*: May 09, 2022, *status*: 4 - Beta, *requires*: N/A @@ -6905,7 +6930,7 @@ This list contains 1043 plugins. Allow for multiple processes to log to a single file :pypi:`pytest-skip-markers` - *last release*: Feb 22, 2022, + *last release*: May 09, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.0.0) @@ -7325,7 +7350,7 @@ This list contains 1043 plugins. Workaround for https://github.com/Frozenball/pytest-sugar/issues/159 :pypi:`pytest-super-check` - *last release*: Jan 10, 2022, + *last release*: May 11, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -7556,7 +7581,7 @@ This list contains 1043 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-testrail-integrator` - *last release*: May 05, 2022, + *last release*: May 10, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) @@ -7632,6 +7657,13 @@ This list contains 1043 plugins. pytest-ligo + :pypi:`pytest-th2-bdd` + *last release*: May 13, 2022, + *status*: N/A, + *requires*: N/A + + pytest_th2_bdd + :pypi:`pytest-thawgun` *last release*: May 26, 2020, *status*: 3 - Alpha, From 73c2d1c6e37d3c3350cbe980c2c18f4aa8d90581 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Mon, 16 May 2022 22:52:27 +0200 Subject: [PATCH 248/549] Remove "Python 2.7 and 3.4 Support" from globaltoc Follow up to #9957 - I missed that the globaltoc is hard-coded and the page needs to be removed there as well. --- doc/en/_templates/globaltoc.html | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/en/_templates/globaltoc.html b/doc/en/_templates/globaltoc.html index 7c595e7ebf2..9bd144903b1 100644 --- a/doc/en/_templates/globaltoc.html +++ b/doc/en/_templates/globaltoc.html @@ -17,7 +17,6 @@

About the project

  • Changelog
  • Contributing
  • Backwards Compatibility
  • -
  • Python 2.7 and 3.4 Support
  • Sponsor
  • pytest for Enterprise
  • License
  • From ee10ecdf7eb20033b8b46e56ae257a0344712b8a Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Mon, 16 May 2022 23:01:54 +0200 Subject: [PATCH 249/549] Reorder the reference guides in the docs This changes the order to: - API Reference - Fixtures reference - Configuration - Exit codes - Plugin List which is approximately sorted from general to specific and often used to less used. Plugin List ist at the end because it points to further external resources. --- doc/en/reference/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/en/reference/index.rst b/doc/en/reference/index.rst index d9648400317..ee1b2e6214d 100644 --- a/doc/en/reference/index.rst +++ b/doc/en/reference/index.rst @@ -8,8 +8,8 @@ Reference guides .. toctree:: :maxdepth: 1 + reference fixtures - plugin_list customize - reference exit-codes + plugin_list From 296b642eb3cc1c14fa4ebc0e748442ed968b8007 Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Tue, 17 May 2022 07:29:32 +0200 Subject: [PATCH 250/549] Fix rst markup in TempdirFactory's docstring. --- src/_pytest/legacypath.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/legacypath.py b/src/_pytest/legacypath.py index 37e8c24220e..ac23888c722 100644 --- a/src/_pytest/legacypath.py +++ b/src/_pytest/legacypath.py @@ -270,8 +270,8 @@ def testdir(pytester: Pytester) -> Testdir: @final @attr.s(init=False, auto_attribs=True) class TempdirFactory: - """Backward compatibility wrapper that implements :class:``_pytest.compat.LEGACY_PATH`` - for :class:``TempPathFactory``.""" + """Backward compatibility wrapper that implements :class:`_pytest.compat.LEGACY_PATH` + for :class:`TempPathFactory`.""" _tmppath_factory: TempPathFactory From a1ed6839e38eecae809360f7641406aec3ba029b Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 17 May 2022 08:09:21 -0300 Subject: [PATCH 251/549] Refer to py.path.local instead of LEGACY_PATH constant for better docs --- .pre-commit-config.yaml | 2 +- src/_pytest/legacypath.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c5856cdd8c7..189aa5b912d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -101,7 +101,7 @@ repos: types: [python] - id: py-path-deprecated name: py.path usage is deprecated - exclude: docs|src/_pytest/deprecated.py|testing/deprecated_test.py + exclude: docs|src/_pytest/deprecated.py|testing/deprecated_test.py|src/_pytest/legacypath.py language: pygrep entry: \bpy\.path\.local types: [python] diff --git a/src/_pytest/legacypath.py b/src/_pytest/legacypath.py index ac23888c722..49149311a7d 100644 --- a/src/_pytest/legacypath.py +++ b/src/_pytest/legacypath.py @@ -270,7 +270,7 @@ def testdir(pytester: Pytester) -> Testdir: @final @attr.s(init=False, auto_attribs=True) class TempdirFactory: - """Backward compatibility wrapper that implements :class:`_pytest.compat.LEGACY_PATH` + """Backward compatibility wrapper that implements :class:`py.path.local` for :class:`TempPathFactory`.""" _tmppath_factory: TempPathFactory @@ -282,11 +282,11 @@ def __init__( self._tmppath_factory = tmppath_factory def mktemp(self, basename: str, numbered: bool = True) -> LEGACY_PATH: - """Same as :meth:`TempPathFactory.mktemp`, but returns a ``_pytest.compat.LEGACY_PATH`` object.""" + """Same as :meth:`TempPathFactory.mktemp`, but returns a :class:`py.path.local` object.""" return legacy_path(self._tmppath_factory.mktemp(basename, numbered).resolve()) def getbasetemp(self) -> LEGACY_PATH: - """Backward compat wrapper for ``_tmppath_factory.getbasetemp``.""" + """Same as :meth:`TempPathFactory.getbasetemp`, but returns a :class:`py.path.local` object.""" return legacy_path(self._tmppath_factory.getbasetemp().resolve()) From 0e62861e847eeca1fb76bd63a03b1c5d5ef23206 Mon Sep 17 00:00:00 2001 From: Pete Baughman <99513503+petebman@users.noreply.github.com> Date: Mon, 23 May 2022 17:44:27 +0000 Subject: [PATCH 252/549] Improve error message in getfixturevalue --- changelog/9984.trivial.rst | 4 ++++ src/_pytest/fixtures.py | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 changelog/9984.trivial.rst diff --git a/changelog/9984.trivial.rst b/changelog/9984.trivial.rst new file mode 100644 index 00000000000..cca8170629c --- /dev/null +++ b/changelog/9984.trivial.rst @@ -0,0 +1,4 @@ +Improve the error message when we attempt to access a fixture that has been +torn down. +Add an additional sentence to the docstring explaining when it's not a good +idea to call getfixturevalue. diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index ee3e93f1908..af5b449d0d3 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -548,11 +548,18 @@ def getfixturevalue(self, argname: str) -> Any: 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, but during the test teardown phase a fixture's value may not + be available. + :raises pytest.FixtureLookupError: If the given fixture could not be found. """ fixturedef = self._get_active_fixturedef(argname) - assert fixturedef.cached_result is not None + assert fixturedef.cached_result is not None, ( + f'The fixture value for "{argname}" is not available. ' + "This can happen when the fixture has already been torn down." + ) return fixturedef.cached_result[0] def _get_active_fixturedef( From 8ac6dce2c7ec1083e849417379e13b354d5aecfd Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Tue, 24 May 2022 01:20:51 -0700 Subject: [PATCH 253/549] Add shell-style wildcard support to 'testpaths' (#9897) This is especially useful for large repositories (e.g. monorepos) that use a hierarchical file system organization for nested test paths. src/*/tests The implementation uses the standard `glob` module to perform wildcard expansion in Config.parse(). The related logic that determines whether or not to include 'testpaths' in the terminal header was previously relying on a weak heuristic: if Config.args matched 'testpaths', then its value was printed. That generally worked, but it could also print when the user explicitly used the same arguments on the command-line as listed in 'testpaths'. Not a big deal, but it shows that the check was logically incorrect. Now that 'testpaths' can contain wildcards, it's no longer possible to perform this simple comparison, so this change also introduces a public Config.ArgSource enum and Config.args_source attribute that explicitly names the "source" of the arguments: the command line, the invocation directory, or the 'testdata' configuration value. --- AUTHORS | 1 + changelog/9897.feature.rst | 1 + doc/en/reference/reference.rst | 2 ++ src/_pytest/config/__init__.py | 26 +++++++++++++++++++++++++- src/_pytest/terminal.py | 4 ++-- testing/test_collection.py | 18 +++++++++++------- 6 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 changelog/9897.feature.rst diff --git a/AUTHORS b/AUTHORS index 86a814a137b..6baf9be2bd9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -165,6 +165,7 @@ Jeff Widman Jenni Rinker John Eddie Ayson John Towler +Jon Parise Jon Sonesen Jonas Obrist Jordan Guymon diff --git a/changelog/9897.feature.rst b/changelog/9897.feature.rst new file mode 100644 index 00000000000..7464067bfcd --- /dev/null +++ b/changelog/9897.feature.rst @@ -0,0 +1 @@ +Added shell-style wildcard support to ``testpaths``. diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index d082697258c..c1fb47e33b9 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1699,6 +1699,8 @@ passed multiple times. The expected format is ``name=value``. For example:: Sets list of directories that should be searched for tests when no specific directories, files or test ids are given in the command line when executing pytest from the :ref:`rootdir ` directory. + File system paths may use shell-style wildcards, including the recursive + ``**`` pattern. Useful when all project tests are in a known location to speed up test collection and to avoid picking up undesired tests by accident. diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 05abaa8eda6..dfbda68ea78 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -3,6 +3,7 @@ import collections.abc import copy import enum +import glob import inspect import os import re @@ -899,6 +900,19 @@ class InvocationParams: dir: Path """The directory from which :func:`pytest.main` was invoked.""" + class ArgsSource(enum.Enum): + """Indicates the source of the test arguments. + + .. versionadded:: 7.2 + """ + + #: Command line arguments. + ARGS = enum.auto() + #: Invocation directory. + INCOVATION_DIR = enum.auto() + #: 'testpaths' configuration value. + TESTPATHS = enum.auto() + def __init__( self, pluginmanager: PytestPluginManager, @@ -1308,15 +1322,25 @@ def parse(self, args: List[str], addopts: bool = True) -> None: self.hook.pytest_cmdline_preparse(config=self, args=args) self._parser.after_preparse = True # type: ignore try: + source = Config.ArgsSource.ARGS args = self._parser.parse_setoption( args, self.option, namespace=self.option ) if not args: if self.invocation_params.dir == self.rootpath: - args = self.getini("testpaths") + source = Config.ArgsSource.TESTPATHS + testpaths: List[str] = self.getini("testpaths") + if self.known_args_namespace.pyargs: + args = testpaths + else: + args = [] + for path in testpaths: + args.extend(sorted(glob.iglob(path, recursive=True))) if not args: + source = Config.ArgsSource.INCOVATION_DIR args = [str(self.invocation_params.dir)] self.args = args + self.args_source = source except PrintHelp: pass diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index bb07b3ce7c6..8e47f26045a 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -730,8 +730,8 @@ def pytest_report_header(self, config: Config) -> List[str]: if config.inipath: line += ", configfile: " + bestrelpath(config.rootpath, config.inipath) - testpaths: List[str] = config.getini("testpaths") - if config.invocation_params.dir == config.rootpath and config.args == testpaths: + if config.args_source == Config.ArgsSource.TESTPATHS: + testpaths: List[str] = config.getini("testpaths") line += ", testpaths: {}".format(", ".join(testpaths)) result = [line] diff --git a/testing/test_collection.py b/testing/test_collection.py index 9099ec57fca..58e1d862a35 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -244,28 +244,32 @@ def test_testpaths_ini(self, pytester: Pytester, monkeypatch: MonkeyPatch) -> No pytester.makeini( """ [pytest] - testpaths = gui uts + testpaths = */tests """ ) tmp_path = pytester.path - ensure_file(tmp_path / "env" / "test_1.py").write_text("def test_env(): pass") - ensure_file(tmp_path / "gui" / "test_2.py").write_text("def test_gui(): pass") - ensure_file(tmp_path / "uts" / "test_3.py").write_text("def test_uts(): pass") + ensure_file(tmp_path / "a" / "test_1.py").write_text("def test_a(): pass") + ensure_file(tmp_path / "b" / "tests" / "test_2.py").write_text( + "def test_b(): pass" + ) + ensure_file(tmp_path / "c" / "tests" / "test_3.py").write_text( + "def test_c(): pass" + ) # executing from rootdir only tests from `testpaths` directories # are collected items, reprec = pytester.inline_genitems("-v") - assert [x.name for x in items] == ["test_gui", "test_uts"] + assert [x.name for x in items] == ["test_b", "test_c"] # check that explicitly passing directories in the command-line # collects the tests - for dirname in ("env", "gui", "uts"): + for dirname in ("a", "b", "c"): items, reprec = pytester.inline_genitems(tmp_path.joinpath(dirname)) assert [x.name for x in items] == ["test_%s" % dirname] # changing cwd to each subdirectory and running pytest without # arguments collects the tests in that directory normally - for dirname in ("env", "gui", "uts"): + for dirname in ("a", "b", "c"): monkeypatch.chdir(pytester.path.joinpath(dirname)) items, reprec = pytester.inline_genitems() assert [x.name for x in items] == ["test_%s" % dirname] From 9a9acf13f89da7578d0b16b48e92ea09102eb755 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Tue, 24 May 2022 10:23:39 +0200 Subject: [PATCH 254/549] Declutter doc entry page (#9969) - Remove the index page https://docs.pytest.org/en/7.1.x/genindex.html Such an index is reasonable in books but not so much in HTML pages. IMHO the integrated search is much more user-friendly and sufficient. - Remove the PDF link from the entry page. The PDF is already linked in the sidebar. I anticipate that getting the PDF documentation is not a major concern for users. - Remove the sections "Changelog" and "License" from the entry page. These section only contain links to the respective pages. These topics are purely technical. They should be easily accessible (which they still are through sidebar section "About the project"), but they don't need additional advertisement through a dedicated section on the entry page. --- doc/en/_templates/globaltoc.html | 2 -- doc/en/conf.py | 2 +- doc/en/index.rst | 17 ----------------- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/doc/en/_templates/globaltoc.html b/doc/en/_templates/globaltoc.html index 9bd144903b1..09d970b64ed 100644 --- a/doc/en/_templates/globaltoc.html +++ b/doc/en/_templates/globaltoc.html @@ -29,5 +29,3 @@

    About the project

    {%- endif %}
    -Index -
    diff --git a/doc/en/conf.py b/doc/en/conf.py index 1adc3493ad5..5aedd2d322d 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -247,7 +247,7 @@ html_domain_indices = True # If false, no index is generated. -html_use_index = True +html_use_index = False # If true, the index is split into individual pages for each letter. # html_split_index = False diff --git a/doc/en/index.rst b/doc/en/index.rst index 03a39aaaae8..8b4528ddf2d 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -27,8 +27,6 @@ scale to support complex functional testing for applications and libraries. **PyPI package name**: :pypi:`pytest` -**Documentation as PDF**: `download latest `_ - A quick example --------------- @@ -104,11 +102,6 @@ Bugs/Requests Please use the `GitHub issue tracker `_ to submit bugs or request features. -Changelog ---------- - -Consult the :ref:`Changelog ` page for fixes and enhancements of each version. - Support pytest -------------- @@ -141,13 +134,3 @@ Security pytest has never been associated with a security vulnerability, but in any case, to report a security vulnerability please use the `Tidelift security contact `_. Tidelift will coordinate the fix and disclosure. - - -License -------- - -Copyright Holger Krekel and others, 2004. - -Distributed under the terms of the `MIT`_ license, pytest is free and open source software. - -.. _`MIT`: https://github.com/pytest-dev/pytest/blob/main/LICENSE From 31f9e5bcdd3396ac0daf6d35c9d8aa8a2cd72993 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 24 May 2022 11:12:31 +0200 Subject: [PATCH 255/549] [automated] Update plugin list (#9985) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 124 +++++++++++++++++-------------- 1 file changed, 70 insertions(+), 54 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 6def59d1b14..8b1202fca31 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1047 plugins. +This list contains 1049 plugins. .. only:: not latex @@ -19,7 +19,7 @@ This list contains 1047 plugins. name summary last release status requires =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Apr 26, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) May 17, 2022 N/A pytest (>=5.4.0) :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) @@ -78,8 +78,9 @@ This list contains 1047 plugins. :pypi:`pytest-atomic` Skip rest of tests if previous test failed. Nov 24, 2018 4 - Beta N/A :pypi:`pytest-attrib` pytest plugin to select tests based on attributes similar to the nose-attrib plugin May 24, 2016 4 - Beta N/A :pypi:`pytest-austin` Austin plugin for pytest Oct 11, 2020 4 - Beta N/A + :pypi:`pytest-autocap` automatically capture test & fixture stdout/stderr to files May 15, 2022 N/A pytest (<7.2,>=7.1.2) :pypi:`pytest-autochecklog` automatically check condition and log all the checks Apr 25, 2015 4 - Beta N/A - :pypi:`pytest-automation` pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. May 12, 2022 N/A pytest (>=7.0.0) + :pypi:`pytest-automation` pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. May 20, 2022 N/A pytest (>=7.0.0) :pypi:`pytest-automock` Pytest plugin for automatical mocks creation Feb 01, 2022 N/A pytest ; extra == 'dev' :pypi:`pytest-auto-parametrize` pytest plugin: avoid repeating arguments in parametrize Oct 02, 2016 3 - Alpha N/A :pypi:`pytest-autotest` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Aug 25, 2021 N/A pytest @@ -104,7 +105,7 @@ This list contains 1047 plugins. :pypi:`pytest-black` A pytest plugin to enable format checking with black Oct 05, 2020 4 - Beta N/A :pypi:`pytest-black-multipy` Allow '--black' on older Pythons Jan 14, 2021 5 - Production/Stable pytest (!=3.7.3,>=3.5) ; extra == 'testing' :pypi:`pytest-blame` A pytest plugin helps developers to debug by providing useful commits history. May 04, 2019 N/A pytest (>=4.4.0) - :pypi:`pytest-blender` Blender Pytest plugin. May 12, 2022 N/A pytest ; extra == 'dev' + :pypi:`pytest-blender` Blender Pytest plugin. May 17, 2022 N/A pytest ; extra == 'dev' :pypi:`pytest-blink1` Pytest plugin to emit notifications via the Blink(1) RGB LED Jan 07, 2018 4 - Beta N/A :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A @@ -134,7 +135,7 @@ This list contains 1047 plugins. :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A :pypi:`pytest-capture-deprecatedwarnings` pytest plugin to capture all deprecatedwarnings and put them in one file Apr 30, 2019 N/A N/A :pypi:`pytest-capture-warnings` pytest plugin to capture all warnings and put them in one file of your choice May 03, 2022 N/A pytest - :pypi:`pytest-cases` Separate test code from test cases in pytest. May 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-cases` Separate test code from test cases in pytest. May 20, 2022 5 - Production/Stable N/A :pypi:`pytest-cassandra` Cassandra CCM Test Fixtures for pytest Nov 04, 2017 1 - Planning N/A :pypi:`pytest-catchlog` py.test plugin to catch log messages. This is a fork of pytest-capturelog. Jan 24, 2016 4 - Beta pytest (>=2.6) :pypi:`pytest-catch-server` Pytest plugin with server for catching HTTP requests. Dec 12, 2019 5 - Production/Stable N/A @@ -168,7 +169,7 @@ This list contains 1047 plugins. :pypi:`pytest-collect-formatter2` Formatter for pytest collect output May 31, 2021 5 - Production/Stable N/A :pypi:`pytest-colordots` Colorizes the progress indicators Oct 06, 2017 5 - Production/Stable N/A :pypi:`pytest-commander` An interactive GUI test runner for PyTest Aug 17, 2021 N/A pytest (<7.0.0,>=6.2.4) - :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method Nov 12, 2020 N/A pytest (>=3.6,<7) + :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method May 15, 2022 N/A pytest (>=3.6,<8) :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-config` Base configurations and utilities for developing your Python project test suite with pytest. Nov 07, 2014 5 - Production/Stable N/A :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Apr 17, 2022 N/A N/A @@ -351,7 +352,7 @@ This list contains 1047 plugins. :pypi:`pytest-extra-durations` A pytest plugin to get durations on a per-function basis and per module basis. Apr 21, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-fabric` Provides test utilities to run fabric task tests by using docker containers Sep 12, 2018 5 - Production/Stable N/A :pypi:`pytest-factory` Use factories for test setup with py.test Sep 06, 2020 3 - Alpha pytest (>4.3) - :pypi:`pytest-factoryboy` Factory Boy support for pytest. May 13, 2022 6 - Mature pytest (>=5.0.0) + :pypi:`pytest-factoryboy` Factory Boy support for pytest. May 21, 2022 6 - Mature pytest (>=5.0.0) :pypi:`pytest-factoryboy-fixtures` Generates pytest fixtures that allow the use of type hinting Jun 25, 2020 N/A N/A :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-failed-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A @@ -379,7 +380,7 @@ This list contains 1047 plugins. :pypi:`pytest-fixture-config` Fixture configuration utils for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-fixture-maker` Pytest plugin to load fixtures from YAML files Sep 21, 2021 N/A N/A :pypi:`pytest-fixture-marker` A pytest plugin to add markers based on fixtures used. Oct 11, 2020 5 - Production/Stable N/A - :pypi:`pytest-fixture-order` pytest plugin to control fixture evaluation order Aug 25, 2020 N/A pytest (>=3.0) + :pypi:`pytest-fixture-order` pytest plugin to control fixture evaluation order May 16, 2022 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-fixture-rtttg` Warn or fail on fixture name clash Feb 23, 2022 N/A pytest (>=7.0.1,<8.0.0) :pypi:`pytest-fixtures` Common fixtures for pytest May 01, 2019 5 - Production/Stable N/A :pypi:`pytest-fixture-tools` Plugin for pytest which provides tools for fixtures Aug 18, 2020 6 - Mature pytest @@ -419,7 +420,7 @@ This list contains 1047 plugins. :pypi:`pytest-github` Plugin for py.test that associates tests with github issues using a marker. Mar 07, 2019 5 - Production/Stable N/A :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Dec 08, 2021 N/A pytest (>=4.0.0) :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A - :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Nov 26, 2021 4 - Beta pytest + :pypi:`pytest-glamor-allure` Extends allure-pytest functionality May 19, 2022 4 - Beta pytest :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest :pypi:`pytest-golden` Plugin for pytest that offloads expected outputs to data files Nov 23, 2020 N/A pytest (>=6.1.2,<7.0.0) :pypi:`pytest-google-chat` Notify google chat channel for test results Mar 27, 2022 4 - Beta pytest @@ -438,7 +439,7 @@ This list contains 1047 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components May 13, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components May 19, 2022 3 - Alpha pytest (==7.1.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -474,9 +475,9 @@ This list contains 1047 plugins. :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A - :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. May 13, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. May 18, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Apr 29, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules May 18, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules May 10, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) @@ -512,7 +513,7 @@ This list contains 1047 plugins. :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) - :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. Aug 23, 2021 3 - Alpha pytest (>=3.6,<7) + :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. May 17, 2022 3 - Alpha pytest (>=3.6,<8) :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A :pypi:`pytest-lazy-fixture` It helps to use fixtures in pytest.mark.parametrize Feb 01, 2020 4 - Beta pytest (>=3.2.5) @@ -560,7 +561,7 @@ This list contains 1047 plugins. :pypi:`pytest-md` Plugin for generating Markdown reports for pytest results Jul 11, 2019 3 - Alpha pytest (>=4.2.1) :pypi:`pytest-md-report` A pytest plugin to make a test results report with Markdown table format. Feb 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :pypi:`pytest-memprof` Estimates memory consumption of test functions Mar 29, 2019 4 - Beta N/A - :pypi:`pytest-memray` A simple plugin to use with pytest Apr 19, 2022 N/A N/A + :pypi:`pytest-memray` A simple plugin to use with pytest May 17, 2022 N/A N/A :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution May 03, 2022 N/A pytest (>=6.2.5) @@ -574,7 +575,7 @@ This list contains 1047 plugins. :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Jan 28, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-mock-api` A mock API server with configurable routes and responses available as a fixture. Feb 13, 2019 1 - Planning pytest (>=4.0.0) - :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator Mar 08, 2022 5 - Production/Stable N/A + :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator May 16, 2022 5 - Production/Stable N/A :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A @@ -587,7 +588,7 @@ This list contains 1047 plugins. :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Mar 29, 2022 5 - Production/Stable pytest (>=7.0.0) :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Jun 07, 2021 5 - Production/Stable pytest :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures Dec 07, 2019 5 - Production/Stable pytest (>=2.5.2) - :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Dec 23, 2021 5 - Production/Stable pytest + :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. May 18, 2022 5 - Production/Stable pytest :pypi:`pytest-monkeyplus` pytest's monkeypatch subclass with extra functionalities Sep 18, 2012 5 - Production/Stable N/A :pypi:`pytest-monkeytype` pytest-monkeytype: Generate Monkeytype annotations from your pytest tests. Jul 29, 2020 4 - Beta N/A :pypi:`pytest-moto` Fixtures for integration tests of AWS services,uses moto mocking library. Aug 28, 2015 1 - Planning N/A @@ -595,7 +596,7 @@ This list contains 1047 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Apr 22, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Feb 28, 2022 4 - Beta pytest + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin May 17, 2022 4 - Beta pytest :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A @@ -639,8 +640,8 @@ This list contains 1047 plugins. :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest - :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Feb 28, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators May 04, 2022 N/A pytest + :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi May 18, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-operator` Fixtures for Operators May 19, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -758,7 +759,7 @@ This list contains 1047 plugins. :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-readme` Test your README.md file Dec 28, 2014 5 - Production/Stable N/A - :pypi:`pytest-reana` Pytest fixtures for REANA. Mar 31, 2022 3 - Alpha N/A + :pypi:`pytest-reana` Pytest fixtures for REANA. May 16, 2022 3 - Alpha N/A :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jul 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) @@ -826,13 +827,13 @@ This list contains 1047 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. May 14, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. May 21, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. May 14, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. May 21, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -846,7 +847,7 @@ This list contains 1047 plugins. :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A - :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Feb 21, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system May 20, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 5 - Production/Stable pytest (>=3.5.1) :pypi:`pytest-shortcuts` Expand command-line shortcuts listed in pytest configuration Oct 29, 2020 4 - Beta pytest (>=3.5.0) @@ -863,7 +864,7 @@ This list contains 1047 plugins. :pypi:`pytest-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A :pypi:`pytest-smartcollect` A plugin for collecting tests that touch changed code Oct 04, 2018 N/A pytest (>=3.5.0) :pypi:`pytest-smartcov` Smart coverage plugin for pytest. Sep 30, 2017 3 - Alpha N/A - :pypi:`pytest-smell` Automated bad smell detection tool for Pytest May 02, 2022 N/A N/A + :pypi:`pytest-smell` Automated bad smell detection tool for Pytest May 17, 2022 N/A N/A :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A @@ -948,7 +949,7 @@ This list contains 1047 plugins. :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) - :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. May 10, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. May 16, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Oct 08, 2021 N/A pytest (>=3.6) :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A @@ -1052,6 +1053,7 @@ This list contains 1047 plugins. :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) + :pypi:`pytest-xreport` May 17, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-xvfb` A pytest plugin to run Xvfb for tests. Jun 09, 2020 4 - Beta pytest (>=2.8.1) :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) @@ -1062,7 +1064,7 @@ This list contains 1047 plugins. :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A - :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Apr 15, 2022 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting May 20, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ @@ -1078,7 +1080,7 @@ This list contains 1047 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: Apr 26, 2022, + *last release*: May 17, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1490,6 +1492,13 @@ This list contains 1047 plugins. Austin plugin for pytest + :pypi:`pytest-autocap` + *last release*: May 15, 2022, + *status*: N/A, + *requires*: pytest (<7.2,>=7.1.2) + + automatically capture test & fixture stdout/stderr to files + :pypi:`pytest-autochecklog` *last release*: Apr 25, 2015, *status*: 4 - Beta, @@ -1498,7 +1507,7 @@ This list contains 1047 plugins. automatically check condition and log all the checks :pypi:`pytest-automation` - *last release*: May 12, 2022, + *last release*: May 20, 2022, *status*: N/A, *requires*: pytest (>=7.0.0) @@ -1673,7 +1682,7 @@ This list contains 1047 plugins. A pytest plugin helps developers to debug by providing useful commits history. :pypi:`pytest-blender` - *last release*: May 12, 2022, + *last release*: May 17, 2022, *status*: N/A, *requires*: pytest ; extra == 'dev' @@ -1883,7 +1892,7 @@ This list contains 1047 plugins. pytest plugin to capture all warnings and put them in one file of your choice :pypi:`pytest-cases` - *last release*: May 12, 2022, + *last release*: May 20, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -2121,9 +2130,9 @@ This list contains 1047 plugins. An interactive GUI test runner for PyTest :pypi:`pytest-common-subject` - *last release*: Nov 12, 2020, + *last release*: May 15, 2022, *status*: N/A, - *requires*: pytest (>=3.6,<7) + *requires*: pytest (>=3.6,<8) pytest framework for testing different aspects of a common method @@ -3402,7 +3411,7 @@ This list contains 1047 plugins. Use factories for test setup with py.test :pypi:`pytest-factoryboy` - *last release*: May 13, 2022, + *last release*: May 21, 2022, *status*: 6 - Mature, *requires*: pytest (>=5.0.0) @@ -3598,8 +3607,8 @@ This list contains 1047 plugins. A pytest plugin to add markers based on fixtures used. :pypi:`pytest-fixture-order` - *last release*: Aug 25, 2020, - *status*: N/A, + *last release*: May 16, 2022, + *status*: 5 - Production/Stable, *requires*: pytest (>=3.0) pytest plugin to control fixture evaluation order @@ -3878,7 +3887,7 @@ This list contains 1047 plugins. py.test plugin to ignore the same files as git :pypi:`pytest-glamor-allure` - *last release*: Nov 26, 2021, + *last release*: May 19, 2022, *status*: 4 - Beta, *requires*: pytest @@ -4011,7 +4020,7 @@ This list contains 1047 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: May 13, 2022, + *last release*: May 19, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4263,7 +4272,7 @@ This list contains 1047 plugins. Reuse pytest.ini to store env variables :pypi:`pytest-inmanta` - *last release*: May 13, 2022, + *last release*: May 18, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4277,7 +4286,7 @@ This list contains 1047 plugins. Inmanta tests package :pypi:`pytest-inmanta-lsm` - *last release*: Apr 29, 2022, + *last release*: May 18, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4529,9 +4538,9 @@ This list contains 1047 plugins. Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks :pypi:`pytest-lambda` - *last release*: Aug 23, 2021, + *last release*: May 17, 2022, *status*: 3 - Alpha, - *requires*: pytest (>=3.6,<7) + *requires*: pytest (>=3.6,<8) Define pytest fixtures with lambda functions. @@ -4865,7 +4874,7 @@ This list contains 1047 plugins. Estimates memory consumption of test functions :pypi:`pytest-memray` - *last release*: Apr 19, 2022, + *last release*: May 17, 2022, *status*: N/A, *requires*: N/A @@ -4963,7 +4972,7 @@ This list contains 1047 plugins. A mock API server with configurable routes and responses available as a fixture. :pypi:`pytest-mock-generator` - *last release*: Mar 08, 2022, + *last release*: May 16, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -5054,7 +5063,7 @@ This list contains 1047 plugins. pytest plugin for MongoDB fixtures :pypi:`pytest-monitor` - *last release*: Dec 23, 2021, + *last release*: May 18, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -5110,7 +5119,7 @@ This list contains 1047 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Feb 28, 2022, + *last release*: May 17, 2022, *status*: 4 - Beta, *requires*: pytest @@ -5418,14 +5427,14 @@ This list contains 1047 plugins. A pytest plugin for instrumenting test runs via OpenTelemetry :pypi:`pytest-opentmi` - *last release*: Feb 28, 2022, + *last release*: May 18, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: May 04, 2022, + *last release*: May 19, 2022, *status*: N/A, *requires*: pytest @@ -6251,7 +6260,7 @@ This list contains 1047 plugins. Test your README.md file :pypi:`pytest-reana` - *last release*: Mar 31, 2022, + *last release*: May 16, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -6727,7 +6736,7 @@ This list contains 1047 plugins. :pypi:`pytest-sbase` - *last release*: May 14, 2022, + *last release*: May 21, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6769,7 +6778,7 @@ This list contains 1047 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: May 14, 2022, + *last release*: May 21, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6867,7 +6876,7 @@ This list contains 1047 plugins. A pytest plugin to help with testing shell scripts / black box commands :pypi:`pytest-shell-utilities` - *last release*: Feb 21, 2022, + *last release*: May 20, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6986,7 +6995,7 @@ This list contains 1047 plugins. Smart coverage plugin for pytest. :pypi:`pytest-smell` - *last release*: May 02, 2022, + *last release*: May 17, 2022, *status*: N/A, *requires*: N/A @@ -7581,7 +7590,7 @@ This list contains 1047 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-testrail-integrator` - *last release*: May 10, 2022, + *last release*: May 16, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) @@ -8308,6 +8317,13 @@ This list contains 1047 plugins. + :pypi:`pytest-xreport` + *last release*: May 17, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + + :pypi:`pytest-xvfb` *last release*: Jun 09, 2020, *status*: 4 - Beta, @@ -8379,7 +8395,7 @@ This list contains 1047 plugins. OWASP ZAP plugin for py.test. :pypi:`pytest-zebrunner` - *last release*: Apr 15, 2022, + *last release*: May 20, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.5.0) From c988e49af63a50f0704a46a93e73463666451af0 Mon Sep 17 00:00:00 2001 From: Cheuk Ting Ho Date: Wed, 25 May 2022 06:48:02 -0600 Subject: [PATCH 256/549] Warn when test functions return other than None (#9956) Closes #7337 --- AUTHORS | 1 + changelog/7337.improvement.rst | 1 + doc/en/deprecations.rst | 41 ++++++++++++++++++++++++++++++++++ doc/en/reference/reference.rst | 3 +++ src/_pytest/python.py | 9 ++++++++ src/_pytest/warning_types.py | 7 ++++++ src/pytest/__init__.py | 2 ++ testing/acceptance_test.py | 11 +++++++++ 8 files changed, 75 insertions(+) create mode 100644 changelog/7337.improvement.rst diff --git a/AUTHORS b/AUTHORS index 6baf9be2bd9..af9c7a56bce 100644 --- a/AUTHORS +++ b/AUTHORS @@ -63,6 +63,7 @@ Ceridwen Charles Cloud Charles Machalow Charnjit SiNGH (CCSJ) +Cheuk Ting Ho Chris Lamb Chris NeJame Chris Rose diff --git a/changelog/7337.improvement.rst b/changelog/7337.improvement.rst new file mode 100644 index 00000000000..74d98d9b6c9 --- /dev/null +++ b/changelog/7337.improvement.rst @@ -0,0 +1 @@ +A warning is now emitted if a test function returns something other than `None`. This prevents a common mistake among beginners that expect that returning a `bool` (for example `return foo(a, b) == result`) would cause a test to pass or fail, instead of using `assert`. diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index 91944b758f9..3bbd29bb509 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -252,6 +252,47 @@ or ``pytest.warns(Warning)``. See :ref:`warns use cases` for examples. + +Returning non-None value in test functions +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. deprecated:: 7.2 + +A :class:`pytest.PytestReturnNotNoneWarning` is now emitted if a test function returns something other than `None`. + +This prevents a common mistake among beginners that expect that returning a `bool` would cause a test to pass or fail, for example: + +.. code-block:: python + + @pytest.mark.parametrize( + ["a", "b", "result"], + [ + [1, 2, 5], + [2, 3, 8], + [5, 3, 18], + ], + ) + def test_foo(a, b, result): + return foo(a, b) == result + +Given that pytest ignores the return value, this might be surprising that it will never fail. + +The proper fix is to change the `return` to an `assert`: + +.. code-block:: python + + @pytest.mark.parametrize( + ["a", "b", "result"], + [ + [1, 2, 5], + [2, 3, 8], + [5, 3, 18], + ], + ) + def test_foo(a, b, result): + assert foo(a, b) == result + + The ``--strict`` command-line option ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index c1fb47e33b9..a4a5fd3fba4 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1130,6 +1130,9 @@ Custom warnings generated in some situations such as improper usage or deprecate .. autoclass:: pytest.PytestExperimentalApiWarning :show-inheritance: +.. autoclass:: pytest.PytestReturnNotNoneWarning + :show-inheritance: + .. autoclass:: pytest.PytestUnhandledCoroutineWarning :show-inheritance: diff --git a/src/_pytest/python.py b/src/_pytest/python.py index cd951939e7a..4d1f722e474 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -77,10 +77,12 @@ from _pytest.pathlib import visit from _pytest.scope import Scope from _pytest.warning_types import PytestCollectionWarning +from _pytest.warning_types import PytestReturnNotNoneWarning from _pytest.warning_types import PytestUnhandledCoroutineWarning if TYPE_CHECKING: from typing_extensions import Literal + from _pytest.scope import _ScopeName @@ -192,6 +194,13 @@ def pytest_pyfunc_call(pyfuncitem: "Function") -> Optional[object]: result = testfunction(**testargs) if hasattr(result, "__await__") or hasattr(result, "__aiter__"): async_warn_and_skip(pyfuncitem.nodeid) + elif result is not None: + warnings.warn( + PytestReturnNotNoneWarning( + f"Expected None, but {pyfuncitem.nodeid} returned {result!r}, which will be an error in a " + "future version of pytest. Did you mean to use `assert` instead of `return`?" + ) + ) return True diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index ac79bb53acc..ebfeb87d842 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -55,6 +55,13 @@ class PytestRemovedIn8Warning(PytestDeprecationWarning): __module__ = "pytest" +@final +class PytestReturnNotNoneWarning(PytestDeprecationWarning): + """Warning emitted when a test function is returning value other than None.""" + + __module__ = "pytest" + + @final class PytestExperimentalApiWarning(PytestWarning, FutureWarning): """Warning category used to denote experiments in pytest. diff --git a/src/pytest/__init__.py b/src/pytest/__init__.py index 777d3774064..c1634e296bc 100644 --- a/src/pytest/__init__.py +++ b/src/pytest/__init__.py @@ -69,6 +69,7 @@ from _pytest.warning_types import PytestDeprecationWarning from _pytest.warning_types import PytestExperimentalApiWarning from _pytest.warning_types import PytestRemovedIn8Warning +from _pytest.warning_types import PytestReturnNotNoneWarning from _pytest.warning_types import PytestUnhandledCoroutineWarning from _pytest.warning_types import PytestUnhandledThreadExceptionWarning from _pytest.warning_types import PytestUnknownMarkWarning @@ -127,6 +128,7 @@ "PytestDeprecationWarning", "PytestExperimentalApiWarning", "PytestRemovedIn8Warning", + "PytestReturnNotNoneWarning", "Pytester", "PytestPluginManager", "PytestUnhandledCoroutineWarning", diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 92661b0f23a..c7139b538b2 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -1292,3 +1292,14 @@ def test_no_brokenpipeerror_message(pytester: Pytester) -> None: # Cleanup. popen.stderr.close() + + +def test_function_return_non_none_warning(testdir) -> None: + testdir.makepyfile( + """ + def test_stuff(): + return "something" + """ + ) + res = testdir.runpytest() + res.stdout.fnmatch_lines(["*Did you mean to use `assert` instead of `return`?*"]) From e547cd565d32f7bc1db17800f38ade5077c47e03 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 29 May 2022 13:04:53 -0300 Subject: [PATCH 257/549] [automated] Update plugin list (#10001) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 190 ++++++++++++++++++++----------- 1 file changed, 123 insertions(+), 67 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 8b1202fca31..c59689c507c 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,15 +11,16 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1049 plugins. +This list contains 1056 plugins. .. only:: not latex =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ name summary last release status requires =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ + :pypi:`pytest-abstracts` A contextmanager pytest fixture for handling multiple mock abstracts May 25, 2022 N/A N/A :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) May 17, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) May 24, 2022 N/A pytest (>=5.4.0) :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) @@ -62,6 +63,7 @@ This list contains 1049 plugins. :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 4 - Beta pytest (>=4.6) :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A + :pypi:`pytest-assertcount` Plugin to count actual number of asserts in pytest May 22, 2022 N/A N/A :pypi:`pytest-assertions` Pytest Assertions Apr 27, 2022 N/A N/A :pypi:`pytest-assertutil` pytest-assertutil May 10, 2019 N/A N/A :pypi:`pytest-assert-utils` Useful assertion utilities for use with pytest Apr 14, 2022 3 - Alpha N/A @@ -92,6 +94,7 @@ This list contains 1049 plugins. :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-bdd` BDD for pytest Oct 25, 2021 6 - Mature pytest (>=4.3) + :pypi:`pytest-bdd-ng` BDD for pytest May 25, 2022 4 - Beta pytest (>=5.0) :pypi:`pytest-bdd-splinter` Common steps for pytest bdd and splinter integration Aug 12, 2019 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-bdd-web` A simple plugin to use with pytest Jan 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A @@ -222,7 +225,7 @@ This list contains 1049 plugins. :pypi:`pytest-db-plugin` Nov 27, 2021 N/A pytest (>=5.0) :pypi:`pytest-dbt-adapter` A pytest plugin for testing dbt adapter plugins Nov 24, 2021 N/A pytest (<7,>=6) :pypi:`pytest-dbt-conventions` A pytest plugin for linting a dbt project's conventions Mar 02, 2022 N/A pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-dbt-core` Pytest extension for dbt. Jan 28, 2022 N/A pytest (>=6.2.5) ; extra == 'test' + :pypi:`pytest-dbt-core` Pytest extension for dbt. May 27, 2022 N/A pytest (>=6.2.5) ; extra == 'test' :pypi:`pytest-dbus-notification` D-BUS notifications for pytest results. Mar 05, 2014 5 - Production/Stable N/A :pypi:`pytest-deadfixtures` A simple plugin to list unused fixtures in pytest Jul 23, 2020 5 - Production/Stable N/A :pypi:`pytest-deepcov` deepcov Mar 30, 2021 N/A N/A @@ -311,14 +314,14 @@ This list contains 1049 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin May 09, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects May 09, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project May 09, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag May 09, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip May 09, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin May 25, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects May 25, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project May 25, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag May 25, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip May 25, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports May 09, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports May 09, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports May 25, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports May 25, 2022 N/A N/A :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -363,7 +366,7 @@ This list contains 1049 plugins. :pypi:`pytest-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A :pypi:`pytest-fantasy` Pytest plugin for Flask Fantasy Framework Mar 14, 2019 N/A N/A :pypi:`pytest-fastapi` Dec 27, 2020 N/A N/A - :pypi:`pytest-fastapi-deps` A fixture which allows easy replacement of fastapi dependencies for testing May 09, 2022 5 - Production/Stable pytest + :pypi:`pytest-fastapi-deps` A fixture which allows easy replacement of fastapi dependencies for testing May 24, 2022 5 - Production/Stable pytest :pypi:`pytest-fastest` Use SCM and coverage to run only needed tests Mar 05, 2020 N/A N/A :pypi:`pytest-fast-first` Pytest plugin that runs fast tests first Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-faulthandler` py.test plugin that activates the fault handler module for tests (dummy package) Jul 04, 2019 6 - Mature pytest (>=5.0) @@ -413,7 +416,7 @@ This list contains 1049 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. May 04, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. May 26, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -439,7 +442,7 @@ This list contains 1049 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components May 19, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components May 28, 2022 3 - Alpha pytest (==7.1.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -457,7 +460,7 @@ This list contains 1049 plugins. :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Jan 27, 2022 3 - Alpha N/A - :pypi:`pytest-httpx` Send responses to httpx. Feb 05, 2022 5 - Production/Stable pytest (<8.*,>=6.*) + :pypi:`pytest-httpx` Send responses to httpx. May 24, 2022 5 - Production/Stable pytest (<8.*,>=6.*) :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest @@ -495,10 +498,11 @@ This list contains 1049 plugins. :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-it` Pytest plugin to display test reports as a plaintext spec, inspired by Rspec: https://github.com/mattduck/pytest-it. Jan 22, 2020 4 - Beta N/A :pypi:`pytest-iterassert` Nicer list and iterable assertion messages for pytest May 11, 2020 3 - Alpha N/A + :pypi:`pytest-iters` A contextmanager pytest fixture for handling multiple mock iters May 24, 2022 N/A N/A :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY May 11, 2022 4 - Beta pytest + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY May 23, 2022 4 - Beta pytest :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A @@ -544,7 +548,7 @@ This list contains 1049 plugins. :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Apr 18, 2022 3 - Alpha pytest + :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers May 26, 2022 3 - Alpha pytest :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha pytest (>=6) :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) :pypi:`pytest-markdown-docs` Run markdown code fences through pytest May 12, 2022 N/A N/A @@ -557,11 +561,12 @@ This list contains 1049 plugins. :pypi:`pytest-match-skip` Skip matching marks. Matches partial marks using wildcards. May 15, 2019 4 - Beta pytest (>=4.4.1) :pypi:`pytest-mat-report` this is report Jan 20, 2021 N/A N/A :pypi:`pytest-matrix` Provide tools for generating tests from combinations of fixtures. Jun 24, 2020 5 - Production/Stable pytest (>=5.4.3,<6.0.0) + :pypi:`pytest-maybe-raises` Pytest fixture for optional exception testing. May 27, 2022 N/A pytest ; extra == 'dev' :pypi:`pytest-mccabe` pytest plugin to run the mccabe code complexity checker. Jul 22, 2020 3 - Alpha pytest (>=5.4.0) :pypi:`pytest-md` Plugin for generating Markdown reports for pytest results Jul 11, 2019 3 - Alpha pytest (>=4.2.1) :pypi:`pytest-md-report` A pytest plugin to make a test results report with Markdown table format. Feb 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :pypi:`pytest-memprof` Estimates memory consumption of test functions Mar 29, 2019 4 - Beta N/A - :pypi:`pytest-memray` A simple plugin to use with pytest May 17, 2022 N/A N/A + :pypi:`pytest-memray` A simple plugin to use with pytest May 27, 2022 N/A N/A :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution May 03, 2022 N/A pytest (>=6.2.5) @@ -596,7 +601,7 @@ This list contains 1049 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Apr 22, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin May 17, 2022 4 - Beta pytest + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin May 28, 2022 4 - Beta pytest :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A @@ -641,14 +646,14 @@ This list contains 1049 plugins. :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi May 18, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators May 19, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Operators May 25, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A :pypi:`pytest-order` pytest plugin to run your tests in a specific order Jan 09, 2022 4 - Beta pytest (>=5.0) ; python_version < "3.10" :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A - :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Mar 24, 2022 N/A N/A + :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed May 26, 2022 N/A N/A :pypi:`pytest-owner` Add owner mark for tests Apr 25, 2022 N/A N/A :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A :pypi:`pytest-pahrametahrize` Parametrize your tests with a Boston accent. Nov 24, 2021 4 - Beta pytest (>=6.0,<7.0) @@ -656,7 +661,7 @@ This list contains 1049 plugins. :pypi:`pytest-parallel-39` a pytest plugin for parallel and concurrent testing Jul 12, 2021 3 - Alpha pytest (>=3.0.0) :pypi:`pytest-param` pytest plugin to test all, first, last or random params Sep 11, 2016 4 - Beta pytest (>=2.6.0) :pypi:`pytest-paramark` Configure pytest fixtures using a combination of"parametrize" and markers Jan 10, 2020 4 - Beta pytest (>=4.5.0) - :pypi:`pytest-parametrization` Simpler PyTest parametrization Nov 30, 2021 5 - Production/Stable pytest + :pypi:`pytest-parametrization` Simpler PyTest parametrization May 22, 2022 5 - Production/Stable N/A :pypi:`pytest-parametrize-cases` A more user-friendly way to write parametrized tests. Mar 13, 2022 N/A pytest (>=6.1.2) :pypi:`pytest-parametrized` Pytest plugin for parametrizing tests with default iterables. Oct 19, 2020 5 - Production/Stable pytest :pypi:`pytest-parawtf` Finally spell paramete?ri[sz]e correctly Dec 03, 2018 4 - Beta pytest (>=3.6.0) @@ -795,7 +800,7 @@ This list contains 1049 plugins. :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Apr 13, 2022 N/A N/A + :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. May 23, 2022 N/A N/A :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A @@ -821,19 +826,19 @@ This list contains 1049 plugins. :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). May 10, 2022 3 - Alpha N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A - :pypi:`pytest-salt-factories` Pytest Salt Plugin May 09, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin May 28, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. May 21, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. May 27, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. May 21, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. May 27, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -847,7 +852,7 @@ This list contains 1049 plugins. :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A - :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system May 20, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system May 26, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 5 - Production/Stable pytest (>=3.5.1) :pypi:`pytest-shortcuts` Expand command-line shortcuts listed in pytest configuration Oct 29, 2020 4 - Beta pytest (>=3.5.0) @@ -889,7 +894,7 @@ This list contains 1049 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Apr 19, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons May 26, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A @@ -912,7 +917,7 @@ This list contains 1049 plugins. :pypi:`pytest-study` A pytest plugin to organize long run tests (named studies) without interfering the regular tests Sep 26, 2017 3 - Alpha pytest (>=2.0) :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Feb 09, 2022 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Mar 02, 2021 N/A N/A - :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Feb 13, 2022 4 - Beta pytest (>=7.0) + :pypi:`pytest-subtests` unittest subTest() support and subtests fixture May 26, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Jul 06, 2020 3 - Alpha N/A :pypi:`pytest-sugar-bugfix159` Workaround for https://github.com/Frozenball/pytest-sugar/issues/159 Nov 07, 2018 5 - Production/Stable pytest (!=3.7.3,>=3.5); extra == 'testing' @@ -930,6 +935,7 @@ This list contains 1049 plugins. :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) + :pypi:`pytest-terra-fixt` Terraform fixtures for pytest May 26, 2022 N/A pytest (==6.2.5) :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Jan 17, 2022 N/A pytest (>=6.0) :pypi:`pytest-terraform-fixture` generate terraform resources to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-testbook` A plugin to run tests written in Jupyter notebook Dec 11, 2016 3 - Alpha N/A @@ -949,11 +955,11 @@ This list contains 1049 plugins. :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) - :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. May 16, 2022 N/A pytest (>=6.2.5) - :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Oct 08, 2021 N/A pytest (>=3.6) + :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. May 24, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results May 23, 2022 N/A N/A :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A - :pypi:`pytest-testreport` Nov 12, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-testreport` May 23, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testreport-new` May 05, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) @@ -1023,6 +1029,7 @@ This list contains 1049 plugins. :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) :pypi:`pytest-virtualenv` Virtualenv fixture for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-vnc` VNC client for Pytest May 22, 2022 N/A pytest :pypi:`pytest-voluptuous` Pytest plugin for asserting data against voluptuous schema. Jun 09, 2020 N/A pytest :pypi:`pytest-vscodedebug` A pytest plugin to easily enable debugging tests within Visual Studio Code Dec 04, 2020 4 - Beta N/A :pypi:`pytest-vts` pytest plugin for automatic recording of http stubbed tests Jun 05, 2019 N/A pytest (>=2.3) @@ -1049,7 +1056,7 @@ This list contains 1049 plugins. :pypi:`pytest-xfiles` Pytest fixtures providing data read from function, module or package related (x)files. Feb 27, 2018 N/A N/A :pypi:`pytest-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest - :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Jul 28, 2021 4 - Beta pytest (>=2.8) + :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. May 24, 2022 4 - Beta pytest (>=2.8) :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) @@ -1064,7 +1071,7 @@ This list contains 1049 plugins. :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A - :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting May 20, 2022 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting May 27, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ @@ -1072,6 +1079,13 @@ This list contains 1049 plugins. .. only:: latex + :pypi:`pytest-abstracts` + *last release*: May 25, 2022, + *status*: N/A, + *requires*: N/A + + A contextmanager pytest fixture for handling multiple mock abstracts + :pypi:`pytest-accept` *last release*: Jan 07, 2022, *status*: N/A, @@ -1080,7 +1094,7 @@ This list contains 1049 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: May 17, 2022, + *last release*: May 24, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1380,6 +1394,13 @@ This list contains 1049 plugins. test Answer Set Programming programs + :pypi:`pytest-assertcount` + *last release*: May 22, 2022, + *status*: N/A, + *requires*: N/A + + Plugin to count actual number of asserts in pytest + :pypi:`pytest-assertions` *last release*: Apr 27, 2022, *status*: N/A, @@ -1590,6 +1611,13 @@ This list contains 1049 plugins. BDD for pytest + :pypi:`pytest-bdd-ng` + *last release*: May 25, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=5.0) + + BDD for pytest + :pypi:`pytest-bdd-splinter` *last release*: Aug 12, 2019, *status*: 5 - Production/Stable, @@ -2501,7 +2529,7 @@ This list contains 1049 plugins. A pytest plugin for linting a dbt project's conventions :pypi:`pytest-dbt-core` - *last release*: Jan 28, 2022, + *last release*: May 27, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) ; extra == 'test' @@ -3124,35 +3152,35 @@ This list contains 1049 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: May 09, 2022, + *last release*: May 25, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: May 09, 2022, + *last release*: May 25, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: May 09, 2022, + *last release*: May 25, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: May 09, 2022, + *last release*: May 25, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: May 09, 2022, + *last release*: May 25, 2022, *status*: N/A, *requires*: N/A @@ -3166,14 +3194,14 @@ This list contains 1049 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: May 09, 2022, + *last release*: May 25, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: May 09, 2022, + *last release*: May 25, 2022, *status*: N/A, *requires*: N/A @@ -3488,7 +3516,7 @@ This list contains 1049 plugins. :pypi:`pytest-fastapi-deps` - *last release*: May 09, 2022, + *last release*: May 24, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -3838,7 +3866,7 @@ This list contains 1049 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: May 04, 2022, + *last release*: May 26, 2022, *status*: N/A, *requires*: N/A @@ -4020,7 +4048,7 @@ This list contains 1049 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: May 19, 2022, + *last release*: May 28, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4146,7 +4174,7 @@ This list contains 1049 plugins. pytest-httpserver is a httpserver for pytest :pypi:`pytest-httpx` - *last release*: Feb 05, 2022, + *last release*: May 24, 2022, *status*: 5 - Production/Stable, *requires*: pytest (<8.*,>=6.*) @@ -4411,6 +4439,13 @@ This list contains 1049 plugins. Nicer list and iterable assertion messages for pytest + :pypi:`pytest-iters` + *last release*: May 24, 2022, + *status*: N/A, + *requires*: N/A + + A contextmanager pytest fixture for handling multiple mock iters + :pypi:`pytest-jasmine` *last release*: Nov 04, 2017, *status*: 1 - Planning, @@ -4433,7 +4468,7 @@ This list contains 1049 plugins. py.test JIRA integration plugin, using markers :pypi:`pytest-jira-xray` - *last release*: May 11, 2022, + *last release*: May 23, 2022, *status*: 4 - Beta, *requires*: pytest @@ -4755,7 +4790,7 @@ This list contains 1049 plugins. Pytest Loguru :pypi:`pytest-lsp` - *last release*: Apr 18, 2022, + *last release*: May 26, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -4845,6 +4880,13 @@ This list contains 1049 plugins. Provide tools for generating tests from combinations of fixtures. + :pypi:`pytest-maybe-raises` + *last release*: May 27, 2022, + *status*: N/A, + *requires*: pytest ; extra == 'dev' + + Pytest fixture for optional exception testing. + :pypi:`pytest-mccabe` *last release*: Jul 22, 2020, *status*: 3 - Alpha, @@ -4874,7 +4916,7 @@ This list contains 1049 plugins. Estimates memory consumption of test functions :pypi:`pytest-memray` - *last release*: May 17, 2022, + *last release*: May 27, 2022, *status*: N/A, *requires*: N/A @@ -5119,7 +5161,7 @@ This list contains 1049 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: May 17, 2022, + *last release*: May 28, 2022, *status*: 4 - Beta, *requires*: pytest @@ -5434,7 +5476,7 @@ This list contains 1049 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: May 19, 2022, + *last release*: May 25, 2022, *status*: N/A, *requires*: pytest @@ -5483,7 +5525,7 @@ This list contains 1049 plugins. OS X notifications for py.test results. :pypi:`pytest-otel` - *last release*: Mar 24, 2022, + *last release*: May 26, 2022, *status*: N/A, *requires*: N/A @@ -5539,9 +5581,9 @@ This list contains 1049 plugins. Configure pytest fixtures using a combination of"parametrize" and markers :pypi:`pytest-parametrization` - *last release*: Nov 30, 2021, + *last release*: May 22, 2022, *status*: 5 - Production/Stable, - *requires*: pytest + *requires*: N/A Simpler PyTest parametrization @@ -6512,7 +6554,7 @@ This list contains 1049 plugins. pytest plugin to re-run tests to eliminate flaky failures :pypi:`pytest-resilient-circuits` - *last release*: Apr 13, 2022, + *last release*: May 23, 2022, *status*: N/A, *requires*: N/A @@ -6694,7 +6736,7 @@ This list contains 1049 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: May 09, 2022, + *last release*: May 28, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6736,7 +6778,7 @@ This list contains 1049 plugins. :pypi:`pytest-sbase` - *last release*: May 21, 2022, + *last release*: May 27, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6778,7 +6820,7 @@ This list contains 1049 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: May 21, 2022, + *last release*: May 27, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6876,7 +6918,7 @@ This list contains 1049 plugins. A pytest plugin to help with testing shell scripts / black box commands :pypi:`pytest-shell-utilities` - *last release*: May 20, 2022, + *last release*: May 26, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -7170,7 +7212,7 @@ This list contains 1049 plugins. :pypi:`pytest-splunk-addon` - *last release*: Apr 19, 2022, + *last release*: May 26, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7331,7 +7373,7 @@ This list contains 1049 plugins. A hack to explicitly set up and tear down fixtures. :pypi:`pytest-subtests` - *last release*: Feb 13, 2022, + *last release*: May 26, 2022, *status*: 4 - Beta, *requires*: pytest (>=7.0) @@ -7456,6 +7498,13 @@ This list contains 1049 plugins. Predictable and repeatable tempdir support. + :pypi:`pytest-terra-fixt` + *last release*: May 26, 2022, + *status*: N/A, + *requires*: pytest (==6.2.5) + + Terraform fixtures for pytest + :pypi:`pytest-terraform` *last release*: Jan 17, 2022, *status*: N/A, @@ -7590,16 +7639,16 @@ This list contains 1049 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-testrail-integrator` - *last release*: May 16, 2022, + *last release*: May 24, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) Pytest plugin for sending report to testrail system. :pypi:`pytest-testrail-ns` - *last release*: Oct 08, 2021, + *last release*: May 23, 2022, *status*: N/A, - *requires*: pytest (>=3.6) + *requires*: N/A pytest plugin for creating TestRail runs and adding results @@ -7618,7 +7667,7 @@ This list contains 1049 plugins. :pypi:`pytest-testreport` - *last release*: Nov 12, 2021, + *last release*: May 23, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) @@ -8107,6 +8156,13 @@ This list contains 1049 plugins. Virtualenv fixture for py.test + :pypi:`pytest-vnc` + *last release*: May 22, 2022, + *status*: N/A, + *requires*: pytest + + VNC client for Pytest + :pypi:`pytest-voluptuous` *last release*: Jun 09, 2020, *status*: N/A, @@ -8290,7 +8346,7 @@ This list contains 1049 plugins. An extended parametrizing plugin of pytest. :pypi:`pytest-xprocess` - *last release*: Jul 28, 2021, + *last release*: May 24, 2022, *status*: 4 - Beta, *requires*: pytest (>=2.8) @@ -8395,7 +8451,7 @@ This list contains 1049 plugins. OWASP ZAP plugin for py.test. :pypi:`pytest-zebrunner` - *last release*: May 20, 2022, + *last release*: May 27, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.5.0) From 0efd7a6ec617b55af733f6794436543604e4b5e4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 May 2022 21:00:26 +0000 Subject: [PATCH 258/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.950 → v0.960](https://github.com/pre-commit/mirrors-mypy/compare/v0.950...v0.960) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 189aa5b912d..c98ff7ea12a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -56,7 +56,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.950 + rev: v0.960 hooks: - id: mypy files: ^(src/|testing/) From 6017666fe180205221f9969222a0e1208d4f5fe7 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 31 May 2022 09:51:09 -0300 Subject: [PATCH 259/549] Do not advertise that importlib will be default import mode It is clear at this point that changing the default would break a lot of suites, and is not a clear win in all cases anyway. Close #10003 --- doc/en/explanation/goodpractices.rst | 5 ++--- doc/en/explanation/pythonpath.rst | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 92110f4f901..0b812ba5857 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -173,10 +173,9 @@ This layout prevents a lot of common pitfalls and has many benefits, which are b `blog post by Ionel Cristian Mărieș `_. .. note:: - The new ``--import-mode=importlib`` (see :ref:`import-modes`) doesn't have + The ``--import-mode=importlib`` option (see :ref:`import-modes`) does not have any of the drawbacks above because ``sys.path`` is not changed when importing - test modules, so users that run - into this issue are strongly encouraged to try it and report if the new option works well for them. + test modules, so users that run into this issue are strongly encouraged to try it. The ``src`` directory layout is still strongly recommended however. diff --git a/doc/en/explanation/pythonpath.rst b/doc/en/explanation/pythonpath.rst index 2330356b863..e1d240b498a 100644 --- a/doc/en/explanation/pythonpath.rst +++ b/doc/en/explanation/pythonpath.rst @@ -45,10 +45,19 @@ these values: * ``importlib``: new in pytest-6.0, this mode uses :mod:`importlib` to import test modules. This gives full control over the import process, and doesn't require changing :py:data:`sys.path`. - For this reason this doesn't require test module names to be unique, but also makes test - modules non-importable by each other. + For this reason this doesn't require test module names to be unique. + + One drawback however is that test modules are non-importable by each other. Also, utility + modules in the tests directories are not automatically importable because the tests directory is no longer + added to :py:data:`sys.path`. + + 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. + +.. seealso:: + + The :confval:`pythonpath` configuration variable. - We intend to make ``importlib`` the default in future releases, depending on feedback. ``prepend`` and ``append`` import modes scenarios ------------------------------------------------- From e54c6a1362589b32a2e63bb780192b86216ecec8 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 31 May 2022 22:32:51 +0300 Subject: [PATCH 260/549] Document the --code-highlight default (#9883) Also normalized all help text using the patterns: * `One sentence help text` * `First sentence of help. Second sentence of help.` --- changelog/9883.improvement.rst | 1 + doc/en/reference/reference.rst | 282 +++++++++++++++--------------- src/_pytest/assertion/__init__.py | 2 +- src/_pytest/cacheprovider.py | 14 +- src/_pytest/capture.py | 4 +- src/_pytest/config/__init__.py | 6 +- src/_pytest/config/argparsing.py | 2 +- src/_pytest/debugging.py | 6 +- src/_pytest/doctest.py | 14 +- src/_pytest/faulthandler.py | 2 +- src/_pytest/fixtures.py | 2 +- src/_pytest/helpconfig.py | 27 +-- src/_pytest/junitxml.py | 4 +- src/_pytest/logging.py | 26 +-- src/_pytest/main.py | 52 +++--- src/_pytest/mark/__init__.py | 10 +- src/_pytest/pastebin.py | 2 +- src/_pytest/pytester.py | 6 +- src/_pytest/python.py | 12 +- src/_pytest/runner.py | 7 +- src/_pytest/setuponly.py | 4 +- src/_pytest/setupplan.py | 4 +- src/_pytest/skipping.py | 4 +- src/_pytest/stepwise.py | 6 +- src/_pytest/terminal.py | 32 ++-- testing/test_config.py | 6 +- testing/test_helpconfig.py | 12 +- testing/test_stepwise.py | 2 +- 28 files changed, 279 insertions(+), 272 deletions(-) create mode 100644 changelog/9883.improvement.rst diff --git a/changelog/9883.improvement.rst b/changelog/9883.improvement.rst new file mode 100644 index 00000000000..180784b5dba --- /dev/null +++ b/changelog/9883.improvement.rst @@ -0,0 +1 @@ +Normalize the help description of all command-line options. diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index a4a5fd3fba4..6402e0af64f 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1752,11 +1752,11 @@ All the command-line flags can be obtained by running ``pytest --help``:: $ pytest --help usage: pytest [options] [file_or_dir] [file_or_dir] [...] - positional arguments: + Positional arguments: file_or_dir - general: - -k EXPRESSION only run tests which match the given substring + General: + -k EXPRESSION Only run tests which match the given substring expression. An expression is a python evaluatable expression where all names are substring-matched against test names and their parent classes. @@ -1771,217 +1771,217 @@ All the command-line flags can be obtained by running ``pytest --help``:: 'extra_keyword_matches' set, as well as functions which have names assigned directly to them. The matching is case-insensitive. - -m MARKEXPR only run tests matching given mark expression. + -m MARKEXPR Only run tests matching given mark expression. For example: -m 'mark1 and not mark2'. - --markers show markers (builtin, plugin and per-project ones). - -x, --exitfirst exit instantly on first error or failed test. + --markers Show markers (builtin, plugin and per-project ones) + -x, --exitfirst Exit instantly on first error or failed test --fixtures, --funcargs - show available fixtures, sorted by plugin appearance + Show available fixtures, sorted by plugin appearance (fixtures with leading '_' are only shown with '-v') - --fixtures-per-test show fixtures per test - --pdb start the interactive Python debugger on errors or - KeyboardInterrupt. + --fixtures-per-test Show fixtures per test + --pdb Start the interactive Python debugger on errors or + KeyboardInterrupt --pdbcls=modulename:classname - specify a custom interactive Python debugger for use - with --pdb.For example: + Specify a custom interactive Python debugger for use + with --pdb. For example: --pdbcls=IPython.terminal.debugger:TerminalPdb - --trace Immediately break when running each test. - --capture=method per-test capturing method: one of fd|sys|no|tee-sys. - -s shortcut for --capture=no. - --runxfail report the results of xfail tests as if they were + --trace Immediately break when running each test + --capture=method Per-test capturing method: one of fd|sys|no|tee-sys. + -s Shortcut for --capture=no. + --runxfail Report the results of xfail tests as if they were not marked - --lf, --last-failed rerun only the tests that failed at the last run (or + --lf, --last-failed Rerun only the tests that failed at the last run (or all if none failed) - --ff, --failed-first run all tests, but run the last failures first. + --ff, --failed-first Run all tests, but run the last failures first This may re-order tests and thus lead to repeated - fixture setup/teardown. - --nf, --new-first run tests from new files first, then the rest of the + fixture setup/teardown + --nf, --new-first Run tests from new files first, then the rest of the tests sorted by file mtime --cache-show=[CACHESHOW] - show cache contents, don't perform collection or + Show cache contents, don't perform collection or tests. Optional argument: glob (default: '*'). - --cache-clear remove all cache contents at start of test run. + --cache-clear Remove all cache contents at start of test run --lfnf={all,none}, --last-failed-no-failures={all,none} - which tests to run with no previously (known) - failures. - --sw, --stepwise exit on test failure and continue from last failing + Which tests to run with no previously (known) + failures + --sw, --stepwise Exit on test failure and continue from last failing test next time --sw-skip, --stepwise-skip - ignore the first failing test but stop on the next + Ignore the first failing test but stop on the next failing test. implicitly enables --stepwise. - reporting: - --durations=N show N slowest setup/test durations (N=0 for all). + Reporting: + --durations=N show N slowest setup/test durations (N=0 for all) --durations-min=N Minimal duration in seconds for inclusion in slowest - list. Default 0.005 - -v, --verbose increase verbosity. - --no-header disable header - --no-summary disable summary - -q, --quiet decrease verbosity. - --verbosity=VERBOSE set verbosity. Default is 0. - -r chars show extra test summary info as specified by chars: + list. Default: 0.005. + -v, --verbose Increase verbosity + --no-header Disable header + --no-summary Disable summary + -q, --quiet Decrease verbosity + --verbosity=VERBOSE Set verbosity. Default: 0. + -r chars Show extra test summary info as specified by chars: (f)ailed, (E)rror, (s)kipped, (x)failed, (X)passed, (p)assed, (P)assed with output, (a)ll except passed (p/P), or (A)ll. (w)arnings are enabled by default (see --disable-warnings), 'N' can be used to reset the list. (default: 'fE'). --disable-warnings, --disable-pytest-warnings - disable warnings summary - -l, --showlocals show locals in tracebacks (disabled by default). - --tb=style traceback print mode + Disable warnings summary + -l, --showlocals Show locals in tracebacks (disabled by default) + --tb=style Traceback print mode (auto/long/short/line/native/no). --show-capture={no,stdout,stderr,log,all} Controls how captured stdout/stderr/log is shown on - failed tests. Default is 'all'. - --full-trace don't cut any tracebacks (default is to cut). - --color=color color terminal output (yes/no/auto). + failed tests. Default: all. + --full-trace Don't cut any tracebacks (default is to cut) + --color=color Color terminal output (yes/no/auto) --code-highlight={yes,no} Whether code should be highlighted (only if --color - is also enabled) - --pastebin=mode send failed|all info to bpaste.net pastebin service. - --junit-xml=path create junit-xml style report file at given path. - --junit-prefix=str prepend prefix to classnames in junit-xml output + is also enabled). Default: yes. + --pastebin=mode Send failed|all info to bpaste.net pastebin service + --junit-xml=path Create junit-xml style report file at given path + --junit-prefix=str Prepend prefix to classnames in junit-xml output pytest-warnings: -W PYTHONWARNINGS, --pythonwarnings=PYTHONWARNINGS - set which warnings to report, see -W option of - python itself. - --maxfail=num exit after first num failures or errors. - --strict-config any warnings encountered while parsing the `pytest` - section of the configuration file raise errors. - --strict-markers markers not registered in the `markers` section of - the configuration file raise errors. - --strict (deprecated) alias to --strict-markers. - -c file load configuration from `file` instead of trying to - locate one of the implicit configuration files. + Set which warnings to report, see -W option of + Python itself + --maxfail=num Exit after first num failures or errors + --strict-config Any warnings encountered while parsing the `pytest` + section of the configuration file raise errors + --strict-markers Markers not registered in the `markers` section of + the configuration file raise errors + --strict (Deprecated) alias to --strict-markers + -c file Load configuration from `file` instead of trying to + locate one of the implicit configuration files --continue-on-collection-errors Force test execution even if collection errors - occur. + occur --rootdir=ROOTDIR Define root directory for tests. Can be relative path: 'root_dir', './root_dir', 'root_dir/another_dir/'; absolute path: '/home/user/root_dir'; path with variables: '$HOME/root_dir'. - collection: - --collect-only, --co only collect tests, don't execute them. - --pyargs try to interpret all arguments as python packages. - --ignore=path ignore path during collection (multi-allowed). - --ignore-glob=path ignore path pattern during collection (multi- - allowed). + Collection: + --collect-only, --co Only collect tests, don't execute them + --pyargs Try to interpret all arguments as Python packages + --ignore=path Ignore path during collection (multi-allowed) + --ignore-glob=path Ignore path pattern during collection (multi- + allowed) --deselect=nodeid_prefix - deselect item (via node id prefix) during collection - (multi-allowed). - --confcutdir=dir only load conftest.py's relative to specified dir. - --noconftest Don't load any conftest.py files. - --keep-duplicates Keep duplicate tests. + Deselect item (via node id prefix) during collection + (multi-allowed) + --confcutdir=dir Only load conftest.py's relative to specified dir + --noconftest Don't load any conftest.py files + --keep-duplicates Keep duplicate tests --collect-in-virtualenv Don't ignore tests in a local virtualenv directory --import-mode={prepend,append,importlib} - prepend/append to sys.path when importing test - modules and conftest files, default is to prepend. - --doctest-modules run doctests in all .py modules + Prepend/append to sys.path when importing test + modules and conftest files. Default: prepend. + --doctest-modules Run doctests in all .py modules --doctest-report={none,cdiff,ndiff,udiff,only_first_failure} - choose another output format for diffs on doctest + Choose another output format for diffs on doctest failure - --doctest-glob=pat doctests file matching pattern, default: test*.txt + --doctest-glob=pat Doctests file matching pattern, default: test*.txt --doctest-ignore-import-errors - ignore doctest ImportErrors + Ignore doctest ImportErrors --doctest-continue-on-failure - for a given doctest, continue to run after the first + For a given doctest, continue to run after the first failure - test session debugging and configuration: - --basetemp=dir base temporary directory for this test run.(warning: - this directory is removed if it exists) - -V, --version display pytest version and information about + Test session debugging and configuration: + --basetemp=dir Base temporary directory for this test run. (Warning: + this directory is removed if it exists.) + -V, --version Display pytest version and information about plugins. When given twice, also display information about plugins. - -h, --help show help message and configuration info - -p name early-load given plugin module name or entry point - (multi-allowed). + -h, --help Show help message and configuration info + -p name Early-load given plugin module name or entry point + (multi-allowed) To avoid loading of plugins, use the `no:` prefix, - e.g. `no:doctest`. - --trace-config trace considerations of conftest.py files. + e.g. `no:doctest` + --trace-config Trace considerations of conftest.py files --debug=[DEBUG_FILE_NAME] - store internal tracing debug information in this log + Store internal tracing debug information in this log file. This file is opened with 'w' and truncated as a result, care advised. - Defaults to 'pytestdebug.log'. + Default: pytestdebug.log. -o OVERRIDE_INI, --override-ini=OVERRIDE_INI - override ini option with "option=value" style, e.g. - `-o xfail_strict=True -o cache_dir=cache`. + Override ini option with "option=value" style, e.g. + `-o xfail_strict=True -o cache_dir=cache` --assert=MODE Control assertion debugging tools. 'plain' performs no assertion debugging. 'rewrite' (the default) rewrites assert statements in test modules on import to provide assert expression information. - --setup-only only setup fixtures, do not execute tests. - --setup-show show setup of fixtures while executing tests. - --setup-plan show what fixtures and tests would be executed but - don't execute anything. + --setup-only Only setup fixtures, do not execute tests + --setup-show Show setup of fixtures while executing tests + --setup-plan Show what fixtures and tests would be executed but + don't execute anything - logging: - --log-level=LEVEL level of messages to catch/display. + Logging: + --log-level=LEVEL Level of messages to catch/display. Not set by default, so it depends on the root/parent log handler's effective level, where it is "WARNING" by default. --log-format=LOG_FORMAT - log format as used by the logging module. + Log format used by the logging module --log-date-format=LOG_DATE_FORMAT - log date format as used by the logging module. + Log date format used by the logging module --log-cli-level=LOG_CLI_LEVEL - cli logging level. + CLI logging level --log-cli-format=LOG_CLI_FORMAT - log format as used by the logging module. + Log format used by the logging module --log-cli-date-format=LOG_CLI_DATE_FORMAT - log date format as used by the logging module. - --log-file=LOG_FILE path to a file when logging will be written to. + Log date format used by the logging module + --log-file=LOG_FILE Path to a file when logging will be written to --log-file-level=LOG_FILE_LEVEL - log file logging level. + Log file logging level --log-file-format=LOG_FILE_FORMAT - log format as used by the logging module. + Log format used by the logging module --log-file-date-format=LOG_FILE_DATE_FORMAT - log date format as used by the logging module. + Log date format used by the logging module --log-auto-indent=LOG_AUTO_INDENT Auto-indent multiline messages passed to the logging module. Accepts true|on, false|off or an integer. [pytest] ini-options in the first pytest.ini|tox.ini|setup.cfg file found: - markers (linelist): markers for test functions + markers (linelist): Markers for test functions empty_parameter_set_mark (string): - default marker for empty parametersets - norecursedirs (args): directory patterns to avoid for recursion - testpaths (args): directories to search for tests when no files or - directories are given in the command line. + Default marker for empty parametersets + norecursedirs (args): Directory patterns to avoid for recursion + testpaths (args): Directories to search for tests when no files or + directories are given in the command line filterwarnings (linelist): Each line specifies a pattern for warnings.filterwarnings. Processed after -W/--pythonwarnings. - usefixtures (args): list of default fixtures to be used with this + usefixtures (args): List of default fixtures to be used with this project - python_files (args): glob-style file patterns for Python test module + python_files (args): Glob-style file patterns for Python test module discovery python_classes (args): - prefixes or glob names for Python test class + Prefixes or glob names for Python test class discovery python_functions (args): - prefixes or glob names for Python test function and + Prefixes or glob names for Python test function and method discovery disable_test_id_escaping_and_forfeit_all_rights_to_community_support (bool): - disable string escape non-ascii characters, might + Disable string escape non-ASCII characters, might cause unwanted side effects(use at your own risk) console_output_style (string): - console output: "classic", or with additional + Console output: "classic", or with additional progress information ("progress" (percentage) | - "count"). - xfail_strict (bool): default for the strict parameter of xfail markers + "count") + xfail_strict (bool): Default for the strict parameter of xfail markers when not given explicitly (default: False) enable_assertion_pass_hook (bool): - Enables the pytest_assertion_pass hook.Make sure to + Enables the pytest_assertion_pass hook. Make sure to delete any previously generated pyc cache files. junit_suite_name (string): Test suite name for JUnit report @@ -1996,45 +1996,45 @@ All the command-line flags can be obtained by running ``pytest --help``:: junit_family (string): Emit XML for schema: one of legacy|xunit1|xunit2 doctest_optionflags (args): - option flags for doctests + Option flags for doctests doctest_encoding (string): - encoding used for doctest files - cache_dir (string): cache directory path. - log_level (string): default value for --log-level - log_format (string): default value for --log-format + Encoding used for doctest files + cache_dir (string): Cache directory path + log_level (string): Default value for --log-level + log_format (string): Default value for --log-format log_date_format (string): - default value for --log-date-format - log_cli (bool): enable log display during test run (also known as - "live logging"). + Default value for --log-date-format + log_cli (bool): Enable log display during test run (also known as + "live logging") log_cli_level (string): - default value for --log-cli-level + Default value for --log-cli-level log_cli_format (string): - default value for --log-cli-format + Default value for --log-cli-format log_cli_date_format (string): - default value for --log-cli-date-format - log_file (string): default value for --log-file + Default value for --log-cli-date-format + log_file (string): Default value for --log-file log_file_level (string): - default value for --log-file-level + Default value for --log-file-level log_file_format (string): - default value for --log-file-format + Default value for --log-file-format log_file_date_format (string): - default value for --log-file-date-format + Default value for --log-file-date-format log_auto_indent (string): - default value for --log-auto-indent + Default value for --log-auto-indent pythonpath (paths): Add paths to sys.path faulthandler_timeout (string): Dump the traceback of all threads if a test takes - more than TIMEOUT seconds to finish. - addopts (args): extra command line options - minversion (string): minimally required pytest version + more than TIMEOUT seconds to finish + addopts (args): Extra command line options + minversion (string): Minimally required pytest version required_plugins (args): - plugins that must be present for pytest to run + Plugins that must be present for pytest to run - environment variables: - PYTEST_ADDOPTS extra command line options - PYTEST_PLUGINS comma-separated plugins to load during startup - PYTEST_DISABLE_PLUGIN_AUTOLOAD set to disable plugin auto-loading - PYTEST_DEBUG set to enable debug tracing of pytest's internals + Environment variables: + PYTEST_ADDOPTS Extra command line options + PYTEST_PLUGINS Comma-separated plugins to load during startup + PYTEST_DISABLE_PLUGIN_AUTOLOAD Set to disable plugin auto-loading + PYTEST_DEBUG Set to enable debug tracing of pytest's internals to see available markers type: pytest --markers diff --git a/src/_pytest/assertion/__init__.py b/src/_pytest/assertion/__init__.py index 480a26ad867..5c971bb8622 100644 --- a/src/_pytest/assertion/__init__.py +++ b/src/_pytest/assertion/__init__.py @@ -39,7 +39,7 @@ def pytest_addoption(parser: Parser) -> None: "enable_assertion_pass_hook", type="bool", default=False, - help="Enables the pytest_assertion_pass hook." + help="Enables the pytest_assertion_pass hook. " "Make sure to delete any previously generated pyc cache files.", ) diff --git a/src/_pytest/cacheprovider.py b/src/_pytest/cacheprovider.py index 4dad599d0e3..777c1b0b05a 100755 --- a/src/_pytest/cacheprovider.py +++ b/src/_pytest/cacheprovider.py @@ -440,7 +440,7 @@ def pytest_addoption(parser: Parser) -> None: "--last-failed", action="store_true", dest="lf", - help="rerun only the tests that failed " + help="Rerun only the tests that failed " "at the last run (or all if none failed)", ) group.addoption( @@ -448,7 +448,7 @@ def pytest_addoption(parser: Parser) -> None: "--failed-first", action="store_true", dest="failedfirst", - help="run all tests, but run the last failures first.\n" + help="Run all tests, but run the last failures first. " "This may re-order tests and thus lead to " "repeated fixture setup/teardown.", ) @@ -457,7 +457,7 @@ def pytest_addoption(parser: Parser) -> None: "--new-first", action="store_true", dest="newfirst", - help="run tests from new files first, then the rest of the tests " + help="Run tests from new files first, then the rest of the tests " "sorted by file mtime", ) group.addoption( @@ -466,7 +466,7 @@ def pytest_addoption(parser: Parser) -> None: nargs="?", dest="cacheshow", help=( - "show cache contents, don't perform collection or tests. " + "Show cache contents, don't perform collection or tests. " "Optional argument: glob (default: '*')." ), ) @@ -474,12 +474,12 @@ def pytest_addoption(parser: Parser) -> None: "--cache-clear", action="store_true", dest="cacheclear", - help="remove all cache contents at start of test run.", + help="Remove all cache contents at start of test run", ) cache_dir_default = ".pytest_cache" if "TOX_ENV_DIR" in os.environ: cache_dir_default = os.path.join(os.environ["TOX_ENV_DIR"], cache_dir_default) - parser.addini("cache_dir", default=cache_dir_default, help="cache directory path.") + parser.addini("cache_dir", default=cache_dir_default, help="Cache directory path") group.addoption( "--lfnf", "--last-failed-no-failures", @@ -487,7 +487,7 @@ def pytest_addoption(parser: Parser) -> None: dest="last_failed_no_failures", choices=("all", "none"), default="all", - help="which tests to run with no previously (known) failures.", + help="Which tests to run with no previously (known) failures", ) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index 2a3c4143be4..d6cf42c3b51 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -42,14 +42,14 @@ def pytest_addoption(parser: Parser) -> None: default="fd", metavar="method", choices=["fd", "sys", "no", "tee-sys"], - help="per-test capturing method: one of fd|sys|no|tee-sys.", + help="Per-test capturing method: one of fd|sys|no|tee-sys", ) group._addoption( "-s", action="store_const", const="no", dest="capture", - help="shortcut for --capture=no.", + help="Shortcut for --capture=no", ) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index dfbda68ea78..b3173d7d736 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1115,11 +1115,11 @@ def _initini(self, args: Sequence[str]) -> None: self.inicfg = inicfg self._parser.extra_info["rootdir"] = str(self.rootpath) self._parser.extra_info["inifile"] = str(self.inipath) - self._parser.addini("addopts", "extra command line options", "args") - self._parser.addini("minversion", "minimally required pytest version") + self._parser.addini("addopts", "Extra command line options", "args") + self._parser.addini("minversion", "Minimally required pytest version") self._parser.addini( "required_plugins", - "plugins that must be present for pytest to run", + "Plugins that must be present for pytest to run", type="args", default=[], ) diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index b0bb3f168ff..5f281eb0992 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -48,7 +48,7 @@ def __init__( _ispytest: bool = False, ) -> None: check_ispytest(_ispytest) - self._anonymous = OptionGroup("custom options", parser=self, _ispytest=True) + self._anonymous = OptionGroup("Custom options", parser=self, _ispytest=True) self._groups: List[OptionGroup] = [] self._processopt = processopt self._usage = usage diff --git a/src/_pytest/debugging.py b/src/_pytest/debugging.py index 452fb18ac34..b99c3fe2d31 100644 --- a/src/_pytest/debugging.py +++ b/src/_pytest/debugging.py @@ -46,21 +46,21 @@ def pytest_addoption(parser: Parser) -> None: "--pdb", dest="usepdb", action="store_true", - help="start the interactive Python debugger on errors or KeyboardInterrupt.", + help="Start the interactive Python debugger on errors or KeyboardInterrupt", ) group._addoption( "--pdbcls", dest="usepdb_cls", metavar="modulename:classname", type=_validate_usepdb_cls, - help="specify a custom interactive Python debugger for use with --pdb." + help="Specify a custom interactive Python debugger for use with --pdb." "For example: --pdbcls=IPython.terminal.debugger:TerminalPdb", ) group._addoption( "--trace", dest="trace", action="store_true", - help="Immediately break when running each test.", + help="Immediately break when running each test", ) diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py index aa071cde883..ac5a29bb923 100644 --- a/src/_pytest/doctest.py +++ b/src/_pytest/doctest.py @@ -66,26 +66,26 @@ def pytest_addoption(parser: Parser) -> None: parser.addini( "doctest_optionflags", - "option flags for doctests", + "Option flags for doctests", type="args", default=["ELLIPSIS"], ) parser.addini( - "doctest_encoding", "encoding used for doctest files", default="utf-8" + "doctest_encoding", "Encoding used for doctest files", default="utf-8" ) group = parser.getgroup("collect") group.addoption( "--doctest-modules", action="store_true", default=False, - help="run doctests in all .py modules", + help="Run doctests in all .py modules", dest="doctestmodules", ) group.addoption( "--doctest-report", type=str.lower, default="udiff", - help="choose another output format for diffs on doctest failure", + help="Choose another output format for diffs on doctest failure", choices=DOCTEST_REPORT_CHOICES, dest="doctestreport", ) @@ -94,21 +94,21 @@ def pytest_addoption(parser: Parser) -> None: action="append", default=[], metavar="pat", - help="doctests file matching pattern, default: test*.txt", + help="Doctests file matching pattern, default: test*.txt", dest="doctestglob", ) group.addoption( "--doctest-ignore-import-errors", action="store_true", default=False, - help="ignore doctest ImportErrors", + help="Ignore doctest ImportErrors", dest="doctest_ignore_import_errors", ) group.addoption( "--doctest-continue-on-failure", action="store_true", default=False, - help="for a given doctest, continue to run after the first failure", + help="For a given doctest, continue to run after the first failure", dest="doctest_continue_on_failure", ) diff --git a/src/_pytest/faulthandler.py b/src/_pytest/faulthandler.py index aaee307ff2c..b9c925582ca 100644 --- a/src/_pytest/faulthandler.py +++ b/src/_pytest/faulthandler.py @@ -18,7 +18,7 @@ def pytest_addoption(parser: Parser) -> None: help = ( "Dump the traceback of all threads if a test takes " - "more than TIMEOUT seconds to finish." + "more than TIMEOUT seconds to finish" ) parser.addini("faulthandler_timeout", help, default=0.0) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index e7075fb85bb..b4545d49dc7 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -1352,7 +1352,7 @@ def pytest_addoption(parser: Parser) -> None: "usefixtures", type="args", default=[], - help="list of default fixtures to be used with this project", + help="List of default fixtures to be used with this project", ) diff --git a/src/_pytest/helpconfig.py b/src/_pytest/helpconfig.py index aca2cd391e4..151bc6dff95 100644 --- a/src/_pytest/helpconfig.py +++ b/src/_pytest/helpconfig.py @@ -49,7 +49,7 @@ def pytest_addoption(parser: Parser) -> None: action="count", default=0, dest="version", - help="display pytest version and information about plugins. " + help="Display pytest version and information about plugins. " "When given twice, also display information about plugins.", ) group._addoption( @@ -57,7 +57,7 @@ def pytest_addoption(parser: Parser) -> None: "--help", action=HelpAction, dest="help", - help="show help message and configuration info", + help="Show help message and configuration info", ) group._addoption( "-p", @@ -65,7 +65,7 @@ def pytest_addoption(parser: Parser) -> None: dest="plugins", default=[], metavar="name", - help="early-load given plugin module name or entry point (multi-allowed).\n" + help="Early-load given plugin module name or entry point (multi-allowed). " "To avoid loading of plugins, use the `no:` prefix, e.g. " "`no:doctest`.", ) @@ -74,7 +74,7 @@ def pytest_addoption(parser: Parser) -> None: "--trace-config", action="store_true", default=False, - help="trace considerations of conftest.py files.", + help="Trace considerations of conftest.py files", ) group.addoption( "--debug", @@ -83,16 +83,17 @@ def pytest_addoption(parser: Parser) -> None: const="pytestdebug.log", dest="debug", metavar="DEBUG_FILE_NAME", - help="store internal tracing debug information in this log file.\n" - "This file is opened with 'w' and truncated as a result, care advised.\n" - "Defaults to 'pytestdebug.log'.", + help="Store internal tracing debug information in this log file. " + "This file is opened with 'w' and truncated as a result, care advised. " + "Default: pytestdebug.log.", ) group._addoption( "-o", "--override-ini", dest="override_ini", action="append", - help='override ini option with "option=value" style, e.g. `-o xfail_strict=True -o cache_dir=cache`.', + help='Override ini option with "option=value" style, ' + "e.g. `-o xfail_strict=True -o cache_dir=cache`.", ) @@ -203,12 +204,12 @@ def showhelp(config: Config) -> None: tw.line(indent + line) tw.line() - tw.line("environment variables:") + tw.line("Environment variables:") vars = [ - ("PYTEST_ADDOPTS", "extra command line options"), - ("PYTEST_PLUGINS", "comma-separated plugins to load during startup"), - ("PYTEST_DISABLE_PLUGIN_AUTOLOAD", "set to disable plugin auto-loading"), - ("PYTEST_DEBUG", "set to enable debug tracing of pytest's internals"), + ("PYTEST_ADDOPTS", "Extra command line options"), + ("PYTEST_PLUGINS", "Comma-separated plugins to load during startup"), + ("PYTEST_DISABLE_PLUGIN_AUTOLOAD", "Set to disable plugin auto-loading"), + ("PYTEST_DEBUG", "Set to enable debug tracing of pytest's internals"), ] for name, help in vars: tw.line(f" {name:<24} {help}") diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py index 1b9e3bfecac..c92a227bf1e 100644 --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -386,7 +386,7 @@ def pytest_addoption(parser: Parser) -> None: metavar="path", type=functools.partial(filename_arg, optname="--junitxml"), default=None, - help="create junit-xml style report file at given path.", + help="Create junit-xml style report file at given path", ) group.addoption( "--junitprefix", @@ -394,7 +394,7 @@ def pytest_addoption(parser: Parser) -> None: action="store", metavar="str", default=None, - help="prepend prefix to classnames in junit-xml output", + help="Prepend prefix to classnames in junit-xml output", ) parser.addini( "junit_suite_name", "Test suite name for JUnit report", default="pytest" diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index 0163554bae4..a4f4214b137 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -218,7 +218,7 @@ def pytest_addoption(parser: Parser) -> None: def add_option_ini(option, dest, default=None, type=None, **kwargs): parser.addini( - dest, default=default, type=type, help="default value for " + option + dest, default=default, type=type, help="Default value for " + option ) group.addoption(option, dest=dest, **kwargs) @@ -228,8 +228,8 @@ def add_option_ini(option, dest, default=None, type=None, **kwargs): default=None, metavar="LEVEL", help=( - "level of messages to catch/display.\n" - "Not set by default, so it depends on the root/parent log handler's" + "Level of messages to catch/display." + " Not set by default, so it depends on the root/parent log handler's" ' effective level, where it is "WARNING" by default.' ), ) @@ -237,58 +237,58 @@ def add_option_ini(option, dest, default=None, type=None, **kwargs): "--log-format", dest="log_format", default=DEFAULT_LOG_FORMAT, - help="log format as used by the logging module.", + help="Log format used by the logging module", ) add_option_ini( "--log-date-format", dest="log_date_format", default=DEFAULT_LOG_DATE_FORMAT, - help="log date format as used by the logging module.", + help="Log date format used by the logging module", ) parser.addini( "log_cli", default=False, type="bool", - help='enable log display during test run (also known as "live logging").', + help='Enable log display during test run (also known as "live logging")', ) add_option_ini( - "--log-cli-level", dest="log_cli_level", default=None, help="cli logging level." + "--log-cli-level", dest="log_cli_level", default=None, help="CLI logging level" ) add_option_ini( "--log-cli-format", dest="log_cli_format", default=None, - help="log format as used by the logging module.", + help="Log format used by the logging module", ) add_option_ini( "--log-cli-date-format", dest="log_cli_date_format", default=None, - help="log date format as used by the logging module.", + help="Log date format used by the logging module", ) add_option_ini( "--log-file", dest="log_file", default=None, - help="path to a file when logging will be written to.", + help="Path to a file when logging will be written to", ) add_option_ini( "--log-file-level", dest="log_file_level", default=None, - help="log file logging level.", + help="Log file logging level", ) add_option_ini( "--log-file-format", dest="log_file_format", default=DEFAULT_LOG_FORMAT, - help="log format as used by the logging module.", + help="Log format used by the logging module", ) add_option_ini( "--log-file-date-format", dest="log_file_date_format", default=DEFAULT_LOG_DATE_FORMAT, - help="log date format as used by the logging module.", + help="Log date format used by the logging module", ) add_option_ini( "--log-auto-indent", diff --git a/src/_pytest/main.py b/src/_pytest/main.py index f2f0c667141..4a117fc2ea1 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -51,7 +51,7 @@ def pytest_addoption(parser: Parser) -> None: parser.addini( "norecursedirs", - "directory patterns to avoid for recursion", + "Directory patterns to avoid for recursion", type="args", default=[ "*.egg", @@ -67,26 +67,26 @@ def pytest_addoption(parser: Parser) -> None: ) parser.addini( "testpaths", - "directories to search for tests when no files or directories are given in the " - "command line.", + "Directories to search for tests when no files or directories are given on the " + "command line", type="args", default=[], ) - group = parser.getgroup("general", "running and selection options") + group = parser.getgroup("general", "Running and selection options") group._addoption( "-x", "--exitfirst", action="store_const", dest="maxfail", const=1, - help="exit instantly on first error or failed test.", + help="Exit instantly on first error or failed test", ) group = parser.getgroup("pytest-warnings") group.addoption( "-W", "--pythonwarnings", action="append", - help="set which warnings to report, see -W option of python itself.", + help="Set which warnings to report, see -W option of Python itself", ) parser.addini( "filterwarnings", @@ -102,37 +102,39 @@ def pytest_addoption(parser: Parser) -> None: type=int, dest="maxfail", default=0, - help="exit after first num failures or errors.", + help="Exit after first num failures or errors", ) group._addoption( "--strict-config", action="store_true", - help="any warnings encountered while parsing the `pytest` section of the configuration file raise errors.", + help="Any warnings encountered while parsing the `pytest` section of the " + "configuration file raise errors", ) group._addoption( "--strict-markers", action="store_true", - help="markers not registered in the `markers` section of the configuration file raise errors.", + help="Markers not registered in the `markers` section of the configuration " + "file raise errors", ) group._addoption( "--strict", action="store_true", - help="(deprecated) alias to --strict-markers.", + help="(Deprecated) alias to --strict-markers", ) group._addoption( "-c", metavar="file", type=str, dest="inifilename", - help="load configuration from `file` instead of trying to locate one of the implicit " - "configuration files.", + help="Load configuration from `file` instead of trying to locate one of the " + "implicit configuration files", ) group._addoption( "--continue-on-collection-errors", action="store_true", default=False, dest="continue_on_collection_errors", - help="Force test execution even if collection errors occur.", + help="Force test execution even if collection errors occur", ) group._addoption( "--rootdir", @@ -149,30 +151,30 @@ def pytest_addoption(parser: Parser) -> None: "--collect-only", "--co", action="store_true", - help="only collect tests, don't execute them.", + help="Only collect tests, don't execute them", ) group.addoption( "--pyargs", action="store_true", - help="try to interpret all arguments as python packages.", + help="Try to interpret all arguments as Python packages", ) group.addoption( "--ignore", action="append", metavar="path", - help="ignore path during collection (multi-allowed).", + help="Ignore path during collection (multi-allowed)", ) group.addoption( "--ignore-glob", action="append", metavar="path", - help="ignore path pattern during collection (multi-allowed).", + help="Ignore path pattern during collection (multi-allowed)", ) group.addoption( "--deselect", action="append", metavar="nodeid_prefix", - help="deselect item (via node id prefix) during collection (multi-allowed).", + help="Deselect item (via node id prefix) during collection (multi-allowed)", ) group.addoption( "--confcutdir", @@ -180,14 +182,14 @@ def pytest_addoption(parser: Parser) -> None: default=None, metavar="dir", type=functools.partial(directory_arg, optname="--confcutdir"), - help="only load conftest.py's relative to specified dir.", + help="Only load conftest.py's relative to specified dir", ) group.addoption( "--noconftest", action="store_true", dest="noconftest", default=False, - help="Don't load any conftest.py files.", + help="Don't load any conftest.py files", ) group.addoption( "--keepduplicates", @@ -195,7 +197,7 @@ def pytest_addoption(parser: Parser) -> None: action="store_true", dest="keepduplicates", default=False, - help="Keep duplicate tests.", + help="Keep duplicate tests", ) group.addoption( "--collect-in-virtualenv", @@ -209,8 +211,8 @@ def pytest_addoption(parser: Parser) -> None: default="prepend", choices=["prepend", "append", "importlib"], dest="importmode", - help="prepend/append to sys.path when importing test modules and conftest files, " - "default is to prepend.", + help="Prepend/append to sys.path when importing test modules and conftest " + "files. Default: prepend.", ) group = parser.getgroup("debugconfig", "test session debugging and configuration") @@ -221,8 +223,8 @@ def pytest_addoption(parser: Parser) -> None: type=validate_basetemp, metavar="dir", help=( - "base temporary directory for this test run." - "(warning: this directory is removed if it exists)" + "Base temporary directory for this test run. " + "(Warning: this directory is removed if it exists.)" ), ) diff --git a/src/_pytest/mark/__init__.py b/src/_pytest/mark/__init__.py index 11e6e34d73a..a03f0f89c2a 100644 --- a/src/_pytest/mark/__init__.py +++ b/src/_pytest/mark/__init__.py @@ -76,8 +76,8 @@ def pytest_addoption(parser: Parser) -> None: dest="keyword", default="", metavar="EXPRESSION", - help="only run tests which match the given substring expression. " - "An expression is a python evaluatable expression " + help="Only run tests which match the given substring expression. " + "An expression is a Python evaluatable expression " "where all names are substring-matched against test names " "and their parent classes. Example: -k 'test_method or test_" "other' matches all test functions and classes whose name " @@ -96,7 +96,7 @@ def pytest_addoption(parser: Parser) -> None: dest="markexpr", default="", metavar="MARKEXPR", - help="only run tests matching given mark expression.\n" + help="Only run tests matching given mark expression. " "For example: -m 'mark1 and not mark2'.", ) @@ -106,8 +106,8 @@ def pytest_addoption(parser: Parser) -> None: help="show markers (builtin, plugin and per-project ones).", ) - parser.addini("markers", "markers for test functions", "linelist") - parser.addini(EMPTY_PARAMETERSET_OPTION, "default marker for empty parametersets") + parser.addini("markers", "Markers for test functions", "linelist") + parser.addini(EMPTY_PARAMETERSET_OPTION, "Default marker for empty parametersets") @hookimpl(tryfirst=True) diff --git a/src/_pytest/pastebin.py b/src/_pytest/pastebin.py index 385b3022cc0..22c7a622373 100644 --- a/src/_pytest/pastebin.py +++ b/src/_pytest/pastebin.py @@ -24,7 +24,7 @@ def pytest_addoption(parser: Parser) -> None: dest="pastebin", default=None, choices=["failed", "all"], - help="send failed|all info to bpaste.net pastebin service.", + help="Send failed|all info to bpaste.net pastebin service", ) diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 4493bdb80dc..d8586a05694 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -89,7 +89,7 @@ def pytest_addoption(parser: Parser) -> None: action="store_true", dest="lsof", default=False, - help="run FD checks if lsof is available", + help="Run FD checks if lsof is available", ) parser.addoption( @@ -98,13 +98,13 @@ def pytest_addoption(parser: Parser) -> None: dest="runpytest", choices=("inprocess", "subprocess"), help=( - "run pytest sub runs in tests using an 'inprocess' " + "Run pytest sub runs in tests using an 'inprocess' " "or 'subprocess' (python -m main) method" ), ) parser.addini( - "pytester_example_dir", help="directory to take the pytester example files from" + "pytester_example_dir", help="Directory to take the pytester example files from" ) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 4d1f722e474..91054f370d3 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -97,7 +97,7 @@ def pytest_addoption(parser: Parser) -> None: action="store_true", dest="showfixtures", default=False, - help="show available fixtures, sorted by plugin appearance " + help="Show available fixtures, sorted by plugin appearance " "(fixtures with leading '_' are only shown with '-v')", ) group.addoption( @@ -105,32 +105,32 @@ def pytest_addoption(parser: Parser) -> None: action="store_true", dest="show_fixtures_per_test", default=False, - help="show fixtures per test", + help="Show fixtures per test", ) parser.addini( "python_files", type="args", # NOTE: default is also used in AssertionRewritingHook. default=["test_*.py", "*_test.py"], - help="glob-style file patterns for Python test module discovery", + help="Glob-style file patterns for Python test module discovery", ) parser.addini( "python_classes", type="args", default=["Test"], - help="prefixes or glob names for Python test class discovery", + help="Prefixes or glob names for Python test class discovery", ) parser.addini( "python_functions", type="args", default=["test"], - help="prefixes or glob names for Python test function and method discovery", + help="Prefixes or glob names for Python test function and method discovery", ) parser.addini( "disable_test_id_escaping_and_forfeit_all_rights_to_community_support", type="bool", default=False, - help="disable string escape non-ascii characters, might cause unwanted " + help="Disable string escape non-ASCII characters, might cause unwanted " "side effects(use at your own risk)", ) diff --git a/src/_pytest/runner.py b/src/_pytest/runner.py index df6eecdb129..584c3229d5f 100644 --- a/src/_pytest/runner.py +++ b/src/_pytest/runner.py @@ -46,14 +46,14 @@ def pytest_addoption(parser: Parser) -> None: - group = parser.getgroup("terminal reporting", "reporting", after="general") + group = parser.getgroup("terminal reporting", "Reporting", after="general") group.addoption( "--durations", action="store", type=int, default=None, metavar="N", - help="show N slowest setup/test durations (N=0 for all).", + help="Show N slowest setup/test durations (N=0 for all)", ) group.addoption( "--durations-min", @@ -61,7 +61,8 @@ def pytest_addoption(parser: Parser) -> None: type=float, default=0.005, metavar="N", - help="Minimal duration in seconds for inclusion in slowest list. Default 0.005", + help="Minimal duration in seconds for inclusion in slowest list. " + "Default: 0.005.", ) diff --git a/src/_pytest/setuponly.py b/src/_pytest/setuponly.py index 531131ce726..583590d6b70 100644 --- a/src/_pytest/setuponly.py +++ b/src/_pytest/setuponly.py @@ -18,13 +18,13 @@ def pytest_addoption(parser: Parser) -> None: "--setuponly", "--setup-only", action="store_true", - help="only setup fixtures, do not execute tests.", + help="Only setup fixtures, do not execute tests", ) group.addoption( "--setupshow", "--setup-show", action="store_true", - help="show setup of fixtures while executing tests.", + help="Show setup of fixtures while executing tests", ) diff --git a/src/_pytest/setupplan.py b/src/_pytest/setupplan.py index 9ba81ccaf0a..1a4ebdd99ca 100644 --- a/src/_pytest/setupplan.py +++ b/src/_pytest/setupplan.py @@ -15,8 +15,8 @@ def pytest_addoption(parser: Parser) -> None: "--setupplan", "--setup-plan", action="store_true", - help="show what fixtures and tests would be executed but " - "don't execute anything.", + help="Show what fixtures and tests would be executed but " + "don't execute anything", ) diff --git a/src/_pytest/skipping.py b/src/_pytest/skipping.py index ac7216f8385..b20442350d6 100644 --- a/src/_pytest/skipping.py +++ b/src/_pytest/skipping.py @@ -31,12 +31,12 @@ def pytest_addoption(parser: Parser) -> None: action="store_true", dest="runxfail", default=False, - help="report the results of xfail tests as if they were not marked", + help="Report the results of xfail tests as if they were not marked", ) parser.addini( "xfail_strict", - "default for the strict parameter of xfail " + "Default for the strict parameter of xfail " "markers when not given explicitly (default: False)", default=False, type="bool", diff --git a/src/_pytest/stepwise.py b/src/_pytest/stepwise.py index 4d95a96b872..84f1a6ce8fe 100644 --- a/src/_pytest/stepwise.py +++ b/src/_pytest/stepwise.py @@ -23,7 +23,7 @@ def pytest_addoption(parser: Parser) -> None: action="store_true", default=False, dest="stepwise", - help="exit on test failure and continue from last failing test next time", + help="Exit on test failure and continue from last failing test next time", ) group.addoption( "--sw-skip", @@ -31,8 +31,8 @@ def pytest_addoption(parser: Parser) -> None: action="store_true", default=False, dest="stepwise_skip", - help="ignore the first failing test but stop on the next failing test.\n" - "implicitly enables --stepwise.", + help="Ignore the first failing test but stop on the next failing test. " + "Implicitly enables --stepwise.", ) diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 8e47f26045a..9739a467a66 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -112,28 +112,28 @@ def __call__( def pytest_addoption(parser: Parser) -> None: - group = parser.getgroup("terminal reporting", "reporting", after="general") + group = parser.getgroup("terminal reporting", "Reporting", after="general") group._addoption( "-v", "--verbose", action="count", default=0, dest="verbose", - help="increase verbosity.", + help="Increase verbosity", ) group._addoption( "--no-header", action="store_true", default=False, dest="no_header", - help="disable header", + help="Disable header", ) group._addoption( "--no-summary", action="store_true", default=False, dest="no_summary", - help="disable summary", + help="Disable summary", ) group._addoption( "-q", @@ -141,14 +141,14 @@ def pytest_addoption(parser: Parser) -> None: action=MoreQuietAction, default=0, dest="verbose", - help="decrease verbosity.", + help="Decrease verbosity", ) group._addoption( "--verbosity", dest="verbose", type=int, default=0, - help="set verbosity. Default is 0.", + help="Set verbosity. Default: 0.", ) group._addoption( "-r", @@ -156,7 +156,7 @@ def pytest_addoption(parser: Parser) -> None: dest="reportchars", default=_REPORTCHARS_DEFAULT, metavar="chars", - help="show extra test summary info as specified by chars: (f)ailed, " + help="Show extra test summary info as specified by chars: (f)ailed, " "(E)rror, (s)kipped, (x)failed, (X)passed, " "(p)assed, (P)assed with output, (a)ll except passed (p/P), or (A)ll. " "(w)arnings are enabled by default (see --disable-warnings), " @@ -168,7 +168,7 @@ def pytest_addoption(parser: Parser) -> None: default=False, dest="disable_warnings", action="store_true", - help="disable warnings summary", + help="Disable warnings summary", ) group._addoption( "-l", @@ -176,7 +176,7 @@ def pytest_addoption(parser: Parser) -> None: action="store_true", dest="showlocals", default=False, - help="show locals in tracebacks (disabled by default).", + help="Show locals in tracebacks (disabled by default)", ) group._addoption( "--tb", @@ -185,7 +185,7 @@ def pytest_addoption(parser: Parser) -> None: dest="tbstyle", default="auto", choices=["auto", "long", "short", "no", "line", "native"], - help="traceback print mode (auto/long/short/line/native/no).", + help="Traceback print mode (auto/long/short/line/native/no)", ) group._addoption( "--show-capture", @@ -194,14 +194,14 @@ def pytest_addoption(parser: Parser) -> None: choices=["no", "stdout", "stderr", "log", "all"], default="all", help="Controls how captured stdout/stderr/log is shown on failed tests. " - "Default is 'all'.", + "Default: all.", ) group._addoption( "--fulltrace", "--full-trace", action="store_true", default=False, - help="don't cut any tracebacks (default is to cut).", + help="Don't cut any tracebacks (default is to cut)", ) group._addoption( "--color", @@ -210,18 +210,20 @@ def pytest_addoption(parser: Parser) -> None: dest="color", default="auto", choices=["yes", "no", "auto"], - help="color terminal output (yes/no/auto).", + help="Color terminal output (yes/no/auto)", ) group._addoption( "--code-highlight", default="yes", choices=["yes", "no"], - help="Whether code should be highlighted (only if --color is also enabled)", + help="Whether code should be highlighted (only if --color is also enabled). " + "Default: yes.", ) parser.addini( "console_output_style", - help='console output: "classic", or with additional progress information ("progress" (percentage) | "count").', + help='Console output: "classic", or with additional progress information ' + '("progress" (percentage) | "count")', default="progress", ) diff --git a/testing/test_config.py b/testing/test_config.py index b2c74085eae..ac0c159a833 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -2117,8 +2117,8 @@ def test_debug_help(self, pytester: Pytester) -> None: result = pytester.runpytest("-h") result.stdout.fnmatch_lines( [ - "*store internal tracing debug information in this log*", - "*This file is opened with 'w' and truncated as a result*", - "*Defaults to 'pytestdebug.log'.", + "*Store internal tracing debug information in this log*", + "*file. This file is opened with 'w' and truncated as a*", + "*Default: pytestdebug.log.", ] ) diff --git a/testing/test_helpconfig.py b/testing/test_helpconfig.py index 44c2c9295bf..ba89d0c4acf 100644 --- a/testing/test_helpconfig.py +++ b/testing/test_helpconfig.py @@ -30,11 +30,11 @@ def test_help(pytester: Pytester) -> None: assert result.ret == 0 result.stdout.fnmatch_lines( """ - -m MARKEXPR only run tests matching given mark expression. - For example: -m 'mark1 and not mark2'. - reporting: + -m MARKEXPR Only run tests matching given mark expression. For + example: -m 'mark1 and not mark2'. + Reporting: --durations=N * - -V, --version display pytest version and information about plugins. + -V, --version Display pytest version and information about plugins. When given twice, also display information about plugins. *setup.cfg* @@ -71,9 +71,9 @@ def pytest_addoption(parser): assert result.ret == 0 lines = [ " required_plugins (args):", - " plugins that must be present for pytest to run*", + " Plugins that must be present for pytest to run*", " test_ini (bool):*", - "environment variables:", + "Environment variables:", ] result.stdout.fnmatch_lines(lines, consecutive=True) diff --git a/testing/test_stepwise.py b/testing/test_stepwise.py index 63d29d6241f..20781d42cce 100644 --- a/testing/test_stepwise.py +++ b/testing/test_stepwise.py @@ -277,4 +277,4 @@ def test_three(): def test_sw_skip_help(pytester: Pytester) -> None: result = pytester.runpytest("-h") - result.stdout.fnmatch_lines("*implicitly enables --stepwise.") + result.stdout.fnmatch_lines("*Implicitly enables --stepwise.") From c2f684fcd6af2818a5ddeb99cd5b8367a91e99ef Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Thu, 2 Jun 2022 08:16:59 -0500 Subject: [PATCH 261/549] docs(monkeypatch): Fix autodoc reference links (#10013) Close #10014 --- AUTHORS | 1 + doc/en/how-to/monkeypatch.rst | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index af9c7a56bce..61c3901beaa 100644 --- a/AUTHORS +++ b/AUTHORS @@ -334,6 +334,7 @@ Tom Dalton Tom Viner Tomáš Gavenčiak Tomer Keren +Tony Narlock Tor Colvin Trevor Bekolay Tyler Goodlet diff --git a/doc/en/how-to/monkeypatch.rst b/doc/en/how-to/monkeypatch.rst index 9c61233f7e5..0ae87824030 100644 --- a/doc/en/how-to/monkeypatch.rst +++ b/doc/en/how-to/monkeypatch.rst @@ -3,7 +3,7 @@ How to monkeypatch/mock modules and environments ================================================================ -.. currentmodule:: _pytest.monkeypatch +.. currentmodule:: pytest Sometimes tests need to invoke functionality which depends on global settings or which invokes code which cannot be easily @@ -436,7 +436,7 @@ separate fixtures for each potential mock and reference them in the needed tests _ = app.create_connection_string() -.. currentmodule:: _pytest.monkeypatch +.. currentmodule:: pytest API Reference ------------- From 5adfb0e1876a39704bfd257ac63e21ca6652b34b Mon Sep 17 00:00:00 2001 From: Neil Girdhar Date: Fri, 3 Jun 2022 06:59:48 -0400 Subject: [PATCH 262/549] Use symbolic NoReturn as a type annotation (#10018) Use symbolic NoReturn as a type annotation --- src/_pytest/compat.py | 4 ++-- src/_pytest/config/argparsing.py | 4 ++-- src/_pytest/fixtures.py | 6 +++--- src/_pytest/mark/expression.py | 7 ++----- src/_pytest/outcomes.py | 12 +++++------- src/_pytest/reports.py | 4 ++-- 6 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index 8b77de28f10..d0cb07b2291 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -10,6 +10,7 @@ from typing import Any from typing import Callable from typing import Generic +from typing import NoReturn from typing import Optional from typing import Tuple from typing import TYPE_CHECKING @@ -20,7 +21,6 @@ import py if TYPE_CHECKING: - from typing import NoReturn from typing_extensions import Final @@ -403,5 +403,5 @@ def __get__(self, instance, owner=None): # previously. # # This also work for Enums (if you use `is` to compare) and Literals. -def assert_never(value: "NoReturn") -> "NoReturn": +def assert_never(value: NoReturn) -> NoReturn: assert False, f"Unhandled value: {value} ({type(value).__name__})" diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index 5f281eb0992..fa27aa6203b 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -9,6 +9,7 @@ from typing import Dict from typing import List from typing import Mapping +from typing import NoReturn from typing import Optional from typing import Sequence from typing import Tuple @@ -24,7 +25,6 @@ from _pytest.deprecated import check_ispytest if TYPE_CHECKING: - from typing import NoReturn from typing_extensions import Literal FILE_OR_DIR = "file_or_dir" @@ -403,7 +403,7 @@ def __init__( # an usage error to provide more contextual information to the user. self.extra_info = extra_info if extra_info else {} - def error(self, message: str) -> "NoReturn": + def error(self, message: str) -> NoReturn: """Transform argparse error message into UsageError.""" msg = f"{self.prog}: error: {message}" diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index b4545d49dc7..fc6539db0fd 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -18,6 +18,7 @@ from typing import Iterator from typing import List from typing import MutableMapping +from typing import NoReturn from typing import Optional from typing import overload from typing import Sequence @@ -67,7 +68,6 @@ if TYPE_CHECKING: from typing import Deque - from typing import NoReturn from _pytest.scope import _ScopeName from _pytest.main import Session @@ -524,7 +524,7 @@ def applymarker(self, marker: Union[str, MarkDecorator]) -> None: """ self.node.add_marker(marker) - def raiseerror(self, msg: Optional[str]) -> "NoReturn": + def raiseerror(self, msg: Optional[str]) -> NoReturn: """Raise a FixtureLookupError with the given message.""" raise self._fixturemanager.FixtureLookupError(None, self, msg) @@ -866,7 +866,7 @@ def toterminal(self, tw: TerminalWriter) -> None: tw.line("%s:%d" % (os.fspath(self.filename), self.firstlineno + 1)) -def fail_fixturefunc(fixturefunc, msg: str) -> "NoReturn": +def fail_fixturefunc(fixturefunc, msg: str) -> NoReturn: fs, lineno = getfslineno(fixturefunc) location = f"{fs}:{lineno + 1}" source = _pytest._code.Source(fixturefunc) diff --git a/src/_pytest/mark/expression.py b/src/_pytest/mark/expression.py index 92220d7723a..0a2e7c65676 100644 --- a/src/_pytest/mark/expression.py +++ b/src/_pytest/mark/expression.py @@ -21,15 +21,12 @@ from typing import Callable from typing import Iterator from typing import Mapping +from typing import NoReturn from typing import Optional from typing import Sequence -from typing import TYPE_CHECKING import attr -if TYPE_CHECKING: - from typing import NoReturn - __all__ = [ "Expression", @@ -117,7 +114,7 @@ def accept(self, type: TokenType, *, reject: bool = False) -> Optional[Token]: self.reject((type,)) return None - def reject(self, expected: Sequence[TokenType]) -> "NoReturn": + def reject(self, expected: Sequence[TokenType]) -> NoReturn: raise ParseError( self.current.pos + 1, "expected {}; got {}".format( diff --git a/src/_pytest/outcomes.py b/src/_pytest/outcomes.py index 25206fe0e85..684efae7715 100644 --- a/src/_pytest/outcomes.py +++ b/src/_pytest/outcomes.py @@ -5,6 +5,7 @@ from typing import Any from typing import Callable from typing import cast +from typing import NoReturn from typing import Optional from typing import Type from typing import TypeVar @@ -14,7 +15,6 @@ TYPE_CHECKING = False # Avoid circular import through compat. if TYPE_CHECKING: - from typing import NoReturn from typing_extensions import Protocol else: # typing.Protocol is only available starting from Python 3.8. It is also @@ -115,7 +115,7 @@ def decorate(func: _F) -> _WithException[_F, _ET]: @_with_exception(Exit) def exit( reason: str = "", returncode: Optional[int] = None, *, msg: Optional[str] = None -) -> "NoReturn": +) -> NoReturn: """Exit testing process. :param reason: @@ -146,7 +146,7 @@ def exit( @_with_exception(Skipped) def skip( reason: str = "", *, allow_module_level: bool = False, msg: Optional[str] = None -) -> "NoReturn": +) -> NoReturn: """Skip an executing test with the given message. This function should be called only during testing (setup, call or teardown) or @@ -176,9 +176,7 @@ def skip( @_with_exception(Failed) -def fail( - reason: str = "", pytrace: bool = True, msg: Optional[str] = None -) -> "NoReturn": +def fail(reason: str = "", pytrace: bool = True, msg: Optional[str] = None) -> NoReturn: """Explicitly fail an executing test with the given message. :param reason: @@ -238,7 +236,7 @@ class XFailed(Failed): @_with_exception(XFailed) -def xfail(reason: str = "") -> "NoReturn": +def xfail(reason: str = "") -> NoReturn: """Imperatively xfail an executing test or setup function with the given reason. This function should be called only during testing (setup, call or teardown). diff --git a/src/_pytest/reports.py b/src/_pytest/reports.py index 725fdf61739..20862d60388 100644 --- a/src/_pytest/reports.py +++ b/src/_pytest/reports.py @@ -8,6 +8,7 @@ from typing import Iterator from typing import List from typing import Mapping +from typing import NoReturn from typing import Optional from typing import Tuple from typing import Type @@ -36,7 +37,6 @@ from _pytest.outcomes import skip if TYPE_CHECKING: - from typing import NoReturn from typing_extensions import Literal from _pytest.runner import CallInfo @@ -229,7 +229,7 @@ def _from_json(cls: Type[_R], reportdict: Dict[str, object]) -> _R: def _report_unserialization_failure( type_name: str, report_class: Type[BaseReport], reportdict -) -> "NoReturn": +) -> NoReturn: url = "https://github.com/pytest-dev/pytest/issues" stream = StringIO() pprint("-" * 100, stream=stream) From 433c7376c5193446769b7307df93f27a94e72435 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 5 Jun 2022 12:44:38 -0300 Subject: [PATCH 263/549] [automated] Update plugin list (#10020) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 138 +++++++++++++++++++++---------- 1 file changed, 93 insertions(+), 45 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index c59689c507c..68b2352db7f 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1056 plugins. +This list contains 1062 plugins. .. only:: not latex @@ -20,7 +20,7 @@ This list contains 1056 plugins. =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ :pypi:`pytest-abstracts` A contextmanager pytest fixture for handling multiple mock abstracts May 25, 2022 N/A N/A :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) May 24, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) May 31, 2022 N/A pytest (>=5.4.0) :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) @@ -90,6 +90,7 @@ This list contains 1056 plugins. :pypi:`pytest-aws` pytest plugin for testing AWS resource configurations Oct 04, 2017 4 - Beta N/A :pypi:`pytest-aws-config` Protect your AWS credentials in unit tests May 28, 2021 N/A N/A :pypi:`pytest-axe` pytest plugin for axe-selenium-python Nov 12, 2018 N/A pytest (>=3.0.0) + :pypi:`pytest-azure-devops` Simplifies using azure devops parallel strategy (https://docs.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner) with pytest. Jun 02, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Mar 16, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) @@ -108,7 +109,7 @@ This list contains 1056 plugins. :pypi:`pytest-black` A pytest plugin to enable format checking with black Oct 05, 2020 4 - Beta N/A :pypi:`pytest-black-multipy` Allow '--black' on older Pythons Jan 14, 2021 5 - Production/Stable pytest (!=3.7.3,>=3.5) ; extra == 'testing' :pypi:`pytest-blame` A pytest plugin helps developers to debug by providing useful commits history. May 04, 2019 N/A pytest (>=4.4.0) - :pypi:`pytest-blender` Blender Pytest plugin. May 17, 2022 N/A pytest ; extra == 'dev' + :pypi:`pytest-blender` Blender Pytest plugin. May 30, 2022 N/A pytest ; extra == 'dev' :pypi:`pytest-blink1` Pytest plugin to emit notifications via the Blink(1) RGB LED Jan 07, 2018 4 - Beta N/A :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A @@ -190,7 +191,7 @@ This list contains 1056 plugins. :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types May 13, 2022 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Jun 02, 2022 N/A N/A :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest @@ -314,14 +315,14 @@ This list contains 1056 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin May 25, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects May 25, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project May 25, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag May 25, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip May 25, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Jun 01, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jun 01, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jun 01, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jun 01, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jun 01, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports May 25, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports May 25, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jun 01, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jun 01, 2022 N/A N/A :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -355,7 +356,7 @@ This list contains 1056 plugins. :pypi:`pytest-extra-durations` A pytest plugin to get durations on a per-function basis and per module basis. Apr 21, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-fabric` Provides test utilities to run fabric task tests by using docker containers Sep 12, 2018 5 - Production/Stable N/A :pypi:`pytest-factory` Use factories for test setup with py.test Sep 06, 2020 3 - Alpha pytest (>4.3) - :pypi:`pytest-factoryboy` Factory Boy support for pytest. May 21, 2022 6 - Mature pytest (>=5.0.0) + :pypi:`pytest-factoryboy` Factory Boy support for pytest. May 31, 2022 6 - Mature pytest (>=5.0.0) :pypi:`pytest-factoryboy-fixtures` Generates pytest fixtures that allow the use of type hinting Jun 25, 2020 N/A N/A :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-failed-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A @@ -366,7 +367,7 @@ This list contains 1056 plugins. :pypi:`pytest-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A :pypi:`pytest-fantasy` Pytest plugin for Flask Fantasy Framework Mar 14, 2019 N/A N/A :pypi:`pytest-fastapi` Dec 27, 2020 N/A N/A - :pypi:`pytest-fastapi-deps` A fixture which allows easy replacement of fastapi dependencies for testing May 24, 2022 5 - Production/Stable pytest + :pypi:`pytest-fastapi-deps` A fixture which allows easy replacement of fastapi dependencies for testing Jun 02, 2022 5 - Production/Stable pytest :pypi:`pytest-fastest` Use SCM and coverage to run only needed tests Mar 05, 2020 N/A N/A :pypi:`pytest-fast-first` Pytest plugin that runs fast tests first Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-faulthandler` py.test plugin that activates the fault handler module for tests (dummy package) Jul 04, 2019 6 - Mature pytest (>=5.0) @@ -422,6 +423,7 @@ This list contains 1056 plugins. :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest :pypi:`pytest-github` Plugin for py.test that associates tests with github issues using a marker. Mar 07, 2019 5 - Production/Stable N/A :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Dec 08, 2021 N/A pytest (>=4.0.0) + :pypi:`pytest-github-report` Generate a GitHub report using pytest in GitHub Workflows Jun 03, 2022 4 - Beta N/A :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A :pypi:`pytest-glamor-allure` Extends allure-pytest functionality May 19, 2022 4 - Beta pytest :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest @@ -442,7 +444,7 @@ This list contains 1056 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components May 28, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 03, 2022 3 - Alpha pytest (==7.1.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -519,6 +521,7 @@ This list contains 1056 plugins. :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. May 17, 2022 3 - Alpha pytest (>=3.6,<8) :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A + :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 03, 2022 N/A pytest :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A :pypi:`pytest-lazy-fixture` It helps to use fixtures in pytest.mark.parametrize Feb 01, 2020 4 - Beta pytest (>=3.2.5) :pypi:`pytest-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest @@ -601,7 +604,7 @@ This list contains 1056 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Apr 22, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin May 28, 2022 4 - Beta pytest + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jun 03, 2022 4 - Beta pytest :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A @@ -612,7 +615,7 @@ This list contains 1056 plugins. :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Jan 11, 2022 3 - Alpha pytest (>=6.0.0) :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A N/A - :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Mar 02, 2022 N/A N/A + :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. May 30, 2022 N/A N/A :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 15, 2022 5 - Production/Stable pytest (>=6.2) :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) @@ -636,6 +639,7 @@ This list contains 1056 plugins. :pypi:`pytest-notimplemented` Pytest markers for not implemented features and tests. Aug 27, 2019 N/A pytest (>=5.1,<6.0) :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Mar 16, 2022 4 - Beta pytest (>=4.6.0) + :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jun 02, 2022 5 - Production/Stable pytest :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A :pypi:`pytest-odoo` py.test plugin to run Odoo tests Feb 08, 2022 4 - Beta N/A :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A @@ -645,7 +649,7 @@ This list contains 1056 plugins. :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest - :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi May 18, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Jun 02, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-operator` Fixtures for Operators May 25, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) @@ -807,6 +811,7 @@ This list contains 1056 plugins. :pypi:`pytest-responses` py.test integration for responses Apr 26, 2021 N/A pytest (>=2.5) :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A + :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Jun 01, 2022 N/A pytest (>=7.0.0) :pypi:`pytest-reverse` Pytest plugin to reverse test order. May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) @@ -832,13 +837,13 @@ This list contains 1056 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. May 27, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 03, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. May 27, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 03, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -852,7 +857,7 @@ This list contains 1056 plugins. :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A - :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system May 26, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Jun 02, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 5 - Production/Stable pytest (>=3.5.1) :pypi:`pytest-shortcuts` Expand command-line shortcuts listed in pytest configuration Oct 29, 2020 4 - Beta pytest (>=3.5.0) @@ -945,7 +950,8 @@ This list contains 1056 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Apr 12, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Mar 11, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Jun 01, 2022 4 - Beta N/A + :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) @@ -1029,7 +1035,7 @@ This list contains 1056 plugins. :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) :pypi:`pytest-virtualenv` Virtualenv fixture for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-vnc` VNC client for Pytest May 22, 2022 N/A pytest + :pypi:`pytest-vnc` VNC client for Pytest Jun 03, 2022 N/A pytest :pypi:`pytest-voluptuous` Pytest plugin for asserting data against voluptuous schema. Jun 09, 2020 N/A pytest :pypi:`pytest-vscodedebug` A pytest plugin to easily enable debugging tests within Visual Studio Code Dec 04, 2020 4 - Beta N/A :pypi:`pytest-vts` pytest plugin for automatic recording of http stubbed tests Jun 05, 2019 N/A pytest (>=2.3) @@ -1071,7 +1077,7 @@ This list contains 1056 plugins. :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A - :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting May 27, 2022 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Jun 02, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ @@ -1094,7 +1100,7 @@ This list contains 1056 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: May 24, 2022, + *last release*: May 31, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1583,6 +1589,13 @@ This list contains 1056 plugins. pytest plugin for axe-selenium-python + :pypi:`pytest-azure-devops` + *last release*: Jun 02, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + Simplifies using azure devops parallel strategy (https://docs.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner) with pytest. + :pypi:`pytest-azurepipelines` *last release*: Mar 16, 2022, *status*: 4 - Beta, @@ -1710,7 +1723,7 @@ This list contains 1056 plugins. A pytest plugin helps developers to debug by providing useful commits history. :pypi:`pytest-blender` - *last release*: May 17, 2022, + *last release*: May 30, 2022, *status*: N/A, *requires*: pytest ; extra == 'dev' @@ -2284,7 +2297,7 @@ This list contains 1056 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: May 13, 2022, + *last release*: Jun 02, 2022, *status*: N/A, *requires*: N/A @@ -3152,35 +3165,35 @@ This list contains 1056 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: May 25, 2022, + *last release*: Jun 01, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: May 25, 2022, + *last release*: Jun 01, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: May 25, 2022, + *last release*: Jun 01, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: May 25, 2022, + *last release*: Jun 01, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: May 25, 2022, + *last release*: Jun 01, 2022, *status*: N/A, *requires*: N/A @@ -3194,14 +3207,14 @@ This list contains 1056 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: May 25, 2022, + *last release*: Jun 01, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: May 25, 2022, + *last release*: Jun 01, 2022, *status*: N/A, *requires*: N/A @@ -3439,7 +3452,7 @@ This list contains 1056 plugins. Use factories for test setup with py.test :pypi:`pytest-factoryboy` - *last release*: May 21, 2022, + *last release*: May 31, 2022, *status*: 6 - Mature, *requires*: pytest (>=5.0.0) @@ -3516,7 +3529,7 @@ This list contains 1056 plugins. :pypi:`pytest-fastapi-deps` - *last release*: May 24, 2022, + *last release*: Jun 02, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -3907,6 +3920,13 @@ This list contains 1056 plugins. pytest plugin to annotate failed tests with a workflow command for GitHub Actions + :pypi:`pytest-github-report` + *last release*: Jun 03, 2022, + *status*: 4 - Beta, + *requires*: N/A + + Generate a GitHub report using pytest in GitHub Workflows + :pypi:`pytest-gitignore` *last release*: Jul 17, 2015, *status*: 4 - Beta, @@ -4048,7 +4068,7 @@ This list contains 1056 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: May 28, 2022, + *last release*: Jun 03, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4586,6 +4606,13 @@ This list contains 1056 plugins. + :pypi:`pytest-launchable` + *last release*: Jun 03, 2022, + *status*: N/A, + *requires*: pytest + + Launchable Pytest Plugin + :pypi:`pytest-layab` *last release*: Oct 05, 2020, *status*: 5 - Production/Stable, @@ -5161,7 +5188,7 @@ This list contains 1056 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: May 28, 2022, + *last release*: Jun 03, 2022, *status*: 4 - Beta, *requires*: pytest @@ -5238,7 +5265,7 @@ This list contains 1056 plugins. Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. :pypi:`pytest-mypy-testing` - *last release*: Mar 02, 2022, + *last release*: May 30, 2022, *status*: N/A, *requires*: N/A @@ -5405,6 +5432,13 @@ This list contains 1056 plugins. A pytest plugin for generating NUnit3 test result XML output + :pypi:`pytest-object-getter` + *last release*: Jun 02, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest + + Import any object from a 3rd party module while mocking its namespace on demand. + :pypi:`pytest-ochrus` *last release*: Feb 21, 2018, *status*: 4 - Beta, @@ -5469,7 +5503,7 @@ This list contains 1056 plugins. A pytest plugin for instrumenting test runs via OpenTelemetry :pypi:`pytest-opentmi` - *last release*: May 18, 2022, + *last release*: Jun 02, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) @@ -6602,6 +6636,13 @@ This list contains 1056 plugins. A RethinkDB plugin for pytest. + :pypi:`pytest-retry` + *last release*: Jun 01, 2022, + *status*: N/A, + *requires*: pytest (>=7.0.0) + + Adds the ability to retry flaky tests in CI environments + :pypi:`pytest-reverse` *last release*: May 11, 2022, *status*: 5 - Production/Stable, @@ -6778,7 +6819,7 @@ This list contains 1056 plugins. :pypi:`pytest-sbase` - *last release*: May 27, 2022, + *last release*: Jun 03, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6820,7 +6861,7 @@ This list contains 1056 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: May 27, 2022, + *last release*: Jun 03, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6918,7 +6959,7 @@ This list contains 1056 plugins. A pytest plugin to help with testing shell scripts / black box commands :pypi:`pytest-shell-utilities` - *last release*: May 26, 2022, + *last release*: Jun 02, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -7569,12 +7610,19 @@ This list contains 1056 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Mar 11, 2022, + *last release*: Jun 01, 2022, *status*: 4 - Beta, *requires*: N/A selects tests affected by changed files and methods + :pypi:`pytest-testmon-oc` + *last release*: Jun 01, 2022, + *status*: 4 - Beta, + *requires*: pytest (<8,>=5) + + nOly selects tests affected by changed files and methods + :pypi:`pytest-testobject` *last release*: Sep 24, 2019, *status*: 4 - Beta, @@ -8157,7 +8205,7 @@ This list contains 1056 plugins. Virtualenv fixture for py.test :pypi:`pytest-vnc` - *last release*: May 22, 2022, + *last release*: Jun 03, 2022, *status*: N/A, *requires*: pytest @@ -8451,7 +8499,7 @@ This list contains 1056 plugins. OWASP ZAP plugin for py.test. :pypi:`pytest-zebrunner` - *last release*: May 27, 2022, + *last release*: Jun 02, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.5.0) From 083285948f2a425b9b5f3f3b4c25b02c13a30bc6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Jun 2022 08:01:15 -0300 Subject: [PATCH 264/549] build(deps): Bump django from 4.0.4 to 4.0.5 in /testing/plugins_integration (#10021) Bumps [django](https://github.com/django/django) from 4.0.4 to 4.0.5. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/4.0.4...4.0.5) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 0386a613a93..965762dae4b 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.6.1 -django==4.0.4 +django==4.0.5 pytest-asyncio==0.18.3 pytest-bdd==5.0.0 pytest-cov==3.0.0 From fe2c74cb1aaba82a1bc085005ba39e0c6beb0748 Mon Sep 17 00:00:00 2001 From: Sandro Tosi Date: Tue, 7 Jun 2022 14:43:34 -0400 Subject: [PATCH 265/549] Update location of `usage.rst` to fix manpage compilation `usage.rst` has been moved from `doc/en` to `doc/en/how-to`, so the `man_pages` configuration value needs to be updated to the new location, so that we dont get this warning: writing... WARNING: "man_pages" config value references unknown document usage --- doc/en/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/conf.py b/doc/en/conf.py index 5aedd2d322d..0022363b27e 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -320,7 +320,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [("usage", "pytest", "pytest usage", ["holger krekel at merlinux eu"], 1)] +man_pages = [("how-to/usage", "pytest", "pytest usage", ["holger krekel at merlinux eu"], 1)] # -- Options for Epub output --------------------------------------------------- From 27c94f573cac932a00169a59aa52e8353f4ef71b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 10 Jun 2022 14:28:40 +0200 Subject: [PATCH 266/549] Update training list --- doc/en/index.rst | 8 ++------ doc/en/talks.rst | 2 ++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/en/index.rst b/doc/en/index.rst index 8b4528ddf2d..501ec913388 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -2,16 +2,12 @@ .. sidebar:: Next Open Trainings - - `PyConDE `__, April 11th 2022 (3h), Berlin, Germany - - `PyConIT `__, June 3rd 2022 (4h), Florence, Italy + - `Europython `__, July 11th 2022 (3h), Dublin, Ireland + - `CH Open Workshop-Tage `__ (German), September 8th 2022, Bern, Switzerland - `Professional Testing with Python `_, via `Python Academy `_, March 7th to 9th 2023 (3 day in-depth training), Remote and Leipzig, Germany Also see :doc:`previous talks and blogposts `. -.. - - `Europython `__, July 11th to 17th (3h), Dublin, Ireland - - `CH Open Workshoptage `__ (German), September 6th to 8th (1 day), Bern, Switzerland - .. _features: pytest: helps you write better programs diff --git a/doc/en/talks.rst b/doc/en/talks.rst index 160345614c8..b9b153a792e 100644 --- a/doc/en/talks.rst +++ b/doc/en/talks.rst @@ -17,6 +17,8 @@ Books Talks and blog postings --------------------------------------------- +- Training: `pytest - simple, rapid and fun testing with Python `_, Florian Bruhin, PyConDE 2022 + - `pytest: Simple, rapid and fun testing with Python, `_ (@ 4:22:32), Florian Bruhin, WeAreDevelopers World Congress 2021 - Webinar: `pytest: Test Driven Development für Python (German) `_, Florian Bruhin, via mylearning.ch, 2020 From 1a50e5222fdaa82dc47eecaba38a3bb04d0b4872 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 12 Jun 2022 00:22:15 +0000 Subject: [PATCH 267/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 120 +++++++++++++++---------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 68b2352db7f..d29f5ddcc44 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -20,7 +20,7 @@ This list contains 1062 plugins. =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ :pypi:`pytest-abstracts` A contextmanager pytest fixture for handling multiple mock abstracts May 25, 2022 N/A N/A :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) May 31, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Jun 07, 2022 N/A pytest (>=5.4.0) :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) @@ -45,7 +45,7 @@ This list contains 1062 plugins. :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-android` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Feb 21, 2019 3 - Alpha pytest :pypi:`pytest-anki` A pytest plugin for testing Anki add-ons Oct 14, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-annotate` pytest-annotate: Generate PyAnnotate annotations from your pytest tests. Nov 29, 2021 3 - Alpha pytest (<7.0.0,>=3.2.0) + :pypi:`pytest-annotate` pytest-annotate: Generate PyAnnotate annotations from your pytest tests. Jun 07, 2022 3 - Alpha pytest (<8.0.0,>=3.2.0) :pypi:`pytest-ansible` Plugin for py.test to simplify calling ansible modules from tests or fixtures May 25, 2021 5 - Production/Stable N/A :pypi:`pytest-ansible-playbook` Pytest fixture which runs given ansible playbook file. Mar 08, 2019 4 - Beta N/A :pypi:`pytest-ansible-playbook-runner` Pytest fixture which runs given ansible playbook file. Dec 02, 2020 4 - Beta pytest (>=3.1.0) @@ -191,7 +191,7 @@ This list contains 1062 plugins. :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Jun 02, 2022 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Jun 08, 2022 N/A N/A :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest @@ -315,14 +315,14 @@ This list contains 1062 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Jun 01, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jun 01, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jun 01, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jun 01, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jun 01, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Jun 06, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jun 06, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jun 06, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jun 06, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jun 06, 2022 N/A N/A :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jun 01, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jun 01, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jun 06, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jun 06, 2022 N/A N/A :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -434,7 +434,7 @@ This list contains 1062 plugins. :pypi:`pytest-growl` Growl notifications for pytest results. Jan 13, 2014 5 - Production/Stable N/A :pypi:`pytest-grpc` pytest plugin for grpc May 01, 2020 N/A pytest (>=3.6.0) :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest - :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Apr 01, 2021 5 - Production/Stable N/A + :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Jun 10, 2022 5 - Production/Stable N/A :pypi:`pytest-helm-chart` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jun 15, 2020 4 - Beta pytest (>=5.4.2,<6.0.0) :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. May 11, 2022 4 - Beta pytest (>=6.1.2,<7.0.0) :pypi:`pytest-helper` Functions to help in using the pytest testing framework May 31, 2019 5 - Production/Stable N/A @@ -444,7 +444,7 @@ This list contains 1062 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 03, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 11, 2022 3 - Alpha pytest (==7.1.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -467,13 +467,13 @@ This list contains 1062 plugins. :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A - :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jan 14, 2022 4 - Beta pytest + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jun 08, 2022 4 - Beta N/A :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A :pypi:`pytest-idem` A pytest plugin to help with testing idem projects May 04, 2022 5 - Production/Stable N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 30, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A - :pypi:`pytest-image-diff` Mar 17, 2022 3 - Alpha pytest + :pypi:`pytest-image-diff` Jun 08, 2022 3 - Alpha pytest :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A :pypi:`pytest-influxdb` Plugin for influxdb and pytest integration. Apr 20, 2021 N/A N/A :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A @@ -482,7 +482,7 @@ This list contains 1062 plugins. :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. May 18, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules May 18, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jun 08, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules May 10, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) @@ -521,7 +521,7 @@ This list contains 1062 plugins. :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. May 17, 2022 3 - Alpha pytest (>=3.6,<8) :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A - :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 03, 2022 N/A pytest + :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 09, 2022 N/A pytest (>=4.2.0) :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A :pypi:`pytest-lazy-fixture` It helps to use fixtures in pytest.mark.parametrize Feb 01, 2020 4 - Beta pytest (>=3.2.5) :pypi:`pytest-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest @@ -604,7 +604,7 @@ This list contains 1062 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Apr 22, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jun 03, 2022 4 - Beta pytest + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jun 07, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A @@ -681,7 +681,7 @@ This list contains 1062 plugins. :pypi:`pytest-perf` pytest-perf Feb 05, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) :pypi:`pytest-persistence` Pytest tool for persistent objects Apr 22, 2022 N/A N/A - :pypi:`pytest-pg` Helps to run PostgreSQL in docker as pytest fixture Jan 18, 2022 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-pg` A tiny plugin for pytest which runs PostgreSQL in Docker Jun 07, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Apr 15, 2022 4 - Beta pytest (>=5.4.3) :pypi:`pytest-picked` Run the tests related to the changed files Dec 23, 2020 N/A pytest (>=3.5.0) @@ -755,7 +755,7 @@ This list contains 1062 plugins. :pypi:`pytest-quarantine` A plugin for pytest to manage expected test failures Nov 24, 2019 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-quickcheck` pytest plugin to generate random data inspired by QuickCheck Nov 15, 2020 4 - Beta pytest (<6.0.0,>=4.0) :pypi:`pytest-rabbitmq` RabbitMQ process and client fixtures for pytest Feb 11, 2022 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-race` Race conditions tester for pytest Nov 21, 2016 4 - Beta N/A + :pypi:`pytest-race` Race conditions tester for pytest Jun 07, 2022 4 - Beta N/A :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results May 02, 2022 N/A pytest (>=3.6) :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Apr 12, 2022 5 - Production/Stable pytest @@ -782,7 +782,7 @@ This list contains 1062 plugins. :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Jun 14, 2019 5 - Production/Stable pytest (<5,>=3) :pypi:`pytest-remfiles` Pytest plugin to create a temporary directory with remote files Jul 01, 2019 5 - Production/Stable N/A :pypi:`pytest-remotedata` Pytest plugin for controlling remote data access. Dec 21, 2021 3 - Alpha pytest (>=4.6) - :pypi:`pytest-remote-response` Pytest plugin for capturing and mocking connection requests. Jun 30, 2021 4 - Beta pytest (>=4.6) + :pypi:`pytest-remote-response` Pytest plugin for capturing and mocking connection requests. Jun 05, 2022 4 - Beta pytest (>=4.6) :pypi:`pytest-remove-stale-bytecode` py.test plugin to remove stale byte code files. Mar 04, 2020 4 - Beta pytest :pypi:`pytest-reorder` Reorder tests depending on their paths and names. May 31, 2018 4 - Beta pytest :pypi:`pytest-repeat` pytest plugin for repeating tests Oct 31, 2020 5 - Production/Stable pytest (>=3.6) @@ -837,13 +837,13 @@ This list contains 1062 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 03, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 08, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 03, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 08, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -894,7 +894,7 @@ This list contains 1062 plugins. :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Mar 30, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A - :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Dec 22, 2021 6 - Mature pytest (>=6.2.4) + :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Jun 11, 2022 6 - Mature pytest (<8.0,>=7.1.2) :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Apr 22, 2022 4 - Beta pytest (>=5,<8) :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) @@ -1020,15 +1020,15 @@ This list contains 1062 plugins. :pypi:`pytest-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) :pypi:`pytest-unmarked` Run only unmarked tests Aug 27, 2019 5 - Production/Stable N/A :pypi:`pytest-unordered` Test equality of unordered collections in pytest Mar 28, 2021 4 - Beta N/A - :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Apr 12, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Jun 10, 2022 4 - Beta N/A :pypi:`pytest-upload-report` pytest-upload-report is a plugin for pytest that upload your test report for test results. Jun 18, 2021 5 - Production/Stable N/A :pypi:`pytest-utils` Some helpers for pytest. Dec 04, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) :pypi:`pytest-vagrant` A py.test plugin providing access to vagrant. Sep 07, 2021 5 - Production/Stable pytest :pypi:`pytest-valgrind` May 19, 2021 N/A N/A :pypi:`pytest-variables` pytest plugin for providing variables to tests/fixtures Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) - :pypi:`pytest-variant` Variant support for Pytest Jun 20, 2021 N/A N/A + :pypi:`pytest-variant` Variant support for Pytest Jun 06, 2022 N/A N/A :pypi:`pytest-vcr` Plugin for managing VCR.py cassettes Apr 26, 2019 5 - Production/Stable pytest (>=3.6.0) - :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Apr 21, 2022 4 - Beta pytest (>=6.2.2,<7.0.0) + :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Jun 06, 2022 5 - Production/Stable pytest (>=6.2.2,<7.0.0) :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest :pypi:`pytest-ver` Pytest module with Verification Report Apr 17, 2022 2 - Pre-Alpha N/A @@ -1100,7 +1100,7 @@ This list contains 1062 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: May 31, 2022, + *last release*: Jun 07, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1275,9 +1275,9 @@ This list contains 1062 plugins. A pytest plugin for testing Anki add-ons :pypi:`pytest-annotate` - *last release*: Nov 29, 2021, + *last release*: Jun 07, 2022, *status*: 3 - Alpha, - *requires*: pytest (<7.0.0,>=3.2.0) + *requires*: pytest (<8.0.0,>=3.2.0) pytest-annotate: Generate PyAnnotate annotations from your pytest tests. @@ -2297,7 +2297,7 @@ This list contains 1062 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Jun 02, 2022, + *last release*: Jun 08, 2022, *status*: N/A, *requires*: N/A @@ -3165,35 +3165,35 @@ This list contains 1062 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Jun 01, 2022, + *last release*: Jun 06, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Jun 01, 2022, + *last release*: Jun 06, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Jun 01, 2022, + *last release*: Jun 06, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Jun 01, 2022, + *last release*: Jun 06, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Jun 01, 2022, + *last release*: Jun 06, 2022, *status*: N/A, *requires*: N/A @@ -3207,14 +3207,14 @@ This list contains 1062 plugins. pytest embedded plugin for esp-idf project by qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Jun 01, 2022, + *last release*: Jun 06, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Jun 01, 2022, + *last release*: Jun 06, 2022, *status*: N/A, *requires*: N/A @@ -3998,7 +3998,7 @@ This list contains 1062 plugins. Display "🔨 " instead of "." for passed pytest tests. :pypi:`pytest-harvest` - *last release*: Apr 01, 2021, + *last release*: Jun 10, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4068,7 +4068,7 @@ This list contains 1062 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jun 03, 2022, + *last release*: Jun 11, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4229,9 +4229,9 @@ This list contains 1062 plugins. help hypo module for pytest :pypi:`pytest-ibutsu` - *last release*: Jan 14, 2022, + *last release*: Jun 08, 2022, *status*: 4 - Beta, - *requires*: pytest + *requires*: N/A A plugin to sent pytest results to an Ibutsu server @@ -4271,7 +4271,7 @@ This list contains 1062 plugins. ignore failures from flaky tests (pytest plugin) :pypi:`pytest-image-diff` - *last release*: Mar 17, 2022, + *last release*: Jun 08, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -4334,7 +4334,7 @@ This list contains 1062 plugins. Inmanta tests package :pypi:`pytest-inmanta-lsm` - *last release*: May 18, 2022, + *last release*: Jun 08, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4607,9 +4607,9 @@ This list contains 1062 plugins. :pypi:`pytest-launchable` - *last release*: Jun 03, 2022, + *last release*: Jun 09, 2022, *status*: N/A, - *requires*: pytest + *requires*: pytest (>=4.2.0) Launchable Pytest Plugin @@ -5188,9 +5188,9 @@ This list contains 1062 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Jun 03, 2022, + *last release*: Jun 07, 2022, *status*: 4 - Beta, - *requires*: pytest + *requires*: pytest (>=6) low-startup-overhead, scalable, distributed-testing pytest plugin @@ -5727,11 +5727,11 @@ This list contains 1062 plugins. Pytest tool for persistent objects :pypi:`pytest-pg` - *last release*: Jan 18, 2022, + *last release*: Jun 07, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.0.0) - Helps to run PostgreSQL in docker as pytest fixture + A tiny plugin for pytest which runs PostgreSQL in Docker :pypi:`pytest-pgsql` *last release*: May 13, 2020, @@ -6245,7 +6245,7 @@ This list contains 1062 plugins. RabbitMQ process and client fixtures for pytest :pypi:`pytest-race` - *last release*: Nov 21, 2016, + *last release*: Jun 07, 2022, *status*: 4 - Beta, *requires*: N/A @@ -6434,7 +6434,7 @@ This list contains 1062 plugins. Pytest plugin for controlling remote data access. :pypi:`pytest-remote-response` - *last release*: Jun 30, 2021, + *last release*: Jun 05, 2022, *status*: 4 - Beta, *requires*: pytest (>=4.6) @@ -6819,7 +6819,7 @@ This list contains 1062 plugins. :pypi:`pytest-sbase` - *last release*: Jun 03, 2022, + *last release*: Jun 08, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6861,7 +6861,7 @@ This list contains 1062 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Jun 03, 2022, + *last release*: Jun 08, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7218,9 +7218,9 @@ This list contains 1062 plugins. Splinter plugin for pytest testing framework :pypi:`pytest-splinter4` - *last release*: Dec 22, 2021, + *last release*: Jun 11, 2022, *status*: 6 - Mature, - *requires*: pytest (>=6.2.4) + *requires*: pytest (<8.0,>=7.1.2) Pytest plugin for the splinter automation library @@ -8100,9 +8100,9 @@ This list contains 1062 plugins. Test equality of unordered collections in pytest :pypi:`pytest-unstable` - *last release*: Apr 12, 2022, + *last release*: Jun 10, 2022, *status*: 4 - Beta, - *requires*: pytest (>=3.5.0) + *requires*: N/A Set a test as unstable to return 0 even if it failed @@ -8142,7 +8142,7 @@ This list contains 1062 plugins. pytest plugin for providing variables to tests/fixtures :pypi:`pytest-variant` - *last release*: Jun 20, 2021, + *last release*: Jun 06, 2022, *status*: N/A, *requires*: N/A @@ -8156,8 +8156,8 @@ This list contains 1062 plugins. Plugin for managing VCR.py cassettes :pypi:`pytest-vcr-delete-on-fail` - *last release*: Apr 21, 2022, - *status*: 4 - Beta, + *last release*: Jun 06, 2022, + *status*: 5 - Production/Stable, *requires*: pytest (>=6.2.2,<7.0.0) A pytest plugin that automates vcrpy cassettes deletion on test failure. From 96412d19abb244325a72f16974646cc5afb7d2b1 Mon Sep 17 00:00:00 2001 From: Zach OBrien Date: Tue, 14 Jun 2022 05:54:32 -0400 Subject: [PATCH 268/549] Fix representation of tuples in approx Closes #9917 --- AUTHORS | 1 + changelog/9917.bugfix.rst | 1 + src/_pytest/python_api.py | 20 +++++++++++-------- testing/python/approx.py | 42 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 changelog/9917.bugfix.rst diff --git a/AUTHORS b/AUTHORS index 61c3901beaa..6a88d2bbb71 100644 --- a/AUTHORS +++ b/AUTHORS @@ -361,5 +361,6 @@ Yoav Caspi Yuval Shimon Zac Hatfield-Dodds Zachary Kneupper +Zachary OBrien Zoltán Máté Zsolt Cserna diff --git a/changelog/9917.bugfix.rst b/changelog/9917.bugfix.rst new file mode 100644 index 00000000000..ac0616d2ee7 --- /dev/null +++ b/changelog/9917.bugfix.rst @@ -0,0 +1 @@ +Fixed string representation for :func:`pytest.approx` when used to compare tuples. diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index ba3b48783ce..426b93ac2d4 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -133,9 +133,11 @@ def _check_type(self) -> None: # raise if there are any non-numeric elements in the sequence. -def _recursive_list_map(f, x): - if isinstance(x, list): - return [_recursive_list_map(f, xi) for xi in x] +def _recursive_sequence_map(f, x): + """Recursively map a function over a sequence of arbitary depth""" + if isinstance(x, (list, tuple)): + seq_type = type(x) + return seq_type(_recursive_sequence_map(f, xi) for xi in x) else: return f(x) @@ -144,7 +146,9 @@ class ApproxNumpy(ApproxBase): """Perform approximate comparisons where the expected value is numpy array.""" def __repr__(self) -> str: - list_scalars = _recursive_list_map(self._approx_scalar, self.expected.tolist()) + list_scalars = _recursive_sequence_map( + self._approx_scalar, self.expected.tolist() + ) return f"approx({list_scalars!r})" def _repr_compare(self, other_side: "ndarray") -> List[str]: @@ -164,7 +168,7 @@ def get_value_from_nested_list( return value np_array_shape = self.expected.shape - approx_side_as_list = _recursive_list_map( + approx_side_as_seq = _recursive_sequence_map( self._approx_scalar, self.expected.tolist() ) @@ -179,7 +183,7 @@ def get_value_from_nested_list( max_rel_diff = -math.inf different_ids = [] for index in itertools.product(*(range(i) for i in np_array_shape)): - approx_value = get_value_from_nested_list(approx_side_as_list, index) + approx_value = get_value_from_nested_list(approx_side_as_seq, index) other_value = get_value_from_nested_list(other_side, index) if approx_value != other_value: abs_diff = abs(approx_value.expected - other_value) @@ -194,7 +198,7 @@ def get_value_from_nested_list( ( str(index), str(get_value_from_nested_list(other_side, index)), - str(get_value_from_nested_list(approx_side_as_list, index)), + str(get_value_from_nested_list(approx_side_as_seq, index)), ) for index in different_ids ] @@ -326,7 +330,7 @@ def _repr_compare(self, other_side: Sequence[float]) -> List[str]: f"Lengths: {len(self.expected)} and {len(other_side)}", ] - approx_side_as_map = _recursive_list_map(self._approx_scalar, self.expected) + approx_side_as_map = _recursive_sequence_map(self._approx_scalar, self.expected) number_of_elements = len(approx_side_as_map) max_abs_diff = -math.inf diff --git a/testing/python/approx.py b/testing/python/approx.py index 7b4fbad156e..6acb466ffb1 100644 --- a/testing/python/approx.py +++ b/testing/python/approx.py @@ -2,12 +2,14 @@ from contextlib import contextmanager from decimal import Decimal from fractions import Fraction +from math import sqrt from operator import eq from operator import ne from typing import Optional import pytest from _pytest.pytester import Pytester +from _pytest.python_api import _recursive_sequence_map from pytest import approx inf, nan = float("inf"), float("nan") @@ -133,6 +135,18 @@ def test_error_messages_native_dtypes(self, assert_approx_raises_regex): ], ) + assert_approx_raises_regex( + (1, 2.2, 4), + (1, 3.2, 4), + [ + r" comparison failed. Mismatched elements: 1 / 3:", + rf" Max absolute difference: {SOME_FLOAT}", + rf" Max relative difference: {SOME_FLOAT}", + r" Index \| Obtained\s+\| Expected ", + rf" 1 \| {SOME_FLOAT} \| {SOME_FLOAT} ± {SOME_FLOAT}", + ], + ) + # Specific test for comparison with 0.0 (relative diff will be 'inf') assert_approx_raises_regex( [0.0], @@ -878,3 +892,31 @@ def test_allow_ordered_sequences_only(self) -> None: """pytest.approx() should raise an error on unordered sequences (#9692).""" with pytest.raises(TypeError, match="only supports ordered sequences"): assert {1, 2, 3} == approx({1, 2, 3}) + + +class TestRecursiveSequenceMap: + def test_map_over_scalar(self): + assert _recursive_sequence_map(sqrt, 16) == 4 + + def test_map_over_empty_list(self): + assert _recursive_sequence_map(sqrt, []) == [] + + def test_map_over_list(self): + assert _recursive_sequence_map(sqrt, [4, 16, 25, 676]) == [2, 4, 5, 26] + + def test_map_over_tuple(self): + assert _recursive_sequence_map(sqrt, (4, 16, 25, 676)) == (2, 4, 5, 26) + + def test_map_over_nested_lists(self): + assert _recursive_sequence_map(sqrt, [4, [25, 64], [[49]]]) == [ + 2, + [5, 8], + [[7]], + ] + + def test_map_over_mixed_sequence(self): + assert _recursive_sequence_map(sqrt, [4, (25, 64), [(49)]]) == [ + 2, + (5, 8), + [(7)], + ] From d6b837e2d31310d61be46ea954ff74f94be69e55 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 14 Jun 2022 07:01:34 -0300 Subject: [PATCH 269/549] Mark pdb+expect tests as xfail for now Related to #10042 --- testing/test_debugging.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/testing/test_debugging.py b/testing/test_debugging.py index a95b542adec..9298726a561 100644 --- a/testing/test_debugging.py +++ b/testing/test_debugging.py @@ -353,6 +353,7 @@ def test_pdb_prevent_ConftestImportFailure_hiding_exception( result = pytester.runpytest_subprocess("--pdb", ".") result.stdout.fnmatch_lines(["-> import unknown"]) + @pytest.mark.xfail(reason="#10042") def test_pdb_interaction_capturing_simple(self, pytester: Pytester) -> None: p1 = pytester.makepyfile( """ @@ -521,6 +522,7 @@ def function_1(): assert "BdbQuit" not in rest assert "UNEXPECTED EXCEPTION" not in rest + @pytest.mark.xfail(reason="#10042") def test_pdb_interaction_capturing_twice(self, pytester: Pytester) -> None: p1 = pytester.makepyfile( """ @@ -556,6 +558,7 @@ def test_1(): assert "1 failed" in rest self.flush(child) + @pytest.mark.xfail(reason="#10042") def test_pdb_with_injected_do_debug(self, pytester: Pytester) -> None: """Simulates pdbpp, which injects Pdb into do_debug, and uses self.__class__ in do_continue. @@ -1000,6 +1003,7 @@ def test_1(): assert "reading from stdin while output" not in rest TestPDB.flush(child) + @pytest.mark.xfail(reason="#10042") def test_pdb_not_altered(self, pytester: Pytester) -> None: p1 = pytester.makepyfile( """ @@ -1159,6 +1163,7 @@ def test_2(): @pytest.mark.parametrize("fixture", ("capfd", "capsys")) +@pytest.mark.xfail(reason="#10042") def test_pdb_suspends_fixture_capturing(pytester: Pytester, fixture: str) -> None: """Using "-s" with pytest should suspend/resume fixture capturing.""" p1 = pytester.makepyfile( From fab696dcd1ecd621ed05d2552b7d790ab143efe5 Mon Sep 17 00:00:00 2001 From: Chris Wheeler Date: Tue, 14 Jun 2022 07:24:35 -0400 Subject: [PATCH 270/549] Add support for .pytest.ini as an alternative to pytest.ini Closes #9987 --- AUTHORS | 1 + changelog/9987.improvement.rst | 1 + doc/en/reference/customize.rst | 4 +++- doc/en/reference/reference.rst | 7 ++++--- src/_pytest/config/findpaths.py | 1 + testing/test_config.py | 11 ++++++++--- 6 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 changelog/9987.improvement.rst diff --git a/AUTHORS b/AUTHORS index 6a88d2bbb71..d1f1b5503f2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -67,6 +67,7 @@ Cheuk Ting Ho Chris Lamb Chris NeJame Chris Rose +Chris Wheeler Christian Boelsen Christian Fetzer Christian Neumüller diff --git a/changelog/9987.improvement.rst b/changelog/9987.improvement.rst new file mode 100644 index 00000000000..cb1ae17ad2c --- /dev/null +++ b/changelog/9987.improvement.rst @@ -0,0 +1 @@ +Added support for hidden configuration file by allowing ``.pytest.ini`` as an alternative to ``pytest.ini``. diff --git a/doc/en/reference/customize.rst b/doc/en/reference/customize.rst index fe10ca066b2..b6d21445a7e 100644 --- a/doc/en/reference/customize.rst +++ b/doc/en/reference/customize.rst @@ -29,9 +29,11 @@ pytest.ini ``pytest.ini`` files take precedence over other files, even when empty. +Alternatively, the hidden version ``.pytest.ini`` can be used. + .. code-block:: ini - # pytest.ini + # pytest.ini or .pytest.ini [pytest] minversion = 6.0 addopts = -ra -q diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 6402e0af64f..4ea391be2a8 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1154,9 +1154,10 @@ Consult the :ref:`internal-warnings` section in the documentation for more infor Configuration Options --------------------- -Here is a list of builtin configuration options that may be written in a ``pytest.ini``, ``pyproject.toml``, ``tox.ini`` or ``setup.cfg`` -file, usually located at the root of your repository. To see each file format in details, see -:ref:`config file formats`. +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. + +To see each file format in details, see :ref:`config file formats`. .. warning:: Usage of ``setup.cfg`` is not recommended except for very simple use cases. ``.cfg`` diff --git a/src/_pytest/config/findpaths.py b/src/_pytest/config/findpaths.py index ead344baac5..43c2367793e 100644 --- a/src/_pytest/config/findpaths.py +++ b/src/_pytest/config/findpaths.py @@ -96,6 +96,7 @@ def locate_config( and return a tuple of (rootdir, inifile, cfg-dict).""" config_names = [ "pytest.ini", + ".pytest.ini", "pyproject.toml", "tox.ini", "setup.cfg", diff --git a/testing/test_config.py b/testing/test_config.py index ac0c159a833..c2e3fe5bbcf 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -112,21 +112,26 @@ def test_tox_ini_wrong_version(self, pytester: Pytester) -> None: @pytest.mark.parametrize( "section, name", - [("tool:pytest", "setup.cfg"), ("pytest", "tox.ini"), ("pytest", "pytest.ini")], + [ + ("tool:pytest", "setup.cfg"), + ("pytest", "tox.ini"), + ("pytest", "pytest.ini"), + ("pytest", ".pytest.ini"), + ], ) def test_ini_names(self, pytester: Pytester, name, section) -> None: pytester.path.joinpath(name).write_text( textwrap.dedent( """ [{section}] - minversion = 1.0 + minversion = 3.36 """.format( section=section ) ) ) config = pytester.parseconfig() - assert config.getini("minversion") == "1.0" + assert config.getini("minversion") == "3.36" def test_pyproject_toml(self, pytester: Pytester) -> None: pytester.makepyprojecttoml( From 17c385180d7fdb160e79ca619545344ba40012ed Mon Sep 17 00:00:00 2001 From: James Gerity Date: Thu, 16 Jun 2022 11:39:41 -0400 Subject: [PATCH 271/549] Indicate support for a tuple of exceptions in xfail raises= --- doc/en/reference/reference.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 4ea391be2a8..4ce8ead7173 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -245,7 +245,7 @@ Marks a test function as *expected to fail*. :keyword str reason: Reason why the test function is marked as xfail. :keyword Type[Exception] raises: - Exception subclass expected to be raised by the test function; other exceptions will fail the test. + Exception subclass (or tuple of subclasses) expected to be raised by the test function; other exceptions will fail the test. :keyword bool run: If 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). From 5a9536cf42a9f570de7e43285bb3313c39240816 Mon Sep 17 00:00:00 2001 From: Paul Reece Date: Fri, 17 Jun 2022 11:52:18 -0400 Subject: [PATCH 272/549] Added Docstring description for the Path property of the FixtureRequest class. --- src/_pytest/fixtures.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index fc6539db0fd..32c3ec4b0bf 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -486,6 +486,7 @@ def module(self): @property def path(self) -> Path: + """Path where the test function was collected.""" if self.scope not in ("function", "class", "module", "package"): raise AttributeError(f"path not available in {self.scope}-scoped context") # TODO: Remove ignore once _pyfuncitem is properly typed. From cdc287d21aab827d3a11981ecf26745b777e9dfe Mon Sep 17 00:00:00 2001 From: Paul Reece Date: Fri, 17 Jun 2022 12:00:18 -0400 Subject: [PATCH 273/549] Added self to Authors --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index d1f1b5503f2..939c671dcdf 100644 --- a/AUTHORS +++ b/AUTHORS @@ -261,6 +261,7 @@ Oscar Benjamin Parth Patel Patrick Hayes Paul Müller +Paul Reece Pauli Virtanen Pavel Karateev Paweł Adamczak From 052da7128b57b9192a350f85dbbd1666555be10d Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 21 Jun 2022 22:53:28 +0300 Subject: [PATCH 274/549] Replace deprecated logging.warn with .warning --- testing/test_debugging.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/test_debugging.py b/testing/test_debugging.py index 9298726a561..08ae09658ac 100644 --- a/testing/test_debugging.py +++ b/testing/test_debugging.py @@ -244,7 +244,7 @@ def test_pdb_print_captured_logs(self, pytester, showcapture: str) -> None: """ def test_1(): import logging - logging.warn("get " + "rekt") + logging.warning("get " + "rekt") assert False """ ) @@ -263,7 +263,7 @@ def test_pdb_print_captured_logs_nologging(self, pytester: Pytester) -> None: """ def test_1(): import logging - logging.warn("get " + "rekt") + logging.warning("get " + "rekt") assert False """ ) From 1e6a587363f03de2644dcb4fa2ce2f5220c6fc2e Mon Sep 17 00:00:00 2001 From: Chanvin Xiao Date: Wed, 22 Jun 2022 20:06:37 +0800 Subject: [PATCH 275/549] Doc: Clear mailbox before deleting the user --- doc/en/how-to/fixtures.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index 14bf12cf982..b90b40619f5 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -631,6 +631,7 @@ Here's what that might look like: def receiving_user(mail_admin): user = mail_admin.create_user() yield user + user.clear_mailbox() mail_admin.delete_user(user) From 6db715c205f0964eaaf3d452bf5fda35505fd73c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 12:16:23 +0000 Subject: [PATCH 276/549] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/en/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/en/conf.py b/doc/en/conf.py index 0022363b27e..3c26b8ce0b7 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -320,7 +320,9 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [("how-to/usage", "pytest", "pytest usage", ["holger krekel at merlinux eu"], 1)] +man_pages = [ + ("how-to/usage", "pytest", "pytest usage", ["holger krekel at merlinux eu"], 1) +] # -- Options for Epub output --------------------------------------------------- From 74691346bdf89c6588cf3a2c10505fce30ccd366 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 22 Jun 2022 08:29:02 -0700 Subject: [PATCH 277/549] fix some typos to ensure pre-commit.ci fixes main --- src/_pytest/config/argparsing.py | 2 +- src/_pytest/python_api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index fa27aa6203b..830bbd2e2cd 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -227,7 +227,7 @@ class Argument: _typ_map = {"int": int, "string": str, "float": float, "complex": complex} def __init__(self, *names: str, **attrs: Any) -> None: - """Store parms in private vars for use in add_argument.""" + """Store params in private vars for use in add_argument.""" self._attrs = attrs self._short_opts: List[str] = [] self._long_opts: List[str] = [] diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 426b93ac2d4..10762ee7b98 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -134,7 +134,7 @@ def _check_type(self) -> None: def _recursive_sequence_map(f, x): - """Recursively map a function over a sequence of arbitary depth""" + """Recursively map a function over a sequence of arbitrary depth""" if isinstance(x, (list, tuple)): seq_type = type(x) return seq_type(_recursive_sequence_map(f, xi) for xi in x) From cba65e74b34c0b31c0538acad86e29b78899aa29 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 15:32:04 +0000 Subject: [PATCH 278/549] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/en/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/en/conf.py b/doc/en/conf.py index 0022363b27e..3c26b8ce0b7 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -320,7 +320,9 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [("how-to/usage", "pytest", "pytest usage", ["holger krekel at merlinux eu"], 1)] +man_pages = [ + ("how-to/usage", "pytest", "pytest usage", ["holger krekel at merlinux eu"], 1) +] # -- Options for Epub output --------------------------------------------------- From 0a7b8722e58fcebb5fdeb7b811c679cbae29dd92 Mon Sep 17 00:00:00 2001 From: Kevin C Date: Thu, 23 Jun 2022 17:54:51 -0700 Subject: [PATCH 279/549] Clarify writing_plugins naming instructions Fixes: #10072 --- AUTHORS | 1 + doc/en/how-to/writing_plugins.rst | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index d1f1b5503f2..9144f43be39 100644 --- a/AUTHORS +++ b/AUTHORS @@ -187,6 +187,7 @@ Katarzyna Jachim Katarzyna Król Katerina Koukiou Keri Volans +Kevin C Kevin Cox Kevin J. Foley Kian Eliasi diff --git a/doc/en/how-to/writing_plugins.rst b/doc/en/how-to/writing_plugins.rst index 3e43d3252b7..2fbf49718ce 100644 --- a/doc/en/how-to/writing_plugins.rst +++ b/doc/en/how-to/writing_plugins.rst @@ -158,18 +158,20 @@ it in your setuptools-invocation: # sample ./setup.py file from setuptools import setup + + name_of_plugin = "myproject" # register plugin with this name setup( name="myproject", packages=["myproject"], # the following makes a plugin available to pytest - entry_points={"pytest11": ["name_of_plugin = myproject.pluginmodule"]}, + entry_points={"pytest11": [f"{name_of_plugin} = myproject.pluginmodule"]}, # custom PyPI classifier for pytest plugins classifiers=["Framework :: Pytest"], ) If a package is installed this way, ``pytest`` will load ``myproject.pluginmodule`` as a plugin which can define -:ref:`hooks `. +:ref:`hooks `. Confirm registration with ``pytest --trace-config`` .. note:: From c7e784f95d6ff7dc1e9d1a1dbc234a39c0125816 Mon Sep 17 00:00:00 2001 From: "zx.qiu" Date: Wed, 15 Jun 2022 23:11:55 +0800 Subject: [PATCH 280/549] Fix stage caplog records not clear Closes #9877 --- AUTHORS | 1 + changelog/9877.bugfix.rst | 1 + src/_pytest/logging.py | 12 ++++++++++++ testing/logging/test_fixture.py | 13 +++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 changelog/9877.bugfix.rst diff --git a/AUTHORS b/AUTHORS index d1f1b5503f2..7d27f5adadf 100644 --- a/AUTHORS +++ b/AUTHORS @@ -363,5 +363,6 @@ Yuval Shimon Zac Hatfield-Dodds Zachary Kneupper Zachary OBrien +Zhouxin Qiu Zoltán Máté Zsolt Cserna diff --git a/changelog/9877.bugfix.rst b/changelog/9877.bugfix.rst new file mode 100644 index 00000000000..ace3a4385a4 --- /dev/null +++ b/changelog/9877.bugfix.rst @@ -0,0 +1 @@ +Fixed ``caplog.get_records(when)`` still get the stage records after ``caplog.clear()`` diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index a4f4214b137..96709ae93cf 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -335,6 +335,16 @@ def __init__(self) -> None: """Create a new log handler.""" super().__init__(StringIO()) self.records: List[logging.LogRecord] = [] + self.set_when(None) + + def set_when(self, when: Optional[str]) -> None: + """Prepare for the given test phase (setup/call/teardown).""" + self._when = when + + def get_when(self) -> Optional[str]: + return self._when + + when = property(get_when, set_when) def emit(self, record: logging.LogRecord) -> None: """Keep the log records in a list in addition to the log text.""" @@ -441,6 +451,7 @@ def messages(self) -> List[str]: def clear(self) -> None: """Reset the list of log records and the captured log text.""" self.handler.reset() + self._item.stash[caplog_records_key][self.handler.when] = self.records def set_level(self, level: Union[int, str], logger: Optional[str] = None) -> None: """Set the level of a logger for the duration of a test. @@ -695,6 +706,7 @@ def _runtest_for(self, item: nodes.Item, when: str) -> Generator[None, None, Non level=self.log_level, ) as report_handler: caplog_handler.reset() + caplog_handler.set_when(when) report_handler.reset() item.stash[caplog_records_key][when] = caplog_handler.records item.stash[caplog_handler_key] = caplog_handler diff --git a/testing/logging/test_fixture.py b/testing/logging/test_fixture.py index bcb20de5805..6b85ce60a63 100644 --- a/testing/logging/test_fixture.py +++ b/testing/logging/test_fixture.py @@ -172,6 +172,19 @@ def test_caplog_captures_for_all_stages(caplog, logging_during_setup_and_teardow assert set(caplog._item.stash[caplog_records_key]) == {"setup", "call"} +def test_clear_for_call_stage(caplog, logging_during_setup_and_teardown): + logger.info("a_call_log") + assert [x.message for x in caplog.get_records("call")] == ["a_call_log"] + assert [x.message for x in caplog.get_records("setup")] == ["a_setup_log"] + assert set(caplog._item.stash[caplog_records_key]) == {"setup", "call"} + + caplog.clear() + + assert caplog.get_records("call") == [] + assert [x.message for x in caplog.get_records("setup")] == ["a_setup_log"] + assert set(caplog._item.stash[caplog_records_key]) == {"setup", "call"} + + def test_ini_controls_global_log_level(pytester: Pytester) -> None: pytester.makepyfile( """ From f29f79e39f698d33ec773b24a06b38c38ee0cdaa Mon Sep 17 00:00:00 2001 From: "zx.qiu" Date: Fri, 24 Jun 2022 19:17:55 +0800 Subject: [PATCH 281/549] Use records.clear() in LogCaptureHandler when caplog.clear() --- src/_pytest/logging.py | 19 +++++-------------- testing/logging/test_fixture.py | 5 +++++ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index 96709ae93cf..2eb69fdbfb4 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -40,7 +40,6 @@ else: logging_StreamHandler = logging.StreamHandler - DEFAULT_LOG_FORMAT = "%(levelname)-8s %(name)s:%(filename)s:%(lineno)d %(message)s" DEFAULT_LOG_DATE_FORMAT = "%H:%M:%S" _ANSI_ESCAPE_SEQ = re.compile(r"\x1b\[[\d;]+m") @@ -335,16 +334,6 @@ def __init__(self) -> None: """Create a new log handler.""" super().__init__(StringIO()) self.records: List[logging.LogRecord] = [] - self.set_when(None) - - def set_when(self, when: Optional[str]) -> None: - """Prepare for the given test phase (setup/call/teardown).""" - self._when = when - - def get_when(self) -> Optional[str]: - return self._when - - when = property(get_when, set_when) def emit(self, record: logging.LogRecord) -> None: """Keep the log records in a list in addition to the log text.""" @@ -355,6 +344,10 @@ def reset(self) -> None: self.records = [] self.stream = StringIO() + def clear(self) -> None: + self.records.clear() + self.stream = StringIO() + def handleError(self, record: logging.LogRecord) -> None: if logging.raiseExceptions: # Fail the test if the log message is bad (emit failed). @@ -450,8 +443,7 @@ def messages(self) -> List[str]: def clear(self) -> None: """Reset the list of log records and the captured log text.""" - self.handler.reset() - self._item.stash[caplog_records_key][self.handler.when] = self.records + self.handler.clear() def set_level(self, level: Union[int, str], logger: Optional[str] = None) -> None: """Set the level of a logger for the duration of a test. @@ -706,7 +698,6 @@ def _runtest_for(self, item: nodes.Item, when: str) -> Generator[None, None, Non level=self.log_level, ) as report_handler: caplog_handler.reset() - caplog_handler.set_when(when) report_handler.reset() item.stash[caplog_records_key][when] = caplog_handler.records item.stash[caplog_handler_key] = caplog_handler diff --git a/testing/logging/test_fixture.py b/testing/logging/test_fixture.py index 6b85ce60a63..e9e73d05f98 100644 --- a/testing/logging/test_fixture.py +++ b/testing/logging/test_fixture.py @@ -184,6 +184,11 @@ def test_clear_for_call_stage(caplog, logging_during_setup_and_teardown): assert [x.message for x in caplog.get_records("setup")] == ["a_setup_log"] assert set(caplog._item.stash[caplog_records_key]) == {"setup", "call"} + logging.info("a_call_log_after_clear") + assert [x.message for x in caplog.get_records("call")] == ["a_call_log_after_clear"] + assert [x.message for x in caplog.get_records("setup")] == ["a_setup_log"] + assert set(caplog._item.stash[caplog_records_key]) == {"setup", "call"} + def test_ini_controls_global_log_level(pytester: Pytester) -> None: pytester.makepyfile( From 62d975a69ee06bc4e94a5719145fe65a0c6c4bef Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 26 Jun 2022 00:25:07 +0000 Subject: [PATCH 282/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 200 ++++++++++++++++++++++--------- 1 file changed, 144 insertions(+), 56 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index d29f5ddcc44..a1bae76cef4 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1062 plugins. +This list contains 1073 plugins. .. only:: not latex @@ -44,7 +44,7 @@ This list contains 1062 plugins. :pypi:`pytest-allure-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-android` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Feb 21, 2019 3 - Alpha pytest - :pypi:`pytest-anki` A pytest plugin for testing Anki add-ons Oct 14, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-anki` A pytest plugin for testing Anki add-ons Jun 20, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-annotate` pytest-annotate: Generate PyAnnotate annotations from your pytest tests. Jun 07, 2022 3 - Alpha pytest (<8.0.0,>=3.2.0) :pypi:`pytest-ansible` Plugin for py.test to simplify calling ansible modules from tests or fixtures May 25, 2021 5 - Production/Stable N/A :pypi:`pytest-ansible-playbook` Pytest fixture which runs given ansible playbook file. Mar 08, 2019 4 - Beta N/A @@ -90,7 +90,7 @@ This list contains 1062 plugins. :pypi:`pytest-aws` pytest plugin for testing AWS resource configurations Oct 04, 2017 4 - Beta N/A :pypi:`pytest-aws-config` Protect your AWS credentials in unit tests May 28, 2021 N/A N/A :pypi:`pytest-axe` pytest plugin for axe-selenium-python Nov 12, 2018 N/A pytest (>=3.0.0) - :pypi:`pytest-azure-devops` Simplifies using azure devops parallel strategy (https://docs.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner) with pytest. Jun 02, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-azure-devops` Simplifies using azure devops parallel strategy (https://docs.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner) with pytest. Jun 20, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Mar 16, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) @@ -109,7 +109,7 @@ This list contains 1062 plugins. :pypi:`pytest-black` A pytest plugin to enable format checking with black Oct 05, 2020 4 - Beta N/A :pypi:`pytest-black-multipy` Allow '--black' on older Pythons Jan 14, 2021 5 - Production/Stable pytest (!=3.7.3,>=3.5) ; extra == 'testing' :pypi:`pytest-blame` A pytest plugin helps developers to debug by providing useful commits history. May 04, 2019 N/A pytest (>=4.4.0) - :pypi:`pytest-blender` Blender Pytest plugin. May 30, 2022 N/A pytest ; extra == 'dev' + :pypi:`pytest-blender` Blender Pytest plugin. Jun 16, 2022 N/A pytest ; extra == 'dev' :pypi:`pytest-blink1` Pytest plugin to emit notifications via the Blink(1) RGB LED Jan 07, 2018 4 - Beta N/A :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A @@ -156,6 +156,7 @@ This list contains 1062 plugins. :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest :pypi:`pytest-circleci` py.test plugin for CircleCI May 03, 2019 N/A N/A :pypi:`pytest-circleci-parallelized` Parallelize pytest across CircleCI workers. Mar 26, 2019 N/A N/A + :pypi:`pytest-circleci-parallelized-rjp` Parallelize pytest across CircleCI workers. Jun 21, 2022 N/A pytest :pypi:`pytest-ckan` Backport of CKAN 2.9 pytest plugin and fixtures to CAKN 2.8 Apr 28, 2020 4 - Beta pytest :pypi:`pytest-clarity` A plugin providing an alternative, colourful diff output for failing assertions. Jun 11, 2021 N/A N/A :pypi:`pytest-cldf` Easy quality control for CLDF datasets using pytest May 06, 2019 N/A N/A @@ -164,6 +165,7 @@ This list contains 1062 plugins. :pypi:`pytest-cloud` Distributed tests planner plugin for pytest testing framework. Oct 05, 2020 6 - Mature N/A :pypi:`pytest-cloudflare-worker` pytest plugin for testing cloudflare workers Mar 30, 2021 4 - Beta pytest (>=6.0.0) :pypi:`pytest-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) + :pypi:`pytest-codecarbon` Pytest plugin for measuring carbon emissions Jun 15, 2022 N/A pytest :pypi:`pytest-codecheckers` pytest plugin to add source code sanity checks (pep8 and friends) Feb 13, 2010 N/A N/A :pypi:`pytest-codecov` Pytest plugin for uploading pytest-cov results to codecov.io Apr 12, 2022 4 - Beta pytest (>=4.6.0) :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A @@ -205,7 +207,7 @@ This list contains 1062 plugins. :pypi:`pytest-custom-report` Configure the symbols displayed for test outcomes Jan 30, 2019 N/A pytest :pypi:`pytest-custom-scheduling` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 01, 2021 N/A N/A :pypi:`pytest-cython` A plugin for testing Cython extension modules Mar 26, 2022 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-cython-collect` May 04, 2022 N/A pytest + :pypi:`pytest-cython-collect` Jun 17, 2022 N/A pytest :pypi:`pytest-darker` A pytest plugin for checking of modified code using Darker Aug 16, 2020 N/A pytest (>=6.0.1) ; extra == 'test' :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A @@ -220,6 +222,7 @@ This list contains 1062 plugins. :pypi:`pytest-data-from-files` pytest plugin to provide data from files loaded automatically Oct 13, 2021 4 - Beta pytest :pypi:`pytest-dataplugin` A pytest plugin for managing an archive of test data. Sep 16, 2017 1 - Planning N/A :pypi:`pytest-datarecorder` A py.test plugin recording and comparing test output. Apr 20, 2020 5 - Production/Stable pytest + :pypi:`pytest-data-suites` Class-based pytest parametrization Jun 18, 2022 N/A pytest (>=6.0,<8.0) :pypi:`pytest-datatest` A pytest plugin for test driven data-wrangling (this is the development version of datatest's pytest integration). Oct 15, 2020 4 - Beta pytest (>=3.3) :pypi:`pytest-db` Session scope fixture "db" for mysql query or change Dec 04, 2019 N/A N/A :pypi:`pytest-dbfixtures` Databases fixtures plugin for py.test. Dec 07, 2016 4 - Beta N/A @@ -323,9 +326,10 @@ This list contains 1062 plugins. :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jun 06, 2022 N/A N/A :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jun 06, 2022 N/A N/A + :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jun 24, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) - :pypi:`pytest-enabler` Enable installed pytest plugins Nov 08, 2021 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-enabler` Enable installed pytest plugins Jun 22, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-encode` set your encoding and logger Nov 06, 2021 N/A N/A :pypi:`pytest-encode-kane` set your encoding and logger Nov 16, 2021 N/A pytest :pypi:`pytest-enhancements` Improvements for pytest (rejected upstream) Oct 30, 2019 4 - Beta N/A @@ -356,7 +360,7 @@ This list contains 1062 plugins. :pypi:`pytest-extra-durations` A pytest plugin to get durations on a per-function basis and per module basis. Apr 21, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-fabric` Provides test utilities to run fabric task tests by using docker containers Sep 12, 2018 5 - Production/Stable N/A :pypi:`pytest-factory` Use factories for test setup with py.test Sep 06, 2020 3 - Alpha pytest (>4.3) - :pypi:`pytest-factoryboy` Factory Boy support for pytest. May 31, 2022 6 - Mature pytest (>=5.0.0) + :pypi:`pytest-factoryboy` Factory Boy support for pytest. Jun 14, 2022 6 - Mature pytest (>=5.0.0) :pypi:`pytest-factoryboy-fixtures` Generates pytest fixtures that allow the use of type hinting Jun 25, 2020 N/A N/A :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-failed-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A @@ -444,7 +448,7 @@ This list contains 1062 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 11, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 23, 2022 3 - Alpha pytest (==7.1.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -467,7 +471,7 @@ This list contains 1062 plugins. :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A - :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jun 08, 2022 4 - Beta N/A + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jun 24, 2022 4 - Beta N/A :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A :pypi:`pytest-idem` A pytest plugin to help with testing idem projects May 04, 2022 5 - Production/Stable N/A @@ -483,7 +487,7 @@ This list contains 1062 plugins. :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. May 18, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jun 08, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules May 10, 2022 4 - Beta N/A + :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Jun 16, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) @@ -521,7 +525,7 @@ This list contains 1062 plugins. :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. May 17, 2022 3 - Alpha pytest (>=3.6,<8) :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A - :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 09, 2022 N/A pytest (>=4.2.0) + :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 14, 2022 N/A pytest (>=4.2.0) :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A :pypi:`pytest-lazy-fixture` It helps to use fixtures in pytest.mark.parametrize Feb 01, 2020 4 - Beta pytest (>=3.2.5) :pypi:`pytest-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest @@ -581,13 +585,13 @@ This list contains 1062 plugins. :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ml` Test your machine learning! May 04, 2019 4 - Beta N/A :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) - :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Jan 28, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Jun 24, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-mock-api` A mock API server with configurable routes and responses available as a fixture. Feb 13, 2019 1 - Planning pytest (>=4.0.0) :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator May 16, 2022 5 - Production/Stable N/A :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Apr 11, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Jun 15, 2022 N/A pytest (>=1.0) :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A @@ -603,8 +607,8 @@ This list contains 1062 plugins. :pypi:`pytest-motor` A pytest plugin for motor, the non-blocking MongoDB driver. Jul 21, 2021 3 - Alpha pytest :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest - :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Apr 22, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jun 07, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jun 15, 2022 4 - Beta pytest + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jun 22, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A @@ -645,7 +649,7 @@ This list contains 1062 plugins. :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A :pypi:`pytest-oerp` pytest plugin to test OpenERP modules Feb 28, 2012 3 - Alpha N/A :pypi:`pytest-ok` The ultimate pytest output plugin Apr 01, 2019 4 - Beta N/A - :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jan 19, 2020 N/A N/A + :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jun 14, 2022 5 - Production/Stable pytest (<7.1); python_version <= "3.6" :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest @@ -678,7 +682,7 @@ This list contains 1062 plugins. :pypi:`pytest-pep257` py.test plugin for pep257 Jul 09, 2016 N/A N/A :pypi:`pytest-pep8` pytest plugin to check PEP8 requirements Apr 27, 2014 N/A N/A :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) - :pypi:`pytest-perf` pytest-perf Feb 05, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-perf` pytest-perf Jun 23, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) :pypi:`pytest-persistence` Pytest tool for persistent objects Apr 22, 2022 N/A N/A :pypi:`pytest-pg` A tiny plugin for pytest which runs PostgreSQL in Docker Jun 07, 2022 5 - Production/Stable pytest (>=6.0.0) @@ -750,7 +754,7 @@ This list contains 1062 plugins. :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Mar 17, 2022 5 - Production/Stable pytest (>=6.2.3) :pypi:`pytest-qml` Run QML Tests with pytest Dec 02, 2020 4 - Beta pytest (>=6.0.0) :pypi:`pytest-qr` pytest plugin to generate test result QR codes Nov 25, 2021 4 - Beta N/A - :pypi:`pytest-qt` pytest support for PyQt and PySide applications Jun 13, 2021 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-qt` pytest support for PyQt and PySide applications Jun 23, 2022 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-qt-app` QT app fixture for py.test Dec 23, 2015 5 - Production/Stable N/A :pypi:`pytest-quarantine` A plugin for pytest to manage expected test failures Nov 24, 2019 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-quickcheck` pytest plugin to generate random data inspired by QuickCheck Nov 15, 2020 4 - Beta pytest (<6.0.0,>=4.0) @@ -758,7 +762,7 @@ This list contains 1062 plugins. :pypi:`pytest-race` Race conditions tester for pytest Jun 07, 2022 4 - Beta N/A :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results May 02, 2022 N/A pytest (>=3.6) - :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Apr 12, 2022 5 - Production/Stable pytest + :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Jun 20, 2022 5 - Production/Stable pytest :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) :pypi:`pytest-raisesregexp` Simple pytest plugin to look for regex in Exceptions Dec 18, 2015 N/A N/A :pypi:`pytest-raisin` Plugin enabling the use of exception instances with pytest.raises Feb 06, 2022 N/A pytest @@ -769,13 +773,14 @@ This list contains 1062 plugins. :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-readme` Test your README.md file Dec 28, 2014 5 - Production/Stable N/A :pypi:`pytest-reana` Pytest fixtures for REANA. May 16, 2022 3 - Alpha N/A - :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jul 08, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jun 20, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-redislite` Pytest plugin for testing code using Redis Apr 05, 2022 4 - Beta pytest :pypi:`pytest-redmine` Pytest plugin for redmine Mar 19, 2018 1 - Planning N/A :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A + :pypi:`pytest-regex-dependency` Management of Pytest dependencies via regex patterns Jun 12, 2022 N/A pytest :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Jan 19, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-regtest` pytest plugin for regression tests Jun 03, 2021 N/A N/A :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A @@ -796,7 +801,7 @@ This list contains 1062 plugins. :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility Dec 11, 2020 3 - Alpha pytest (>=5.2) :pypi:`pytest-report-me` A pytest plugin to generate report. Dec 31, 2020 N/A pytest :pypi:`pytest-report-parameters` pytest plugin for adding tests' parameters to junit report Jun 18, 2020 3 - Alpha pytest (>=2.4.2) - :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Apr 26, 2022 N/A pytest (>=3.8.0) + :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Jun 24, 2022 N/A pytest (>=3.8.0) :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) @@ -831,25 +836,26 @@ This list contains 1062 plugins. :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). May 10, 2022 3 - Alpha N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A - :pypi:`pytest-salt-factories` Pytest Salt Plugin May 28, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Jun 17, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 08, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 24, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 08, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 24, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A + :pypi:`pytest-servers` pytest servers Jun 24, 2022 1 - Planning pytest (==7.1.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :pypi:`pytest-session2file` pytest-session2file (aka: pytest-session_to_file for v0.1.0 - v0.1.2) is a py.test plugin for capturing and saving to file the stdout of py.test. Jan 26, 2021 3 - Alpha pytest :pypi:`pytest-session-fixture-globalize` py.test plugin to make session fixtures behave as if written in conftest, even if it is written in some modules May 15, 2018 4 - Beta N/A @@ -891,6 +897,7 @@ This list contains 1062 plugins. :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. Feb 23, 2020 4 - Beta pytest :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. May 04, 2021 N/A N/A + :pypi:`pytest-spec2md` Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. Jun 19, 2022 N/A pytest (>7.0) :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Mar 30, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A @@ -940,18 +947,20 @@ This list contains 1062 plugins. :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-terra-fixt` Terraform fixtures for pytest May 26, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-terra-fixt` Terraform fixtures for pytest Jun 18, 2022 N/A pytest (==6.2.5) :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Jan 17, 2022 N/A pytest (>=6.0) :pypi:`pytest-terraform-fixture` generate terraform resources to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-testbook` A plugin to run tests written in Jupyter notebook Dec 11, 2016 3 - Alpha N/A :pypi:`pytest-testconfig` Test configuration plugin for pytest. Jan 11, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testdirectory` A py.test plugin providing temporary directories in unit tests. Feb 21, 2022 5 - Production/Stable pytest :pypi:`pytest-testdox` A testdox format reporter for pytest Apr 19, 2022 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-test-grouping` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Jun 17, 2022 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A - :pypi:`pytest-testinfra` Test infrastructures Apr 12, 2022 5 - Production/Stable pytest (!=3.0.2) + :pypi:`pytest-testinfra` Test infrastructures Jun 19, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) :pypi:`pytest-testmon` selects tests affected by changed files and methods Jun 01, 2022 4 - Beta N/A :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) + :pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Jun 13, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) @@ -997,6 +1006,7 @@ This list contains 1062 plugins. :pypi:`pytest-tornado5` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Nov 16, 2018 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-tornado-yen3` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Oct 15, 2018 5 - Production/Stable N/A :pypi:`pytest-tornasync` py.test plugin for testing Python 3.5+ Tornado code Jul 15, 2019 3 - Alpha pytest (>=3.0) + :pypi:`pytest-trace` Save OpenTelemetry spans generated during testing Jun 19, 2022 N/A pytest (>=4.6) :pypi:`pytest-track` Feb 26, 2021 3 - Alpha pytest (>=3.0) :pypi:`pytest-translations` Test your translation files. Nov 05, 2021 5 - Production/Stable N/A :pypi:`pytest-travis-fold` Folds captured output sections in Travis CI build log Nov 29, 2017 4 - Beta pytest (>=2.6.0) @@ -1016,6 +1026,7 @@ This list contains 1062 plugins. :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) :pypi:`pytest-ubersmith` Easily mock calls to ubersmith at the \`requests\` level. Apr 13, 2015 N/A N/A :pypi:`pytest-ui` Text User Interface for running python tests Jul 05, 2021 4 - Beta pytest + :pypi:`pytest-unflakable` Unflakable plugin for PyTest Jun 14, 2022 4 - Beta pytest (>=6.2.0) :pypi:`pytest-unhandled-exception-exit-code` Plugin for py.test set a different exit code on uncaught exceptions Jun 22, 2020 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) :pypi:`pytest-unmarked` Run only unmarked tests Aug 27, 2019 5 - Production/Stable N/A @@ -1028,7 +1039,7 @@ This list contains 1062 plugins. :pypi:`pytest-variables` pytest plugin for providing variables to tests/fixtures Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-variant` Variant support for Pytest Jun 06, 2022 N/A N/A :pypi:`pytest-vcr` Plugin for managing VCR.py cassettes Apr 26, 2019 5 - Production/Stable pytest (>=3.6.0) - :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Jun 06, 2022 5 - Production/Stable pytest (>=6.2.2,<7.0.0) + :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Jun 20, 2022 5 - Production/Stable pytest (>=6.2.2) :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest :pypi:`pytest-ver` Pytest module with Verification Report Apr 17, 2022 2 - Pre-Alpha N/A @@ -1268,7 +1279,7 @@ This list contains 1062 plugins. This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. :pypi:`pytest-anki` - *last release*: Oct 14, 2021, + *last release*: Jun 20, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) @@ -1590,7 +1601,7 @@ This list contains 1062 plugins. pytest plugin for axe-selenium-python :pypi:`pytest-azure-devops` - *last release*: Jun 02, 2022, + *last release*: Jun 20, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) @@ -1723,7 +1734,7 @@ This list contains 1062 plugins. A pytest plugin helps developers to debug by providing useful commits history. :pypi:`pytest-blender` - *last release*: May 30, 2022, + *last release*: Jun 16, 2022, *status*: N/A, *requires*: pytest ; extra == 'dev' @@ -2051,6 +2062,13 @@ This list contains 1062 plugins. Parallelize pytest across CircleCI workers. + :pypi:`pytest-circleci-parallelized-rjp` + *last release*: Jun 21, 2022, + *status*: N/A, + *requires*: pytest + + Parallelize pytest across CircleCI workers. + :pypi:`pytest-ckan` *last release*: Apr 28, 2020, *status*: 4 - Beta, @@ -2107,6 +2125,13 @@ This list contains 1062 plugins. PyTest plugin for testing Smart Contracts for Ethereum blockchain. + :pypi:`pytest-codecarbon` + *last release*: Jun 15, 2022, + *status*: N/A, + *requires*: pytest + + Pytest plugin for measuring carbon emissions + :pypi:`pytest-codecheckers` *last release*: Feb 13, 2010, *status*: N/A, @@ -2395,7 +2420,7 @@ This list contains 1062 plugins. A plugin for testing Cython extension modules :pypi:`pytest-cython-collect` - *last release*: May 04, 2022, + *last release*: Jun 17, 2022, *status*: N/A, *requires*: pytest @@ -2499,6 +2524,13 @@ This list contains 1062 plugins. A py.test plugin recording and comparing test output. + :pypi:`pytest-data-suites` + *last release*: Jun 18, 2022, + *status*: N/A, + *requires*: pytest (>=6.0,<8.0) + + Class-based pytest parametrization + :pypi:`pytest-datatest` *last release*: Oct 15, 2020, *status*: 4 - Beta, @@ -3220,6 +3252,13 @@ This list contains 1062 plugins. pytest embedded plugin for testing espressif boards via serial ports + :pypi:`pytest-embrace` + *last release*: Jun 24, 2022, + *status*: N/A, + *requires*: pytest (>=7.0,<8.0) + + 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. + :pypi:`pytest-emoji` *last release*: Feb 19, 2019, *status*: 4 - Beta, @@ -3235,7 +3274,7 @@ This list contains 1062 plugins. Pytest plugin to represent test output with emoji support :pypi:`pytest-enabler` - *last release*: Nov 08, 2021, + *last release*: Jun 22, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6) ; extra == 'testing' @@ -3452,7 +3491,7 @@ This list contains 1062 plugins. Use factories for test setup with py.test :pypi:`pytest-factoryboy` - *last release*: May 31, 2022, + *last release*: Jun 14, 2022, *status*: 6 - Mature, *requires*: pytest (>=5.0.0) @@ -4068,7 +4107,7 @@ This list contains 1062 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jun 11, 2022, + *last release*: Jun 23, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.1) @@ -4229,7 +4268,7 @@ This list contains 1062 plugins. help hypo module for pytest :pypi:`pytest-ibutsu` - *last release*: Jun 08, 2022, + *last release*: Jun 24, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4341,7 +4380,7 @@ This list contains 1062 plugins. Common fixtures for inmanta LSM related modules :pypi:`pytest-inmanta-yang` - *last release*: May 10, 2022, + *last release*: Jun 16, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4607,7 +4646,7 @@ This list contains 1062 plugins. :pypi:`pytest-launchable` - *last release*: Jun 09, 2022, + *last release*: Jun 14, 2022, *status*: N/A, *requires*: pytest (>=4.2.0) @@ -5027,7 +5066,7 @@ This list contains 1062 plugins. pytest plugin to display test execution output like a mochajs :pypi:`pytest-mock` - *last release*: Jan 28, 2022, + *last release*: Jun 24, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) @@ -5069,7 +5108,7 @@ This list contains 1062 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Apr 11, 2022, + *last release*: Jun 15, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -5181,14 +5220,14 @@ This list contains 1062 plugins. pytest plugin to collect information from tests :pypi:`pytest-mpl` - *last release*: Apr 22, 2022, + *last release*: Jun 15, 2022, *status*: 4 - Beta, *requires*: pytest pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Jun 07, 2022, + *last release*: Jun 22, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -5475,9 +5514,9 @@ This list contains 1062 plugins. The ultimate pytest output plugin :pypi:`pytest-only` - *last release*: Jan 19, 2020, - *status*: N/A, - *requires*: N/A + *last release*: Jun 14, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest (<7.1); python_version <= "3.6" Use @pytest.mark.only to run a single test @@ -5706,7 +5745,7 @@ This list contains 1062 plugins. Change the exit code of pytest test sessions when a required percent of tests pass. :pypi:`pytest-perf` - *last release*: Feb 05, 2022, + *last release*: Jun 23, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6) ; extra == 'testing' @@ -6210,7 +6249,7 @@ This list contains 1062 plugins. pytest plugin to generate test result QR codes :pypi:`pytest-qt` - *last release*: Jun 13, 2021, + *last release*: Jun 23, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=3.0.0) @@ -6266,7 +6305,7 @@ This list contains 1062 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-railflow-testrail-reporter` - *last release*: Apr 12, 2022, + *last release*: Jun 20, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6343,7 +6382,7 @@ This list contains 1062 plugins. Pytest fixtures for REANA. :pypi:`pytest-recording` - *last release*: Jul 08, 2021, + *last release*: Jun 20, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) @@ -6391,6 +6430,13 @@ This list contains 1062 plugins. Conveniently run pytest with a dot-formatted test reference. + :pypi:`pytest-regex-dependency` + *last release*: Jun 12, 2022, + *status*: N/A, + *requires*: pytest + + Management of Pytest dependencies via regex patterns + :pypi:`pytest-regressions` *last release*: Jan 19, 2022, *status*: 5 - Production/Stable, @@ -6532,7 +6578,7 @@ This list contains 1062 plugins. pytest plugin for adding tests' parameters to junit report :pypi:`pytest-reportportal` - *last release*: Apr 26, 2022, + *last release*: Jun 24, 2022, *status*: N/A, *requires*: pytest (>=3.8.0) @@ -6777,7 +6823,7 @@ This list contains 1062 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: May 28, 2022, + *last release*: Jun 17, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6819,7 +6865,7 @@ This list contains 1062 plugins. :pypi:`pytest-sbase` - *last release*: Jun 08, 2022, + *last release*: Jun 24, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6861,7 +6907,7 @@ This list contains 1062 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Jun 08, 2022, + *last release*: Jun 24, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6909,6 +6955,13 @@ This list contains 1062 plugins. Automatically mocks resources from serverless.yml in pytest using moto. + :pypi:`pytest-servers` + *last release*: Jun 24, 2022, + *status*: 1 - Planning, + *requires*: pytest (==7.1.2) + + pytest servers + :pypi:`pytest-services` *last release*: Oct 30, 2020, *status*: 6 - Mature, @@ -7196,6 +7249,13 @@ This list contains 1062 plugins. Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. + :pypi:`pytest-spec2md` + *last release*: Jun 19, 2022, + *status*: N/A, + *requires*: pytest (>7.0) + + Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. + :pypi:`pytest-sphinx` *last release*: Mar 30, 2022, *status*: 4 - Beta, @@ -7540,7 +7600,7 @@ This list contains 1062 plugins. Predictable and repeatable tempdir support. :pypi:`pytest-terra-fixt` - *last release*: May 26, 2022, + *last release*: Jun 18, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -7588,6 +7648,13 @@ This list contains 1062 plugins. A testdox format reporter for pytest + :pypi:`pytest-test-grouping` + *last release*: Jun 17, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest (>=2.5) + + A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. + :pypi:`pytest-test-groups` *last release*: Oct 25, 2016, *status*: 5 - Production/Stable, @@ -7596,7 +7663,7 @@ This list contains 1062 plugins. A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. :pypi:`pytest-testinfra` - *last release*: Apr 12, 2022, + *last release*: Jun 19, 2022, *status*: 5 - Production/Stable, *requires*: pytest (!=3.0.2) @@ -7623,6 +7690,13 @@ This list contains 1062 plugins. nOly selects tests affected by changed files and methods + :pypi:`pytest-testmon-skip-libraries` + *last release*: Jun 13, 2022, + *status*: 4 - Beta, + *requires*: N/A + + selects tests affected by changed files and methods + :pypi:`pytest-testobject` *last release*: Sep 24, 2019, *status*: 4 - Beta, @@ -7938,6 +8012,13 @@ This list contains 1062 plugins. py.test plugin for testing Python 3.5+ Tornado code + :pypi:`pytest-trace` + *last release*: Jun 19, 2022, + *status*: N/A, + *requires*: pytest (>=4.6) + + Save OpenTelemetry spans generated during testing + :pypi:`pytest-track` *last release*: Feb 26, 2021, *status*: 3 - Alpha, @@ -8071,6 +8152,13 @@ This list contains 1062 plugins. Text User Interface for running python tests + :pypi:`pytest-unflakable` + *last release*: Jun 14, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=6.2.0) + + Unflakable plugin for PyTest + :pypi:`pytest-unhandled-exception-exit-code` *last release*: Jun 22, 2020, *status*: 5 - Production/Stable, @@ -8156,9 +8244,9 @@ This list contains 1062 plugins. Plugin for managing VCR.py cassettes :pypi:`pytest-vcr-delete-on-fail` - *last release*: Jun 06, 2022, + *last release*: Jun 20, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=6.2.2,<7.0.0) + *requires*: pytest (>=6.2.2) A pytest plugin that automates vcrpy cassettes deletion on test failure. From f92c4a77ada65a40700272c5af8cef302dbb4c27 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sun, 26 Jun 2022 10:06:18 -0300 Subject: [PATCH 283/549] Use PurePath directly instead of os.path.sep in rewrite.py Given we are already creating a `PurePath`, just pass the parts directly to it. This avoids using `os.path.sep`, that although is an official API, seems not to be available in all systems. Fix #9791 --- changelog/9791.bugfix.rst | 1 + src/_pytest/assertion/rewrite.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog/9791.bugfix.rst diff --git a/changelog/9791.bugfix.rst b/changelog/9791.bugfix.rst new file mode 100644 index 00000000000..f81c870165b --- /dev/null +++ b/changelog/9791.bugfix.rst @@ -0,0 +1 @@ +Fixed a path handling code in ``rewrite.py`` that seems to work fine, but was incorrect and fails in some systems. diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index 81096764e04..9d0b431b4a7 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -190,7 +190,7 @@ def _early_rewrite_bailout(self, name: str, state: "AssertionState") -> bool: return False # For matching the name it must be as if it was a filename. - path = PurePath(os.path.sep.join(parts) + ".py") + path = PurePath(*parts).with_suffix(".py") for pat in self.fnpats: # if the pattern contains subdirectories ("tests/**.py" for example) we can't bail out based From 0b1e9ba270ac99cff6d15e4ed6f626bacc86b671 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jun 2022 03:02:47 +0000 Subject: [PATCH 284/549] build(deps): Bump pytest-mock in /testing/plugins_integration Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.7.0 to 3.8.1. - [Release notes](https://github.com/pytest-dev/pytest-mock/releases) - [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.7.0...v3.8.1) --- updated-dependencies: - dependency-name: pytest-mock dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 965762dae4b..2379afcd5b8 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -6,7 +6,7 @@ pytest-cov==3.0.0 pytest-django==4.5.2 pytest-flakes==4.0.5 pytest-html==3.1.1 -pytest-mock==3.7.0 +pytest-mock==3.8.1 pytest-rerunfailures==10.2 pytest-sugar==0.9.4 pytest-trio==0.7.0 From bd642fac70275133e8741a25aa652d7537c4b3db Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sun, 26 Jun 2022 10:52:01 -0300 Subject: [PATCH 285/549] Do not call tearDown for skipped unittest.TestCases with --pdb Fix #10060 --- changelog/10060.bugfix.rst | 1 + src/_pytest/unittest.py | 5 +++- testing/test_unittest.py | 50 ++++++++++++++++++++++++++++++++++---- 3 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 changelog/10060.bugfix.rst diff --git a/changelog/10060.bugfix.rst b/changelog/10060.bugfix.rst new file mode 100644 index 00000000000..c8941820eca --- /dev/null +++ b/changelog/10060.bugfix.rst @@ -0,0 +1 @@ +When running with ``--pdb``, ``TestCase.tearDown`` is no longer called for tests when the *class* has been skipped via ``unittest.skip`` or ``pytest.mark.skip``. diff --git a/src/_pytest/unittest.py b/src/_pytest/unittest.py index 851e4943b23..c2df986530c 100644 --- a/src/_pytest/unittest.py +++ b/src/_pytest/unittest.py @@ -316,7 +316,10 @@ def runtest(self) -> None: # Arguably we could always postpone tearDown(), but this changes the moment where the # TestCase instance interacts with the results object, so better to only do it # when absolutely needed. - if self.config.getoption("usepdb") and not _is_skipped(self.obj): + # We need to consider if the test itself is skipped, or the whole class. + assert isinstance(self.parent, UnitTestCase) + skipped = _is_skipped(self.obj) or _is_skipped(self.parent.obj) + if self.config.getoption("usepdb") and not skipped: self._explicit_tearDown = self._testcase.tearDown setattr(self._testcase, "tearDown", lambda *args: None) diff --git a/testing/test_unittest.py b/testing/test_unittest.py index fb312814542..d917d331a03 100644 --- a/testing/test_unittest.py +++ b/testing/test_unittest.py @@ -1241,12 +1241,15 @@ def test_2(self): @pytest.mark.parametrize("mark", ["@unittest.skip", "@pytest.mark.skip"]) -def test_pdb_teardown_skipped( +def test_pdb_teardown_skipped_for_functions( pytester: Pytester, monkeypatch: MonkeyPatch, mark: str ) -> None: - """With --pdb, setUp and tearDown should not be called for skipped tests.""" + """ + With --pdb, setUp and tearDown should not be called for tests skipped + via a decorator (#7215). + """ tracked: List[str] = [] - monkeypatch.setattr(pytest, "test_pdb_teardown_skipped", tracked, raising=False) + monkeypatch.setattr(pytest, "track_pdb_teardown_skipped", tracked, raising=False) pytester.makepyfile( """ @@ -1256,10 +1259,10 @@ def test_pdb_teardown_skipped( class MyTestCase(unittest.TestCase): def setUp(self): - pytest.test_pdb_teardown_skipped.append("setUp:" + self.id()) + pytest.track_pdb_teardown_skipped.append("setUp:" + self.id()) def tearDown(self): - pytest.test_pdb_teardown_skipped.append("tearDown:" + self.id()) + pytest.track_pdb_teardown_skipped.append("tearDown:" + self.id()) {mark}("skipped for reasons") def test_1(self): @@ -1274,6 +1277,43 @@ def test_1(self): assert tracked == [] +@pytest.mark.parametrize("mark", ["@unittest.skip", "@pytest.mark.skip"]) +def test_pdb_teardown_skipped_for_classes( + pytester: Pytester, monkeypatch: MonkeyPatch, mark: str +) -> None: + """ + With --pdb, setUp and tearDown should not be called for tests skipped + via a decorator on the class (#10060). + """ + tracked: List[str] = [] + monkeypatch.setattr(pytest, "track_pdb_teardown_skipped", tracked, raising=False) + + pytester.makepyfile( + """ + import unittest + import pytest + + {mark}("skipped for reasons") + class MyTestCase(unittest.TestCase): + + def setUp(self): + pytest.track_pdb_teardown_skipped.append("setUp:" + self.id()) + + def tearDown(self): + pytest.track_pdb_teardown_skipped.append("tearDown:" + self.id()) + + def test_1(self): + pass + + """.format( + mark=mark + ) + ) + result = pytester.runpytest_inprocess("--pdb") + result.stdout.fnmatch_lines("* 1 skipped in *") + assert tracked == [] + + def test_async_support(pytester: Pytester) -> None: pytest.importorskip("unittest.async_case") From b961ef5b798cf698e4be7613ec555800b1762d14 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Jun 2022 20:50:23 +0000 Subject: [PATCH 286/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.2.0 → v4.3.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.2.0...v4.3.0) - [github.com/asottile/pyupgrade: v2.32.1 → v2.34.0](https://github.com/asottile/pyupgrade/compare/v2.32.1...v2.34.0) - [github.com/pre-commit/mirrors-mypy: v0.960 → v0.961](https://github.com/pre-commit/mirrors-mypy/compare/v0.960...v0.961) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c98ff7ea12a..2f8b36049b6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: blacken-docs additional_dependencies: [black==20.8b1] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.3.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -42,7 +42,7 @@ repos: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.32.1 + rev: v2.34.0 hooks: - id: pyupgrade args: [--py37-plus] @@ -56,7 +56,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.960 + rev: v0.961 hooks: - id: mypy files: ^(src/|testing/) From c34eaaaa1c485e9c8c3d1fe7f05549b6436f49cc Mon Sep 17 00:00:00 2001 From: Alice Purcell Date: Wed, 29 Jun 2022 14:38:59 +0100 Subject: [PATCH 287/549] Pass importmode to import_path in DoctestModule This allows doctest to be used with namespace modules --- changelog/3396.improvement.rst | 1 + src/_pytest/doctest.py | 6 +++++- testing/test_doctest.py | 22 ++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 changelog/3396.improvement.rst diff --git a/changelog/3396.improvement.rst b/changelog/3396.improvement.rst new file mode 100644 index 00000000000..aa3f278c2a6 --- /dev/null +++ b/changelog/3396.improvement.rst @@ -0,0 +1 @@ +Doctests now respect the ``--import-mode`` flag. diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py index ac5a29bb923..ed072fcd628 100644 --- a/src/_pytest/doctest.py +++ b/src/_pytest/doctest.py @@ -542,7 +542,11 @@ def _find( ) else: try: - module = import_path(self.path, root=self.config.rootpath) + module = import_path( + self.path, + root=self.config.rootpath, + mode=self.config.getoption("importmode"), + ) except ImportError: if self.config.getvalue("doctest_ignore_import_errors"): pytest.skip("unable to import module %r" % self.path) diff --git a/testing/test_doctest.py b/testing/test_doctest.py index 1b4809240c0..828253d3223 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -113,6 +113,28 @@ def test_simple_doctestfile(self, pytester: Pytester): reprec = pytester.inline_run(p) reprec.assertoutcome(failed=1) + def test_importmode(self, pytester: Pytester): + p = pytester.makepyfile( + **{ + "namespacepkg/innerpkg/__init__.py": "", + "namespacepkg/innerpkg/a.py": """ + def some_func(): + return 42 + """, + "namespacepkg/innerpkg/b.py": """ + from namespacepkg.innerpkg.a import some_func + def my_func(): + ''' + >>> my_func() + 42 + ''' + return some_func() + """, + } + ) + reprec = pytester.inline_run(p, "--doctest-modules", "--import-mode=importlib") + reprec.assertoutcome(passed=1) + def test_new_pattern(self, pytester: Pytester): p = pytester.maketxtfile( xdoc=""" From 85000f037f33e34eb8b0a8d6430a9a33fbb1ee29 Mon Sep 17 00:00:00 2001 From: Alice Purcell Date: Wed, 29 Jun 2022 14:39:04 +0100 Subject: [PATCH 288/549] Added Alice Purcell to AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 2d3439b6ca1..8530e2e01dc 100644 --- a/AUTHORS +++ b/AUTHORS @@ -15,6 +15,7 @@ Alan Velasco Alexander Johnson Alexander King Alexei Kozlenok +Alice Purcell Allan Feldman Aly Sivji Amir Elkess From 1b47de7d7f2a5353dfd0c1c549532e873999f5bf Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 29 Jun 2022 13:13:15 -0400 Subject: [PATCH 289/549] update does_not_raise docs now that pytest is 3.7+ only --- doc/en/example/parametrize.rst | 31 ++++--------------------------- testing/python/raises.py | 12 ++---------- 2 files changed, 6 insertions(+), 37 deletions(-) diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index 24dd5ecaa38..f8147683975 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -657,21 +657,17 @@ Use :func:`pytest.raises` with the :ref:`pytest.mark.parametrize ref` decorator to write parametrized tests in which some tests raise exceptions and others do not. -It is helpful to define a no-op context manager ``does_not_raise`` to serve -as a complement to ``raises``. For example: +It may be helpful to use ``nullcontext`` as a complement to ``raises``. + +For example: .. code-block:: python - from contextlib import contextmanager + from contextlib import nullcontext as does_not_raise import pytest - @contextmanager - def does_not_raise(): - yield - - @pytest.mark.parametrize( "example_input,expectation", [ @@ -688,22 +684,3 @@ as a complement to ``raises``. For example: In the example above, the first three test cases should run unexceptionally, while the fourth should raise ``ZeroDivisionError``. - -If you're only supporting Python 3.7+, you can simply use ``nullcontext`` -to define ``does_not_raise``: - -.. code-block:: python - - from contextlib import nullcontext as does_not_raise - -Or, if you're supporting Python 3.3+ you can use: - -.. code-block:: python - - from contextlib import ExitStack as does_not_raise - -Or, if desired, you can ``pip install contextlib2`` and use: - -.. code-block:: python - - from contextlib2 import nullcontext as does_not_raise diff --git a/testing/python/raises.py b/testing/python/raises.py index f1f6ece4ee0..3dcec31eb1f 100644 --- a/testing/python/raises.py +++ b/testing/python/raises.py @@ -92,13 +92,9 @@ def test_raise_wrong_exception_passes_by(): def test_does_not_raise(self, pytester: Pytester) -> None: pytester.makepyfile( """ - from contextlib import contextmanager + from contextlib import nullcontext as does_not_raise import pytest - @contextmanager - def does_not_raise(): - yield - @pytest.mark.parametrize('example_input,expectation', [ (3, does_not_raise()), (2, does_not_raise()), @@ -117,13 +113,9 @@ def test_division(example_input, expectation): def test_does_not_raise_does_raise(self, pytester: Pytester) -> None: pytester.makepyfile( """ - from contextlib import contextmanager + from contextlib import nullcontext as does_not_raise import pytest - @contextmanager - def does_not_raise(): - yield - @pytest.mark.parametrize('example_input,expectation', [ (0, does_not_raise()), (1, pytest.raises(ZeroDivisionError)), From 3e590fe79e05e5fd5d1f0f328c1afe272d28ad40 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 30 Jun 2022 05:47:02 -0700 Subject: [PATCH 290/549] git mv changelog/3396.{improvement,bugfix}.rst --- changelog/{3396.improvement.rst => 3396.bugfix.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changelog/{3396.improvement.rst => 3396.bugfix.rst} (100%) diff --git a/changelog/3396.improvement.rst b/changelog/3396.bugfix.rst similarity index 100% rename from changelog/3396.improvement.rst rename to changelog/3396.bugfix.rst From 04de180f4177c7be26e993b3291f32dfcfab0d0d Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 3 Jul 2022 00:22:59 +0000 Subject: [PATCH 291/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 92 +++++++++++++++++++------------- 1 file changed, 54 insertions(+), 38 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index a1bae76cef4..ba2dde43027 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1073 plugins. +This list contains 1075 plugins. .. only:: not latex @@ -39,7 +39,7 @@ This list contains 1073 plugins. :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) - :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Feb 21, 2022 N/A pytest + :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Jun 28, 2022 N/A pytest :pypi:`pytest-allure-dsl` pytest plugin to test case doc string dls instructions Oct 25, 2020 4 - Beta pytest :pypi:`pytest-allure-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) @@ -54,6 +54,7 @@ This list contains 1073 plugins. :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest :pypi:`pytest-anything` Pytest fixtures to assert anything and something Feb 18, 2021 N/A N/A :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Nov 23, 2021 N/A pytest ; extra == 'test' + :pypi:`pytest-aoreporter` pytest report Jun 27, 2022 N/A N/A :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 12, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-appengine` AppEngine integration that works well with pytest-django Feb 27, 2017 N/A N/A @@ -326,7 +327,7 @@ This list contains 1073 plugins. :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jun 06, 2022 N/A N/A :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jun 06, 2022 N/A N/A - :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jun 24, 2022 N/A pytest (>=7.0,<8.0) + :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jul 01, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Jun 22, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -343,7 +344,7 @@ This list contains 1073 plugins. :pypi:`pytest-error-for-skips` Pytest plugin to treat skipped tests a test failure Dec 19, 2019 4 - Beta pytest (>=4.6) :pypi:`pytest-eth` PyTest plugin for testing Smart Contracts for Ethereum Virtual Machine (EVM). Aug 14, 2020 1 - Planning N/A :pypi:`pytest-ethereum` pytest-ethereum: Pytest library for ethereum projects. Jun 24, 2019 3 - Alpha pytest (==3.3.2); extra == 'dev' - :pypi:`pytest-eucalyptus` Pytest Plugin for BDD Aug 13, 2019 N/A pytest (>=4.2.0) + :pypi:`pytest-eucalyptus` Pytest Plugin for BDD Jun 28, 2022 N/A pytest (>=4.2.0) :pypi:`pytest-eventlet` Applies eventlet monkey-patch as a pytest plugin. Oct 04, 2021 N/A pytest ; extra == 'dev' :pypi:`pytest-excel` pytest plugin for generating excel reports Jan 31, 2022 5 - Production/Stable N/A :pypi:`pytest-exceptional` Better exceptions Mar 16, 2017 4 - Beta N/A @@ -426,7 +427,7 @@ This list contains 1073 plugins. :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest :pypi:`pytest-github` Plugin for py.test that associates tests with github issues using a marker. Mar 07, 2019 5 - Production/Stable N/A - :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Dec 08, 2021 N/A pytest (>=4.0.0) + :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Jul 02, 2022 N/A pytest (>=4.0.0) :pypi:`pytest-github-report` Generate a GitHub report using pytest in GitHub Workflows Jun 03, 2022 4 - Beta N/A :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A :pypi:`pytest-glamor-allure` Extends allure-pytest functionality May 19, 2022 4 - Beta pytest @@ -471,10 +472,10 @@ This list contains 1073 plugins. :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A - :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jun 24, 2022 4 - Beta N/A + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jun 27, 2022 4 - Beta N/A :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A - :pypi:`pytest-idem` A pytest plugin to help with testing idem projects May 04, 2022 5 - Production/Stable N/A + :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Jun 29, 2022 5 - Production/Stable N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 30, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A :pypi:`pytest-image-diff` Jun 08, 2022 3 - Alpha pytest @@ -555,7 +556,7 @@ This list contains 1073 plugins. :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers May 26, 2022 3 - Alpha pytest + :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Jul 02, 2022 3 - Alpha pytest :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha pytest (>=6) :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) :pypi:`pytest-markdown-docs` Run markdown code fences through pytest May 12, 2022 N/A N/A @@ -591,7 +592,7 @@ This list contains 1073 plugins. :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Jun 15, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Jun 28, 2022 N/A pytest (>=1.0) :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A @@ -608,7 +609,7 @@ This list contains 1073 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jun 15, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jun 22, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jul 01, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A @@ -684,7 +685,7 @@ This list contains 1073 plugins. :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) :pypi:`pytest-perf` pytest-perf Jun 23, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) - :pypi:`pytest-persistence` Pytest tool for persistent objects Apr 22, 2022 N/A N/A + :pypi:`pytest-persistence` Pytest tool for persistent objects Jun 27, 2022 N/A N/A :pypi:`pytest-pg` A tiny plugin for pytest which runs PostgreSQL in Docker Jun 07, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Apr 15, 2022 4 - Beta pytest (>=5.4.3) @@ -751,7 +752,7 @@ This list contains 1073 plugins. :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Jun 26, 2021 4 - Beta pytest (>=6.2.0) - :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Mar 17, 2022 5 - Production/Stable pytest (>=6.2.3) + :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jun 26, 2022 5 - Production/Stable pytest (>=6.2.3) :pypi:`pytest-qml` Run QML Tests with pytest Dec 02, 2020 4 - Beta pytest (>=6.0.0) :pypi:`pytest-qr` pytest plugin to generate test result QR codes Nov 25, 2021 4 - Beta N/A :pypi:`pytest-qt` pytest support for PyQt and PySide applications Jun 23, 2022 5 - Production/Stable pytest (>=3.0.0) @@ -762,7 +763,7 @@ This list contains 1073 plugins. :pypi:`pytest-race` Race conditions tester for pytest Jun 07, 2022 4 - Beta N/A :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results May 02, 2022 N/A pytest (>=3.6) - :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Jun 20, 2022 5 - Production/Stable pytest + :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Jun 29, 2022 5 - Production/Stable pytest :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) :pypi:`pytest-raisesregexp` Simple pytest plugin to look for regex in Exceptions Dec 18, 2015 N/A N/A :pypi:`pytest-raisin` Plugin enabling the use of exception instances with pytest.raises Feb 06, 2022 N/A pytest @@ -832,6 +833,7 @@ This list contains 1073 plugins. :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A :pypi:`pytest-runner` Invoke py.test as distutils command with dependency resolution Feb 25, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Jul 02, 2022 5 - Production/Stable pytest :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A N/A :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). May 10, 2022 3 - Alpha N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A @@ -842,20 +844,20 @@ This list contains 1073 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jun 24, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 01, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jun 24, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 01, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A - :pypi:`pytest-servers` pytest servers Jun 24, 2022 1 - Planning pytest (==7.1.2) + :pypi:`pytest-servers` pytest servers Jul 01, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :pypi:`pytest-session2file` pytest-session2file (aka: pytest-session_to_file for v0.1.0 - v0.1.2) is a py.test plugin for capturing and saving to file the stdout of py.test. Jan 26, 2021 3 - Alpha pytest :pypi:`pytest-session-fixture-globalize` py.test plugin to make session fixtures behave as if written in conftest, even if it is written in some modules May 15, 2018 4 - Beta N/A @@ -880,7 +882,7 @@ This list contains 1073 plugins. :pypi:`pytest-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A :pypi:`pytest-smartcollect` A plugin for collecting tests that touch changed code Oct 04, 2018 N/A pytest (>=3.5.0) :pypi:`pytest-smartcov` Smart coverage plugin for pytest. Sep 30, 2017 3 - Alpha N/A - :pypi:`pytest-smell` Automated bad smell detection tool for Pytest May 17, 2022 N/A N/A + :pypi:`pytest-smell` Automated bad smell detection tool for Pytest Jun 26, 2022 N/A N/A :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A @@ -897,7 +899,7 @@ This list contains 1073 plugins. :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. Feb 23, 2020 4 - Beta pytest :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. May 04, 2021 N/A N/A - :pypi:`pytest-spec2md` Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. Jun 19, 2022 N/A pytest (>7.0) + :pypi:`pytest-spec2md` Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. Jun 26, 2022 N/A pytest (>7.0) :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Mar 30, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A @@ -978,7 +980,7 @@ This list contains 1073 plugins. :pypi:`pytest-testreport-new` May 05, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) - :pypi:`pytest-test-utils` Dec 14, 2021 N/A pytest (>=5) + :pypi:`pytest-test-utils` Jun 30, 2022 N/A pytest (>=5) :pypi:`pytest-tesults` Tesults plugin for pytest Dec 31, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-tezos` pytest-ligo Jan 16, 2020 4 - Beta N/A :pypi:`pytest-th2-bdd` pytest_th2_bdd May 13, 2022 N/A N/A @@ -1244,7 +1246,7 @@ This list contains 1073 plugins. Plugin for py.test to generate allure xml reports :pypi:`pytest-allure-collection` - *last release*: Feb 21, 2022, + *last release*: Jun 28, 2022, *status*: N/A, *requires*: pytest @@ -1348,6 +1350,13 @@ This list contains 1073 plugins. Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures + :pypi:`pytest-aoreporter` + *last release*: Jun 27, 2022, + *status*: N/A, + *requires*: N/A + + pytest report + :pypi:`pytest-api` *last release*: May 12, 2022, *status*: N/A, @@ -3253,7 +3262,7 @@ This list contains 1073 plugins. pytest embedded plugin for testing espressif boards via serial ports :pypi:`pytest-embrace` - *last release*: Jun 24, 2022, + *last release*: Jul 01, 2022, *status*: N/A, *requires*: pytest (>=7.0,<8.0) @@ -3372,7 +3381,7 @@ This list contains 1073 plugins. pytest-ethereum: Pytest library for ethereum projects. :pypi:`pytest-eucalyptus` - *last release*: Aug 13, 2019, + *last release*: Jun 28, 2022, *status*: N/A, *requires*: pytest (>=4.2.0) @@ -3953,7 +3962,7 @@ This list contains 1073 plugins. Plugin for py.test that associates tests with github issues using a marker. :pypi:`pytest-github-actions-annotate-failures` - *last release*: Dec 08, 2021, + *last release*: Jul 02, 2022, *status*: N/A, *requires*: pytest (>=4.0.0) @@ -4268,7 +4277,7 @@ This list contains 1073 plugins. help hypo module for pytest :pypi:`pytest-ibutsu` - *last release*: Jun 24, 2022, + *last release*: Jun 27, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4289,7 +4298,7 @@ This list contains 1073 plugins. A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api :pypi:`pytest-idem` - *last release*: May 04, 2022, + *last release*: Jun 29, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4856,7 +4865,7 @@ This list contains 1073 plugins. Pytest Loguru :pypi:`pytest-lsp` - *last release*: May 26, 2022, + *last release*: Jul 02, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -5108,7 +5117,7 @@ This list contains 1073 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Jun 15, 2022, + *last release*: Jun 28, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -5227,7 +5236,7 @@ This list contains 1073 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Jun 22, 2022, + *last release*: Jul 01, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -5759,7 +5768,7 @@ This list contains 1073 plugins. A simple plugin to ensure the execution of critical sections of code has not been impacted :pypi:`pytest-persistence` - *last release*: Apr 22, 2022, + *last release*: Jun 27, 2022, *status*: N/A, *requires*: N/A @@ -6228,7 +6237,7 @@ This list contains 1073 plugins. Pytest plugin for uploading test results to your QA Touch Testrun. :pypi:`pytest-qgis` - *last release*: Mar 17, 2022, + *last release*: Jun 26, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2.3) @@ -6305,7 +6314,7 @@ This list contains 1073 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-railflow-testrail-reporter` - *last release*: Jun 20, 2022, + *last release*: Jun 29, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6794,6 +6803,13 @@ This list contains 1073 plugins. Invoke py.test as distutils command with dependency resolution + :pypi:`pytest-run-subprocess` + *last release*: Jul 02, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest + + Pytest Plugin for running and testing subprocesses. + :pypi:`pytest-runtime-xfail` *last release*: Aug 26, 2021, *status*: N/A, @@ -6865,7 +6881,7 @@ This list contains 1073 plugins. :pypi:`pytest-sbase` - *last release*: Jun 24, 2022, + *last release*: Jul 01, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6907,7 +6923,7 @@ This list contains 1073 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Jun 24, 2022, + *last release*: Jul 01, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6956,8 +6972,8 @@ This list contains 1073 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Jun 24, 2022, - *status*: 1 - Planning, + *last release*: Jul 01, 2022, + *status*: 3 - Alpha, *requires*: pytest (==7.1.2) pytest servers @@ -7131,7 +7147,7 @@ This list contains 1073 plugins. Smart coverage plugin for pytest. :pypi:`pytest-smell` - *last release*: May 17, 2022, + *last release*: Jun 26, 2022, *status*: N/A, *requires*: N/A @@ -7250,7 +7266,7 @@ This list contains 1073 plugins. Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. :pypi:`pytest-spec2md` - *last release*: Jun 19, 2022, + *last release*: Jun 26, 2022, *status*: N/A, *requires*: pytest (>7.0) @@ -7817,7 +7833,7 @@ This list contains 1073 plugins. Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply :pypi:`pytest-test-utils` - *last release*: Dec 14, 2021, + *last release*: Jun 30, 2022, *status*: N/A, *requires*: pytest (>=5) From b99541e7441d7d1235bb8649da14fdd67fd38368 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 Jul 2022 22:38:23 +0000 Subject: [PATCH 292/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 22.3.0 → 22.6.0](https://github.com/psf/black/compare/22.3.0...22.6.0) - [github.com/asottile/reorder_python_imports: v3.1.0 → v3.3.0](https://github.com/asottile/reorder_python_imports/compare/v3.1.0...v3.3.0) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2f8b36049b6..e9496d6a0c6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 22.6.0 hooks: - id: black args: [--safe, --quiet] @@ -37,7 +37,7 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v3.1.0 + rev: v3.3.0 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] From 6d7973942f077bc90dd2488e6c39afe8cc8f96e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Jul 2022 22:37:17 +0000 Subject: [PATCH 293/549] build(deps): Bump django in /testing/plugins_integration Bumps [django](https://github.com/django/django) from 4.0.5 to 4.0.6. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/4.0.5...4.0.6) --- updated-dependencies: - dependency-name: django dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 2379afcd5b8..6e61df2790e 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.6.1 -django==4.0.5 +django==4.0.6 pytest-asyncio==0.18.3 pytest-bdd==5.0.0 pytest-cov==3.0.0 From 4449bdc068f598b226ad7dc72a7ea03f38a1307d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 6 Jul 2022 04:05:08 -0700 Subject: [PATCH 294/549] Remove europython training (#10107) --- doc/en/index.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/en/index.rst b/doc/en/index.rst index 501ec913388..870fd5a2b15 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -2,7 +2,6 @@ .. sidebar:: Next Open Trainings - - `Europython `__, July 11th 2022 (3h), Dublin, Ireland - `CH Open Workshop-Tage `__ (German), September 8th 2022, Bern, Switzerland - `Professional Testing with Python `_, via `Python Academy `_, March 7th to 9th 2023 (3 day in-depth training), Remote and Leipzig, Germany From aa83fa353c58c8b9f6b6afecbc5a223e9731d720 Mon Sep 17 00:00:00 2001 From: EmptyRabbit <32815055+EmptyRabbit@users.noreply.github.com> Date: Thu, 7 Jul 2022 19:29:50 +0800 Subject: [PATCH 295/549] Update changelog/9877.bugfix.rst Co-authored-by: Ronny Pfannschmidt --- changelog/9877.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/9877.bugfix.rst b/changelog/9877.bugfix.rst index ace3a4385a4..77b1b8c38ff 100644 --- a/changelog/9877.bugfix.rst +++ b/changelog/9877.bugfix.rst @@ -1 +1 @@ -Fixed ``caplog.get_records(when)`` still get the stage records after ``caplog.clear()`` +ensure ``caplog.get_records(when)`` returns current/correct data after invoking ``caplog.clear()`` From 87265973218e37bf7839bfbbd25fe69f1fe50a15 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 7 Jul 2022 09:39:57 -0300 Subject: [PATCH 296/549] Update changelog/9877.bugfix.rst --- changelog/9877.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/9877.bugfix.rst b/changelog/9877.bugfix.rst index 77b1b8c38ff..1d2264c6157 100644 --- a/changelog/9877.bugfix.rst +++ b/changelog/9877.bugfix.rst @@ -1 +1 @@ -ensure ``caplog.get_records(when)`` returns current/correct data after invoking ``caplog.clear()`` +Ensure ``caplog.get_records(when)`` returns current/correct data after invoking ``caplog.clear()``. From 4cd0322ca18bf2f9e4f27f22d2c46c25cdc8b1e2 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 8 Jul 2022 16:01:14 -0400 Subject: [PATCH 297/549] replace atomicwrites with os.replace --- .pre-commit-config.yaml | 1 - changelog/10114.trivial.rst | 1 + setup.cfg | 1 - src/_pytest/assertion/rewrite.py | 68 +++++++++++--------------------- testing/test_assertrewrite.py | 25 ++---------- 5 files changed, 26 insertions(+), 70 deletions(-) create mode 100644 changelog/10114.trivial.rst diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e9496d6a0c6..11757b940bf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -67,7 +67,6 @@ repos: - attrs>=19.2.0 - packaging - tomli - - types-atomicwrites - types-pkg_resources - repo: local hooks: diff --git a/changelog/10114.trivial.rst b/changelog/10114.trivial.rst new file mode 100644 index 00000000000..42c43a1d0d6 --- /dev/null +++ b/changelog/10114.trivial.rst @@ -0,0 +1 @@ +Replace `atomicwrites `__ dependency on windows with `os.replace`. diff --git a/setup.cfg b/setup.cfg index c4f5bd9d29f..3545a9503a8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -46,7 +46,6 @@ install_requires = packaging pluggy>=0.12,<2.0 py>=1.8.2 - atomicwrites>=1.0;sys_platform=="win32" colorama;sys_platform=="win32" importlib-metadata>=0.12;python_version<"3.8" tomli>=1.0.0;python_version<"3.11" diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index 9d0b431b4a7..a1bbb171b4b 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -302,53 +302,29 @@ def _write_pyc_fp( fp.write(marshal.dumps(co)) -if sys.platform == "win32": - from atomicwrites import atomic_write - - def _write_pyc( - state: "AssertionState", - co: types.CodeType, - source_stat: os.stat_result, - pyc: Path, - ) -> bool: - try: - with atomic_write(os.fspath(pyc), mode="wb", overwrite=True) as fp: - _write_pyc_fp(fp, source_stat, co) - except OSError as e: - state.trace(f"error writing pyc file at {pyc}: {e}") - # we ignore any failure to write the cache file - # there are many reasons, permission-denied, pycache dir being a - # file etc. - return False - return True - -else: - - def _write_pyc( - state: "AssertionState", - co: types.CodeType, - source_stat: os.stat_result, - pyc: Path, - ) -> bool: - proc_pyc = f"{pyc}.{os.getpid()}" - try: - fp = open(proc_pyc, "wb") - except OSError as e: - state.trace(f"error writing pyc file at {proc_pyc}: errno={e.errno}") - return False - - try: +def _write_pyc( + state: "AssertionState", + co: types.CodeType, + source_stat: os.stat_result, + pyc: Path, +) -> bool: + proc_pyc = f"{pyc}.{os.getpid()}" + try: + with open(proc_pyc, "wb") as fp: _write_pyc_fp(fp, source_stat, co) - os.rename(proc_pyc, pyc) - except OSError as e: - state.trace(f"error writing pyc file at {pyc}: {e}") - # we ignore any failure to write the cache file - # there are many reasons, permission-denied, pycache dir being a - # file etc. - return False - finally: - fp.close() - return True + except OSError as e: + state.trace(f"error writing pyc file at {proc_pyc}: errno={e.errno}") + return False + + try: + os.replace(proc_pyc, pyc) + except OSError as e: + state.trace(f"error writing pyc file at {pyc}: {e}") + # we ignore any failure to write the cache file + # there are many reasons, permission-denied, pycache dir being a + # file etc. + return False + return True def _rewrite_test(fn: Path, config: Config) -> Tuple[os.stat_result, types.CodeType]: diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 41458b52b0e..3c98392ed98 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1009,7 +1009,7 @@ def test_meta_path(): ) assert pytester.runpytest().ret == 0 - def test_write_pyc(self, pytester: Pytester, tmp_path, monkeypatch) -> None: + def test_write_pyc(self, pytester: Pytester, tmp_path) -> None: from _pytest.assertion.rewrite import _write_pyc from _pytest.assertion import AssertionState @@ -1021,27 +1021,8 @@ def test_write_pyc(self, pytester: Pytester, tmp_path, monkeypatch) -> None: co = compile("1", "f.py", "single") assert _write_pyc(state, co, os.stat(source_path), pycpath) - if sys.platform == "win32": - from contextlib import contextmanager - - @contextmanager - def atomic_write_failed(fn, mode="r", overwrite=False): - e = OSError() - e.errno = 10 - raise e - yield # type:ignore[unreachable] - - monkeypatch.setattr( - _pytest.assertion.rewrite, "atomic_write", atomic_write_failed - ) - else: - - def raise_oserror(*args): - raise OSError() - - monkeypatch.setattr("os.rename", raise_oserror) - - assert not _write_pyc(state, co, os.stat(source_path), pycpath) + with mock.patch.object(os, "replace", side_effect=OSError): + assert not _write_pyc(state, co, os.stat(source_path), pycpath) def test_resources_provider_for_loader(self, pytester: Pytester) -> None: """ From dda7673f571873872ad89357265164005356aae0 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 10 Jul 2022 00:24:23 +0000 Subject: [PATCH 298/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 116 ++++++++++++++++++++----------- 1 file changed, 74 insertions(+), 42 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index ba2dde43027..0dcf90ac574 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1075 plugins. +This list contains 1079 plugins. .. only:: not latex @@ -50,7 +50,7 @@ This list contains 1075 plugins. :pypi:`pytest-ansible-playbook` Pytest fixture which runs given ansible playbook file. Mar 08, 2019 4 - Beta N/A :pypi:`pytest-ansible-playbook-runner` Pytest fixture which runs given ansible playbook file. Dec 02, 2020 4 - Beta pytest (>=3.1.0) :pypi:`pytest-ansible-units` A pytest plugin for running unit tests within an ansible collection Apr 14, 2022 N/A N/A - :pypi:`pytest-antilru` Bust functools.lru_cache when running pytest to avoid test pollution Jan 29, 2022 5 - Production/Stable pytest + :pypi:`pytest-antilru` Bust functools.lru_cache when running pytest to avoid test pollution Jul 05, 2022 5 - Production/Stable pytest :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest :pypi:`pytest-anything` Pytest fixtures to assert anything and something Feb 18, 2021 N/A N/A :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Nov 23, 2021 N/A pytest ; extra == 'test' @@ -95,7 +95,7 @@ This list contains 1075 plugins. :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Mar 16, 2022 4 - Beta pytest (>=5.0.0) :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) - :pypi:`pytest-bdd` BDD for pytest Oct 25, 2021 6 - Mature pytest (>=4.3) + :pypi:`pytest-bdd` BDD for pytest Jul 07, 2022 6 - Mature pytest (>=5.0) :pypi:`pytest-bdd-ng` BDD for pytest May 25, 2022 4 - Beta pytest (>=5.0) :pypi:`pytest-bdd-splinter` Common steps for pytest bdd and splinter integration Aug 12, 2019 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-bdd-web` A simple plugin to use with pytest Jan 02, 2020 4 - Beta pytest (>=3.5.0) @@ -155,6 +155,7 @@ This list contains 1075 plugins. :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest (>=7.0) :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest + :pypi:`pytest-chunks` Run only a chunk of your test suite Jul 05, 2022 N/A pytest (>=6.0.0) :pypi:`pytest-circleci` py.test plugin for CircleCI May 03, 2019 N/A N/A :pypi:`pytest-circleci-parallelized` Parallelize pytest across CircleCI workers. Mar 26, 2019 N/A N/A :pypi:`pytest-circleci-parallelized-rjp` Parallelize pytest across CircleCI workers. Jun 21, 2022 N/A pytest @@ -162,7 +163,7 @@ This list contains 1075 plugins. :pypi:`pytest-clarity` A plugin providing an alternative, colourful diff output for failing assertions. Jun 11, 2021 N/A N/A :pypi:`pytest-cldf` Easy quality control for CLDF datasets using pytest May 06, 2019 N/A N/A :pypi:`pytest-click` Pytest plugin for Click Feb 11, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-clld` Nov 29, 2021 N/A pytest (>=3.6) + :pypi:`pytest-clld` Jul 06, 2022 N/A pytest (>=3.6) :pypi:`pytest-cloud` Distributed tests planner plugin for pytest testing framework. Oct 05, 2020 6 - Mature N/A :pypi:`pytest-cloudflare-worker` pytest plugin for testing cloudflare workers Mar 30, 2021 4 - Beta pytest (>=6.0.0) :pypi:`pytest-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) @@ -279,7 +280,7 @@ This list contains 1075 plugins. :pypi:`pytest-dockerc` Run, manage and stop Docker Compose project from Docker API Oct 09, 2020 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-docker-compose` Manages Docker containers during your integration tests Jan 26, 2021 5 - Production/Stable pytest (>=3.3) :pypi:`pytest-docker-db` A plugin to use docker databases for pytests Mar 20, 2021 5 - Production/Stable pytest (>=3.1.1) - :pypi:`pytest-docker-fixtures` pytest docker fixtures Nov 23, 2021 3 - Alpha N/A + :pypi:`pytest-docker-fixtures` pytest docker fixtures Jul 06, 2022 3 - Alpha N/A :pypi:`pytest-docker-git-fixtures` Pytest fixtures for testing with git scm. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-haproxy-fixtures` Pytest fixtures for testing with haproxy. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-pexpect` pytest plugin for writing functional tests with pexpect and docker Jan 14, 2019 N/A pytest @@ -327,7 +328,7 @@ This list contains 1075 plugins. :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jun 06, 2022 N/A N/A :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jun 06, 2022 N/A N/A - :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jul 01, 2022 N/A pytest (>=7.0,<8.0) + :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jul 05, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Jun 22, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -372,7 +373,7 @@ This list contains 1075 plugins. :pypi:`pytest-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A :pypi:`pytest-fantasy` Pytest plugin for Flask Fantasy Framework Mar 14, 2019 N/A N/A :pypi:`pytest-fastapi` Dec 27, 2020 N/A N/A - :pypi:`pytest-fastapi-deps` A fixture which allows easy replacement of fastapi dependencies for testing Jun 02, 2022 5 - Production/Stable pytest + :pypi:`pytest-fastapi-deps` A fixture which allows easy replacement of fastapi dependencies for testing Jul 03, 2022 5 - Production/Stable pytest :pypi:`pytest-fastest` Use SCM and coverage to run only needed tests Mar 05, 2020 N/A N/A :pypi:`pytest-fast-first` Pytest plugin that runs fast tests first Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-faulthandler` py.test plugin that activates the fault handler module for tests (dummy package) Jul 04, 2019 6 - Mature pytest (>=5.0) @@ -449,7 +450,7 @@ This list contains 1075 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jun 23, 2022 3 - Alpha pytest (==7.1.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jul 09, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -586,7 +587,7 @@ This list contains 1075 plugins. :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ml` Test your machine learning! May 04, 2019 4 - Beta N/A :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) - :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Jun 24, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Jul 05, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-mock-api` A mock API server with configurable routes and responses available as a fixture. Feb 13, 2019 1 - Planning pytest (>=4.0.0) :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator May 16, 2022 5 - Production/Stable N/A :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest @@ -609,7 +610,7 @@ This list contains 1075 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jun 15, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jul 01, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jul 03, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A @@ -631,7 +632,7 @@ This list contains 1075 plugins. :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Mar 15, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Jul 07, 2022 N/A pytest (==6.2.5) :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A :pypi:`pytest-nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Jul 07, 2021 N/A N/A @@ -783,7 +784,7 @@ This list contains 1075 plugins. :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A :pypi:`pytest-regex-dependency` Management of Pytest dependencies via regex patterns Jun 12, 2022 N/A pytest :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Jan 19, 2022 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-regtest` pytest plugin for regression tests Jun 03, 2021 N/A N/A + :pypi:`pytest-regtest` pytest plugin for regression tests Jul 08, 2022 N/A N/A :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Jun 14, 2019 5 - Production/Stable pytest (<5,>=3) :pypi:`pytest-remfiles` Pytest plugin to create a temporary directory with remote files Jul 01, 2019 5 - Production/Stable N/A @@ -805,12 +806,13 @@ This list contains 1075 plugins. :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Jun 24, 2022 N/A pytest (>=3.8.0) :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-requests-futures` Pytest Plugin to Mock Requests Futures Jul 06, 2022 5 - Production/Stable pytest :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Jun 17, 2021 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. May 23, 2022 N/A N/A + :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Jul 07, 2022 N/A N/A :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A @@ -833,7 +835,7 @@ This list contains 1075 plugins. :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A :pypi:`pytest-runner` Invoke py.test as distutils command with dependency resolution Feb 25, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' - :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Jul 02, 2022 5 - Production/Stable pytest + :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Jul 03, 2022 5 - Production/Stable pytest :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A N/A :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). May 10, 2022 3 - Alpha N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A @@ -844,20 +846,20 @@ This list contains 1075 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 01, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 08, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 01, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 08, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A - :pypi:`pytest-servers` pytest servers Jul 01, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-servers` pytest servers Jul 04, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :pypi:`pytest-session2file` pytest-session2file (aka: pytest-session_to_file for v0.1.0 - v0.1.2) is a py.test plugin for capturing and saving to file the stdout of py.test. Jan 26, 2021 3 - Alpha pytest :pypi:`pytest-session-fixture-globalize` py.test plugin to make session fixtures behave as if written in conftest, even if it is written in some modules May 15, 2018 4 - Beta N/A @@ -900,6 +902,7 @@ This list contains 1075 plugins. :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. May 04, 2021 N/A N/A :pypi:`pytest-spec2md` Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. Jun 26, 2022 N/A pytest (>7.0) + :pypi:`pytest-speed` Modern benchmarking library for python with pytest integration. Jul 06, 2022 3 - Alpha pytest (>=7) :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Mar 30, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A @@ -972,7 +975,7 @@ This list contains 1075 plugins. :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) - :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. May 24, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Jul 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results May 23, 2022 N/A N/A :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A @@ -985,7 +988,7 @@ This list contains 1075 plugins. :pypi:`pytest-tezos` pytest-ligo Jan 16, 2020 4 - Beta N/A :pypi:`pytest-th2-bdd` pytest_th2_bdd May 13, 2022 N/A N/A :pypi:`pytest-thawgun` Pytest plugin for time travel May 26, 2020 3 - Alpha N/A - :pypi:`pytest-threadleak` Detects thread leaks Jan 18, 2022 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-threadleak` Detects thread leaks Jul 03, 2022 4 - Beta pytest (>=3.1.1) :pypi:`pytest-tick` Ticking on tests Aug 31, 2021 5 - Production/Stable pytest (>=6.2.5,<7.0.0) :pypi:`pytest-timeit` A pytest plugin to time test function runs Oct 13, 2016 4 - Beta N/A :pypi:`pytest-timeout` pytest plugin to abort hanging tests Jan 18, 2022 5 - Production/Stable pytest (>=5.0.0) @@ -1004,6 +1007,7 @@ This list contains 1075 plugins. :pypi:`pytest-tomato` Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-toolbelt` This is just a collection of utilities for pytest, but don't really belong in pytest proper. Aug 12, 2019 3 - Alpha N/A :pypi:`pytest-toolbox` Numerous useful plugins for pytest. Apr 07, 2018 N/A pytest (>=3.5.0) + :pypi:`pytest-tools` Pytest tools Jul 04, 2022 4 - Beta N/A :pypi:`pytest-tornado` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Jun 17, 2020 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-tornado5` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Nov 16, 2018 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-tornado-yen3` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Oct 15, 2018 5 - Production/Stable N/A @@ -1032,7 +1036,7 @@ This list contains 1075 plugins. :pypi:`pytest-unhandled-exception-exit-code` Plugin for py.test set a different exit code on uncaught exceptions Jun 22, 2020 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) :pypi:`pytest-unmarked` Run only unmarked tests Aug 27, 2019 5 - Production/Stable N/A - :pypi:`pytest-unordered` Test equality of unordered collections in pytest Mar 28, 2021 4 - Beta N/A + :pypi:`pytest-unordered` Test equality of unordered collections in pytest Jul 08, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Jun 10, 2022 4 - Beta N/A :pypi:`pytest-upload-report` pytest-upload-report is a plugin for pytest that upload your test report for test results. Jun 18, 2021 5 - Production/Stable N/A :pypi:`pytest-utils` Some helpers for pytest. Dec 04, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) @@ -1323,7 +1327,7 @@ This list contains 1075 plugins. A pytest plugin for running unit tests within an ansible collection :pypi:`pytest-antilru` - *last release*: Jan 29, 2022, + *last release*: Jul 05, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -1638,9 +1642,9 @@ This list contains 1075 plugins. pytest plugin for URL based testing :pypi:`pytest-bdd` - *last release*: Oct 25, 2021, + *last release*: Jul 07, 2022, *status*: 6 - Mature, - *requires*: pytest (>=4.3) + *requires*: pytest (>=5.0) BDD for pytest @@ -2057,6 +2061,13 @@ This list contains 1075 plugins. pytest plugin to test Check_MK checks + :pypi:`pytest-chunks` + *last release*: Jul 05, 2022, + *status*: N/A, + *requires*: pytest (>=6.0.0) + + Run only a chunk of your test suite + :pypi:`pytest-circleci` *last release*: May 03, 2019, *status*: N/A, @@ -2107,7 +2118,7 @@ This list contains 1075 plugins. Pytest plugin for Click :pypi:`pytest-clld` - *last release*: Nov 29, 2021, + *last release*: Jul 06, 2022, *status*: N/A, *requires*: pytest (>=3.6) @@ -2926,7 +2937,7 @@ This list contains 1075 plugins. A plugin to use docker databases for pytests :pypi:`pytest-docker-fixtures` - *last release*: Nov 23, 2021, + *last release*: Jul 06, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -3262,7 +3273,7 @@ This list contains 1075 plugins. pytest embedded plugin for testing espressif boards via serial ports :pypi:`pytest-embrace` - *last release*: Jul 01, 2022, + *last release*: Jul 05, 2022, *status*: N/A, *requires*: pytest (>=7.0,<8.0) @@ -3577,7 +3588,7 @@ This list contains 1075 plugins. :pypi:`pytest-fastapi-deps` - *last release*: Jun 02, 2022, + *last release*: Jul 03, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -4116,9 +4127,9 @@ This list contains 1075 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jun 23, 2022, + *last release*: Jul 09, 2022, *status*: 3 - Alpha, - *requires*: pytest (==7.1.1) + *requires*: pytest (==7.1.2) Experimental package to automatically extract test plugins for Home Assistant custom components @@ -5075,7 +5086,7 @@ This list contains 1075 plugins. pytest plugin to display test execution output like a mochajs :pypi:`pytest-mock` - *last release*: Jun 24, 2022, + *last release*: Jul 05, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) @@ -5236,7 +5247,7 @@ This list contains 1075 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Jul 01, 2022, + *last release*: Jul 03, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -5390,7 +5401,7 @@ This list contains 1075 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Mar 15, 2022, + *last release*: Jul 07, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -6454,7 +6465,7 @@ This list contains 1075 plugins. Easy to use fixtures to write regression tests. :pypi:`pytest-regtest` - *last release*: Jun 03, 2021, + *last release*: Jul 08, 2022, *status*: N/A, *requires*: N/A @@ -6607,6 +6618,13 @@ This list contains 1075 plugins. A simple plugin to use with pytest + :pypi:`pytest-requests-futures` + *last release*: Jul 06, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest + + Pytest Plugin to Mock Requests Futures + :pypi:`pytest-requires` *last release*: Dec 21, 2021, *status*: 4 - Beta, @@ -6643,7 +6661,7 @@ This list contains 1075 plugins. pytest plugin to re-run tests to eliminate flaky failures :pypi:`pytest-resilient-circuits` - *last release*: May 23, 2022, + *last release*: Jul 07, 2022, *status*: N/A, *requires*: N/A @@ -6804,7 +6822,7 @@ This list contains 1075 plugins. Invoke py.test as distutils command with dependency resolution :pypi:`pytest-run-subprocess` - *last release*: Jul 02, 2022, + *last release*: Jul 03, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6881,7 +6899,7 @@ This list contains 1075 plugins. :pypi:`pytest-sbase` - *last release*: Jul 01, 2022, + *last release*: Jul 08, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6923,7 +6941,7 @@ This list contains 1075 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Jul 01, 2022, + *last release*: Jul 08, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6972,7 +6990,7 @@ This list contains 1075 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Jul 01, 2022, + *last release*: Jul 04, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -7272,6 +7290,13 @@ This list contains 1075 plugins. Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. + :pypi:`pytest-speed` + *last release*: Jul 06, 2022, + *status*: 3 - Alpha, + *requires*: pytest (>=7) + + Modern benchmarking library for python with pytest integration. + :pypi:`pytest-sphinx` *last release*: Mar 30, 2022, *status*: 4 - Beta, @@ -7777,7 +7802,7 @@ This list contains 1075 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-testrail-integrator` - *last release*: May 24, 2022, + *last release*: Jul 04, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) @@ -7868,7 +7893,7 @@ This list contains 1075 plugins. Pytest plugin for time travel :pypi:`pytest-threadleak` - *last release*: Jan 18, 2022, + *last release*: Jul 03, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.1.1) @@ -8000,6 +8025,13 @@ This list contains 1075 plugins. Numerous useful plugins for pytest. + :pypi:`pytest-tools` + *last release*: Jul 04, 2022, + *status*: 4 - Beta, + *requires*: N/A + + Pytest tools + :pypi:`pytest-tornado` *last release*: Jun 17, 2020, *status*: 5 - Production/Stable, @@ -8197,9 +8229,9 @@ This list contains 1075 plugins. Run only unmarked tests :pypi:`pytest-unordered` - *last release*: Mar 28, 2021, + *last release*: Jul 08, 2022, *status*: 4 - Beta, - *requires*: N/A + *requires*: pytest (>=6.0.0) Test equality of unordered collections in pytest From da68c9d5bc191ee88386d2639fe91877b36b02ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Jul 2022 03:02:47 +0000 Subject: [PATCH 299/549] build(deps): Bump pytest-mock in /testing/plugins_integration Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.8.1 to 3.8.2. - [Release notes](https://github.com/pytest-dev/pytest-mock/releases) - [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.8.1...v3.8.2) --- updated-dependencies: - dependency-name: pytest-mock dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 6e61df2790e..a226cb82ebe 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -6,7 +6,7 @@ pytest-cov==3.0.0 pytest-django==4.5.2 pytest-flakes==4.0.5 pytest-html==3.1.1 -pytest-mock==3.8.1 +pytest-mock==3.8.2 pytest-rerunfailures==10.2 pytest-sugar==0.9.4 pytest-trio==0.7.0 From b1948c60acbd47c65e3068313aafb8ffbc14f32c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Jul 2022 03:02:49 +0000 Subject: [PATCH 300/549] build(deps): Bump pytest-sugar in /testing/plugins_integration Bumps [pytest-sugar](https://github.com/Teemu/pytest-sugar) from 0.9.4 to 0.9.5. - [Release notes](https://github.com/Teemu/pytest-sugar/releases) - [Changelog](https://github.com/Teemu/pytest-sugar/blob/master/CHANGES.rst) - [Commits](https://github.com/Teemu/pytest-sugar/commits) --- updated-dependencies: - dependency-name: pytest-sugar dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 6e61df2790e..3c5144023e9 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -8,7 +8,7 @@ pytest-flakes==4.0.5 pytest-html==3.1.1 pytest-mock==3.8.1 pytest-rerunfailures==10.2 -pytest-sugar==0.9.4 +pytest-sugar==0.9.5 pytest-trio==0.7.0 pytest-twisted==1.13.4 twisted==22.4.0 From 9c5b6fbab239ca67bd26c4096b25635bce5bba58 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Jul 2022 03:02:51 +0000 Subject: [PATCH 301/549] build(deps): Bump pytest-bdd in /testing/plugins_integration Bumps [pytest-bdd](https://github.com/pytest-dev/pytest-bdd) from 5.0.0 to 6.0.1. - [Release notes](https://github.com/pytest-dev/pytest-bdd/releases) - [Changelog](https://github.com/pytest-dev/pytest-bdd/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-bdd/compare/5.0.0...6.0.1) --- updated-dependencies: - dependency-name: pytest-bdd dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 6e61df2790e..7bf7ba8e7fc 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,7 +1,7 @@ anyio[curio,trio]==3.6.1 django==4.0.6 pytest-asyncio==0.18.3 -pytest-bdd==5.0.0 +pytest-bdd==6.0.1 pytest-cov==3.0.0 pytest-django==4.5.2 pytest-flakes==4.0.5 From 334d6514c6f4726a0c053e6e1ef9fb369deec762 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 11 Jul 2022 08:27:09 -0300 Subject: [PATCH 302/549] Fix mypy pre-commit run This started to fail recently with: ``` mypy.....................................................................Failed - hook id: mypy - exit code: 1 src/_pytest/assertion/rewrite.py:284: error: Returning Any from function declared to return "TraversableResources" [no-any-return] Found 1 error in 1 file (checked 219 source files) ``` Not sure why that started failing, but seems like ignoring that error specifically is OK. --- src/_pytest/assertion/rewrite.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index a1bbb171b4b..63f9dd8f27b 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -281,7 +281,9 @@ def get_resource_reader(self, name: str) -> importlib.abc.TraversableResources: else: from importlib.resources.readers import FileReader - return FileReader(types.SimpleNamespace(path=self._rewritten_names[name])) + return FileReader( # type:ignore[no-any-return] + types.SimpleNamespace(path=self._rewritten_names[name]) + ) def _write_pyc_fp( From 5c513a5fb3c2725177f5866b31a93a98e7018d62 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 11 Jul 2022 21:57:36 +0000 Subject: [PATCH 303/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v3.3.0 → v3.8.1](https://github.com/asottile/reorder_python_imports/compare/v3.3.0...v3.8.1) - [github.com/asottile/pyupgrade: v2.34.0 → v2.37.1](https://github.com/asottile/pyupgrade/compare/v2.34.0...v2.37.1) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 11757b940bf..6ac38a1d90b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,12 +37,12 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v3.3.0 + rev: v3.8.1 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.34.0 + rev: v2.37.1 hooks: - id: pyupgrade args: [--py37-plus] From 09b2c9532090db84daa3aa1a243f90dc8709fc00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 13 Jul 2022 17:06:33 +0200 Subject: [PATCH 304/549] Adjust tests for a last minute Python 3.11 change in the traceback format See https://github.com/python/cpython/issues/93883 and https://github.com/python/cpython/pull/93994 Fixes https://github.com/pytest-dev/pytest/issues/10131 --- testing/test_doctest.py | 6 +++++- testing/test_main.py | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/testing/test_doctest.py b/testing/test_doctest.py index 828253d3223..2f73feb8c4b 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -223,7 +223,11 @@ def test_doctest_unexpected_exception(self, pytester: Pytester): "Traceback (most recent call last):", ' File "*/doctest.py", line *, in __run', " *", - *((" *^^^^*",) if sys.version_info >= (3, 11) else ()), + *( + (" *^^^^*",) + if (3, 11, 0, "beta", 4) > sys.version_info >= (3, 11) + else () + ), ' File "", line 1, in ', "ZeroDivisionError: division by zero", "*/test_doctest_unexpected_exception.txt:2: UnexpectedException", diff --git a/testing/test_main.py b/testing/test_main.py index 2df51bb7bb9..71597626790 100644 --- a/testing/test_main.py +++ b/testing/test_main.py @@ -47,7 +47,7 @@ def pytest_internalerror(excrepr, excinfo): end_lines = ( result.stdout.lines[-4:] - if sys.version_info >= (3, 11) + if (3, 11, 0, "beta", 4) > sys.version_info >= (3, 11) else result.stdout.lines[-3:] ) @@ -57,7 +57,7 @@ def pytest_internalerror(excrepr, excinfo): 'INTERNALERROR> raise SystemExit("boom")', *( ("INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^",) - if sys.version_info >= (3, 11) + if (3, 11, 0, "beta", 4) > sys.version_info >= (3, 11) else () ), "INTERNALERROR> SystemExit: boom", @@ -68,7 +68,7 @@ def pytest_internalerror(excrepr, excinfo): 'INTERNALERROR> raise ValueError("boom")', *( ("INTERNALERROR> ^^^^^^^^^^^^^^^^^^^^^^^^",) - if sys.version_info >= (3, 11) + if (3, 11, 0, "beta", 4) > sys.version_info >= (3, 11) else () ), "INTERNALERROR> ValueError: boom", From c1d134172cff3787dbfe51cd154af8f8d4b5e556 Mon Sep 17 00:00:00 2001 From: Nipunn Koorapati Date: Thu, 14 Jul 2022 16:36:05 -0700 Subject: [PATCH 305/549] Add typing for FixtureRequest.param (#10133) For now, mark it as Any until #8073 is solved Fixes #9514 --- AUTHORS | 1 + changelog/9514.bugfix.rst | 1 + src/_pytest/fixtures.py | 11 ++++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 changelog/9514.bugfix.rst diff --git a/AUTHORS b/AUTHORS index 09fe12e004f..b0669ba29fd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -252,6 +252,7 @@ Nicholas Murphy Niclas Olofsson Nicolas Delaby Nikolay Kondratyev +Nipunn Koorapati Olga Matoula Oleg Pidsadnyi Oleg Sushchenko diff --git a/changelog/9514.bugfix.rst b/changelog/9514.bugfix.rst new file mode 100644 index 00000000000..a940b5c72d5 --- /dev/null +++ b/changelog/9514.bugfix.rst @@ -0,0 +1 @@ +Type-annotate ``FixtureRequest.param`` as ``Any`` as a stop gap measure until :issue:`8073` is fixed. diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 32c3ec4b0bf..d1d36d7fa24 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -345,7 +345,7 @@ def reorder_items_atscope( return items_done -def get_direct_param_fixture_func(request): +def get_direct_param_fixture_func(request: "FixtureRequest") -> Any: return request.param @@ -407,6 +407,15 @@ def __init__(self, pyfuncitem, *, _ispytest: bool = False) -> None: self._arg2fixturedefs = fixtureinfo.name2fixturedefs.copy() self._arg2index: Dict[str, int] = {} self._fixturemanager: FixtureManager = pyfuncitem.session._fixturemanager + # Notes on the type of `param`: + # -`request.param` is only defined in parametrized fixtures, and will raise + # AttributeError otherwise. Python typing has no notion of "undefined", so + # this cannot be reflected in the type. + # - Technically `param` is only (possibly) defined on SubRequest, not + # FixtureRequest, but the typing of that is still in flux so this cheats. + # - In the future we might consider using a generic for the param type, but + # for now just using Any. + self.param: Any @property def scope(self) -> "_ScopeName": From 70cac3d464905cb3f7cedba9ea4f61dc56613f55 Mon Sep 17 00:00:00 2001 From: Wolfremium <64548160+Wolfremium13@users.noreply.github.com> Date: Fri, 15 Jul 2022 12:40:18 +0100 Subject: [PATCH 306/549] Explicit note that tmpdir fixture is discouraged in favour of tmp_path #9937 (#10138) Co-authored-by: Bruno Oliveira Co-authored-by: kevin.hierro-ext Co-authored-by: Dani Sancas --- AUTHORS | 4 ++++ changelog/9937.doc.rst | 1 + doc/en/how-to/tmp_path.rst | 6 ++++-- src/_pytest/legacypath.py | 14 +++++++++++++- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 changelog/9937.doc.rst diff --git a/AUTHORS b/AUTHORS index b0669ba29fd..b8e6377fb02 100644 --- a/AUTHORS +++ b/AUTHORS @@ -87,6 +87,7 @@ Damian Skrzypczak Daniel Grana Daniel Hahler Daniel Nuri +Daniel Sánchez Castelló Daniel Wandschneider Daniele Procida Danielle Jenkins @@ -190,6 +191,7 @@ Katerina Koukiou Keri Volans Kevin C Kevin Cox +Kevin Hierro Carrasco Kevin J. Foley Kian Eliasi Kian-Meng Ang @@ -328,6 +330,7 @@ Taneli Hukkinen Tanvi Mehta Tarcisio Fischer Tareq Alayan +Tatiana Ovary Ted Xiao Terje Runde Thomas Grainger @@ -346,6 +349,7 @@ Tyler Goodlet Tzu-ping Chung Vasily Kuznetsov Victor Maryama +Victor Rodriguez Victor Uriarte Vidar T. Fauske Virgil Dupras diff --git a/changelog/9937.doc.rst b/changelog/9937.doc.rst new file mode 100644 index 00000000000..326d20ec8f6 --- /dev/null +++ b/changelog/9937.doc.rst @@ -0,0 +1 @@ +Explicit note that :fixture:`tmpdir` fixture is discouraged in favour of :fixture:`tmp_path`. diff --git a/doc/en/how-to/tmp_path.rst b/doc/en/how-to/tmp_path.rst index b261a55637e..99e9e55367a 100644 --- a/doc/en/how-to/tmp_path.rst +++ b/doc/en/how-to/tmp_path.rst @@ -104,8 +104,10 @@ 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 :class:`pathlib.Path` objects. These days, prefer to -use ``tmp_path`` and ``tmp_path_factory``. +rather than standard :class:`pathlib.Path` objects. + +.. note:: + These days, it is preferred to use ``tmp_path`` and ``tmp_path_factory``. See :fixture:`tmpdir ` :fixture:`tmpdir_factory ` API for details. diff --git a/src/_pytest/legacypath.py b/src/_pytest/legacypath.py index 49149311a7d..f71e7e96ead 100644 --- a/src/_pytest/legacypath.py +++ b/src/_pytest/legacypath.py @@ -271,7 +271,14 @@ def testdir(pytester: Pytester) -> Testdir: @attr.s(init=False, auto_attribs=True) class TempdirFactory: """Backward compatibility wrapper that implements :class:`py.path.local` - for :class:`TempPathFactory`.""" + for :class:`TempPathFactory`. + + .. note:: + These days, it is preferred to use ``tmp_path_factory``. + + :ref:`About the tmpdir and tmpdir_factory fixtures`. + + """ _tmppath_factory: TempPathFactory @@ -312,6 +319,11 @@ def tmpdir(tmp_path: Path) -> LEGACY_PATH: The returned object is a `legacy_path`_ object. + .. note:: + These days, it is preferred to use ``tmp_path``. + + :ref:`About the tmpdir and tmpdir_factory fixtures`. + .. _legacy_path: https://py.readthedocs.io/en/latest/path.html """ return legacy_path(tmp_path) From b8e2f42ec1fc552ce145182ab5868cbfa357d0ec Mon Sep 17 00:00:00 2001 From: Stephen Rosen Date: Fri, 15 Jul 2022 19:24:16 +0000 Subject: [PATCH 307/549] Add monkeypatch.context() to how-to doc intro --- doc/en/how-to/monkeypatch.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/en/how-to/monkeypatch.rst b/doc/en/how-to/monkeypatch.rst index 0ae87824030..9214de77edb 100644 --- a/doc/en/how-to/monkeypatch.rst +++ b/doc/en/how-to/monkeypatch.rst @@ -25,6 +25,7 @@ functionality in tests: monkeypatch.delenv(name, raising=True) monkeypatch.syspath_prepend(path) monkeypatch.chdir(path) + monkeypatch.context() All modifications will be undone after the requesting test function or fixture has finished. The ``raising`` @@ -55,6 +56,9 @@ during a test. 5. Use :py:meth:`monkeypatch.syspath_prepend ` to modify ``sys.path`` which will also call ``pkg_resources.fixup_namespace_packages`` and :py:func:`importlib.invalidate_caches`. +6. Use :py:meth:`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. From 4696ba74f90d8eecad453dd08e5f5493d697f2a9 Mon Sep 17 00:00:00 2001 From: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com> Date: Tue, 19 Jul 2022 22:16:14 +0200 Subject: [PATCH 308/549] Fix typo in example/markers docs --- doc/en/example/markers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index 2260dbf423b..34d96c2bc00 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -346,7 +346,7 @@ Custom marker and command line option to control test runs Plugins can provide custom markers and implement specific behaviour based on it. This is a self-contained example which adds a command line option and a parametrized test function marker to run tests -specifies via named environments: +specified via named environments: .. code-block:: python From 8c5487fd6b733de1e0e44194350908ee77e2bf0a Mon Sep 17 00:00:00 2001 From: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com> Date: Wed, 20 Jul 2022 00:01:23 +0200 Subject: [PATCH 309/549] Fix cross-reference in reference/reference docs --- doc/en/reference/reference.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 4ce8ead7173..bdad8fa597d 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -290,7 +290,7 @@ Example for using multiple custom markers: def test_function(): ... -When :meth:`Node.iter_markers <_pytest.nodes.Node.iter_markers>` or :meth:`Node.iter_markers <_pytest.nodes.Node.iter_markers_with_node>` is used with multiple markers, the marker closest to the function will be iterated over first. The above example will result in ``@pytest.mark.slow`` followed by ``@pytest.mark.timeout(...)``. +When :meth:`Node.iter_markers <_pytest.nodes.Node.iter_markers>` or :meth:`Node.iter_markers_with_node <_pytest.nodes.Node.iter_markers_with_node>` is used with multiple markers, the marker closest to the function will be iterated over first. The above example will result in ``@pytest.mark.slow`` followed by ``@pytest.mark.timeout(...)``. .. _`fixtures-api`: From 3bf15135e46ab525d28377cf54e97a6a9516223c Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 24 Jul 2022 00:25:01 +0000 Subject: [PATCH 310/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 258 +++++++++++++++++++------------ 1 file changed, 161 insertions(+), 97 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 0dcf90ac574..03b15620d0d 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1079 plugins. +This list contains 1087 plugins. .. only:: not latex @@ -30,12 +30,12 @@ This list contains 1079 plugins. :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Nov 01, 2020 N/A pytest (>=6) - :pypi:`pytest-aiomoto` pytest-aiomoto Mar 13, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-aiomoto` pytest-aiomoto Jul 10, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A - :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Apr 10, 2022 N/A pytest (>=1.0) + :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Jul 20, 2022 N/A pytest (>=1.0) :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) @@ -73,8 +73,8 @@ This list contains 1079 plugins. :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest - :pypi:`pytest-asyncio` Pytest support for asyncio Mar 25, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. May 02, 2022 N/A N/A + :pypi:`pytest-asyncio` Pytest support for asyncio Jul 15, 2022 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jul 11, 2022 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) :pypi:`pytest-async-sqlalchemy` Database testing fixtures using the SQLAlchemy asyncio API Oct 07, 2021 4 - Beta pytest (>=6.0.0) @@ -96,7 +96,7 @@ This list contains 1079 plugins. :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-bdd` BDD for pytest Jul 07, 2022 6 - Mature pytest (>=5.0) - :pypi:`pytest-bdd-ng` BDD for pytest May 25, 2022 4 - Beta pytest (>=5.0) + :pypi:`pytest-bdd-ng` BDD for pytest Jul 15, 2022 4 - Beta pytest (>=5.0) :pypi:`pytest-bdd-splinter` Common steps for pytest bdd and splinter integration Aug 12, 2019 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-bdd-web` A simple plugin to use with pytest Jan 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A @@ -153,6 +153,8 @@ This list contains 1079 plugins. :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) :pypi:`pytest-checkdocs` check the README when running tests Jul 31, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) + :pypi:`pytest-check-library` check your missing library Jul 17, 2022 N/A N/A + :pypi:`pytest-check-libs` check your missing library Jul 17, 2022 N/A N/A :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest (>=7.0) :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest :pypi:`pytest-chunks` Run only a chunk of your test suite Jul 05, 2022 N/A pytest (>=6.0.0) @@ -217,7 +219,7 @@ This list contains 1079 plugins. :pypi:`pytest-datadir` pytest plugin for test data directories and files Oct 22, 2019 5 - Production/Stable pytest (>=2.7.0) :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Jan 20, 2022 5 - Production/Stable pytest :pypi:`pytest-datadir-ng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Dec 25, 2019 5 - Production/Stable pytest - :pypi:`pytest-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Mar 09, 2022 N/A pytest (>=7.0.1) + :pypi:`pytest-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Jul 19, 2022 N/A pytest (>=7.0.1) :pypi:`pytest-data-file` Fixture "data" and "case_data" for test from yaml file Dec 04, 2019 N/A N/A :pypi:`pytest-datafiles` py.test plugin to create a 'tmpdir' containing predefined files/directories. May 01, 2022 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-datafixtures` Data fixtures for pytest made simple Dec 05, 2020 5 - Production/Stable N/A @@ -231,7 +233,7 @@ This list contains 1079 plugins. :pypi:`pytest-db-plugin` Nov 27, 2021 N/A pytest (>=5.0) :pypi:`pytest-dbt-adapter` A pytest plugin for testing dbt adapter plugins Nov 24, 2021 N/A pytest (<7,>=6) :pypi:`pytest-dbt-conventions` A pytest plugin for linting a dbt project's conventions Mar 02, 2022 N/A pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-dbt-core` Pytest extension for dbt. May 27, 2022 N/A pytest (>=6.2.5) ; extra == 'test' + :pypi:`pytest-dbt-core` Pytest extension for dbt. Jul 22, 2022 N/A pytest (>=6.2.5) ; extra == 'test' :pypi:`pytest-dbus-notification` D-BUS notifications for pytest results. Mar 05, 2014 5 - Production/Stable N/A :pypi:`pytest-deadfixtures` A simple plugin to list unused fixtures in pytest Jul 23, 2020 5 - Production/Stable N/A :pypi:`pytest-deepcov` deepcov Mar 30, 2021 N/A N/A @@ -274,7 +276,7 @@ This list contains 1079 plugins. :pypi:`pytest-doc` A documentation plugin for py.test. Jun 28, 2015 5 - Production/Stable N/A :pypi:`pytest-docfiles` pytest plugin to test codeblocks in your documentation. Dec 22, 2021 4 - Beta pytest (>=3.7.0) :pypi:`pytest-docgen` An RST Documentation Generator for pytest-based test suites Apr 17, 2020 N/A N/A - :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Apr 09, 2022 N/A pytest (<8.0,>=4.0) + :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Jul 22, 2022 N/A pytest (<8.0,>=4.0) :pypi:`pytest-docker-apache-fixtures` Pytest fixtures for testing with apache2 (httpd). Feb 16, 2022 4 - Beta pytest :pypi:`pytest-docker-butla` Jun 16, 2019 3 - Alpha N/A :pypi:`pytest-dockerc` Run, manage and stop Docker Compose project from Docker API Oct 09, 2020 5 - Production/Stable pytest (>=3.0) @@ -299,7 +301,7 @@ This list contains 1079 plugins. :pypi:`pytest-dolphin` Some extra stuff that we use ininternally Nov 30, 2016 4 - Beta pytest (==3.0.4) :pypi:`pytest-doorstop` A pytest plugin for adding test results into doorstop items. Jun 09, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-dotenv` A py.test plugin that parses environment files before running tests Jun 16, 2020 4 - Beta pytest (>=5.0.0) - :pypi:`pytest-drf` A Django REST framework plugin for pytest. Nov 12, 2020 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-drf` A Django REST framework plugin for pytest. Jul 12, 2022 5 - Production/Stable pytest (>=3.7) :pypi:`pytest-drivings` Tool to allow webdriver automation to be ran locally or remotely Jan 13, 2021 N/A N/A :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection May 23, 2020 4 - Beta pytest (>=2.7) :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest @@ -320,14 +322,13 @@ This list contains 1079 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Jun 06, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jun 06, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jun 06, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jun 06, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jun 06, 2022 N/A N/A - :pypi:`pytest-embedded-qemu-idf` pytest embedded plugin for esp-idf project by qemu, not target chip Jun 29, 2021 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jun 06, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jun 06, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Jul 11, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jul 11, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jul 11, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jul 11, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jul 11, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jul 11, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jul 11, 2022 N/A N/A :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jul 05, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) @@ -373,7 +374,7 @@ This list contains 1079 plugins. :pypi:`pytest-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A :pypi:`pytest-fantasy` Pytest plugin for Flask Fantasy Framework Mar 14, 2019 N/A N/A :pypi:`pytest-fastapi` Dec 27, 2020 N/A N/A - :pypi:`pytest-fastapi-deps` A fixture which allows easy replacement of fastapi dependencies for testing Jul 03, 2022 5 - Production/Stable pytest + :pypi:`pytest-fastapi-deps` A fixture which allows easy replacement of fastapi dependencies for testing Jul 20, 2022 5 - Production/Stable pytest :pypi:`pytest-fastest` Use SCM and coverage to run only needed tests Mar 05, 2020 N/A N/A :pypi:`pytest-fast-first` Pytest plugin that runs fast tests first Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-faulthandler` py.test plugin that activates the fault handler module for tests (dummy package) Jul 04, 2019 6 - Mature pytest (>=5.0) @@ -404,6 +405,7 @@ This list contains 1079 plugins. :pypi:`pytest-flask` A set of py.test fixtures to test Flask applications. Feb 27, 2021 5 - Production/Stable pytest (>=5.2) :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) + :pypi:`pytest-fluent` A pytest plugin in order to provide logs via fluentd Jul 12, 2022 4 - Beta pytest :pypi:`pytest-flyte` Pytest fixtures for simplifying Flyte integration testing May 03, 2021 N/A pytest :pypi:`pytest-focus` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-forcefail` py.test plugin to make the test failing regardless of pytest.mark.xfail May 15, 2018 4 - Beta N/A @@ -431,9 +433,9 @@ This list contains 1079 plugins. :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Jul 02, 2022 N/A pytest (>=4.0.0) :pypi:`pytest-github-report` Generate a GitHub report using pytest in GitHub Workflows Jun 03, 2022 4 - Beta N/A :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A - :pypi:`pytest-glamor-allure` Extends allure-pytest functionality May 19, 2022 4 - Beta pytest + :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Jul 22, 2022 4 - Beta pytest :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest - :pypi:`pytest-golden` Plugin for pytest that offloads expected outputs to data files Nov 23, 2020 N/A pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-golden` Plugin for pytest that offloads expected outputs to data files Jul 18, 2022 N/A pytest (>=6.1.2) :pypi:`pytest-google-chat` Notify google chat channel for test results Mar 27, 2022 4 - Beta pytest :pypi:`pytest-graphql-schema` Get graphql schema as fixture for pytest Oct 18, 2019 N/A N/A :pypi:`pytest-greendots` Green progress dots Feb 08, 2014 3 - Alpha N/A @@ -450,7 +452,7 @@ This list contains 1079 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jul 09, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jul 21, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -473,7 +475,7 @@ This list contains 1079 plugins. :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A - :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jun 27, 2022 4 - Beta N/A + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jul 13, 2022 4 - Beta N/A :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Jun 29, 2022 5 - Production/Stable N/A @@ -488,7 +490,7 @@ This list contains 1079 plugins. :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. May 18, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jun 08, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jul 14, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Jun 16, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) @@ -525,7 +527,7 @@ This list contains 1079 plugins. :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) - :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. May 17, 2022 3 - Alpha pytest (>=3.6,<8) + :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. Jul 17, 2022 3 - Alpha pytest (>=3.6,<8) :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 14, 2022 N/A pytest (>=4.2.0) :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A @@ -535,7 +537,7 @@ This list contains 1079 plugins. :pypi:`pytest-leaks` A pytest plugin to trace resource leaks. Nov 27, 2019 1 - Planning N/A :pypi:`pytest-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest. Dec 22, 2018 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Apr 14, 2022 4 - Beta N/A + :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Jul 11, 2022 4 - Beta N/A :pypi:`pytest-libnotify` Pytest plugin that shows notifications about the test run Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-ligo` Jan 16, 2020 4 - Beta N/A :pypi:`pytest-lineno` A pytest plugin to show the line numbers of test functions Dec 04, 2020 N/A pytest @@ -547,7 +549,7 @@ This list contains 1079 plugins. :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Aug 25, 2021 5 - Production/Stable pytest :pypi:`pytest-localserver` py.test plugin to test server connections locally. May 05, 2022 4 - Beta N/A :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Aug 22, 2019 4 - Beta pytest (>=3.3.0) - :pypi:`pytest-lockable` lockable resource plugin for pytest Feb 28, 2022 5 - Production/Stable pytest + :pypi:`pytest-lockable` lockable resource plugin for pytest Jul 20, 2022 5 - Production/Stable pytest :pypi:`pytest-locker` Used to lock object during testing. Essentially changing assertions from being hard coded to asserting that nothing changed Oct 29, 2021 N/A pytest (>=5.4) :pypi:`pytest-log` print log Aug 15, 2021 N/A pytest (>=3.8) :pypi:`pytest-logbook` py.test plugin to capture logbook log messages Nov 23, 2015 5 - Production/Stable pytest (>=2.8) @@ -557,8 +559,10 @@ This list contains 1079 plugins. :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Jul 02, 2022 3 - Alpha pytest + :pypi:`pytest-loop` pytest plugin for looping tests Jul 22, 2022 5 - Production/Stable pytest (>=6) + :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Jul 18, 2022 3 - Alpha pytest :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha pytest (>=6) + :pypi:`pytest-markdoctest` A pytest plugin to doctest your markdown files Jul 22, 2022 4 - Beta pytest (>=6) :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) :pypi:`pytest-markdown-docs` Run markdown code fences through pytest May 12, 2022 N/A N/A :pypi:`pytest-marker-bugzilla` py.test bugzilla integration plugin, using markers Jan 09, 2020 N/A N/A @@ -578,9 +582,10 @@ This list contains 1079 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest May 27, 2022 N/A N/A :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A + :pypi:`pytest-mesh` pytest_mesh插件 Jul 19, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution May 03, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Feb 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-metadata` pytest plugin for test session metadata Mar 26, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) + :pypi:`pytest-metadata` pytest plugin for test session metadata Jul 15, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) @@ -593,7 +598,7 @@ This list contains 1079 plugins. :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Jun 28, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Jul 20, 2022 N/A pytest (>=1.0) :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A @@ -609,9 +614,9 @@ This list contains 1079 plugins. :pypi:`pytest-motor` A pytest plugin for motor, the non-blocking MongoDB driver. Jul 21, 2021 3 - Alpha pytest :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest - :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jun 15, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jul 03, 2022 4 - Beta pytest (>=6) - :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jun 03, 2021 N/A pytest + :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 23, 2022 4 - Beta pytest + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jul 15, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jul 12, 2022 N/A pytest :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Aug 12, 2021 N/A pytest (>=3.6) @@ -632,7 +637,7 @@ This list contains 1079 plugins. :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Jul 07, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Jul 21, 2022 N/A pytest (==6.2.5) :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A :pypi:`pytest-nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Jul 07, 2021 N/A N/A @@ -741,6 +746,7 @@ This list contains 1079 plugins. :pypi:`pytest-pydev` py.test plugin to connect to a remote debug server with PyDev or PyCharm. Nov 15, 2017 3 - Alpha N/A :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Mar 13, 2022 3 - Alpha N/A :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) + :pypi:`pytest-pyodide` "Pytest plugin for testing Pyodide and third-party applications that use Pyodide" Jul 21, 2022 N/A pytest :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) @@ -840,32 +846,33 @@ This list contains 1079 plugins. :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). May 10, 2022 3 - Alpha N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A - :pypi:`pytest-salt-factories` Pytest Salt Plugin Jun 17, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Jul 14, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 08, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 17, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 08, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 17, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A - :pypi:`pytest-servers` pytest servers Jul 04, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-servers` pytest servers Jul 13, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :pypi:`pytest-session2file` pytest-session2file (aka: pytest-session_to_file for v0.1.0 - v0.1.2) is a py.test plugin for capturing and saving to file the stdout of py.test. Jan 26, 2021 3 - Alpha pytest :pypi:`pytest-session-fixture-globalize` py.test plugin to make session fixtures behave as if written in conftest, even if it is written in some modules May 15, 2018 4 - Beta N/A :pypi:`pytest-session_to_file` pytest-session_to_file is a py.test plugin for capturing and saving to file the stdout of py.test. Oct 01, 2015 3 - Alpha N/A :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest + :pypi:`pytest-sharkreport` this is pytest report plugin. Jul 11, 2022 N/A pytest (>=3.5) :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Jun 02, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest @@ -933,10 +940,10 @@ This list contains 1079 plugins. :pypi:`pytest-stubprocess` Provide stub implementations for subprocesses in Python tests Sep 17, 2018 3 - Alpha pytest (>=3.5.0) :pypi:`pytest-study` A pytest plugin to organize long run tests (named studies) without interfering the regular tests Sep 26, 2017 3 - Alpha pytest (>=2.0) :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Feb 09, 2022 5 - Production/Stable pytest (>=4.0.0) - :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Mar 02, 2021 N/A N/A + :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Jul 16, 2022 N/A N/A :pypi:`pytest-subtests` unittest subTest() support and subtests fixture May 26, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A - :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Jul 06, 2020 3 - Alpha N/A + :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Jul 10, 2022 3 - Alpha pytest (>=2.9) :pypi:`pytest-sugar-bugfix159` Workaround for https://github.com/Frozenball/pytest-sugar/issues/159 Nov 07, 2018 5 - Production/Stable pytest (!=3.7.3,>=3.5); extra == 'testing' :pypi:`pytest-super-check` Pytest plugin to check your TestCase classes call super in setUp, tearDown, etc. May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-svn` SVN repository fixture for py.test May 28, 2019 5 - Production/Stable pytest @@ -963,7 +970,7 @@ This list contains 1079 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Jun 19, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Jun 01, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Jul 16, 2022 4 - Beta N/A :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) :pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Jun 13, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) @@ -975,7 +982,7 @@ This list contains 1079 plugins. :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) - :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Jul 04, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Jul 19, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results May 23, 2022 N/A N/A :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A @@ -983,7 +990,7 @@ This list contains 1079 plugins. :pypi:`pytest-testreport-new` May 05, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) - :pypi:`pytest-test-utils` Jun 30, 2022 N/A pytest (>=5) + :pypi:`pytest-test-utils` Jul 14, 2022 N/A pytest (>=5) :pypi:`pytest-tesults` Tesults plugin for pytest Dec 31, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-tezos` pytest-ligo Jan 16, 2020 4 - Beta N/A :pypi:`pytest-th2-bdd` pytest_th2_bdd May 13, 2022 N/A N/A @@ -1048,7 +1055,7 @@ This list contains 1079 plugins. :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Jun 20, 2022 5 - Production/Stable pytest (>=6.2.2) :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest - :pypi:`pytest-ver` Pytest module with Verification Report Apr 17, 2022 2 - Pre-Alpha N/A + :pypi:`pytest-ver` Pytest module with Verification Report Jul 20, 2022 2 - Pre-Alpha N/A :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) :pypi:`pytest-virtualenv` Virtualenv fixture for py.test May 28, 2019 5 - Production/Stable pytest @@ -1059,6 +1066,7 @@ This list contains 1079 plugins. :pypi:`pytest-vw` pytest-vw makes your failing test cases succeed under CI tools scrutiny Oct 07, 2015 4 - Beta N/A :pypi:`pytest-vyper` Plugin for the vyper smart contract language. May 28, 2020 2 - Pre-Alpha N/A :pypi:`pytest-wa-e2e-plugin` Pytest plugin for testing whatsapp bots with end to end tests Feb 18, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-wake` Jul 22, 2022 N/A pytest :pypi:`pytest-watch` Local continuous test runner with pytest and watchdog. May 20, 2018 N/A N/A :pypi:`pytest-watcher` Continiously runs pytest on changes in \*.py files Dec 30, 2021 3 - Alpha N/A :pypi:`pytest-wdl` Pytest plugin for testing WDL workflows. Nov 17, 2020 5 - Production/Stable N/A @@ -1187,9 +1195,9 @@ This list contains 1079 plugins. Pytest \`client\` fixture for the Aiohttp :pypi:`pytest-aiomoto` - *last release*: Mar 13, 2022, + *last release*: Jul 10, 2022, *status*: N/A, - *requires*: pytest (>=6.2.5,<7.0.0) + *requires*: pytest (>=7.0,<8.0) pytest-aiomoto @@ -1222,7 +1230,7 @@ This list contains 1079 plugins. :pypi:`pytest-alembic` - *last release*: Apr 10, 2022, + *last release*: Jul 20, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -1488,14 +1496,14 @@ This list contains 1079 plugins. :pypi:`pytest-asyncio` - *last release*: Mar 25, 2022, + *last release*: Jul 15, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.1.0) Pytest support for asyncio :pypi:`pytest-asyncio-cooperative` - *last release*: May 02, 2022, + *last release*: Jul 11, 2022, *status*: N/A, *requires*: N/A @@ -1649,7 +1657,7 @@ This list contains 1079 plugins. BDD for pytest :pypi:`pytest-bdd-ng` - *last release*: May 25, 2022, + *last release*: Jul 15, 2022, *status*: 4 - Beta, *requires*: pytest (>=5.0) @@ -2047,6 +2055,20 @@ This list contains 1079 plugins. plugin to check if there are ipdb debugs left + :pypi:`pytest-check-library` + *last release*: Jul 17, 2022, + *status*: N/A, + *requires*: N/A + + check your missing library + + :pypi:`pytest-check-libs` + *last release*: Jul 17, 2022, + *status*: N/A, + *requires*: N/A + + check your missing library + :pypi:`pytest-check-links` *last release*: Jul 29, 2020, *status*: N/A, @@ -2496,7 +2518,7 @@ This list contains 1079 plugins. Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. :pypi:`pytest-data-extractor` - *last release*: Mar 09, 2022, + *last release*: Jul 19, 2022, *status*: N/A, *requires*: pytest (>=7.0.1) @@ -2594,7 +2616,7 @@ This list contains 1079 plugins. A pytest plugin for linting a dbt project's conventions :pypi:`pytest-dbt-core` - *last release*: May 27, 2022, + *last release*: Jul 22, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) ; extra == 'test' @@ -2895,7 +2917,7 @@ This list contains 1079 plugins. An RST Documentation Generator for pytest-based test suites :pypi:`pytest-docker` - *last release*: Apr 09, 2022, + *last release*: Jul 22, 2022, *status*: N/A, *requires*: pytest (<8.0,>=4.0) @@ -3070,9 +3092,9 @@ This list contains 1079 plugins. A py.test plugin that parses environment files before running tests :pypi:`pytest-drf` - *last release*: Nov 12, 2020, + *last release*: Jul 12, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=3.6) + *requires*: pytest (>=3.7) A Django REST framework plugin for pytest. @@ -3217,56 +3239,49 @@ This list contains 1079 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Jun 06, 2022, + *last release*: Jul 11, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Jun 06, 2022, + *last release*: Jul 11, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Jun 06, 2022, + *last release*: Jul 11, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Jun 06, 2022, + *last release*: Jul 11, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Jun 06, 2022, + *last release*: Jul 11, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for qemu, not target chip - :pypi:`pytest-embedded-qemu-idf` - *last release*: Jun 29, 2021, - *status*: N/A, - *requires*: N/A - - pytest embedded plugin for esp-idf project by qemu, not target chip - :pypi:`pytest-embedded-serial` - *last release*: Jun 06, 2022, + *last release*: Jul 11, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Jun 06, 2022, + *last release*: Jul 11, 2022, *status*: N/A, *requires*: N/A @@ -3588,7 +3603,7 @@ This list contains 1079 plugins. :pypi:`pytest-fastapi-deps` - *last release*: Jul 03, 2022, + *last release*: Jul 20, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -3804,6 +3819,13 @@ This list contains 1079 plugins. Run tests in transactions using pytest, Flask, and SQLalchemy. + :pypi:`pytest-fluent` + *last release*: Jul 12, 2022, + *status*: 4 - Beta, + *requires*: pytest + + A pytest plugin in order to provide logs via fluentd + :pypi:`pytest-flyte` *last release*: May 03, 2021, *status*: N/A, @@ -3994,7 +4016,7 @@ This list contains 1079 plugins. py.test plugin to ignore the same files as git :pypi:`pytest-glamor-allure` - *last release*: May 19, 2022, + *last release*: Jul 22, 2022, *status*: 4 - Beta, *requires*: pytest @@ -4008,9 +4030,9 @@ This list contains 1079 plugins. Pytest fixtures for testing with gnupg. :pypi:`pytest-golden` - *last release*: Nov 23, 2020, + *last release*: Jul 18, 2022, *status*: N/A, - *requires*: pytest (>=6.1.2,<7.0.0) + *requires*: pytest (>=6.1.2) Plugin for pytest that offloads expected outputs to data files @@ -4127,7 +4149,7 @@ This list contains 1079 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jul 09, 2022, + *last release*: Jul 21, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -4288,7 +4310,7 @@ This list contains 1079 plugins. help hypo module for pytest :pypi:`pytest-ibutsu` - *last release*: Jun 27, 2022, + *last release*: Jul 13, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4393,7 +4415,7 @@ This list contains 1079 plugins. Inmanta tests package :pypi:`pytest-inmanta-lsm` - *last release*: Jun 08, 2022, + *last release*: Jul 14, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4652,7 +4674,7 @@ This list contains 1079 plugins. Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks :pypi:`pytest-lambda` - *last release*: May 17, 2022, + *last release*: Jul 17, 2022, *status*: 3 - Alpha, *requires*: pytest (>=3.6,<8) @@ -4722,7 +4744,7 @@ This list contains 1079 plugins. A python-libfaketime plugin for pytest. :pypi:`pytest-libiio` - *last release*: Apr 14, 2022, + *last release*: Jul 11, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4806,7 +4828,7 @@ This list contains 1079 plugins. Pytest plugin for AWS integration tests :pypi:`pytest-lockable` - *last release*: Feb 28, 2022, + *last release*: Jul 20, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -4875,8 +4897,15 @@ This list contains 1079 plugins. Pytest Loguru + :pypi:`pytest-loop` + *last release*: Jul 22, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest (>=6) + + pytest plugin for looping tests + :pypi:`pytest-lsp` - *last release*: Jul 02, 2022, + *last release*: Jul 18, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -4889,6 +4918,13 @@ This list contains 1079 plugins. pytest marker for marking manual tests + :pypi:`pytest-markdoctest` + *last release*: Jul 22, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=6) + + A pytest plugin to doctest your markdown files + :pypi:`pytest-markdown` *last release*: Jan 15, 2021, *status*: 4 - Beta, @@ -5022,6 +5058,13 @@ This list contains 1079 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals + :pypi:`pytest-mesh` + *last release*: Jul 19, 2022, + *status*: N/A, + *requires*: pytest (==7.1.2) + + pytest_mesh插件 + :pypi:`pytest-message` *last release*: May 03, 2022, *status*: N/A, @@ -5037,7 +5080,7 @@ This list contains 1079 plugins. Pytest to Slack reporting plugin :pypi:`pytest-metadata` - *last release*: Mar 26, 2022, + *last release*: Jul 15, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=3.0.0,<8.0.0) @@ -5128,7 +5171,7 @@ This list contains 1079 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Jun 28, 2022, + *last release*: Jul 20, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -5240,21 +5283,21 @@ This list contains 1079 plugins. pytest plugin to collect information from tests :pypi:`pytest-mpl` - *last release*: Jun 15, 2022, + *last release*: Jul 23, 2022, *status*: 4 - Beta, *requires*: pytest pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Jul 03, 2022, + *last release*: Jul 15, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) low-startup-overhead, scalable, distributed-testing pytest plugin :pypi:`pytest-multi-check` - *last release*: Jun 03, 2021, + *last release*: Jul 12, 2022, *status*: N/A, *requires*: pytest @@ -5401,7 +5444,7 @@ This list contains 1079 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Jul 07, 2022, + *last release*: Jul 21, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -6163,6 +6206,13 @@ This list contains 1079 plugins. pytest plugin to check source code with pylint + :pypi:`pytest-pyodide` + *last release*: Jul 21, 2022, + *status*: N/A, + *requires*: pytest + + "Pytest plugin for testing Pyodide and third-party applications that use Pyodide" + :pypi:`pytest-pypi` *last release*: Mar 04, 2018, *status*: 3 - Alpha, @@ -6857,7 +6907,7 @@ This list contains 1079 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Jun 17, 2022, + *last release*: Jul 14, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -6899,7 +6949,7 @@ This list contains 1079 plugins. :pypi:`pytest-sbase` - *last release*: Jul 08, 2022, + *last release*: Jul 17, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6941,7 +6991,7 @@ This list contains 1079 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Jul 08, 2022, + *last release*: Jul 17, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -6990,7 +7040,7 @@ This list contains 1079 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Jul 04, 2022, + *last release*: Jul 13, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -7038,6 +7088,13 @@ This list contains 1079 plugins. + :pypi:`pytest-sharkreport` + *last release*: Jul 11, 2022, + *status*: N/A, + *requires*: pytest (>=3.5) + + this is pytest report plugin. + :pypi:`pytest-shell` *last release*: Mar 27, 2022, *status*: N/A, @@ -7508,7 +7565,7 @@ This list contains 1079 plugins. A plugin to fake subprocess for pytest :pypi:`pytest-subtesthack` - *last release*: Mar 02, 2021, + *last release*: Jul 16, 2022, *status*: N/A, *requires*: N/A @@ -7529,9 +7586,9 @@ This list contains 1079 plugins. pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. :pypi:`pytest-sugar` - *last release*: Jul 06, 2020, + *last release*: Jul 10, 2022, *status*: 3 - Alpha, - *requires*: N/A + *requires*: pytest (>=2.9) pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). @@ -7718,7 +7775,7 @@ This list contains 1079 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Jun 01, 2022, + *last release*: Jul 16, 2022, *status*: 4 - Beta, *requires*: N/A @@ -7802,7 +7859,7 @@ This list contains 1079 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-testrail-integrator` - *last release*: Jul 04, 2022, + *last release*: Jul 19, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) @@ -7858,7 +7915,7 @@ This list contains 1079 plugins. Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply :pypi:`pytest-test-utils` - *last release*: Jun 30, 2022, + *last release*: Jul 14, 2022, *status*: N/A, *requires*: pytest (>=5) @@ -8313,7 +8370,7 @@ This list contains 1079 plugins. py.test fixture for creating a virtual environment :pypi:`pytest-ver` - *last release*: Apr 17, 2022, + *last release*: Jul 20, 2022, *status*: 2 - Pre-Alpha, *requires*: N/A @@ -8389,6 +8446,13 @@ This list contains 1079 plugins. Pytest plugin for testing whatsapp bots with end to end tests + :pypi:`pytest-wake` + *last release*: Jul 22, 2022, + *status*: N/A, + *requires*: pytest + + + :pypi:`pytest-watch` *last release*: May 20, 2018, *status*: N/A, From dbc1017b08b4cb4f9a112ae677aab2880adfa5be Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Jul 2022 22:19:32 +0000 Subject: [PATCH 311/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v3.8.1 → v3.8.2](https://github.com/asottile/reorder_python_imports/compare/v3.8.1...v3.8.2) - [github.com/asottile/pyupgrade: v2.37.1 → v2.37.2](https://github.com/asottile/pyupgrade/compare/v2.37.1...v2.37.2) - [github.com/asottile/setup-cfg-fmt: v1.20.1 → v1.20.2](https://github.com/asottile/setup-cfg-fmt/compare/v1.20.1...v1.20.2) - [github.com/pre-commit/mirrors-mypy: v0.961 → v0.971](https://github.com/pre-commit/mirrors-mypy/compare/v0.961...v0.971) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6ac38a1d90b..694498b0850 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,17 +37,17 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v3.8.1 + rev: v3.8.2 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.37.1 + rev: v2.37.2 hooks: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.20.1 + rev: v1.20.2 hooks: - id: setup-cfg-fmt args: [--max-py-version=3.10] @@ -56,7 +56,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.961 + rev: v0.971 hooks: - id: mypy files: ^(src/|testing/) From c0e3071fdf21eb5bf46478dc7b707720c7c25f1b Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 31 Jul 2022 00:22:46 +0000 Subject: [PATCH 312/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 130 +++++++++++++++++++------------ 1 file changed, 81 insertions(+), 49 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 03b15620d0d..d03ac689a1d 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1087 plugins. +This list contains 1091 plugins. .. only:: not latex @@ -96,7 +96,8 @@ This list contains 1087 plugins. :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-bdd` BDD for pytest Jul 07, 2022 6 - Mature pytest (>=5.0) - :pypi:`pytest-bdd-ng` BDD for pytest Jul 15, 2022 4 - Beta pytest (>=5.0) + :pypi:`pytest-bdd-html` pytest plugin to display BDD info in HTML test report Jul 25, 2022 3 - Alpha pytest (!=6.0.0,>=5.0) + :pypi:`pytest-bdd-ng` BDD for pytest Jul 24, 2022 4 - Beta pytest (>=5.0) :pypi:`pytest-bdd-splinter` Common steps for pytest bdd and splinter integration Aug 12, 2019 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-bdd-web` A simple plugin to use with pytest Jan 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A @@ -165,6 +166,7 @@ This list contains 1087 plugins. :pypi:`pytest-clarity` A plugin providing an alternative, colourful diff output for failing assertions. Jun 11, 2021 N/A N/A :pypi:`pytest-cldf` Easy quality control for CLDF datasets using pytest May 06, 2019 N/A N/A :pypi:`pytest-click` Pytest plugin for Click Feb 11, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-cli-fixtures` Automatically register fixtures for custom CLI arguments Jul 28, 2022 N/A pytest (~=7.0) :pypi:`pytest-clld` Jul 06, 2022 N/A pytest (>=3.6) :pypi:`pytest-cloud` Distributed tests planner plugin for pytest testing framework. Oct 05, 2020 6 - Mature N/A :pypi:`pytest-cloudflare-worker` pytest plugin for testing cloudflare workers Mar 30, 2021 4 - Beta pytest (>=6.0.0) @@ -226,7 +228,7 @@ This list contains 1087 plugins. :pypi:`pytest-data-from-files` pytest plugin to provide data from files loaded automatically Oct 13, 2021 4 - Beta pytest :pypi:`pytest-dataplugin` A pytest plugin for managing an archive of test data. Sep 16, 2017 1 - Planning N/A :pypi:`pytest-datarecorder` A py.test plugin recording and comparing test output. Apr 20, 2020 5 - Production/Stable pytest - :pypi:`pytest-data-suites` Class-based pytest parametrization Jun 18, 2022 N/A pytest (>=6.0,<8.0) + :pypi:`pytest-data-suites` Class-based pytest parametrization Jul 24, 2022 N/A pytest (>=6.0,<8.0) :pypi:`pytest-datatest` A pytest plugin for test driven data-wrangling (this is the development version of datatest's pytest integration). Oct 15, 2020 4 - Beta pytest (>=3.3) :pypi:`pytest-db` Session scope fixture "db" for mysql query or change Dec 04, 2019 N/A N/A :pypi:`pytest-dbfixtures` Databases fixtures plugin for py.test. Dec 07, 2016 4 - Beta N/A @@ -276,7 +278,7 @@ This list contains 1087 plugins. :pypi:`pytest-doc` A documentation plugin for py.test. Jun 28, 2015 5 - Production/Stable N/A :pypi:`pytest-docfiles` pytest plugin to test codeblocks in your documentation. Dec 22, 2021 4 - Beta pytest (>=3.7.0) :pypi:`pytest-docgen` An RST Documentation Generator for pytest-based test suites Apr 17, 2020 N/A N/A - :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Jul 22, 2022 N/A pytest (<8.0,>=4.0) + :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Jul 27, 2022 N/A pytest (<8.0,>=4.0) :pypi:`pytest-docker-apache-fixtures` Pytest fixtures for testing with apache2 (httpd). Feb 16, 2022 4 - Beta pytest :pypi:`pytest-docker-butla` Jun 16, 2019 3 - Alpha N/A :pypi:`pytest-dockerc` Run, manage and stop Docker Compose project from Docker API Oct 09, 2020 5 - Production/Stable pytest (>=3.0) @@ -322,13 +324,13 @@ This list contains 1087 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Jul 11, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jul 11, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jul 11, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jul 11, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jul 11, 2022 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jul 11, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jul 11, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Jul 28, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jul 28, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jul 28, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jul 28, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jul 28, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jul 28, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jul 28, 2022 N/A N/A :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jul 05, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) @@ -425,7 +427,7 @@ This list contains 1087 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. May 26, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Jul 28, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -444,7 +446,7 @@ This list contains 1087 plugins. :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Jun 10, 2022 5 - Production/Stable N/A :pypi:`pytest-helm-chart` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jun 15, 2020 4 - Beta pytest (>=5.4.2,<6.0.0) - :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. May 11, 2022 4 - Beta pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jul 28, 2022 4 - Beta pytest (>=6.1.2,<7.0.0) :pypi:`pytest-helper` Functions to help in using the pytest testing framework May 31, 2019 5 - Production/Stable N/A :pypi:`pytest-helpers` pytest helpers May 17, 2020 N/A pytest :pypi:`pytest-helpers-namespace` Pytest Helpers Namespace Plugin Dec 29, 2021 5 - Production/Stable pytest (>=6.0.0) @@ -452,7 +454,7 @@ This list contains 1087 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jul 21, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jul 30, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -469,7 +471,7 @@ This list contains 1087 plugins. :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Mar 16, 2022 5 - Production/Stable pytest ; extra == 'test' :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A - :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Jan 27, 2022 3 - Alpha N/A + :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Jul 29, 2022 3 - Alpha N/A :pypi:`pytest-httpx` Send responses to httpx. May 24, 2022 5 - Production/Stable pytest (<8.*,>=6.*) :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A @@ -479,7 +481,7 @@ This list contains 1087 plugins. :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Jun 29, 2022 5 - Production/Stable N/A - :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jan 30, 2022 N/A N/A + :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jul 25, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A :pypi:`pytest-image-diff` Jun 08, 2022 3 - Alpha pytest :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A @@ -582,7 +584,7 @@ This list contains 1087 plugins. :pypi:`pytest-memray` A simple plugin to use with pytest May 27, 2022 N/A N/A :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-mesh` pytest_mesh插件 Jul 19, 2022 N/A pytest (==7.1.2) + :pypi:`pytest-mesh` pytest_mesh插件 Jul 29, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution May 03, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Feb 07, 2022 5 - Production/Stable N/A :pypi:`pytest-metadata` pytest plugin for test session metadata Jul 15, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) @@ -615,7 +617,7 @@ This list contains 1087 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 23, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jul 15, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jul 29, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jul 12, 2022 N/A pytest :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A @@ -649,7 +651,7 @@ This list contains 1087 plugins. :pypi:`pytest-notifier` A pytest plugin to notify test result Jun 12, 2020 3 - Alpha pytest :pypi:`pytest-notimplemented` Pytest markers for not implemented features and tests. Aug 27, 2019 N/A pytest (>=5.1,<6.0) :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A - :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Mar 16, 2022 4 - Beta pytest (>=4.6.0) + :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Jul 26, 2022 4 - Beta N/A :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jun 02, 2022 5 - Production/Stable pytest :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A :pypi:`pytest-odoo` py.test plugin to run Odoo tests Feb 08, 2022 4 - Beta N/A @@ -746,7 +748,7 @@ This list contains 1087 plugins. :pypi:`pytest-pydev` py.test plugin to connect to a remote debug server with PyDev or PyCharm. Nov 15, 2017 3 - Alpha N/A :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Mar 13, 2022 3 - Alpha N/A :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) - :pypi:`pytest-pyodide` "Pytest plugin for testing Pyodide and third-party applications that use Pyodide" Jul 21, 2022 N/A pytest + :pypi:`pytest-pyodide` "Pytest plugin for testing Pyodide and third-party applications that use Pyodide" Jul 28, 2022 N/A pytest :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) @@ -865,7 +867,7 @@ This list contains 1087 plugins. :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A - :pypi:`pytest-servers` pytest servers Jul 13, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-servers` pytest servers Jul 25, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :pypi:`pytest-session2file` pytest-session2file (aka: pytest-session_to_file for v0.1.0 - v0.1.2) is a py.test plugin for capturing and saving to file the stdout of py.test. Jan 26, 2021 3 - Alpha pytest :pypi:`pytest-session-fixture-globalize` py.test plugin to make session fixtures behave as if written in conftest, even if it is written in some modules May 15, 2018 4 - Beta N/A @@ -874,7 +876,7 @@ This list contains 1087 plugins. :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest :pypi:`pytest-sharkreport` this is pytest report plugin. Jul 11, 2022 N/A pytest (>=3.5) :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A - :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Jun 02, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Jul 28, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 5 - Production/Stable pytest (>=3.5.1) :pypi:`pytest-shortcuts` Expand command-line shortcuts listed in pytest configuration Oct 29, 2020 4 - Beta pytest (>=3.5.0) @@ -918,6 +920,7 @@ This list contains 1087 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A + :pypi:`pytest-splunk` Jul 29, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons May 26, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) @@ -983,7 +986,7 @@ This list contains 1087 plugins. :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Jul 19, 2022 N/A pytest (>=6.2.5) - :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results May 23, 2022 N/A N/A + :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Jul 26, 2022 N/A pytest (>=3.6) :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A :pypi:`pytest-testreport` May 23, 2022 4 - Beta pytest (>=3.5.0) @@ -1031,7 +1034,7 @@ This list contains 1087 plugins. :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Apr 27, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A - :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, automatically launched after your test run is finished May 02, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, automatically launched after your test run is finished Jul 30, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A @@ -1086,6 +1089,7 @@ This list contains 1087 plugins. :pypi:`pytest-xfaillist` Maintain a xfaillist in an additional file to avoid merge-conflicts. Sep 17, 2021 N/A pytest (>=6.2.2,<7.0.0) :pypi:`pytest-xfiles` Pytest fixtures providing data read from function, module or package related (x)files. Feb 27, 2018 N/A N/A :pypi:`pytest-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A + :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Jul 28, 2022 N/A N/A :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. May 24, 2022 4 - Beta pytest (>=2.8) :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A @@ -1656,8 +1660,15 @@ This list contains 1087 plugins. BDD for pytest + :pypi:`pytest-bdd-html` + *last release*: Jul 25, 2022, + *status*: 3 - Alpha, + *requires*: pytest (!=6.0.0,>=5.0) + + pytest plugin to display BDD info in HTML test report + :pypi:`pytest-bdd-ng` - *last release*: Jul 15, 2022, + *last release*: Jul 24, 2022, *status*: 4 - Beta, *requires*: pytest (>=5.0) @@ -2139,6 +2150,13 @@ This list contains 1087 plugins. Pytest plugin for Click + :pypi:`pytest-cli-fixtures` + *last release*: Jul 28, 2022, + *status*: N/A, + *requires*: pytest (~=7.0) + + Automatically register fixtures for custom CLI arguments + :pypi:`pytest-clld` *last release*: Jul 06, 2022, *status*: N/A, @@ -2567,7 +2585,7 @@ This list contains 1087 plugins. A py.test plugin recording and comparing test output. :pypi:`pytest-data-suites` - *last release*: Jun 18, 2022, + *last release*: Jul 24, 2022, *status*: N/A, *requires*: pytest (>=6.0,<8.0) @@ -2917,7 +2935,7 @@ This list contains 1087 plugins. An RST Documentation Generator for pytest-based test suites :pypi:`pytest-docker` - *last release*: Jul 22, 2022, + *last release*: Jul 27, 2022, *status*: N/A, *requires*: pytest (<8.0,>=4.0) @@ -3239,49 +3257,49 @@ This list contains 1087 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Jul 11, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Jul 11, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Jul 11, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Jul 11, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Jul 11, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Jul 11, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Jul 11, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: N/A @@ -3960,7 +3978,7 @@ This list contains 1087 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: May 26, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: N/A @@ -4093,7 +4111,7 @@ This list contains 1087 plugins. A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. :pypi:`pytest-helm-charts` - *last release*: May 11, 2022, + *last release*: Jul 28, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.1.2,<7.0.0) @@ -4149,7 +4167,7 @@ This list contains 1087 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jul 21, 2022, + *last release*: Jul 30, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -4268,7 +4286,7 @@ This list contains 1087 plugins. A thin wrapper of HTTPretty for pytest :pypi:`pytest-httpserver` - *last release*: Jan 27, 2022, + *last release*: Jul 29, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -4338,7 +4356,7 @@ This list contains 1087 plugins. A pytest plugin to help with testing idem projects :pypi:`pytest-idempotent` - *last release*: Jan 30, 2022, + *last release*: Jul 25, 2022, *status*: N/A, *requires*: N/A @@ -5059,7 +5077,7 @@ This list contains 1087 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mesh` - *last release*: Jul 19, 2022, + *last release*: Jul 29, 2022, *status*: N/A, *requires*: pytest (==7.1.2) @@ -5290,7 +5308,7 @@ This list contains 1087 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Jul 15, 2022, + *last release*: Jul 29, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -5528,9 +5546,9 @@ This list contains 1087 plugins. A PyTest Reporter to send test runs to Notion.so :pypi:`pytest-nunit` - *last release*: Mar 16, 2022, + *last release*: Jul 26, 2022, *status*: 4 - Beta, - *requires*: pytest (>=4.6.0) + *requires*: N/A A pytest plugin for generating NUnit3 test result XML output @@ -6207,7 +6225,7 @@ This list contains 1087 plugins. pytest plugin to check source code with pylint :pypi:`pytest-pyodide` - *last release*: Jul 21, 2022, + *last release*: Jul 28, 2022, *status*: N/A, *requires*: pytest @@ -7040,7 +7058,7 @@ This list contains 1087 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Jul 13, 2022, + *last release*: Jul 25, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -7103,7 +7121,7 @@ This list contains 1087 plugins. A pytest plugin to help with testing shell scripts / black box commands :pypi:`pytest-shell-utilities` - *last release*: Jun 02, 2022, + *last release*: Jul 28, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -7410,6 +7428,13 @@ This list contains 1087 plugins. + :pypi:`pytest-splunk` + *last release*: Jul 29, 2022, + *status*: N/A, + *requires*: pytest (>5.4.0,<6.3) + + + :pypi:`pytest-splunk-addon` *last release*: May 26, 2022, *status*: N/A, @@ -7866,9 +7891,9 @@ This list contains 1087 plugins. Pytest plugin for sending report to testrail system. :pypi:`pytest-testrail-ns` - *last release*: May 23, 2022, + *last release*: Jul 26, 2022, *status*: N/A, - *requires*: N/A + *requires*: pytest (>=3.6) pytest plugin for creating TestRail runs and adding results @@ -8202,7 +8227,7 @@ This list contains 1087 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: May 02, 2022, + *last release*: Jul 30, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.5) @@ -8586,6 +8611,13 @@ This list contains 1087 plugins. Extended logging for test and decorators + :pypi:`pytest-xlsx` + *last release*: Jul 28, 2022, + *status*: N/A, + *requires*: N/A + + pytest plugin for generating test cases by xlsx(excel) + :pypi:`pytest-xpara` *last release*: Oct 30, 2017, *status*: 3 - Alpha, From 1c31a7e6598ff0290012f56c4ee6ce48a31486d9 Mon Sep 17 00:00:00 2001 From: Robert O'Shea Date: Sun, 31 Jul 2022 14:44:02 +0100 Subject: [PATCH 313/549] Added file-like methods to DontReadFromInput (#10173) Co-authored-by: Bruno Oliveira Fixes #10150 --- changelog/10150.bugfix.rst | 1 + src/_pytest/capture.py | 27 +++++++++++++++++++++++++++ testing/test_capture.py | 9 +++++++++ 3 files changed, 37 insertions(+) create mode 100644 changelog/10150.bugfix.rst diff --git a/changelog/10150.bugfix.rst b/changelog/10150.bugfix.rst new file mode 100644 index 00000000000..24c7ccd355a --- /dev/null +++ b/changelog/10150.bugfix.rst @@ -0,0 +1 @@ +:data:`sys.stdin` now contains all expected methods of a file-like object when capture is enabled. diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index d6cf42c3b51..bcfd3449f29 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -203,12 +203,39 @@ def __iter__(self): def fileno(self) -> int: raise UnsupportedOperation("redirected stdin is pseudofile, has no fileno()") + def flush(self) -> None: + raise UnsupportedOperation("redirected stdin is pseudofile, has no flush()") + def isatty(self) -> bool: return False def close(self) -> None: pass + def readable(self) -> bool: + return False + + def seek(self, offset: int) -> int: + raise UnsupportedOperation("redirected stdin is pseudofile, has no seek(int)") + + def seekable(self) -> bool: + return False + + def tell(self) -> int: + raise UnsupportedOperation("redirected stdin is pseudofile, has no tell()") + + def truncate(self, size: int) -> None: + raise UnsupportedOperation("cannont truncate stdin") + + def write(self, *args) -> None: + raise UnsupportedOperation("cannot write to stdin") + + def writelines(self, *args) -> None: + raise UnsupportedOperation("Cannot write to stdin") + + def writable(self) -> bool: + return False + @property def buffer(self): return self diff --git a/testing/test_capture.py b/testing/test_capture.py index f0c582b6651..00cab19330b 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -897,6 +897,15 @@ def test_dontreadfrominput() -> None: iter_f = iter(f) pytest.raises(OSError, next, iter_f) pytest.raises(UnsupportedOperation, f.fileno) + pytest.raises(UnsupportedOperation, f.flush) + assert not f.readable() + pytest.raises(UnsupportedOperation, f.seek, 0) + assert not f.seekable() + pytest.raises(UnsupportedOperation, f.tell) + pytest.raises(UnsupportedOperation, f.truncate, 0) + pytest.raises(UnsupportedOperation, f.write, b"") + pytest.raises(UnsupportedOperation, f.writelines, []) + assert not f.writable() f.close() # just for completeness From 58cf20edf08d84c5baf08f0566cc9bccbc4ec7fd Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 8 Aug 2022 10:14:49 +0100 Subject: [PATCH 314/549] Update :class:`pytest.PytestUnhandledCoroutineWarning` to a deprecation; it will raise an error in pytest 8. [SQUASH] (#10012) Co-authored-by: Bruno Oliveira --- changelog/10012.deprecation.rst | 1 + src/_pytest/warning_types.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 changelog/10012.deprecation.rst diff --git a/changelog/10012.deprecation.rst b/changelog/10012.deprecation.rst new file mode 100644 index 00000000000..66681263e32 --- /dev/null +++ b/changelog/10012.deprecation.rst @@ -0,0 +1 @@ +Update :class:`pytest.PytestUnhandledCoroutineWarning` to a deprecation; it will raise an error in pytest 8. diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index ebfeb87d842..c32ce80ccb1 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -55,7 +55,6 @@ class PytestRemovedIn8Warning(PytestDeprecationWarning): __module__ = "pytest" -@final class PytestReturnNotNoneWarning(PytestDeprecationWarning): """Warning emitted when a test function is returning value other than None.""" @@ -82,7 +81,7 @@ def simple(cls, apiname: str) -> "PytestExperimentalApiWarning": @final -class PytestUnhandledCoroutineWarning(PytestWarning): +class PytestUnhandledCoroutineWarning(PytestReturnNotNoneWarning): """Warning emitted for an unhandled coroutine. A coroutine was encountered when collecting test functions, but was not From abd5df4b3cf6c133e136be781aaf1091a22038e0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 12 Aug 2022 11:06:48 +0200 Subject: [PATCH 315/549] [automated] Update plugin list (#10194) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 162 ++++++++++++++++++------------- 1 file changed, 93 insertions(+), 69 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index d03ac689a1d..235628055ef 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1091 plugins. +This list contains 1094 plugins. .. only:: not latex @@ -35,7 +35,7 @@ This list contains 1091 plugins. :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A - :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Jul 20, 2022 N/A pytest (>=1.0) + :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Aug 03, 2022 N/A pytest (>=1.0) :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) @@ -44,7 +44,7 @@ This list contains 1091 plugins. :pypi:`pytest-allure-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-android` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Feb 21, 2019 3 - Alpha pytest - :pypi:`pytest-anki` A pytest plugin for testing Anki add-ons Jun 20, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-anki` A pytest plugin for testing Anki add-ons Jul 31, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-annotate` pytest-annotate: Generate PyAnnotate annotations from your pytest tests. Jun 07, 2022 3 - Alpha pytest (<8.0.0,>=3.2.0) :pypi:`pytest-ansible` Plugin for py.test to simplify calling ansible modules from tests or fixtures May 25, 2021 5 - Production/Stable N/A :pypi:`pytest-ansible-playbook` Pytest fixture which runs given ansible playbook file. Mar 08, 2019 4 - Beta N/A @@ -69,6 +69,7 @@ This list contains 1091 plugins. :pypi:`pytest-assertutil` pytest-assertutil May 10, 2019 N/A N/A :pypi:`pytest-assert-utils` Useful assertion utilities for use with pytest Apr 14, 2022 3 - Alpha N/A :pypi:`pytest-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) + :pypi:`pytest-assurka` A pytest plugin for Assurka Studio Aug 04, 2022 N/A N/A :pypi:`pytest-ast-back-to-python` A plugin for pytest devs to view how assertion rewriting recodes the AST Sep 29, 2019 4 - Beta N/A :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) @@ -84,7 +85,7 @@ This list contains 1091 plugins. :pypi:`pytest-autocap` automatically capture test & fixture stdout/stderr to files May 15, 2022 N/A pytest (<7.2,>=7.1.2) :pypi:`pytest-autochecklog` automatically check condition and log all the checks Apr 25, 2015 4 - Beta N/A :pypi:`pytest-automation` pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. May 20, 2022 N/A pytest (>=7.0.0) - :pypi:`pytest-automock` Pytest plugin for automatical mocks creation Feb 01, 2022 N/A pytest ; extra == 'dev' + :pypi:`pytest-automock` Pytest plugin for automatical mocks creation Aug 04, 2022 N/A pytest ; extra == 'dev' :pypi:`pytest-auto-parametrize` pytest plugin: avoid repeating arguments in parametrize Oct 02, 2016 3 - Alpha N/A :pypi:`pytest-autotest` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Aug 25, 2021 N/A pytest :pypi:`pytest-avoidance` Makes pytest skip tests that don not need rerunning May 23, 2019 4 - Beta pytest (>=3.5.0) @@ -179,6 +180,7 @@ This list contains 1091 plugins. :pypi:`pytest-codestyle` pytest plugin to run pycodestyle Mar 23, 2020 3 - Alpha N/A :pypi:`pytest-collect-formatter` Formatter for pytest collect output Mar 29, 2021 5 - Production/Stable N/A :pypi:`pytest-collect-formatter2` Formatter for pytest collect output May 31, 2021 5 - Production/Stable N/A + :pypi:`pytest-collector` Python package for collecting pytest. Aug 02, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-colordots` Colorizes the progress indicators Oct 06, 2017 5 - Production/Stable N/A :pypi:`pytest-commander` An interactive GUI test runner for PyTest Aug 17, 2021 N/A pytest (<7.0.0,>=6.2.4) :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method May 15, 2022 N/A pytest (>=3.6,<8) @@ -324,13 +326,13 @@ This list contains 1091 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Jul 28, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jul 28, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jul 28, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jul 28, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jul 28, 2022 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jul 28, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jul 28, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Aug 04, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Aug 04, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Aug 04, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Aug 04, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Aug 04, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Aug 04, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Aug 04, 2022 N/A N/A :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jul 05, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) @@ -446,7 +448,7 @@ This list contains 1091 plugins. :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Jun 10, 2022 5 - Production/Stable N/A :pypi:`pytest-helm-chart` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jun 15, 2020 4 - Beta pytest (>=5.4.2,<6.0.0) - :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jul 28, 2022 4 - Beta pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Aug 03, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) :pypi:`pytest-helper` Functions to help in using the pytest testing framework May 31, 2019 5 - Production/Stable N/A :pypi:`pytest-helpers` pytest helpers May 17, 2020 N/A pytest :pypi:`pytest-helpers-namespace` Pytest Helpers Namespace Plugin Dec 29, 2021 5 - Production/Stable pytest (>=6.0.0) @@ -454,7 +456,7 @@ This list contains 1091 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jul 30, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 05, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -477,7 +479,7 @@ This list contains 1091 plugins. :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A - :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Jul 13, 2022 4 - Beta N/A + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Aug 05, 2022 4 - Beta N/A :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Jun 29, 2022 5 - Production/Stable N/A @@ -514,10 +516,11 @@ This list contains 1091 plugins. :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY May 23, 2022 4 - Beta pytest + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Aug 05, 2022 4 - Beta pytest :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A + :pypi:`pytest-json-fixtures` JSON output for the --fixtures flag Aug 03, 2022 4 - Beta pytest (>=7.1.0) :pypi:`pytest-jsonlint` UNKNOWN Aug 04, 2016 N/A N/A :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Mar 15, 2022 4 - Beta pytest (>=3.8.0) :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 24, 2021 N/A pytest @@ -563,7 +566,7 @@ This list contains 1091 plugins. :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A :pypi:`pytest-loop` pytest plugin for looping tests Jul 22, 2022 5 - Production/Stable pytest (>=6) :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Jul 18, 2022 3 - Alpha pytest - :pypi:`pytest-manual-marker` pytest marker for marking manual tests Oct 11, 2021 3 - Alpha pytest (>=6) + :pypi:`pytest-manual-marker` pytest marker for marking manual tests Aug 04, 2022 3 - Alpha N/A :pypi:`pytest-markdoctest` A pytest plugin to doctest your markdown files Jul 22, 2022 4 - Beta pytest (>=6) :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) :pypi:`pytest-markdown-docs` Run markdown code fences through pytest May 12, 2022 N/A N/A @@ -579,13 +582,13 @@ This list contains 1091 plugins. :pypi:`pytest-maybe-raises` Pytest fixture for optional exception testing. May 27, 2022 N/A pytest ; extra == 'dev' :pypi:`pytest-mccabe` pytest plugin to run the mccabe code complexity checker. Jul 22, 2020 3 - Alpha pytest (>=5.4.0) :pypi:`pytest-md` Plugin for generating Markdown reports for pytest results Jul 11, 2019 3 - Alpha pytest (>=4.2.1) - :pypi:`pytest-md-report` A pytest plugin to make a test results report with Markdown table format. Feb 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) + :pypi:`pytest-md-report` A pytest plugin to make a test results report with Markdown table format. Aug 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :pypi:`pytest-memprof` Estimates memory consumption of test functions Mar 29, 2019 4 - Beta N/A :pypi:`pytest-memray` A simple plugin to use with pytest May 27, 2022 N/A N/A :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-mesh` pytest_mesh插件 Jul 29, 2022 N/A pytest (==7.1.2) - :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution May 03, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) + :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Feb 07, 2022 5 - Production/Stable N/A :pypi:`pytest-metadata` pytest plugin for test session metadata Jul 15, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest @@ -617,7 +620,7 @@ This list contains 1091 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 23, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Jul 29, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Aug 01, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jul 12, 2022 N/A pytest :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A @@ -652,7 +655,7 @@ This list contains 1091 plugins. :pypi:`pytest-notimplemented` Pytest markers for not implemented features and tests. Aug 27, 2019 N/A pytest (>=5.1,<6.0) :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Jul 26, 2022 4 - Beta N/A - :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jun 02, 2022 5 - Production/Stable pytest + :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jul 31, 2022 5 - Production/Stable pytest :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A :pypi:`pytest-odoo` py.test plugin to run Odoo tests Feb 08, 2022 4 - Beta N/A :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A @@ -748,7 +751,7 @@ This list contains 1091 plugins. :pypi:`pytest-pydev` py.test plugin to connect to a remote debug server with PyDev or PyCharm. Nov 15, 2017 3 - Alpha N/A :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Mar 13, 2022 3 - Alpha N/A :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) - :pypi:`pytest-pyodide` "Pytest plugin for testing Pyodide and third-party applications that use Pyodide" Jul 28, 2022 N/A pytest + :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Aug 04, 2022 N/A pytest :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) @@ -827,7 +830,7 @@ This list contains 1091 plugins. :pypi:`pytest-responses` py.test integration for responses Apr 26, 2021 N/A pytest (>=2.5) :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A - :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Jun 01, 2022 N/A pytest (>=7.0.0) + :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Aug 05, 2022 N/A pytest (>=7.0.0) :pypi:`pytest-reverse` Pytest plugin to reverse test order. May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) @@ -837,7 +840,7 @@ This list contains 1091 plugins. :pypi:`pytest-rocketchat` Pytest to Rocket.Chat reporting plugin Apr 18, 2021 5 - Production/Stable N/A :pypi:`pytest-rotest` Pytest integration with rotest Sep 08, 2019 N/A pytest (>=3.5.0) :pypi:`pytest-rpc` Extend py.test for RPC OpenStack testing. Feb 22, 2019 4 - Beta pytest (~=3.6) - :pypi:`pytest-rst` Test code from RST documents with pytest Sep 21, 2021 N/A pytest + :pypi:`pytest-rst` Test code from RST documents with pytest Aug 02, 2022 N/A N/A :pypi:`pytest-rt` pytest data collector plugin for Testgr May 05, 2022 N/A N/A :pypi:`pytest-rts` Coverage-based regression test selection (RTS) plugin for pytest May 17, 2021 N/A pytest :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest @@ -854,13 +857,13 @@ This list contains 1091 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jul 17, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 05, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jul 17, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 05, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -920,7 +923,6 @@ This list contains 1091 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk` Jul 29, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons May 26, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) @@ -985,7 +987,7 @@ This list contains 1091 plugins. :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) - :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Jul 19, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Aug 01, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Jul 26, 2022 N/A pytest (>=3.6) :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A @@ -1034,7 +1036,8 @@ This list contains 1091 plugins. :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Apr 27, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A - :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, automatically launched after your test run is finished Jul 30, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, automatically launched after your test run is finished Aug 03, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A @@ -1089,7 +1092,7 @@ This list contains 1091 plugins. :pypi:`pytest-xfaillist` Maintain a xfaillist in an additional file to avoid merge-conflicts. Sep 17, 2021 N/A pytest (>=6.2.2,<7.0.0) :pypi:`pytest-xfiles` Pytest fixtures providing data read from function, module or package related (x)files. Feb 27, 2018 N/A N/A :pypi:`pytest-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A - :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Jul 28, 2022 N/A N/A + :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Aug 04, 2022 N/A N/A :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. May 24, 2022 4 - Beta pytest (>=2.8) :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A @@ -1234,7 +1237,7 @@ This list contains 1091 plugins. :pypi:`pytest-alembic` - *last release*: Jul 20, 2022, + *last release*: Aug 03, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -1297,7 +1300,7 @@ This list contains 1091 plugins. This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. :pypi:`pytest-anki` - *last release*: Jun 20, 2022, + *last release*: Jul 31, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) @@ -1471,6 +1474,13 @@ This list contains 1091 plugins. A pytest plugin that allows multiple failures per test + :pypi:`pytest-assurka` + *last release*: Aug 04, 2022, + *status*: N/A, + *requires*: N/A + + A pytest plugin for Assurka Studio + :pypi:`pytest-ast-back-to-python` *last release*: Sep 29, 2019, *status*: 4 - Beta, @@ -1577,7 +1587,7 @@ This list contains 1091 plugins. pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. :pypi:`pytest-automock` - *last release*: Feb 01, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: pytest ; extra == 'dev' @@ -2241,6 +2251,13 @@ This list contains 1091 plugins. Formatter for pytest collect output + :pypi:`pytest-collector` + *last release*: Aug 02, 2022, + *status*: N/A, + *requires*: pytest (>=7.0,<8.0) + + Python package for collecting pytest. + :pypi:`pytest-colordots` *last release*: Oct 06, 2017, *status*: 5 - Production/Stable, @@ -3257,49 +3274,49 @@ This list contains 1091 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: N/A @@ -4111,9 +4128,9 @@ This list contains 1091 plugins. A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. :pypi:`pytest-helm-charts` - *last release*: Jul 28, 2022, + *last release*: Aug 03, 2022, *status*: 4 - Beta, - *requires*: pytest (>=6.1.2,<7.0.0) + *requires*: pytest (>=7.1.2,<8.0.0) A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. @@ -4167,7 +4184,7 @@ This list contains 1091 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jul 30, 2022, + *last release*: Aug 05, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -4328,7 +4345,7 @@ This list contains 1091 plugins. help hypo module for pytest :pypi:`pytest-ibutsu` - *last release*: Jul 13, 2022, + *last release*: Aug 05, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4587,7 +4604,7 @@ This list contains 1091 plugins. py.test JIRA integration plugin, using markers :pypi:`pytest-jira-xray` - *last release*: May 23, 2022, + *last release*: Aug 05, 2022, *status*: 4 - Beta, *requires*: pytest @@ -4614,6 +4631,13 @@ This list contains 1091 plugins. Generate JSON test reports + :pypi:`pytest-json-fixtures` + *last release*: Aug 03, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=7.1.0) + + JSON output for the --fixtures flag + :pypi:`pytest-jsonlint` *last release*: Aug 04, 2016, *status*: N/A, @@ -4930,9 +4954,9 @@ This list contains 1091 plugins. Pytest plugin for end-to-end testing of language servers :pypi:`pytest-manual-marker` - *last release*: Oct 11, 2021, + *last release*: Aug 04, 2022, *status*: 3 - Alpha, - *requires*: pytest (>=6) + *requires*: N/A pytest marker for marking manual tests @@ -5042,7 +5066,7 @@ This list contains 1091 plugins. Plugin for generating Markdown reports for pytest results :pypi:`pytest-md-report` - *last release*: Feb 06, 2022, + *last release*: Aug 06, 2022, *status*: 4 - Beta, *requires*: pytest (!=6.0.0,<8,>=3.3.2) @@ -5077,14 +5101,14 @@ This list contains 1091 plugins. pytest plugin to write integration tests for projects using Mercurial Python internals :pypi:`pytest-mesh` - *last release*: Jul 29, 2022, + *last release*: Aug 05, 2022, *status*: N/A, *requires*: pytest (==7.1.2) pytest_mesh插件 :pypi:`pytest-message` - *last release*: May 03, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) @@ -5308,7 +5332,7 @@ This list contains 1091 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Jul 29, 2022, + *last release*: Aug 01, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -5553,7 +5577,7 @@ This list contains 1091 plugins. A pytest plugin for generating NUnit3 test result XML output :pypi:`pytest-object-getter` - *last release*: Jun 02, 2022, + *last release*: Jul 31, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6225,11 +6249,11 @@ This list contains 1091 plugins. pytest plugin to check source code with pylint :pypi:`pytest-pyodide` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: pytest - "Pytest plugin for testing Pyodide and third-party applications that use Pyodide" + "Pytest plugin for testing applications that use Pyodide" :pypi:`pytest-pypi` *last release*: Mar 04, 2018, @@ -6778,7 +6802,7 @@ This list contains 1091 plugins. A RethinkDB plugin for pytest. :pypi:`pytest-retry` - *last release*: Jun 01, 2022, + *last release*: Aug 05, 2022, *status*: N/A, *requires*: pytest (>=7.0.0) @@ -6848,9 +6872,9 @@ This list contains 1091 plugins. Extend py.test for RPC OpenStack testing. :pypi:`pytest-rst` - *last release*: Sep 21, 2021, + *last release*: Aug 02, 2022, *status*: N/A, - *requires*: pytest + *requires*: N/A Test code from RST documents with pytest @@ -6967,7 +6991,7 @@ This list contains 1091 plugins. :pypi:`pytest-sbase` - *last release*: Jul 17, 2022, + *last release*: Aug 05, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7009,7 +7033,7 @@ This list contains 1091 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Jul 17, 2022, + *last release*: Aug 05, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7428,13 +7452,6 @@ This list contains 1091 plugins. - :pypi:`pytest-splunk` - *last release*: Jul 29, 2022, - *status*: N/A, - *requires*: pytest (>5.4.0,<6.3) - - - :pypi:`pytest-splunk-addon` *last release*: May 26, 2022, *status*: N/A, @@ -7884,7 +7901,7 @@ This list contains 1091 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-testrail-integrator` - *last release*: Jul 19, 2022, + *last release*: Aug 01, 2022, *status*: N/A, *requires*: pytest (>=6.2.5) @@ -8227,12 +8244,19 @@ This list contains 1091 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: Jul 30, 2022, + *last release*: Aug 03, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.5) Text User Interface (TUI) for Pytest, automatically launched after your test run is finished + :pypi:`pytest-twilio-conversations-client-mock` + *last release*: Aug 02, 2022, + *status*: N/A, + *requires*: N/A + + + :pypi:`pytest-twisted` *last release*: Aug 30, 2021, *status*: 5 - Production/Stable, @@ -8612,7 +8636,7 @@ This list contains 1091 plugins. Extended logging for test and decorators :pypi:`pytest-xlsx` - *last release*: Jul 28, 2022, + *last release*: Aug 04, 2022, *status*: N/A, *requires*: N/A From 4d430ea6ffe8cf18582e756b4093405cc83d0cc4 Mon Sep 17 00:00:00 2001 From: Brandon Chinn Date: Fri, 12 Aug 2022 02:08:39 -0700 Subject: [PATCH 316/549] Fix partially unknown type (#10204) --- src/_pytest/config/argparsing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index 830bbd2e2cd..feae1ce7eda 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -169,7 +169,7 @@ def addini( type: Optional[ "Literal['string', 'paths', 'pathlist', 'args', 'linelist', 'bool']" ] = None, - default=None, + default: Any = None, ) -> None: """Register an ini-file option. From 433efaeaa93291fa56ef8d306922a25aad12a512 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Aug 2022 11:09:06 +0200 Subject: [PATCH 317/549] build(deps): Bump django in /testing/plugins_integration (#10195) Bumps [django](https://github.com/django/django) from 4.0.6 to 4.1. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/4.0.6...4.1) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index bde7afa4df4..b221b8f6777 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.6.1 -django==4.0.6 +django==4.1 pytest-asyncio==0.18.3 pytest-bdd==6.0.1 pytest-cov==3.0.0 From cc0092b9d898fdd903f56b9b937139fbf766d1c1 Mon Sep 17 00:00:00 2001 From: holesch <8659229+holesch@users.noreply.github.com> Date: Fri, 12 Aug 2022 11:11:03 +0200 Subject: [PATCH 318/549] JUnit XML: Escape error messages in setup/teardown (#10190) Co-authored-by: Holesch, Simon (BSH) --- AUTHORS | 1 + changelog/10190.bugfix.rst | 1 + src/_pytest/junitxml.py | 2 +- testing/test_junitxml.py | 22 ++++++++++++++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 changelog/10190.bugfix.rst diff --git a/AUTHORS b/AUTHORS index b8e6377fb02..e797f21461a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -313,6 +313,7 @@ Seth Junot Shantanu Jain Shubham Adep Simon Gomizelj +Simon Holesch Simon Kerr Skylar Downes Srinivas Reddy Thatiparthy diff --git a/changelog/10190.bugfix.rst b/changelog/10190.bugfix.rst new file mode 100644 index 00000000000..731d0efad9a --- /dev/null +++ b/changelog/10190.bugfix.rst @@ -0,0 +1 @@ +Invalid XML characters in setup or teardown error messages are now properly escaped for JUnit XML reports. diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py index c92a227bf1e..66057ef6f61 100644 --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -231,7 +231,7 @@ def append_error(self, report: TestReport) -> None: msg = f'failed on teardown with "{reason}"' else: msg = f'failed on setup with "{reason}"' - self._add_simple("error", msg, str(report.longrepr)) + self._add_simple("error", bin_xml_escape(msg), str(report.longrepr)) def append_skipped(self, report: TestReport) -> None: if hasattr(report, "wasxfail"): diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index 02531e81435..b266c76d922 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -1625,6 +1625,28 @@ def test_skip(): snode.assert_attr(message="1 <> 2") +def test_escaped_setup_teardown_error( + pytester: Pytester, run_and_parse: RunAndParse +) -> None: + pytester.makepyfile( + """ + import pytest + + @pytest.fixture() + def my_setup(): + raise Exception("error: \033[31mred\033[m") + + def test_esc(my_setup): + pass + """ + ) + _, dom = run_and_parse() + node = dom.find_first_by_tag("testcase") + snode = node.find_first_by_tag("error") + assert "#x1B[31mred#x1B[m" in snode["message"] + assert "#x1B[31mred#x1B[m" in snode.text + + @parametrize_families def test_logging_passing_tests_disabled_does_not_log_test_output( pytester: Pytester, run_and_parse: RunAndParse, xunit_family: str From c72d2023175887fcf3fcd4d1bdaf30e0ffb1f4ff Mon Sep 17 00:00:00 2001 From: Nhieuvu1802 <87355872+Nhieuvu1802@users.noreply.github.com> Date: Sat, 13 Aug 2022 06:56:51 +0700 Subject: [PATCH 319/549] build(deps): Bump pytest-asyncio in /testing/plugins_integration (#10212) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index b221b8f6777..0853db6299b 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,6 +1,6 @@ anyio[curio,trio]==3.6.1 django==4.1 -pytest-asyncio==0.18.3 +pytest-asyncio==0.19.0 pytest-bdd==6.0.1 pytest-cov==3.0.0 pytest-django==4.5.2 From cb7f5ed3b1cd0c8e90118adbcafb1b7c4bc8fd63 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 13 Aug 2022 12:35:07 +0300 Subject: [PATCH 320/549] doc: require sphinx 5 Fix #9836. --- doc/en/conf.py | 12 +++++------- doc/en/reference/customize.rst | 2 +- doc/en/reference/reference.rst | 1 + doc/en/requirements.txt | 5 +---- src/_pytest/python_api.py | 2 +- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/doc/en/conf.py b/doc/en/conf.py index 3c26b8ce0b7..fe1d54416c0 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -162,11 +162,11 @@ _repo = "https://github.com/pytest-dev/pytest" extlinks = { - "bpo": ("https://bugs.python.org/issue%s", "bpo-"), - "pypi": ("https://pypi.org/project/%s/", ""), - "issue": (f"{_repo}/issues/%s", "issue #"), - "pull": (f"{_repo}/pull/%s", "pull request #"), - "user": ("https://github.com/%s", "@"), + "bpo": ("https://bugs.python.org/issue%s", "bpo-%s"), + "pypi": ("https://pypi.org/project/%s/", "%s"), + "issue": (f"{_repo}/issues/%s", "issue #%s"), + "pull": (f"{_repo}/pull/%s", "pull request #%s"), + "user": ("https://github.com/%s", "@%s"), } @@ -419,8 +419,6 @@ def filter(self, record: logging.LogRecord) -> bool: def setup(app: "sphinx.application.Sphinx") -> None: - # from sphinx.ext.autodoc import cut_lines - # app.connect('autodoc-process-docstring', cut_lines(4, what=['module'])) app.add_crossref_type( "fixture", "fixture", diff --git a/doc/en/reference/customize.rst b/doc/en/reference/customize.rst index b6d21445a7e..b794d646b8e 100644 --- a/doc/en/reference/customize.rst +++ b/doc/en/reference/customize.rst @@ -90,7 +90,7 @@ and can also be used to hold pytest configuration if they have a ``[pytest]`` se setup.cfg ~~~~~~~~~ -``setup.cfg`` files are general purpose configuration files, used originally by :doc:`distutils `, and can also be used to hold pytest configuration +``setup.cfg`` files are general purpose configuration files, used originally by :doc:`distutils `, and can also be used to hold pytest configuration if they have a ``[tool:pytest]`` section. .. code-block:: ini diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index bdad8fa597d..de11cba554b 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -529,6 +529,7 @@ New code should avoid using :fixture:`testdir` in favor of :fixture:`pytester`. .. autoclass:: pytest.Testdir() :members: + :noindex: TimeoutExpired .. fixture:: recwarn diff --git a/doc/en/requirements.txt b/doc/en/requirements.txt index 89446634e03..a0d54cd4c1d 100644 --- a/doc/en/requirements.txt +++ b/doc/en/requirements.txt @@ -2,9 +2,6 @@ pallets-sphinx-themes pluggy>=1.0 pygments-pytest>=2.2.0 sphinx-removed-in>=0.2.0 -sphinx>=3.1,<4 +sphinx>=5,<6 sphinxcontrib-trio sphinxcontrib-svg2pdfconverter - -# XXX: sphinx<4 is broken with latest jinja2 -jinja2<3.1 diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 10762ee7b98..d825931debc 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -521,7 +521,7 @@ def approx(expected, rel=None, abs=None, nan_ok: bool = False) -> ApproxBase: """Assert that two numbers (or two ordered sequences of numbers) are equal to each other within some tolerance. - Due to the :std:doc:`tutorial/floatingpoint`, numbers that we + Due to the :doc:`python:tutorial/floatingpoint`, numbers that we would intuitively expect to be equal are not always so:: >>> 0.1 + 0.2 == 0.3 From 7431750bb6e48106ded6acd70ef2e4c67aad294a Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 29 Oct 2021 21:18:12 +0300 Subject: [PATCH 321/549] doc: have tighter control on what autodoc shows New versions of sphinx starting showing `__init__` parameters even when we don't want them to show because they are private (have `_ispytest` argument). The only working solution I found was to switch to `autodoc_typehints_description_target = "documented"` and explicitly document parameters for which we want to show the types. It's a little tedious and repetitive in some simple cases, but overall it results in nicer API docs. --- doc/en/conf.py | 1 + doc/en/reference/reference.rst | 2 +- src/_pytest/assertion/__init__.py | 2 +- src/_pytest/config/argparsing.py | 54 +++++--- src/_pytest/fixtures.py | 19 ++- src/_pytest/hookspec.py | 208 +++++++++++++++++++++--------- src/_pytest/junitxml.py | 5 +- src/_pytest/logging.py | 25 ++-- src/_pytest/mark/__init__.py | 4 +- src/_pytest/monkeypatch.py | 5 +- src/_pytest/nodes.py | 25 ++-- src/_pytest/outcomes.py | 9 +- src/_pytest/pytester.py | 113 ++++++++++------ src/_pytest/python_api.py | 15 ++- src/_pytest/reports.py | 10 +- src/_pytest/tmpdir.py | 6 +- 16 files changed, 335 insertions(+), 168 deletions(-) diff --git a/doc/en/conf.py b/doc/en/conf.py index fe1d54416c0..b0c158e5a21 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -38,6 +38,7 @@ autodoc_member_order = "bysource" autodoc_typehints = "description" +autodoc_typehints_description_target = "documented" todo_include_todos = 1 latex_engine = "lualatex" diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index de11cba554b..97afdef377c 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -102,7 +102,7 @@ pytest.deprecated_call **Tutorial**: :ref:`ensuring_function_triggers` -.. autofunction:: pytest.deprecated_call() +.. autofunction:: pytest.deprecated_call([match]) :with: pytest.register_assert_rewrite diff --git a/src/_pytest/assertion/__init__.py b/src/_pytest/assertion/__init__.py index 5c971bb8622..a46e58136ba 100644 --- a/src/_pytest/assertion/__init__.py +++ b/src/_pytest/assertion/__init__.py @@ -53,7 +53,7 @@ def register_assert_rewrite(*names: str) -> None: actually imported, usually in your __init__.py if you are a plugin using a package. - :raises TypeError: If the given module names are not strings. + :param names: The module names to register. """ for name in names: if not isinstance(name, str): diff --git a/src/_pytest/config/argparsing.py b/src/_pytest/config/argparsing.py index feae1ce7eda..d3f01916b61 100644 --- a/src/_pytest/config/argparsing.py +++ b/src/_pytest/config/argparsing.py @@ -66,14 +66,15 @@ def getgroup( ) -> "OptionGroup": """Get (or create) a named option Group. - :name: Name of the option group. - :description: Long description for --help output. - :after: Name of another group, used for ordering --help output. + :param name: Name of the option group. + :param description: Long description for --help output. + :param after: Name of another group, used for ordering --help output. + :returns: The option group. The returned group object has an ``addoption`` method with the same signature as :func:`parser.addoption ` but will be shown in the respective group in the output of - ``pytest. --help``. + ``pytest --help``. """ for group in self._groups: if group.name == name: @@ -89,10 +90,11 @@ def getgroup( def addoption(self, *opts: str, **attrs: Any) -> None: """Register a command line option. - :opts: Option names, can be short or long options. - :attrs: Same attributes which the ``add_argument()`` function of the - `argparse library `_ - accepts. + :param opts: + Option names, can be short or long options. + :param attrs: + Same attributes as the argparse library's :py:func:`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 @@ -148,7 +150,10 @@ def parse_known_args( args: Sequence[Union[str, "os.PathLike[str]"]], namespace: Optional[argparse.Namespace] = None, ) -> argparse.Namespace: - """Parse and return a namespace object with known arguments at this point.""" + """Parse the known arguments at this point. + + :returns: An argparse namespace object. + """ return self.parse_known_and_unknown_args(args, namespace=namespace)[0] def parse_known_and_unknown_args( @@ -156,8 +161,13 @@ def parse_known_and_unknown_args( args: Sequence[Union[str, "os.PathLike[str]"]], namespace: Optional[argparse.Namespace] = None, ) -> Tuple[argparse.Namespace, List[str]]: - """Parse and return a namespace object with known arguments, and - the remaining arguments unknown at this point.""" + """Parse the known arguments at this point, and also return the + remaining unknown arguments. + + :returns: + A tuple containing an argparse namespace object for the known + arguments, and a list of the unknown arguments. + """ optparser = self._getparser() strargs = [os.fspath(x) for x in args] return optparser.parse_known_args(strargs, namespace=namespace) @@ -173,9 +183,9 @@ def addini( ) -> None: """Register an ini-file option. - :name: + :param name: Name of the ini-variable. - :type: + :param type: Type of the variable. Can be: * ``string``: a string @@ -189,7 +199,7 @@ def addini( The ``paths`` variable type. Defaults to ``string`` if ``None`` or not passed. - :default: + :param default: Default value if no ini-file option exists but is queried. The value of ini-variables can be retrieved via a call to @@ -354,24 +364,30 @@ def __init__( self.options: List[Argument] = [] self.parser = parser - def addoption(self, *optnames: str, **attrs: Any) -> None: + def addoption(self, *opts: str, **attrs: Any) -> None: """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 **and** the automatic destination is in ``args.twowords``. + + :param opts: + Option names, can be short or long options. + :param attrs: + Same attributes as the argparse library's :py:func:`add_argument() + ` function accepts. """ - conflict = set(optnames).intersection( + conflict = set(opts).intersection( name for opt in self.options for name in opt.names() ) if conflict: raise ValueError("option names %s already added" % conflict) - option = Argument(*optnames, **attrs) + option = Argument(*opts, **attrs) self._addoption_instance(option, shortupper=False) - def _addoption(self, *optnames: str, **attrs: Any) -> None: - option = Argument(*optnames, **attrs) + def _addoption(self, *opts: str, **attrs: Any) -> None: + option = Argument(*opts, **attrs) self._addoption_instance(option, shortupper=True) def _addoption_instance(self, option: "Argument", shortupper: bool = False) -> None: diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index d1d36d7fa24..30b6054d05e 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -513,8 +513,8 @@ def session(self) -> "Session": return self._pyfuncitem.session # type: ignore[no-any-return] def addfinalizer(self, finalizer: Callable[[], object]) -> None: - """Add finalizer/teardown function to be called after the last test - within the requesting test context finished execution.""" + """Add finalizer/teardown function to be called without arguments after + the last test within the requesting test context finished execution.""" # XXX usually this method is shadowed by fixturedef specific ones. self._addfinalizer(finalizer, scope=self.scope) @@ -529,13 +529,16 @@ def applymarker(self, marker: Union[str, MarkDecorator]) -> None: on all function invocations. :param marker: - A :class:`pytest.MarkDecorator` object created by a call - to ``pytest.mark.NAME(...)``. + An object created by a call to ``pytest.mark.NAME(...)``. """ self.node.add_marker(marker) def raiseerror(self, msg: Optional[str]) -> NoReturn: - """Raise a FixtureLookupError with the given message.""" + """Raise a FixtureLookupError exception. + + :param msg: + An optional custom error message. + """ raise self._fixturemanager.FixtureLookupError(None, self, msg) def _fillfixtures(self) -> None: @@ -557,6 +560,8 @@ def getfixturevalue(self, argname: str) -> Any: phase, but during the test teardown phase a fixture's value may not be available. + :param argname: + The fixture name. :raises pytest.FixtureLookupError: If the given fixture could not be found. """ @@ -768,8 +773,8 @@ def __repr__(self) -> str: return f"" def addfinalizer(self, finalizer: Callable[[], object]) -> None: - """Add finalizer/teardown function to be called after the last test - within the requesting test context finished execution.""" + """Add finalizer/teardown function to be called without arguments after + the last test within the requesting test context finished execution.""" self._fixturedef.addfinalizer(finalizer) def _schedule_finalizers( diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index a03c0e9ab79..cc0828dd19e 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -143,7 +143,7 @@ def pytest_configure(config: "Config") -> None: def pytest_cmdline_parse( pluginmanager: "PytestPluginManager", args: List[str] ) -> Optional["Config"]: - """Return an initialized config object, parsing the specified args. + """Return an initialized :class:`~pytest.Config`, parsing the specified args. Stops at first non-None result, see :ref:`firstresult`. @@ -152,8 +152,9 @@ def pytest_cmdline_parse( ``plugins`` arg when using `pytest.main`_ to perform an in-process test run. - :param pytest.PytestPluginManager pluginmanager: The pytest plugin manager. - :param List[str] args: List of arguments passed on the command line. + :param pluginmanager: The pytest plugin manager. + :param args: List of arguments passed on the command line. + :returns: A pytest config object. """ @@ -167,8 +168,8 @@ def pytest_cmdline_preparse(config: "Config", args: List[str]) -> None: .. note:: This hook will not be called for ``conftest.py`` files, only for setuptools plugins. - :param pytest.Config config: The pytest config object. - :param List[str] args: Arguments passed on the command line. + :param config: The pytest config object. + :param args: Arguments passed on the command line. """ @@ -179,7 +180,8 @@ def pytest_cmdline_main(config: "Config") -> Optional[Union["ExitCode", int]]: Stops at first non-None result, see :ref:`firstresult`. - :param pytest.Config config: The pytest config object. + :param config: The pytest config object. + :returns: The exit code. """ @@ -192,9 +194,9 @@ def pytest_load_initial_conftests( .. note:: This hook will not be called for ``conftest.py`` files, only for setuptools plugins. - :param pytest.Config early_config: The pytest config object. - :param List[str] args: Arguments passed on the command line. - :param pytest.Parser parser: To add command line options. + :param early_config: The pytest config object. + :param args: Arguments passed on the command line. + :param parser: To add command line options. """ @@ -236,7 +238,7 @@ def pytest_collection(session: "Session") -> Optional[object]: for example the terminal plugin uses it to start displaying the collection counter (and returns `None`). - :param pytest.Session session: The pytest session object. + :param session: The pytest session object. """ @@ -246,16 +248,16 @@ def pytest_collection_modifyitems( """Called after collection has been performed. May filter or re-order the items in-place. - :param pytest.Session session: The pytest session object. - :param pytest.Config config: The pytest config object. - :param List[pytest.Item] items: List of item objects. + :param session: The pytest session object. + :param config: The pytest config object. + :param items: List of item objects. """ def pytest_collection_finish(session: "Session") -> None: """Called after collection has been performed and modified. - :param pytest.Session session: The pytest session object. + :param session: The pytest session object. """ @@ -270,9 +272,9 @@ def pytest_ignore_collect( Stops at first non-None result, see :ref:`firstresult`. - :param pathlib.Path collection_path : The path to analyze. - :param LEGACY_PATH path: The path to analyze (deprecated). - :param pytest.Config config: The pytest config object. + :param collection_path: The path to analyze. + :param path: The path to analyze (deprecated). + :param config: The pytest config object. .. versionchanged:: 7.0.0 The ``collection_path`` parameter was added as a :class:`pathlib.Path` @@ -284,12 +286,12 @@ def pytest_ignore_collect( def pytest_collect_file( file_path: Path, path: "LEGACY_PATH", parent: "Collector" ) -> "Optional[Collector]": - """Create a Collector for the given path, or None if not relevant. + """Create a :class:`~pytest.Collector` for the given path, or None if not relevant. The new node needs to have the specified ``parent`` as a parent. - :param pathlib.Path file_path: The path to analyze. - :param LEGACY_PATH path: The path to collect (deprecated). + :param file_path: The path to analyze. + :param path: The path to collect (deprecated). .. versionchanged:: 7.0.0 The ``file_path`` parameter was added as a :class:`pathlib.Path` @@ -302,21 +304,36 @@ def pytest_collect_file( def pytest_collectstart(collector: "Collector") -> None: - """Collector starts collecting.""" + """Collector starts collecting. + + :param collector: + The collector. + """ def pytest_itemcollected(item: "Item") -> None: - """We just collected a test item.""" + """We just collected a test item. + + :param item: + The item. + """ def pytest_collectreport(report: "CollectReport") -> None: - """Collector finished collecting.""" + """Collector finished collecting. + + :param report: + The collect report. + """ def pytest_deselected(items: Sequence["Item"]) -> None: """Called for deselected test items, e.g. by keyword. May be called multiple times. + + :param items: + The items. """ @@ -326,6 +343,9 @@ def pytest_make_collect_report(collector: "Collector") -> "Optional[CollectRepor a :class:`~pytest.CollectReport`. Stops at first non-None result, see :ref:`firstresult`. + + :param collector: + The collector. """ @@ -338,16 +358,16 @@ def pytest_make_collect_report(collector: "Collector") -> "Optional[CollectRepor def pytest_pycollect_makemodule( module_path: Path, path: "LEGACY_PATH", parent ) -> Optional["Module"]: - """Return a Module collector or None for the given path. + """Return a :class:`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 + The :hook:`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 :ref:`firstresult`. - :param pathlib.Path module_path: The path of the module to collect. - :param LEGACY_PATH path: The path of the module to collect (deprecated). + :param module_path: The path of the module to collect. + :param path: The path of the module to collect (deprecated). .. versionchanged:: 7.0.0 The ``module_path`` parameter was added as a :class:`pathlib.Path` @@ -364,6 +384,15 @@ def pytest_pycollect_makeitem( """Return a custom item/collector for a Python object in a module, or None. Stops at first non-None result, see :ref:`firstresult`. + + :param collector: + The module/class collector. + :param name: + The name of the object in the module/class. + :param obj: + The object. + :returns: + The created items/collectors. """ @@ -372,11 +401,18 @@ def pytest_pyfunc_call(pyfuncitem: "Function") -> Optional[object]: """Call underlying test function. Stops at first non-None result, see :ref:`firstresult`. + + :param pyfuncitem: + The function item. """ def pytest_generate_tests(metafunc: "Metafunc") -> None: - """Generate (multiple) parametrized calls to a test function.""" + """Generate (multiple) parametrized calls to a test function. + + :param metafunc: + The :class:`~pytest.Metafunc` helper for the test function. + """ @hookspec(firstresult=True) @@ -391,7 +427,7 @@ def pytest_make_parametrize_id( Stops at first non-None result, see :ref:`firstresult`. - :param pytest.Config config: The pytest config object. + :param config: The pytest config object. :param val: The parametrized value. :param str argname: The automatic parameter name produced by pytest. """ @@ -416,7 +452,7 @@ def pytest_runtestloop(session: "Session") -> Optional[object]: If at any point ``session.shouldfail`` or ``session.shouldstop`` are set, the loop is terminated after the runtest protocol for the current item is finished. - :param pytest.Session session: The pytest session object. + :param session: The pytest session object. Stops at first non-None result, see :ref:`firstresult`. The return value is not used, but only stops further processing. @@ -468,7 +504,7 @@ def pytest_runtest_logstart( See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. - :param str nodeid: Full node ID of the item. + :param nodeid: Full node ID of the item. :param location: A tuple of ``(filename, lineno, testname)``. """ @@ -480,7 +516,7 @@ def pytest_runtest_logfinish( See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. - :param str nodeid: Full node ID of the item. + :param nodeid: Full node ID of the item. :param location: A tuple of ``(filename, lineno, testname)``. """ @@ -492,6 +528,9 @@ def pytest_runtest_setup(item: "Item") -> None: parents (which haven't been setup yet). This includes obtaining the values of fixtures required by the item (which haven't been obtained yet). + + :param item: + The item. """ @@ -499,6 +538,9 @@ def pytest_runtest_call(item: "Item") -> None: """Called to run the test for test item (the call phase). The default implementation calls ``item.runtest()``. + + :param item: + The item. """ @@ -510,6 +552,8 @@ def pytest_runtest_teardown(item: "Item", nextitem: Optional["Item"]) -> None: includes running the teardown phase of fixtures required by the item (if they go out of scope). + :param item: + The item. :param nextitem: The scheduled-to-be-next test item (None if no further test item is scheduled). This argument is used to perform exact teardowns, i.e. @@ -527,6 +571,7 @@ def pytest_runtest_makereport( See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. + :param item: The item. :param call: The :class:`~pytest.CallInfo` for the phase. Stops at first non-None result, see :ref:`firstresult`. @@ -547,7 +592,11 @@ def pytest_report_to_serializable( report: Union["CollectReport", "TestReport"], ) -> Optional[Dict[str, Any]]: """Serialize the given report object into a data structure suitable for - sending over the wire, e.g. converted to JSON.""" + sending over the wire, e.g. converted to JSON. + + :param config: The pytest config object. + :param report: The report. + """ @hookspec(firstresult=True) @@ -556,7 +605,10 @@ def pytest_report_from_serializable( data: Dict[str, Any], ) -> Optional[Union["CollectReport", "TestReport"]]: """Restore a report object previously serialized with - :hook:`pytest_report_to_serializable`.""" + :hook:`pytest_report_to_serializable`. + + :param config: The pytest config object. + """ # ------------------------------------------------------------------------- @@ -570,7 +622,12 @@ def pytest_fixture_setup( ) -> Optional[object]: """Perform fixture setup execution. - :returns: The return value of the call to the fixture function. + :param fixturdef: + The fixture definition object. + :param request: + The fixture request object. + :returns: + The return value of the call to the fixture function. Stops at first non-None result, see :ref:`firstresult`. @@ -586,7 +643,13 @@ def pytest_fixture_post_finalizer( ) -> None: """Called after fixture teardown, but before the cache is cleared, so the fixture result ``fixturedef.cached_result`` is still available (not - ``None``).""" + ``None``). + + :param fixturdef: + The fixture definition object. + :param request: + The fixture request object. + """ # ------------------------------------------------------------------------- @@ -598,7 +661,7 @@ def pytest_sessionstart(session: "Session") -> None: """Called after the ``Session`` object has been created and before performing collection and entering the run test loop. - :param pytest.Session session: The pytest session object. + :param session: The pytest session object. """ @@ -608,15 +671,15 @@ def pytest_sessionfinish( ) -> None: """Called after whole test run finished, right before returning the exit status to the system. - :param pytest.Session session: The pytest session object. - :param int exitstatus: The status which pytest will return to the system. + :param session: The pytest session object. + :param exitstatus: The status which pytest will return to the system. """ def pytest_unconfigure(config: "Config") -> None: """Called before test process is exited. - :param pytest.Config config: The pytest config object. + :param config: The pytest config object. """ @@ -635,7 +698,10 @@ def pytest_assertrepr_compare( *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. - :param pytest.Config config: The pytest config object. + :param config: The pytest config object. + :param op: The operator, e.g. `"=="`, `"!="`, `"not in"`. + :param left: The left operand. + :param right: The right operand. """ @@ -660,10 +726,10 @@ def pytest_assertion_pass(item: "Item", lineno: int, orig: str, expl: str) -> No 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. - :param pytest.Item item: pytest item object of current test. - :param int lineno: Line number of the assert statement. - :param str orig: String with the original assertion. - :param str expl: String with the assert explanation. + :param item: pytest item object of current test. + :param lineno: Line number of the assert statement. + :param orig: String with the original assertion. + :param expl: String with the assert explanation. """ @@ -677,9 +743,9 @@ def pytest_report_header( ) -> Union[str, List[str]]: """Return a string or list of strings to be displayed as header info for terminal reporting. - :param pytest.Config config: The pytest config object. - :param Path start_path: The starting dir. - :param LEGACY_PATH startdir: The starting dir (deprecated). + :param config: The pytest config object. + :param start_path: The starting dir. + :param startdir: The starting dir (deprecated). .. note:: @@ -714,9 +780,9 @@ def pytest_report_collectionfinish( .. versionadded:: 3.2 - :param pytest.Config config: The pytest config object. - :param Path start_path: The starting dir. - :param LEGACY_PATH startdir: The starting dir (deprecated). + :param config: The pytest config object. + :param start_path: The starting dir. + :param startdir: The starting dir (deprecated). :param items: List of pytest items that are going to be executed; this list should not be modified. .. note:: @@ -755,6 +821,7 @@ def pytest_report_teststatus( :param report: The report object whose status is to be returned. :param config: The pytest config object. + :returns: The test status. Stops at first non-None result, see :ref:`firstresult`. """ @@ -767,9 +834,9 @@ def pytest_terminal_summary( ) -> None: """Add a section to terminal summary reporting. - :param _pytest.terminal.TerminalReporter terminalreporter: The internal terminal reporter object. - :param int exitstatus: The exit status that will be reported back to the OS. - :param pytest.Config config: The pytest config object. + :param terminalreporter: The internal terminal reporter object. + :param exitstatus: The exit status that will be reported back to the OS. + :param config: The pytest config object. .. versionadded:: 4.2 The ``config`` parameter. @@ -785,21 +852,21 @@ def pytest_warning_recorded( ) -> None: """Process a warning captured by the internal pytest warnings plugin. - :param warnings.WarningMessage warning_message: + :param warning_message: The captured warning. This is the same object produced by :py:func:`warnings.catch_warnings`, and contains the same attributes as the parameters of :py:func:`warnings.showwarning`. - :param str when: + :param when: Indicates when the warning was captured. Possible values: * ``"config"``: during pytest configuration/initialization stage. * ``"collect"``: during test collection. * ``"runtest"``: during test execution. - :param str nodeid: + :param nodeid: Full id of the item. - :param tuple|None location: + :param location: When available, holds information about the execution context of the captured warning (filename, linenumber, function). ``function`` evaluates to when the execution context is at the module level. @@ -824,7 +891,7 @@ def pytest_markeval_namespace(config: "Config") -> Dict[str, Any]: .. versionadded:: 6.2 - :param pytest.Config config: The pytest config object. + :param config: The pytest config object. :returns: A dictionary of additional globals to add. """ @@ -842,13 +909,19 @@ def pytest_internalerror( Return True to suppress the fallback handling of printing an INTERNALERROR message directly to sys.stderr. + + :param excrepr: The exception repr object. + :param excinfo: The exception info. """ def pytest_keyboard_interrupt( excinfo: "ExceptionInfo[Union[KeyboardInterrupt, Exit]]", ) -> None: - """Called for keyboard interrupt.""" + """Called for keyboard interrupt. + + :param excinfo: The exception info. + """ def pytest_exception_interact( @@ -867,6 +940,13 @@ def pytest_exception_interact( This hook is not called if the exception that was raised is an internal exception like ``skip.Exception``. + + :param node: + The item or collector. + :param call: + The call information. Contains the exception. + :param report: + The collection or test report. """ @@ -876,8 +956,8 @@ def pytest_enter_pdb(config: "Config", pdb: "pdb.Pdb") -> None: Can be used by plugins to take special action just before the python debugger enters interactive mode. - :param pytest.Config config: The pytest config object. - :param pdb.Pdb pdb: The Pdb instance. + :param config: The pytest config object. + :param pdb: The Pdb instance. """ @@ -887,6 +967,6 @@ def pytest_leave_pdb(config: "Config", pdb: "pdb.Pdb") -> None: Can be used by plugins to take special action just after the python debugger leaves interactive mode. - :param pytest.Config config: The pytest config object. - :param pdb.Pdb pdb: The Pdb instance. + :param config: The pytest config object. + :param pdb: The Pdb instance. """ diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py index 66057ef6f61..7a5170f328b 100644 --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -354,7 +354,10 @@ def test_foo(record_testsuite_property): record_testsuite_property("ARCH", "PPC") record_testsuite_property("STORAGE_TYPE", "CEPH") - ``name`` must be a string, ``value`` will be converted to a string and properly xml-escaped. + :param name: + The property name. + :param value: + The property value. Will be converted to a string. .. warning:: diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index 2eb69fdbfb4..f9091399f2c 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -37,6 +37,8 @@ if TYPE_CHECKING: logging_StreamHandler = logging.StreamHandler[StringIO] + + from typing_extensions import Literal else: logging_StreamHandler = logging.StreamHandler @@ -382,20 +384,19 @@ def _finalize(self) -> None: @property def handler(self) -> LogCaptureHandler: - """Get the logging handler used by the fixture. - - :rtype: LogCaptureHandler - """ + """Get the logging handler used by the fixture.""" return self._item.stash[caplog_handler_key] - def get_records(self, when: str) -> List[logging.LogRecord]: + def get_records( + self, when: "Literal['setup', 'call', 'teardown']" + ) -> List[logging.LogRecord]: """Get the logging records for one of the possible test phases. - :param str when: - Which test phase to obtain the records from. Valid values are: "setup", "call" and "teardown". + :param when: + 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. - :rtype: List[logging.LogRecord] .. versionadded:: 3.4 """ @@ -452,8 +453,8 @@ def set_level(self, level: Union[int, str], logger: Optional[str] = None) -> Non The levels of the loggers changed by this function will be restored to their initial values at the end of the test. - :param int level: The level. - :param str logger: The logger to update. If not given, the root logger. + :param level: The level. + :param logger: The logger to update. If not given, the root logger. """ logger_obj = logging.getLogger(logger) # Save the original log-level to restore it during teardown. @@ -471,8 +472,8 @@ def at_level( the end of the 'with' statement the level is restored to its original value. - :param int level: The level. - :param str logger: The logger to update. If not given, the root logger. + :param level: The level. + :param logger: The logger to update. If not given, the root logger. """ logger_obj = logging.getLogger(logger) orig_level = logger_obj.level diff --git a/src/_pytest/mark/__init__.py b/src/_pytest/mark/__init__.py index a03f0f89c2a..6717d1135ee 100644 --- a/src/_pytest/mark/__init__.py +++ b/src/_pytest/mark/__init__.py @@ -62,8 +62,8 @@ def test_eval(test_input, expected): assert eval(test_input) == expected :param values: Variable args of the values of the parameter set, in order. - :keyword marks: A single mark or a list of marks to be applied to this parameter set. - :keyword str id: The id to attribute to this parameter set. + :param marks: A single mark or a list of marks to be applied to this parameter set. + :param id: The id to attribute to this parameter set. """ return ParameterSet.param(*values, marks=marks, id=id) diff --git a/src/_pytest/monkeypatch.py b/src/_pytest/monkeypatch.py index 91d590fb3df..fdb252c5c0a 100644 --- a/src/_pytest/monkeypatch.py +++ b/src/_pytest/monkeypatch.py @@ -115,7 +115,7 @@ class MonkeyPatch: Returned by the :fixture:`monkeypatch` fixture. - :versionchanged:: 6.2 + .. versionchanged:: 6.2 Can now also be used directly as `pytest.MonkeyPatch()`, for when the fixture is not available. In this case, use :meth:`with MonkeyPatch.context() as mp: ` or remember to call @@ -338,7 +338,8 @@ def syspath_prepend(self, path) -> None: def chdir(self, path: Union[str, "os.PathLike[str]"]) -> None: """Change the current working directory to the specified path. - Path can be a string or a path object. + :param path: + The path to change into. """ if self._cwd is None: self._cwd = os.getcwd() diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py index 1a168043a4f..cfb9b5a3634 100644 --- a/src/_pytest/nodes.py +++ b/src/_pytest/nodes.py @@ -193,7 +193,7 @@ def __init__( nodeid: Optional[str] = None, ) -> None: #: A unique name within the scope of the parent node. - self.name = name + self.name: str = name #: The parent collector node. self.parent = parent @@ -208,7 +208,7 @@ def __init__( if session: #: The pytest session this node is part of. - self.session = session + self.session: Session = session else: if not parent: raise TypeError("session or parent must be provided") @@ -239,9 +239,7 @@ def __init__( #: A place where plugins can store information on the node for their #: own use. - #: - #: :type: Stash - self.stash = Stash() + self.stash: Stash = Stash() # Deprecated alias. Was never public. Can be removed in a few releases. self._store = self.stash @@ -326,7 +324,10 @@ def teardown(self) -> None: def listchain(self) -> List["Node"]: """Return list of all parent collectors up to self, starting from - the root of collection tree.""" + the root of collection tree. + + :returns: The nodes. + """ chain = [] item: Optional[Node] = self while item is not None: @@ -340,6 +341,8 @@ def add_marker( ) -> None: """Dynamically add a marker object to the node. + :param marker: + The marker. :param append: Whether to append the marker, or prepend it. """ @@ -361,6 +364,7 @@ def iter_markers(self, name: Optional[str] = None) -> Iterator[Mark]: """Iterate over all markers of the node. :param name: If given, filter the results by the name attribute. + :returns: An iterator of the markers of the node. """ return (x[1] for x in self.iter_markers_with_node(name=name)) @@ -407,7 +411,8 @@ def listnames(self) -> List[str]: return [x.name for x in self.listchain()] def addfinalizer(self, fin: Callable[[], object]) -> None: - """Register a function to be called when this node is finalized. + """Register a function to be called without arguments when this node is + finalized. This method can only be called when this node is active in a setup chain, for example during self.setup(). @@ -416,7 +421,11 @@ def addfinalizer(self, fin: Callable[[], object]) -> None: def getparent(self, cls: Type[_NodeType]) -> Optional[_NodeType]: """Get the next parent node (including self) which is an instance of - the given class.""" + the given class. + + :param cls: The node class to search for. + :returns: The node, if found. + """ current: Optional[Node] = self while current and not isinstance(current, cls): current = current.parent diff --git a/src/_pytest/outcomes.py b/src/_pytest/outcomes.py index 684efae7715..e46b663dd50 100644 --- a/src/_pytest/outcomes.py +++ b/src/_pytest/outcomes.py @@ -241,6 +241,9 @@ def xfail(reason: str = "") -> NoReturn: This function should be called only during testing (setup, call or teardown). + :param reason: + The message to show the user as reason for the xfail. + .. note:: It is better to use the :ref:`pytest.mark.xfail ref` marker when possible to declare a test to be xfailed under certain conditions @@ -256,12 +259,12 @@ def importorskip( """Import and return the requested module ``modname``, or skip the current test if the module cannot be imported. - :param str modname: + :param modname: The name of the module to import. - :param str minversion: + :param minversion: If given, the imported module's ``__version__`` attribute must be at least this minimal version, otherwise the test is still skipped. - :param str reason: + :param reason: If given, this reason is shown as the message when the module cannot be imported. diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index d8586a05694..a9299944dec 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -661,17 +661,7 @@ class Pytester: 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 ``path`` and environment variables during initialization. - - Attributes: - - :ivar Path path: temporary directory path used to create files/run tests from, etc. - - :ivar plugins: - A list of plugins to use with :py:meth:`parseconfig` and - :py:meth:`runpytest`. Initially this is an empty list but plugins can - be added to the list. The type of items to add to the list depends on - the method using them so refer to them for details. + the current working directory to :attr:`path` and environment variables during initialization. """ __test__ = False @@ -700,6 +690,10 @@ def __init__( name = request.node.name self._name = name self._path: Path = tmp_path_factory.mktemp(name, numbered=True) + #: A list of plugins to use with :py:meth:`parseconfig` and + #: :py:meth:`runpytest`. Initially this is an empty list but plugins can + #: be added to the list. The type of items to add to the list depends on + #: the method using them so refer to them for details. self.plugins: List[Union[str, _PluggyPlugin]] = [] self._cwd_snapshot = CwdSnapshot() self._sys_path_snapshot = SysPathsSnapshot() @@ -724,7 +718,7 @@ def __init__( @property def path(self) -> Path: - """Temporary directory where files are created and pytest is executed.""" + """Temporary directory path used to create files/run tests from, etc.""" return self._path def __repr__(self) -> str: @@ -755,7 +749,7 @@ def preserve_module(name): return SysModulesSnapshot(preserve=preserve_module) def make_hook_recorder(self, pluginmanager: PytestPluginManager) -> HookRecorder: - """Create a new :py:class:`HookRecorder` for a PluginManager.""" + """Create a new :class:`HookRecorder` for a :class:`PytestPluginManager`.""" pluginmanager.reprec = reprec = HookRecorder(pluginmanager, _ispytest=True) self._request.addfinalizer(reprec.finish_recording) return reprec @@ -804,7 +798,7 @@ def to_text(s: Union[Any, bytes]) -> str: def makefile(self, ext: str, *args: str, **kwargs: str) -> Path: r"""Create new text file(s) in the test directory. - :param str ext: + :param ext: The extension the file(s) should use, including the dot, e.g. `.py`. :param args: All args are treated as strings and joined using newlines. @@ -813,6 +807,8 @@ def makefile(self, ext: str, *args: str, **kwargs: str) -> Path: :param kwargs: 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. Examples: @@ -832,11 +828,19 @@ def makefile(self, ext: str, *args: str, **kwargs: str) -> Path: return self._makefile(ext, args, kwargs) def makeconftest(self, source: str) -> Path: - """Write a conftest.py file with 'source' as contents.""" + """Write a contest.py file. + + :param source: The contents. + :returns: The conftest.py file. + """ return self.makepyfile(conftest=source) def makeini(self, source: str) -> Path: - """Write a tox.ini file with 'source' as contents.""" + """Write a tox.ini file. + + :param source: The contents. + :returns: The tox.ini file. + """ return self.makefile(".ini", tox=source) def getinicfg(self, source: str) -> SectionWrapper: @@ -845,7 +849,10 @@ def getinicfg(self, source: str) -> SectionWrapper: return IniConfig(str(p))["pytest"] def makepyprojecttoml(self, source: str) -> Path: - """Write a pyproject.toml file with 'source' as contents. + """Write a pyproject.toml file. + + :param source: The contents. + :returns: The pyproject.ini file. .. versionadded:: 6.0 """ @@ -898,6 +905,9 @@ def syspathinsert( This is undone automatically when this object dies at the end of each test. + + :param path: + The path. """ if path is None: path = self.path @@ -905,7 +915,13 @@ def syspathinsert( self._monkeypatch.syspath_prepend(str(path)) def mkdir(self, name: Union[str, "os.PathLike[str]"]) -> Path: - """Create a new (sub)directory.""" + """Create a new (sub)directory. + + :param name: + The name of the directory, relative to the pytester path. + :returns: + The created directory. + """ p = self.path / name p.mkdir() return p @@ -924,14 +940,15 @@ def mkpydir(self, name: Union[str, "os.PathLike[str]"]) -> Path: def copy_example(self, name: Optional[str] = None) -> Path: """Copy file from project's directory into the testdir. - :param str name: The name of the file to copy. - :return: path to the copied directory (inside ``self.path``). - + :param name: + The name of the file to copy. + :return: + Path to the copied directory (inside ``self.path``). """ - example_dir = self._request.config.getini("pytester_example_dir") - if example_dir is None: + example_dir_ = self._request.config.getini("pytester_example_dir") + if example_dir_ is None: raise ValueError("pytester_example_dir is unset, can't copy examples") - example_dir = self._request.config.rootpath / example_dir + example_dir: Path = self._request.config.rootpath / example_dir_ for extra_element in self._request.node.iter_markers("pytester_example_path"): assert extra_element.args @@ -967,14 +984,16 @@ def copy_example(self, name: Optional[str] = None) -> Path: def getnode( self, config: Config, arg: Union[str, "os.PathLike[str]"] - ) -> Optional[Union[Collector, Item]]: - """Return the collection node of a file. + ) -> Union[Collector, Item]: + """Get the collection node of a file. - :param pytest.Config config: + :param config: A pytest config. See :py:meth:`parseconfig` and :py:meth:`parseconfigure` for creating it. - :param os.PathLike[str] arg: + :param arg: Path to the file. + :returns: + The node. """ session = Session.from_config(config) assert "::" not in str(arg) @@ -984,13 +1003,18 @@ def getnode( config.hook.pytest_sessionfinish(session=session, exitstatus=ExitCode.OK) return res - def getpathnode(self, path: Union[str, "os.PathLike[str]"]): + def getpathnode( + self, path: Union[str, "os.PathLike[str]"] + ) -> Union[Collector, Item]: """Return the collection node of a file. This is like :py:meth:`getnode` but uses :py:meth:`parseconfigure` to create the (configured) pytest Config instance. - :param os.PathLike[str] path: Path to the file. + :param path: + Path to the file. + :returns: + The node. """ path = Path(path) config = self.parseconfigure(path) @@ -1006,6 +1030,11 @@ def genitems(self, colitems: Sequence[Union[Item, Collector]]) -> List[Item]: This recurses into the collection node and returns a list of all the test items contained within. + + :param colitems: + The collection nodes. + :returns: + The collected items. """ session = colitems[0].session result: List[Item] = [] @@ -1192,15 +1221,16 @@ def _ensure_basetemp( return new_args def parseconfig(self, *args: Union[str, "os.PathLike[str]"]) -> Config: - """Return a new pytest Config instance from given commandline args. + """Return a new pytest :class:`pytest.Config` instance from given + commandline args. - This invokes the pytest bootstrapping code in _pytest.config to create - a new :py:class:`_pytest.core.PluginManager` and call the - pytest_cmdline_parse hook to create a new - :py:class:`pytest.Config` instance. + This invokes the pytest bootstrapping code in _pytest.config to create a + new :py:class:`pytest.PytestPluginManager` and call the + :hook:`pytest_cmdline_parse` hook to create a new :class:`pytest.Config` + instance. - If :py:attr:`plugins` has been populated they should be plugin modules - to be registered with the PluginManager. + If :attr:`plugins` has been populated they should be plugin modules + to be registered with the plugin manager. """ import _pytest.config @@ -1218,7 +1248,8 @@ def parseconfigure(self, *args: Union[str, "os.PathLike[str]"]) -> Config: """Return a new pytest configured Config instance. Returns a new :py:class:`pytest.Config` instance like - :py:meth:`parseconfig`, but also calls the pytest_configure hook. + :py:meth:`parseconfig`, but also calls the :hook:`pytest_configure` + hook. """ config = self.parseconfig(*args) config._do_configure() @@ -1237,6 +1268,8 @@ def getitem( The module source. :param funcname: The name of the test function for which to return a test item. + :returns: + The test item. """ items = self.getitems(source) for item in items: @@ -1377,6 +1410,8 @@ def run( - Otherwise, it is passed through to :py:class:`subprocess.Popen`. For further information in this case, consult the document of the ``stdin`` parameter in :py:class:`subprocess.Popen`. + :returns: + The result. """ __tracebackhide__ = True @@ -1463,6 +1498,8 @@ def runpytest_subprocess( :param timeout: The period in seconds after which to timeout and raise :py:class:`Pytester.TimeoutExpired`. + :returns: + The result. """ __tracebackhide__ = True p = make_numbered_dir(root=self.path, prefix="runpytest-", mode=0o700) diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index d825931debc..00e377f40b3 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -798,15 +798,18 @@ def raises( def raises( expected_exception: Union[Type[E], Tuple[Type[E], ...]], *args: Any, **kwargs: Any ) -> Union["RaisesContext[E]", _pytest._code.ExceptionInfo[E]]: - r"""Assert that a code block/function call raises ``expected_exception`` - or raise a failure exception otherwise. + r"""Assert that a code block/function call raises an exception. - :kwparam match: + :param typing.Type[E] | typing.Tuple[typing.Type[E], ...] expected_exception: + The excpected exception type, or a tuple if one of multiple possible + exception types are excepted. + :kwparam str | typing.Pattern[str] | None match: If specified, a string containing a regular expression, or a regular expression object, that is tested against the string - representation of the exception using :py:func:`re.search`. To match a literal - string that may contain :std:ref:`special characters `, the pattern can - first be escaped with :py:func:`re.escape`. + representation of the exception using :func:`re.search`. + + To match a literal string that may contain :ref:`special characters + `, the pattern can first be escaped with :func:`re.escape`. (This is only used when :py:func:`pytest.raises` is used as a context manager, and passed through to the function otherwise. diff --git a/src/_pytest/reports.py b/src/_pytest/reports.py index 20862d60388..c35f7087e41 100644 --- a/src/_pytest/reports.py +++ b/src/_pytest/reports.py @@ -276,7 +276,7 @@ def __init__( #: A name -> value dictionary containing all keywords and #: markers associated with a test invocation. - self.keywords = keywords + self.keywords: Mapping[str, Any] = keywords #: Test outcome, always one of "passed", "failed", "skipped". self.outcome = outcome @@ -298,7 +298,7 @@ def __init__( self.sections = list(sections) #: Time it took to run just the test. - self.duration = duration + self.duration: float = duration self.__dict__.update(extra) @@ -309,7 +309,11 @@ def __repr__(self) -> str: @classmethod def from_item_and_call(cls, item: Item, call: "CallInfo[None]") -> "TestReport": - """Create and fill a TestReport with standard item and call info.""" + """Create and fill a TestReport with standard item and call info. + + :param item: The item. + :param call: The call info. + """ when = call.when # Remove "collect" from the Literal type -- only for collection calls. assert when != "collect" diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index 12dc463a2a2..9497a0d49da 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -100,7 +100,11 @@ def mktemp(self, basename: str, numbered: bool = True) -> Path: return p def getbasetemp(self) -> Path: - """Return the base temporary directory, creating it if needed.""" + """Return the base temporary directory, creating it if needed. + + :returns: + The base temporary directory. + """ if self._basetemp is not None: return self._basetemp From beae7fd0ba063dd8ef980e15d66286a584aebc97 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 13 Aug 2022 21:04:59 +0300 Subject: [PATCH 322/549] doc: workaround for ugly API docs for overloaded functions with new Sphinx New Sphinx added support for overloads and always displays them all with full type annotations etc. This regresses the API reference for overloaded functions like `fixture()`, `warns()`, `raises()` and friends to become impossible to read. I tried various workarounds but none worked except this one. --- src/_pytest/compat.py | 11 ++++++++++- src/_pytest/fixtures.py | 6 +++--- src/_pytest/main.py | 6 +++--- src/_pytest/python_api.py | 6 +++--- src/_pytest/recwarn.py | 12 +++++++----- 5 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index d0cb07b2291..fab4c31107f 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -20,6 +20,16 @@ import attr import py +# fmt: off +# Workaround for https://github.com/sphinx-doc/sphinx/issues/10351. +# If `overload` is imported from `compat` instead of from `typing`, +# Sphinx doesn't recognize it as `overload` and the API docs for +# overloaded functions look good again. But type checkers handle +# it fine. +# fmt: on +if True: + from typing import overload as overload + if TYPE_CHECKING: from typing_extensions import Final @@ -345,7 +355,6 @@ def final(f): if sys.version_info >= (3, 8): from functools import cached_property as cached_property else: - from typing import overload from typing import Type class cached_property(Generic[_S, _T]): diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 30b6054d05e..d79895c262b 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -20,7 +20,6 @@ from typing import MutableMapping from typing import NoReturn from typing import Optional -from typing import overload from typing import Sequence from typing import Set from typing import Tuple @@ -48,6 +47,7 @@ from _pytest.compat import getlocation from _pytest.compat import is_generator from _pytest.compat import NOTSET +from _pytest.compat import overload from _pytest.compat import safe_getattr from _pytest.config import _PluggyPlugin from _pytest.config import Config @@ -1231,7 +1231,7 @@ def fixture( @overload -def fixture( +def fixture( # noqa: F811 fixture_function: None = ..., *, scope: "Union[_ScopeName, Callable[[str, Config], _ScopeName]]" = ..., @@ -1245,7 +1245,7 @@ def fixture( ... -def fixture( +def fixture( # noqa: F811 fixture_function: Optional[FixtureFunction] = None, *, scope: "Union[_ScopeName, Callable[[str, Config], _ScopeName]]" = "function", diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 4a117fc2ea1..61fb7eaa4e3 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -12,7 +12,6 @@ from typing import Iterator from typing import List from typing import Optional -from typing import overload from typing import Sequence from typing import Set from typing import Tuple @@ -25,6 +24,7 @@ import _pytest._code from _pytest import nodes from _pytest.compat import final +from _pytest.compat import overload from _pytest.config import Config from _pytest.config import directory_arg from _pytest.config import ExitCode @@ -597,12 +597,12 @@ def perform_collect( ... @overload - def perform_collect( + def perform_collect( # noqa: F811 self, args: Optional[Sequence[str]] = ..., genitems: bool = ... ) -> Sequence[Union[nodes.Item, nodes.Collector]]: ... - def perform_collect( + def perform_collect( # noqa: F811 self, args: Optional[Sequence[str]] = None, genitems: bool = True ) -> Sequence[Union[nodes.Item, nodes.Collector]]: """Perform the collection phase for this session. diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 00e377f40b3..515d437f0d8 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -12,7 +12,6 @@ from typing import List from typing import Mapping from typing import Optional -from typing import overload from typing import Pattern from typing import Sequence from typing import Tuple @@ -28,6 +27,7 @@ import _pytest._code from _pytest.compat import final from _pytest.compat import STRING_TYPES +from _pytest.compat import overload from _pytest.outcomes import fail @@ -786,7 +786,7 @@ def raises( @overload -def raises( +def raises( # noqa: F811 expected_exception: Union[Type[E], Tuple[Type[E], ...]], func: Callable[..., Any], *args: Any, @@ -795,7 +795,7 @@ def raises( ... -def raises( +def raises( # noqa: F811 expected_exception: Union[Type[E], Tuple[Type[E], ...]], *args: Any, **kwargs: Any ) -> Union["RaisesContext[E]", _pytest._code.ExceptionInfo[E]]: r"""Assert that a code block/function call raises an exception. diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index 9c6e7e91daf..9971bb52fb6 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -9,7 +9,6 @@ from typing import Iterator from typing import List from typing import Optional -from typing import overload from typing import Pattern from typing import Tuple from typing import Type @@ -17,6 +16,7 @@ from typing import Union from _pytest.compat import final +from _pytest.compat import overload from _pytest.deprecated import check_ispytest from _pytest.deprecated import WARNS_NONE_ARG from _pytest.fixtures import fixture @@ -47,11 +47,13 @@ def deprecated_call( @overload -def deprecated_call(func: Callable[..., T], *args: Any, **kwargs: Any) -> T: +def deprecated_call( # noqa: F811 + func: Callable[..., T], *args: Any, **kwargs: Any +) -> T: ... -def deprecated_call( +def deprecated_call( # noqa: F811 func: Optional[Callable[..., Any]] = None, *args: Any, **kwargs: Any ) -> Union["WarningsRecorder", Any]: """Assert that code produces a ``DeprecationWarning`` or ``PendingDeprecationWarning``. @@ -93,7 +95,7 @@ def warns( @overload -def warns( +def warns( # noqa: F811 expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]], func: Callable[..., T], *args: Any, @@ -102,7 +104,7 @@ def warns( ... -def warns( +def warns( # noqa: F811 expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]] = Warning, *args: Any, match: Optional[Union[str, Pattern[str]]] = None, From 739322af037459a8bb9b32e32690b67850573bb6 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Sat, 13 Aug 2022 21:07:27 +0200 Subject: [PATCH 323/549] Mention `monkeypatch.context()` in the docs (#10192) In addition: * Improve the docs a bit with links. * Recommend `context()` instead of `undo()`. --- src/_pytest/monkeypatch.py | 43 ++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/src/_pytest/monkeypatch.py b/src/_pytest/monkeypatch.py index 91d590fb3df..f29c4f2ef55 100644 --- a/src/_pytest/monkeypatch.py +++ b/src/_pytest/monkeypatch.py @@ -29,21 +29,25 @@ def monkeypatch() -> Generator["MonkeyPatch", None, None]: """A convenient fixture for monkey-patching. - The fixture provides these methods to modify objects, dictionaries or - os.environ:: - - monkeypatch.setattr(obj, name, value, raising=True) - monkeypatch.delattr(obj, name, raising=True) - monkeypatch.setitem(mapping, name, value) - monkeypatch.delitem(obj, name, raising=True) - monkeypatch.setenv(name, value, prepend=None) - monkeypatch.delenv(name, raising=True) - monkeypatch.syspath_prepend(path) - monkeypatch.chdir(path) + The fixture provides these methods to modify objects, dictionaries, or + :data:`os.environ`: + + * :meth:`monkeypatch.setattr(obj, name, value, raising=True) ` + * :meth:`monkeypatch.delattr(obj, name, raising=True) ` + * :meth:`monkeypatch.setitem(mapping, name, value) ` + * :meth:`monkeypatch.delitem(obj, name, raising=True) ` + * :meth:`monkeypatch.setenv(name, value, prepend=None) ` + * :meth:`monkeypatch.delenv(name, raising=True) ` + * :meth:`monkeypatch.syspath_prepend(path) ` + * :meth:`monkeypatch.chdir(path) ` All modifications will be undone after the requesting test function or - fixture has finished. The ``raising`` parameter determines if a KeyError - or AttributeError will be raised if the set/deletion operation has no target. + fixture has finished. The ``raising`` parameter determines if a :class:`KeyError` + or :class:`AttributeError` will be raised if the set/deletion operation does not have the + specified target. + + To undo modifications done by the fixture in a contained scope, + use :meth:`context() `. """ mpatch = MonkeyPatch() yield mpatch @@ -353,11 +357,14 @@ def undo(self) -> None: There is generally no need to call `undo()`, since it is called automatically during tear-down. - Note that the same `monkeypatch` fixture is used across a - single test function invocation. If `monkeypatch` is used both by - the test function itself and one of the test fixtures, - calling `undo()` will undo all of the changes made in - both functions. + .. note:: + The same `monkeypatch` fixture is used across a + single test function invocation. If `monkeypatch` is used both by + the test function itself and one of the test fixtures, + calling `undo()` will undo all of the changes made in + both functions. + + Prefer to use :meth:`context() ` instead. """ for obj, name, value in reversed(self._setattr): if value is not notset: From f425dfc15881dc853a8143e1d346fd969dff95f0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 14 Aug 2022 05:07:01 -0300 Subject: [PATCH 324/549] [automated] Update plugin list (#10214) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 120 +++++++++++++++++++++---------- 1 file changed, 84 insertions(+), 36 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 235628055ef..20d5e4c2605 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1094 plugins. +This list contains 1100 plugins. .. only:: not latex @@ -201,7 +201,7 @@ This list contains 1094 plugins. :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Jun 08, 2022 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Aug 13, 2022 N/A N/A :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest @@ -372,7 +372,7 @@ This list contains 1094 plugins. :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-failed-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A :pypi:`pytest-failed-to-verify` A pytest plugin that helps better distinguishing real test failures from setup flakiness. Aug 08, 2019 5 - Production/Stable pytest (>=4.1.0) - :pypi:`pytest-fail-slow` Fail tests that take too long to run Apr 25, 2022 4 - Beta pytest (>=6.0) + :pypi:`pytest-fail-slow` Fail tests that take too long to run Aug 13, 2022 4 - Beta pytest (>=6.0) :pypi:`pytest-faker` Faker integration with the pytest framework. Dec 19, 2016 6 - Mature N/A :pypi:`pytest-falcon` Pytest helpers for Falcon. Sep 07, 2016 4 - Beta N/A :pypi:`pytest-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A @@ -407,6 +407,7 @@ This list contains 1094 plugins. :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) :pypi:`pytest-flaptastic` Flaptastic py.test plugin Mar 17, 2019 N/A N/A :pypi:`pytest-flask` A set of py.test fixtures to test Flask applications. Feb 27, 2021 5 - Production/Stable pytest (>=5.2) + :pypi:`pytest-flask-ligand` Pytest fixtures and helper functions to use for testing flask-ligand microservices. Aug 09, 2022 4 - Beta pytest (~=7.1) :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) :pypi:`pytest-fluent` A pytest plugin in order to provide logs via fluentd Jul 12, 2022 4 - Beta pytest @@ -456,7 +457,7 @@ This list contains 1094 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 05, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 13, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -480,7 +481,7 @@ This list contains 1094 plugins. :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Aug 05, 2022 4 - Beta N/A - :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Apr 08, 2020 4 - Beta N/A + :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Aug 09, 2022 4 - Beta N/A :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Jun 29, 2022 5 - Production/Stable N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jul 25, 2022 N/A N/A @@ -493,7 +494,7 @@ This list contains 1094 plugins. :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. May 18, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-extensions` Inmanta tests package Apr 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-extensions` Inmanta tests package Aug 10, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jul 14, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Jun 16, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A @@ -504,7 +505,7 @@ This list contains 1094 plugins. :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) - :pypi:`pytest-invenio` Pytest fixtures for Invenio. May 05, 2022 5 - Production/Stable pytest (<7,>=6) + :pypi:`pytest-invenio` "Pytest fixtures for Invenio." Aug 09, 2022 5 - Production/Stable pytest (<7,>=6) :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A @@ -520,13 +521,13 @@ This list contains 1094 plugins. :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A - :pypi:`pytest-json-fixtures` JSON output for the --fixtures flag Aug 03, 2022 4 - Beta pytest (>=7.1.0) + :pypi:`pytest-json-fixtures` JSON output for the --fixtures flag Aug 09, 2022 4 - Beta pytest (>=7.1.0) :pypi:`pytest-jsonlint` UNKNOWN Aug 04, 2016 N/A N/A :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Mar 15, 2022 4 - Beta pytest (>=3.8.0) :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 24, 2021 N/A pytest :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest :pypi:`pytest-kexi` Apr 29, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Jan 24, 2021 5 - Production/Stable N/A + :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Aug 11, 2022 5 - Production/Stable N/A :pypi:`pytest-kivy` Kivy GUI tests fixtures using pytest Jul 06, 2021 4 - Beta pytest (>=3.6) :pypi:`pytest-knows` A pytest plugin that can automaticly skip test case based on dependence info calculated by trace Aug 22, 2014 N/A N/A :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A @@ -547,6 +548,7 @@ This list contains 1094 plugins. :pypi:`pytest-ligo` Jan 16, 2020 4 - Beta N/A :pypi:`pytest-lineno` A pytest plugin to show the line numbers of test functions Dec 04, 2020 N/A pytest :pypi:`pytest-line-profiler` Profile code executed by pytest May 03, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-line-profiler-apn` Profile code executed by pytest Aug 13, 2022 4 - Beta N/A :pypi:`pytest-lisa` Pytest plugin for organizing tests. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) :pypi:`pytest-listener` A simple network listener May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) @@ -603,7 +605,7 @@ This list contains 1094 plugins. :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Jul 20, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Aug 12, 2022 N/A pytest (>=1.0) :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A @@ -642,7 +644,7 @@ This list contains 1094 plugins. :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Jul 21, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Aug 10, 2022 N/A pytest (==6.2.5) :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A :pypi:`pytest-nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Jul 07, 2021 N/A N/A @@ -751,7 +753,7 @@ This list contains 1094 plugins. :pypi:`pytest-pydev` py.test plugin to connect to a remote debug server with PyDev or PyCharm. Nov 15, 2017 3 - Alpha N/A :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Mar 13, 2022 3 - Alpha N/A :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) - :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Aug 04, 2022 N/A pytest + :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Aug 10, 2022 N/A pytest :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) @@ -823,18 +825,20 @@ This list contains 1094 plugins. :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Jul 07, 2022 N/A N/A + :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Aug 12, 2022 N/A N/A :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A :pypi:`pytest-responses` py.test integration for responses Apr 26, 2021 N/A pytest (>=2.5) + :pypi:`pytest-rest-api` Aug 08, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A - :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Aug 05, 2022 N/A pytest (>=7.0.0) + :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Aug 11, 2022 N/A pytest (>=7.0.0) :pypi:`pytest-reverse` Pytest plugin to reverse test order. May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) :pypi:`pytest-ringo` pytest plugin to test webapplications using the Ringo webframework Sep 27, 2017 3 - Alpha N/A + :pypi:`pytest-rmsis` Sycronise pytest results to Jira RMsis Aug 10, 2022 N/A pytest (>=5.3.5) :pypi:`pytest-rng` Fixtures for seeding tests and making randomness reproducible Aug 08, 2019 5 - Production/Stable pytest :pypi:`pytest-roast` pytest plugin for ROAST configuration override and fixtures Jul 29, 2021 5 - Production/Stable pytest :pypi:`pytest-rocketchat` Pytest to Rocket.Chat reporting plugin Apr 18, 2021 5 - Production/Stable N/A @@ -928,6 +932,7 @@ This list contains 1094 plugins. :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Mar 13, 2018 3 - Alpha N/A + :pypi:`pytest-sqlalchemy-mock` pytest sqlalchemy plugin for mock Aug 10, 2022 3 - Alpha pytest (>=2.0) :pypi:`pytest-sql-bigquery` Yet another SQL-testing framework for BigQuery provided by pytest plugin Dec 19, 2019 N/A pytest :pypi:`pytest-squadcast` Pytest report plugin for Squadcast Feb 22, 2022 5 - Production/Stable pytest :pypi:`pytest-srcpaths` Add paths to sys.path Oct 15, 2021 N/A N/A @@ -988,7 +993,7 @@ This list contains 1094 plugins. :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Aug 01, 2022 N/A pytest (>=6.2.5) - :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Jul 26, 2022 N/A pytest (>=3.6) + :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Aug 12, 2022 N/A N/A :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A :pypi:`pytest-testreport` May 23, 2022 4 - Beta pytest (>=3.5.0) @@ -1014,7 +1019,7 @@ This list contains 1094 plugins. :pypi:`pytest-tm4j-reporter` Cloud Jira Test Management (TM4J) PyTest reporter plugin Sep 01, 2020 N/A pytest :pypi:`pytest-tmnet` A small example package Mar 01, 2022 N/A N/A :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest - :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Nov 17, 2021 N/A N/A + :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Aug 12, 2022 N/A N/A :pypi:`pytest-todo` A small plugin for the pytest testing framework, marking TODO comments as failure May 23, 2019 4 - Beta pytest :pypi:`pytest-tomato` Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-toolbelt` This is just a collection of utilities for pytest, but don't really belong in pytest proper. Aug 12, 2019 3 - Alpha N/A @@ -1036,7 +1041,7 @@ This list contains 1094 plugins. :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Apr 27, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A - :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, automatically launched after your test run is finished Aug 03, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, with optional auto-launch and HTML export Aug 13, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) @@ -1106,6 +1111,7 @@ This list contains 1094 plugins. :pypi:`pytest-yapf` Run yapf Jul 06, 2017 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) :pypi:`pytest-yield` PyTest plugin to run tests concurrently, each \`yield\` switch context to other one Jan 23, 2019 N/A N/A + :pypi:`pytest-yls` Pytest plugin to test the YLS as a whole. Aug 08, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A @@ -2399,7 +2405,7 @@ This list contains 1094 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Jun 08, 2022, + *last release*: Aug 13, 2022, *status*: N/A, *requires*: N/A @@ -3596,7 +3602,7 @@ This list contains 1094 plugins. A pytest plugin that helps better distinguishing real test failures from setup flakiness. :pypi:`pytest-fail-slow` - *last release*: Apr 25, 2022, + *last release*: Aug 13, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0) @@ -3840,6 +3846,13 @@ This list contains 1094 plugins. A set of py.test fixtures to test Flask applications. + :pypi:`pytest-flask-ligand` + *last release*: Aug 09, 2022, + *status*: 4 - Beta, + *requires*: pytest (~=7.1) + + Pytest fixtures and helper functions to use for testing flask-ligand microservices. + :pypi:`pytest-flask-sqlalchemy` *last release*: Apr 30, 2022, *status*: 4 - Beta, @@ -4184,7 +4197,7 @@ This list contains 1094 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Aug 05, 2022, + *last release*: Aug 13, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -4352,7 +4365,7 @@ This list contains 1094 plugins. A plugin to sent pytest results to an Ibutsu server :pypi:`pytest-icdiff` - *last release*: Apr 08, 2020, + *last release*: Aug 09, 2022, *status*: 4 - Beta, *requires*: N/A @@ -4443,7 +4456,7 @@ This list contains 1094 plugins. A py.test plugin providing fixtures to simplify inmanta modules testing. :pypi:`pytest-inmanta-extensions` - *last release*: Apr 12, 2022, + *last release*: Aug 10, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4520,11 +4533,11 @@ This list contains 1094 plugins. Pytest plugin for intercepting outgoing connection requests during pytest run. :pypi:`pytest-invenio` - *last release*: May 05, 2022, + *last release*: Aug 09, 2022, *status*: 5 - Production/Stable, *requires*: pytest (<7,>=6) - Pytest fixtures for Invenio. + "Pytest fixtures for Invenio." :pypi:`pytest-involve` *last release*: Feb 02, 2020, @@ -4632,7 +4645,7 @@ This list contains 1094 plugins. Generate JSON test reports :pypi:`pytest-json-fixtures` - *last release*: Aug 03, 2022, + *last release*: Aug 09, 2022, *status*: 4 - Beta, *requires*: pytest (>=7.1.0) @@ -4674,7 +4687,7 @@ This list contains 1094 plugins. :pypi:`pytest-kind` - *last release*: Jan 24, 2021, + *last release*: Aug 11, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4820,6 +4833,13 @@ This list contains 1094 plugins. Profile code executed by pytest + :pypi:`pytest-line-profiler-apn` + *last release*: Aug 13, 2022, + *status*: 4 - Beta, + *requires*: N/A + + Profile code executed by pytest + :pypi:`pytest-lisa` *last release*: Jan 21, 2021, *status*: 3 - Alpha, @@ -5213,7 +5233,7 @@ This list contains 1094 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Jul 20, 2022, + *last release*: Aug 12, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -5486,7 +5506,7 @@ This list contains 1094 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Jul 21, 2022, + *last release*: Aug 10, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -6249,7 +6269,7 @@ This list contains 1094 plugins. pytest plugin to check source code with pylint :pypi:`pytest-pyodide` - *last release*: Aug 04, 2022, + *last release*: Aug 10, 2022, *status*: N/A, *requires*: pytest @@ -6753,7 +6773,7 @@ This list contains 1094 plugins. pytest plugin to re-run tests to eliminate flaky failures :pypi:`pytest-resilient-circuits` - *last release*: Jul 07, 2022, + *last release*: Aug 12, 2022, *status*: N/A, *requires*: N/A @@ -6787,6 +6807,13 @@ This list contains 1094 plugins. py.test integration for responses + :pypi:`pytest-rest-api` + *last release*: Aug 08, 2022, + *status*: N/A, + *requires*: pytest (>=7.1.2,<8.0.0) + + + :pypi:`pytest-restrict` *last release*: May 11, 2022, *status*: 5 - Production/Stable, @@ -6802,7 +6829,7 @@ This list contains 1094 plugins. A RethinkDB plugin for pytest. :pypi:`pytest-retry` - *last release*: Aug 05, 2022, + *last release*: Aug 11, 2022, *status*: N/A, *requires*: pytest (>=7.0.0) @@ -6836,6 +6863,13 @@ This list contains 1094 plugins. pytest plugin to test webapplications using the Ringo webframework + :pypi:`pytest-rmsis` + *last release*: Aug 10, 2022, + *status*: N/A, + *requires*: pytest (>=5.3.5) + + Sycronise pytest results to Jira RMsis + :pypi:`pytest-rng` *last release*: Aug 08, 2019, *status*: 5 - Production/Stable, @@ -7487,6 +7521,13 @@ This list contains 1094 plugins. pytest plugin with sqlalchemy related fixtures + :pypi:`pytest-sqlalchemy-mock` + *last release*: Aug 10, 2022, + *status*: 3 - Alpha, + *requires*: pytest (>=2.0) + + pytest sqlalchemy plugin for mock + :pypi:`pytest-sql-bigquery` *last release*: Dec 19, 2019, *status*: N/A, @@ -7908,9 +7949,9 @@ This list contains 1094 plugins. Pytest plugin for sending report to testrail system. :pypi:`pytest-testrail-ns` - *last release*: Jul 26, 2022, + *last release*: Aug 12, 2022, *status*: N/A, - *requires*: pytest (>=3.6) + *requires*: N/A pytest plugin for creating TestRail runs and adding results @@ -8090,7 +8131,7 @@ This list contains 1094 plugins. Utilities to create temporary file hierarchies in pytest. :pypi:`pytest-tmreport` - *last release*: Nov 17, 2021, + *last release*: Aug 12, 2022, *status*: N/A, *requires*: N/A @@ -8244,11 +8285,11 @@ This list contains 1094 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: Aug 03, 2022, + *last release*: Aug 13, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.5) - Text User Interface (TUI) for Pytest, automatically launched after your test run is finished + Text User Interface (TUI) for Pytest, with optional auto-launch and HTML export :pypi:`pytest-twilio-conversations-client-mock` *last release*: Aug 02, 2022, @@ -8733,6 +8774,13 @@ This list contains 1094 plugins. PyTest plugin to run tests concurrently, each \`yield\` switch context to other one + :pypi:`pytest-yls` + *last release*: Aug 08, 2022, + *status*: N/A, + *requires*: pytest (>=7.1.2,<8.0.0) + + Pytest plugin to test the YLS as a whole. + :pypi:`pytest-yuk` *last release*: Mar 26, 2021, *status*: N/A, From cb65f64572557e08e4eba6b84b855652acde1c34 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 15 Aug 2022 19:07:36 +0300 Subject: [PATCH 325/549] changelog: add missing entry for PR #9248 --- changelog/9248.doc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/9248.doc.rst diff --git a/changelog/9248.doc.rst b/changelog/9248.doc.rst new file mode 100644 index 00000000000..755e7b0f1af --- /dev/null +++ b/changelog/9248.doc.rst @@ -0,0 +1 @@ +The documentation is now built using Sphinx 5.x (up from 3.x previously). From 67e29d2548839ecc6ab91802f746c5fba704ffc2 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 15 Aug 2022 19:12:12 +0300 Subject: [PATCH 326/549] mark: allow any Sequence[str] for parametrize(argnames), not just list/tuple The main motivation for this change is to simplify the type shown in code editors -- `Sequence[str]` is easier to follow than `Union[list[str], tuple[str, ...]]`. It also permits using other types if desired. It might lead to problems if someone uses some oddball sequence type, but hopefully they won't do that. --- changelog/10218.improvement.rst | 5 +++++ src/_pytest/mark/structures.py | 12 ++++++------ src/_pytest/python.py | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 changelog/10218.improvement.rst diff --git a/changelog/10218.improvement.rst b/changelog/10218.improvement.rst new file mode 100644 index 00000000000..e00325e2567 --- /dev/null +++ b/changelog/10218.improvement.rst @@ -0,0 +1,5 @@ +``@pytest.mark.parametrize()`` (and similar functions) now accepts any ``Sequence[str]`` for the argument names, +instead of just ``list[str]`` and ``tuple[str, ...]``. + +(Note that ``str``, which is itself a ``Sequence[str]``, is still treated as a +comma-delimited name list, as before). diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index b8cbf0d1875..800a25c9243 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -126,12 +126,12 @@ def extract_from( @staticmethod def _parse_parametrize_args( - argnames: Union[str, List[str], Tuple[str, ...]], + argnames: Union[str, Sequence[str]], argvalues: Iterable[Union["ParameterSet", Sequence[object], object]], *args, **kwargs, - ) -> Tuple[Union[List[str], Tuple[str, ...]], bool]: - if not isinstance(argnames, (tuple, list)): + ) -> Tuple[Sequence[str], bool]: + if isinstance(argnames, str): argnames = [x.strip() for x in argnames.split(",") if x.strip()] force_tuple = len(argnames) == 1 else: @@ -150,12 +150,12 @@ def _parse_parametrize_parameters( @classmethod def _for_parametrize( cls, - argnames: Union[str, List[str], Tuple[str, ...]], + argnames: Union[str, Sequence[str]], argvalues: Iterable[Union["ParameterSet", Sequence[object], object]], func, config: Config, nodeid: str, - ) -> Tuple[Union[List[str], Tuple[str, ...]], List["ParameterSet"]]: + ) -> Tuple[Sequence[str], List["ParameterSet"]]: argnames, force_tuple = cls._parse_parametrize_args(argnames, argvalues) parameters = cls._parse_parametrize_parameters(argvalues, force_tuple) del argvalues @@ -434,7 +434,7 @@ def __call__( class _ParametrizeMarkDecorator(MarkDecorator): def __call__( # type: ignore[override] self, - argnames: Union[str, List[str], Tuple[str, ...]], + argnames: Union[str, Sequence[str]], argvalues: Iterable[Union[ParameterSet, Sequence[object], object]], *, indirect: Union[bool, Sequence[str]] = ..., diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 91054f370d3..3db8775061b 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1207,7 +1207,7 @@ def __init__( def parametrize( self, - argnames: Union[str, List[str], Tuple[str, ...]], + argnames: Union[str, Sequence[str]], argvalues: Iterable[Union[ParameterSet, Sequence[object], object]], indirect: Union[bool, Sequence[str]] = False, ids: Optional[ From 56862c03cbb3f9cae3464c33390fbbaf8a91823a Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 15 Aug 2022 19:41:57 +0300 Subject: [PATCH 327/549] pyproject.toml: remove `wheel` from `build-system.requires` It's not required -- see https://github.com/pypa/packaging.python.org/pull/1050 --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3d683aebea7..a66f90017ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,6 @@ requires = [ # sync with setup.py until we discard non-pep-517/518 "setuptools>=45.0", "setuptools-scm[toml]>=6.2.3", - "wheel", ] build-backend = "setuptools.build_meta" From 2e7c718373f2ddd1cfa25686abd5166f602af297 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 15 Aug 2022 13:55:19 -0300 Subject: [PATCH 328/549] Add reference to the Where to patch docs in monkeypatch.setattr (#10217) This should help users with the common issue of patching the wrong place. Also took the opportunity of using proper links in the monkeypatch introduction. Related to #10216 Co-authored-by: Ran Benita --- doc/en/how-to/monkeypatch.rst | 24 +++++++++++------------ src/_pytest/monkeypatch.py | 37 +++++++++++++++++++++++++++++------ 2 files changed, 42 insertions(+), 19 deletions(-) diff --git a/doc/en/how-to/monkeypatch.rst b/doc/en/how-to/monkeypatch.rst index 9214de77edb..81edd00bda5 100644 --- a/doc/en/how-to/monkeypatch.rst +++ b/doc/en/how-to/monkeypatch.rst @@ -14,18 +14,16 @@ environment variable, or to modify ``sys.path`` for importing. The ``monkeypatch`` fixture provides these helper methods for safely patching and mocking functionality in tests: -.. code-block:: python +* :meth:`monkeypatch.setattr(obj, name, value, raising=True) ` +* :meth:`monkeypatch.delattr(obj, name, raising=True) ` +* :meth:`monkeypatch.setitem(mapping, name, value) ` +* :meth:`monkeypatch.delitem(obj, name, raising=True) ` +* :meth:`monkeypatch.setenv(name, value, prepend=None) ` +* :meth:`monkeypatch.delenv(name, raising=True) ` +* :meth:`monkeypatch.syspath_prepend(path) ` +* :meth:`monkeypatch.chdir(path) ` +* :meth:`monkeypatch.context() ` - monkeypatch.setattr(obj, name, value, raising=True) - monkeypatch.setattr("somemodule.obj.name", value, raising=True) - monkeypatch.delattr(obj, name, raising=True) - monkeypatch.setitem(mapping, name, value) - monkeypatch.delitem(obj, name, raising=True) - monkeypatch.setenv(name, value, prepend=None) - monkeypatch.delenv(name, raising=True) - monkeypatch.syspath_prepend(path) - monkeypatch.chdir(path) - monkeypatch.context() All modifications will be undone after the requesting test function or fixture has finished. The ``raising`` @@ -64,8 +62,8 @@ and a discussion of its motivation. .. _`monkeypatch blog post`: https://tetamap.wordpress.com//2009/03/03/monkeypatching-in-unit-tests-done-right/ -Simple example: monkeypatching functions ----------------------------------------- +Monkeypatching functions +------------------------ 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. ``monkeypatch`` diff --git a/src/_pytest/monkeypatch.py b/src/_pytest/monkeypatch.py index abf67690710..c6e29ac7642 100644 --- a/src/_pytest/monkeypatch.py +++ b/src/_pytest/monkeypatch.py @@ -40,6 +40,7 @@ def monkeypatch() -> Generator["MonkeyPatch", None, None]: * :meth:`monkeypatch.delenv(name, raising=True) ` * :meth:`monkeypatch.syspath_prepend(path) ` * :meth:`monkeypatch.chdir(path) ` + * :meth:`monkeypatch.context() ` All modifications will be undone after the requesting test function or fixture has finished. The ``raising`` parameter determines if a :class:`KeyError` @@ -186,16 +187,40 @@ def setattr( value: object = notset, raising: bool = True, ) -> None: - """Set attribute value on target, memorizing the old value. + """ + Set attribute value on target, memorizing the old value. + + For example: + + .. code-block:: python + + import os + + monkeypatch.setattr(os, "getcwd", lambda: "/") + + The code above replaces the :func:`os.getcwd` function by a ``lambda`` which + always returns ``"/"``. - For convenience you can specify a string as ``target`` which + 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. For example, - ``monkeypatch.setattr("os.getcwd", lambda: "/")`` - would set the ``getcwd`` function of the ``os`` module. + being the attribute name: - Raises AttributeError if the attribute does not exist, unless + .. code-block:: python + + monkeypatch.setattr("os.getcwd", lambda: "/") + + Raises :class:`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 :ref:`Where to patch ` in the :mod:`unittest.mock` + docs for a complete explanation, which is meant for :func:`unittest.mock.patch` but + applies to ``monkeypatch.setattr`` as well. """ __tracebackhide__ = True import inspect From 7378f35b035a75472330cc9ed65d90d127941309 Mon Sep 17 00:00:00 2001 From: aizpurua23a <57321880+aizpurua23a@users.noreply.github.com> Date: Mon, 15 Aug 2022 19:00:03 +0200 Subject: [PATCH 329/549] Update fixtures.rst w/ finalizer order Co-authored-by: Bruno Oliveira --- doc/en/how-to/fixtures.rst | 77 +++++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 2 deletions(-) diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index b90b40619f5..8ab498bd7d4 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -735,8 +735,81 @@ does offer some nuances for when you're in a pinch. .. code-block:: pytest $ pytest -q test_emaillib.py - . [100%] - 1 passed in 0.12s + . [100%] + 1 passed in 0.12s + +Note on finalizer order +"""""""""""""""""""""""" + +Finalizers are executed in a first-in-last-out order. +For yield fixtures, the first teardown code to run is from the right-most fixture, i.e. the last test parameter. + +.. regendoc:wipe + +.. code-block:: python + + import pytest + + + def test_bar(fix_w_yield1, fix_w_yield2): + print("test_bar") + + + @pytest.fixture + def fix_w_yield1(): + yield + print("after_yield_1") + + + @pytest.fixture + def fix_w_yield2(): + yield + print("after_yield_2") + + +.. code-block:: pytest + + $ pytest test_module.py + =========================== test session starts ============================ + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y + collected 1 item + + test_module.py test_bar + .after_yield_2 + after_yield_1 + + + +For finalizers, the first fixture to run is last call to `request.addfinalizer`. + +.. code-block:: python + + import pytest + + + @pytest.fixture + def fix_w_finalizers(request): + request.addfinalizer(partial(print, "finalizer_2")) + request.addfinalizer(partial(print, "finalizer_1")) + + + def test_bar(fix_w_finalizers): + print("test_bar") + + +.. code-block:: pytest + + $ pytest test_module.py + =========================== test session starts ============================ + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y + collected 1 item + + test_module.py test_bar + .finalizer_1 + finalizer_2 + +This is so because yield fixtures use `addfinalizer` behind the scenes: when the fixture executes, `addfinalizer` registers a function that resumes the generator, which in turn calls the teardown code. + .. _`safe teardowns`: From 832100955a4607b46b31f5d343e6b75ed87a2257 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 17 Aug 2022 11:40:03 -0300 Subject: [PATCH 330/549] Sort fixtures in reference.rst alphabetically While taking a look at the docs I noticed they were not properly sorted. This just moves the sections around so they are sorted alphabetically, without any other changes. --- doc/en/reference/reference.rst | 182 +++++++++++++++++---------------- 1 file changed, 92 insertions(+), 90 deletions(-) diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 97afdef377c..c4402ff41a0 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -333,50 +333,6 @@ For more details, consult the full :ref:`fixtures docs `. :decorator: -.. fixture:: cache - -config.cache -~~~~~~~~~~~~ - -**Tutorial**: :ref:`cache` - -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 :py:mod:`json` stdlib module. - -``config.cache`` is an instance of :class:`pytest.Cache`: - -.. autoclass:: pytest.Cache() - :members: - - -.. fixture:: capsys - -capsys -~~~~~~ - -**Tutorial**: :ref:`captures` - -.. autofunction:: _pytest.capture.capsys() - :no-auto-options: - -.. autoclass:: pytest.CaptureFixture() - :members: - - -.. fixture:: capsysbinary - -capsysbinary -~~~~~~~~~~~~ - -**Tutorial**: :ref:`captures` - -.. autofunction:: _pytest.capture.capsysbinary() - :no-auto-options: - .. fixture:: capfd capfd @@ -387,6 +343,7 @@ capfd .. autofunction:: _pytest.capture.capfd() :no-auto-options: + .. fixture:: capfdbinary capfdbinary @@ -398,71 +355,74 @@ capfdbinary :no-auto-options: -.. fixture:: doctest_namespace - -doctest_namespace -~~~~~~~~~~~~~~~~~ - -**Tutorial**: :ref:`doctest` +.. fixture:: caplog -.. autofunction:: _pytest.doctest.doctest_namespace() +caplog +~~~~~~ +**Tutorial**: :ref:`logging` -.. fixture:: request +.. autofunction:: _pytest.logging.caplog() + :no-auto-options: -request -~~~~~~~ + Returns a :class:`pytest.LogCaptureFixture` instance. -**Example**: :ref:`request example` +.. autoclass:: pytest.LogCaptureFixture() + :members: -The ``request`` fixture is a special fixture providing information of the requesting test function. -.. autoclass:: pytest.FixtureRequest() - :members: +.. fixture:: capsys +capsys +~~~~~~ -.. fixture:: pytestconfig +**Tutorial**: :ref:`captures` -pytestconfig -~~~~~~~~~~~~ +.. autofunction:: _pytest.capture.capsys() + :no-auto-options: -.. autofunction:: _pytest.fixtures.pytestconfig() +.. autoclass:: pytest.CaptureFixture() + :members: +.. fixture:: capsysbinary -.. fixture:: record_property +capsysbinary +~~~~~~~~~~~~ -record_property -~~~~~~~~~~~~~~~~~~~ +**Tutorial**: :ref:`captures` -**Tutorial**: :ref:`record_property example` +.. autofunction:: _pytest.capture.capsysbinary() + :no-auto-options: -.. autofunction:: _pytest.junitxml.record_property() +.. fixture:: cache -.. fixture:: record_testsuite_property +config.cache +~~~~~~~~~~~~ -record_testsuite_property -~~~~~~~~~~~~~~~~~~~~~~~~~ +**Tutorial**: :ref:`cache` -**Tutorial**: :ref:`record_testsuite_property example` +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``. -.. autofunction:: _pytest.junitxml.record_testsuite_property() +Under the hood, the cache plugin uses the simple +``dumps``/``loads`` API of the :py:mod:`json` stdlib module. +``config.cache`` is an instance of :class:`pytest.Cache`: -.. fixture:: caplog +.. autoclass:: pytest.Cache() + :members: -caplog -~~~~~~ -**Tutorial**: :ref:`logging` +.. fixture:: doctest_namespace -.. autofunction:: _pytest.logging.caplog() - :no-auto-options: +doctest_namespace +~~~~~~~~~~~~~~~~~ - Returns a :class:`pytest.LogCaptureFixture` instance. +**Tutorial**: :ref:`doctest` -.. autoclass:: pytest.LogCaptureFixture() - :members: +.. autofunction:: _pytest.doctest.doctest_namespace() .. fixture:: monkeypatch @@ -481,6 +441,14 @@ monkeypatch :members: +.. fixture:: pytestconfig + +pytestconfig +~~~~~~~~~~~~ + +.. autofunction:: _pytest.fixtures.pytestconfig() + + .. fixture:: pytester pytester @@ -517,19 +485,25 @@ To use it, include in your topmost ``conftest.py`` file: .. autoclass:: pytest.RecordedHookCall() :members: -.. fixture:: testdir -testdir -~~~~~~~ +.. fixture:: record_property -Identical to :fixture:`pytester`, but provides an instance whose methods return -legacy ``py.path.local`` objects instead when applicable. +record_property +~~~~~~~~~~~~~~~~~~~ -New code should avoid using :fixture:`testdir` in favor of :fixture:`pytester`. +**Tutorial**: :ref:`record_property example` -.. autoclass:: pytest.Testdir() - :members: - :noindex: TimeoutExpired +.. autofunction:: _pytest.junitxml.record_property() + + +.. fixture:: record_testsuite_property + +record_testsuite_property +~~~~~~~~~~~~~~~~~~~~~~~~~ + +**Tutorial**: :ref:`record_testsuite_property example` + +.. autofunction:: _pytest.junitxml.record_testsuite_property() .. fixture:: recwarn @@ -546,6 +520,34 @@ recwarn :members: +.. fixture:: request + +request +~~~~~~~ + +**Example**: :ref:`request example` + +The ``request`` fixture is a special fixture providing information of the requesting test function. + +.. autoclass:: pytest.FixtureRequest() + :members: + + +.. fixture:: testdir + +testdir +~~~~~~~ + +Identical to :fixture:`pytester`, but provides an instance whose methods return +legacy ``py.path.local`` objects instead when applicable. + +New code should avoid using :fixture:`testdir` in favor of :fixture:`pytester`. + +.. autoclass:: pytest.Testdir() + :members: + :noindex: TimeoutExpired + + .. fixture:: tmp_path tmp_path From 3039391b8342ffcb98b33562d00223ea27c39cfe Mon Sep 17 00:00:00 2001 From: Tatiana Ovary <109212969+toclarity@users.noreply.github.com> Date: Wed, 17 Aug 2022 16:44:58 +0200 Subject: [PATCH 331/549] Update documentation on how pytest.warns affects DeprecationWarning #9291 (#10141) Co-authored-by: Dani Sancas On-behalf-of: @clarityai-eng Signed-off-by: Tatiana Ovary --- changelog/9291.doc.rst | 1 + doc/en/how-to/capture-warnings.rst | 42 ++++++++++++++++++++++-------- src/_pytest/recwarn.py | 22 +++++++++++----- 3 files changed, 47 insertions(+), 18 deletions(-) create mode 100644 changelog/9291.doc.rst diff --git a/changelog/9291.doc.rst b/changelog/9291.doc.rst new file mode 100644 index 00000000000..fad8467dc90 --- /dev/null +++ b/changelog/9291.doc.rst @@ -0,0 +1 @@ +Update documentation on how :func:`pytest.warns` affects :class:`DeprecationWarning`. diff --git a/doc/en/how-to/capture-warnings.rst b/doc/en/how-to/capture-warnings.rst index ad5c1f3c3df..91565002ccc 100644 --- a/doc/en/how-to/capture-warnings.rst +++ b/doc/en/how-to/capture-warnings.rst @@ -42,6 +42,8 @@ Running pytest now produces this output: -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ======================= 1 passed, 1 warning in 0.12s ======================= +.. _`controlling-warnings`: + Controlling warnings -------------------- @@ -176,11 +178,14 @@ using an external system. DeprecationWarning and PendingDeprecationWarning ------------------------------------------------ - By default pytest will display ``DeprecationWarning`` and ``PendingDeprecationWarning`` warnings from user code and third-party libraries, as recommended by :pep:`565`. This helps users keep their code modern and avoid breakages when deprecated warnings are effectively removed. +However, in the specific case where users capture any type of warnings in their test, either with +:func:`pytest.warns`, :func:`pytest.deprecated_call` or using the :ref:`recwarn ` fixture, +no warning will be displayed at all. + Sometimes it is useful to hide some specific deprecation warnings that happen in code that you have no control over (such as third-party libraries), in which case you might use the warning filters options (ini or marks) to ignore those warnings. @@ -197,6 +202,9 @@ For example: This will ignore all warnings of type ``DeprecationWarning`` where the start of the message matches the regular expression ``".*U.*mode is deprecated"``. +See :ref:`@pytest.mark.filterwarnings ` and +:ref:`Controlling warnings ` for more examples. + .. note:: If warnings are configured at the interpreter level, using @@ -245,10 +253,10 @@ when called with a ``17`` argument. Asserting warnings with the warns function ------------------------------------------ - - You can check that code raises a particular warning using :func:`pytest.warns`, -which works in a similar manner to :ref:`raises `: +which works in a similar manner to :ref:`raises ` (except that +:ref:`raises ` does not capture all exceptions, only the +``expected_exception``): .. code-block:: python @@ -261,8 +269,8 @@ which works in a similar manner to :ref:`raises `: with pytest.warns(UserWarning): warnings.warn("my warning", UserWarning) -The test will fail if the warning in question is not raised. The keyword -argument ``match`` to assert that the exception matches a text or regex:: +The test will fail if the warning in question is not raised. Use the keyword +argument ``match`` to assert that the warning matches a text or regex:: >>> with warns(UserWarning, match='must be 0 or None'): ... warnings.warn("value must be 0 or None", UserWarning) @@ -359,20 +367,32 @@ Additional use cases of warnings in tests Here are some use cases involving warnings that often come up in tests, and suggestions on how to deal with them: -- To ensure that **at least one** warning is emitted, use: +- To ensure that **at least one** of the indicated warnings is issued, use: .. code-block:: python - with pytest.warns(): + def test_warning(): + with pytest.warns((RuntimeWarning, UserWarning)): + ... + +- To ensure that **only** certain warnings are issued, use: + +.. code-block:: python + + def test_warning(recwarn): ... + assert len(recwarn) == 1 + user_warning = recwarn.pop(UserWarning) + assert issubclass(user_warning.category, UserWarning) - To ensure that **no** warnings are emitted, use: .. code-block:: python - with warnings.catch_warnings(): - warnings.simplefilter("error") - ... + def test_warning(): + with warnings.catch_warnings(): + warnings.simplefilter("error") + ... - To suppress warnings, use: diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index 9971bb52fb6..06eb82d7191 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -112,15 +112,15 @@ def warns( # noqa: F811 ) -> Union["WarningsChecker", Any]: r"""Assert that code raises a particular class of warning. - Specifically, the parameter ``expected_warning`` can be a warning class or - sequence of warning classes, and the code inside the ``with`` block must issue a warning of that class or - classes. + Specifically, the parameter ``expected_warning`` can be a warning class or sequence + of warning classes, and the code inside the ``with`` block must issue at least one + warning of that class or classes. - This helper produces a list of :class:`warnings.WarningMessage` objects, - one for each warning raised. + This helper produces a list of :class:`warnings.WarningMessage` objects, one for + each warning raised (regardless of whether it is an ``expected_warning`` or not). - This function can be used as a context manager, or any of the other ways - :func:`pytest.raises` can be used:: + This function can be used as a context manager, which will capture all the raised + warnings inside it:: >>> import pytest >>> with pytest.warns(RuntimeWarning): @@ -141,6 +141,14 @@ def warns( # noqa: F811 ... Failed: DID NOT WARN. No warnings of type ...UserWarning... were emitted... + **Using with** ``pytest.mark.parametrize`` + + When using :ref:`pytest.mark.parametrize ref` it is possible to parametrize tests + such that some runs raise a warning and others do not. + + This could be achieved in the same way as with exceptions, see + :ref:`parametrizing_conditional_raising` for an example. + """ __tracebackhide__ = True if not args: From 69f2855cc8896c67c499a250c2f08fcfd408f827 Mon Sep 17 00:00:00 2001 From: John Litborn <11260241+jakkdl@users.noreply.github.com> Date: Wed, 17 Aug 2022 16:16:32 +0000 Subject: [PATCH 332/549] fallback to native traceback when handling ExceptionGroup (take 2) [SQUASH] (#10209) * Squashed commit of the following: commit 41d339c46763bbe26123e1e6504b6e32290e33e1 Author: Cheukting Date: Thu Jun 23 17:01:04 2022 +0800 test in all py versions commit b3572a5a12672228c3276fc8c8e05980dfb7888a Author: Cheukting Date: Thu Jun 23 16:41:06 2022 +0800 add test commit 7166a2a51e4f99046b028b663c193d8b558c7fd4 Author: Cheukting Date: Thu Jun 23 16:00:07 2022 +0800 update changelog commit b958c73d489157f0c0d4e46425083a5e2e2bc851 Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu Jun 23 07:50:52 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit ea7f376c6ca37c40c83df0e4a1cfaaedb34bae91 Author: Cheukting Date: Thu Jun 23 15:48:21 2022 +0800 Fix MyPy commit 97469beb1da40257e9a061a5e19548546c9312c4 Author: Cheukting Date: Thu Jun 23 15:03:48 2022 +0800 fix if ExceptionGroup not exist commit 84e553642cd69b4d499231d733df91ebfa84c7ad Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu Jun 23 03:43:27 2022 +0000 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci commit 76bbef449b88bbd74fb5cca3b5293337a624ef03 Author: Cheukting Date: Thu Jun 23 11:40:41 2022 +0800 adding changelog commit db82bebc5a4969e2083adcd97bdfd2a63bb17d98 Author: Cheukting Date: Thu Jun 23 11:33:10 2022 +0800 fall back to native when handeling to exception groups * Typed ExceptionGroupTypes and changed to BaseExceptionGroup, fixed exceptionchain (excinfo->excinfo_, set reprcrash. Extended tests, though they're wip. * added exceptiongroup to pre-commit-config, moved away from tuple to directly defining BaseExceptionGroup, added block comment, added match line for inner exception, changked mark.skipif to importorskip to not need top-level import, changed tox.ini a bit - only uncovered should now be py37 without exceptiongroup, due to hypothesis * added py311-exceptiongroup to github CI, exceptiongroup is now a hard dependency on py<3.11, renamed bad variable names * added use_coverage to ubuntu-py311 * import BaseExceptionGroup with explicit version check instead of try/catch * removed from CI, added comments to tox and pre-commit --- .github/workflows/test.yml | 1 + .pre-commit-config.yaml | 3 ++ AUTHORS | 1 + changelog/9159.bugfix.rst | 1 + setup.cfg | 1 + src/_pytest/_code/code.py | 19 +++++++- testing/code/test_excinfo.py | 87 ++++++++++++++++++++++++++++++++++++ tox.ini | 5 +++ 8 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 changelog/9159.bugfix.rst diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0c5fda16e4a..33b32a1abaa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -114,6 +114,7 @@ jobs: python: "3.11-dev" os: ubuntu-latest tox_env: "py311" + use_coverage: true - name: "ubuntu-pypy3" python: "pypy-3.7" os: ubuntu-latest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 694498b0850..72e1d8d62b1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -68,6 +68,9 @@ repos: - packaging - tomli - types-pkg_resources + # for mypy running on python>=3.11 since exceptiongroup is only a dependency + # on <3.11 + - exceptiongroup>=1.0.0rc8 - repo: local hooks: - id: rst diff --git a/AUTHORS b/AUTHORS index e797f21461a..ca2872f32a4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -168,6 +168,7 @@ Jeff Rackauckas Jeff Widman Jenni Rinker John Eddie Ayson +John Litborn John Towler Jon Parise Jon Sonesen diff --git a/changelog/9159.bugfix.rst b/changelog/9159.bugfix.rst new file mode 100644 index 00000000000..5e7f0a3014d --- /dev/null +++ b/changelog/9159.bugfix.rst @@ -0,0 +1 @@ +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``. diff --git a/setup.cfg b/setup.cfg index 3545a9503a8..38f50556c93 100644 --- a/setup.cfg +++ b/setup.cfg @@ -47,6 +47,7 @@ install_requires = pluggy>=0.12,<2.0 py>=1.8.2 colorama;sys_platform=="win32" + exceptiongroup>=1.0.0rc8;python_version<"3.11" importlib-metadata>=0.12;python_version<"3.8" tomli>=1.0.0;python_version<"3.11" python_requires = >=3.7 diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index 304a5cbd751..97985def1c3 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -56,6 +56,9 @@ _TracebackStyle = Literal["long", "short", "line", "no", "native", "value", "auto"] +if sys.version_info[:2] < (3, 11): + from exceptiongroup import BaseExceptionGroup + class Code: """Wrapper around Python code objects.""" @@ -924,7 +927,21 @@ def repr_excinfo( while e is not None and id(e) not in seen: seen.add(id(e)) if excinfo_: - reprtraceback = self.repr_traceback(excinfo_) + # Fall back to native traceback as a temporary workaround until + # full support for exception groups added to ExceptionInfo. + # See https://github.com/pytest-dev/pytest/issues/9159 + if isinstance(e, BaseExceptionGroup): + reprtraceback: Union[ + ReprTracebackNative, ReprTraceback + ] = ReprTracebackNative( + traceback.format_exception( + type(excinfo_.value), + excinfo_.value, + excinfo_.traceback[0]._rawentry, + ) + ) + else: + reprtraceback = self.repr_traceback(excinfo_) reprcrash: Optional[ReprFileLocation] = ( excinfo_._getreprcrash() if self.style != "value" else None ) diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index af72857f3e7..e428b9c5ca9 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -1470,3 +1470,90 @@ def __getattr__(self, attr): with pytest.raises(RuntimeError) as excinfo: RecursionDepthError().trigger assert "maximum recursion" in str(excinfo.getrepr()) + + +def _exceptiongroup_common( + pytester: Pytester, + outer_chain: str, + inner_chain: str, + native: bool, +) -> None: + pre_raise = "exceptiongroup." if not native else "" + pre_catch = pre_raise if sys.version_info < (3, 11) else "" + filestr = f""" + {"import exceptiongroup" if not native else ""} + import pytest + + def f(): raise ValueError("From f()") + def g(): raise BaseException("From g()") + + def inner(inner_chain): + excs = [] + for callback in [f, g]: + try: + callback() + except BaseException as err: + excs.append(err) + if excs: + if inner_chain == "none": + raise {pre_raise}BaseExceptionGroup("Oops", excs) + try: + raise SyntaxError() + except SyntaxError as e: + if inner_chain == "from": + raise {pre_raise}BaseExceptionGroup("Oops", excs) from e + else: + raise {pre_raise}BaseExceptionGroup("Oops", excs) + + def outer(outer_chain, inner_chain): + try: + inner(inner_chain) + except {pre_catch}BaseExceptionGroup as e: + if outer_chain == "none": + raise + if outer_chain == "from": + raise IndexError() from e + else: + raise IndexError() + + + def test(): + outer("{outer_chain}", "{inner_chain}") + """ + pytester.makepyfile(test_excgroup=filestr) + result = pytester.runpytest() + match_lines = [] + if inner_chain in ("another", "from"): + match_lines.append(r"SyntaxError: ") + + match_lines += [ + r" + Exception Group Traceback (most recent call last):", + rf" \| {pre_catch}BaseExceptionGroup: Oops \(2 sub-exceptions\)", + r" \| ValueError: From f\(\)", + r" \| BaseException: From g\(\)", + r"=* short test summary info =*", + ] + if outer_chain in ("another", "from"): + match_lines.append(r"FAILED test_excgroup.py::test - IndexError") + else: + match_lines.append( + rf"FAILED test_excgroup.py::test - {pre_catch}BaseExceptionGroup: Oops \(2.*" + ) + result.stdout.re_match_lines(match_lines) + + +@pytest.mark.skipif( + sys.version_info < (3, 11), reason="Native ExceptionGroup not implemented" +) +@pytest.mark.parametrize("outer_chain", ["none", "from", "another"]) +@pytest.mark.parametrize("inner_chain", ["none", "from", "another"]) +def test_native_exceptiongroup(pytester: Pytester, outer_chain, inner_chain) -> None: + _exceptiongroup_common(pytester, outer_chain, inner_chain, native=True) + + +@pytest.mark.parametrize("outer_chain", ["none", "from", "another"]) +@pytest.mark.parametrize("inner_chain", ["none", "from", "another"]) +def test_exceptiongroup(pytester: Pytester, outer_chain, inner_chain) -> None: + # with py>=3.11 does not depend on exceptiongroup, though there is a toxenv for it + pytest.importorskip("exceptiongroup") + _exceptiongroup_common(pytester, outer_chain, inner_chain, native=False) diff --git a/tox.ini b/tox.ini index 93c390ffc57..f1ab4b815a5 100644 --- a/tox.ini +++ b/tox.ini @@ -17,6 +17,10 @@ envlist = docs docs-checklinks + # checks that 3.11 native ExceptionGroup works with exceptiongroup + # not included in CI. + py311-exceptiongroup + [testenv] @@ -46,6 +50,7 @@ setenv = extras = testing deps = doctesting: PyYAML + exceptiongroup: exceptiongroup>=1.0.0rc8 numpy: numpy>=1.19.4 pexpect: pexpect>=4.8.0 pluggymain: pluggy @ git+https://github.com/pytest-dev/pluggy.git From 71aa1388e0d7dd2a1c073874a25c88a98ed914f8 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Fri, 19 Aug 2022 19:01:40 +0200 Subject: [PATCH 333/549] Drop `wheel` from `pyproject.toml` example It is unnecessary and has been deleted from the setuptools' docs too. The setuptools' PEP 517 build backend implementation has been auto-adding the `wheel` dependency since it's first been implemented. --- doc/en/explanation/goodpractices.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 0b812ba5857..8deef9abe9c 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -17,7 +17,7 @@ Next, place a ``pyproject.toml`` file in the root of your package: .. code-block:: toml [build-system] - requires = ["setuptools>=42", "wheel"] + requires = ["setuptools >= 42"] build-backend = "setuptools.build_meta" and a ``setup.cfg`` file containing your package's metadata with the following minimum content: From 932264d8fdedc5fbdd676169078dd1acb795903a Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 21 Aug 2022 00:21:46 +0000 Subject: [PATCH 334/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 144 ++++++++++++++++++++++--------- 1 file changed, 104 insertions(+), 40 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 20d5e4c2605..5a02cc58ad8 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1100 plugins. +This list contains 1108 plugins. .. only:: not latex @@ -71,6 +71,7 @@ This list contains 1100 plugins. :pypi:`pytest-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) :pypi:`pytest-assurka` A pytest plugin for Assurka Studio Aug 04, 2022 N/A N/A :pypi:`pytest-ast-back-to-python` A plugin for pytest devs to view how assertion rewriting recodes the AST Sep 29, 2019 4 - Beta N/A + :pypi:`pytest-asteroid` PyTest plugin for docker-based testing on database images Aug 15, 2022 N/A pytest (>=6.2.5,<8.0.0) :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest @@ -153,6 +154,7 @@ This list contains 1100 plugins. :pypi:`pytest-change-report` turn . into √,turn F into x Sep 14, 2020 N/A pytest :pypi:`pytest-change-xds` turn . into √,turn F into x Apr 16, 2022 N/A pytest :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) + :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Aug 19, 2022 5 - Production/Stable N/A :pypi:`pytest-checkdocs` check the README when running tests Jul 31, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) :pypi:`pytest-check-library` check your missing library Jul 17, 2022 N/A N/A @@ -201,12 +203,13 @@ This list contains 1100 plugins. :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Aug 13, 2022 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Aug 17, 2022 N/A N/A :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest :pypi:`pytest-crontab` add crontab task in crontab Dec 09, 2019 N/A N/A :pypi:`pytest-csv` CSV output for pytest. Apr 22, 2021 N/A pytest (>=6.0) + :pypi:`pytest-csv-params` Pytest plugin for Test Case Parametrization with CSV files Aug 17, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) :pypi:`pytest-curio` Pytest support for curio. Oct 07, 2020 N/A N/A :pypi:`pytest-curl-report` pytest plugin to generate curl command line report Dec 11, 2016 4 - Beta N/A :pypi:`pytest-custom-concurrency` Custom grouping concurrence for pytest Feb 08, 2021 N/A N/A @@ -221,7 +224,7 @@ This list contains 1100 plugins. :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A :pypi:`pytest-databricks` Pytest plugin for remote Databricks notebooks testing Jul 29, 2020 N/A pytest :pypi:`pytest-datadir` pytest plugin for test data directories and files Oct 22, 2019 5 - Production/Stable pytest (>=2.7.0) - :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Jan 20, 2022 5 - Production/Stable pytest + :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Aug 16, 2022 5 - Production/Stable pytest (>=7.1) :pypi:`pytest-datadir-ng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Dec 25, 2019 5 - Production/Stable pytest :pypi:`pytest-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Jul 19, 2022 N/A pytest (>=7.0.1) :pypi:`pytest-data-file` Fixture "data" and "case_data" for test from yaml file Dec 04, 2019 N/A N/A @@ -319,6 +322,7 @@ This list contains 1100 plugins. :pypi:`pytest-easyMPI` Package that supports mpi tests in pytest Oct 21, 2020 N/A N/A :pypi:`pytest-easyread` pytest plugin that makes terminal printouts of the reports easier to read Nov 17, 2017 N/A N/A :pypi:`pytest-easy-server` Pytest plugin for easy testing against servers May 01, 2021 4 - Beta pytest (<5.0.0,>=4.3.1) ; python_version < "3.5" + :pypi:`pytest-ebics-sandbox` A pytest plugin for testing against an EBICS sandbox server. Requires docker. Aug 15, 2022 N/A N/A :pypi:`pytest-ec2` Pytest execution on EC2 instance Oct 22, 2019 3 - Alpha N/A :pypi:`pytest-echo` pytest plugin with mechanisms for echoing environment variables, package version and generic attributes Jan 08, 2020 5 - Production/Stable N/A :pypi:`pytest-elasticsearch` Elasticsearch fixtures and fixture factories for Pytest. Mar 01, 2022 5 - Production/Stable pytest (>=6.2.0) @@ -363,6 +367,7 @@ This list contains 1100 plugins. :pypi:`pytest-experiments` A pytest plugin to help developers of research-oriented software projects keep track of the results of their numerical experiments. Dec 13, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) :pypi:`pytest-explicit` A Pytest plugin to ignore certain marked tests by default Jun 15, 2021 5 - Production/Stable pytest :pypi:`pytest-exploratory` Interactive console for pytest. Feb 21, 2022 N/A pytest (>=6.2) + :pypi:`pytest-extensions` A collection of helpers for pytest to ease testing Aug 17, 2022 4 - Beta pytest ; extra == 'testing' :pypi:`pytest-external-blockers` a special outcome for tests that are blocked for external reasons Oct 05, 2021 N/A pytest :pypi:`pytest-extra-durations` A pytest plugin to get durations on a per-function basis and per module basis. Apr 21, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-fabric` Provides test utilities to run fabric task tests by using docker containers Sep 12, 2018 5 - Production/Stable N/A @@ -407,7 +412,7 @@ This list contains 1100 plugins. :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) :pypi:`pytest-flaptastic` Flaptastic py.test plugin Mar 17, 2019 N/A N/A :pypi:`pytest-flask` A set of py.test fixtures to test Flask applications. Feb 27, 2021 5 - Production/Stable pytest (>=5.2) - :pypi:`pytest-flask-ligand` Pytest fixtures and helper functions to use for testing flask-ligand microservices. Aug 09, 2022 4 - Beta pytest (~=7.1) + :pypi:`pytest-flask-ligand` Pytest fixtures and helper functions to use for testing flask-ligand microservices. Aug 18, 2022 4 - Beta pytest (~=7.1) :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) :pypi:`pytest-fluent` A pytest plugin in order to provide logs via fluentd Jul 12, 2022 4 - Beta pytest @@ -423,6 +428,7 @@ This list contains 1100 plugins. :pypi:`pytest-funparam` An alternative way to parametrize test cases. Dec 02, 2021 4 - Beta pytest >=4.6.0 :pypi:`pytest-fxa` pytest plugin for Firefox Accounts Aug 28, 2018 5 - Production/Stable N/A :pypi:`pytest-fxtest` Oct 27, 2020 N/A N/A + :pypi:`pytest-fzf` fzf-based test selector for pytest Aug 17, 2022 1 - Planning pytest (>=7.1.2) :pypi:`pytest-gather-fixtures` set up asynchronous pytest fixtures concurrently Apr 12, 2022 N/A pytest (>=6.0.0) :pypi:`pytest-gc` The garbage collector plugin for py.test Feb 01, 2018 N/A N/A :pypi:`pytest-gcov` Uses gcov to measure test coverage of a C library Feb 01, 2018 3 - Alpha N/A @@ -457,7 +463,7 @@ This list contains 1100 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 13, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 19, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -510,7 +516,7 @@ This list contains 1100 plugins. :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A :pypi:`pytest-isort` py.test plugin to check import ordering using isort Feb 08, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. Aug 19, 2022 5 - Production/Stable N/A :pypi:`pytest-it` Pytest plugin to display test reports as a plaintext spec, inspired by Rspec: https://github.com/mattduck/pytest-it. Jan 22, 2020 4 - Beta N/A :pypi:`pytest-iterassert` Nicer list and iterable assertion messages for pytest May 11, 2020 3 - Alpha N/A :pypi:`pytest-iters` A contextmanager pytest fixture for handling multiple mock iters May 24, 2022 N/A N/A @@ -533,7 +539,7 @@ This list contains 1100 plugins. :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) - :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. Jul 17, 2022 3 - Alpha pytest (>=3.6,<8) + :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. Aug 20, 2022 3 - Alpha pytest (>=3.6,<8) :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 14, 2022 N/A pytest (>=4.2.0) :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A @@ -548,7 +554,7 @@ This list contains 1100 plugins. :pypi:`pytest-ligo` Jan 16, 2020 4 - Beta N/A :pypi:`pytest-lineno` A pytest plugin to show the line numbers of test functions Dec 04, 2020 N/A pytest :pypi:`pytest-line-profiler` Profile code executed by pytest May 03, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-line-profiler-apn` Profile code executed by pytest Aug 13, 2022 4 - Beta N/A + :pypi:`pytest-line-profiler-apn` Profile code executed by pytest Aug 14, 2022 4 - Beta N/A :pypi:`pytest-lisa` Pytest plugin for organizing tests. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) :pypi:`pytest-listener` A simple network listener May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) @@ -631,7 +637,7 @@ This list contains 1100 plugins. :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Feb 07, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" - :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Jan 11, 2022 3 - Alpha pytest (>=6.0.0) + :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Aug 15, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A N/A :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. May 30, 2022 N/A N/A :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 15, 2022 5 - Production/Stable pytest (>=6.2) @@ -668,7 +674,7 @@ This list contains 1100 plugins. :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Jun 02, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators May 25, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Operators Aug 17, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A @@ -728,7 +734,7 @@ This list contains 1100 plugins. :pypi:`pytest-ponyorm` PonyORM in Pytest Oct 31, 2018 N/A pytest (>=3.1.1) :pypi:`pytest-poo` Visualize your crappy tests Mar 25, 2021 5 - Production/Stable pytest (>=2.3.4) :pypi:`pytest-poo-fail` Visualize your failed tests with poo Feb 12, 2015 5 - Production/Stable N/A - :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Apr 20, 2022 5 - Production/Stable pytest + :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Aug 18, 2022 5 - Production/Stable pytest :pypi:`pytest-portion` Select a portion of the collected tests Jan 28, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) @@ -819,6 +825,7 @@ This list contains 1100 plugins. :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Jun 24, 2022 N/A pytest (>=3.8.0) :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-requestselapsed` collect and show http requests elapsed time Aug 14, 2022 N/A N/A :pypi:`pytest-requests-futures` Pytest Plugin to Mock Requests Futures Jul 06, 2022 5 - Production/Stable pytest :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Jun 17, 2021 5 - Production/Stable pytest (>=4.6) @@ -833,7 +840,7 @@ This list contains 1100 plugins. :pypi:`pytest-rest-api` Aug 08, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A - :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Aug 11, 2022 N/A pytest (>=7.0.0) + :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Aug 16, 2022 N/A pytest (>=7.0.0) :pypi:`pytest-reverse` Pytest plugin to reverse test order. May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) @@ -861,20 +868,20 @@ This list contains 1100 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 05, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 19, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 05, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 19, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A - :pypi:`pytest-servers` pytest servers Jul 25, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-servers` pytest servers Aug 18, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :pypi:`pytest-session2file` pytest-session2file (aka: pytest-session_to_file for v0.1.0 - v0.1.2) is a py.test plugin for capturing and saving to file the stdout of py.test. Jan 26, 2021 3 - Alpha pytest :pypi:`pytest-session-fixture-globalize` py.test plugin to make session fixtures behave as if written in conftest, even if it is written in some modules May 15, 2018 4 - Beta N/A @@ -908,6 +915,7 @@ This list contains 1100 plugins. :pypi:`pytest-snmpserver` May 12, 2021 N/A N/A :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Jan 05, 2022 4 - Beta pytest (>=6.2.0) :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Jan 23, 2022 4 - Beta pytest (>=3.6.3) + :pypi:`pytest-sofaepione` Test the installation of SOFA and the SofaEpione plugin. Aug 17, 2022 N/A N/A :pypi:`pytest-soft-assertions` May 05, 2020 3 - Alpha pytest :pypi:`pytest-solidity` A PyTest library plugin for Solidity language. Jan 15, 2022 1 - Planning pytest (<7,>=6.0.1) ; extra == 'tests' :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) @@ -927,7 +935,7 @@ This list contains 1100 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons May 26, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Aug 19, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A @@ -980,14 +988,14 @@ This list contains 1100 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Jun 19, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Jul 16, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Aug 17, 2022 4 - Beta N/A :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) :pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Jun 13, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) :pypi:`pytest-testrail2` A small example package Nov 17, 2020 N/A pytest (>=5) - :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Mar 11, 2022 N/A pytest (>=5.5) + :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Aug 19, 2022 N/A pytest (>=5.5) :pypi:`pytest-testrail-api-client` TestRail Api Python Client Dec 14, 2021 N/A pytest :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A @@ -997,7 +1005,7 @@ This list contains 1100 plugins. :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A :pypi:`pytest-testreport` May 23, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-testreport-new` May 05, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-testreport-new` Aug 15, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) :pypi:`pytest-test-utils` Jul 14, 2022 N/A pytest (>=5) @@ -1494,6 +1502,13 @@ This list contains 1100 plugins. A plugin for pytest devs to view how assertion rewriting recodes the AST + :pypi:`pytest-asteroid` + *last release*: Aug 15, 2022, + *status*: N/A, + *requires*: pytest (>=6.2.5,<8.0.0) + + PyTest plugin for docker-based testing on database images + :pypi:`pytest-astropy` *last release*: Apr 12, 2022, *status*: 5 - Production/Stable, @@ -2068,6 +2083,13 @@ This list contains 1100 plugins. A pytest fixture for changing current working directory + :pypi:`pytest-check` + *last release*: Aug 19, 2022, + *status*: 5 - Production/Stable, + *requires*: N/A + + A pytest plugin that allows multiple failures per test. + :pypi:`pytest-checkdocs` *last release*: Jul 31, 2021, *status*: 5 - Production/Stable, @@ -2405,7 +2427,7 @@ This list contains 1100 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Aug 13, 2022, + *last release*: Aug 17, 2022, *status*: N/A, *requires*: N/A @@ -2446,6 +2468,13 @@ This list contains 1100 plugins. CSV output for pytest. + :pypi:`pytest-csv-params` + *last release*: Aug 17, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=7.1.2,<8.0.0) + + Pytest plugin for Test Case Parametrization with CSV files + :pypi:`pytest-curio` *last release*: Oct 07, 2020, *status*: N/A, @@ -2545,9 +2574,9 @@ This list contains 1100 plugins. pytest plugin for test data directories and files :pypi:`pytest-datadir-mgr` - *last release*: Jan 20, 2022, + *last release*: Aug 16, 2022, *status*: 5 - Production/Stable, - *requires*: pytest + *requires*: pytest (>=7.1) Manager for test data: downloads, artifact caching, and a tmpdir context. @@ -3230,6 +3259,13 @@ This list contains 1100 plugins. Pytest plugin for easy testing against servers + :pypi:`pytest-ebics-sandbox` + *last release*: Aug 15, 2022, + *status*: N/A, + *requires*: N/A + + A pytest plugin for testing against an EBICS sandbox server. Requires docker. + :pypi:`pytest-ec2` *last release*: Oct 22, 2019, *status*: 3 - Alpha, @@ -3538,6 +3574,13 @@ This list contains 1100 plugins. Interactive console for pytest. + :pypi:`pytest-extensions` + *last release*: Aug 17, 2022, + *status*: 4 - Beta, + *requires*: pytest ; extra == 'testing' + + A collection of helpers for pytest to ease testing + :pypi:`pytest-external-blockers` *last release*: Oct 05, 2021, *status*: N/A, @@ -3847,7 +3890,7 @@ This list contains 1100 plugins. A set of py.test fixtures to test Flask applications. :pypi:`pytest-flask-ligand` - *last release*: Aug 09, 2022, + *last release*: Aug 18, 2022, *status*: 4 - Beta, *requires*: pytest (~=7.1) @@ -3958,6 +4001,13 @@ This list contains 1100 plugins. + :pypi:`pytest-fzf` + *last release*: Aug 17, 2022, + *status*: 1 - Planning, + *requires*: pytest (>=7.1.2) + + fzf-based test selector for pytest + :pypi:`pytest-gather-fixtures` *last release*: Apr 12, 2022, *status*: N/A, @@ -4197,7 +4247,7 @@ This list contains 1100 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Aug 13, 2022, + *last release*: Aug 19, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -4568,9 +4618,9 @@ This list contains 1100 plugins. py.test plugin to check import ordering using isort :pypi:`pytest-is-running` - *last release*: May 11, 2022, + *last release*: Aug 19, 2022, *status*: 5 - Production/Stable, - *requires*: pytest + *requires*: N/A pytest plugin providing a function to check if pytest is running. @@ -4729,7 +4779,7 @@ This list contains 1100 plugins. Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks :pypi:`pytest-lambda` - *last release*: Jul 17, 2022, + *last release*: Aug 20, 2022, *status*: 3 - Alpha, *requires*: pytest (>=3.6,<8) @@ -4834,7 +4884,7 @@ This list contains 1100 plugins. Profile code executed by pytest :pypi:`pytest-line-profiler-apn` - *last release*: Aug 13, 2022, + *last release*: Aug 14, 2022, *status*: 4 - Beta, *requires*: N/A @@ -5415,8 +5465,8 @@ This list contains 1100 plugins. Mypy static type checker plugin for Pytest :pypi:`pytest-mypy-plugins` - *last release*: Jan 11, 2022, - *status*: 3 - Alpha, + *last release*: Aug 15, 2022, + *status*: 4 - Beta, *requires*: pytest (>=6.0.0) pytest plugin for writing tests for mypy plugins @@ -5674,7 +5724,7 @@ This list contains 1100 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: May 25, 2022, + *last release*: Aug 17, 2022, *status*: N/A, *requires*: pytest @@ -6094,7 +6144,7 @@ This list contains 1100 plugins. Visualize your failed tests with poo :pypi:`pytest-pop` - *last release*: Apr 20, 2022, + *last release*: Aug 18, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6730,6 +6780,13 @@ This list contains 1100 plugins. A simple plugin to use with pytest + :pypi:`pytest-requestselapsed` + *last release*: Aug 14, 2022, + *status*: N/A, + *requires*: N/A + + collect and show http requests elapsed time + :pypi:`pytest-requests-futures` *last release*: Jul 06, 2022, *status*: 5 - Production/Stable, @@ -6829,7 +6886,7 @@ This list contains 1100 plugins. A RethinkDB plugin for pytest. :pypi:`pytest-retry` - *last release*: Aug 11, 2022, + *last release*: Aug 16, 2022, *status*: N/A, *requires*: pytest (>=7.0.0) @@ -7025,7 +7082,7 @@ This list contains 1100 plugins. :pypi:`pytest-sbase` - *last release*: Aug 05, 2022, + *last release*: Aug 19, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7067,7 +7124,7 @@ This list contains 1100 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Aug 05, 2022, + *last release*: Aug 19, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7116,7 +7173,7 @@ This list contains 1100 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Jul 25, 2022, + *last release*: Aug 18, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -7353,6 +7410,13 @@ This list contains 1100 plugins. Pytest Plugin to disable socket calls during tests + :pypi:`pytest-sofaepione` + *last release*: Aug 17, 2022, + *status*: N/A, + *requires*: N/A + + Test the installation of SOFA and the SofaEpione plugin. + :pypi:`pytest-soft-assertions` *last release*: May 05, 2020, *status*: 3 - Alpha, @@ -7487,7 +7551,7 @@ This list contains 1100 plugins. :pypi:`pytest-splunk-addon` - *last release*: May 26, 2022, + *last release*: Aug 19, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7858,7 +7922,7 @@ This list contains 1100 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Jul 16, 2022, + *last release*: Aug 17, 2022, *status*: 4 - Beta, *requires*: N/A @@ -7907,7 +7971,7 @@ This list contains 1100 plugins. A small example package :pypi:`pytest-testrail-api` - *last release*: Mar 11, 2022, + *last release*: Aug 19, 2022, *status*: N/A, *requires*: pytest (>=5.5) @@ -7977,7 +8041,7 @@ This list contains 1100 plugins. :pypi:`pytest-testreport-new` - *last release*: May 05, 2022, + *last release*: Aug 15, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) From 42776c0949b4f6245f1df447108a49b9ec8b1363 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 20:19:44 -0300 Subject: [PATCH 335/549] [pre-commit.ci] pre-commit autoupdate (#10178) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/PyCQA/flake8: 4.0.1 → 5.0.4](https://github.com/PyCQA/flake8/compare/4.0.1...5.0.4) - [github.com/asottile/pyupgrade: v2.37.2 → v2.37.3](https://github.com/asottile/pyupgrade/compare/v2.37.2...v2.37.3) - [github.com/asottile/setup-cfg-fmt: v1.20.2 → v2.0.0](https://github.com/asottile/setup-cfg-fmt/compare/v1.20.2...v2.0.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Configure setup-cfg-fmt to include version specifiers * Update .pre-commit-config.yaml * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bruno Oliveira --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 72e1d8d62b1..db679bdbce2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: language: python files: \.py$ - repo: https://github.com/PyCQA/flake8 - rev: 4.0.1 + rev: 5.0.4 hooks: - id: flake8 language_version: python3 @@ -42,15 +42,15 @@ repos: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.37.2 + rev: v2.37.3 hooks: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.20.2 + rev: v2.0.0 hooks: - id: setup-cfg-fmt - args: [--max-py-version=3.10] + args: ["--max-py-version=3.10", "--include-version-classifiers"] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.9.0 hooks: From adaa463ee31bbdb17a348d680a58d6373dcc4a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gergely=20Kalm=C3=A1r?= Date: Fri, 26 Aug 2022 14:46:47 +0200 Subject: [PATCH 336/549] Ignore editable installation modules (#10231) Fixes #10230 --- changelog/10230.bugfix.rst | 1 + src/_pytest/config/__init__.py | 3 ++- testing/test_config.py | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelog/10230.bugfix.rst diff --git a/changelog/10230.bugfix.rst b/changelog/10230.bugfix.rst new file mode 100644 index 00000000000..6ca2b00bf89 --- /dev/null +++ b/changelog/10230.bugfix.rst @@ -0,0 +1 @@ +Ignore ``.py`` files created by ``pyproject.toml``-based editable builds introduced in `pip 21.3 `__. diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index b3173d7d736..d753a9054ab 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -836,7 +836,8 @@ def _iter_rewritable_modules(package_files: Iterable[str]) -> Iterator[str]: if is_simple_module: module_name, _ = os.path.splitext(fn) # we ignore "setup.py" at the root of the distribution - if module_name != "setup": + # as well as editable installation finder modules made by setuptools + if module_name != "setup" and not module_name.startswith("__editable__"): seen_some = True yield module_name elif is_package: diff --git a/testing/test_config.py b/testing/test_config.py index c2e3fe5bbcf..f5b6d7f9816 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -842,6 +842,9 @@ def test_confcutdir_check_isdir(self, pytester: Pytester) -> None: (["src/bar/__init__.py"], ["bar"]), (["src/bar/__init__.py", "setup.py"], ["bar"]), (["source/python/bar/__init__.py", "setup.py"], ["bar"]), + # editable installation finder modules + (["__editable___xyz_finder.py"], []), + (["bar/__init__.py", "__editable___xyz_finder.py"], ["bar"]), ], ) def test_iter_rewritable_modules(self, names, expected) -> None: From 0fc3a977a9f60b09aec032f77e16a320dbe1d271 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 17:49:38 -0300 Subject: [PATCH 337/549] [automated] Update plugin list (#10253) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 124 +++++++++++++++++-------------- 1 file changed, 70 insertions(+), 54 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 5a02cc58ad8..9eafdfe7665 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1108 plugins. +This list contains 1110 plugins. .. only:: not latex @@ -154,7 +154,7 @@ This list contains 1108 plugins. :pypi:`pytest-change-report` turn . into √,turn F into x Sep 14, 2020 N/A pytest :pypi:`pytest-change-xds` turn . into √,turn F into x Apr 16, 2022 N/A pytest :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) - :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Aug 19, 2022 5 - Production/Stable N/A + :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Aug 25, 2022 5 - Production/Stable N/A :pypi:`pytest-checkdocs` check the README when running tests Jul 31, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) :pypi:`pytest-check-library` check your missing library Jul 17, 2022 N/A N/A @@ -202,14 +202,15 @@ This list contains 1108 plugins. :pypi:`pytest-coverage` Jun 17, 2015 N/A N/A :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' - :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Mar 18, 2022 5 - Production/Stable pytest (!=5.4.0,!=5.4.1) + :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Aug 22, 2022 5 - Production/Stable pytest (>=7.0) :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Aug 17, 2022 N/A N/A + :pypi:`pytest-cqase` Custom qase pytest plugin Aug 22, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest :pypi:`pytest-crontab` add crontab task in crontab Dec 09, 2019 N/A N/A :pypi:`pytest-csv` CSV output for pytest. Apr 22, 2021 N/A pytest (>=6.0) - :pypi:`pytest-csv-params` Pytest plugin for Test Case Parametrization with CSV files Aug 17, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-csv-params` Pytest plugin for Test Case Parametrization with CSV files Aug 25, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) :pypi:`pytest-curio` Pytest support for curio. Oct 07, 2020 N/A N/A :pypi:`pytest-curl-report` pytest plugin to generate curl command line report Dec 11, 2016 4 - Beta N/A :pypi:`pytest-custom-concurrency` Custom grouping concurrence for pytest Feb 08, 2021 N/A N/A @@ -330,14 +331,14 @@ This list contains 1108 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Aug 04, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Aug 04, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Aug 04, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Aug 04, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Aug 04, 2022 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Aug 04, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Aug 04, 2022 N/A N/A - :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Jul 05, 2022 N/A pytest (>=7.0,<8.0) + :pypi:`pytest-embedded` pytest embedded plugin Aug 23, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Aug 23, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Aug 23, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Aug 23, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Aug 23, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Aug 23, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Aug 23, 2022 N/A N/A + :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Aug 27, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Jun 22, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -436,7 +437,7 @@ This list contains 1108 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Jul 28, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Aug 23, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -463,7 +464,7 @@ This list contains 1108 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 19, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 26, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -523,7 +524,7 @@ This list contains 1108 plugins. :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Aug 05, 2022 4 - Beta pytest + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Aug 25, 2022 4 - Beta pytest :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A @@ -592,7 +593,7 @@ This list contains 1108 plugins. :pypi:`pytest-md` Plugin for generating Markdown reports for pytest results Jul 11, 2019 3 - Alpha pytest (>=4.2.1) :pypi:`pytest-md-report` A pytest plugin to make a test results report with Markdown table format. Aug 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :pypi:`pytest-memprof` Estimates memory consumption of test functions Mar 29, 2019 4 - Beta N/A - :pypi:`pytest-memray` A simple plugin to use with pytest May 27, 2022 N/A N/A + :pypi:`pytest-memray` A simple plugin to use with pytest Aug 21, 2022 N/A N/A :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) @@ -611,7 +612,7 @@ This list contains 1108 plugins. :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Aug 12, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Aug 24, 2022 N/A pytest (>=1.0) :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A @@ -628,7 +629,7 @@ This list contains 1108 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 23, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Aug 01, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Aug 26, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jul 12, 2022 N/A pytest :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A @@ -650,7 +651,7 @@ This list contains 1108 plugins. :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Aug 10, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Aug 23, 2022 N/A pytest (==6.2.5) :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A :pypi:`pytest-nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Jul 07, 2021 N/A N/A @@ -862,26 +863,26 @@ This list contains 1108 plugins. :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). May 10, 2022 3 - Alpha N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A - :pypi:`pytest-salt-factories` Pytest Salt Plugin Jul 14, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Aug 25, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 19, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 27, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 19, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 27, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A - :pypi:`pytest-servers` pytest servers Aug 18, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-servers` pytest servers Aug 22, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :pypi:`pytest-session2file` pytest-session2file (aka: pytest-session_to_file for v0.1.0 - v0.1.2) is a py.test plugin for capturing and saving to file the stdout of py.test. Jan 26, 2021 3 - Alpha pytest :pypi:`pytest-session-fixture-globalize` py.test plugin to make session fixtures behave as if written in conftest, even if it is written in some modules May 15, 2018 4 - Beta N/A @@ -935,7 +936,7 @@ This list contains 1108 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Aug 19, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Aug 23, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A @@ -988,7 +989,7 @@ This list contains 1108 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Jun 19, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Aug 17, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Aug 27, 2022 4 - Beta N/A :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) :pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Jun 13, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) @@ -1027,6 +1028,7 @@ This list contains 1108 plugins. :pypi:`pytest-tm4j-reporter` Cloud Jira Test Management (TM4J) PyTest reporter plugin Sep 01, 2020 N/A pytest :pypi:`pytest-tmnet` A small example package Mar 01, 2022 N/A N/A :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest + :pypi:`pytest-tmpfs` A pytest plugin that helps you on using a temporary filesystem for testing. Aug 26, 2022 N/A pytest :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Aug 12, 2022 N/A N/A :pypi:`pytest-todo` A small plugin for the pytest testing framework, marking TODO comments as failure May 23, 2019 4 - Beta pytest :pypi:`pytest-tomato` Mar 01, 2019 5 - Production/Stable N/A @@ -1049,7 +1051,7 @@ This list contains 1108 plugins. :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Apr 27, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A - :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, with optional auto-launch and HTML export Aug 13, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, with optional auto-launch and HTML export Aug 27, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) @@ -1074,7 +1076,7 @@ This list contains 1108 plugins. :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Jun 20, 2022 5 - Production/Stable pytest (>=6.2.2) :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest - :pypi:`pytest-ver` Pytest module with Verification Report Jul 20, 2022 2 - Pre-Alpha N/A + :pypi:`pytest-ver` Pytest module with Verification Report Aug 21, 2022 2 - Pre-Alpha N/A :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) :pypi:`pytest-virtualenv` Virtualenv fixture for py.test May 28, 2019 5 - Production/Stable pytest @@ -2084,7 +2086,7 @@ This list contains 1108 plugins. A pytest fixture for changing current working directory :pypi:`pytest-check` - *last release*: Aug 19, 2022, + *last release*: Aug 25, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -2420,9 +2422,9 @@ This list contains 1108 plugins. Pytest plugin for excluding tests based on coverage data :pypi:`pytest-cpp` - *last release*: Mar 18, 2022, + *last release*: Aug 22, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (!=5.4.0,!=5.4.1) + *requires*: pytest (>=7.0) Use pytest's runner to discover and execute C++ tests @@ -2433,6 +2435,13 @@ This list contains 1108 plugins. A pytest plugin that imports CPPython testing types + :pypi:`pytest-cqase` + *last release*: Aug 22, 2022, + *status*: N/A, + *requires*: pytest (>=7.1.2,<8.0.0) + + Custom qase pytest plugin + :pypi:`pytest-cram` *last release*: Aug 08, 2020, *status*: N/A, @@ -2469,7 +2478,7 @@ This list contains 1108 plugins. CSV output for pytest. :pypi:`pytest-csv-params` - *last release*: Aug 17, 2022, + *last release*: Aug 25, 2022, *status*: 4 - Beta, *requires*: pytest (>=7.1.2,<8.0.0) @@ -3316,56 +3325,56 @@ This list contains 1108 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Aug 04, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Aug 04, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Aug 04, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Aug 04, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Aug 04, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Aug 04, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Aug 04, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing espressif boards via serial ports :pypi:`pytest-embrace` - *last release*: Jul 05, 2022, + *last release*: Aug 27, 2022, *status*: N/A, *requires*: pytest (>=7.0,<8.0) @@ -4058,7 +4067,7 @@ This list contains 1108 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Jul 28, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: N/A @@ -4247,7 +4256,7 @@ This list contains 1108 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Aug 19, 2022, + *last release*: Aug 26, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -4667,7 +4676,7 @@ This list contains 1108 plugins. py.test JIRA integration plugin, using markers :pypi:`pytest-jira-xray` - *last release*: Aug 05, 2022, + *last release*: Aug 25, 2022, *status*: 4 - Beta, *requires*: pytest @@ -5150,7 +5159,7 @@ This list contains 1108 plugins. Estimates memory consumption of test functions :pypi:`pytest-memray` - *last release*: May 27, 2022, + *last release*: Aug 21, 2022, *status*: N/A, *requires*: N/A @@ -5283,7 +5292,7 @@ This list contains 1108 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Aug 12, 2022, + *last release*: Aug 24, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -5402,7 +5411,7 @@ This list contains 1108 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Aug 01, 2022, + *last release*: Aug 26, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -5556,7 +5565,7 @@ This list contains 1108 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Aug 10, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -7040,7 +7049,7 @@ This list contains 1108 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Jul 14, 2022, + *last release*: Aug 25, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -7082,7 +7091,7 @@ This list contains 1108 plugins. :pypi:`pytest-sbase` - *last release*: Aug 19, 2022, + *last release*: Aug 27, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7124,7 +7133,7 @@ This list contains 1108 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Aug 19, 2022, + *last release*: Aug 27, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7173,7 +7182,7 @@ This list contains 1108 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Aug 18, 2022, + *last release*: Aug 22, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -7551,7 +7560,7 @@ This list contains 1108 plugins. :pypi:`pytest-splunk-addon` - *last release*: Aug 19, 2022, + *last release*: Aug 23, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7922,7 +7931,7 @@ This list contains 1108 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Aug 17, 2022, + *last release*: Aug 27, 2022, *status*: 4 - Beta, *requires*: N/A @@ -8194,6 +8203,13 @@ This list contains 1108 plugins. Utilities to create temporary file hierarchies in pytest. + :pypi:`pytest-tmpfs` + *last release*: Aug 26, 2022, + *status*: N/A, + *requires*: pytest + + A pytest plugin that helps you on using a temporary filesystem for testing. + :pypi:`pytest-tmreport` *last release*: Aug 12, 2022, *status*: N/A, @@ -8349,7 +8365,7 @@ This list contains 1108 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: Aug 13, 2022, + *last release*: Aug 27, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.5) @@ -8524,7 +8540,7 @@ This list contains 1108 plugins. py.test fixture for creating a virtual environment :pypi:`pytest-ver` - *last release*: Jul 20, 2022, + *last release*: Aug 21, 2022, *status*: 2 - Pre-Alpha, *requires*: N/A From 4b77638ba88f6dc7bf1125deeb8e4d4bfd795ad5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 30 Aug 2022 07:11:58 -0300 Subject: [PATCH 338/549] [pre-commit.ci] pre-commit autoupdate (#10256) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/myint/autoflake: v1.4 → v1.5.1](https://github.com/myint/autoflake/compare/v1.4...v1.5.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index db679bdbce2..68357b127ac 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,7 @@ repos: exclude: _pytest/(debugging|hookspec).py language_version: python3 - repo: https://github.com/myint/autoflake - rev: v1.4 + rev: v1.5.1 hooks: - id: autoflake name: autoflake From 1caa099e42739bf96ef007297895dffda8c07e60 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 26 Aug 2022 14:12:08 -0300 Subject: [PATCH 339/549] Fix regendoc The finalizers example was wiping out code needed for the examples below. --- doc/en/how-to/fixtures.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index 8ab498bd7d4..9ace480b553 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -744,10 +744,10 @@ Note on finalizer order Finalizers are executed in a first-in-last-out order. For yield fixtures, the first teardown code to run is from the right-most fixture, i.e. the last test parameter. -.. regendoc:wipe .. code-block:: python + # content of test_finalizers.py import pytest @@ -769,12 +769,12 @@ For yield fixtures, the first teardown code to run is from the right-most fixtur .. code-block:: pytest - $ pytest test_module.py + $ pytest -s test_finalizers.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y collected 1 item - test_module.py test_bar + test_finalizers.py test_bar .after_yield_2 after_yield_1 @@ -784,6 +784,8 @@ For finalizers, the first fixture to run is last call to `request.addfinalizer`. .. code-block:: python + # content of test_finalizers.py + from functools import partial import pytest @@ -799,12 +801,12 @@ For finalizers, the first fixture to run is last call to `request.addfinalizer`. .. code-block:: pytest - $ pytest test_module.py + $ pytest -s test_finalizers.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y collected 1 item - test_module.py test_bar + test_finalizers.py test_bar .finalizer_1 finalizer_2 @@ -1416,6 +1418,8 @@ Running the above tests results in the following test IDs being used: + + From 245a8c23dd0ffeb03710f0fbabd1f5e6a56611ab Mon Sep 17 00:00:00 2001 From: Philipp A Date: Thu, 1 Sep 2022 12:55:41 +0200 Subject: [PATCH 340/549] Revamp good practices (#10206) * Recommend importlib import mode for new projects * Recommend src layout more strongly * Switch to hatchling as the packaging tool in the example (following PyPA) * Add explanation about the different import modes --- doc/en/conf.py | 1 + doc/en/explanation/goodpractices.rst | 168 +++++++++++++-------------- doc/en/how-to/fixtures.rst | 14 +-- 3 files changed, 82 insertions(+), 101 deletions(-) diff --git a/doc/en/conf.py b/doc/en/conf.py index b0c158e5a21..5184ee7b1e5 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -393,6 +393,7 @@ "tox": ("https://tox.wiki/en/stable", None), "virtualenv": ("https://virtualenv.pypa.io/en/stable", None), "setuptools": ("https://setuptools.pypa.io/en/stable", None), + "packaging": ("https://packaging.python.org/en/latest", None), } diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 8deef9abe9c..0280f14342f 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -12,41 +12,26 @@ For development, we recommend you use :mod:`venv` for virtual environments and as well as the ``pytest`` package itself. This ensures your code and dependencies are isolated from your system Python installation. -Next, place a ``pyproject.toml`` file in the root of your package: +Create a ``pyproject.toml`` file in the root of your repository as described in +:doc:`packaging:tutorials/packaging-projects`. +The first few lines should look like this: .. code-block:: toml [build-system] - requires = ["setuptools >= 42"] - build-backend = "setuptools.build_meta" - -and a ``setup.cfg`` file containing your package's metadata with the following minimum content: - -.. code-block:: ini + requires = ["hatchling"] + build-backend = "hatchling.build" [metadata] - name = PACKAGENAME - - [options] - packages = find: + name = "PACKAGENAME" where ``PACKAGENAME`` is the name of your package. -.. note:: - - If your pip version is older than ``21.3``, you'll also need a ``setup.py`` file: - - .. code-block:: python - - from setuptools import setup - - setup() - You can then install your package in "editable" mode by running from the same directory: .. code-block:: bash - pip install -e . + pip install -e . which lets you change your source code (both tests and application) and rerun tests at will. @@ -89,11 +74,11 @@ to keep tests separate from actual application code (often a good idea): .. code-block:: text pyproject.toml - setup.cfg - mypkg/ - __init__.py - app.py - view.py + src/ + mypkg/ + __init__.py + app.py + view.py tests/ test_app.py test_view.py @@ -112,72 +97,28 @@ This has the following benefits: See :ref:`pytest vs python -m pytest` for more information about the difference between calling ``pytest`` and ``python -m pytest``. -Note that this scheme has a drawback if you are using ``prepend`` :ref:`import mode ` -(which is the default): your test files must have **unique names**, because -``pytest`` will import them as *top-level* modules since there are no packages -to derive a full package name from. In other words, the test files in the example above will -be imported as ``test_app`` and ``test_view`` top-level modules by adding ``tests/`` to -``sys.path``. +For new projects, we recommend to use ``importlib`` :ref:`import mode ` +(see which-import-mode_ for a detailed explanation). +To this end, add the following to your ``pyproject.toml``: -If you need to have test modules with the same name, you might add ``__init__.py`` files to your -``tests`` folder and subfolders, changing them to packages: - -.. code-block:: text +.. code-block:: toml - pyproject.toml - setup.cfg - mypkg/ - ... - tests/ - __init__.py - foo/ - __init__.py - test_view.py - bar/ - __init__.py - test_view.py + [tool.pytest.ini_options] + addopts = [ + "--import-mode=importlib", + ] -Now pytest will load the modules as ``tests.foo.test_view`` and ``tests.bar.test_view``, allowing -you to have modules with the same name. But now this introduces a subtle problem: in order to load -the test modules from the ``tests`` directory, pytest prepends the root of the repository to -``sys.path``, which adds the side-effect that now ``mypkg`` is also importable. +.. _src-layout: -This is problematic if you are using a tool like `tox`_ to test your package in a virtual environment, -because you want to test the *installed* version of your package, not the local code from the repository. +Generally, but especially if you use the default import mode ``prepend``, +it is **strongly** suggested to use a ``src`` layout. +Here, your application root package resides in a sub-directory of your root, +i.e. ``src/mypkg/`` instead of ``mypkg``. -.. _`src-layout`: +This layout prevents a lot of common pitfalls and has many benefits, +which are better explained in this excellent `blog post`_ by Ionel Cristian Mărieș. -In this situation, it is **strongly** suggested to use a ``src`` layout where application root package resides in a -sub-directory of your root: - -.. code-block:: text - - pyproject.toml - setup.cfg - src/ - mypkg/ - __init__.py - app.py - view.py - tests/ - __init__.py - foo/ - __init__.py - test_view.py - bar/ - __init__.py - test_view.py - - -This layout prevents a lot of common pitfalls and has many benefits, which are better explained in this excellent -`blog post by Ionel Cristian Mărieș `_. - -.. note:: - The ``--import-mode=importlib`` option (see :ref:`import-modes`) does not have - any of the drawbacks above because ``sys.path`` is not changed when importing - test modules, so users that run into this issue are strongly encouraged to try it. - - The ``src`` directory layout is still strongly recommended however. +.. _blog post: https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure> Tests as part of application code @@ -190,8 +131,7 @@ want to distribute them along with your application: .. code-block:: text pyproject.toml - setup.cfg - mypkg/ + [src/]mypkg/ __init__.py app.py view.py @@ -253,6 +193,56 @@ Note that this layout also works in conjunction with the ``src`` layout mentione much less surprising. +.. _which-import-mode: + +Choosing an import mode +^^^^^^^^^^^^^^^^^^^^^^^ + +For historical reasons, pytest defaults to the ``prepend`` :ref:`import mode ` +instead of the ``importlib`` import mode we recommend for new projects. +The reason lies in the way the ``prepend`` mode works: + +Since there are no packages to derive a full package name from, +``pytest`` will import your test files as *top-level* modules. +The test files in the first example (:ref:`src layout `) would be imported as +``test_app`` and ``test_view`` top-level modules by adding ``tests/`` to ``sys.path``. + +This results in a drawback compared to the import mode ``importlib``: +your test files must have **unique names**. + +If you need to have test modules with the same name, +as a workaround you might add ``__init__.py`` files to your ``tests`` folder and subfolders, +changing them to packages: + +.. code-block:: text + + pyproject.toml + mypkg/ + ... + tests/ + __init__.py + foo/ + __init__.py + test_view.py + bar/ + __init__.py + test_view.py + +Now pytest will load the modules as ``tests.foo.test_view`` and ``tests.bar.test_view``, +allowing you to have modules with the same name. +But now this introduces a subtle problem: +in order to load the test modules from the ``tests`` directory, +pytest prepends the root of the repository to ``sys.path``, +which adds the side-effect that now ``mypkg`` is also importable. + +This is problematic if you are using a tool like tox_ to test your package in a virtual environment, +because you want to test the *installed* version of your package, +not the local code from the repository. + +The ``importlib`` import mode does not have any of the drawbacks above, +because ``sys.path`` is not changed when importing test modules. + + .. _`buildout`: http://www.buildout.org/en/latest/ .. _`use tox`: diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index 9ace480b553..c63a1c3c5b1 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -1766,8 +1766,6 @@ Given the tests file structure is: :: tests/ - __init__.py - conftest.py # content of tests/conftest.py import pytest @@ -1782,8 +1780,6 @@ Given the tests file structure is: assert username == 'username' subfolder/ - __init__.py - conftest.py # content of tests/subfolder/conftest.py import pytest @@ -1792,8 +1788,8 @@ Given the tests file structure is: def username(username): return 'overridden-' + username - test_something.py - # content of tests/subfolder/test_something.py + test_something_else.py + # content of tests/subfolder/test_something_else.py def test_username(username): assert username == 'overridden-username' @@ -1809,8 +1805,6 @@ Given the tests file structure is: :: tests/ - __init__.py - conftest.py # content of tests/conftest.py import pytest @@ -1852,8 +1846,6 @@ Given the tests file structure is: :: tests/ - __init__.py - conftest.py # content of tests/conftest.py import pytest @@ -1890,8 +1882,6 @@ Given the tests file structure is: :: tests/ - __init__.py - conftest.py # content of tests/conftest.py import pytest From 7f4b63b143c11a93b3fb276297a4fe078e2607b8 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 2 Sep 2022 08:23:39 -0300 Subject: [PATCH 341/549] Merge pull request #10259 from pytest-dev/release-7.1.3 Prepare release 7.1.3 (cherry picked from commit 3739e6cd4830cf707dff3fb5c5b93d7a2cec3663) --- changelog/10060.bugfix.rst | 1 - changelog/10114.trivial.rst | 1 - changelog/10190.bugfix.rst | 1 - changelog/10230.bugfix.rst | 1 - changelog/3396.bugfix.rst | 1 - changelog/9514.bugfix.rst | 1 - changelog/9791.bugfix.rst | 1 - changelog/9917.bugfix.rst | 1 - changelog/9937.doc.rst | 1 - doc/en/announce/index.rst | 1 + doc/en/announce/release-7.1.3.rst | 28 ++++++++ doc/en/builtin.rst | 102 ++++++++++++++++++++++++------ doc/en/changelog.rst | 41 ++++++++++++ doc/en/getting-started.rst | 2 +- doc/en/how-to/fixtures.rst | 14 ++-- 15 files changed, 164 insertions(+), 33 deletions(-) delete mode 100644 changelog/10060.bugfix.rst delete mode 100644 changelog/10114.trivial.rst delete mode 100644 changelog/10190.bugfix.rst delete mode 100644 changelog/10230.bugfix.rst delete mode 100644 changelog/3396.bugfix.rst delete mode 100644 changelog/9514.bugfix.rst delete mode 100644 changelog/9791.bugfix.rst delete mode 100644 changelog/9917.bugfix.rst delete mode 100644 changelog/9937.doc.rst create mode 100644 doc/en/announce/release-7.1.3.rst diff --git a/changelog/10060.bugfix.rst b/changelog/10060.bugfix.rst deleted file mode 100644 index c8941820eca..00000000000 --- a/changelog/10060.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -When running with ``--pdb``, ``TestCase.tearDown`` is no longer called for tests when the *class* has been skipped via ``unittest.skip`` or ``pytest.mark.skip``. diff --git a/changelog/10114.trivial.rst b/changelog/10114.trivial.rst deleted file mode 100644 index 42c43a1d0d6..00000000000 --- a/changelog/10114.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Replace `atomicwrites `__ dependency on windows with `os.replace`. diff --git a/changelog/10190.bugfix.rst b/changelog/10190.bugfix.rst deleted file mode 100644 index 731d0efad9a..00000000000 --- a/changelog/10190.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Invalid XML characters in setup or teardown error messages are now properly escaped for JUnit XML reports. diff --git a/changelog/10230.bugfix.rst b/changelog/10230.bugfix.rst deleted file mode 100644 index 6ca2b00bf89..00000000000 --- a/changelog/10230.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Ignore ``.py`` files created by ``pyproject.toml``-based editable builds introduced in `pip 21.3 `__. diff --git a/changelog/3396.bugfix.rst b/changelog/3396.bugfix.rst deleted file mode 100644 index aa3f278c2a6..00000000000 --- a/changelog/3396.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Doctests now respect the ``--import-mode`` flag. diff --git a/changelog/9514.bugfix.rst b/changelog/9514.bugfix.rst deleted file mode 100644 index a940b5c72d5..00000000000 --- a/changelog/9514.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Type-annotate ``FixtureRequest.param`` as ``Any`` as a stop gap measure until :issue:`8073` is fixed. diff --git a/changelog/9791.bugfix.rst b/changelog/9791.bugfix.rst deleted file mode 100644 index f81c870165b..00000000000 --- a/changelog/9791.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed a path handling code in ``rewrite.py`` that seems to work fine, but was incorrect and fails in some systems. diff --git a/changelog/9917.bugfix.rst b/changelog/9917.bugfix.rst deleted file mode 100644 index ac0616d2ee7..00000000000 --- a/changelog/9917.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed string representation for :func:`pytest.approx` when used to compare tuples. diff --git a/changelog/9937.doc.rst b/changelog/9937.doc.rst deleted file mode 100644 index 326d20ec8f6..00000000000 --- a/changelog/9937.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Explicit note that :fixture:`tmpdir` fixture is discouraged in favour of :fixture:`tmp_path`. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index bcc0b45664b..142425cdee7 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-7.1.3 release-7.1.2 release-7.1.1 release-7.1.0 diff --git a/doc/en/announce/release-7.1.3.rst b/doc/en/announce/release-7.1.3.rst new file mode 100644 index 00000000000..4cb1b271704 --- /dev/null +++ b/doc/en/announce/release-7.1.3.rst @@ -0,0 +1,28 @@ +pytest-7.1.3 +======================================= + +pytest 7.1.3 has just been released to PyPI. + +This is a bug-fix release, being a drop-in replacement. To upgrade:: + + pip install --upgrade pytest + +The full changelog is available at https://docs.pytest.org/en/stable/changelog.html. + +Thanks to all of the contributors to this release: + +* Anthony Sottile +* Bruno Oliveira +* Gergely Kalmár +* Nipunn Koorapati +* Pax +* Sviatoslav Sydorenko +* Tim Hoffmann +* Tony Narlock +* Wolfremium +* Zach OBrien +* aizpurua23a + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index 77ae5a13028..7e22002245d 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -40,32 +40,86 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``text`` objects. - capsysbinary -- .../_pytest/capture.py:895 + Returns an instance of :class:`CaptureFixture[str] `. + + Example: + + .. code-block:: python + + def test_output(capsys): + print("hello") + captured = capsys.readouterr() + assert captured.out == "hello\n" + + capsysbinary -- .../_pytest/capture.py:906 Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``. The captured output is made available via ``capsysbinary.readouterr()`` method calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``bytes`` objects. - capfd -- .../_pytest/capture.py:912 + Returns an instance of :class:`CaptureFixture[bytes] `. + + Example: + + .. code-block:: python + + def test_output(capsysbinary): + print("hello") + captured = capsysbinary.readouterr() + assert captured.out == b"hello\n" + + capfd -- .../_pytest/capture.py:934 Enable text capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``text`` objects. - capfdbinary -- .../_pytest/capture.py:929 + Returns an instance of :class:`CaptureFixture[str] `. + + Example: + + .. code-block:: python + + def test_system_echo(capfd): + os.system('echo "hello"') + captured = capfd.readouterr() + assert captured.out == "hello\n" + + capfdbinary -- .../_pytest/capture.py:962 Enable bytes capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method calls, which return a ``(out, err)`` namedtuple. ``out`` and ``err`` will be ``byte`` objects. - doctest_namespace [session scope] -- .../_pytest/doctest.py:731 + Returns an instance of :class:`CaptureFixture[bytes] `. + + Example: + + .. code-block:: python + + def test_system_echo(capfdbinary): + os.system('echo "hello"') + captured = capfdbinary.readouterr() + assert captured.out == b"hello\n" + + doctest_namespace [session scope] -- .../_pytest/doctest.py:735 Fixture that returns a :py:class:`dict` that will be injected into the namespace of doctests. - pytestconfig [session scope] -- .../_pytest/fixtures.py:1334 + Usually this fixture is used in conjunction with another ``autouse`` fixture: + + .. code-block:: python + + @pytest.fixture(autouse=True) + def add_np(doctest_namespace): + doctest_namespace["np"] = numpy + + For more details: :ref:`doctest_namespace`. + + pytestconfig [session scope] -- .../_pytest/fixtures.py:1344 Session-scoped fixture that returns the session's :class:`pytest.Config` object. @@ -117,10 +171,10 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a `pytest-xdist `__ plugin. See :issue:`7767` for details. - tmpdir_factory [session scope] -- .../_pytest/legacypath.py:295 + tmpdir_factory [session scope] -- .../_pytest/legacypath.py:302 Return a :class:`pytest.TempdirFactory` instance for the test session. - tmpdir -- .../_pytest/legacypath.py:302 + tmpdir -- .../_pytest/legacypath.py:309 Return a temporary directory path object which is unique to each test function invocation, created as a sub directory of the base temporary directory. @@ -132,6 +186,11 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a The returned object is a `legacy_path`_ object. + .. note:: + These days, it is preferred to use ``tmp_path``. + + :ref:`About the tmpdir and tmpdir_factory fixtures`. + .. _legacy_path: https://py.readthedocs.io/en/latest/path.html caplog -- .../_pytest/logging.py:487 @@ -148,21 +207,26 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a monkeypatch -- .../_pytest/monkeypatch.py:29 A convenient fixture for monkey-patching. - The fixture provides these methods to modify objects, dictionaries or - os.environ:: + The fixture provides these methods to modify objects, dictionaries, or + :data:`os.environ`: - monkeypatch.setattr(obj, name, value, raising=True) - monkeypatch.delattr(obj, name, raising=True) - monkeypatch.setitem(mapping, name, value) - monkeypatch.delitem(obj, name, raising=True) - monkeypatch.setenv(name, value, prepend=None) - monkeypatch.delenv(name, raising=True) - monkeypatch.syspath_prepend(path) - monkeypatch.chdir(path) + * :meth:`monkeypatch.setattr(obj, name, value, raising=True) ` + * :meth:`monkeypatch.delattr(obj, name, raising=True) ` + * :meth:`monkeypatch.setitem(mapping, name, value) ` + * :meth:`monkeypatch.delitem(obj, name, raising=True) ` + * :meth:`monkeypatch.setenv(name, value, prepend=None) ` + * :meth:`monkeypatch.delenv(name, raising=True) ` + * :meth:`monkeypatch.syspath_prepend(path) ` + * :meth:`monkeypatch.chdir(path) ` + * :meth:`monkeypatch.context() ` All modifications will be undone after the requesting test function or - fixture has finished. The ``raising`` parameter determines if a KeyError - or AttributeError will be raised if the set/deletion operation has no target. + fixture has finished. The ``raising`` parameter determines if a :class:`KeyError` + or :class:`AttributeError` will be raised if the set/deletion operation does not have the + specified target. + + To undo modifications done by the fixture in a contained scope, + use :meth:`context() `. recwarn -- .../_pytest/recwarn.py:29 Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions. diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 01c6d6983a2..e60b08c555e 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -28,6 +28,47 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 7.1.3 (2022-08-31) +========================= + +Bug Fixes +--------- + +- `#10060 `_: When running with ``--pdb``, ``TestCase.tearDown`` is no longer called for tests when the *class* has been skipped via ``unittest.skip`` or ``pytest.mark.skip``. + + +- `#10190 `_: Invalid XML characters in setup or teardown error messages are now properly escaped for JUnit XML reports. + + +- `#10230 `_: Ignore ``.py`` files created by ``pyproject.toml``-based editable builds introduced in `pip 21.3 `__. + + +- `#3396 `_: Doctests now respect the ``--import-mode`` flag. + + +- `#9514 `_: Type-annotate ``FixtureRequest.param`` as ``Any`` as a stop gap measure until :issue:`8073` is fixed. + + +- `#9791 `_: Fixed a path handling code in ``rewrite.py`` that seems to work fine, but was incorrect and fails in some systems. + + +- `#9917 `_: Fixed string representation for :func:`pytest.approx` when used to compare tuples. + + + +Improved Documentation +---------------------- + +- `#9937 `_: Explicit note that :fixture:`tmpdir` fixture is discouraged in favour of :fixture:`tmp_path`. + + + +Trivial/Internal Changes +------------------------ + +- `#10114 `_: Replace `atomicwrites `__ dependency on windows with `os.replace`. + + pytest 7.1.2 (2022-04-23) ========================= diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index f7e03cc8b67..ce8ce815260 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -22,7 +22,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 7.1.2 + pytest 7.1.3 .. _`simpletest`: diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index c63a1c3c5b1..3acf39d0fa0 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -735,8 +735,8 @@ does offer some nuances for when you're in a pinch. .. code-block:: pytest $ pytest -q test_emaillib.py - . [100%] - 1 passed in 0.12s + . [100%] + 1 passed in 0.12s Note on finalizer order """""""""""""""""""""""" @@ -772,6 +772,7 @@ For yield fixtures, the first teardown code to run is from the right-most fixtur $ pytest -s test_finalizers.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y + rootdir: /home/sweet/project collected 1 item test_finalizers.py test_bar @@ -779,6 +780,7 @@ For yield fixtures, the first teardown code to run is from the right-most fixtur after_yield_1 + ============================ 1 passed in 0.12s ============================= For finalizers, the first fixture to run is last call to `request.addfinalizer`. @@ -804,12 +806,16 @@ For finalizers, the first fixture to run is last call to `request.addfinalizer`. $ pytest -s test_finalizers.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y + rootdir: /home/sweet/project collected 1 item test_finalizers.py test_bar .finalizer_1 finalizer_2 + + ============================ 1 passed in 0.12s ============================= + This is so because yield fixtures use `addfinalizer` behind the scenes: when the fixture executes, `addfinalizer` registers a function that resumes the generator, which in turn calls the teardown code. @@ -1411,7 +1417,7 @@ Running the above tests results in the following test IDs being used: =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y rootdir: /home/sweet/project - collected 11 items + collected 12 items @@ -1431,7 +1437,7 @@ Running the above tests results in the following test IDs being used: - ======================= 11 tests collected in 0.12s ======================== + ======================= 12 tests collected in 0.12s ======================== .. _`fixture-parametrize-marks`: From 50f390f015fce3ad2622b81e323f3c6f14ca872f Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 4 Sep 2022 00:23:26 +0000 Subject: [PATCH 342/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 116 ++++++++++++++++++++----------- 1 file changed, 74 insertions(+), 42 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 9eafdfe7665..33a80b3a8bd 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1110 plugins. +This list contains 1114 plugins. .. only:: not latex @@ -56,6 +56,7 @@ This list contains 1110 plugins. :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Nov 23, 2021 N/A pytest ; extra == 'test' :pypi:`pytest-aoreporter` pytest report Jun 27, 2022 N/A N/A :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 12, 2022 N/A pytest (>=7.1.1,<8.0.0) + :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A :pypi:`pytest-appengine` AppEngine integration that works well with pytest-django Feb 27, 2017 N/A N/A :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A @@ -173,6 +174,7 @@ This list contains 1110 plugins. :pypi:`pytest-clld` Jul 06, 2022 N/A pytest (>=3.6) :pypi:`pytest-cloud` Distributed tests planner plugin for pytest testing framework. Oct 05, 2020 6 - Mature N/A :pypi:`pytest-cloudflare-worker` pytest plugin for testing cloudflare workers Mar 30, 2021 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-cloudist` Distribute tests to cloud machines without fuss Sep 02, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) :pypi:`pytest-codecarbon` Pytest plugin for measuring carbon emissions Jun 15, 2022 N/A pytest :pypi:`pytest-codecheckers` pytest plugin to add source code sanity checks (pep8 and friends) Feb 13, 2010 N/A N/A @@ -210,7 +212,7 @@ This list contains 1110 plugins. :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest :pypi:`pytest-crontab` add crontab task in crontab Dec 09, 2019 N/A N/A :pypi:`pytest-csv` CSV output for pytest. Apr 22, 2021 N/A pytest (>=6.0) - :pypi:`pytest-csv-params` Pytest plugin for Test Case Parametrization with CSV files Aug 25, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-csv-params` Pytest plugin for Test Case Parametrization with CSV files Aug 28, 2022 5 - Production/Stable pytest (>=7.1.2,<8.0.0) :pypi:`pytest-curio` Pytest support for curio. Oct 07, 2020 N/A N/A :pypi:`pytest-curl-report` pytest plugin to generate curl command line report Dec 11, 2016 4 - Beta N/A :pypi:`pytest-custom-concurrency` Custom grouping concurrence for pytest Feb 08, 2021 N/A N/A @@ -328,7 +330,7 @@ This list contains 1110 plugins. :pypi:`pytest-echo` pytest plugin with mechanisms for echoing environment variables, package version and generic attributes Jan 08, 2020 5 - Production/Stable N/A :pypi:`pytest-elasticsearch` Elasticsearch fixtures and fixture factories for Pytest. Mar 01, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-elements` Tool to help automate user interfaces Jan 13, 2021 N/A pytest (>=5.4,<6.0) - :pypi:`pytest-eliot` An eliot plugin for pytest. Apr 05, 2022 1 - Planning pytest (>=5.4.0) + :pypi:`pytest-eliot` An eliot plugin for pytest. Aug 31, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest :pypi:`pytest-embedded` pytest embedded plugin Aug 23, 2022 N/A pytest (>=7.0) @@ -464,7 +466,7 @@ This list contains 1110 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Aug 26, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Sep 03, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -476,6 +478,7 @@ This list contains 1110 plugins. :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Mar 04, 2022 5 - Production/Stable N/A :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A + :pypi:`pytest-html-report-merger` Aug 31, 2022 N/A N/A :pypi:`pytest-html-thread` pytest plugin for generating HTML reports Dec 29, 2020 5 - Production/Stable N/A :pypi:`pytest-http` Fixture "http" for http requests Dec 05, 2019 N/A N/A :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Mar 16, 2022 5 - Production/Stable pytest ; extra == 'test' @@ -490,7 +493,7 @@ This list contains 1110 plugins. :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Aug 05, 2022 4 - Beta N/A :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Aug 09, 2022 4 - Beta N/A :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A - :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Jun 29, 2022 5 - Production/Stable N/A + :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Aug 31, 2022 5 - Production/Stable N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jul 25, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A :pypi:`pytest-image-diff` Jun 08, 2022 3 - Alpha pytest @@ -561,7 +564,7 @@ This list contains 1110 plugins. :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) :pypi:`pytest-live` Live results for pytest Mar 08, 2020 N/A pytest :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Aug 25, 2021 5 - Production/Stable pytest - :pypi:`pytest-localserver` py.test plugin to test server connections locally. May 05, 2022 4 - Beta N/A + :pypi:`pytest-localserver` pytest plugin to test server connections locally. Aug 30, 2022 4 - Beta N/A :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Aug 22, 2019 4 - Beta pytest (>=3.3.0) :pypi:`pytest-lockable` lockable resource plugin for pytest Jul 20, 2022 5 - Production/Stable pytest :pypi:`pytest-locker` Used to lock object during testing. Essentially changing assertions from being hard coded to asserting that nothing changed Oct 29, 2021 N/A pytest (>=5.4) @@ -578,7 +581,7 @@ This list contains 1110 plugins. :pypi:`pytest-manual-marker` pytest marker for marking manual tests Aug 04, 2022 3 - Alpha N/A :pypi:`pytest-markdoctest` A pytest plugin to doctest your markdown files Jul 22, 2022 4 - Beta pytest (>=6) :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) - :pypi:`pytest-markdown-docs` Run markdown code fences through pytest May 12, 2022 N/A N/A + :pypi:`pytest-markdown-docs` Run markdown code fences through pytest Sep 02, 2022 N/A N/A :pypi:`pytest-marker-bugzilla` py.test bugzilla integration plugin, using markers Jan 09, 2020 N/A N/A :pypi:`pytest-markers-presence` A simple plugin to detect missed pytest tags and markers" Feb 04, 2021 4 - Beta pytest (>=6.0) :pypi:`pytest-markfiltration` UNKNOWN Nov 08, 2011 3 - Alpha N/A @@ -629,7 +632,7 @@ This list contains 1110 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 23, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Aug 26, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Aug 30, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jul 12, 2022 N/A pytest :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A @@ -748,7 +751,7 @@ This list contains 1110 plugins. :pypi:`pytest-profiling` Profiling plugin for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-progress` pytest plugin for instant test progress status Jan 31, 2022 5 - Production/Stable N/A :pypi:`pytest-prometheus` Report test pass / failures to a Prometheus PushGateway Oct 03, 2017 N/A N/A - :pypi:`pytest-prometheus-pushgateway` Pytest report plugin for Zulip May 05, 2022 5 - Production/Stable pytest + :pypi:`pytest-prometheus-pushgateway` Pytest report plugin for Zulip Sep 01, 2022 5 - Production/Stable pytest :pypi:`pytest-prosper` Test helpers for Prosper projects Sep 24, 2018 N/A N/A :pypi:`pytest-pspec` A rspec format reporter for Python ptest Jun 02, 2020 4 - Beta pytest (>=3.0.0) :pypi:`pytest-psqlgraph` pytest plugin for testing applications that use psqlgraph Oct 19, 2021 4 - Beta pytest (>=6.0) @@ -760,7 +763,8 @@ This list contains 1110 plugins. :pypi:`pytest-pydev` py.test plugin to connect to a remote debug server with PyDev or PyCharm. Nov 15, 2017 3 - Alpha N/A :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Mar 13, 2022 3 - Alpha N/A :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) - :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Aug 10, 2022 N/A pytest + :pypi:`pytest-pymysql-autorecord` Record PyMySQL queries and mock with the stored data. Sep 02, 2022 N/A N/A + :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Sep 02, 2022 N/A pytest :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) @@ -793,7 +797,7 @@ This list contains 1110 plugins. :pypi:`pytest-randomness` Pytest plugin about random seed management May 30, 2019 3 - Alpha N/A :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-readme` Test your README.md file Dec 28, 2014 5 - Production/Stable N/A + :pypi:`pytest-readme` Test your README.md file Sep 02, 2022 5 - Production/Stable N/A :pypi:`pytest-reana` Pytest fixtures for REANA. May 16, 2022 3 - Alpha N/A :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jun 20, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A @@ -869,13 +873,13 @@ This list contains 1110 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Aug 27, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Sep 02, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Aug 27, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Sep 02, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -936,7 +940,7 @@ This list contains 1110 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Aug 23, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Aug 31, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A @@ -978,8 +982,8 @@ This list contains 1110 plugins. :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-terra-fixt` Terraform fixtures for pytest Jun 18, 2022 N/A pytest (==6.2.5) - :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Jan 17, 2022 N/A pytest (>=6.0) + :pypi:`pytest-terra-fixt` Terraform and Terragrunt fixtures for pytest Sep 02, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Sep 01, 2022 N/A pytest (>=6.0) :pypi:`pytest-terraform-fixture` generate terraform resources to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-testbook` A plugin to run tests written in Jupyter notebook Dec 11, 2016 3 - Alpha N/A :pypi:`pytest-testconfig` Test configuration plugin for pytest. Jan 11, 2020 4 - Beta pytest (>=3.5.0) @@ -996,7 +1000,7 @@ This list contains 1110 plugins. :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) :pypi:`pytest-testrail2` A small example package Nov 17, 2020 N/A pytest (>=5) - :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Aug 19, 2022 N/A pytest (>=5.5) + :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Aug 29, 2022 N/A pytest (>=5.5) :pypi:`pytest-testrail-api-client` TestRail Api Python Client Dec 14, 2021 N/A pytest :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A @@ -1028,7 +1032,7 @@ This list contains 1110 plugins. :pypi:`pytest-tm4j-reporter` Cloud Jira Test Management (TM4J) PyTest reporter plugin Sep 01, 2020 N/A pytest :pypi:`pytest-tmnet` A small example package Mar 01, 2022 N/A N/A :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest - :pypi:`pytest-tmpfs` A pytest plugin that helps you on using a temporary filesystem for testing. Aug 26, 2022 N/A pytest + :pypi:`pytest-tmpfs` A pytest plugin that helps you on using a temporary filesystem for testing. Aug 29, 2022 N/A pytest :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Aug 12, 2022 N/A N/A :pypi:`pytest-todo` A small plugin for the pytest testing framework, marking TODO comments as failure May 23, 2019 4 - Beta pytest :pypi:`pytest-tomato` Mar 01, 2019 5 - Production/Stable N/A @@ -1087,7 +1091,7 @@ This list contains 1110 plugins. :pypi:`pytest-vw` pytest-vw makes your failing test cases succeed under CI tools scrutiny Oct 07, 2015 4 - Beta N/A :pypi:`pytest-vyper` Plugin for the vyper smart contract language. May 28, 2020 2 - Pre-Alpha N/A :pypi:`pytest-wa-e2e-plugin` Pytest plugin for testing whatsapp bots with end to end tests Feb 18, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-wake` Jul 22, 2022 N/A pytest + :pypi:`pytest-wake` Aug 30, 2022 N/A pytest :pypi:`pytest-watch` Local continuous test runner with pytest and watchdog. May 20, 2018 N/A N/A :pypi:`pytest-watcher` Continiously runs pytest on changes in \*.py files Dec 30, 2021 3 - Alpha N/A :pypi:`pytest-wdl` Pytest plugin for testing WDL workflows. Nov 17, 2020 5 - Production/Stable N/A @@ -1109,7 +1113,7 @@ This list contains 1110 plugins. :pypi:`pytest-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Aug 04, 2022 N/A N/A :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest - :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. May 24, 2022 4 - Beta pytest (>=2.8) + :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Aug 29, 2022 4 - Beta pytest (>=2.8) :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) @@ -1399,6 +1403,13 @@ This list contains 1110 plugins. An ASGI middleware to populate OpenAPI Specification examples from pytest functions + :pypi:`pytest-api-soup` + *last release*: Aug 27, 2022, + *status*: N/A, + *requires*: N/A + + Validate multiple endpoints with unit testing using a single source of truth. + :pypi:`pytest-apistellar` *last release*: Jun 18, 2019, *status*: N/A, @@ -2218,6 +2229,13 @@ This list contains 1110 plugins. pytest plugin for testing cloudflare workers + :pypi:`pytest-cloudist` + *last release*: Sep 02, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=7.1.2,<8.0.0) + + Distribute tests to cloud machines without fuss + :pypi:`pytest-cobra` *last release*: Jun 29, 2019, *status*: 3 - Alpha, @@ -2478,8 +2496,8 @@ This list contains 1110 plugins. CSV output for pytest. :pypi:`pytest-csv-params` - *last release*: Aug 25, 2022, - *status*: 4 - Beta, + *last release*: Aug 28, 2022, + *status*: 5 - Production/Stable, *requires*: pytest (>=7.1.2,<8.0.0) Pytest plugin for Test Case Parametrization with CSV files @@ -3304,7 +3322,7 @@ This list contains 1110 plugins. Tool to help automate user interfaces :pypi:`pytest-eliot` - *last release*: Apr 05, 2022, + *last release*: Aug 31, 2022, *status*: 1 - Planning, *requires*: pytest (>=5.4.0) @@ -4256,7 +4274,7 @@ This list contains 1110 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Aug 26, 2022, + *last release*: Sep 03, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -4339,6 +4357,13 @@ This list contains 1110 plugins. Generates a static html report based on pytest framework + :pypi:`pytest-html-report-merger` + *last release*: Aug 31, 2022, + *status*: N/A, + *requires*: N/A + + + :pypi:`pytest-html-thread` *last release*: Dec 29, 2020, *status*: 5 - Production/Stable, @@ -4438,7 +4463,7 @@ This list contains 1110 plugins. A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api :pypi:`pytest-idem` - *last release*: Jun 29, 2022, + *last release*: Aug 31, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4935,11 +4960,11 @@ This list contains 1110 plugins. A PyTest plugin which provides an FTP fixture for your tests :pypi:`pytest-localserver` - *last release*: May 05, 2022, + *last release*: Aug 30, 2022, *status*: 4 - Beta, *requires*: N/A - py.test plugin to test server connections locally. + pytest plugin to test server connections locally. :pypi:`pytest-localstack` *last release*: Aug 22, 2019, @@ -5054,7 +5079,7 @@ This list contains 1110 plugins. Test your markdown docs with pytest :pypi:`pytest-markdown-docs` - *last release*: May 12, 2022, + *last release*: Sep 02, 2022, *status*: N/A, *requires*: N/A @@ -5411,7 +5436,7 @@ This list contains 1110 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Aug 26, 2022, + *last release*: Aug 30, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -6244,7 +6269,7 @@ This list contains 1110 plugins. Report test pass / failures to a Prometheus PushGateway :pypi:`pytest-prometheus-pushgateway` - *last release*: May 05, 2022, + *last release*: Sep 01, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6327,8 +6352,15 @@ This list contains 1110 plugins. pytest plugin to check source code with pylint + :pypi:`pytest-pymysql-autorecord` + *last release*: Sep 02, 2022, + *status*: N/A, + *requires*: N/A + + Record PyMySQL queries and mock with the stored data. + :pypi:`pytest-pyodide` - *last release*: Aug 10, 2022, + *last release*: Sep 02, 2022, *status*: N/A, *requires*: pytest @@ -6559,7 +6591,7 @@ This list contains 1110 plugins. Randomise the order in which pytest tests are run with some control over the randomness :pypi:`pytest-readme` - *last release*: Dec 28, 2014, + *last release*: Sep 02, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7091,7 +7123,7 @@ This list contains 1110 plugins. :pypi:`pytest-sbase` - *last release*: Aug 27, 2022, + *last release*: Sep 02, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7133,7 +7165,7 @@ This list contains 1110 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Aug 27, 2022, + *last release*: Sep 02, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7560,7 +7592,7 @@ This list contains 1110 plugins. :pypi:`pytest-splunk-addon` - *last release*: Aug 23, 2022, + *last release*: Aug 31, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7854,14 +7886,14 @@ This list contains 1110 plugins. Predictable and repeatable tempdir support. :pypi:`pytest-terra-fixt` - *last release*: Jun 18, 2022, + *last release*: Sep 02, 2022, *status*: N/A, *requires*: pytest (==6.2.5) - Terraform fixtures for pytest + Terraform and Terragrunt fixtures for pytest :pypi:`pytest-terraform` - *last release*: Jan 17, 2022, + *last release*: Sep 01, 2022, *status*: N/A, *requires*: pytest (>=6.0) @@ -7980,7 +8012,7 @@ This list contains 1110 plugins. A small example package :pypi:`pytest-testrail-api` - *last release*: Aug 19, 2022, + *last release*: Aug 29, 2022, *status*: N/A, *requires*: pytest (>=5.5) @@ -8204,7 +8236,7 @@ This list contains 1110 plugins. Utilities to create temporary file hierarchies in pytest. :pypi:`pytest-tmpfs` - *last release*: Aug 26, 2022, + *last release*: Aug 29, 2022, *status*: N/A, *requires*: pytest @@ -8617,7 +8649,7 @@ This list contains 1110 plugins. Pytest plugin for testing whatsapp bots with end to end tests :pypi:`pytest-wake` - *last release*: Jul 22, 2022, + *last release*: Aug 30, 2022, *status*: N/A, *requires*: pytest @@ -8771,7 +8803,7 @@ This list contains 1110 plugins. An extended parametrizing plugin of pytest. :pypi:`pytest-xprocess` - *last release*: May 24, 2022, + *last release*: Aug 29, 2022, *status*: 4 - Beta, *requires*: pytest (>=2.8) From 649b2e7f305259d0c64f3059b9f6c1c86be02639 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Sep 2022 13:09:31 +0000 Subject: [PATCH 343/549] build(deps): Bump django in /testing/plugins_integration Bumps [django](https://github.com/django/django) from 4.1 to 4.1.1. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/commits) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 0853db6299b..77309ef46f9 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.6.1 -django==4.1 +django==4.1.1 pytest-asyncio==0.19.0 pytest-bdd==6.0.1 pytest-cov==3.0.0 From b4ae5e4a351119d2a679bf46c8ef0356a6734342 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Sep 2022 23:33:43 +0000 Subject: [PATCH 344/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 22.6.0 → 22.8.0](https://github.com/psf/black/compare/22.6.0...22.8.0) - [github.com/myint/autoflake: v1.5.1 → v1.5.3](https://github.com/myint/autoflake/compare/v1.5.1...v1.5.3) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 68357b127ac..fe9c54ac169 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 22.6.0 + rev: 22.8.0 hooks: - id: black args: [--safe, --quiet] @@ -21,7 +21,7 @@ repos: exclude: _pytest/(debugging|hookspec).py language_version: python3 - repo: https://github.com/myint/autoflake - rev: v1.5.1 + rev: v1.5.3 hooks: - id: autoflake name: autoflake From 1e0aa16908bd0a0f7da1dfd9a8398271d75528dd Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 7 Sep 2022 14:48:49 +0200 Subject: [PATCH 345/549] Update open trainings --- doc/en/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/index.rst b/doc/en/index.rst index 870fd5a2b15..2757e6415a0 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -2,7 +2,7 @@ .. sidebar:: Next Open Trainings - - `CH Open Workshop-Tage `__ (German), September 8th 2022, Bern, Switzerland + - `enterPy `__ (German), October 28th (separate workshop day), online - `Professional Testing with Python `_, via `Python Academy `_, March 7th to 9th 2023 (3 day in-depth training), Remote and Leipzig, Germany Also see :doc:`previous talks and blogposts `. From c326bd5669fdfd21ea902e248ba5e4f3a16bd13f Mon Sep 17 00:00:00 2001 From: skhomuti Date: Thu, 8 Sep 2022 22:12:44 +0500 Subject: [PATCH 346/549] Add allure-pytest to the popular plugins list --- doc/en/how-to/plugins.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/en/how-to/plugins.rst b/doc/en/how-to/plugins.rst index 7a1948410e4..7d5bcd85a31 100644 --- a/doc/en/how-to/plugins.rst +++ b/doc/en/how-to/plugins.rst @@ -51,6 +51,9 @@ Here is a little annotated list for some popular plugins: * :pypi:`pytest-flakes`: check source code with pyflakes. +* :pypi:`allure-pytest`: + report test results via `allure-framework `_. + To see a complete list of all plugins with their latest testing status against different pytest and Python versions, please visit :ref:`plugin-list`. From f53b49c8c4218756ff6db6bee18b1abdf3fef31c Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 11 Sep 2022 00:22:18 +0000 Subject: [PATCH 347/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 116 ++++++++++++++++++++----------- 1 file changed, 74 insertions(+), 42 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 33a80b3a8bd..3dff88e5913 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1114 plugins. +This list contains 1118 plugins. .. only:: not latex @@ -39,7 +39,7 @@ This list contains 1114 plugins. :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) - :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Jun 28, 2022 N/A pytest + :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Sep 08, 2022 N/A pytest :pypi:`pytest-allure-dsl` pytest plugin to test case doc string dls instructions Oct 25, 2020 4 - Beta pytest :pypi:`pytest-allure-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) @@ -74,7 +74,7 @@ This list contains 1114 plugins. :pypi:`pytest-ast-back-to-python` A plugin for pytest devs to view how assertion rewriting recodes the AST Sep 29, 2019 4 - Beta N/A :pypi:`pytest-asteroid` PyTest plugin for docker-based testing on database images Aug 15, 2022 N/A pytest (>=6.2.5,<8.0.0) :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) - :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Mar 10, 2022 3 - Alpha pytest (>=4.6) + :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Sep 06, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio Jul 15, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jul 11, 2022 N/A N/A @@ -118,6 +118,7 @@ This list contains 1114 plugins. :pypi:`pytest-blink1` Pytest plugin to emit notifications via the Blink(1) RGB LED Jan 07, 2018 4 - Beta N/A :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A + :pypi:`pytest-blue` A pytest plugin that adds a \`blue\` fixture for printing stuff in blue. Sep 05, 2022 N/A N/A :pypi:`pytest-board` Local continuous test runner with pytest and watchdog. Jan 20, 2019 N/A N/A :pypi:`pytest-bootstrap` Mar 04, 2022 N/A N/A :pypi:`pytest-bpdb` A py.test plug-in to enable drop to bpdb debugger on test failure. Jan 19, 2015 2 - Pre-Alpha N/A @@ -205,7 +206,7 @@ This list contains 1114 plugins. :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Aug 22, 2022 5 - Production/Stable pytest (>=7.0) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Aug 17, 2022 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Sep 10, 2022 N/A N/A :pypi:`pytest-cqase` Custom qase pytest plugin Aug 22, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) @@ -236,6 +237,7 @@ This list contains 1114 plugins. :pypi:`pytest-data-from-files` pytest plugin to provide data from files loaded automatically Oct 13, 2021 4 - Beta pytest :pypi:`pytest-dataplugin` A pytest plugin for managing an archive of test data. Sep 16, 2017 1 - Planning N/A :pypi:`pytest-datarecorder` A py.test plugin recording and comparing test output. Apr 20, 2020 5 - Production/Stable pytest + :pypi:`pytest-dataset` Plugin for loading different datasets for pytest by prefix from json or yaml files Sep 05, 2022 5 - Production/Stable N/A :pypi:`pytest-data-suites` Class-based pytest parametrization Jul 24, 2022 N/A pytest (>=6.0,<8.0) :pypi:`pytest-datatest` A pytest plugin for test driven data-wrangling (this is the development version of datatest's pytest integration). Oct 15, 2020 4 - Beta pytest (>=3.3) :pypi:`pytest-db` Session scope fixture "db" for mysql query or change Dec 04, 2019 N/A N/A @@ -255,6 +257,7 @@ This list contains 1114 plugins. :pypi:`pytest-describe` Describe-style plugin for pytest Nov 13, 2021 4 - Beta pytest (>=4.0.0) :pypi:`pytest-describe-it` plugin for rich text descriptions Jul 19, 2019 4 - Beta pytest :pypi:`pytest-devpi-server` DevPI server fixture for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-dhos` Common fixtures for pytest in DHOS services and libraries Sep 07, 2022 N/A N/A :pypi:`pytest-diamond` pytest plugin for diamond Aug 31, 2015 4 - Beta N/A :pypi:`pytest-dicom` pytest plugin to provide DICOM fixtures Dec 19, 2018 3 - Alpha pytest :pypi:`pytest-dictsdiff` Jul 26, 2019 N/A N/A @@ -466,7 +469,7 @@ This list contains 1114 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Sep 03, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Sep 09, 2022 3 - Alpha pytest (==7.1.2) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -493,7 +496,7 @@ This list contains 1114 plugins. :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Aug 05, 2022 4 - Beta N/A :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Aug 09, 2022 4 - Beta N/A :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A - :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Aug 31, 2022 5 - Production/Stable N/A + :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Sep 07, 2022 5 - Production/Stable N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jul 25, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A :pypi:`pytest-image-diff` Jun 08, 2022 3 - Alpha pytest @@ -503,9 +506,9 @@ This list contains 1114 plugins. :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A - :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. May 18, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Sep 07, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Aug 10, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jul 14, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Sep 07, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Jun 16, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) @@ -537,7 +540,7 @@ This list contains 1114 plugins. :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 24, 2021 N/A pytest :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest :pypi:`pytest-kexi` Apr 29, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Aug 11, 2022 5 - Production/Stable N/A + :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Sep 08, 2022 5 - Production/Stable N/A :pypi:`pytest-kivy` Kivy GUI tests fixtures using pytest Jul 06, 2021 4 - Beta pytest (>=3.6) :pypi:`pytest-knows` A pytest plugin that can automaticly skip test case based on dependence info calculated by trace Aug 22, 2014 N/A N/A :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A @@ -632,7 +635,7 @@ This list contains 1114 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 23, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Aug 30, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Sep 04, 2022 4 - Beta pytest (>=6) :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jul 12, 2022 N/A pytest :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A @@ -676,7 +679,7 @@ This list contains 1114 plugins. :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jun 14, 2022 5 - Production/Stable pytest (<7.1); python_version <= "3.6" :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) - :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry May 03, 2022 N/A pytest + :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry Sep 07, 2022 N/A pytest :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Jun 02, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-operator` Fixtures for Operators Aug 17, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A @@ -762,9 +765,9 @@ This list contains 1114 plugins. :pypi:`pytest-pycodestyle` pytest plugin to run pycodestyle Mar 13, 2022 3 - Alpha N/A :pypi:`pytest-pydev` py.test plugin to connect to a remote debug server with PyDev or PyCharm. Nov 15, 2017 3 - Alpha N/A :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Mar 13, 2022 3 - Alpha N/A - :pypi:`pytest-pylint` pytest plugin to check source code with pylint Nov 09, 2020 5 - Production/Stable pytest (>=5.4) + :pypi:`pytest-pylint` pytest plugin to check source code with pylint Sep 10, 2022 5 - Production/Stable pytest (>=5.4) :pypi:`pytest-pymysql-autorecord` Record PyMySQL queries and mock with the stored data. Sep 02, 2022 N/A N/A - :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Sep 02, 2022 N/A pytest + :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Sep 08, 2022 N/A pytest :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) @@ -873,13 +876,13 @@ This list contains 1114 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Sep 02, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Sep 09, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Sep 02, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Sep 09, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -932,15 +935,15 @@ This list contains 1114 plugins. :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. May 04, 2021 N/A N/A :pypi:`pytest-spec2md` Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. Jun 26, 2022 N/A pytest (>7.0) :pypi:`pytest-speed` Modern benchmarking library for python with pytest integration. Jul 06, 2022 3 - Alpha pytest (>=7) - :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Mar 30, 2022 4 - Beta pytest (>=7.0.0) + :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Sep 06, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A - :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Dec 25, 2020 6 - Mature N/A + :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Sep 09, 2022 6 - Mature pytest (>=3.0.0) :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Jun 11, 2022 6 - Mature pytest (<8.0,>=7.1.2) :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Apr 22, 2022 4 - Beta pytest (>=5,<8) :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Aug 31, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Sep 08, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A @@ -955,6 +958,7 @@ This list contains 1114 plugins. :pypi:`pytest-stepfunctions` A small description May 08, 2021 4 - Beta pytest :pypi:`pytest-steps` Create step-wise / incremental tests in pytest. Sep 23, 2021 5 - Production/Stable N/A :pypi:`pytest-stepwise` Run a test suite one failing test at a time. Dec 01, 2015 4 - Beta N/A + :pypi:`pytest-stf` pytest plugin for openSTF Sep 09, 2022 N/A pytest (>=5.0) :pypi:`pytest-stoq` A plugin to pytest stoq Feb 09, 2021 4 - Beta N/A :pypi:`pytest-stress` A Pytest plugin that allows you to loop tests for a user defined amount of time. Dec 07, 2019 4 - Beta pytest (>=3.6.0) :pypi:`pytest-structlog` Structured logging assertions Sep 21, 2021 N/A pytest @@ -982,7 +986,7 @@ This list contains 1114 plugins. :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-terra-fixt` Terraform and Terragrunt fixtures for pytest Sep 02, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-terra-fixt` Terraform and Terragrunt fixtures for pytest Sep 09, 2022 N/A pytest (==6.2.5) :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Sep 01, 2022 N/A pytest (>=6.0) :pypi:`pytest-terraform-fixture` generate terraform resources to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-testbook` A plugin to run tests written in Jupyter notebook Dec 11, 2016 3 - Alpha N/A @@ -993,7 +997,7 @@ This list contains 1114 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Jun 19, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Aug 27, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Sep 09, 2022 4 - Beta N/A :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) :pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Jun 13, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) @@ -1055,7 +1059,7 @@ This list contains 1114 plugins. :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Apr 27, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A - :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, with optional auto-launch and HTML export Aug 27, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, with optional auto-launch and HTML export Sep 07, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) @@ -1285,7 +1289,7 @@ This list contains 1114 plugins. Plugin for py.test to generate allure xml reports :pypi:`pytest-allure-collection` - *last release*: Jun 28, 2022, + *last release*: Sep 08, 2022, *status*: N/A, *requires*: pytest @@ -1530,7 +1534,7 @@ This list contains 1114 plugins. Meta-package containing dependencies for testing :pypi:`pytest-astropy-header` - *last release*: Mar 10, 2022, + *last release*: Sep 06, 2022, *status*: 3 - Alpha, *requires*: pytest (>=4.6) @@ -1837,6 +1841,13 @@ This list contains 1114 plugins. pytest plugin to mark a test as blocker and skip all other tests + :pypi:`pytest-blue` + *last release*: Sep 05, 2022, + *status*: N/A, + *requires*: N/A + + A pytest plugin that adds a \`blue\` fixture for printing stuff in blue. + :pypi:`pytest-board` *last release*: Jan 20, 2019, *status*: N/A, @@ -2447,7 +2458,7 @@ This list contains 1114 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Aug 17, 2022, + *last release*: Sep 10, 2022, *status*: N/A, *requires*: N/A @@ -2663,6 +2674,13 @@ This list contains 1114 plugins. A py.test plugin recording and comparing test output. + :pypi:`pytest-dataset` + *last release*: Sep 05, 2022, + *status*: 5 - Production/Stable, + *requires*: N/A + + Plugin for loading different datasets for pytest by prefix from json or yaml files + :pypi:`pytest-data-suites` *last release*: Jul 24, 2022, *status*: N/A, @@ -2796,6 +2814,13 @@ This list contains 1114 plugins. DevPI server fixture for py.test + :pypi:`pytest-dhos` + *last release*: Sep 07, 2022, + *status*: N/A, + *requires*: N/A + + Common fixtures for pytest in DHOS services and libraries + :pypi:`pytest-diamond` *last release*: Aug 31, 2015, *status*: 4 - Beta, @@ -4274,7 +4299,7 @@ This list contains 1114 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Sep 03, 2022, + *last release*: Sep 09, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.2) @@ -4463,7 +4488,7 @@ This list contains 1114 plugins. A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api :pypi:`pytest-idem` - *last release*: Aug 31, 2022, + *last release*: Sep 07, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4533,7 +4558,7 @@ This list contains 1114 plugins. Reuse pytest.ini to store env variables :pypi:`pytest-inmanta` - *last release*: May 18, 2022, + *last release*: Sep 07, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4547,7 +4572,7 @@ This list contains 1114 plugins. Inmanta tests package :pypi:`pytest-inmanta-lsm` - *last release*: Jul 14, 2022, + *last release*: Sep 07, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4771,7 +4796,7 @@ This list contains 1114 plugins. :pypi:`pytest-kind` - *last release*: Aug 11, 2022, + *last release*: Sep 08, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -5436,7 +5461,7 @@ This list contains 1114 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Aug 30, 2022, + *last release*: Sep 04, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -5744,7 +5769,7 @@ This list contains 1114 plugins. Pytest plugin for detecting inadvertent open file handles :pypi:`pytest-opentelemetry` - *last release*: May 03, 2022, + *last release*: Sep 07, 2022, *status*: N/A, *requires*: pytest @@ -6346,7 +6371,7 @@ This list contains 1114 plugins. pytest plugin to run pydocstyle :pypi:`pytest-pylint` - *last release*: Nov 09, 2020, + *last release*: Sep 10, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.4) @@ -6360,7 +6385,7 @@ This list contains 1114 plugins. Record PyMySQL queries and mock with the stored data. :pypi:`pytest-pyodide` - *last release*: Sep 02, 2022, + *last release*: Sep 08, 2022, *status*: N/A, *requires*: pytest @@ -7123,7 +7148,7 @@ This list contains 1114 plugins. :pypi:`pytest-sbase` - *last release*: Sep 02, 2022, + *last release*: Sep 09, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7165,7 +7190,7 @@ This list contains 1114 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Sep 02, 2022, + *last release*: Sep 09, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7536,7 +7561,7 @@ This list contains 1114 plugins. Modern benchmarking library for python with pytest integration. :pypi:`pytest-sphinx` - *last release*: Mar 30, 2022, + *last release*: Sep 06, 2022, *status*: 4 - Beta, *requires*: pytest (>=7.0.0) @@ -7550,9 +7575,9 @@ This list contains 1114 plugins. Exports unit tests as test runs in SpiraTest/Team/Plan :pypi:`pytest-splinter` - *last release*: Dec 25, 2020, + *last release*: Sep 09, 2022, *status*: 6 - Mature, - *requires*: N/A + *requires*: pytest (>=3.0.0) Splinter plugin for pytest testing framework @@ -7592,7 +7617,7 @@ This list contains 1114 plugins. :pypi:`pytest-splunk-addon` - *last release*: Aug 31, 2022, + *last release*: Sep 08, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7696,6 +7721,13 @@ This list contains 1114 plugins. Run a test suite one failing test at a time. + :pypi:`pytest-stf` + *last release*: Sep 09, 2022, + *status*: N/A, + *requires*: pytest (>=5.0) + + pytest plugin for openSTF + :pypi:`pytest-stoq` *last release*: Feb 09, 2021, *status*: 4 - Beta, @@ -7886,7 +7918,7 @@ This list contains 1114 plugins. Predictable and repeatable tempdir support. :pypi:`pytest-terra-fixt` - *last release*: Sep 02, 2022, + *last release*: Sep 09, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -7963,7 +7995,7 @@ This list contains 1114 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Aug 27, 2022, + *last release*: Sep 09, 2022, *status*: 4 - Beta, *requires*: N/A @@ -8397,7 +8429,7 @@ This list contains 1114 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: Aug 27, 2022, + *last release*: Sep 07, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.5) From d416fbab914996b8d3b294a747b33e75be6bfe3e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 03:01:53 +0000 Subject: [PATCH 348/549] build(deps): Bump twisted in /testing/plugins_integration Bumps [twisted](https://github.com/twisted/twisted) from 22.4.0 to 22.8.0. - [Release notes](https://github.com/twisted/twisted/releases) - [Changelog](https://github.com/twisted/twisted/blob/trunk/NEWS.rst) - [Commits](https://github.com/twisted/twisted/compare/twisted-22.4.0...twisted-22.8.0) --- updated-dependencies: - dependency-name: twisted dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 77309ef46f9..7d66be96c7c 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -11,5 +11,5 @@ pytest-rerunfailures==10.2 pytest-sugar==0.9.5 pytest-trio==0.7.0 pytest-twisted==1.13.4 -twisted==22.4.0 +twisted==22.8.0 pytest-xvfb==2.0.0 From 34765f6b2e8a98b231baa33e4f356646259ab556 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Thu, 15 Sep 2022 08:07:02 -0700 Subject: [PATCH 349/549] doc: Add link for enterPy training (#10299) --- doc/en/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/index.rst b/doc/en/index.rst index 2757e6415a0..a443e081bb3 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -2,7 +2,7 @@ .. sidebar:: Next Open Trainings - - `enterPy `__ (German), October 28th (separate workshop day), online + - `Professionelles Testen für Python mit pytest `_, part of `enterPy `__ (German), October 28th (separate workshop day), online - `Professional Testing with Python `_, via `Python Academy `_, March 7th to 9th 2023 (3 day in-depth training), Remote and Leipzig, Germany Also see :doc:`previous talks and blogposts `. From 246129089c7442eca563c6d98d6b260f8a55f517 Mon Sep 17 00:00:00 2001 From: Fredrik Berndtsson Date: Thu, 15 Sep 2022 23:34:10 +0200 Subject: [PATCH 350/549] doc: Fix 404 'identify flaky test' link (#10244) --- doc/en/explanation/flaky.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/explanation/flaky.rst b/doc/en/explanation/flaky.rst index 50121c7a761..ccf3fbb2b0c 100644 --- a/doc/en/explanation/flaky.rst +++ b/doc/en/explanation/flaky.rst @@ -94,7 +94,7 @@ Mark Lapierre discusses the `Pros and Cons of Quarantined Tests `_ and rerun failed tests. +Azure Pipelines (the Azure cloud CI/CD tool, formerly Visual Studio Team Services or VSTS) has a feature to `identify flaky tests `_ and rerun failed tests. From 256ab097a274c3e4057a70849ae86aced52b4b27 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Sep 2022 23:24:54 +0000 Subject: [PATCH 351/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - https://github.com/myint/autoflake → https://github.com/PyCQA/autoflake - [github.com/PyCQA/autoflake: v1.5.3 → v1.6.0](https://github.com/PyCQA/autoflake/compare/v1.5.3...v1.6.0) - [github.com/asottile/pyupgrade: v2.37.3 → v2.38.0](https://github.com/asottile/pyupgrade/compare/v2.37.3...v2.38.0) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fe9c54ac169..a8dc8b5b610 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,8 +20,8 @@ repos: - id: debug-statements exclude: _pytest/(debugging|hookspec).py language_version: python3 -- repo: https://github.com/myint/autoflake - rev: v1.5.3 +- repo: https://github.com/PyCQA/autoflake + rev: v1.6.0 hooks: - id: autoflake name: autoflake @@ -42,7 +42,7 @@ repos: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.37.3 + rev: v2.38.0 hooks: - id: pyupgrade args: [--py37-plus] From 0fdacb6db5806dcc2c01d80e6dfe0e5fcd24034e Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sun, 3 Oct 2021 16:01:40 +0200 Subject: [PATCH 352/549] deprecate hook configuration via marks/attributes fixes #4562 --- changelog/4562.deprecation.rst | 4 +++ doc/en/deprecations.rst | 44 ++++++++++++++++++++++++ pyproject.toml | 3 ++ src/_pytest/config/__init__.py | 61 ++++++++++++++++++++++------------ src/_pytest/deprecated.py | 8 +++++ src/_pytest/warning_types.py | 19 +++++++++++ testing/deprecated_test.py | 48 ++++++++++++++++++++++++++ 7 files changed, 165 insertions(+), 22 deletions(-) create mode 100644 changelog/4562.deprecation.rst diff --git a/changelog/4562.deprecation.rst b/changelog/4562.deprecation.rst new file mode 100644 index 00000000000..d459801d4a6 --- /dev/null +++ b/changelog/4562.deprecation.rst @@ -0,0 +1,4 @@ +Deprecate configuring hook specs/impls using attributes/marks. + +Instead use :py:func:`pytest.hookimpl` and :py:func:`pytest.hookspec`. +For more details, see the :ref:`docs `. diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index 3bbd29bb509..a18d9d713b0 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -78,6 +78,50 @@ no matter what argument was used in the constructor. We expect to deprecate the .. _legacy-path-hooks-deprecated: +Configuring hook specs/impls using markers +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Before pluggy, pytest's plugin library, was its own package and had a clear API, +pytest just used ``pytest.mark`` to configure hooks. + +The :py:func:`pytest.hookimpl` and :py:func:`pytest.hookspec` decorators +have been available since years and should be used instead. + +.. code-block:: python + + @pytest.mark.tryfirst + def pytest_runtest_call(): + ... + + + # or + def pytest_runtest_call(): + ... + + + pytest_runtest_call.tryfirst = True + +should be changed to: + +.. code-block:: python + + @pytest.hookimpl(tryfirst=True) + def pytest_runtest_call(): + ... + +Changed ``hookimpl`` attributes: + +* ``tryfirst`` +* ``trylast`` +* ``optionalhook`` +* ``hookwrapper`` + +Changed ``hookwrapper`` attributes: + +* ``firstresult`` +* ``historic`` + + ``py.path.local`` arguments for hooks replaced with ``pathlib.Path`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/pyproject.toml b/pyproject.toml index a66f90017ce..fc9a119f6f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,9 @@ filterwarnings = [ # Those are caught/handled by pyupgrade, and not easy to filter with the # module being the filename (with .py removed). "default:invalid escape sequence:DeprecationWarning", + # ignore not yet fixed warnings for hook markers + "default:.*not marked using pytest.hook.*", + "ignore:.*not marked using pytest.hook.*::xdist.*", # ignore use of unregistered marks, because we use many to test the implementation "ignore::_pytest.warning_types.PytestUnknownMarkWarning", # https://github.com/benjaminp/six/issues/341 diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index d753a9054ab..e1ceb7737cd 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -14,6 +14,7 @@ from functools import lru_cache from pathlib import Path from textwrap import dedent +from types import FunctionType from types import TracebackType from typing import Any from typing import Callable @@ -58,6 +59,7 @@ from _pytest.pathlib import resolve_package_path from _pytest.stash import Stash from _pytest.warning_types import PytestConfigWarning +from _pytest.warning_types import warn_explicit_for if TYPE_CHECKING: @@ -341,6 +343,32 @@ def _get_directory(path: Path) -> Path: return path +def _get_legacy_hook_marks( + method: object, # using object to avoid function type excess + hook_type: str, + opt_names: Tuple[str, ...], +) -> Dict[str, bool]: + known_marks = {m.name for m in getattr(method, "pytestmark", [])} + must_warn = False + opts = {} + for opt_name in opt_names: + if hasattr(method, opt_name) or opt_name in known_marks: + opts[opt_name] = True + must_warn = True + else: + opts[opt_name] = False + if must_warn: + + hook_opts = ", ".join(f"{name}=True" for name, val in opts.items() if val) + message = _pytest.deprecated.HOOK_LEGACY_MARKING.format( + type=hook_type, + fullname=method.__qualname__, # type: ignore + hook_opts=hook_opts, + ) + warn_explicit_for(cast(FunctionType, method), message) + return opts + + @final class PytestPluginManager(PluginManager): """A :py:class:`pluggy.PluginManager ` with @@ -414,40 +442,29 @@ def parse_hookimpl_opts(self, plugin: _PluggyPlugin, name: str): if name == "pytest_plugins": return - method = getattr(plugin, name) opts = super().parse_hookimpl_opts(plugin, name) + if opts is not None: + return opts + method = getattr(plugin, name) # Consider only actual functions for hooks (#3775). if not inspect.isroutine(method): return - # Collect unmarked hooks as long as they have the `pytest_' prefix. - if opts is None and name.startswith("pytest_"): - opts = {} - if opts is not None: - # TODO: DeprecationWarning, people should use hookimpl - # https://github.com/pytest-dev/pytest/issues/4562 - known_marks = {m.name for m in getattr(method, "pytestmark", [])} - - for name in ("tryfirst", "trylast", "optionalhook", "hookwrapper"): - opts.setdefault(name, hasattr(method, name) or name in known_marks) - return opts + return _get_legacy_hook_marks( + method, "impl", ("tryfirst", "trylast", "optionalhook", "hookwrapper") + ) def parse_hookspec_opts(self, module_or_class, name: str): opts = super().parse_hookspec_opts(module_or_class, name) if opts is None: method = getattr(module_or_class, name) - if name.startswith("pytest_"): - # todo: deprecate hookspec hacks - # https://github.com/pytest-dev/pytest/issues/4562 - known_marks = {m.name for m in getattr(method, "pytestmark", [])} - opts = { - "firstresult": hasattr(method, "firstresult") - or "firstresult" in known_marks, - "historic": hasattr(method, "historic") - or "historic" in known_marks, - } + opts = _get_legacy_hook_marks( + method, + "spec", + ("firstresult", "historic"), + ) return opts def register( diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index f2d79760ae7..623bb02365f 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -98,6 +98,14 @@ "The pytest.Instance collector type is deprecated and is no longer used. " "See https://docs.pytest.org/en/latest/deprecations.html#the-pytest-instance-collector", ) +HOOK_LEGACY_MARKING = UnformattedWarning( + PytestDeprecationWarning, + "The hook{type} {fullname} uses old-style configuration options (marks or attributes).\n" + "Please use the pytest.hook{type}({hook_opts}) decorator instead\n" + " to configure the hooks.\n" + " See https://docs.pytest.org/en/latest/deprecations.html" + "#configuring-hook-specs-impls-using-markers", +) # You want to make some `__init__` or function "private". # diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index c32ce80ccb1..fd4b68e187c 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -1,3 +1,6 @@ +import inspect +import warnings +from types import FunctionType from typing import Any from typing import Generic from typing import Type @@ -142,3 +145,19 @@ class UnformattedWarning(Generic[_W]): def format(self, **kwargs: Any) -> _W: """Return an instance of the warning category, formatted with given kwargs.""" return self.category(self.template.format(**kwargs)) + + +def warn_explicit_for(method: FunctionType, message: PytestWarning) -> None: + lineno = method.__code__.co_firstlineno + filename = inspect.getfile(method) + module = method.__module__ + mod_globals = method.__globals__ + + warnings.warn_explicit( + message, + type(message), + filename=filename, + module=module, + registry=mod_globals.setdefault("__warningregistry__", {}), + lineno=lineno, + ) diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index db649841abe..8847695a776 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -20,6 +20,54 @@ def test_external_plugins_integrated(pytester: Pytester, plugin) -> None: pytester.parseconfig("-p", plugin) +def test_hookspec_via_function_attributes_are_deprecated(): + from _pytest.config import PytestPluginManager + + pm = PytestPluginManager() + + class DeprecatedHookMarkerSpec: + def pytest_bad_hook(self): + pass + + pytest_bad_hook.historic = True # type: ignore[attr-defined] + + with pytest.warns( + PytestDeprecationWarning, + match=r"Please use the pytest\.hookspec\(historic=True\) decorator", + ) as recorder: + pm.add_hookspecs(DeprecatedHookMarkerSpec) + (record,) = recorder + assert ( + record.lineno + == DeprecatedHookMarkerSpec.pytest_bad_hook.__code__.co_firstlineno + ) + assert record.filename == __file__ + + +def test_hookimpl_via_function_attributes_are_deprecated(): + from _pytest.config import PytestPluginManager + + pm = PytestPluginManager() + + class DeprecatedMarkImplPlugin: + def pytest_runtest_call(self): + pass + + pytest_runtest_call.tryfirst = True # type: ignore[attr-defined] + + with pytest.warns( + PytestDeprecationWarning, + match=r"Please use the pytest.hookimpl\(tryfirst=True\)", + ) as recorder: + pm.register(DeprecatedMarkImplPlugin()) + (record,) = recorder + assert ( + record.lineno + == DeprecatedMarkImplPlugin.pytest_runtest_call.__code__.co_firstlineno + ) + assert record.filename == __file__ + + def test_fscollector_gethookproxy_isinitpath(pytester: Pytester) -> None: module = pytester.getmodulecol( """ From 8c52dc5b7e566e6112185105ce897015adf6607c Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 8 Mar 2022 10:13:27 +0100 Subject: [PATCH 353/549] remove the setup.py for the py.test project which for deprecation has been deployed since 2014 --- extra/setup-py.test/setup.py | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 extra/setup-py.test/setup.py diff --git a/extra/setup-py.test/setup.py b/extra/setup-py.test/setup.py deleted file mode 100644 index 97883852e2e..00000000000 --- a/extra/setup-py.test/setup.py +++ /dev/null @@ -1,12 +0,0 @@ -import sys - -from distutils.core import setup - -if __name__ == "__main__": - if "sdist" not in sys.argv[1:]: - raise ValueError("please use 'pytest' pypi package instead of 'py.test'") - setup( - name="py.test", - version="0.0", - description="please use 'pytest' for installation", - ) From b1fb9a9c8d8b8af0fa795b4bf2bc5a58e792c390 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sun, 31 Jul 2022 17:11:34 +0200 Subject: [PATCH 354/549] handle non-true options in hookspec warning --- src/_pytest/config/__init__.py | 15 +++++++++------ testing/deprecated_test.py | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index e1ceb7737cd..2d6693808ce 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -348,18 +348,21 @@ def _get_legacy_hook_marks( hook_type: str, opt_names: Tuple[str, ...], ) -> Dict[str, bool]: - known_marks = {m.name for m in getattr(method, "pytestmark", [])} - must_warn = False - opts = {} + known_marks: set[str] = {m.name for m in getattr(method, "pytestmark", [])} + must_warn: list[str] = [] + opts: dict[str, bool] = {} for opt_name in opt_names: + opt_attr = getattr(method, opt_name, AttributeError) + if opt_attr is not AttributeError: + must_warn.append(f"{opt_name}={opt_attr}") + elif opt_name in known_marks: + must_warn.append(f"{opt_name}=True") if hasattr(method, opt_name) or opt_name in known_marks: opts[opt_name] = True - must_warn = True else: opts[opt_name] = False if must_warn: - - hook_opts = ", ".join(f"{name}=True" for name, val in opts.items() if val) + hook_opts = ", ".join(must_warn) message = _pytest.deprecated.HOOK_LEGACY_MARKING.format( type=hook_type, fullname=method.__qualname__, # type: ignore diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index 8847695a776..d468b443541 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -29,11 +29,11 @@ class DeprecatedHookMarkerSpec: def pytest_bad_hook(self): pass - pytest_bad_hook.historic = True # type: ignore[attr-defined] + pytest_bad_hook.historic = False # type: ignore[attr-defined] with pytest.warns( PytestDeprecationWarning, - match=r"Please use the pytest\.hookspec\(historic=True\) decorator", + match=r"Please use the pytest\.hookspec\(historic=False\) decorator", ) as recorder: pm.add_hookspecs(DeprecatedHookMarkerSpec) (record,) = recorder From e3294398d6912a4c3d28dadb6087c3ab8974582a Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 20 Sep 2022 15:53:53 +0200 Subject: [PATCH 355/549] simplify typing for legacy hook mark support --- src/_pytest/config/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 2d6693808ce..51d79deba4a 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -344,10 +344,13 @@ def _get_directory(path: Path) -> Path: def _get_legacy_hook_marks( - method: object, # using object to avoid function type excess + method: Any, hook_type: str, opt_names: Tuple[str, ...], ) -> Dict[str, bool]: + if TYPE_CHECKING: + # abuse typeguard from importlib to avoid massive method type union thats lacking a alias + assert inspect.isroutine(method) known_marks: set[str] = {m.name for m in getattr(method, "pytestmark", [])} must_warn: list[str] = [] opts: dict[str, bool] = {} @@ -365,7 +368,7 @@ def _get_legacy_hook_marks( hook_opts = ", ".join(must_warn) message = _pytest.deprecated.HOOK_LEGACY_MARKING.format( type=hook_type, - fullname=method.__qualname__, # type: ignore + fullname=method.__qualname__, hook_opts=hook_opts, ) warn_explicit_for(cast(FunctionType, method), message) From 7e8a4849d819e53248bb0eb2e08f4183d9c7e4d6 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 20 Sep 2022 15:55:13 +0200 Subject: [PATCH 356/549] unify option extraction for legacy hook marks --- src/_pytest/config/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 51d79deba4a..cffbb6dc45b 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -358,9 +358,9 @@ def _get_legacy_hook_marks( opt_attr = getattr(method, opt_name, AttributeError) if opt_attr is not AttributeError: must_warn.append(f"{opt_name}={opt_attr}") + opts[opt_name] = True elif opt_name in known_marks: must_warn.append(f"{opt_name}=True") - if hasattr(method, opt_name) or opt_name in known_marks: opts[opt_name] = True else: opts[opt_name] = False From ae9dbf5006286018440c0dead9b140f42c427286 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 20 Sep 2022 16:04:35 +0200 Subject: [PATCH 357/549] add docstring to warn_explicit_for --- src/_pytest/warning_types.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index fd4b68e187c..88a51399182 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -148,6 +148,12 @@ def format(self, **kwargs: Any) -> _W: def warn_explicit_for(method: FunctionType, message: PytestWarning) -> None: + """ + Issue the warning :param:`message` for the definition of the given :param:`method` + + this helps to log warnigns for functions defined prior to finding an issue with them + (like hook wrappers being marked in a legacy mechanism) + """ lineno = method.__code__.co_firstlineno filename = inspect.getfile(method) module = method.__module__ From ce3e2e922bb40acdf3109b0832e95270bed0803a Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Wed, 28 Sep 2022 22:28:03 +0200 Subject: [PATCH 358/549] bump plugin test pytest cov pin --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 7d66be96c7c..3b4b291cc4f 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -2,7 +2,7 @@ anyio[curio,trio]==3.6.1 django==4.1.1 pytest-asyncio==0.19.0 pytest-bdd==6.0.1 -pytest-cov==3.0.0 +pytest-cov==4.0.0 pytest-django==4.5.2 pytest-flakes==4.0.5 pytest-html==3.1.1 From 594413e8f05268bc0d448d37022c502af28e1244 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Date: Fri, 30 Sep 2022 23:43:27 +0100 Subject: [PATCH 359/549] Use an explicit encoding when opening `os.devnul` Although slightly pointless, this avoids an `EncodingWarning` in Python 3.10 or greater when running under the `-X warn_default_encoding` flag. --- src/_pytest/capture.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index bcfd3449f29..6131a46df47 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -381,7 +381,7 @@ def __init__(self, targetfd: int) -> None: self.targetfd_save = os.dup(targetfd) if targetfd == 0: - self.tmpfile = open(os.devnull) + self.tmpfile = open(os.devnull, encoding="utf-8") self.syscapture = SysCapture(targetfd) else: self.tmpfile = EncodedFile( From eab875509d9337dcc70af60ae9c42c761ccdc8e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 03:01:46 +0000 Subject: [PATCH 360/549] build(deps): Bump pytest-mock in /testing/plugins_integration Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.8.2 to 3.9.0. - [Release notes](https://github.com/pytest-dev/pytest-mock/releases) - [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.8.2...v3.9.0) --- updated-dependencies: - dependency-name: pytest-mock dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 3b4b291cc4f..82929c87a73 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -6,7 +6,7 @@ pytest-cov==4.0.0 pytest-django==4.5.2 pytest-flakes==4.0.5 pytest-html==3.1.1 -pytest-mock==3.8.2 +pytest-mock==3.9.0 pytest-rerunfailures==10.2 pytest-sugar==0.9.5 pytest-trio==0.7.0 From 4ee6e900a0809c8ad19bba6c705280d65be26905 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 23:32:26 +0000 Subject: [PATCH 361/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/autoflake: v1.6.0 → v1.6.1](https://github.com/PyCQA/autoflake/compare/v1.6.0...v1.6.1) - [github.com/asottile/reorder_python_imports: v3.8.2 → v3.8.3](https://github.com/asottile/reorder_python_imports/compare/v3.8.2...v3.8.3) - [github.com/asottile/pyupgrade: v2.38.0 → v2.38.2](https://github.com/asottile/pyupgrade/compare/v2.38.0...v2.38.2) - [github.com/pre-commit/mirrors-mypy: v0.971 → v0.981](https://github.com/pre-commit/mirrors-mypy/compare/v0.971...v0.981) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a8dc8b5b610..663bc64c206 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,7 +21,7 @@ repos: exclude: _pytest/(debugging|hookspec).py language_version: python3 - repo: https://github.com/PyCQA/autoflake - rev: v1.6.0 + rev: v1.6.1 hooks: - id: autoflake name: autoflake @@ -37,12 +37,12 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v3.8.2 + rev: v3.8.3 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.38.0 + rev: v2.38.2 hooks: - id: pyupgrade args: [--py37-plus] @@ -56,7 +56,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.971 + rev: v0.981 hooks: - id: mypy files: ^(src/|testing/) From 06007de7bad903018420612e6df42eb8bdfb8329 Mon Sep 17 00:00:00 2001 From: Thierry Moisan Date: Wed, 5 Oct 2022 10:24:55 -0400 Subject: [PATCH 362/549] Fix a few broken links in the documentation --- CONTRIBUTING.rst | 2 +- doc/en/changelog.rst | 4 ++-- doc/en/example/nonpython.rst | 2 +- src/_pytest/recwarn.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 262396728b8..22c3ecefb6c 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -223,7 +223,7 @@ changes you want to review and merge. Pull requests are stored on Once you send a pull request, we can discuss its potential modifications and even add more commits to it later on. There's an excellent tutorial on how Pull Requests work in the -`GitHub Help Center `_. +`GitHub Help Center `_. Here is a simple overview, with pytest-specific bits: diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index e60b08c555e..ef3a241cdb1 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -6229,7 +6229,7 @@ Bug Fixes Thanks :user:`adborden` for the report and :user:`nicoddemus` for the PR. * Clean up unittest TestCase objects after tests are complete (:issue:`1649`). - Thanks :user:`d_b_w` for the report and PR. + Thanks :user:`d-b-w` for the report and PR. 3.0.3 (2016-09-28) @@ -6244,7 +6244,7 @@ Bug Fixes Thanks :user:`nicoddemus` for the PR. * Fix pkg_resources import error in Jython projects (:issue:`1853`). - Thanks :user:`raquel-ucl` for the PR. + Thanks :user:`raquelalegre` for the PR. * Got rid of ``AttributeError: 'Module' object has no attribute '_obj'`` exception in Python 3 (:issue:`1944`). diff --git a/doc/en/example/nonpython.rst b/doc/en/example/nonpython.rst index f79f15b4f79..efb701b1f16 100644 --- a/doc/en/example/nonpython.rst +++ b/doc/en/example/nonpython.rst @@ -9,7 +9,7 @@ Working with non-python tests A basic example for specifying tests in Yaml files -------------------------------------------------------------- -.. _`pytest-yamlwsgi`: http://bitbucket.org/aafshar/pytest-yamlwsgi/src/tip/pytest_yamlwsgi.py +.. _`pytest-yamlwsgi`: https://pypi.org/project/pytest-yamlwsgi/ Here is an example ``conftest.py`` (extracted from Ali Afshar's special purpose `pytest-yamlwsgi`_ plugin). This ``conftest.py`` will collect ``test*.yaml`` files and will execute the yaml-formatted content as custom tests: diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index 06eb82d7191..edb419981ba 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -30,7 +30,7 @@ def recwarn() -> Generator["WarningsRecorder", None, None]: """Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions. - See https://docs.python.org/library/how-to/capture-warnings.html for information + See https://docs.pytest.org/en/latest/how-to/capture-warnings.html for information on warning categories. """ wrec = WarningsRecorder(_ispytest=True) From 14919c4bbbeca42a1822858ee31f928c0b2e35dd Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Thu, 6 Oct 2022 11:44:05 +0200 Subject: [PATCH 363/549] fix #10342: put location into warning exceptions as the warning systems own warn_explicit looses the information we add them explicitly to the warning exceptions --- src/_pytest/warning_types.py | 20 +++++++++++--------- testing/test_warning_types.py | 8 ++++++++ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index 88a51399182..388949bed53 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -158,12 +158,14 @@ def warn_explicit_for(method: FunctionType, message: PytestWarning) -> None: filename = inspect.getfile(method) module = method.__module__ mod_globals = method.__globals__ - - warnings.warn_explicit( - message, - type(message), - filename=filename, - module=module, - registry=mod_globals.setdefault("__warningregistry__", {}), - lineno=lineno, - ) + try: + warnings.warn_explicit( + message, + type(message), + filename=filename, + module=module, + registry=mod_globals.setdefault("__warningregistry__", {}), + lineno=lineno, + ) + except Warning as w: + raise type(w)(f"{w}\n at {filename}:{lineno}") from None diff --git a/testing/test_warning_types.py b/testing/test_warning_types.py index b49cc68f9c6..5f69439ef3e 100644 --- a/testing/test_warning_types.py +++ b/testing/test_warning_types.py @@ -36,3 +36,11 @@ def test(): ) result = pytester.runpytest() result.stdout.fnmatch_lines(["E pytest.PytestWarning: some warning"]) + + +@pytest.mark.filterwarnings("error") +def test_warn_explicit_for_annotates_errors_with_location(): + with pytest.raises(Warning, match="(?m)test\n at .*python_api.py:\\d+"): + warning_types.warn_explicit_for( + pytest.raises, warning_types.PytestWarning("test") # type: ignore + ) From 2df0d9656ca906e15754483bcd833b0e7b09387e Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 6 Oct 2022 21:12:03 +0300 Subject: [PATCH 364/549] ci: fix PR not triggering workflows by switching back to pytestbot access token The builtin actions token is not allowed to trigger further workflows. So when we create a PR using that token, the PR checks don't run, and a maintainer must close & open the PR to make them run. This is quite annoying, so switch back to the "machine user" approach. Fixes #9554. --- .github/workflows/backport.yml | 2 +- .github/workflows/prepare-release-pr.yml | 4 ++-- .github/workflows/update-plugin-list.yml | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index f7840d537cf..d007d323dd1 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -48,4 +48,4 @@ jobs: --title "${subject}" \ --body "Backport of PR #${{ github.event.number }} to $target_branch branch. PR created by backport workflow." env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CHATOPS }} diff --git a/.github/workflows/prepare-release-pr.yml b/.github/workflows/prepare-release-pr.yml index 429834b3f21..4f90662e0ca 100644 --- a/.github/workflows/prepare-release-pr.yml +++ b/.github/workflows/prepare-release-pr.yml @@ -44,9 +44,9 @@ jobs: - name: Prepare release PR (minor/patch release) if: github.event.inputs.major == 'no' run: | - tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ github.token }} --prerelease='${{ github.event.inputs.prerelease }}' + tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ secrets.CHATOPS }} --prerelease='${{ github.event.inputs.prerelease }}' - name: Prepare release PR (major release) if: github.event.inputs.major == 'yes' run: | - tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ github.token }} --major --prerelease='${{ github.event.inputs.prerelease }}' + tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ secrets.CHATOPS }} --major --prerelease='${{ github.event.inputs.prerelease }}' diff --git a/.github/workflows/update-plugin-list.yml b/.github/workflows/update-plugin-list.yml index 193469072ff..f4fb81fdaa9 100644 --- a/.github/workflows/update-plugin-list.yml +++ b/.github/workflows/update-plugin-list.yml @@ -38,7 +38,7 @@ jobs: run: python scripts/update-plugin-list.py - name: Create Pull Request - uses: peter-evans/create-pull-request@2455e1596942c2902952003bbb574afbbe2ab2e6 + uses: peter-evans/create-pull-request@671dc9c9e0c2d73f07fa45a3eb0220e1622f0c5f with: commit-message: '[automated] Update plugin list' author: 'pytest bot ' @@ -47,3 +47,4 @@ jobs: branch-suffix: short-commit-hash title: '[automated] Update plugin list' body: '[automated] Update plugin list' + token: ${{ secrets.CHATOPS }} From 72cac9b1af32a3edeb48f15d78bf8d006373c9e6 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 7 Oct 2022 12:16:53 +0200 Subject: [PATCH 365/549] Mark tryfirst/trylast as deprecated in their docs. Follow-up to #9118 --- src/_pytest/config/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index cffbb6dc45b..25f156f8b20 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -512,12 +512,14 @@ def pytest_configure(self, config: "Config") -> None: config.addinivalue_line( "markers", "tryfirst: mark a hook implementation function such that the " - "plugin machinery will try to call it first/as early as possible.", + "plugin machinery will try to call it first/as early as possible. " + "DEPRECATED, use @pytest.hookimpl(tryfirst=True) instead.", ) config.addinivalue_line( "markers", "trylast: mark a hook implementation function such that the " - "plugin machinery will try to call it last/as late as possible.", + "plugin machinery will try to call it last/as late as possible. " + "DEPRECATED, use @pytest.hookimpl(trylast=True) instead.", ) self._configured = True From 7a15bad89b2a11923f06a5ac416303d77f48d05b Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Fri, 7 Oct 2022 12:46:40 +0200 Subject: [PATCH 366/549] Update src/_pytest/warning_types.py Co-authored-by: Florian Bruhin --- src/_pytest/warning_types.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index 388949bed53..3be1648fe61 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -168,4 +168,5 @@ def warn_explicit_for(method: FunctionType, message: PytestWarning) -> None: lineno=lineno, ) except Warning as w: + # If warnings are errors (e.g. -Werror), location information gets lost, so we add it to the message. raise type(w)(f"{w}\n at {filename}:{lineno}") from None From 0c21d60349e9e91e6c369709d7a47236d5effbb5 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 7 Oct 2022 11:10:28 -0300 Subject: [PATCH 367/549] Improve documentation for setup() and teardown() nose support Fix #9549 --- doc/en/how-to/nose.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/en/how-to/nose.rst b/doc/en/how-to/nose.rst index 4bf8b06c324..621c243b283 100644 --- a/doc/en/how-to/nose.rst +++ b/doc/en/how-to/nose.rst @@ -23,8 +23,8 @@ make use of pytest's capabilities. Supported nose Idioms ---------------------- -* setup and teardown at module/class/method level -* SkipTest exceptions and markers +* ``setup()`` and ``teardown()`` at module/class/method level: any function or method called ``setup`` will be called during the setup phase for each test, same for ``teardown``. +* ``SkipTest`` exceptions and markers * setup/teardown decorators * ``__test__`` attribute on modules/classes/functions * general usage of nose utilities From 9be1e3fac8e75d9b48ac27b212f45d9f43293e46 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 7 Oct 2022 16:13:05 +0200 Subject: [PATCH 368/549] doc: Add second day for enterPy training (#10348) --- doc/en/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/index.rst b/doc/en/index.rst index a443e081bb3..60fbf99aed6 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -2,7 +2,7 @@ .. sidebar:: Next Open Trainings - - `Professionelles Testen für Python mit pytest `_, part of `enterPy `__ (German), October 28th (separate workshop day), online + - Professionelles Testen für Python mit pytest, part of `enterPy `__ (German), `October 28th `__ (sold out) and `November 4th `__, online - `Professional Testing with Python `_, via `Python Academy `_, March 7th to 9th 2023 (3 day in-depth training), Remote and Leipzig, Germany Also see :doc:`previous talks and blogposts `. From 4da06896532809a216bfa7a53b0ff490c5193fe9 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 7 Oct 2022 11:30:24 -0300 Subject: [PATCH 369/549] Ignore mypy error about missing generic arg for catch_warnings mypy stubs recently changed warnings.catch_warnings to a Generic, in order to have proper overloads depending on the parameters passed to it, whihc triggers this mypy error now when we subclass it: src/_pytest/recwarn.py:170: error: Missing type parameters for generic type "catch_warnings" [type-arg] For our porpuses the parameter is not relevant (we always use record=True), so decided to just ignore the type error. --- .pre-commit-config.yaml | 2 ++ src/_pytest/recwarn.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 663bc64c206..19329cb21b8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,5 @@ +default_language_version: + python: "3.10" repos: - repo: https://github.com/psf/black rev: 22.8.0 diff --git a/src/_pytest/recwarn.py b/src/_pytest/recwarn.py index 06eb82d7191..0ab7ab2de4f 100644 --- a/src/_pytest/recwarn.py +++ b/src/_pytest/recwarn.py @@ -167,7 +167,7 @@ def warns( # noqa: F811 return func(*args[1:], **kwargs) -class WarningsRecorder(warnings.catch_warnings): +class WarningsRecorder(warnings.catch_warnings): # type:ignore[type-arg] """A context manager to record raised warnings. Each recorded warning is an instance of :class:`warnings.WarningMessage`. From 2bc036e50ab0af2955bfe1c91b3f1b55d6a31765 Mon Sep 17 00:00:00 2001 From: wodny Date: Fri, 7 Oct 2022 18:03:13 +0200 Subject: [PATCH 370/549] Mention pythonpath confval in Good Integration Practices (#10314) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- doc/en/explanation/goodpractices.rst | 34 +++++++++++++++++++++------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 0280f14342f..5277c2ac54a 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -88,14 +88,6 @@ This has the following benefits: * Your tests can run against an installed version after executing ``pip install .``. * Your tests can run against the local copy with an editable install after executing ``pip install --editable .``. -* If you don't use an editable install and are relying on the fact that Python by default puts the current - directory in ``sys.path`` to import your package, you can execute ``python -m pytest`` to execute the tests against the - local copy directly, without using ``pip``. - -.. note:: - - See :ref:`pytest vs python -m pytest` for more information about the difference between calling ``pytest`` and - ``python -m pytest``. For new projects, we recommend to use ``importlib`` :ref:`import mode ` (see which-import-mode_ for a detailed explanation). @@ -120,6 +112,32 @@ which are better explained in this excellent `blog post`_ by Ionel Cristian Măr .. _blog post: https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure> +.. note:: + + If you do not use an editable install and use the ``src`` layout as above you need to extend the Python's + search path for module files to execute the tests against the local copy directly. You can do it in an + ad-hoc manner by setting the ``PYTHONPATH`` environment variable: + + .. code-block:: bash + + PYTHONPATH=src pytest + + or in a permanent manner by using the :confval:`pythonpath` configuration variable and adding the + following to your ``pyproject.toml``: + + .. code-block:: toml + + [tool.pytest.ini_options] + pythonpath = "src" + +.. note:: + + If you do not use an editable install and not use the ``src`` layout (``mypkg`` directly in the root + directory) you can rely on the fact that Python by default puts the current directory in ``sys.path`` to + import your package and run ``python -m pytest`` to execute the tests against the local copy directly. + + See :ref:`pytest vs python -m pytest` for more information about the difference between calling ``pytest`` and + ``python -m pytest``. Tests as part of application code ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From 8e7ce60c7d8d6c595e8357e040fbdac25bfee696 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Fri, 7 Oct 2022 11:03:42 -0500 Subject: [PATCH 371/549] Export `pytest.DoctestItem` for typing / runtime purposes (#10313) Fixes #10312 --- changelog/10313.trivial.rst | 3 +++ src/_pytest/doctest.py | 17 ++++++++++------- src/pytest/__init__.py | 2 ++ 3 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 changelog/10313.trivial.rst diff --git a/changelog/10313.trivial.rst b/changelog/10313.trivial.rst new file mode 100644 index 00000000000..8203b580211 --- /dev/null +++ b/changelog/10313.trivial.rst @@ -0,0 +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. diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py index ed072fcd628..771f0890d88 100644 --- a/src/_pytest/doctest.py +++ b/src/_pytest/doctest.py @@ -23,7 +23,6 @@ from typing import TYPE_CHECKING from typing import Union -import pytest from _pytest import outcomes from _pytest._code.code import ExceptionInfo from _pytest._code.code import ReprFileLocation @@ -32,11 +31,15 @@ from _pytest.compat import safe_getattr from _pytest.config import Config from _pytest.config.argparsing import Parser +from _pytest.fixtures import fixture from _pytest.fixtures import FixtureRequest from _pytest.nodes import Collector +from _pytest.nodes import Item from _pytest.outcomes import OutcomeException +from _pytest.outcomes import skip from _pytest.pathlib import fnmatch_ex from _pytest.pathlib import import_path +from _pytest.python import Module from _pytest.python_api import approx from _pytest.warning_types import PytestWarning @@ -246,7 +249,7 @@ def _get_runner( ) -class DoctestItem(pytest.Item): +class DoctestItem(Item): def __init__( self, name: str, @@ -411,7 +414,7 @@ def _get_continue_on_failure(config): return continue_on_failure -class DoctestTextfile(pytest.Module): +class DoctestTextfile(Module): obj = None def collect(self) -> Iterable[DoctestItem]: @@ -449,7 +452,7 @@ def _check_all_skipped(test: "doctest.DocTest") -> None: all_skipped = all(x.options.get(doctest.SKIP, False) for x in test.examples) if all_skipped: - pytest.skip("all tests skipped by +SKIP option") + skip("all tests skipped by +SKIP option") def _is_mocked(obj: object) -> bool: @@ -491,7 +494,7 @@ def _mock_aware_unwrap( inspect.unwrap = real_unwrap -class DoctestModule(pytest.Module): +class DoctestModule(Module): def collect(self) -> Iterable[DoctestItem]: import doctest @@ -549,7 +552,7 @@ def _find( ) except ImportError: if self.config.getvalue("doctest_ignore_import_errors"): - pytest.skip("unable to import module %r" % self.path) + skip("unable to import module %r" % self.path) else: raise # Uses internal doctest module parsing mechanism. @@ -731,7 +734,7 @@ def _get_report_choice(key: str) -> int: }[key] -@pytest.fixture(scope="session") +@fixture(scope="session") def doctest_namespace() -> Dict[str, Any]: """Fixture that returns a :py:class:`dict` that will be injected into the namespace of doctests. diff --git a/src/pytest/__init__.py b/src/pytest/__init__.py index c1634e296bc..f25ecde9c47 100644 --- a/src/pytest/__init__.py +++ b/src/pytest/__init__.py @@ -18,6 +18,7 @@ from _pytest.config.argparsing import OptionGroup from _pytest.config.argparsing import Parser from _pytest.debugging import pytestPDB as __pytestPDB +from _pytest.doctest import DoctestItem from _pytest.fixtures import fixture from _pytest.fixtures import FixtureLookupError from _pytest.fixtures import FixtureRequest @@ -92,6 +93,7 @@ "Config", "console_main", "deprecated_call", + "DoctestItem", "exit", "ExceptionInfo", "ExitCode", From a501518a26fa854e62615b2f22285407266ceaaf Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 8 Oct 2022 00:58:51 +0300 Subject: [PATCH 372/549] Revert "ci: fix PR not triggering workflows by switching back to pytestbot access token" --- .github/workflows/backport.yml | 2 +- .github/workflows/prepare-release-pr.yml | 4 ++-- .github/workflows/update-plugin-list.yml | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index d007d323dd1..f7840d537cf 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -48,4 +48,4 @@ jobs: --title "${subject}" \ --body "Backport of PR #${{ github.event.number }} to $target_branch branch. PR created by backport workflow." env: - GITHUB_TOKEN: ${{ secrets.CHATOPS }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/prepare-release-pr.yml b/.github/workflows/prepare-release-pr.yml index 4f90662e0ca..429834b3f21 100644 --- a/.github/workflows/prepare-release-pr.yml +++ b/.github/workflows/prepare-release-pr.yml @@ -44,9 +44,9 @@ jobs: - name: Prepare release PR (minor/patch release) if: github.event.inputs.major == 'no' run: | - tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ secrets.CHATOPS }} --prerelease='${{ github.event.inputs.prerelease }}' + tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ github.token }} --prerelease='${{ github.event.inputs.prerelease }}' - name: Prepare release PR (major release) if: github.event.inputs.major == 'yes' run: | - tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ secrets.CHATOPS }} --major --prerelease='${{ github.event.inputs.prerelease }}' + tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ github.token }} --major --prerelease='${{ github.event.inputs.prerelease }}' diff --git a/.github/workflows/update-plugin-list.yml b/.github/workflows/update-plugin-list.yml index f4fb81fdaa9..193469072ff 100644 --- a/.github/workflows/update-plugin-list.yml +++ b/.github/workflows/update-plugin-list.yml @@ -38,7 +38,7 @@ jobs: run: python scripts/update-plugin-list.py - name: Create Pull Request - uses: peter-evans/create-pull-request@671dc9c9e0c2d73f07fa45a3eb0220e1622f0c5f + uses: peter-evans/create-pull-request@2455e1596942c2902952003bbb574afbbe2ab2e6 with: commit-message: '[automated] Update plugin list' author: 'pytest bot ' @@ -47,4 +47,3 @@ jobs: branch-suffix: short-commit-hash title: '[automated] Update plugin list' body: '[automated] Update plugin list' - token: ${{ secrets.CHATOPS }} From d8c783268c6876379f5a3a0251b72d0d6d22d0cf Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sat, 8 Oct 2022 08:18:26 +0200 Subject: [PATCH 373/549] fix #7792: consider marks from the mro closes #9105 as superseeded --- changelog/7792.bugfix.rst | 1 + src/_pytest/mark/structures.py | 29 +++++++++++++++++++++++------ testing/test_mark.py | 23 +++++++++++++++++++++++ 3 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 changelog/7792.bugfix.rst diff --git a/changelog/7792.bugfix.rst b/changelog/7792.bugfix.rst new file mode 100644 index 00000000000..00e09ebe849 --- /dev/null +++ b/changelog/7792.bugfix.rst @@ -0,0 +1 @@ +Consider the full mro when getting marks from classes. diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index 800a25c9243..e9e00612529 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -355,12 +355,29 @@ def __call__(self, *args: object, **kwargs: object): return self.with_args(*args, **kwargs) -def get_unpacked_marks(obj: object) -> Iterable[Mark]: +def get_unpacked_marks( + obj: object | type, + consider_mro: bool = True, +) -> List[Mark]: """Obtain the unpacked marks that are stored on an object.""" - mark_list = getattr(obj, "pytestmark", []) - if not isinstance(mark_list, list): - mark_list = [mark_list] - return normalize_mark_list(mark_list) + if isinstance(obj, type): + if not consider_mro: + mark_lists = [obj.__dict__.get("pytestmark", [])] + else: + mark_lists = [x.__dict__.get("pytestmark", []) for x in obj.__mro__] + mark_list = [] + for item in mark_lists: + if isinstance(item, list): + mark_list.extend(item) + else: + mark_list.append(item) + else: + mark_attribute = getattr(obj, "pytestmark", []) + if isinstance(mark_attribute, list): + mark_list = mark_attribute + else: + mark_list = [mark_attribute] + return list(normalize_mark_list(mark_list)) def normalize_mark_list( @@ -388,7 +405,7 @@ def store_mark(obj, mark: Mark) -> None: assert isinstance(mark, Mark), mark # Always reassign name to avoid updating pytestmark in a reference that # was only borrowed. - obj.pytestmark = [*get_unpacked_marks(obj), mark] + obj.pytestmark = [*get_unpacked_marks(obj, consider_mro=False), mark] # Typing for builtin pytest marks. This is cheating; it gives builtin marks diff --git a/testing/test_mark.py b/testing/test_mark.py index 65f2581bd63..8c20fe8b17d 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -1109,3 +1109,26 @@ def test_foo(): result = pytester.runpytest(foo, "-m", expr) result.stderr.fnmatch_lines([expected]) assert result.ret == ExitCode.USAGE_ERROR + + +def test_mark_mro(): + @pytest.mark.xfail("a") + class A: + pass + + @pytest.mark.xfail("b") + class B: + pass + + @pytest.mark.xfail("c") + class C(A, B): + pass + + from _pytest.mark.structures import get_unpacked_marks + + all_marks = list(get_unpacked_marks(C)) + + nk = [(x.name, x.args[0]) for x in all_marks] + assert nk == [("xfail", "c"), ("xfail", "a"), ("xfail", "b")] + + assert list(get_unpacked_marks(C, consider_mro=False)) == [] From 4e7486d3fb95f97422283fc7f21b24e8aa6ef2c8 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sat, 8 Oct 2022 08:28:03 +0200 Subject: [PATCH 374/549] fixup: annotations --- src/_pytest/mark/structures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index e9e00612529..0b1daefd639 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -356,7 +356,7 @@ def __call__(self, *args: object, **kwargs: object): def get_unpacked_marks( - obj: object | type, + obj: Union[object, type], consider_mro: bool = True, ) -> List[Mark]: """Obtain the unpacked marks that are stored on an object.""" From 13e594a31474136fb185eff7084760f724897d6b Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sat, 8 Oct 2022 08:35:26 +0200 Subject: [PATCH 375/549] fixup: mark mro test reformatt --- testing/test_mark.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/testing/test_mark.py b/testing/test_mark.py index 8c20fe8b17d..6199dc0b374 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -1112,23 +1112,24 @@ def test_foo(): def test_mark_mro(): - @pytest.mark.xfail("a") + xfail = pytest.mark.xfail + + @xfail("a") class A: pass - @pytest.mark.xfail("b") + @xfail("b") class B: pass - @pytest.mark.xfail("c") + @xfail("c") class C(A, B): pass from _pytest.mark.structures import get_unpacked_marks - all_marks = list(get_unpacked_marks(C)) + all_marks = get_unpacked_marks(C) - nk = [(x.name, x.args[0]) for x in all_marks] - assert nk == [("xfail", "c"), ("xfail", "a"), ("xfail", "b")] + assert all_marks == [xfail("c").mark, xfail("a").mark, xfail("b").mark] - assert list(get_unpacked_marks(C, consider_mro=False)) == [] + assert get_unpacked_marks(C, consider_mro=False) == [pytest.mark.xfail("c").mark] From c42bb36009445e0cf1915dd5d1b762639a710675 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sat, 8 Oct 2022 08:35:53 +0200 Subject: [PATCH 376/549] fixup: mark mro test reformatt --- testing/test_mark.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/test_mark.py b/testing/test_mark.py index 6199dc0b374..ebb70e2470b 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -1132,4 +1132,4 @@ class C(A, B): assert all_marks == [xfail("c").mark, xfail("a").mark, xfail("b").mark] - assert get_unpacked_marks(C, consider_mro=False) == [pytest.mark.xfail("c").mark] + assert get_unpacked_marks(C, consider_mro=False) == [xfail("c").mark] From a28d595b4686b074101ba5d9b5cf7498361f75c6 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Sat, 1 Oct 2022 11:44:06 +0200 Subject: [PATCH 377/549] doc: add note to help modernize code bases to use pathlib Fixes #10199 --- doc/en/how-to/tmp_path.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/en/how-to/tmp_path.rst b/doc/en/how-to/tmp_path.rst index 99e9e55367a..a2f936d3352 100644 --- a/doc/en/how-to/tmp_path.rst +++ b/doc/en/how-to/tmp_path.rst @@ -109,6 +109,17 @@ rather than standard :class:`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: + + .. code-block:: bash + + pytest -p no:legacypath + + This will trigger errors on tests using the legacy paths. + It can also be permanently set as part of the :confval:`addopts` parameter in the + config file. + See :fixture:`tmpdir ` :fixture:`tmpdir_factory ` API for details. From d0abfb1c2a2642df68634c6d79ffd06d5855a7dd Mon Sep 17 00:00:00 2001 From: Anton Yakutovich Date: Sun, 9 Oct 2022 16:27:35 +0400 Subject: [PATCH 378/549] Bump actions in test.yml --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 33b32a1abaa..3f3e7e535eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -154,13 +154,13 @@ jobs: use_coverage: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 persist-credentials: false - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} @@ -183,7 +183,7 @@ jobs: - name: Upload coverage to Codecov if: "matrix.use_coverage" - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: fail_ci_if_error: true files: ./coverage.xml From 3bf2bc55b12e8540b4bb5311db2463845be12fbd Mon Sep 17 00:00:00 2001 From: Simon K Date: Sun, 9 Oct 2022 21:16:33 +0100 Subject: [PATCH 379/549] Add deprecations for tests written for `nose` (#9907) Fixes #9886 --- .gitignore | 1 + changelog/9886.deprecation.rst | 10 +++ doc/en/deprecations.rst | 107 +++++++++++++++++++++++++++++++++ doc/en/how-to/nose.rst | 3 + doc/en/how-to/xunit_setup.rst | 2 + src/_pytest/deprecated.py | 15 +++++ src/_pytest/nose.py | 14 ++++- src/_pytest/python.py | 21 ++++++- testing/deprecated_test.py | 59 ++++++++++++++++++ testing/test_nose.py | 4 +- 10 files changed, 230 insertions(+), 6 deletions(-) create mode 100644 changelog/9886.deprecation.rst diff --git a/.gitignore b/.gitignore index 935da3b9a2e..3cac2474a59 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,7 @@ coverage.xml .project .settings .vscode +__pycache__/ # generated by pip pip-wheel-metadata/ diff --git a/changelog/9886.deprecation.rst b/changelog/9886.deprecation.rst new file mode 100644 index 00000000000..94f51decfda --- /dev/null +++ b/changelog/9886.deprecation.rst @@ -0,0 +1,10 @@ +The functionality for running tests written for ``nose`` has been officially deprecated. + +This includes: + +* Plain ``setup`` and ``teardown`` functions and methods: this might catch users by surprise, as ``setup()`` and ``teardown()`` are not pytest idioms, but part of the ``nose`` support. +* Setup/teardown using the `@with_setup `_ decorator. + +For more details, consult the :ref:`deprecation docs `. + +.. _`with-setup-nose`: https://nose.readthedocs.io/en/latest/testing_tools.html?highlight=with_setup#nose.tools.with_setup diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index a18d9d713b0..a73c11fb846 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -18,6 +18,113 @@ Deprecated Features Below is a complete list of all pytest features which are considered deprecated. Using those features will issue :class:`~pytest.PytestWarning` or subclasses, which can be filtered using :ref:`standard warning filters `. + +.. _nose-deprecation: + +Support for tests written for nose +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. deprecated:: 7.2 + +Support for running tests written for `nose `__ is now deprecated. + +``nose`` has been in maintenance mode-only for years, and maintaining the plugin is not trivial as it spills +over the code base (see :issue:`9886` for more details). + +setup/teardown +^^^^^^^^^^^^^^ + +One thing that might catch users by surprise is that plain ``setup`` and ``teardown`` methods are not pytest native, +they are in fact part of the ``nose`` support. + + +.. code-block:: python + + class Test: + def setup(self): + self.resource = make_resource() + + def teardown(self): + self.resource.close() + + def test_foo(self): + ... + + def test_bar(self): + ... + + + +Native pytest support uses ``setup_method`` and ``teardown_method`` (see :ref:`xunit-method-setup`), so the above should be changed to: + +.. code-block:: python + + class Test: + def setup_method(self): + self.resource = make_resource() + + def teardown_method(self): + self.resource.close() + + def test_foo(self): + ... + + def test_bar(self): + ... + + +This is easy to do in an entire code base by doing a simple find/replace. + +@with_setup +^^^^^^^^^^^ + +Code using `@with_setup `_ such as this: + +.. code-block:: python + + from nose.tools import with_setup + + + def setup_some_resource(): + ... + + + def teardown_some_resource(): + ... + + + @with_setup(setup_some_resource, teardown_some_resource) + def test_foo(): + ... + +Will also need to be ported to a supported pytest style. One way to do it is using a fixture: + +.. code-block:: python + + import pytest + + + def setup_some_resource(): + ... + + + def teardown_some_resource(): + ... + + + @pytest.fixture + def some_resource(): + setup_some_resource() + yield + teardown_some_resource() + + + def test_foo(some_resource): + ... + + +.. _`with-setup-nose`: https://nose.readthedocs.io/en/latest/testing_tools.html?highlight=with_setup#nose.tools.with_setup + .. _instance-collector-deprecation: The ``pytest.Instance`` collector diff --git a/doc/en/how-to/nose.rst b/doc/en/how-to/nose.rst index 621c243b283..a736dfa55a7 100644 --- a/doc/en/how-to/nose.rst +++ b/doc/en/how-to/nose.rst @@ -5,6 +5,9 @@ How to run tests written for nose ``pytest`` has basic support for running tests written for nose_. +.. warning:: + This functionality has been deprecated and is likely to be removed in ``pytest 8.x``. + .. _nosestyle: Usage diff --git a/doc/en/how-to/xunit_setup.rst b/doc/en/how-to/xunit_setup.rst index eb432a4053d..3de6681ff8f 100644 --- a/doc/en/how-to/xunit_setup.rst +++ b/doc/en/how-to/xunit_setup.rst @@ -63,6 +63,8 @@ and after all test methods of the class are called: setup_class. """ +.. _xunit-method-setup: + Method and function level setup/teardown ----------------------------------------------- diff --git a/src/_pytest/deprecated.py b/src/_pytest/deprecated.py index 623bb02365f..b9c10df7a00 100644 --- a/src/_pytest/deprecated.py +++ b/src/_pytest/deprecated.py @@ -22,6 +22,21 @@ "pytest_faulthandler", } +NOSE_SUPPORT = UnformattedWarning( + PytestRemovedIn8Warning, + "Support for nose tests is deprecated and will be removed in a future release.\n" + "{nodeid} is using nose method: `{method}` ({stage})\n" + "See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose", +) + +NOSE_SUPPORT_METHOD = UnformattedWarning( + PytestRemovedIn8Warning, + "Support for nose tests is deprecated and will be removed in a future release.\n" + "{nodeid} is using nose-specific method: `{method}(self)`\n" + "To remove this warning, rename it to `{method}_method(self)`\n" + "See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose", +) + # This can be* removed pytest 8, but it's harmless and common, so no rush to remove. # * If you're in the future: "could have been". diff --git a/src/_pytest/nose.py b/src/_pytest/nose.py index b0699d22bd8..273bd045fb6 100644 --- a/src/_pytest/nose.py +++ b/src/_pytest/nose.py @@ -1,5 +1,8 @@ """Run testsuites written for nose.""" +import warnings + from _pytest.config import hookimpl +from _pytest.deprecated import NOSE_SUPPORT from _pytest.fixtures import getfixturemarker from _pytest.nodes import Item from _pytest.python import Function @@ -18,8 +21,8 @@ def pytest_runtest_setup(item: Item) -> None: # see https://github.com/python/mypy/issues/2608 func = item - call_optional(func.obj, "setup") - func.addfinalizer(lambda: call_optional(func.obj, "teardown")) + call_optional(func.obj, "setup", func.nodeid) + func.addfinalizer(lambda: call_optional(func.obj, "teardown", func.nodeid)) # NOTE: Module- and class-level fixtures are handled in python.py # with `pluginmanager.has_plugin("nose")` checks. @@ -27,7 +30,7 @@ def pytest_runtest_setup(item: Item) -> None: # it's not straightforward. -def call_optional(obj: object, name: str) -> bool: +def call_optional(obj: object, name: str, nodeid: str) -> bool: method = getattr(obj, name, None) if method is None: return False @@ -36,6 +39,11 @@ def call_optional(obj: object, name: str) -> bool: return False if not callable(method): return False + # Warn about deprecation of this plugin. + method_name = getattr(method, "__name__", str(method)) + warnings.warn( + NOSE_SUPPORT.format(nodeid=nodeid, method=method_name, stage=name), stacklevel=2 + ) # If there are any problems allow the exception to raise rather than # silently ignoring it. method() diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 3db8775061b..1e30d42ce9c 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -59,6 +59,7 @@ from _pytest.deprecated import check_ispytest from _pytest.deprecated import FSCOLLECTOR_GETHOOKPROXY_ISINITPATH from _pytest.deprecated import INSTANCE_COLLECTOR +from _pytest.deprecated import NOSE_SUPPORT_METHOD from _pytest.fixtures import FuncFixtureInfo from _pytest.main import Session from _pytest.mark import MARK_GEN @@ -872,19 +873,23 @@ def _inject_setup_method_fixture(self) -> None: """Inject a hidden autouse, function scoped fixture into the collected class object that invokes setup_method/teardown_method if either or both are available. - Using a fixture to invoke this methods ensures we play nicely and unsurprisingly with + Using a fixture to invoke these methods ensures we play nicely and unsurprisingly with other fixtures (#517). """ has_nose = self.config.pluginmanager.has_plugin("nose") setup_name = "setup_method" setup_method = _get_first_non_fixture_func(self.obj, (setup_name,)) + emit_nose_setup_warning = False if setup_method is None and has_nose: setup_name = "setup" + emit_nose_setup_warning = True setup_method = _get_first_non_fixture_func(self.obj, (setup_name,)) teardown_name = "teardown_method" teardown_method = getattr(self.obj, teardown_name, None) + emit_nose_teardown_warning = False if teardown_method is None and has_nose: teardown_name = "teardown" + emit_nose_teardown_warning = True teardown_method = getattr(self.obj, teardown_name, None) if setup_method is None and teardown_method is None: return @@ -900,10 +905,24 @@ def xunit_setup_method_fixture(self, request) -> Generator[None, None, None]: if setup_method is not None: func = getattr(self, setup_name) _call_with_optional_argument(func, method) + if emit_nose_setup_warning: + warnings.warn( + NOSE_SUPPORT_METHOD.format( + nodeid=request.node.nodeid, method="setup" + ), + stacklevel=2, + ) yield if teardown_method is not None: func = getattr(self, teardown_name) _call_with_optional_argument(func, method) + if emit_nose_teardown_warning: + warnings.warn( + NOSE_SUPPORT_METHOD.format( + nodeid=request.node.nodeid, method="teardown" + ), + stacklevel=2, + ) self.obj.__pytest_setup_method = xunit_setup_method_fixture diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index d468b443541..3ceed7f5a2c 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -279,3 +279,62 @@ def test_importing_instance_is_deprecated(pytester: Pytester) -> None: match=re.escape("The pytest.Instance collector type is deprecated"), ): from _pytest.python import Instance # noqa: F401 + + +@pytest.mark.filterwarnings("default") +def test_nose_deprecated_with_setup(pytester: Pytester) -> None: + pytest.importorskip("nose") + pytester.makepyfile( + """ + from nose.tools import with_setup + + def setup_fn_no_op(): + ... + + def teardown_fn_no_op(): + ... + + @with_setup(setup_fn_no_op, teardown_fn_no_op) + def test_omits_warnings(): + ... + """ + ) + output = pytester.runpytest() + message = [ + "*PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.", + "*test_nose_deprecated_with_setup.py::test_omits_warnings is using nose method: `setup_fn_no_op` (setup)", + "*PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.", + "*test_nose_deprecated_with_setup.py::test_omits_warnings is using nose method: `teardown_fn_no_op` (teardown)", + ] + output.stdout.fnmatch_lines(message) + output.assert_outcomes(passed=1) + + +@pytest.mark.filterwarnings("default") +def test_nose_deprecated_setup_teardown(pytester: Pytester) -> None: + pytest.importorskip("nose") + pytester.makepyfile( + """ + class Test: + + def setup(self): + ... + + def teardown(self): + ... + + def test(self): + ... + """ + ) + output = pytester.runpytest() + message = [ + "*PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.", + "*test_nose_deprecated_setup_teardown.py::Test::test is using nose-specific method: `setup(self)`", + "*To remove this warning, rename it to `setup_method(self)`", + "*PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.", + "*test_nose_deprecated_setup_teardown.py::Test::test is using nose-specific method: `teardown(self)`", + "*To remove this warning, rename it to `teardown_method(self)`", + ] + output.stdout.fnmatch_lines(message) + output.assert_outcomes(passed=1) diff --git a/testing/test_nose.py b/testing/test_nose.py index cab5a81a2b9..92d6b95fd87 100644 --- a/testing/test_nose.py +++ b/testing/test_nose.py @@ -37,7 +37,7 @@ class A: def f(self): values.append(1) - call_optional(A(), "f") + call_optional(A(), "f", "A.f") assert not values @@ -47,7 +47,7 @@ def test_setup_func_not_callable() -> None: class A: f = 1 - call_optional(A(), "f") + call_optional(A(), "f", "A.f") def test_nose_setup_func(pytester: Pytester) -> None: From 196f01965ed264e1fd917db236c872f85403753d Mon Sep 17 00:00:00 2001 From: Vivaan Verma Date: Sun, 9 Oct 2022 21:42:42 +0100 Subject: [PATCH 380/549] Replace entrypoint example with `pyproject.toml` in docs (#10359) Fixes #10344 --- AUTHORS | 1 + changelog/10344.doc.rst | 1 + doc/en/how-to/writing_plugins.rst | 40 ++++++++++++++++++------------- 3 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 changelog/10344.doc.rst diff --git a/AUTHORS b/AUTHORS index ca2872f32a4..4e15caf8e90 100644 --- a/AUTHORS +++ b/AUTHORS @@ -356,6 +356,7 @@ Victor Uriarte Vidar T. Fauske Virgil Dupras Vitaly Lashmanov +Vivaan Verma Vlad Dragos Vlad Radziuk Vladyslav Rachek diff --git a/changelog/10344.doc.rst b/changelog/10344.doc.rst new file mode 100644 index 00000000000..1c7885edc20 --- /dev/null +++ b/changelog/10344.doc.rst @@ -0,0 +1 @@ +Update information on writing plugins to use ``pyproject.toml`` instead of ``setup.py``. diff --git a/doc/en/how-to/writing_plugins.rst b/doc/en/how-to/writing_plugins.rst index 2fbf49718ce..f15b69c2317 100644 --- a/doc/en/how-to/writing_plugins.rst +++ b/doc/en/how-to/writing_plugins.rst @@ -147,27 +147,33 @@ Making your plugin installable by others If you want to make your plugin externally available, you may define a so-called entry point for your distribution so -that ``pytest`` finds your plugin module. Entry points are -a feature that is provided by :std:doc:`setuptools:index`. pytest looks up -the ``pytest11`` entrypoint to discover its -plugins and you can thus make your plugin available by defining -it in your setuptools-invocation: +that ``pytest`` finds your plugin module. Entry points are +a feature that is provided by :std:doc:`setuptools `. -.. sourcecode:: python +pytest looks up the ``pytest11`` entrypoint to discover its +plugins, thus you can make your plugin available by defining +it in your ``pyproject.toml`` file. + +.. sourcecode:: toml + + # sample ./pyproject.toml file + [build-system] + requires = ["hatchling"] + build-backend = "hatchling.build" - # sample ./setup.py file - from setuptools import setup + [project] + name = "myproject" + classifiers = [ + "Framework :: Pytest", + ] + [tool.setuptools] + packages = ["myproject"] - name_of_plugin = "myproject" # register plugin with this name - setup( - name="myproject", - packages=["myproject"], - # the following makes a plugin available to pytest - entry_points={"pytest11": [f"{name_of_plugin} = myproject.pluginmodule"]}, - # custom PyPI classifier for pytest plugins - classifiers=["Framework :: Pytest"], - ) + [project.entry_points] + pytest11 = [ + "myproject = myproject.pluginmodule", + ] If a package is installed this way, ``pytest`` will load ``myproject.pluginmodule`` as a plugin which can define From 8a40fc53152e9430f66f4a7eb62e30eb21d0b311 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 10 Oct 2022 00:10:45 +0100 Subject: [PATCH 381/549] PytestReturnNotNoneWarning now subclasses PytestRemovedIn8Warning (#10196) As discussed in https://github.com/pytest-dev/pytest/pull/9956#issuecomment-1132710934. Also added PytestRemovedIn8Warning to the reference docs. --- changelog/10196.trivial.rst | 1 + doc/en/reference/reference.rst | 3 +++ src/_pytest/warning_types.py | 3 +-- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelog/10196.trivial.rst diff --git a/changelog/10196.trivial.rst b/changelog/10196.trivial.rst new file mode 100644 index 00000000000..edf458f84c5 --- /dev/null +++ b/changelog/10196.trivial.rst @@ -0,0 +1 @@ +:class:`~pytest.PytestReturnNotNoneWarning` is now a subclass of :class:`~pytest.PytestRemovedIn8Warning`: the plan is to make returning non-``None`` from tests an error in the future. diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index c4402ff41a0..6edb88b92c8 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1136,6 +1136,9 @@ Custom warnings generated in some situations such as improper usage or deprecate .. autoclass:: pytest.PytestReturnNotNoneWarning :show-inheritance: +.. autoclass:: pytest.PytestRemovedIn8Warning + :show-inheritance: + .. autoclass:: pytest.PytestUnhandledCoroutineWarning :show-inheritance: diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index 3be1648fe61..620860c1bc4 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -51,14 +51,13 @@ class PytestDeprecationWarning(PytestWarning, DeprecationWarning): __module__ = "pytest" -@final class PytestRemovedIn8Warning(PytestDeprecationWarning): """Warning class for features that will be removed in pytest 8.""" __module__ = "pytest" -class PytestReturnNotNoneWarning(PytestDeprecationWarning): +class PytestReturnNotNoneWarning(PytestRemovedIn8Warning): """Warning emitted when a test function is returning value other than None.""" __module__ = "pytest" From 78c2c48c67f594235f63c927fd1fc0760ac79ade Mon Sep 17 00:00:00 2001 From: itxasos23 <115184221+itxasos23@users.noreply.github.com> Date: Mon, 10 Oct 2022 02:09:33 +0200 Subject: [PATCH 382/549] Handle NFC/NFD strings that normalize to the same string. (#10355) Co-authored-by: Zac Hatfield-Dodds --- AUTHORS | 1 + changelog/3426.improvement.rst | 1 + src/_pytest/_io/saferepr.py | 20 +++++++++++++++----- src/_pytest/assertion/util.py | 23 ++++++++++++++++++----- testing/test_assertion.py | 18 ++++++++++++++++++ 5 files changed, 53 insertions(+), 10 deletions(-) create mode 100644 changelog/3426.improvement.rst diff --git a/AUTHORS b/AUTHORS index 4e15caf8e90..55b0237ea08 100644 --- a/AUTHORS +++ b/AUTHORS @@ -154,6 +154,7 @@ Ian Bicking Ian Lesperance Ilya Konstantinov Ionuț Turturică +Itxaso Aizpurua Iwan Briquemont Jaap Broekhuizen Jakob van Santen diff --git a/changelog/3426.improvement.rst b/changelog/3426.improvement.rst new file mode 100644 index 00000000000..e232d56aa6a --- /dev/null +++ b/changelog/3426.improvement.rst @@ -0,0 +1 @@ +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 expresed instead. diff --git a/src/_pytest/_io/saferepr.py b/src/_pytest/_io/saferepr.py index a27e8c2a6a5..c701872238c 100644 --- a/src/_pytest/_io/saferepr.py +++ b/src/_pytest/_io/saferepr.py @@ -41,7 +41,7 @@ class SafeRepr(reprlib.Repr): information on exceptions raised during the call. """ - def __init__(self, maxsize: Optional[int]) -> None: + def __init__(self, maxsize: Optional[int], use_ascii: bool = False) -> None: """ :param maxsize: If not None, will truncate the resulting repr to that specific size, using ellipsis @@ -54,10 +54,15 @@ def __init__(self, maxsize: Optional[int]) -> None: # truncation. self.maxstring = maxsize if maxsize is not None else 1_000_000_000 self.maxsize = maxsize + self.use_ascii = use_ascii def repr(self, x: object) -> str: try: - s = super().repr(x) + if self.use_ascii: + s = ascii(x) + else: + s = super().repr(x) + except (KeyboardInterrupt, SystemExit): raise except BaseException as exc: @@ -94,7 +99,9 @@ def safeformat(obj: object) -> str: DEFAULT_REPR_MAX_SIZE = 240 -def saferepr(obj: object, maxsize: Optional[int] = DEFAULT_REPR_MAX_SIZE) -> str: +def saferepr( + obj: object, maxsize: Optional[int] = DEFAULT_REPR_MAX_SIZE, use_ascii: bool = False +) -> str: """Return a size-limited safe repr-string for the given object. Failing __repr__ functions of user instances will be represented @@ -104,10 +111,11 @@ def saferepr(obj: object, maxsize: Optional[int] = DEFAULT_REPR_MAX_SIZE) -> str This function is a wrapper around the Repr/reprlib functionality of the stdlib. """ - return SafeRepr(maxsize).repr(obj) + + return SafeRepr(maxsize, use_ascii).repr(obj) -def saferepr_unlimited(obj: object) -> str: +def saferepr_unlimited(obj: object, use_ascii: bool = True) -> str: """Return an unlimited-size safe repr-string for the given object. As with saferepr, failing __repr__ functions of user instances @@ -119,6 +127,8 @@ def saferepr_unlimited(obj: object) -> str: when maxsize=None, but that might affect some other code. """ try: + if use_ascii: + return ascii(obj) return repr(obj) except Exception as exc: return _format_repr_exception(exc, obj) diff --git a/src/_pytest/assertion/util.py b/src/_pytest/assertion/util.py index 0c34b83ea01..fc5dfdbd5ba 100644 --- a/src/_pytest/assertion/util.py +++ b/src/_pytest/assertion/util.py @@ -10,6 +10,7 @@ from typing import Mapping from typing import Optional from typing import Sequence +from unicodedata import normalize import _pytest._code from _pytest import outcomes @@ -156,20 +157,32 @@ def has_default_eq( return True -def assertrepr_compare(config, op: str, left: Any, right: Any) -> Optional[List[str]]: +def assertrepr_compare( + config, op: str, left: Any, right: Any, use_ascii: bool = False +) -> Optional[List[str]]: """Return specialised explanations for some operators/operands.""" verbose = config.getoption("verbose") + + # Strings which normalize equal are often hard to distinguish when printed; use ascii() to make this easier. + # See issue #3246. + use_ascii = ( + isinstance(left, str) + and isinstance(right, str) + and normalize("NFD", left) == normalize("NFD", right) + ) + if verbose > 1: - left_repr = saferepr_unlimited(left) - right_repr = saferepr_unlimited(right) + left_repr = saferepr_unlimited(left, use_ascii=use_ascii) + right_repr = saferepr_unlimited(right, use_ascii=use_ascii) else: # XXX: "15 chars indentation" is wrong # ("E AssertionError: assert "); should use term width. maxsize = ( 80 - 15 - len(op) - 2 ) // 2 # 15 chars indentation, 1 space around op - left_repr = saferepr(left, maxsize=maxsize) - right_repr = saferepr(right, maxsize=maxsize) + + left_repr = saferepr(left, maxsize=maxsize, use_ascii=use_ascii) + right_repr = saferepr(right, maxsize=maxsize, use_ascii=use_ascii) summary = f"{left_repr} {op} {right_repr}" diff --git a/testing/test_assertion.py b/testing/test_assertion.py index 2bc06d65a2b..d8844f2e41d 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -776,6 +776,24 @@ def test_mojibake(self) -> None: msg = "\n".join(expl) assert msg + def test_nfc_nfd_same_string(self) -> None: + # issue 3426 + left = "hyv\xe4" + right = "hyva\u0308" + expl = callequal(left, right) + assert expl == [ + r"'hyv\xe4' == 'hyva\u0308'", + f"- {str(right)}", + f"+ {str(left)}", + ] + + expl = callequal(left, right, verbose=2) + assert expl == [ + r"'hyv\xe4' == 'hyva\u0308'", + f"- {str(right)}", + f"+ {str(left)}", + ] + class TestAssert_reprcompare_dataclass: def test_dataclasses(self, pytester: Pytester) -> None: From 07b380bb3a7e7debe700ad35415868f1c111dbbc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Oct 2022 03:03:45 +0000 Subject: [PATCH 383/549] build(deps): Bump django in /testing/plugins_integration Bumps [django](https://github.com/django/django) from 4.1.1 to 4.1.2. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/4.1.1...4.1.2) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 82929c87a73..8524bf2b710 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.6.1 -django==4.1.1 +django==4.1.2 pytest-asyncio==0.19.0 pytest-bdd==6.0.1 pytest-cov==4.0.0 From d8c5e8805fb2a0bb000974e448f93c38a6907e7d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Oct 2022 03:03:48 +0000 Subject: [PATCH 384/549] build(deps): Bump pytest-mock in /testing/plugins_integration Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.9.0 to 3.10.0. - [Release notes](https://github.com/pytest-dev/pytest-mock/releases) - [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.9.0...v3.10.0) --- updated-dependencies: - dependency-name: pytest-mock dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 82929c87a73..9f12e8d4997 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -6,7 +6,7 @@ pytest-cov==4.0.0 pytest-django==4.5.2 pytest-flakes==4.0.5 pytest-html==3.1.1 -pytest-mock==3.9.0 +pytest-mock==3.10.0 pytest-rerunfailures==10.2 pytest-sugar==0.9.5 pytest-trio==0.7.0 From 3de63f9a9bf9d7c638d0b4d51b25c6edf04d779f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Oct 2022 00:32:50 +0000 Subject: [PATCH 385/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 22.8.0 → 22.10.0](https://github.com/psf/black/compare/22.8.0...22.10.0) - [github.com/PyCQA/autoflake: v1.6.1 → v1.7.2](https://github.com/PyCQA/autoflake/compare/v1.6.1...v1.7.2) - [github.com/asottile/reorder_python_imports: v3.8.3 → v3.8.4](https://github.com/asottile/reorder_python_imports/compare/v3.8.3...v3.8.4) - [github.com/asottile/pyupgrade: v2.38.2 → v3.1.0](https://github.com/asottile/pyupgrade/compare/v2.38.2...v3.1.0) - [github.com/pre-commit/mirrors-mypy: v0.981 → v0.982](https://github.com/pre-commit/mirrors-mypy/compare/v0.981...v0.982) --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 19329cb21b8..fd359ded07f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ default_language_version: python: "3.10" repos: - repo: https://github.com/psf/black - rev: 22.8.0 + rev: 22.10.0 hooks: - id: black args: [--safe, --quiet] @@ -23,7 +23,7 @@ repos: exclude: _pytest/(debugging|hookspec).py language_version: python3 - repo: https://github.com/PyCQA/autoflake - rev: v1.6.1 + rev: v1.7.2 hooks: - id: autoflake name: autoflake @@ -39,12 +39,12 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v3.8.3 + rev: v3.8.4 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.38.2 + rev: v3.1.0 hooks: - id: pyupgrade args: [--py37-plus] @@ -58,7 +58,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.981 + rev: v0.982 hooks: - id: mypy files: ^(src/|testing/) From a9c66172d48a8c93422f1b40e803ad0506d666db Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 11 Oct 2022 08:11:15 -0300 Subject: [PATCH 386/549] Update to autoflake to 1.7.3 Fixes PyCQA/autoflake#168 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fd359ded07f..ce3a30f1ed9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: exclude: _pytest/(debugging|hookspec).py language_version: python3 - repo: https://github.com/PyCQA/autoflake - rev: v1.7.2 + rev: v1.7.3 hooks: - id: autoflake name: autoflake From f13f4360d3ff379144f32b4bbb4b4fa4a7a8cf23 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Wed, 12 Oct 2022 10:20:16 +0200 Subject: [PATCH 387/549] Apply suggestions from code review Co-authored-by: Ran Benita --- changelog/7792.bugfix.rst | 6 +++++- src/_pytest/mark/structures.py | 8 +++++++- testing/test_mark.py | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/changelog/7792.bugfix.rst b/changelog/7792.bugfix.rst index 00e09ebe849..8f65637896d 100644 --- a/changelog/7792.bugfix.rst +++ b/changelog/7792.bugfix.rst @@ -1 +1,5 @@ -Consider the full mro when getting marks from classes. +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 :func:`pytest.Node.iter_markers` instead. diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index 0b1daefd639..b93bf6ed9fc 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -357,9 +357,15 @@ def __call__(self, *args: object, **kwargs: object): def get_unpacked_marks( obj: Union[object, type], + *, consider_mro: bool = True, ) -> List[Mark]: - """Obtain the unpacked marks that are stored on an object.""" + """Obtain the unpacked marks that are stored on an object. + + If obj is a class and consider_mro is true, return marks applied to + this class and all of its super-classes in MRO order. If consider_mro + is false, only return marks applied directly to this class. + """ if isinstance(obj, type): if not consider_mro: mark_lists = [obj.__dict__.get("pytestmark", [])] diff --git a/testing/test_mark.py b/testing/test_mark.py index ebb70e2470b..e2d1a40c38a 100644 --- a/testing/test_mark.py +++ b/testing/test_mark.py @@ -1111,7 +1111,7 @@ def test_foo(): assert result.ret == ExitCode.USAGE_ERROR -def test_mark_mro(): +def test_mark_mro() -> None: xfail = pytest.mark.xfail @xfail("a") From c543e0c4e83f63943efb0cb06b6c94990c4eb0a9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 12 Oct 2022 08:21:16 +0000 Subject: [PATCH 388/549] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytest/mark/structures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index b93bf6ed9fc..5186c9ea3b6 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -361,7 +361,7 @@ def get_unpacked_marks( consider_mro: bool = True, ) -> List[Mark]: """Obtain the unpacked marks that are stored on an object. - + If obj is a class and consider_mro is true, return marks applied to this class and all of its super-classes in MRO order. If consider_mro is false, only return marks applied directly to this class. From 86602ce6e0683098c622e2aad530f989742bf6c9 Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Wed, 12 Oct 2022 11:51:26 -0400 Subject: [PATCH 389/549] Fix packaging example --- doc/en/explanation/goodpractices.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 5277c2ac54a..6b3af861a0d 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -22,7 +22,7 @@ The first few lines should look like this: requires = ["hatchling"] build-backend = "hatchling.build" - [metadata] + [project] name = "PACKAGENAME" where ``PACKAGENAME`` is the name of your package. From 6e7917c1a09c2174f143b34789c202a8b1a855e9 Mon Sep 17 00:00:00 2001 From: Gabriel Landau <42078554+gabriellandau@users.noreply.github.com> Date: Thu, 13 Oct 2022 18:20:46 -0400 Subject: [PATCH 390/549] Don't break into `pdb` for `raise unittest.SkipTest()` --- src/_pytest/debugging.py | 5 ++++- testing/test_debugging.py | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/_pytest/debugging.py b/src/_pytest/debugging.py index b99c3fe2d31..a3f80802cab 100644 --- a/src/_pytest/debugging.py +++ b/src/_pytest/debugging.py @@ -3,6 +3,7 @@ import functools import sys import types +import unittest from typing import Any from typing import Callable from typing import Generator @@ -293,7 +294,9 @@ def pytest_exception_interact( sys.stdout.write(out) sys.stdout.write(err) assert call.excinfo is not None - _enter_pdb(node, call.excinfo, report) + + if not isinstance(call.excinfo.value, unittest.SkipTest): + _enter_pdb(node, call.excinfo, report) def pytest_internalerror(self, excinfo: ExceptionInfo[BaseException]) -> None: tb = _postmortem_traceback(excinfo) diff --git a/testing/test_debugging.py b/testing/test_debugging.py index 08ae09658ac..6761e61a967 100644 --- a/testing/test_debugging.py +++ b/testing/test_debugging.py @@ -123,6 +123,18 @@ def test_func(): ) assert rep.skipped assert len(pdblist) == 0 + + def test_pdb_on_raise_skiptest(self, pytester, pdblist) -> None: + rep = runpdb_and_get_report( + pytester, + """ + import unittest + + raise unittest.SkipTest("This is a common way to skip an entire file.") + """, + ) + assert rep.skipped + assert len(pdblist) == 0 def test_pdb_on_BdbQuit(self, pytester, pdblist) -> None: rep = runpdb_and_get_report( From 452617686c8d08e54b9974e30c8456726f6677c5 Mon Sep 17 00:00:00 2001 From: Gabriel Landau <42078554+gabriellandau@users.noreply.github.com> Date: Fri, 14 Oct 2022 13:53:06 -0400 Subject: [PATCH 391/549] Test fix --- testing/test_debugging.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/testing/test_debugging.py b/testing/test_debugging.py index 6761e61a967..eecc1e39fd3 100644 --- a/testing/test_debugging.py +++ b/testing/test_debugging.py @@ -20,9 +20,18 @@ def pdb_env(request): pytester._monkeypatch.setenv("PDBPP_HIJACK_PDB", "0") -def runpdb_and_get_report(pytester: Pytester, source: str): +def runpdb(pytester: Pytester, source: str): p = pytester.makepyfile(source) - result = pytester.runpytest_inprocess("--pdb", p) + return pytester.runpytest_inprocess("--pdb", p) + + +def runpdb_and_get_stdout(pytester: Pytester, source: str): + result = runpdb(pytester, source) + return result.stdout.str() + + +def runpdb_and_get_report(pytester: Pytester, source: str): + result = runpdb(pytester, source) reports = result.reprec.getreports("pytest_runtest_logreport") # type: ignore[attr-defined] assert len(reports) == 3, reports # setup/call/teardown return reports[1] @@ -123,18 +132,16 @@ def test_func(): ) assert rep.skipped assert len(pdblist) == 0 - - def test_pdb_on_raise_skiptest(self, pytester, pdblist) -> None: - rep = runpdb_and_get_report( + + def test_pdb_on_top_level_raise_skiptest(self, pytester, pdblist) -> None: + stdout = runpdb_and_get_stdout( pytester, """ import unittest - raise unittest.SkipTest("This is a common way to skip an entire file.") """, ) - assert rep.skipped - assert len(pdblist) == 0 + assert "entering PDB" not in stdout, stdout def test_pdb_on_BdbQuit(self, pytester, pdblist) -> None: rep = runpdb_and_get_report( From f3d7e984abe4105c0e5c253e1b2f42be6ecae619 Mon Sep 17 00:00:00 2001 From: Gabriel Landau <42078554+gabriellandau@users.noreply.github.com> Date: Fri, 14 Oct 2022 13:58:59 -0400 Subject: [PATCH 392/549] Changelog --- changelog/10382.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/10382.bugfix.rst diff --git a/changelog/10382.bugfix.rst b/changelog/10382.bugfix.rst new file mode 100644 index 00000000000..5876a9a43c2 --- /dev/null +++ b/changelog/10382.bugfix.rst @@ -0,0 +1 @@ +Do not break into pdb when ``raise unittest.SkipTest()`` appears top-level in a file. From 0bc9ffcc8782fd126d0a9ce95ce130d1d760d2cb Mon Sep 17 00:00:00 2001 From: Gabriel Landau <42078554+gabriellandau@users.noreply.github.com> Date: Fri, 14 Oct 2022 14:01:20 -0400 Subject: [PATCH 393/549] Add Gabriel Landau to AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 55b0237ea08..7da1f8a0c57 100644 --- a/AUTHORS +++ b/AUTHORS @@ -129,6 +129,7 @@ Feng Ma Florian Bruhin Florian Dahlitz Floris Bruynooghe +Gabriel Landau Gabriel Reis Garvit Shubham Gene Wood From 2b6622fdd3678c37cdd2fc13f404546ac1a76de6 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Fri, 14 Oct 2022 16:10:21 -0500 Subject: [PATCH 394/549] :wrench: Negating --showlocals with --no-showlocals This is necessary for addopts=--showlocals where individual test runs need to not show locals. --- src/_pytest/terminal.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 9739a467a66..d967a3ee6f1 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -178,6 +178,12 @@ def pytest_addoption(parser: Parser) -> None: default=False, help="Show locals in tracebacks (disabled by default)", ) + group._addoption( + "--no-showlocals", + action="store_false", + dest="showlocals", + help="Hide locals in tracebacks (negate --showlocals passed through addopts)", + ) group._addoption( "--tb", metavar="style", From 3a8d401ac78f2c112a1d78160868f7d2ac09b4c7 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Fri, 14 Oct 2022 16:20:33 -0500 Subject: [PATCH 395/549] test(--no-showlocals): Should hide locals when addopts=--showlocals --- testing/test_terminal.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 9a8dd4d9ac9..9de9a85f093 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -998,6 +998,22 @@ def test_showlocals(): ] ) + def test_noshowlocals_addopts_override(self, pytester: Pytester) -> None: + pytester.makeini("[pytest]\naddopts=--showlocals") + p1 = pytester.makepyfile( + """ + def test_noshowlocals(): + x = 3 + y = "x" * 5000 + assert 0 + """ + ) + + # Override global --showlocals for py.test via arg + result = pytester.runpytest(p1, "--no-showlocals") + result.stdout.no_fnmatch_line("x* = 3") + result.stdout.no_fnmatch_line("y* = 'xxxxxx*") + def test_showlocals_short(self, pytester: Pytester) -> None: p1 = pytester.makepyfile( """ From 7fada7127ed3b7c281164b0364429ce88df53b1a Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Fri, 14 Oct 2022 16:37:53 -0500 Subject: [PATCH 396/549] docs(output): Note --no-show-locals --- doc/en/how-to/output.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/en/how-to/output.rst b/doc/en/how-to/output.rst index dc3a86ba29d..85081a47c61 100644 --- a/doc/en/how-to/output.rst +++ b/doc/en/how-to/output.rst @@ -12,8 +12,9 @@ Examples for modifying traceback printing: .. code-block:: bash - pytest --showlocals # show local variables in tracebacks - pytest -l # show local variables (shortcut) + pytest --showlocals # show local variables in tracebacks + pytest -l # show local variables (shortcut) + pytest --no-showlocals # hide local variables (if addopts enables them) pytest --tb=auto # (default) 'long' tracebacks for the first and last # entry, but 'short' style for the other entries From 2a33e6ab613f6de1a2cf54f0c4f39dd198729720 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Fri, 14 Oct 2022 16:33:45 -0500 Subject: [PATCH 397/549] docs: Update changelog for --no-show-locals --- changelog/10381.improvement.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/10381.improvement.rst diff --git a/changelog/10381.improvement.rst b/changelog/10381.improvement.rst new file mode 100644 index 00000000000..f979a83b132 --- /dev/null +++ b/changelog/10381.improvement.rst @@ -0,0 +1 @@ +The ``--no-showlocals`` flag has been added. This can be passed directly to tests to override ``--showlocals`` declared through ``addopts``. From 8490ff52774be7276d7ba37e3950a7370a43c3e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 03:02:02 +0000 Subject: [PATCH 398/549] build(deps): Bump pytest-twisted in /testing/plugins_integration Bumps [pytest-twisted](https://github.com/pytest-dev/pytest-twisted) from 1.13.4 to 1.14.0. - [Release notes](https://github.com/pytest-dev/pytest-twisted/releases) - [Commits](https://github.com/pytest-dev/pytest-twisted/compare/v1.13.4...v1.14.0) --- updated-dependencies: - dependency-name: pytest-twisted dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index e76231d26a0..79156133348 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -10,6 +10,6 @@ pytest-mock==3.10.0 pytest-rerunfailures==10.2 pytest-sugar==0.9.5 pytest-trio==0.7.0 -pytest-twisted==1.13.4 +pytest-twisted==1.14.0 twisted==22.8.0 pytest-xvfb==2.0.0 From c477ecd14674df7d1566a910c10f2444af6faf90 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 23:48:17 +0000 Subject: [PATCH 399/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/autoflake: v1.7.3 → v1.7.6](https://github.com/PyCQA/autoflake/compare/v1.7.3...v1.7.6) - [github.com/asottile/reorder_python_imports: v3.8.4 → v3.8.5](https://github.com/asottile/reorder_python_imports/compare/v3.8.4...v3.8.5) - [github.com/asottile/setup-cfg-fmt: v2.0.0 → v2.1.0](https://github.com/asottile/setup-cfg-fmt/compare/v2.0.0...v2.1.0) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ce3a30f1ed9..3cc1b1de718 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: exclude: _pytest/(debugging|hookspec).py language_version: python3 - repo: https://github.com/PyCQA/autoflake - rev: v1.7.3 + rev: v1.7.6 hooks: - id: autoflake name: autoflake @@ -39,7 +39,7 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v3.8.4 + rev: v3.8.5 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] @@ -49,7 +49,7 @@ repos: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.0.0 + rev: v2.1.0 hooks: - id: setup-cfg-fmt args: ["--max-py-version=3.10", "--include-version-classifiers"] From 19dda7c9bdc8ef71c792e0f77a9595bfad8d9248 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 10:10:49 -0400 Subject: [PATCH 400/549] vendor py.path and py.error --- .pre-commit-config.yaml | 1 - setup.cfg | 3 +- src/_pytest/_py/__init__.py | 0 src/_pytest/_py/error.py | 91 +++ src/_pytest/_py/path.py | 1489 +++++++++++++++++++++++++++++++++++ src/py.py | 10 + 6 files changed, 1592 insertions(+), 2 deletions(-) create mode 100644 src/_pytest/_py/__init__.py create mode 100644 src/_pytest/_py/error.py create mode 100644 src/_pytest/_py/path.py create mode 100644 src/py.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3cc1b1de718..de612d96988 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -65,7 +65,6 @@ repos: args: [] additional_dependencies: - iniconfig>=1.1.0 - - py>=1.8.2 - attrs>=19.2.0 - packaging - tomli diff --git a/setup.cfg b/setup.cfg index 38f50556c93..39ade4dff4c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -36,16 +36,17 @@ packages = _pytest _pytest._code _pytest._io + _pytest._py _pytest.assertion _pytest.config _pytest.mark pytest +py_modules = py install_requires = attrs>=19.2.0 iniconfig packaging pluggy>=0.12,<2.0 - py>=1.8.2 colorama;sys_platform=="win32" exceptiongroup>=1.0.0rc8;python_version<"3.11" importlib-metadata>=0.12;python_version<"3.8" diff --git a/src/_pytest/_py/__init__.py b/src/_pytest/_py/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/_pytest/_py/error.py b/src/_pytest/_py/error.py new file mode 100644 index 00000000000..e1e3ccd28af --- /dev/null +++ b/src/_pytest/_py/error.py @@ -0,0 +1,91 @@ +""" +create errno-specific classes for IO or os calls. + +""" +from types import ModuleType +import sys, os, errno + +class Error(EnvironmentError): + def __repr__(self): + return "%s.%s %r: %s " %(self.__class__.__module__, + self.__class__.__name__, + self.__class__.__doc__, + " ".join(map(str, self.args)), + #repr(self.args) + ) + + def __str__(self): + s = "[%s]: %s" %(self.__class__.__doc__, + " ".join(map(str, self.args)), + ) + return s + +_winerrnomap = { + 2: errno.ENOENT, + 3: errno.ENOENT, + 17: errno.EEXIST, + 18: errno.EXDEV, + 13: errno.EBUSY, # empty cd drive, but ENOMEDIUM seems unavailiable + 22: errno.ENOTDIR, + 20: errno.ENOTDIR, + 267: errno.ENOTDIR, + 5: errno.EACCES, # anything better? +} + +class ErrorMaker(ModuleType): + """ lazily provides Exception classes for each possible POSIX errno + (as defined per the 'errno' module). All such instances + subclass EnvironmentError. + """ + Error = Error + _errno2class = {} + + def __getattr__(self, name): + if name[0] == "_": + raise AttributeError(name) + eno = getattr(errno, name) + cls = self._geterrnoclass(eno) + setattr(self, name, cls) + return cls + + def _geterrnoclass(self, eno): + try: + return self._errno2class[eno] + except KeyError: + clsname = errno.errorcode.get(eno, "UnknownErrno%d" %(eno,)) + errorcls = type(Error)(clsname, (Error,), + {'__module__':'py.error', + '__doc__': os.strerror(eno)}) + self._errno2class[eno] = errorcls + return errorcls + + def checked_call(self, func, *args, **kwargs): + """ call a function and raise an errno-exception if applicable. """ + __tracebackhide__ = True + try: + return func(*args, **kwargs) + except self.Error: + raise + except (OSError, EnvironmentError): + cls, value, tb = sys.exc_info() + if not hasattr(value, 'errno'): + raise + __tracebackhide__ = False + errno = value.errno + try: + if not isinstance(value, WindowsError): + raise NameError + except NameError: + # we are not on Windows, or we got a proper OSError + cls = self._geterrnoclass(errno) + else: + try: + cls = self._geterrnoclass(_winerrnomap[errno]) + except KeyError: + raise value + raise cls("%s%r" % (func.__name__, args)) + __tracebackhide__ = True + + +error = ErrorMaker('_pytest._py.error') +sys.modules[error.__name__] = error diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py new file mode 100644 index 00000000000..e8adbf27a79 --- /dev/null +++ b/src/_pytest/_py/path.py @@ -0,0 +1,1489 @@ +""" +local path implementation. +""" +from __future__ import with_statement + +from contextlib import contextmanager +import sys, os, atexit, io, uuid +from stat import S_ISLNK, S_ISDIR, S_ISREG + +from os.path import abspath, normpath, isabs, exists, isdir, isfile, islink, dirname + +import warnings +import os +import sys +import posixpath +import fnmatch + +from . import error + +# Moved from local.py. +iswin32 = sys.platform == "win32" or (getattr(os, '_name', False) == 'nt') + +try: + # FileNotFoundError might happen in py34, and is not available with py27. + import_errors = (ImportError, FileNotFoundError) +except NameError: + import_errors = (ImportError,) + +try: + from os import fspath +except ImportError: + def fspath(path): + """ + Return the string representation of the path. + If str or bytes is passed in, it is returned unchanged. + This code comes from PEP 519, modified to support earlier versions of + python. + + This is required for python < 3.6. + """ + if isinstance(path, (str, bytes)): + return path + + # Work from the object's type to match method resolution of other magic + # methods. + path_type = type(path) + try: + return path_type.__fspath__(path) + except AttributeError: + if hasattr(path_type, '__fspath__'): + raise + try: + import pathlib + except import_errors: + pass + else: + if isinstance(path, pathlib.PurePath): + return str(path) + + raise TypeError("expected str, bytes or os.PathLike object, not " + + path_type.__name__) + +class Checkers: + _depend_on_existence = 'exists', 'link', 'dir', 'file' + + def __init__(self, path): + self.path = path + + def dir(self): + raise NotImplementedError + + def file(self): + raise NotImplementedError + + def dotfile(self): + return self.path.basename.startswith('.') + + def ext(self, arg): + if not arg.startswith('.'): + arg = '.' + arg + return self.path.ext == arg + + def exists(self): + raise NotImplementedError + + def basename(self, arg): + return self.path.basename == arg + + def basestarts(self, arg): + return self.path.basename.startswith(arg) + + def relto(self, arg): + return self.path.relto(arg) + + def fnmatch(self, arg): + return self.path.fnmatch(arg) + + def endswith(self, arg): + return str(self.path).endswith(arg) + + def _evaluate(self, kw): + for name, value in kw.items(): + invert = False + meth = None + try: + meth = getattr(self, name) + except AttributeError: + if name[:3] == 'not': + invert = True + try: + meth = getattr(self, name[3:]) + except AttributeError: + pass + if meth is None: + raise TypeError( + "no %r checker available for %r" % (name, self.path)) + try: + if py.code.getrawcode(meth).co_argcount > 1: + if (not meth(value)) ^ invert: + return False + else: + if bool(value) ^ bool(meth()) ^ invert: + return False + except (error.ENOENT, error.ENOTDIR, error.EBUSY): + # EBUSY feels not entirely correct, + # but its kind of necessary since ENOMEDIUM + # is not accessible in python + for name in self._depend_on_existence: + if name in kw: + if kw.get(name): + return False + name = 'not' + name + if name in kw: + if not kw.get(name): + return False + return True + +class NeverRaised(Exception): + pass + +class PathBase(object): + """ shared implementation for filesystem path objects.""" + Checkers = Checkers + + def __div__(self, other): + return self.join(fspath(other)) + __truediv__ = __div__ # py3k + + def basename(self): + """ basename part of path. """ + return self._getbyspec('basename')[0] + basename = property(basename, None, None, basename.__doc__) + + def dirname(self): + """ dirname part of path. """ + return self._getbyspec('dirname')[0] + dirname = property(dirname, None, None, dirname.__doc__) + + def purebasename(self): + """ pure base name of the path.""" + return self._getbyspec('purebasename')[0] + purebasename = property(purebasename, None, None, purebasename.__doc__) + + def ext(self): + """ extension of the path (including the '.').""" + return self._getbyspec('ext')[0] + ext = property(ext, None, None, ext.__doc__) + + def dirpath(self, *args, **kwargs): + """ return the directory path joined with any given path arguments. """ + return self.new(basename='').join(*args, **kwargs) + + def read_binary(self): + """ read and return a bytestring from reading the path. """ + with self.open('rb') as f: + return f.read() + + def read_text(self, encoding): + """ read and return a Unicode string from reading the path. """ + with self.open("r", encoding=encoding) as f: + return f.read() + + + def read(self, mode='r'): + """ read and return a bytestring from reading the path. """ + with self.open(mode) as f: + return f.read() + + def readlines(self, cr=1): + """ read and return a list of lines from the path. if cr is False, the +newline will be removed from the end of each line. """ + if sys.version_info < (3, ): + mode = 'rU' + else: # python 3 deprecates mode "U" in favor of "newline" option + mode = 'r' + + if not cr: + content = self.read(mode) + return content.split('\n') + else: + f = self.open(mode) + try: + return f.readlines() + finally: + f.close() + + def load(self): + """ (deprecated) return object unpickled from self.read() """ + f = self.open('rb') + try: + import pickle + return error.checked_call(pickle.load, f) + finally: + f.close() + + def move(self, target): + """ move this path to target. """ + if target.relto(self): + raise error.EINVAL( + target, + "cannot move path into a subdirectory of itself") + try: + self.rename(target) + except error.EXDEV: # invalid cross-device link + self.copy(target) + self.remove() + + def __repr__(self): + """ return a string representation of this path. """ + return repr(str(self)) + + def check(self, **kw): + """ check a path for existence and properties. + + Without arguments, return True if the path exists, otherwise False. + + valid checkers:: + + file=1 # is a file + file=0 # is not a file (may not even exist) + dir=1 # is a dir + link=1 # is a link + exists=1 # exists + + You can specify multiple checker definitions, for example:: + + path.check(file=1, link=1) # a link pointing to a file + """ + if not kw: + kw = {'exists': 1} + return self.Checkers(self)._evaluate(kw) + + def fnmatch(self, pattern): + """return true if the basename/fullname matches the glob-'pattern'. + + valid pattern characters:: + + * matches everything + ? matches any single character + [seq] matches any character in seq + [!seq] matches any char not in seq + + If the pattern contains a path-separator then the full path + is used for pattern matching and a '*' is prepended to the + pattern. + + if the pattern doesn't contain a path-separator the pattern + is only matched against the basename. + """ + return FNMatcher(pattern)(self) + + def relto(self, relpath): + """ return a string which is the relative part of the path + to the given 'relpath'. + """ + if not isinstance(relpath, (str, PathBase)): + raise TypeError("%r: not a string or path object" %(relpath,)) + strrelpath = str(relpath) + if strrelpath and strrelpath[-1] != self.sep: + strrelpath += self.sep + #assert strrelpath[-1] == self.sep + #assert strrelpath[-2] != self.sep + strself = self.strpath + if sys.platform == "win32" or getattr(os, '_name', None) == 'nt': + if os.path.normcase(strself).startswith( + os.path.normcase(strrelpath)): + return strself[len(strrelpath):] + elif strself.startswith(strrelpath): + return strself[len(strrelpath):] + return "" + + def ensure_dir(self, *args): + """ ensure the path joined with args is a directory. """ + return self.ensure(*args, **{"dir": True}) + + def bestrelpath(self, dest): + """ return a string which is a relative path from self + (assumed to be a directory) to dest such that + self.join(bestrelpath) == dest and if not such + path can be determined return dest. + """ + try: + if self == dest: + return os.curdir + base = self.common(dest) + if not base: # can be the case on windows + return str(dest) + self2base = self.relto(base) + reldest = dest.relto(base) + if self2base: + n = self2base.count(self.sep) + 1 + else: + n = 0 + l = [os.pardir] * n + if reldest: + l.append(reldest) + target = dest.sep.join(l) + return target + except AttributeError: + return str(dest) + + def exists(self): + return self.check() + + def isdir(self): + return self.check(dir=1) + + def isfile(self): + return self.check(file=1) + + def parts(self, reverse=False): + """ return a root-first list of all ancestor directories + plus the path itself. + """ + current = self + l = [self] + while 1: + last = current + current = current.dirpath() + if last == current: + break + l.append(current) + if not reverse: + l.reverse() + return l + + def common(self, other): + """ return the common part shared with the other path + or None if there is no common part. + """ + last = None + for x, y in zip(self.parts(), other.parts()): + if x != y: + return last + last = x + return last + + def __add__(self, other): + """ return new path object with 'other' added to the basename""" + return self.new(basename=self.basename+str(other)) + + def __cmp__(self, other): + """ return sort value (-1, 0, +1). """ + try: + return cmp(self.strpath, other.strpath) + except AttributeError: + return cmp(str(self), str(other)) # self.path, other.path) + + def __lt__(self, other): + try: + return self.strpath < other.strpath + except AttributeError: + return str(self) < str(other) + + def visit(self, fil=None, rec=None, ignore=NeverRaised, bf=False, sort=False): + """ yields all paths below the current one + + fil is a filter (glob pattern or callable), if not matching the + path will not be yielded, defaulting to None (everything is + returned) + + rec is a filter (glob pattern or callable) that controls whether + a node is descended, defaulting to None + + ignore is an Exception class that is ignoredwhen calling dirlist() + on any of the paths (by default, all exceptions are reported) + + bf if True will cause a breadthfirst search instead of the + default depthfirst. Default: False + + sort if True will sort entries within each directory level. + """ + for x in Visitor(fil, rec, ignore, bf, sort).gen(self): + yield x + + def _sortlist(self, res, sort): + if sort: + if hasattr(sort, '__call__'): + warnings.warn(DeprecationWarning( + "listdir(sort=callable) is deprecated and breaks on python3" + ), stacklevel=3) + res.sort(sort) + else: + res.sort() + + def samefile(self, other): + """ return True if other refers to the same stat object as self. """ + return self.strpath == str(other) + + def __fspath__(self): + return self.strpath + +class Visitor: + def __init__(self, fil, rec, ignore, bf, sort): + if isinstance(fil, py.builtin._basestring): + fil = FNMatcher(fil) + if isinstance(rec, py.builtin._basestring): + self.rec = FNMatcher(rec) + elif not hasattr(rec, '__call__') and rec: + self.rec = lambda path: True + else: + self.rec = rec + self.fil = fil + self.ignore = ignore + self.breadthfirst = bf + self.optsort = sort and sorted or (lambda x: x) + + def gen(self, path): + try: + entries = path.listdir() + except self.ignore: + return + rec = self.rec + dirs = self.optsort([p for p in entries + if p.check(dir=1) and (rec is None or rec(p))]) + if not self.breadthfirst: + for subdir in dirs: + for p in self.gen(subdir): + yield p + for p in self.optsort(entries): + if self.fil is None or self.fil(p): + yield p + if self.breadthfirst: + for subdir in dirs: + for p in self.gen(subdir): + yield p + +class FNMatcher: + def __init__(self, pattern): + self.pattern = pattern + + def __call__(self, path): + pattern = self.pattern + + if (pattern.find(path.sep) == -1 and + iswin32 and + pattern.find(posixpath.sep) != -1): + # Running on Windows, the pattern has no Windows path separators, + # and the pattern has one or more Posix path separators. Replace + # the Posix path separators with the Windows path separator. + pattern = pattern.replace(posixpath.sep, path.sep) + + if pattern.find(path.sep) == -1: + name = path.basename + else: + name = str(path) # path.strpath # XXX svn? + if not os.path.isabs(pattern): + pattern = '*' + path.sep + pattern + return fnmatch.fnmatch(name, pattern) + + +if sys.version_info > (3,0): + def map_as_list(func, iter): + return list(map(func, iter)) +else: + map_as_list = map + +ALLOW_IMPORTLIB_MODE = sys.version_info > (3,5) +if ALLOW_IMPORTLIB_MODE: + import importlib + + +class Stat(object): + def __getattr__(self, name): + return getattr(self._osstatresult, "st_" + name) + + def __init__(self, path, osstatresult): + self.path = path + self._osstatresult = osstatresult + + @property + def owner(self): + if iswin32: + raise NotImplementedError("XXX win32") + import pwd + entry = error.checked_call(pwd.getpwuid, self.uid) + return entry[0] + + @property + def group(self): + """ return group name of file. """ + if iswin32: + raise NotImplementedError("XXX win32") + import grp + entry = error.checked_call(grp.getgrgid, self.gid) + return entry[0] + + def isdir(self): + return S_ISDIR(self._osstatresult.st_mode) + + def isfile(self): + return S_ISREG(self._osstatresult.st_mode) + + def islink(self): + st = self.path.lstat() + return S_ISLNK(self._osstatresult.st_mode) + +class PosixPath(PathBase): + def chown(self, user, group, rec=0): + """ change ownership to the given user and group. + user and group may be specified by a number or + by a name. if rec is True change ownership + recursively. + """ + uid = getuserid(user) + gid = getgroupid(group) + if rec: + for x in self.visit(rec=lambda x: x.check(link=0)): + if x.check(link=0): + error.checked_call(os.chown, str(x), uid, gid) + error.checked_call(os.chown, str(self), uid, gid) + + def readlink(self): + """ return value of a symbolic link. """ + return error.checked_call(os.readlink, self.strpath) + + def mklinkto(self, oldname): + """ posix style hard link to another name. """ + error.checked_call(os.link, str(oldname), str(self)) + + def mksymlinkto(self, value, absolute=1): + """ create a symbolic link with the given value (pointing to another name). """ + if absolute: + error.checked_call(os.symlink, str(value), self.strpath) + else: + base = self.common(value) + # with posix local paths '/' is always a common base + relsource = self.__class__(value).relto(base) + reldest = self.relto(base) + n = reldest.count(self.sep) + target = self.sep.join(('..', )*n + (relsource, )) + error.checked_call(os.symlink, target, self.strpath) + +def getuserid(user): + import pwd + if not isinstance(user, int): + user = pwd.getpwnam(user)[2] + return user + +def getgroupid(group): + import grp + if not isinstance(group, int): + group = grp.getgrnam(group)[2] + return group + +FSBase = not iswin32 and PosixPath or PathBase + +class LocalPath(FSBase): + """ object oriented interface to os.path and other local filesystem + related information. + """ + class ImportMismatchError(ImportError): + """ raised on pyimport() if there is a mismatch of __file__'s""" + + sep = os.sep + class Checkers(Checkers): + def _stat(self): + try: + return self._statcache + except AttributeError: + try: + self._statcache = self.path.stat() + except error.ELOOP: + self._statcache = self.path.lstat() + return self._statcache + + def dir(self): + return S_ISDIR(self._stat().mode) + + def file(self): + return S_ISREG(self._stat().mode) + + def exists(self): + return self._stat() + + def link(self): + st = self.path.lstat() + return S_ISLNK(st.mode) + + def __init__(self, path=None, expanduser=False): + """ Initialize and return a local Path instance. + + Path can be relative to the current directory. + If path is None it defaults to the current working directory. + If expanduser is True, tilde-expansion is performed. + Note that Path instances always carry an absolute path. + Note also that passing in a local path object will simply return + the exact same path object. Use new() to get a new copy. + """ + if path is None: + self.strpath = error.checked_call(os.getcwd) + else: + try: + path = fspath(path) + except TypeError: + raise ValueError("can only pass None, Path instances " + "or non-empty strings to LocalPath") + if expanduser: + path = os.path.expanduser(path) + self.strpath = abspath(path) + + def __hash__(self): + s = self.strpath + if iswin32: + s = s.lower() + return hash(s) + + def __eq__(self, other): + s1 = fspath(self) + try: + s2 = fspath(other) + except TypeError: + return False + if iswin32: + s1 = s1.lower() + try: + s2 = s2.lower() + except AttributeError: + return False + return s1 == s2 + + def __ne__(self, other): + return not (self == other) + + def __lt__(self, other): + return fspath(self) < fspath(other) + + def __gt__(self, other): + return fspath(self) > fspath(other) + + def samefile(self, other): + """ return True if 'other' references the same file as 'self'. + """ + other = fspath(other) + if not isabs(other): + other = abspath(other) + if self == other: + return True + if not hasattr(os.path, "samefile"): + return False + return error.checked_call( + os.path.samefile, self.strpath, other) + + def remove(self, rec=1, ignore_errors=False): + """ remove a file or directory (or a directory tree if rec=1). + if ignore_errors is True, errors while removing directories will + be ignored. + """ + if self.check(dir=1, link=0): + if rec: + # force remove of readonly files on windows + if iswin32: + self.chmod(0o700, rec=1) + import shutil + error.checked_call( + shutil.rmtree, self.strpath, + ignore_errors=ignore_errors) + else: + error.checked_call(os.rmdir, self.strpath) + else: + if iswin32: + self.chmod(0o700) + error.checked_call(os.remove, self.strpath) + + def computehash(self, hashtype="md5", chunksize=524288): + """ return hexdigest of hashvalue for this file. """ + try: + try: + import hashlib as mod + except ImportError: + if hashtype == "sha1": + hashtype = "sha" + mod = __import__(hashtype) + hash = getattr(mod, hashtype)() + except (AttributeError, ImportError): + raise ValueError("Don't know how to compute %r hash" %(hashtype,)) + f = self.open('rb') + try: + while 1: + buf = f.read(chunksize) + if not buf: + return hash.hexdigest() + hash.update(buf) + finally: + f.close() + + def new(self, **kw): + """ create a modified version of this path. + the following keyword arguments modify various path parts:: + + a:/some/path/to/a/file.ext + xx drive + xxxxxxxxxxxxxxxxx dirname + xxxxxxxx basename + xxxx purebasename + xxx ext + """ + obj = object.__new__(self.__class__) + if not kw: + obj.strpath = self.strpath + return obj + drive, dirname, basename, purebasename,ext = self._getbyspec( + "drive,dirname,basename,purebasename,ext") + if 'basename' in kw: + if 'purebasename' in kw or 'ext' in kw: + raise ValueError("invalid specification %r" % kw) + else: + pb = kw.setdefault('purebasename', purebasename) + try: + ext = kw['ext'] + except KeyError: + pass + else: + if ext and not ext.startswith('.'): + ext = '.' + ext + kw['basename'] = pb + ext + + if ('dirname' in kw and not kw['dirname']): + kw['dirname'] = drive + else: + kw.setdefault('dirname', dirname) + kw.setdefault('sep', self.sep) + obj.strpath = normpath( + "%(dirname)s%(sep)s%(basename)s" % kw) + return obj + + def _getbyspec(self, spec): + """ see new for what 'spec' can be. """ + res = [] + parts = self.strpath.split(self.sep) + + args = filter(None, spec.split(',') ) + append = res.append + for name in args: + if name == 'drive': + append(parts[0]) + elif name == 'dirname': + append(self.sep.join(parts[:-1])) + else: + basename = parts[-1] + if name == 'basename': + append(basename) + else: + i = basename.rfind('.') + if i == -1: + purebasename, ext = basename, '' + else: + purebasename, ext = basename[:i], basename[i:] + if name == 'purebasename': + append(purebasename) + elif name == 'ext': + append(ext) + else: + raise ValueError("invalid part specification %r" % name) + return res + + def dirpath(self, *args, **kwargs): + """ return the directory path joined with any given path arguments. """ + if not kwargs: + path = object.__new__(self.__class__) + path.strpath = dirname(self.strpath) + if args: + path = path.join(*args) + return path + return super(LocalPath, self).dirpath(*args, **kwargs) + + def join(self, *args, **kwargs): + """ return a new path by appending all 'args' as path + components. if abs=1 is used restart from root if any + of the args is an absolute path. + """ + sep = self.sep + strargs = [fspath(arg) for arg in args] + strpath = self.strpath + if kwargs.get('abs'): + newargs = [] + for arg in reversed(strargs): + if isabs(arg): + strpath = arg + strargs = newargs + break + newargs.insert(0, arg) + # special case for when we have e.g. strpath == "/" + actual_sep = "" if strpath.endswith(sep) else sep + for arg in strargs: + arg = arg.strip(sep) + if iswin32: + # allow unix style paths even on windows. + arg = arg.strip('/') + arg = arg.replace('/', sep) + strpath = strpath + actual_sep + arg + actual_sep = sep + obj = object.__new__(self.__class__) + obj.strpath = normpath(strpath) + return obj + + def open(self, mode='r', ensure=False, encoding=None): + """ return an opened file with the given mode. + + If ensure is True, create parent directories if needed. + """ + if ensure: + self.dirpath().ensure(dir=1) + if encoding: + return error.checked_call(io.open, self.strpath, mode, encoding=encoding) + return error.checked_call(open, self.strpath, mode) + + def _fastjoin(self, name): + child = object.__new__(self.__class__) + child.strpath = self.strpath + self.sep + name + return child + + def islink(self): + return islink(self.strpath) + + def check(self, **kw): + if not kw: + return exists(self.strpath) + if len(kw) == 1: + if "dir" in kw: + return not kw["dir"] ^ isdir(self.strpath) + if "file" in kw: + return not kw["file"] ^ isfile(self.strpath) + return super(LocalPath, self).check(**kw) + + _patternchars = set("*?[" + os.path.sep) + def listdir(self, fil=None, sort=None): + """ list directory contents, possibly filter by the given fil func + and possibly sorted. + """ + if fil is None and sort is None: + names = error.checked_call(os.listdir, self.strpath) + return map_as_list(self._fastjoin, names) + if isinstance(fil, py.builtin._basestring): + if not self._patternchars.intersection(fil): + child = self._fastjoin(fil) + if exists(child.strpath): + return [child] + return [] + fil = FNMatcher(fil) + names = error.checked_call(os.listdir, self.strpath) + res = [] + for name in names: + child = self._fastjoin(name) + if fil is None or fil(child): + res.append(child) + self._sortlist(res, sort) + return res + + def size(self): + """ return size of the underlying file object """ + return self.stat().size + + def mtime(self): + """ return last modification time of the path. """ + return self.stat().mtime + + def copy(self, target, mode=False, stat=False): + """ copy path to target. + + If mode is True, will copy copy permission from path to target. + If stat is True, copy permission, last modification + time, last access time, and flags from path to target. + """ + if self.check(file=1): + if target.check(dir=1): + target = target.join(self.basename) + assert self!=target + copychunked(self, target) + if mode: + copymode(self.strpath, target.strpath) + if stat: + copystat(self, target) + else: + def rec(p): + return p.check(link=0) + for x in self.visit(rec=rec): + relpath = x.relto(self) + newx = target.join(relpath) + newx.dirpath().ensure(dir=1) + if x.check(link=1): + newx.mksymlinkto(x.readlink()) + continue + elif x.check(file=1): + copychunked(x, newx) + elif x.check(dir=1): + newx.ensure(dir=1) + if mode: + copymode(x.strpath, newx.strpath) + if stat: + copystat(x, newx) + + def rename(self, target): + """ rename this path to target. """ + target = fspath(target) + return error.checked_call(os.rename, self.strpath, target) + + def dump(self, obj, bin=1): + """ pickle object into path location""" + f = self.open('wb') + import pickle + try: + error.checked_call(pickle.dump, obj, f, bin) + finally: + f.close() + + def mkdir(self, *args): + """ create & return the directory joined with args. """ + p = self.join(*args) + error.checked_call(os.mkdir, fspath(p)) + return p + + def write_binary(self, data, ensure=False): + """ write binary data into path. If ensure is True create + missing parent directories. + """ + if ensure: + self.dirpath().ensure(dir=1) + with self.open('wb') as f: + f.write(data) + + def write_text(self, data, encoding, ensure=False): + """ write text data into path using the specified encoding. + If ensure is True create missing parent directories. + """ + if ensure: + self.dirpath().ensure(dir=1) + with self.open('w', encoding=encoding) as f: + f.write(data) + + def write(self, data, mode='w', ensure=False): + """ write data into path. If ensure is True create + missing parent directories. + """ + if ensure: + self.dirpath().ensure(dir=1) + if 'b' in mode: + if not py.builtin._isbytes(data): + raise ValueError("can only process bytes") + else: + if not py.builtin._istext(data): + if not py.builtin._isbytes(data): + data = str(data) + else: + data = py.builtin._totext(data, sys.getdefaultencoding()) + f = self.open(mode) + try: + f.write(data) + finally: + f.close() + + def _ensuredirs(self): + parent = self.dirpath() + if parent == self: + return self + if parent.check(dir=0): + parent._ensuredirs() + if self.check(dir=0): + try: + self.mkdir() + except error.EEXIST: + # race condition: file/dir created by another thread/process. + # complain if it is not a dir + if self.check(dir=0): + raise + return self + + def ensure(self, *args, **kwargs): + """ ensure that an args-joined path exists (by default as + a file). if you specify a keyword argument 'dir=True' + then the path is forced to be a directory path. + """ + p = self.join(*args) + if kwargs.get('dir', 0): + return p._ensuredirs() + else: + p.dirpath()._ensuredirs() + if not p.check(file=1): + p.open('w').close() + return p + + def stat(self, raising=True): + """ Return an os.stat() tuple. """ + if raising == True: + return Stat(self, error.checked_call(os.stat, self.strpath)) + try: + return Stat(self, os.stat(self.strpath)) + except KeyboardInterrupt: + raise + except Exception: + return None + + def lstat(self): + """ Return an os.lstat() tuple. """ + return Stat(self, error.checked_call(os.lstat, self.strpath)) + + def setmtime(self, mtime=None): + """ set modification time for the given path. if 'mtime' is None + (the default) then the file's mtime is set to current time. + + Note that the resolution for 'mtime' is platform dependent. + """ + if mtime is None: + return error.checked_call(os.utime, self.strpath, mtime) + try: + return error.checked_call(os.utime, self.strpath, (-1, mtime)) + except error.EINVAL: + return error.checked_call(os.utime, self.strpath, (self.atime(), mtime)) + + def chdir(self): + """ change directory to self and return old current directory """ + try: + old = self.__class__() + except error.ENOENT: + old = None + error.checked_call(os.chdir, self.strpath) + return old + + + @contextmanager + def as_cwd(self): + """ + Return a context manager, which changes to the path's dir during the + managed "with" context. + On __enter__ it returns the old dir, which might be ``None``. + """ + old = self.chdir() + try: + yield old + finally: + if old is not None: + old.chdir() + + def realpath(self): + """ return a new path which contains no symbolic links.""" + return self.__class__(os.path.realpath(self.strpath)) + + def atime(self): + """ return last access time of the path. """ + return self.stat().atime + + def __repr__(self): + return 'local(%r)' % self.strpath + + def __str__(self): + """ return string representation of the Path. """ + return self.strpath + + def chmod(self, mode, rec=0): + """ change permissions to the given mode. If mode is an + integer it directly encodes the os-specific modes. + if rec is True perform recursively. + """ + if not isinstance(mode, int): + raise TypeError("mode %r must be an integer" % (mode,)) + if rec: + for x in self.visit(rec=rec): + error.checked_call(os.chmod, str(x), mode) + error.checked_call(os.chmod, self.strpath, mode) + + def pypkgpath(self): + """ return the Python package path by looking for the last + directory upwards which still contains an __init__.py. + Return None if a pkgpath can not be determined. + """ + pkgpath = None + for parent in self.parts(reverse=True): + if parent.isdir(): + if not parent.join('__init__.py').exists(): + break + if not isimportable(parent.basename): + break + pkgpath = parent + return pkgpath + + def _ensuresyspath(self, ensuremode, path): + if ensuremode: + s = str(path) + if ensuremode == "append": + if s not in sys.path: + sys.path.append(s) + else: + if s != sys.path[0]: + sys.path.insert(0, s) + + def pyimport(self, modname=None, ensuresyspath=True): + """ return path as an imported python module. + + If modname is None, look for the containing package + and construct an according module name. + The module will be put/looked up in sys.modules. + if ensuresyspath is True then the root dir for importing + the file (taking __init__.py files into account) will + be prepended to sys.path if it isn't there already. + If ensuresyspath=="append" the root dir will be appended + if it isn't already contained in sys.path. + if ensuresyspath is False no modification of syspath happens. + + Special value of ensuresyspath=="importlib" is intended + purely for using in pytest, it is capable only of importing + separate .py files outside packages, e.g. for test suite + without any __init__.py file. It effectively allows having + same-named test modules in different places and offers + mild opt-in via this option. Note that it works only in + recent versions of python. + """ + if not self.check(): + raise error.ENOENT(self) + + if ensuresyspath == 'importlib': + if modname is None: + modname = self.purebasename + if not ALLOW_IMPORTLIB_MODE: + raise ImportError( + "Can't use importlib due to old version of Python") + spec = importlib.util.spec_from_file_location( + modname, str(self)) + if spec is None: + raise ImportError( + "Can't find module %s at location %s" % + (modname, str(self)) + ) + mod = importlib.util.module_from_spec(spec) + spec.loader.exec_module(mod) + return mod + + pkgpath = None + if modname is None: + pkgpath = self.pypkgpath() + if pkgpath is not None: + pkgroot = pkgpath.dirpath() + names = self.new(ext="").relto(pkgroot).split(self.sep) + if names[-1] == "__init__": + names.pop() + modname = ".".join(names) + else: + pkgroot = self.dirpath() + modname = self.purebasename + + self._ensuresyspath(ensuresyspath, pkgroot) + __import__(modname) + mod = sys.modules[modname] + if self.basename == "__init__.py": + return mod # we don't check anything as we might + # be in a namespace package ... too icky to check + modfile = mod.__file__ + if modfile[-4:] in ('.pyc', '.pyo'): + modfile = modfile[:-1] + elif modfile.endswith('$py.class'): + modfile = modfile[:-9] + '.py' + if modfile.endswith(os.path.sep + "__init__.py"): + if self.basename != "__init__.py": + modfile = modfile[:-12] + try: + issame = self.samefile(modfile) + except error.ENOENT: + issame = False + if not issame: + ignore = os.getenv('PY_IGNORE_IMPORTMISMATCH') + if ignore != '1': + raise self.ImportMismatchError(modname, modfile, self) + return mod + else: + try: + return sys.modules[modname] + except KeyError: + # we have a custom modname, do a pseudo-import + import types + mod = types.ModuleType(modname) + mod.__file__ = str(self) + sys.modules[modname] = mod + try: + py.builtin.execfile(str(self), mod.__dict__) + except: + del sys.modules[modname] + raise + return mod + + def sysexec(self, *argv, **popen_opts): + """ return stdout text from executing a system child process, + where the 'self' path points to executable. + The process is directly invoked and not through a system shell. + """ + from subprocess import Popen, PIPE + argv = map_as_list(str, argv) + popen_opts['stdout'] = popen_opts['stderr'] = PIPE + proc = Popen([str(self)] + argv, **popen_opts) + stdout, stderr = proc.communicate() + ret = proc.wait() + if py.builtin._isbytes(stdout): + stdout = py.builtin._totext(stdout, sys.getdefaultencoding()) + if ret != 0: + if py.builtin._isbytes(stderr): + stderr = py.builtin._totext(stderr, sys.getdefaultencoding()) + raise py.process.cmdexec.Error(ret, ret, str(self), + stdout, stderr,) + return stdout + + def sysfind(cls, name, checker=None, paths=None): + """ return a path object found by looking at the systems + underlying PATH specification. If the checker is not None + it will be invoked to filter matching paths. If a binary + cannot be found, None is returned + Note: This is probably not working on plain win32 systems + but may work on cygwin. + """ + if isabs(name): + p = py.path.local(name) + if p.check(file=1): + return p + else: + if paths is None: + if iswin32: + paths = os.environ['Path'].split(';') + if '' not in paths and '.' not in paths: + paths.append('.') + try: + systemroot = os.environ['SYSTEMROOT'] + except KeyError: + pass + else: + paths = [path.replace('%SystemRoot%', systemroot) + for path in paths] + else: + paths = os.environ['PATH'].split(':') + tryadd = [] + if iswin32: + tryadd += os.environ['PATHEXT'].split(os.pathsep) + tryadd.append("") + + for x in paths: + for addext in tryadd: + p = py.path.local(x).join(name, abs=True) + addext + try: + if p.check(file=1): + if checker: + if not checker(p): + continue + return p + except error.EACCES: + pass + return None + sysfind = classmethod(sysfind) + + def _gethomedir(cls): + try: + x = os.environ['HOME'] + except KeyError: + try: + x = os.environ["HOMEDRIVE"] + os.environ['HOMEPATH'] + except KeyError: + return None + return cls(x) + _gethomedir = classmethod(_gethomedir) + + # """ + # special class constructors for local filesystem paths + # """ + @classmethod + def get_temproot(cls): + """ return the system's temporary directory + (where tempfiles are usually created in) + """ + import tempfile + return py.path.local(tempfile.gettempdir()) + + @classmethod + def mkdtemp(cls, rootdir=None): + """ return a Path object pointing to a fresh new temporary directory + (which we created ourself). + """ + import tempfile + if rootdir is None: + rootdir = cls.get_temproot() + return cls(error.checked_call(tempfile.mkdtemp, dir=str(rootdir))) + + def make_numbered_dir(cls, prefix='session-', rootdir=None, keep=3, + lock_timeout=172800): # two days + """ return unique directory with a number greater than the current + maximum one. The number is assumed to start directly after prefix. + if keep is true directories with a number less than (maxnum-keep) + will be removed. If .lock files are used (lock_timeout non-zero), + algorithm is multi-process safe. + """ + if rootdir is None: + rootdir = cls.get_temproot() + + nprefix = prefix.lower() + def parse_num(path): + """ parse the number out of a path (if it matches the prefix) """ + nbasename = path.basename.lower() + if nbasename.startswith(nprefix): + try: + return int(nbasename[len(nprefix):]) + except ValueError: + pass + + def create_lockfile(path): + """ exclusively create lockfile. Throws when failed """ + mypid = os.getpid() + lockfile = path.join('.lock') + if hasattr(lockfile, 'mksymlinkto'): + lockfile.mksymlinkto(str(mypid)) + else: + fd = error.checked_call(os.open, str(lockfile), os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o644) + with os.fdopen(fd, 'w') as f: + f.write(str(mypid)) + return lockfile + + def atexit_remove_lockfile(lockfile): + """ ensure lockfile is removed at process exit """ + mypid = os.getpid() + def try_remove_lockfile(): + # in a fork() situation, only the last process should + # remove the .lock, otherwise the other processes run the + # risk of seeing their temporary dir disappear. For now + # we remove the .lock in the parent only (i.e. we assume + # that the children finish before the parent). + if os.getpid() != mypid: + return + try: + lockfile.remove() + except error.Error: + pass + atexit.register(try_remove_lockfile) + + # compute the maximum number currently in use with the prefix + lastmax = None + while True: + maxnum = -1 + for path in rootdir.listdir(): + num = parse_num(path) + if num is not None: + maxnum = max(maxnum, num) + + # make the new directory + try: + udir = rootdir.mkdir(prefix + str(maxnum+1)) + if lock_timeout: + lockfile = create_lockfile(udir) + atexit_remove_lockfile(lockfile) + except (error.EEXIST, error.ENOENT, error.EBUSY): + # race condition (1): another thread/process created the dir + # in the meantime - try again + # race condition (2): another thread/process spuriously acquired + # lock treating empty directory as candidate + # for removal - try again + # race condition (3): another thread/process tried to create the lock at + # the same time (happened in Python 3.3 on Windows) + # https://ci.appveyor.com/project/pytestbot/py/build/1.0.21/job/ffi85j4c0lqwsfwa + if lastmax == maxnum: + raise + lastmax = maxnum + continue + break + + def get_mtime(path): + """ read file modification time """ + try: + return path.lstat().mtime + except error.Error: + pass + + garbage_prefix = prefix + 'garbage-' + + def is_garbage(path): + """ check if path denotes directory scheduled for removal """ + bn = path.basename + return bn.startswith(garbage_prefix) + + # prune old directories + udir_time = get_mtime(udir) + if keep and udir_time: + for path in rootdir.listdir(): + num = parse_num(path) + if num is not None and num <= (maxnum - keep): + try: + # try acquiring lock to remove directory as exclusive user + if lock_timeout: + create_lockfile(path) + except (error.EEXIST, error.ENOENT, error.EBUSY): + path_time = get_mtime(path) + if not path_time: + # assume directory doesn't exist now + continue + if abs(udir_time - path_time) < lock_timeout: + # assume directory with lockfile exists + # and lock timeout hasn't expired yet + continue + + # path dir locked for exclusive use + # and scheduled for removal to avoid another thread/process + # treating it as a new directory or removal candidate + garbage_path = rootdir.join(garbage_prefix + str(uuid.uuid4())) + try: + path.rename(garbage_path) + garbage_path.remove(rec=1) + except KeyboardInterrupt: + raise + except: # this might be error.Error, WindowsError ... + pass + if is_garbage(path): + try: + path.remove(rec=1) + except KeyboardInterrupt: + raise + except: # this might be error.Error, WindowsError ... + pass + + # make link... + try: + username = os.environ['USER'] #linux, et al + except KeyError: + try: + username = os.environ['USERNAME'] #windows + except KeyError: + username = 'current' + + src = str(udir) + dest = src[:src.rfind('-')] + '-' + username + try: + os.unlink(dest) + except OSError: + pass + try: + os.symlink(src, dest) + except (OSError, AttributeError, NotImplementedError): + pass + + return udir + make_numbered_dir = classmethod(make_numbered_dir) + + +def copymode(src, dest): + """ copy permission from src to dst. """ + import shutil + shutil.copymode(src, dest) + + +def copystat(src, dest): + """ copy permission, last modification time, + last access time, and flags from src to dst.""" + import shutil + shutil.copystat(str(src), str(dest)) + + +def copychunked(src, dest): + chunksize = 524288 # half a meg of bytes + fsrc = src.open('rb') + try: + fdest = dest.open('wb') + try: + while 1: + buf = fsrc.read(chunksize) + if not buf: + break + fdest.write(buf) + finally: + fdest.close() + finally: + fsrc.close() + + +def isimportable(name): + if name and (name[0].isalpha() or name[0] == '_'): + name = name.replace("_", '') + return not name or name.isalnum() + +local = LocalPath diff --git a/src/py.py b/src/py.py new file mode 100644 index 00000000000..c4f049e360f --- /dev/null +++ b/src/py.py @@ -0,0 +1,10 @@ +# shim for pylib going away +# if pylib is installed this file will get skipped +# (`py/__init__.py` has higher precedence) +import sys + +import _pytest._py.error as error +import _pytest._py.path as path + +sys.modules['py.error'] = error +sys.modules['py.path'] = path From 49abbf248524b444e00571eb692e804fc855704d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 19 Oct 2022 14:19:24 +0000 Subject: [PATCH 401/549] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/_pytest/_py/error.py | 56 ++-- src/_pytest/_py/path.py | 656 +++++++++++++++++++++------------------ src/_pytest/compat.py | 1 + src/py.py | 4 +- 4 files changed, 389 insertions(+), 328 deletions(-) diff --git a/src/_pytest/_py/error.py b/src/_pytest/_py/error.py index e1e3ccd28af..c427ee5f599 100644 --- a/src/_pytest/_py/error.py +++ b/src/_pytest/_py/error.py @@ -2,41 +2,49 @@ create errno-specific classes for IO or os calls. """ +import errno +import os +import sys from types import ModuleType -import sys, os, errno + class Error(EnvironmentError): def __repr__(self): - return "%s.%s %r: %s " %(self.__class__.__module__, - self.__class__.__name__, - self.__class__.__doc__, - " ".join(map(str, self.args)), - #repr(self.args) - ) + return "{}.{} {!r}: {} ".format( + self.__class__.__module__, + self.__class__.__name__, + self.__class__.__doc__, + " ".join(map(str, self.args)), + # repr(self.args) + ) def __str__(self): - s = "[%s]: %s" %(self.__class__.__doc__, - " ".join(map(str, self.args)), - ) + s = "[{}]: {}".format( + self.__class__.__doc__, + " ".join(map(str, self.args)), + ) return s + _winerrnomap = { 2: errno.ENOENT, 3: errno.ENOENT, 17: errno.EEXIST, 18: errno.EXDEV, - 13: errno.EBUSY, # empty cd drive, but ENOMEDIUM seems unavailiable + 13: errno.EBUSY, # empty cd drive, but ENOMEDIUM seems unavailiable 22: errno.ENOTDIR, 20: errno.ENOTDIR, 267: errno.ENOTDIR, 5: errno.EACCES, # anything better? } + class ErrorMaker(ModuleType): - """ lazily provides Exception classes for each possible POSIX errno - (as defined per the 'errno' module). All such instances - subclass EnvironmentError. + """lazily provides Exception classes for each possible POSIX errno + (as defined per the 'errno' module). All such instances + subclass EnvironmentError. """ + Error = Error _errno2class = {} @@ -52,23 +60,25 @@ def _geterrnoclass(self, eno): try: return self._errno2class[eno] except KeyError: - clsname = errno.errorcode.get(eno, "UnknownErrno%d" %(eno,)) - errorcls = type(Error)(clsname, (Error,), - {'__module__':'py.error', - '__doc__': os.strerror(eno)}) + clsname = errno.errorcode.get(eno, "UnknownErrno%d" % (eno,)) + errorcls = type(Error)( + clsname, + (Error,), + {"__module__": "py.error", "__doc__": os.strerror(eno)}, + ) self._errno2class[eno] = errorcls return errorcls def checked_call(self, func, *args, **kwargs): - """ call a function and raise an errno-exception if applicable. """ + """call a function and raise an errno-exception if applicable.""" __tracebackhide__ = True try: return func(*args, **kwargs) except self.Error: raise - except (OSError, EnvironmentError): + except OSError: cls, value, tb = sys.exc_info() - if not hasattr(value, 'errno'): + if not hasattr(value, "errno"): raise __tracebackhide__ = False errno = value.errno @@ -83,9 +93,9 @@ def checked_call(self, func, *args, **kwargs): cls = self._geterrnoclass(_winerrnomap[errno]) except KeyError: raise value - raise cls("%s%r" % (func.__name__, args)) + raise cls(f"{func.__name__}{args!r}") __tracebackhide__ = True -error = ErrorMaker('_pytest._py.error') +error = ErrorMaker("_pytest._py.error") sys.modules[error.__name__] = error diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index e8adbf27a79..0bf27bcfaf4 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -1,24 +1,31 @@ """ local path implementation. """ -from __future__ import with_statement - -from contextlib import contextmanager -import sys, os, atexit, io, uuid -from stat import S_ISLNK, S_ISDIR, S_ISREG - -from os.path import abspath, normpath, isabs, exists, isdir, isfile, islink, dirname - -import warnings +import atexit +import fnmatch +import io import os -import sys import posixpath -import fnmatch +import sys +import uuid +import warnings +from contextlib import contextmanager +from os.path import abspath +from os.path import dirname +from os.path import exists +from os.path import isabs +from os.path import isdir +from os.path import isfile +from os.path import islink +from os.path import normpath +from stat import S_ISDIR +from stat import S_ISLNK +from stat import S_ISREG from . import error # Moved from local.py. -iswin32 = sys.platform == "win32" or (getattr(os, '_name', False) == 'nt') +iswin32 = sys.platform == "win32" or (getattr(os, "_name", False) == "nt") try: # FileNotFoundError might happen in py34, and is not available with py27. @@ -29,6 +36,7 @@ try: from os import fspath except ImportError: + def fspath(path): """ Return the string representation of the path. @@ -47,7 +55,7 @@ def fspath(path): try: return path_type.__fspath__(path) except AttributeError: - if hasattr(path_type, '__fspath__'): + if hasattr(path_type, "__fspath__"): raise try: import pathlib @@ -57,11 +65,13 @@ def fspath(path): if isinstance(path, pathlib.PurePath): return str(path) - raise TypeError("expected str, bytes or os.PathLike object, not " - + path_type.__name__) + raise TypeError( + "expected str, bytes or os.PathLike object, not " + path_type.__name__ + ) + class Checkers: - _depend_on_existence = 'exists', 'link', 'dir', 'file' + _depend_on_existence = "exists", "link", "dir", "file" def __init__(self, path): self.path = path @@ -73,11 +83,11 @@ def file(self): raise NotImplementedError def dotfile(self): - return self.path.basename.startswith('.') + return self.path.basename.startswith(".") def ext(self, arg): - if not arg.startswith('.'): - arg = '.' + arg + if not arg.startswith("."): + arg = "." + arg return self.path.ext == arg def exists(self): @@ -105,15 +115,14 @@ def _evaluate(self, kw): try: meth = getattr(self, name) except AttributeError: - if name[:3] == 'not': + if name[:3] == "not": invert = True try: meth = getattr(self, name[3:]) except AttributeError: pass if meth is None: - raise TypeError( - "no %r checker available for %r" % (name, self.path)) + raise TypeError(f"no {name!r} checker available for {self.path!r}") try: if py.code.getrawcode(meth).co_argcount > 1: if (not meth(value)) ^ invert: @@ -129,74 +138,78 @@ def _evaluate(self, kw): if name in kw: if kw.get(name): return False - name = 'not' + name + name = "not" + name if name in kw: if not kw.get(name): return False return True + class NeverRaised(Exception): pass -class PathBase(object): - """ shared implementation for filesystem path objects.""" + +class PathBase: + """shared implementation for filesystem path objects.""" + Checkers = Checkers def __div__(self, other): return self.join(fspath(other)) - __truediv__ = __div__ # py3k + + __truediv__ = __div__ # py3k def basename(self): - """ basename part of path. """ - return self._getbyspec('basename')[0] + """basename part of path.""" + return self._getbyspec("basename")[0] + basename = property(basename, None, None, basename.__doc__) def dirname(self): - """ dirname part of path. """ - return self._getbyspec('dirname')[0] + """dirname part of path.""" + return self._getbyspec("dirname")[0] + dirname = property(dirname, None, None, dirname.__doc__) def purebasename(self): - """ pure base name of the path.""" - return self._getbyspec('purebasename')[0] + """pure base name of the path.""" + return self._getbyspec("purebasename")[0] + purebasename = property(purebasename, None, None, purebasename.__doc__) def ext(self): - """ extension of the path (including the '.').""" - return self._getbyspec('ext')[0] + """extension of the path (including the '.').""" + return self._getbyspec("ext")[0] + ext = property(ext, None, None, ext.__doc__) def dirpath(self, *args, **kwargs): - """ return the directory path joined with any given path arguments. """ - return self.new(basename='').join(*args, **kwargs) + """return the directory path joined with any given path arguments.""" + return self.new(basename="").join(*args, **kwargs) def read_binary(self): - """ read and return a bytestring from reading the path. """ - with self.open('rb') as f: + """read and return a bytestring from reading the path.""" + with self.open("rb") as f: return f.read() def read_text(self, encoding): - """ read and return a Unicode string from reading the path. """ + """read and return a Unicode string from reading the path.""" with self.open("r", encoding=encoding) as f: return f.read() - - def read(self, mode='r'): - """ read and return a bytestring from reading the path. """ + def read(self, mode="r"): + """read and return a bytestring from reading the path.""" with self.open(mode) as f: return f.read() def readlines(self, cr=1): - """ read and return a list of lines from the path. if cr is False, the -newline will be removed from the end of each line. """ - if sys.version_info < (3, ): - mode = 'rU' - else: # python 3 deprecates mode "U" in favor of "newline" option - mode = 'r' + """read and return a list of lines from the path. if cr is False, the + newline will be removed from the end of each line.""" + mode = "r" if not cr: content = self.read(mode) - return content.split('\n') + return content.split("\n") else: f = self.open(mode) try: @@ -205,20 +218,19 @@ def readlines(self, cr=1): f.close() def load(self): - """ (deprecated) return object unpickled from self.read() """ - f = self.open('rb') + """(deprecated) return object unpickled from self.read()""" + f = self.open("rb") try: import pickle + return error.checked_call(pickle.load, f) finally: f.close() def move(self, target): - """ move this path to target. """ + """move this path to target.""" if target.relto(self): - raise error.EINVAL( - target, - "cannot move path into a subdirectory of itself") + raise error.EINVAL(target, "cannot move path into a subdirectory of itself") try: self.rename(target) except error.EXDEV: # invalid cross-device link @@ -226,28 +238,28 @@ def move(self, target): self.remove() def __repr__(self): - """ return a string representation of this path. """ + """return a string representation of this path.""" return repr(str(self)) def check(self, **kw): - """ check a path for existence and properties. + """check a path for existence and properties. - Without arguments, return True if the path exists, otherwise False. + Without arguments, return True if the path exists, otherwise False. - valid checkers:: + valid checkers:: - file=1 # is a file - file=0 # is not a file (may not even exist) - dir=1 # is a dir - link=1 # is a link - exists=1 # exists + file=1 # is a file + file=0 # is not a file (may not even exist) + dir=1 # is a dir + link=1 # is a link + exists=1 # exists - You can specify multiple checker definitions, for example:: + You can specify multiple checker definitions, for example:: - path.check(file=1, link=1) # a link pointing to a file + path.check(file=1, link=1) # a link pointing to a file """ if not kw: - kw = {'exists': 1} + kw = {"exists": 1} return self.Checkers(self)._evaluate(kw) def fnmatch(self, pattern): @@ -270,34 +282,33 @@ def fnmatch(self, pattern): return FNMatcher(pattern)(self) def relto(self, relpath): - """ return a string which is the relative part of the path + """return a string which is the relative part of the path to the given 'relpath'. """ if not isinstance(relpath, (str, PathBase)): - raise TypeError("%r: not a string or path object" %(relpath,)) + raise TypeError(f"{relpath!r}: not a string or path object") strrelpath = str(relpath) if strrelpath and strrelpath[-1] != self.sep: strrelpath += self.sep - #assert strrelpath[-1] == self.sep - #assert strrelpath[-2] != self.sep + # assert strrelpath[-1] == self.sep + # assert strrelpath[-2] != self.sep strself = self.strpath - if sys.platform == "win32" or getattr(os, '_name', None) == 'nt': - if os.path.normcase(strself).startswith( - os.path.normcase(strrelpath)): - return strself[len(strrelpath):] + if sys.platform == "win32" or getattr(os, "_name", None) == "nt": + if os.path.normcase(strself).startswith(os.path.normcase(strrelpath)): + return strself[len(strrelpath) :] elif strself.startswith(strrelpath): - return strself[len(strrelpath):] + return strself[len(strrelpath) :] return "" def ensure_dir(self, *args): - """ ensure the path joined with args is a directory. """ + """ensure the path joined with args is a directory.""" return self.ensure(*args, **{"dir": True}) def bestrelpath(self, dest): - """ return a string which is a relative path from self - (assumed to be a directory) to dest such that - self.join(bestrelpath) == dest and if not such - path can be determined return dest. + """return a string which is a relative path from self + (assumed to be a directory) to dest such that + self.join(bestrelpath) == dest and if not such + path can be determined return dest. """ try: if self == dest: @@ -329,8 +340,8 @@ def isfile(self): return self.check(file=1) def parts(self, reverse=False): - """ return a root-first list of all ancestor directories - plus the path itself. + """return a root-first list of all ancestor directories + plus the path itself. """ current = self l = [self] @@ -345,8 +356,8 @@ def parts(self, reverse=False): return l def common(self, other): - """ return the common part shared with the other path - or None if there is no common part. + """return the common part shared with the other path + or None if there is no common part. """ last = None for x, y in zip(self.parts(), other.parts()): @@ -356,15 +367,15 @@ def common(self, other): return last def __add__(self, other): - """ return new path object with 'other' added to the basename""" - return self.new(basename=self.basename+str(other)) + """return new path object with 'other' added to the basename""" + return self.new(basename=self.basename + str(other)) def __cmp__(self, other): - """ return sort value (-1, 0, +1). """ + """return sort value (-1, 0, +1).""" try: return cmp(self.strpath, other.strpath) except AttributeError: - return cmp(str(self), str(other)) # self.path, other.path) + return cmp(str(self), str(other)) # self.path, other.path) def __lt__(self, other): try: @@ -373,50 +384,53 @@ def __lt__(self, other): return str(self) < str(other) def visit(self, fil=None, rec=None, ignore=NeverRaised, bf=False, sort=False): - """ yields all paths below the current one + """yields all paths below the current one - fil is a filter (glob pattern or callable), if not matching the - path will not be yielded, defaulting to None (everything is - returned) + fil is a filter (glob pattern or callable), if not matching the + path will not be yielded, defaulting to None (everything is + returned) - rec is a filter (glob pattern or callable) that controls whether - a node is descended, defaulting to None + rec is a filter (glob pattern or callable) that controls whether + a node is descended, defaulting to None - ignore is an Exception class that is ignoredwhen calling dirlist() - on any of the paths (by default, all exceptions are reported) + ignore is an Exception class that is ignoredwhen calling dirlist() + on any of the paths (by default, all exceptions are reported) - bf if True will cause a breadthfirst search instead of the - default depthfirst. Default: False + bf if True will cause a breadthfirst search instead of the + default depthfirst. Default: False - sort if True will sort entries within each directory level. + sort if True will sort entries within each directory level. """ - for x in Visitor(fil, rec, ignore, bf, sort).gen(self): - yield x + yield from Visitor(fil, rec, ignore, bf, sort).gen(self) def _sortlist(self, res, sort): if sort: - if hasattr(sort, '__call__'): - warnings.warn(DeprecationWarning( - "listdir(sort=callable) is deprecated and breaks on python3" - ), stacklevel=3) + if hasattr(sort, "__call__"): + warnings.warn( + DeprecationWarning( + "listdir(sort=callable) is deprecated and breaks on python3" + ), + stacklevel=3, + ) res.sort(sort) else: res.sort() def samefile(self, other): - """ return True if other refers to the same stat object as self. """ + """return True if other refers to the same stat object as self.""" return self.strpath == str(other) def __fspath__(self): return self.strpath + class Visitor: def __init__(self, fil, rec, ignore, bf, sort): if isinstance(fil, py.builtin._basestring): fil = FNMatcher(fil) if isinstance(rec, py.builtin._basestring): self.rec = FNMatcher(rec) - elif not hasattr(rec, '__call__') and rec: + elif not hasattr(rec, "__call__") and rec: self.rec = lambda path: True else: self.rec = rec @@ -431,8 +445,9 @@ def gen(self, path): except self.ignore: return rec = self.rec - dirs = self.optsort([p for p in entries - if p.check(dir=1) and (rec is None or rec(p))]) + dirs = self.optsort( + [p for p in entries if p.check(dir=1) and (rec is None or rec(p))] + ) if not self.breadthfirst: for subdir in dirs: for p in self.gen(subdir): @@ -445,6 +460,7 @@ def gen(self, path): for p in self.gen(subdir): yield p + class FNMatcher: def __init__(self, pattern): self.pattern = pattern @@ -452,9 +468,11 @@ def __init__(self, pattern): def __call__(self, path): pattern = self.pattern - if (pattern.find(path.sep) == -1 and - iswin32 and - pattern.find(posixpath.sep) != -1): + if ( + pattern.find(path.sep) == -1 + and iswin32 + and pattern.find(posixpath.sep) != -1 + ): # Running on Windows, the pattern has no Windows path separators, # and the pattern has one or more Posix path separators. Replace # the Posix path separators with the Windows path separator. @@ -463,24 +481,22 @@ def __call__(self, path): if pattern.find(path.sep) == -1: name = path.basename else: - name = str(path) # path.strpath # XXX svn? + name = str(path) # path.strpath # XXX svn? if not os.path.isabs(pattern): - pattern = '*' + path.sep + pattern + pattern = "*" + path.sep + pattern return fnmatch.fnmatch(name, pattern) -if sys.version_info > (3,0): - def map_as_list(func, iter): - return list(map(func, iter)) -else: - map_as_list = map +def map_as_list(func, iter): + return list(map(func, iter)) -ALLOW_IMPORTLIB_MODE = sys.version_info > (3,5) + +ALLOW_IMPORTLIB_MODE = sys.version_info > (3, 5) if ALLOW_IMPORTLIB_MODE: import importlib -class Stat(object): +class Stat: def __getattr__(self, name): return getattr(self._osstatresult, "st_" + name) @@ -493,15 +509,17 @@ def owner(self): if iswin32: raise NotImplementedError("XXX win32") import pwd + entry = error.checked_call(pwd.getpwuid, self.uid) return entry[0] @property def group(self): - """ return group name of file. """ + """return group name of file.""" if iswin32: raise NotImplementedError("XXX win32") import grp + entry = error.checked_call(grp.getgrgid, self.gid) return entry[0] @@ -512,15 +530,16 @@ def isfile(self): return S_ISREG(self._osstatresult.st_mode) def islink(self): - st = self.path.lstat() + self.path.lstat() return S_ISLNK(self._osstatresult.st_mode) + class PosixPath(PathBase): def chown(self, user, group, rec=0): - """ change ownership to the given user and group. - user and group may be specified by a number or - by a name. if rec is True change ownership - recursively. + """change ownership to the given user and group. + user and group may be specified by a number or + by a name. if rec is True change ownership + recursively. """ uid = getuserid(user) gid = getgroupid(group) @@ -531,15 +550,15 @@ def chown(self, user, group, rec=0): error.checked_call(os.chown, str(self), uid, gid) def readlink(self): - """ return value of a symbolic link. """ + """return value of a symbolic link.""" return error.checked_call(os.readlink, self.strpath) def mklinkto(self, oldname): - """ posix style hard link to another name. """ + """posix style hard link to another name.""" error.checked_call(os.link, str(oldname), str(self)) def mksymlinkto(self, value, absolute=1): - """ create a symbolic link with the given value (pointing to another name). """ + """create a symbolic link with the given value (pointing to another name).""" if absolute: error.checked_call(os.symlink, str(value), self.strpath) else: @@ -548,31 +567,39 @@ def mksymlinkto(self, value, absolute=1): relsource = self.__class__(value).relto(base) reldest = self.relto(base) n = reldest.count(self.sep) - target = self.sep.join(('..', )*n + (relsource, )) + target = self.sep.join(("..",) * n + (relsource,)) error.checked_call(os.symlink, target, self.strpath) + def getuserid(user): import pwd + if not isinstance(user, int): user = pwd.getpwnam(user)[2] return user + def getgroupid(group): import grp + if not isinstance(group, int): group = grp.getgrnam(group)[2] return group + FSBase = not iswin32 and PosixPath or PathBase + class LocalPath(FSBase): - """ object oriented interface to os.path and other local filesystem - related information. + """object oriented interface to os.path and other local filesystem + related information. """ + class ImportMismatchError(ImportError): - """ raised on pyimport() if there is a mismatch of __file__'s""" + """raised on pyimport() if there is a mismatch of __file__'s""" sep = os.sep + class Checkers(Checkers): def _stat(self): try: @@ -598,7 +625,7 @@ def link(self): return S_ISLNK(st.mode) def __init__(self, path=None, expanduser=False): - """ Initialize and return a local Path instance. + """Initialize and return a local Path instance. Path can be relative to the current directory. If path is None it defaults to the current working directory. @@ -613,8 +640,10 @@ def __init__(self, path=None, expanduser=False): try: path = fspath(path) except TypeError: - raise ValueError("can only pass None, Path instances " - "or non-empty strings to LocalPath") + raise ValueError( + "can only pass None, Path instances " + "or non-empty strings to LocalPath" + ) if expanduser: path = os.path.expanduser(path) self.strpath = abspath(path) @@ -649,8 +678,7 @@ def __gt__(self, other): return fspath(self) > fspath(other) def samefile(self, other): - """ return True if 'other' references the same file as 'self'. - """ + """return True if 'other' references the same file as 'self'.""" other = fspath(other) if not isabs(other): other = abspath(other) @@ -658,11 +686,10 @@ def samefile(self, other): return True if not hasattr(os.path, "samefile"): return False - return error.checked_call( - os.path.samefile, self.strpath, other) + return error.checked_call(os.path.samefile, self.strpath, other) def remove(self, rec=1, ignore_errors=False): - """ remove a file or directory (or a directory tree if rec=1). + """remove a file or directory (or a directory tree if rec=1). if ignore_errors is True, errors while removing directories will be ignored. """ @@ -672,9 +699,10 @@ def remove(self, rec=1, ignore_errors=False): if iswin32: self.chmod(0o700, rec=1) import shutil + error.checked_call( - shutil.rmtree, self.strpath, - ignore_errors=ignore_errors) + shutil.rmtree, self.strpath, ignore_errors=ignore_errors + ) else: error.checked_call(os.rmdir, self.strpath) else: @@ -683,7 +711,7 @@ def remove(self, rec=1, ignore_errors=False): error.checked_call(os.remove, self.strpath) def computehash(self, hashtype="md5", chunksize=524288): - """ return hexdigest of hashvalue for this file. """ + """return hexdigest of hashvalue for this file.""" try: try: import hashlib as mod @@ -693,8 +721,8 @@ def computehash(self, hashtype="md5", chunksize=524288): mod = __import__(hashtype) hash = getattr(mod, hashtype)() except (AttributeError, ImportError): - raise ValueError("Don't know how to compute %r hash" %(hashtype,)) - f = self.open('rb') + raise ValueError(f"Don't know how to compute {hashtype!r} hash") + f = self.open("rb") try: while 1: buf = f.read(chunksize) @@ -705,94 +733,94 @@ def computehash(self, hashtype="md5", chunksize=524288): f.close() def new(self, **kw): - """ create a modified version of this path. - the following keyword arguments modify various path parts:: - - a:/some/path/to/a/file.ext - xx drive - xxxxxxxxxxxxxxxxx dirname - xxxxxxxx basename - xxxx purebasename - xxx ext + """create a modified version of this path. + the following keyword arguments modify various path parts:: + + a:/some/path/to/a/file.ext + xx drive + xxxxxxxxxxxxxxxxx dirname + xxxxxxxx basename + xxxx purebasename + xxx ext """ obj = object.__new__(self.__class__) if not kw: obj.strpath = self.strpath return obj - drive, dirname, basename, purebasename,ext = self._getbyspec( - "drive,dirname,basename,purebasename,ext") - if 'basename' in kw: - if 'purebasename' in kw or 'ext' in kw: + drive, dirname, basename, purebasename, ext = self._getbyspec( + "drive,dirname,basename,purebasename,ext" + ) + if "basename" in kw: + if "purebasename" in kw or "ext" in kw: raise ValueError("invalid specification %r" % kw) else: - pb = kw.setdefault('purebasename', purebasename) + pb = kw.setdefault("purebasename", purebasename) try: - ext = kw['ext'] + ext = kw["ext"] except KeyError: pass else: - if ext and not ext.startswith('.'): - ext = '.' + ext - kw['basename'] = pb + ext + if ext and not ext.startswith("."): + ext = "." + ext + kw["basename"] = pb + ext - if ('dirname' in kw and not kw['dirname']): - kw['dirname'] = drive + if "dirname" in kw and not kw["dirname"]: + kw["dirname"] = drive else: - kw.setdefault('dirname', dirname) - kw.setdefault('sep', self.sep) - obj.strpath = normpath( - "%(dirname)s%(sep)s%(basename)s" % kw) + kw.setdefault("dirname", dirname) + kw.setdefault("sep", self.sep) + obj.strpath = normpath("%(dirname)s%(sep)s%(basename)s" % kw) return obj def _getbyspec(self, spec): - """ see new for what 'spec' can be. """ + """see new for what 'spec' can be.""" res = [] parts = self.strpath.split(self.sep) - args = filter(None, spec.split(',') ) + args = filter(None, spec.split(",")) append = res.append for name in args: - if name == 'drive': + if name == "drive": append(parts[0]) - elif name == 'dirname': + elif name == "dirname": append(self.sep.join(parts[:-1])) else: basename = parts[-1] - if name == 'basename': + if name == "basename": append(basename) else: - i = basename.rfind('.') + i = basename.rfind(".") if i == -1: - purebasename, ext = basename, '' + purebasename, ext = basename, "" else: purebasename, ext = basename[:i], basename[i:] - if name == 'purebasename': + if name == "purebasename": append(purebasename) - elif name == 'ext': + elif name == "ext": append(ext) else: raise ValueError("invalid part specification %r" % name) return res def dirpath(self, *args, **kwargs): - """ return the directory path joined with any given path arguments. """ + """return the directory path joined with any given path arguments.""" if not kwargs: path = object.__new__(self.__class__) path.strpath = dirname(self.strpath) if args: path = path.join(*args) return path - return super(LocalPath, self).dirpath(*args, **kwargs) + return super().dirpath(*args, **kwargs) def join(self, *args, **kwargs): - """ return a new path by appending all 'args' as path + """return a new path by appending all 'args' as path components. if abs=1 is used restart from root if any of the args is an absolute path. """ sep = self.sep strargs = [fspath(arg) for arg in args] strpath = self.strpath - if kwargs.get('abs'): + if kwargs.get("abs"): newargs = [] for arg in reversed(strargs): if isabs(arg): @@ -806,16 +834,16 @@ def join(self, *args, **kwargs): arg = arg.strip(sep) if iswin32: # allow unix style paths even on windows. - arg = arg.strip('/') - arg = arg.replace('/', sep) + arg = arg.strip("/") + arg = arg.replace("/", sep) strpath = strpath + actual_sep + arg actual_sep = sep obj = object.__new__(self.__class__) obj.strpath = normpath(strpath) return obj - def open(self, mode='r', ensure=False, encoding=None): - """ return an opened file with the given mode. + def open(self, mode="r", ensure=False, encoding=None): + """return an opened file with the given mode. If ensure is True, create parent directories if needed. """ @@ -841,12 +869,13 @@ def check(self, **kw): return not kw["dir"] ^ isdir(self.strpath) if "file" in kw: return not kw["file"] ^ isfile(self.strpath) - return super(LocalPath, self).check(**kw) + return super().check(**kw) _patternchars = set("*?[" + os.path.sep) + def listdir(self, fil=None, sort=None): - """ list directory contents, possibly filter by the given fil func - and possibly sorted. + """list directory contents, possibly filter by the given fil func + and possibly sorted. """ if fil is None and sort is None: names = error.checked_call(os.listdir, self.strpath) @@ -868,32 +897,34 @@ def listdir(self, fil=None, sort=None): return res def size(self): - """ return size of the underlying file object """ + """return size of the underlying file object""" return self.stat().size def mtime(self): - """ return last modification time of the path. """ + """return last modification time of the path.""" return self.stat().mtime def copy(self, target, mode=False, stat=False): - """ copy path to target. + """copy path to target. - If mode is True, will copy copy permission from path to target. - If stat is True, copy permission, last modification - time, last access time, and flags from path to target. + If mode is True, will copy copy permission from path to target. + If stat is True, copy permission, last modification + time, last access time, and flags from path to target. """ if self.check(file=1): if target.check(dir=1): target = target.join(self.basename) - assert self!=target + assert self != target copychunked(self, target) if mode: copymode(self.strpath, target.strpath) if stat: copystat(self, target) else: + def rec(p): return p.check(link=0) + for x in self.visit(rec=rec): relpath = x.relto(self) newx = target.join(relpath) @@ -911,50 +942,51 @@ def rec(p): copystat(x, newx) def rename(self, target): - """ rename this path to target. """ + """rename this path to target.""" target = fspath(target) return error.checked_call(os.rename, self.strpath, target) def dump(self, obj, bin=1): - """ pickle object into path location""" - f = self.open('wb') + """pickle object into path location""" + f = self.open("wb") import pickle + try: error.checked_call(pickle.dump, obj, f, bin) finally: f.close() def mkdir(self, *args): - """ create & return the directory joined with args. """ + """create & return the directory joined with args.""" p = self.join(*args) error.checked_call(os.mkdir, fspath(p)) return p def write_binary(self, data, ensure=False): - """ write binary data into path. If ensure is True create + """write binary data into path. If ensure is True create missing parent directories. """ if ensure: self.dirpath().ensure(dir=1) - with self.open('wb') as f: + with self.open("wb") as f: f.write(data) def write_text(self, data, encoding, ensure=False): - """ write text data into path using the specified encoding. + """write text data into path using the specified encoding. If ensure is True create missing parent directories. """ if ensure: self.dirpath().ensure(dir=1) - with self.open('w', encoding=encoding) as f: + with self.open("w", encoding=encoding) as f: f.write(data) - def write(self, data, mode='w', ensure=False): - """ write data into path. If ensure is True create + def write(self, data, mode="w", ensure=False): + """write data into path. If ensure is True create missing parent directories. """ if ensure: self.dirpath().ensure(dir=1) - if 'b' in mode: + if "b" in mode: if not py.builtin._isbytes(data): raise ValueError("can only process bytes") else: @@ -986,21 +1018,21 @@ def _ensuredirs(self): return self def ensure(self, *args, **kwargs): - """ ensure that an args-joined path exists (by default as - a file). if you specify a keyword argument 'dir=True' - then the path is forced to be a directory path. + """ensure that an args-joined path exists (by default as + a file). if you specify a keyword argument 'dir=True' + then the path is forced to be a directory path. """ p = self.join(*args) - if kwargs.get('dir', 0): + if kwargs.get("dir", 0): return p._ensuredirs() else: p.dirpath()._ensuredirs() if not p.check(file=1): - p.open('w').close() + p.open("w").close() return p def stat(self, raising=True): - """ Return an os.stat() tuple. """ + """Return an os.stat() tuple.""" if raising == True: return Stat(self, error.checked_call(os.stat, self.strpath)) try: @@ -1011,11 +1043,11 @@ def stat(self, raising=True): return None def lstat(self): - """ Return an os.lstat() tuple. """ + """Return an os.lstat() tuple.""" return Stat(self, error.checked_call(os.lstat, self.strpath)) def setmtime(self, mtime=None): - """ set modification time for the given path. if 'mtime' is None + """set modification time for the given path. if 'mtime' is None (the default) then the file's mtime is set to current time. Note that the resolution for 'mtime' is platform dependent. @@ -1028,7 +1060,7 @@ def setmtime(self, mtime=None): return error.checked_call(os.utime, self.strpath, (self.atime(), mtime)) def chdir(self): - """ change directory to self and return old current directory """ + """change directory to self and return old current directory""" try: old = self.__class__() except error.ENOENT: @@ -1036,7 +1068,6 @@ def chdir(self): error.checked_call(os.chdir, self.strpath) return old - @contextmanager def as_cwd(self): """ @@ -1052,41 +1083,41 @@ def as_cwd(self): old.chdir() def realpath(self): - """ return a new path which contains no symbolic links.""" + """return a new path which contains no symbolic links.""" return self.__class__(os.path.realpath(self.strpath)) def atime(self): - """ return last access time of the path. """ + """return last access time of the path.""" return self.stat().atime def __repr__(self): - return 'local(%r)' % self.strpath + return "local(%r)" % self.strpath def __str__(self): - """ return string representation of the Path. """ + """return string representation of the Path.""" return self.strpath def chmod(self, mode, rec=0): - """ change permissions to the given mode. If mode is an - integer it directly encodes the os-specific modes. - if rec is True perform recursively. + """change permissions to the given mode. If mode is an + integer it directly encodes the os-specific modes. + if rec is True perform recursively. """ if not isinstance(mode, int): - raise TypeError("mode %r must be an integer" % (mode,)) + raise TypeError(f"mode {mode!r} must be an integer") if rec: for x in self.visit(rec=rec): error.checked_call(os.chmod, str(x), mode) error.checked_call(os.chmod, self.strpath, mode) def pypkgpath(self): - """ return the Python package path by looking for the last + """return the Python package path by looking for the last directory upwards which still contains an __init__.py. Return None if a pkgpath can not be determined. """ pkgpath = None for parent in self.parts(reverse=True): if parent.isdir(): - if not parent.join('__init__.py').exists(): + if not parent.join("__init__.py").exists(): break if not isimportable(parent.basename): break @@ -1104,7 +1135,7 @@ def _ensuresyspath(self, ensuremode, path): sys.path.insert(0, s) def pyimport(self, modname=None, ensuresyspath=True): - """ return path as an imported python module. + """return path as an imported python module. If modname is None, look for the containing package and construct an according module name. @@ -1127,18 +1158,15 @@ def pyimport(self, modname=None, ensuresyspath=True): if not self.check(): raise error.ENOENT(self) - if ensuresyspath == 'importlib': + if ensuresyspath == "importlib": if modname is None: modname = self.purebasename if not ALLOW_IMPORTLIB_MODE: - raise ImportError( - "Can't use importlib due to old version of Python") - spec = importlib.util.spec_from_file_location( - modname, str(self)) + raise ImportError("Can't use importlib due to old version of Python") + spec = importlib.util.spec_from_file_location(modname, str(self)) if spec is None: raise ImportError( - "Can't find module %s at location %s" % - (modname, str(self)) + f"Can't find module {modname} at location {str(self)}" ) mod = importlib.util.module_from_spec(spec) spec.loader.exec_module(mod) @@ -1161,13 +1189,13 @@ def pyimport(self, modname=None, ensuresyspath=True): __import__(modname) mod = sys.modules[modname] if self.basename == "__init__.py": - return mod # we don't check anything as we might - # be in a namespace package ... too icky to check + return mod # we don't check anything as we might + # be in a namespace package ... too icky to check modfile = mod.__file__ - if modfile[-4:] in ('.pyc', '.pyo'): + if modfile[-4:] in (".pyc", ".pyo"): modfile = modfile[:-1] - elif modfile.endswith('$py.class'): - modfile = modfile[:-9] + '.py' + elif modfile.endswith("$py.class"): + modfile = modfile[:-9] + ".py" if modfile.endswith(os.path.sep + "__init__.py"): if self.basename != "__init__.py": modfile = modfile[:-12] @@ -1176,8 +1204,8 @@ def pyimport(self, modname=None, ensuresyspath=True): except error.ENOENT: issame = False if not issame: - ignore = os.getenv('PY_IGNORE_IMPORTMISMATCH') - if ignore != '1': + ignore = os.getenv("PY_IGNORE_IMPORTMISMATCH") + if ignore != "1": raise self.ImportMismatchError(modname, modfile, self) return mod else: @@ -1186,6 +1214,7 @@ def pyimport(self, modname=None, ensuresyspath=True): except KeyError: # we have a custom modname, do a pseudo-import import types + mod = types.ModuleType(modname) mod.__file__ = str(self) sys.modules[modname] = mod @@ -1197,13 +1226,14 @@ def pyimport(self, modname=None, ensuresyspath=True): return mod def sysexec(self, *argv, **popen_opts): - """ return stdout text from executing a system child process, - where the 'self' path points to executable. - The process is directly invoked and not through a system shell. + """return stdout text from executing a system child process, + where the 'self' path points to executable. + The process is directly invoked and not through a system shell. """ from subprocess import Popen, PIPE + argv = map_as_list(str, argv) - popen_opts['stdout'] = popen_opts['stderr'] = PIPE + popen_opts["stdout"] = popen_opts["stderr"] = PIPE proc = Popen([str(self)] + argv, **popen_opts) stdout, stderr = proc.communicate() ret = proc.wait() @@ -1212,17 +1242,22 @@ def sysexec(self, *argv, **popen_opts): if ret != 0: if py.builtin._isbytes(stderr): stderr = py.builtin._totext(stderr, sys.getdefaultencoding()) - raise py.process.cmdexec.Error(ret, ret, str(self), - stdout, stderr,) + raise py.process.cmdexec.Error( + ret, + ret, + str(self), + stdout, + stderr, + ) return stdout def sysfind(cls, name, checker=None, paths=None): - """ return a path object found by looking at the systems - underlying PATH specification. If the checker is not None - it will be invoked to filter matching paths. If a binary - cannot be found, None is returned - Note: This is probably not working on plain win32 systems - but may work on cygwin. + """return a path object found by looking at the systems + underlying PATH specification. If the checker is not None + it will be invoked to filter matching paths. If a binary + cannot be found, None is returned + Note: This is probably not working on plain win32 systems + but may work on cygwin. """ if isabs(name): p = py.path.local(name) @@ -1231,21 +1266,22 @@ def sysfind(cls, name, checker=None, paths=None): else: if paths is None: if iswin32: - paths = os.environ['Path'].split(';') - if '' not in paths and '.' not in paths: - paths.append('.') + paths = os.environ["Path"].split(";") + if "" not in paths and "." not in paths: + paths.append(".") try: - systemroot = os.environ['SYSTEMROOT'] + systemroot = os.environ["SYSTEMROOT"] except KeyError: pass else: - paths = [path.replace('%SystemRoot%', systemroot) - for path in paths] + paths = [ + path.replace("%SystemRoot%", systemroot) for path in paths + ] else: - paths = os.environ['PATH'].split(':') + paths = os.environ["PATH"].split(":") tryadd = [] if iswin32: - tryadd += os.environ['PATHEXT'].split(os.pathsep) + tryadd += os.environ["PATHEXT"].split(os.pathsep) tryadd.append("") for x in paths: @@ -1260,17 +1296,19 @@ def sysfind(cls, name, checker=None, paths=None): except error.EACCES: pass return None + sysfind = classmethod(sysfind) def _gethomedir(cls): try: - x = os.environ['HOME'] + x = os.environ["HOME"] except KeyError: try: - x = os.environ["HOMEDRIVE"] + os.environ['HOMEPATH'] + x = os.environ["HOMEDRIVE"] + os.environ["HOMEPATH"] except KeyError: return None return cls(x) + _gethomedir = classmethod(_gethomedir) # """ @@ -1278,58 +1316,65 @@ def _gethomedir(cls): # """ @classmethod def get_temproot(cls): - """ return the system's temporary directory - (where tempfiles are usually created in) + """return the system's temporary directory + (where tempfiles are usually created in) """ import tempfile + return py.path.local(tempfile.gettempdir()) @classmethod def mkdtemp(cls, rootdir=None): - """ return a Path object pointing to a fresh new temporary directory - (which we created ourself). + """return a Path object pointing to a fresh new temporary directory + (which we created ourself). """ import tempfile + if rootdir is None: rootdir = cls.get_temproot() return cls(error.checked_call(tempfile.mkdtemp, dir=str(rootdir))) - def make_numbered_dir(cls, prefix='session-', rootdir=None, keep=3, - lock_timeout=172800): # two days - """ return unique directory with a number greater than the current - maximum one. The number is assumed to start directly after prefix. - if keep is true directories with a number less than (maxnum-keep) - will be removed. If .lock files are used (lock_timeout non-zero), - algorithm is multi-process safe. + def make_numbered_dir( + cls, prefix="session-", rootdir=None, keep=3, lock_timeout=172800 + ): # two days + """return unique directory with a number greater than the current + maximum one. The number is assumed to start directly after prefix. + if keep is true directories with a number less than (maxnum-keep) + will be removed. If .lock files are used (lock_timeout non-zero), + algorithm is multi-process safe. """ if rootdir is None: rootdir = cls.get_temproot() nprefix = prefix.lower() + def parse_num(path): - """ parse the number out of a path (if it matches the prefix) """ + """parse the number out of a path (if it matches the prefix)""" nbasename = path.basename.lower() if nbasename.startswith(nprefix): try: - return int(nbasename[len(nprefix):]) + return int(nbasename[len(nprefix) :]) except ValueError: pass def create_lockfile(path): - """ exclusively create lockfile. Throws when failed """ + """exclusively create lockfile. Throws when failed""" mypid = os.getpid() - lockfile = path.join('.lock') - if hasattr(lockfile, 'mksymlinkto'): + lockfile = path.join(".lock") + if hasattr(lockfile, "mksymlinkto"): lockfile.mksymlinkto(str(mypid)) else: - fd = error.checked_call(os.open, str(lockfile), os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o644) - with os.fdopen(fd, 'w') as f: + fd = error.checked_call( + os.open, str(lockfile), os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o644 + ) + with os.fdopen(fd, "w") as f: f.write(str(mypid)) return lockfile def atexit_remove_lockfile(lockfile): - """ ensure lockfile is removed at process exit """ + """ensure lockfile is removed at process exit""" mypid = os.getpid() + def try_remove_lockfile(): # in a fork() situation, only the last process should # remove the .lock, otherwise the other processes run the @@ -1342,6 +1387,7 @@ def try_remove_lockfile(): lockfile.remove() except error.Error: pass + atexit.register(try_remove_lockfile) # compute the maximum number currently in use with the prefix @@ -1355,7 +1401,7 @@ def try_remove_lockfile(): # make the new directory try: - udir = rootdir.mkdir(prefix + str(maxnum+1)) + udir = rootdir.mkdir(prefix + str(maxnum + 1)) if lock_timeout: lockfile = create_lockfile(udir) atexit_remove_lockfile(lockfile) @@ -1375,16 +1421,16 @@ def try_remove_lockfile(): break def get_mtime(path): - """ read file modification time """ + """read file modification time""" try: return path.lstat().mtime except error.Error: pass - garbage_prefix = prefix + 'garbage-' + garbage_prefix = prefix + "garbage-" def is_garbage(path): - """ check if path denotes directory scheduled for removal """ + """check if path denotes directory scheduled for removal""" bn = path.basename return bn.startswith(garbage_prefix) @@ -1417,27 +1463,27 @@ def is_garbage(path): garbage_path.remove(rec=1) except KeyboardInterrupt: raise - except: # this might be error.Error, WindowsError ... + except: # this might be error.Error, WindowsError ... pass if is_garbage(path): try: path.remove(rec=1) except KeyboardInterrupt: raise - except: # this might be error.Error, WindowsError ... + except: # this might be error.Error, WindowsError ... pass # make link... try: - username = os.environ['USER'] #linux, et al + username = os.environ["USER"] # linux, et al except KeyError: try: - username = os.environ['USERNAME'] #windows + username = os.environ["USERNAME"] # windows except KeyError: - username = 'current' + username = "current" - src = str(udir) - dest = src[:src.rfind('-')] + '-' + username + src = str(udir) + dest = src[: src.rfind("-")] + "-" + username try: os.unlink(dest) except OSError: @@ -1448,27 +1494,30 @@ def is_garbage(path): pass return udir + make_numbered_dir = classmethod(make_numbered_dir) def copymode(src, dest): - """ copy permission from src to dst. """ + """copy permission from src to dst.""" import shutil + shutil.copymode(src, dest) def copystat(src, dest): - """ copy permission, last modification time, + """copy permission, last modification time, last access time, and flags from src to dst.""" import shutil + shutil.copystat(str(src), str(dest)) def copychunked(src, dest): chunksize = 524288 # half a meg of bytes - fsrc = src.open('rb') + fsrc = src.open("rb") try: - fdest = dest.open('wb') + fdest = dest.open("wb") try: while 1: buf = fsrc.read(chunksize) @@ -1482,8 +1531,9 @@ def copychunked(src, dest): def isimportable(name): - if name and (name[0].isalpha() or name[0] == '_'): - name = name.replace("_", '') + if name and (name[0].isalpha() or name[0] == "_"): + name = name.replace("_", "") return not name or name.isalnum() + local = LocalPath diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index fab4c31107f..211407b2374 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -18,6 +18,7 @@ from typing import Union import attr + import py # fmt: off diff --git a/src/py.py b/src/py.py index c4f049e360f..7813c9b93cd 100644 --- a/src/py.py +++ b/src/py.py @@ -6,5 +6,5 @@ import _pytest._py.error as error import _pytest._py.path as path -sys.modules['py.error'] = error -sys.modules['py.path'] = path +sys.modules["py.error"] = error +sys.modules["py.path"] = path From 349f4bffa087fa2ebddd375805914a69e8fbbb45 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 10:30:19 -0400 Subject: [PATCH 402/549] use module __getattr__ for py.error to fix doctesting --- src/_pytest/_py/error.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/_pytest/_py/error.py b/src/_pytest/_py/error.py index c427ee5f599..1f33c5aadbe 100644 --- a/src/_pytest/_py/error.py +++ b/src/_pytest/_py/error.py @@ -5,7 +5,6 @@ import errno import os import sys -from types import ModuleType class Error(EnvironmentError): @@ -39,7 +38,7 @@ def __str__(self): } -class ErrorMaker(ModuleType): +class ErrorMaker: """lazily provides Exception classes for each possible POSIX errno (as defined per the 'errno' module). All such instances subclass EnvironmentError. @@ -97,5 +96,8 @@ def checked_call(self, func, *args, **kwargs): __tracebackhide__ = True -error = ErrorMaker("_pytest._py.error") -sys.modules[error.__name__] = error +_error_maker = ErrorMaker() + + +def __getattr__(attr): + return getattr(_error_maker, attr) From 965e942dfb4f68d1e28d6388544ff81247a0a4ef Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 10:56:43 -0400 Subject: [PATCH 403/549] use getrawcode from _pytest._code --- src/_pytest/_py/path.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 0bf27bcfaf4..585edd65d64 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -109,6 +109,8 @@ def endswith(self, arg): return str(self.path).endswith(arg) def _evaluate(self, kw): + from .._code.source import getrawcode + for name, value in kw.items(): invert = False meth = None @@ -124,7 +126,7 @@ def _evaluate(self, kw): if meth is None: raise TypeError(f"no {name!r} checker available for {self.path!r}") try: - if py.code.getrawcode(meth).co_argcount > 1: + if getrawcode(meth).co_argcount > 1: if (not meth(value)) ^ invert: return False else: From a7c1fc204bc40638029a27045ad4f25beec67f5c Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 12:03:30 -0400 Subject: [PATCH 404/549] remove other py.* accesses in _pytest._py.path --- src/_pytest/_py/path.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 585edd65d64..a3c72dcbcf7 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -428,9 +428,9 @@ def __fspath__(self): class Visitor: def __init__(self, fil, rec, ignore, bf, sort): - if isinstance(fil, py.builtin._basestring): + if isinstance(fil, str): fil = FNMatcher(fil) - if isinstance(rec, py.builtin._basestring): + if isinstance(rec, str): self.rec = FNMatcher(rec) elif not hasattr(rec, "__call__") and rec: self.rec = lambda path: True @@ -882,7 +882,7 @@ def listdir(self, fil=None, sort=None): if fil is None and sort is None: names = error.checked_call(os.listdir, self.strpath) return map_as_list(self._fastjoin, names) - if isinstance(fil, py.builtin._basestring): + if isinstance(fil, str): if not self._patternchars.intersection(fil): child = self._fastjoin(fil) if exists(child.strpath): @@ -989,14 +989,14 @@ def write(self, data, mode="w", ensure=False): if ensure: self.dirpath().ensure(dir=1) if "b" in mode: - if not py.builtin._isbytes(data): + if not isinstance(data, bytes): raise ValueError("can only process bytes") else: - if not py.builtin._istext(data): - if not py.builtin._isbytes(data): + if not isinstance(data, str): + if not isinstance(data, bytes): data = str(data) else: - data = py.builtin._totext(data, sys.getdefaultencoding()) + data = data.decode(sys.getdefaultencoding()) f = self.open(mode) try: f.write(data) @@ -1221,7 +1221,8 @@ def pyimport(self, modname=None, ensuresyspath=True): mod.__file__ = str(self) sys.modules[modname] = mod try: - py.builtin.execfile(str(self), mod.__dict__) + with open(str(self), "rb") as f: + exec(f.read(), mod.__dict__) except: del sys.modules[modname] raise @@ -1239,12 +1240,12 @@ def sysexec(self, *argv, **popen_opts): proc = Popen([str(self)] + argv, **popen_opts) stdout, stderr = proc.communicate() ret = proc.wait() - if py.builtin._isbytes(stdout): - stdout = py.builtin._totext(stdout, sys.getdefaultencoding()) + if isinstance(stdout, bytes): + stdout = stdout.decode(sys.getdefaultencoding()) if ret != 0: - if py.builtin._isbytes(stderr): - stderr = py.builtin._totext(stderr, sys.getdefaultencoding()) - raise py.process.cmdexec.Error( + if isinstance(stderr, bytes): + stderr = stderr.decode(sys.getdefaultencoding()) + raise RuntimeError( ret, ret, str(self), @@ -1262,7 +1263,7 @@ def sysfind(cls, name, checker=None, paths=None): but may work on cygwin. """ if isabs(name): - p = py.path.local(name) + p = local(name) if p.check(file=1): return p else: @@ -1288,7 +1289,7 @@ def sysfind(cls, name, checker=None, paths=None): for x in paths: for addext in tryadd: - p = py.path.local(x).join(name, abs=True) + addext + p = local(x).join(name, abs=True) + addext try: if p.check(file=1): if checker: @@ -1323,7 +1324,7 @@ def get_temproot(cls): """ import tempfile - return py.path.local(tempfile.gettempdir()) + return local(tempfile.gettempdir()) @classmethod def mkdtemp(cls, rootdir=None): From 8a151774b8c3381bd03d664320574e8a70d7ffda Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 12:51:52 -0400 Subject: [PATCH 405/549] _pytest._py.path: remove fspath compat --- src/_pytest/_py/path.py | 62 +++++++---------------------------------- 1 file changed, 10 insertions(+), 52 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index a3c72dcbcf7..ccddcd38d3d 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -27,48 +27,6 @@ # Moved from local.py. iswin32 = sys.platform == "win32" or (getattr(os, "_name", False) == "nt") -try: - # FileNotFoundError might happen in py34, and is not available with py27. - import_errors = (ImportError, FileNotFoundError) -except NameError: - import_errors = (ImportError,) - -try: - from os import fspath -except ImportError: - - def fspath(path): - """ - Return the string representation of the path. - If str or bytes is passed in, it is returned unchanged. - This code comes from PEP 519, modified to support earlier versions of - python. - - This is required for python < 3.6. - """ - if isinstance(path, (str, bytes)): - return path - - # Work from the object's type to match method resolution of other magic - # methods. - path_type = type(path) - try: - return path_type.__fspath__(path) - except AttributeError: - if hasattr(path_type, "__fspath__"): - raise - try: - import pathlib - except import_errors: - pass - else: - if isinstance(path, pathlib.PurePath): - return str(path) - - raise TypeError( - "expected str, bytes or os.PathLike object, not " + path_type.__name__ - ) - class Checkers: _depend_on_existence = "exists", "link", "dir", "file" @@ -157,7 +115,7 @@ class PathBase: Checkers = Checkers def __div__(self, other): - return self.join(fspath(other)) + return self.join(os.fspath(other)) __truediv__ = __div__ # py3k @@ -640,7 +598,7 @@ def __init__(self, path=None, expanduser=False): self.strpath = error.checked_call(os.getcwd) else: try: - path = fspath(path) + path = os.fspath(path) except TypeError: raise ValueError( "can only pass None, Path instances " @@ -657,9 +615,9 @@ def __hash__(self): return hash(s) def __eq__(self, other): - s1 = fspath(self) + s1 = os.fspath(self) try: - s2 = fspath(other) + s2 = os.fspath(other) except TypeError: return False if iswin32: @@ -674,14 +632,14 @@ def __ne__(self, other): return not (self == other) def __lt__(self, other): - return fspath(self) < fspath(other) + return os.fspath(self) < os.fspath(other) def __gt__(self, other): - return fspath(self) > fspath(other) + return os.fspath(self) > os.fspath(other) def samefile(self, other): """return True if 'other' references the same file as 'self'.""" - other = fspath(other) + other = os.fspath(other) if not isabs(other): other = abspath(other) if self == other: @@ -820,7 +778,7 @@ def join(self, *args, **kwargs): of the args is an absolute path. """ sep = self.sep - strargs = [fspath(arg) for arg in args] + strargs = [os.fspath(arg) for arg in args] strpath = self.strpath if kwargs.get("abs"): newargs = [] @@ -945,7 +903,7 @@ def rec(p): def rename(self, target): """rename this path to target.""" - target = fspath(target) + target = os.fspath(target) return error.checked_call(os.rename, self.strpath, target) def dump(self, obj, bin=1): @@ -961,7 +919,7 @@ def dump(self, obj, bin=1): def mkdir(self, *args): """create & return the directory joined with args.""" p = self.join(*args) - error.checked_call(os.mkdir, fspath(p)) + error.checked_call(os.mkdir, os.fspath(p)) return p def write_binary(self, data, ensure=False): From 00e2f1c15ca2f3f54f5736cf7942129ed99fe31d Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 12:52:25 -0400 Subject: [PATCH 406/549] _pytest._py.path: remove _cmp compat --- src/_pytest/_py/path.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index ccddcd38d3d..93f5528529a 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -330,13 +330,6 @@ def __add__(self, other): """return new path object with 'other' added to the basename""" return self.new(basename=self.basename + str(other)) - def __cmp__(self, other): - """return sort value (-1, 0, +1).""" - try: - return cmp(self.strpath, other.strpath) - except AttributeError: - return cmp(str(self), str(other)) # self.path, other.path) - def __lt__(self, other): try: return self.strpath < other.strpath From 382209d9e9ea0ffa61a31dcfb1a961ebf8135b3d Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 12:53:35 -0400 Subject: [PATCH 407/549] _pytest._py.path: remove decorator compat --- src/_pytest/_py/path.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 93f5528529a..f51e574cef0 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -119,30 +119,26 @@ def __div__(self, other): __truediv__ = __div__ # py3k + @property def basename(self): """basename part of path.""" return self._getbyspec("basename")[0] - basename = property(basename, None, None, basename.__doc__) - + @property def dirname(self): """dirname part of path.""" return self._getbyspec("dirname")[0] - dirname = property(dirname, None, None, dirname.__doc__) - + @property def purebasename(self): """pure base name of the path.""" return self._getbyspec("purebasename")[0] - purebasename = property(purebasename, None, None, purebasename.__doc__) - + @property def ext(self): """extension of the path (including the '.').""" return self._getbyspec("ext")[0] - ext = property(ext, None, None, ext.__doc__) - def dirpath(self, *args, **kwargs): """return the directory path joined with any given path arguments.""" return self.new(basename="").join(*args, **kwargs) @@ -1205,6 +1201,7 @@ def sysexec(self, *argv, **popen_opts): ) return stdout + @classmethod def sysfind(cls, name, checker=None, paths=None): """return a path object found by looking at the systems underlying PATH specification. If the checker is not None @@ -1251,8 +1248,7 @@ def sysfind(cls, name, checker=None, paths=None): pass return None - sysfind = classmethod(sysfind) - + @classmethod def _gethomedir(cls): try: x = os.environ["HOME"] @@ -1263,8 +1259,6 @@ def _gethomedir(cls): return None return cls(x) - _gethomedir = classmethod(_gethomedir) - # """ # special class constructors for local filesystem paths # """ @@ -1288,6 +1282,7 @@ def mkdtemp(cls, rootdir=None): rootdir = cls.get_temproot() return cls(error.checked_call(tempfile.mkdtemp, dir=str(rootdir))) + @classmethod def make_numbered_dir( cls, prefix="session-", rootdir=None, keep=3, lock_timeout=172800 ): # two days @@ -1449,8 +1444,6 @@ def is_garbage(path): return udir - make_numbered_dir = classmethod(make_numbered_dir) - def copymode(src, dest): """copy permission from src to dst.""" From eebbfc65c908346df0ff383dff7cad046e3e8616 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 13:08:48 -0400 Subject: [PATCH 408/549] _pytest._py.error: mypy typing --- src/_pytest/_py/error.py | 58 ++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/src/_pytest/_py/error.py b/src/_pytest/_py/error.py index 1f33c5aadbe..0b8f2d535ef 100644 --- a/src/_pytest/_py/error.py +++ b/src/_pytest/_py/error.py @@ -1,14 +1,23 @@ -""" -create errno-specific classes for IO or os calls. +"""create errno-specific classes for IO or os calls.""" +from __future__ import annotations -""" import errno import os import sys +from typing import Callable +from typing import TYPE_CHECKING +from typing import TypeVar + +if TYPE_CHECKING: + from typing_extensions import ParamSpec + + P = ParamSpec("P") + +R = TypeVar("R") class Error(EnvironmentError): - def __repr__(self): + def __repr__(self) -> str: return "{}.{} {!r}: {} ".format( self.__class__.__module__, self.__class__.__name__, @@ -17,7 +26,7 @@ def __repr__(self): # repr(self.args) ) - def __str__(self): + def __str__(self) -> str: s = "[{}]: {}".format( self.__class__.__doc__, " ".join(map(str, self.args)), @@ -44,10 +53,9 @@ class ErrorMaker: subclass EnvironmentError. """ - Error = Error - _errno2class = {} + _errno2class: dict[int, type[Error]] = {} - def __getattr__(self, name): + def __getattr__(self, name: str) -> type[Error]: if name[0] == "_": raise AttributeError(name) eno = getattr(errno, name) @@ -55,12 +63,12 @@ def __getattr__(self, name): setattr(self, name, cls) return cls - def _geterrnoclass(self, eno): + def _geterrnoclass(self, eno: int) -> type[Error]: try: return self._errno2class[eno] except KeyError: clsname = errno.errorcode.get(eno, "UnknownErrno%d" % (eno,)) - errorcls = type(Error)( + errorcls = type( clsname, (Error,), {"__module__": "py.error", "__doc__": os.strerror(eno)}, @@ -68,36 +76,34 @@ def _geterrnoclass(self, eno): self._errno2class[eno] = errorcls return errorcls - def checked_call(self, func, *args, **kwargs): - """call a function and raise an errno-exception if applicable.""" + def checked_call( + self, func: Callable[P, R], *args: P.args, **kwargs: P.kwargs + ) -> R: + """Call a function and raise an errno-exception if applicable.""" __tracebackhide__ = True try: return func(*args, **kwargs) - except self.Error: + except Error: raise - except OSError: - cls, value, tb = sys.exc_info() + except OSError as value: if not hasattr(value, "errno"): raise - __tracebackhide__ = False errno = value.errno - try: - if not isinstance(value, WindowsError): - raise NameError - except NameError: - # we are not on Windows, or we got a proper OSError - cls = self._geterrnoclass(errno) - else: + if sys.platform == "win32": try: cls = self._geterrnoclass(_winerrnomap[errno]) except KeyError: raise value + else: + # we are not on Windows, or we got a proper OSError + cls = self._geterrnoclass(errno) + raise cls(f"{func.__name__}{args!r}") - __tracebackhide__ = True _error_maker = ErrorMaker() +checked_call = _error_maker.checked_call -def __getattr__(attr): - return getattr(_error_maker, attr) +def __getattr__(attr: str) -> type[Error]: + return getattr(_error_maker, attr) # type: ignore[no-any-return] From 63c4d45c591e692084ff1031875c4bb00d71c28e Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 16:58:16 -0400 Subject: [PATCH 409/549] _pytest._py.path: importlib mode always available --- src/_pytest/_py/path.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index f51e574cef0..3fc0d694be7 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -1,8 +1,11 @@ """ local path implementation. """ +from __future__ import annotations + import atexit import fnmatch +import importlib.util import io import os import posixpath @@ -440,11 +443,6 @@ def map_as_list(func, iter): return list(map(func, iter)) -ALLOW_IMPORTLIB_MODE = sys.version_info > (3, 5) -if ALLOW_IMPORTLIB_MODE: - import importlib - - class Stat: def __getattr__(self, name): return getattr(self._osstatresult, "st_" + name) @@ -1110,8 +1108,6 @@ def pyimport(self, modname=None, ensuresyspath=True): if ensuresyspath == "importlib": if modname is None: modname = self.purebasename - if not ALLOW_IMPORTLIB_MODE: - raise ImportError("Can't use importlib due to old version of Python") spec = importlib.util.spec_from_file_location(modname, str(self)) if spec is None: raise ImportError( From 73349ef3e1896f2cab0192d96126a128d22b6c62 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 17:07:43 -0400 Subject: [PATCH 410/549] _pytest._py.path: flake8 fixes --- src/_pytest/_py/path.py | 158 ++++++++++++++++++++-------------------- 1 file changed, 78 insertions(+), 80 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 3fc0d694be7..e9b50977ed8 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -1,6 +1,4 @@ -""" -local path implementation. -""" +"""local path implementation.""" from __future__ import annotations import atexit @@ -124,45 +122,45 @@ def __div__(self, other): @property def basename(self): - """basename part of path.""" + """Basename part of path.""" return self._getbyspec("basename")[0] @property def dirname(self): - """dirname part of path.""" + """Dirname part of path.""" return self._getbyspec("dirname")[0] @property def purebasename(self): - """pure base name of the path.""" + """Pure base name of the path.""" return self._getbyspec("purebasename")[0] @property def ext(self): - """extension of the path (including the '.').""" + """Extension of the path (including the '.').""" return self._getbyspec("ext")[0] def dirpath(self, *args, **kwargs): - """return the directory path joined with any given path arguments.""" + """Return the directory path joined with any given path arguments.""" return self.new(basename="").join(*args, **kwargs) def read_binary(self): - """read and return a bytestring from reading the path.""" + """Read and return a bytestring from reading the path.""" with self.open("rb") as f: return f.read() def read_text(self, encoding): - """read and return a Unicode string from reading the path.""" + """Read and return a Unicode string from reading the path.""" with self.open("r", encoding=encoding) as f: return f.read() def read(self, mode="r"): - """read and return a bytestring from reading the path.""" + """Read and return a bytestring from reading the path.""" with self.open(mode) as f: return f.read() def readlines(self, cr=1): - """read and return a list of lines from the path. if cr is False, the + """Read and return a list of lines from the path. if cr is False, the newline will be removed from the end of each line.""" mode = "r" @@ -187,7 +185,7 @@ def load(self): f.close() def move(self, target): - """move this path to target.""" + """Move this path to target.""" if target.relto(self): raise error.EINVAL(target, "cannot move path into a subdirectory of itself") try: @@ -197,11 +195,11 @@ def move(self, target): self.remove() def __repr__(self): - """return a string representation of this path.""" + """Return a string representation of this path.""" return repr(str(self)) def check(self, **kw): - """check a path for existence and properties. + """Check a path for existence and properties. Without arguments, return True if the path exists, otherwise False. @@ -222,7 +220,7 @@ def check(self, **kw): return self.Checkers(self)._evaluate(kw) def fnmatch(self, pattern): - """return true if the basename/fullname matches the glob-'pattern'. + """Return true if the basename/fullname matches the glob-'pattern'. valid pattern characters:: @@ -241,7 +239,7 @@ def fnmatch(self, pattern): return FNMatcher(pattern)(self) def relto(self, relpath): - """return a string which is the relative part of the path + """Return a string which is the relative part of the path to the given 'relpath'. """ if not isinstance(relpath, (str, PathBase)): @@ -260,11 +258,11 @@ def relto(self, relpath): return "" def ensure_dir(self, *args): - """ensure the path joined with args is a directory.""" + """Ensure the path joined with args is a directory.""" return self.ensure(*args, **{"dir": True}) def bestrelpath(self, dest): - """return a string which is a relative path from self + """Return a string which is a relative path from self (assumed to be a directory) to dest such that self.join(bestrelpath) == dest and if not such path can be determined return dest. @@ -281,10 +279,10 @@ def bestrelpath(self, dest): n = self2base.count(self.sep) + 1 else: n = 0 - l = [os.pardir] * n + lst = [os.pardir] * n if reldest: - l.append(reldest) - target = dest.sep.join(l) + lst.append(reldest) + target = dest.sep.join(lst) return target except AttributeError: return str(dest) @@ -299,23 +297,23 @@ def isfile(self): return self.check(file=1) def parts(self, reverse=False): - """return a root-first list of all ancestor directories + """Return a root-first list of all ancestor directories plus the path itself. """ current = self - l = [self] + lst = [self] while 1: last = current current = current.dirpath() if last == current: break - l.append(current) + lst.append(current) if not reverse: - l.reverse() - return l + lst.reverse() + return lst def common(self, other): - """return the common part shared with the other path + """Return the common part shared with the other path or None if there is no common part. """ last = None @@ -326,7 +324,7 @@ def common(self, other): return last def __add__(self, other): - """return new path object with 'other' added to the basename""" + """Return new path object with 'other' added to the basename""" return self.new(basename=self.basename + str(other)) def __lt__(self, other): @@ -336,7 +334,7 @@ def __lt__(self, other): return str(self) < str(other) def visit(self, fil=None, rec=None, ignore=NeverRaised, bf=False, sort=False): - """yields all paths below the current one + """Yields all paths below the current one fil is a filter (glob pattern or callable), if not matching the path will not be yielded, defaulting to None (everything is @@ -369,7 +367,7 @@ def _sortlist(self, res, sort): res.sort() def samefile(self, other): - """return True if other refers to the same stat object as self.""" + """Return True if other refers to the same stat object as self.""" return self.strpath == str(other) def __fspath__(self): @@ -462,7 +460,7 @@ def owner(self): @property def group(self): - """return group name of file.""" + """Return group name of file.""" if iswin32: raise NotImplementedError("XXX win32") import grp @@ -483,7 +481,7 @@ def islink(self): class PosixPath(PathBase): def chown(self, user, group, rec=0): - """change ownership to the given user and group. + """Change ownership to the given user and group. user and group may be specified by a number or by a name. if rec is True change ownership recursively. @@ -497,15 +495,15 @@ def chown(self, user, group, rec=0): error.checked_call(os.chown, str(self), uid, gid) def readlink(self): - """return value of a symbolic link.""" + """Return value of a symbolic link.""" return error.checked_call(os.readlink, self.strpath) def mklinkto(self, oldname): - """posix style hard link to another name.""" + """Posix style hard link to another name.""" error.checked_call(os.link, str(oldname), str(self)) def mksymlinkto(self, value, absolute=1): - """create a symbolic link with the given value (pointing to another name).""" + """Create a symbolic link with the given value (pointing to another name).""" if absolute: error.checked_call(os.symlink, str(value), self.strpath) else: @@ -538,7 +536,7 @@ def getgroupid(group): class LocalPath(FSBase): - """object oriented interface to os.path and other local filesystem + """Object oriented interface to os.path and other local filesystem related information. """ @@ -625,7 +623,7 @@ def __gt__(self, other): return os.fspath(self) > os.fspath(other) def samefile(self, other): - """return True if 'other' references the same file as 'self'.""" + """Return True if 'other' references the same file as 'self'.""" other = os.fspath(other) if not isabs(other): other = abspath(other) @@ -636,7 +634,7 @@ def samefile(self, other): return error.checked_call(os.path.samefile, self.strpath, other) def remove(self, rec=1, ignore_errors=False): - """remove a file or directory (or a directory tree if rec=1). + """Remove a file or directory (or a directory tree if rec=1). if ignore_errors is True, errors while removing directories will be ignored. """ @@ -658,7 +656,7 @@ def remove(self, rec=1, ignore_errors=False): error.checked_call(os.remove, self.strpath) def computehash(self, hashtype="md5", chunksize=524288): - """return hexdigest of hashvalue for this file.""" + """Return hexdigest of hashvalue for this file.""" try: try: import hashlib as mod @@ -680,7 +678,7 @@ def computehash(self, hashtype="md5", chunksize=524288): f.close() def new(self, **kw): - """create a modified version of this path. + """Create a modified version of this path. the following keyword arguments modify various path parts:: a:/some/path/to/a/file.ext @@ -720,7 +718,7 @@ def new(self, **kw): return obj def _getbyspec(self, spec): - """see new for what 'spec' can be.""" + """See new for what 'spec' can be.""" res = [] parts = self.strpath.split(self.sep) @@ -750,7 +748,7 @@ def _getbyspec(self, spec): return res def dirpath(self, *args, **kwargs): - """return the directory path joined with any given path arguments.""" + """Return the directory path joined with any given path arguments.""" if not kwargs: path = object.__new__(self.__class__) path.strpath = dirname(self.strpath) @@ -760,7 +758,7 @@ def dirpath(self, *args, **kwargs): return super().dirpath(*args, **kwargs) def join(self, *args, **kwargs): - """return a new path by appending all 'args' as path + """Return a new path by appending all 'args' as path components. if abs=1 is used restart from root if any of the args is an absolute path. """ @@ -790,7 +788,7 @@ def join(self, *args, **kwargs): return obj def open(self, mode="r", ensure=False, encoding=None): - """return an opened file with the given mode. + """Return an opened file with the given mode. If ensure is True, create parent directories if needed. """ @@ -821,7 +819,7 @@ def check(self, **kw): _patternchars = set("*?[" + os.path.sep) def listdir(self, fil=None, sort=None): - """list directory contents, possibly filter by the given fil func + """List directory contents, possibly filter by the given fil func and possibly sorted. """ if fil is None and sort is None: @@ -844,15 +842,15 @@ def listdir(self, fil=None, sort=None): return res def size(self): - """return size of the underlying file object""" + """Return size of the underlying file object""" return self.stat().size def mtime(self): - """return last modification time of the path.""" + """Return last modification time of the path.""" return self.stat().mtime def copy(self, target, mode=False, stat=False): - """copy path to target. + """Copy path to target. If mode is True, will copy copy permission from path to target. If stat is True, copy permission, last modification @@ -889,12 +887,12 @@ def rec(p): copystat(x, newx) def rename(self, target): - """rename this path to target.""" + """Rename this path to target.""" target = os.fspath(target) return error.checked_call(os.rename, self.strpath, target) def dump(self, obj, bin=1): - """pickle object into path location""" + """Pickle object into path location""" f = self.open("wb") import pickle @@ -904,13 +902,13 @@ def dump(self, obj, bin=1): f.close() def mkdir(self, *args): - """create & return the directory joined with args.""" + """Create & return the directory joined with args.""" p = self.join(*args) error.checked_call(os.mkdir, os.fspath(p)) return p def write_binary(self, data, ensure=False): - """write binary data into path. If ensure is True create + """Write binary data into path. If ensure is True create missing parent directories. """ if ensure: @@ -919,7 +917,7 @@ def write_binary(self, data, ensure=False): f.write(data) def write_text(self, data, encoding, ensure=False): - """write text data into path using the specified encoding. + """Write text data into path using the specified encoding. If ensure is True create missing parent directories. """ if ensure: @@ -928,7 +926,7 @@ def write_text(self, data, encoding, ensure=False): f.write(data) def write(self, data, mode="w", ensure=False): - """write data into path. If ensure is True create + """Write data into path. If ensure is True create missing parent directories. """ if ensure: @@ -965,7 +963,7 @@ def _ensuredirs(self): return self def ensure(self, *args, **kwargs): - """ensure that an args-joined path exists (by default as + """Ensure that an args-joined path exists (by default as a file). if you specify a keyword argument 'dir=True' then the path is forced to be a directory path. """ @@ -980,7 +978,7 @@ def ensure(self, *args, **kwargs): def stat(self, raising=True): """Return an os.stat() tuple.""" - if raising == True: + if raising: return Stat(self, error.checked_call(os.stat, self.strpath)) try: return Stat(self, os.stat(self.strpath)) @@ -994,7 +992,7 @@ def lstat(self): return Stat(self, error.checked_call(os.lstat, self.strpath)) def setmtime(self, mtime=None): - """set modification time for the given path. if 'mtime' is None + """Set modification time for the given path. if 'mtime' is None (the default) then the file's mtime is set to current time. Note that the resolution for 'mtime' is platform dependent. @@ -1007,7 +1005,7 @@ def setmtime(self, mtime=None): return error.checked_call(os.utime, self.strpath, (self.atime(), mtime)) def chdir(self): - """change directory to self and return old current directory""" + """Change directory to self and return old current directory""" try: old = self.__class__() except error.ENOENT: @@ -1030,22 +1028,22 @@ def as_cwd(self): old.chdir() def realpath(self): - """return a new path which contains no symbolic links.""" + """Return a new path which contains no symbolic links.""" return self.__class__(os.path.realpath(self.strpath)) def atime(self): - """return last access time of the path.""" + """Return last access time of the path.""" return self.stat().atime def __repr__(self): return "local(%r)" % self.strpath def __str__(self): - """return string representation of the Path.""" + """Return string representation of the Path.""" return self.strpath def chmod(self, mode, rec=0): - """change permissions to the given mode. If mode is an + """Change permissions to the given mode. If mode is an integer it directly encodes the os-specific modes. if rec is True perform recursively. """ @@ -1057,7 +1055,7 @@ def chmod(self, mode, rec=0): error.checked_call(os.chmod, self.strpath, mode) def pypkgpath(self): - """return the Python package path by looking for the last + """Return the Python package path by looking for the last directory upwards which still contains an __init__.py. Return None if a pkgpath can not be determined. """ @@ -1082,7 +1080,7 @@ def _ensuresyspath(self, ensuremode, path): sys.path.insert(0, s) def pyimport(self, modname=None, ensuresyspath=True): - """return path as an imported python module. + """Return path as an imported python module. If modname is None, look for the containing package and construct an according module name. @@ -1166,13 +1164,13 @@ def pyimport(self, modname=None, ensuresyspath=True): try: with open(str(self), "rb") as f: exec(f.read(), mod.__dict__) - except: + except BaseException: del sys.modules[modname] raise return mod def sysexec(self, *argv, **popen_opts): - """return stdout text from executing a system child process, + """Return stdout text from executing a system child process, where the 'self' path points to executable. The process is directly invoked and not through a system shell. """ @@ -1199,7 +1197,7 @@ def sysexec(self, *argv, **popen_opts): @classmethod def sysfind(cls, name, checker=None, paths=None): - """return a path object found by looking at the systems + """Return a path object found by looking at the systems underlying PATH specification. If the checker is not None it will be invoked to filter matching paths. If a binary cannot be found, None is returned @@ -1260,7 +1258,7 @@ def _gethomedir(cls): # """ @classmethod def get_temproot(cls): - """return the system's temporary directory + """Return the system's temporary directory (where tempfiles are usually created in) """ import tempfile @@ -1269,7 +1267,7 @@ def get_temproot(cls): @classmethod def mkdtemp(cls, rootdir=None): - """return a Path object pointing to a fresh new temporary directory + """Return a Path object pointing to a fresh new temporary directory (which we created ourself). """ import tempfile @@ -1282,7 +1280,7 @@ def mkdtemp(cls, rootdir=None): def make_numbered_dir( cls, prefix="session-", rootdir=None, keep=3, lock_timeout=172800 ): # two days - """return unique directory with a number greater than the current + """Return unique directory with a number greater than the current maximum one. The number is assumed to start directly after prefix. if keep is true directories with a number less than (maxnum-keep) will be removed. If .lock files are used (lock_timeout non-zero), @@ -1294,7 +1292,7 @@ def make_numbered_dir( nprefix = prefix.lower() def parse_num(path): - """parse the number out of a path (if it matches the prefix)""" + """Parse the number out of a path (if it matches the prefix)""" nbasename = path.basename.lower() if nbasename.startswith(nprefix): try: @@ -1303,7 +1301,7 @@ def parse_num(path): pass def create_lockfile(path): - """exclusively create lockfile. Throws when failed""" + """Exclusively create lockfile. Throws when failed""" mypid = os.getpid() lockfile = path.join(".lock") if hasattr(lockfile, "mksymlinkto"): @@ -1317,7 +1315,7 @@ def create_lockfile(path): return lockfile def atexit_remove_lockfile(lockfile): - """ensure lockfile is removed at process exit""" + """Ensure lockfile is removed at process exit""" mypid = os.getpid() def try_remove_lockfile(): @@ -1366,7 +1364,7 @@ def try_remove_lockfile(): break def get_mtime(path): - """read file modification time""" + """Read file modification time""" try: return path.lstat().mtime except error.Error: @@ -1375,7 +1373,7 @@ def get_mtime(path): garbage_prefix = prefix + "garbage-" def is_garbage(path): - """check if path denotes directory scheduled for removal""" + """Check if path denotes directory scheduled for removal""" bn = path.basename return bn.startswith(garbage_prefix) @@ -1408,14 +1406,14 @@ def is_garbage(path): garbage_path.remove(rec=1) except KeyboardInterrupt: raise - except: # this might be error.Error, WindowsError ... + except Exception: # this might be error.Error, WindowsError ... pass if is_garbage(path): try: path.remove(rec=1) except KeyboardInterrupt: raise - except: # this might be error.Error, WindowsError ... + except Exception: # this might be error.Error, WindowsError ... pass # make link... @@ -1442,14 +1440,14 @@ def is_garbage(path): def copymode(src, dest): - """copy permission from src to dst.""" + """Copy permission from src to dst.""" import shutil shutil.copymode(src, dest) def copystat(src, dest): - """copy permission, last modification time, + """Copy permission, last modification time, last access time, and flags from src to dst.""" import shutil From af078f3a96cab9fbad610bd6c20a256a5c249cf7 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 18:37:22 -0400 Subject: [PATCH 411/549] _pytest._py.path: combine Checkers classes --- src/_pytest/_py/path.py | 60 +++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 36 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index e9b50977ed8..5cca5c1471f 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -35,12 +35,6 @@ class Checkers: def __init__(self, path): self.path = path - def dir(self): - raise NotImplementedError - - def file(self): - raise NotImplementedError - def dotfile(self): return self.path.basename.startswith(".") @@ -49,9 +43,6 @@ def ext(self, arg): arg = "." + arg return self.path.ext == arg - def exists(self): - raise NotImplementedError - def basename(self, arg): return self.path.basename == arg @@ -105,6 +96,29 @@ def _evaluate(self, kw): return False return True + def _stat(self): + try: + return self._statcache + except AttributeError: + try: + self._statcache = self.path.stat() + except error.ELOOP: + self._statcache = self.path.lstat() + return self._statcache + + def dir(self): + return S_ISDIR(self._stat().mode) + + def file(self): + return S_ISREG(self._stat().mode) + + def exists(self): + return self._stat() + + def link(self): + st = self.path.lstat() + return S_ISLNK(st.mode) + class NeverRaised(Exception): pass @@ -113,8 +127,6 @@ class NeverRaised(Exception): class PathBase: """shared implementation for filesystem path objects.""" - Checkers = Checkers - def __div__(self, other): return self.join(os.fspath(other)) @@ -217,7 +229,7 @@ def check(self, **kw): """ if not kw: kw = {"exists": 1} - return self.Checkers(self)._evaluate(kw) + return Checkers(self)._evaluate(kw) def fnmatch(self, pattern): """Return true if the basename/fullname matches the glob-'pattern'. @@ -545,30 +557,6 @@ class ImportMismatchError(ImportError): sep = os.sep - class Checkers(Checkers): - def _stat(self): - try: - return self._statcache - except AttributeError: - try: - self._statcache = self.path.stat() - except error.ELOOP: - self._statcache = self.path.lstat() - return self._statcache - - def dir(self): - return S_ISDIR(self._stat().mode) - - def file(self): - return S_ISREG(self._stat().mode) - - def exists(self): - return self._stat() - - def link(self): - st = self.path.lstat() - return S_ISLNK(st.mode) - def __init__(self, path=None, expanduser=False): """Initialize and return a local Path instance. From 6660d4552140679f9bd66b8821a1550f4e39ddb6 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 18:44:36 -0400 Subject: [PATCH 412/549] _pytest._py.path: combine PosixPath into LocalPath --- src/_pytest/_py/path.py | 79 ++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 5cca5c1471f..378de6967bf 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -491,43 +491,6 @@ def islink(self): return S_ISLNK(self._osstatresult.st_mode) -class PosixPath(PathBase): - def chown(self, user, group, rec=0): - """Change ownership to the given user and group. - user and group may be specified by a number or - by a name. if rec is True change ownership - recursively. - """ - uid = getuserid(user) - gid = getgroupid(group) - if rec: - for x in self.visit(rec=lambda x: x.check(link=0)): - if x.check(link=0): - error.checked_call(os.chown, str(x), uid, gid) - error.checked_call(os.chown, str(self), uid, gid) - - def readlink(self): - """Return value of a symbolic link.""" - return error.checked_call(os.readlink, self.strpath) - - def mklinkto(self, oldname): - """Posix style hard link to another name.""" - error.checked_call(os.link, str(oldname), str(self)) - - def mksymlinkto(self, value, absolute=1): - """Create a symbolic link with the given value (pointing to another name).""" - if absolute: - error.checked_call(os.symlink, str(value), self.strpath) - else: - base = self.common(value) - # with posix local paths '/' is always a common base - relsource = self.__class__(value).relto(base) - reldest = self.relto(base) - n = reldest.count(self.sep) - target = self.sep.join(("..",) * n + (relsource,)) - error.checked_call(os.symlink, target, self.strpath) - - def getuserid(user): import pwd @@ -544,10 +507,7 @@ def getgroupid(group): return group -FSBase = not iswin32 and PosixPath or PathBase - - -class LocalPath(FSBase): +class LocalPath(PathBase): """Object oriented interface to os.path and other local filesystem related information. """ @@ -581,6 +541,43 @@ def __init__(self, path=None, expanduser=False): path = os.path.expanduser(path) self.strpath = abspath(path) + if sys.platform != "win32": + + def chown(self, user, group, rec=0): + """Change ownership to the given user and group. + user and group may be specified by a number or + by a name. if rec is True change ownership + recursively. + """ + uid = getuserid(user) + gid = getgroupid(group) + if rec: + for x in self.visit(rec=lambda x: x.check(link=0)): + if x.check(link=0): + error.checked_call(os.chown, str(x), uid, gid) + error.checked_call(os.chown, str(self), uid, gid) + + def readlink(self): + """Return value of a symbolic link.""" + return error.checked_call(os.readlink, self.strpath) + + def mklinkto(self, oldname): + """Posix style hard link to another name.""" + error.checked_call(os.link, str(oldname), str(self)) + + def mksymlinkto(self, value, absolute=1): + """Create a symbolic link with the given value (pointing to another name).""" + if absolute: + error.checked_call(os.symlink, str(value), self.strpath) + else: + base = self.common(value) + # with posix local paths '/' is always a common base + relsource = self.__class__(value).relto(base) + reldest = self.relto(base) + n = reldest.count(self.sep) + target = self.sep.join(("..",) * n + (relsource,)) + error.checked_call(os.symlink, target, self.strpath) + def __hash__(self): s = self.strpath if iswin32: From ed4c18f686282b4a7603b04cd3e9c1855366202c Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 18:50:44 -0400 Subject: [PATCH 413/549] _pytest._py.path: combine PathBase and LocalPath --- src/_pytest/_py/path.py | 449 +++++++++++++++++++--------------------- 1 file changed, 212 insertions(+), 237 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 378de6967bf..2e2189cb3cf 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -124,8 +124,197 @@ class NeverRaised(Exception): pass -class PathBase: - """shared implementation for filesystem path objects.""" +class Visitor: + def __init__(self, fil, rec, ignore, bf, sort): + if isinstance(fil, str): + fil = FNMatcher(fil) + if isinstance(rec, str): + self.rec = FNMatcher(rec) + elif not hasattr(rec, "__call__") and rec: + self.rec = lambda path: True + else: + self.rec = rec + self.fil = fil + self.ignore = ignore + self.breadthfirst = bf + self.optsort = sort and sorted or (lambda x: x) + + def gen(self, path): + try: + entries = path.listdir() + except self.ignore: + return + rec = self.rec + dirs = self.optsort( + [p for p in entries if p.check(dir=1) and (rec is None or rec(p))] + ) + if not self.breadthfirst: + for subdir in dirs: + for p in self.gen(subdir): + yield p + for p in self.optsort(entries): + if self.fil is None or self.fil(p): + yield p + if self.breadthfirst: + for subdir in dirs: + for p in self.gen(subdir): + yield p + + +class FNMatcher: + def __init__(self, pattern): + self.pattern = pattern + + def __call__(self, path): + pattern = self.pattern + + if ( + pattern.find(path.sep) == -1 + and iswin32 + and pattern.find(posixpath.sep) != -1 + ): + # Running on Windows, the pattern has no Windows path separators, + # and the pattern has one or more Posix path separators. Replace + # the Posix path separators with the Windows path separator. + pattern = pattern.replace(posixpath.sep, path.sep) + + if pattern.find(path.sep) == -1: + name = path.basename + else: + name = str(path) # path.strpath # XXX svn? + if not os.path.isabs(pattern): + pattern = "*" + path.sep + pattern + return fnmatch.fnmatch(name, pattern) + + +def map_as_list(func, iter): + return list(map(func, iter)) + + +class Stat: + def __getattr__(self, name): + return getattr(self._osstatresult, "st_" + name) + + def __init__(self, path, osstatresult): + self.path = path + self._osstatresult = osstatresult + + @property + def owner(self): + if iswin32: + raise NotImplementedError("XXX win32") + import pwd + + entry = error.checked_call(pwd.getpwuid, self.uid) + return entry[0] + + @property + def group(self): + """Return group name of file.""" + if iswin32: + raise NotImplementedError("XXX win32") + import grp + + entry = error.checked_call(grp.getgrgid, self.gid) + return entry[0] + + def isdir(self): + return S_ISDIR(self._osstatresult.st_mode) + + def isfile(self): + return S_ISREG(self._osstatresult.st_mode) + + def islink(self): + self.path.lstat() + return S_ISLNK(self._osstatresult.st_mode) + + +def getuserid(user): + import pwd + + if not isinstance(user, int): + user = pwd.getpwnam(user)[2] + return user + + +def getgroupid(group): + import grp + + if not isinstance(group, int): + group = grp.getgrnam(group)[2] + return group + + +class LocalPath: + """Object oriented interface to os.path and other local filesystem + related information. + """ + + class ImportMismatchError(ImportError): + """raised on pyimport() if there is a mismatch of __file__'s""" + + sep = os.sep + + def __init__(self, path=None, expanduser=False): + """Initialize and return a local Path instance. + + Path can be relative to the current directory. + If path is None it defaults to the current working directory. + If expanduser is True, tilde-expansion is performed. + Note that Path instances always carry an absolute path. + Note also that passing in a local path object will simply return + the exact same path object. Use new() to get a new copy. + """ + if path is None: + self.strpath = error.checked_call(os.getcwd) + else: + try: + path = os.fspath(path) + except TypeError: + raise ValueError( + "can only pass None, Path instances " + "or non-empty strings to LocalPath" + ) + if expanduser: + path = os.path.expanduser(path) + self.strpath = abspath(path) + + if sys.platform != "win32": + + def chown(self, user, group, rec=0): + """Change ownership to the given user and group. + user and group may be specified by a number or + by a name. if rec is True change ownership + recursively. + """ + uid = getuserid(user) + gid = getgroupid(group) + if rec: + for x in self.visit(rec=lambda x: x.check(link=0)): + if x.check(link=0): + error.checked_call(os.chown, str(x), uid, gid) + error.checked_call(os.chown, str(self), uid, gid) + + def readlink(self): + """Return value of a symbolic link.""" + return error.checked_call(os.readlink, self.strpath) + + def mklinkto(self, oldname): + """Posix style hard link to another name.""" + error.checked_call(os.link, str(oldname), str(self)) + + def mksymlinkto(self, value, absolute=1): + """Create a symbolic link with the given value (pointing to another name).""" + if absolute: + error.checked_call(os.symlink, str(value), self.strpath) + else: + base = self.common(value) + # with posix local paths '/' is always a common base + relsource = self.__class__(value).relto(base) + reldest = self.relto(base) + n = reldest.count(self.sep) + target = self.sep.join(("..",) * n + (relsource,)) + error.checked_call(os.symlink, target, self.strpath) def __div__(self, other): return self.join(os.fspath(other)) @@ -152,10 +341,6 @@ def ext(self): """Extension of the path (including the '.').""" return self._getbyspec("ext")[0] - def dirpath(self, *args, **kwargs): - """Return the directory path joined with any given path arguments.""" - return self.new(basename="").join(*args, **kwargs) - def read_binary(self): """Read and return a bytestring from reading the path.""" with self.open("rb") as f: @@ -206,31 +391,6 @@ def move(self, target): self.copy(target) self.remove() - def __repr__(self): - """Return a string representation of this path.""" - return repr(str(self)) - - def check(self, **kw): - """Check a path for existence and properties. - - Without arguments, return True if the path exists, otherwise False. - - valid checkers:: - - file=1 # is a file - file=0 # is not a file (may not even exist) - dir=1 # is a dir - link=1 # is a link - exists=1 # exists - - You can specify multiple checker definitions, for example:: - - path.check(file=1, link=1) # a link pointing to a file - """ - if not kw: - kw = {"exists": 1} - return Checkers(self)._evaluate(kw) - def fnmatch(self, pattern): """Return true if the basename/fullname matches the glob-'pattern'. @@ -254,7 +414,7 @@ def relto(self, relpath): """Return a string which is the relative part of the path to the given 'relpath'. """ - if not isinstance(relpath, (str, PathBase)): + if not isinstance(relpath, (str, LocalPath)): raise TypeError(f"{relpath!r}: not a string or path object") strrelpath = str(relpath) if strrelpath and strrelpath[-1] != self.sep: @@ -339,12 +499,6 @@ def __add__(self, other): """Return new path object with 'other' added to the basename""" return self.new(basename=self.basename + str(other)) - def __lt__(self, other): - try: - return self.strpath < other.strpath - except AttributeError: - return str(self) < str(other) - def visit(self, fil=None, rec=None, ignore=NeverRaised, bf=False, sort=False): """Yields all paths below the current one @@ -378,206 +532,9 @@ def _sortlist(self, res, sort): else: res.sort() - def samefile(self, other): - """Return True if other refers to the same stat object as self.""" - return self.strpath == str(other) - def __fspath__(self): return self.strpath - -class Visitor: - def __init__(self, fil, rec, ignore, bf, sort): - if isinstance(fil, str): - fil = FNMatcher(fil) - if isinstance(rec, str): - self.rec = FNMatcher(rec) - elif not hasattr(rec, "__call__") and rec: - self.rec = lambda path: True - else: - self.rec = rec - self.fil = fil - self.ignore = ignore - self.breadthfirst = bf - self.optsort = sort and sorted or (lambda x: x) - - def gen(self, path): - try: - entries = path.listdir() - except self.ignore: - return - rec = self.rec - dirs = self.optsort( - [p for p in entries if p.check(dir=1) and (rec is None or rec(p))] - ) - if not self.breadthfirst: - for subdir in dirs: - for p in self.gen(subdir): - yield p - for p in self.optsort(entries): - if self.fil is None or self.fil(p): - yield p - if self.breadthfirst: - for subdir in dirs: - for p in self.gen(subdir): - yield p - - -class FNMatcher: - def __init__(self, pattern): - self.pattern = pattern - - def __call__(self, path): - pattern = self.pattern - - if ( - pattern.find(path.sep) == -1 - and iswin32 - and pattern.find(posixpath.sep) != -1 - ): - # Running on Windows, the pattern has no Windows path separators, - # and the pattern has one or more Posix path separators. Replace - # the Posix path separators with the Windows path separator. - pattern = pattern.replace(posixpath.sep, path.sep) - - if pattern.find(path.sep) == -1: - name = path.basename - else: - name = str(path) # path.strpath # XXX svn? - if not os.path.isabs(pattern): - pattern = "*" + path.sep + pattern - return fnmatch.fnmatch(name, pattern) - - -def map_as_list(func, iter): - return list(map(func, iter)) - - -class Stat: - def __getattr__(self, name): - return getattr(self._osstatresult, "st_" + name) - - def __init__(self, path, osstatresult): - self.path = path - self._osstatresult = osstatresult - - @property - def owner(self): - if iswin32: - raise NotImplementedError("XXX win32") - import pwd - - entry = error.checked_call(pwd.getpwuid, self.uid) - return entry[0] - - @property - def group(self): - """Return group name of file.""" - if iswin32: - raise NotImplementedError("XXX win32") - import grp - - entry = error.checked_call(grp.getgrgid, self.gid) - return entry[0] - - def isdir(self): - return S_ISDIR(self._osstatresult.st_mode) - - def isfile(self): - return S_ISREG(self._osstatresult.st_mode) - - def islink(self): - self.path.lstat() - return S_ISLNK(self._osstatresult.st_mode) - - -def getuserid(user): - import pwd - - if not isinstance(user, int): - user = pwd.getpwnam(user)[2] - return user - - -def getgroupid(group): - import grp - - if not isinstance(group, int): - group = grp.getgrnam(group)[2] - return group - - -class LocalPath(PathBase): - """Object oriented interface to os.path and other local filesystem - related information. - """ - - class ImportMismatchError(ImportError): - """raised on pyimport() if there is a mismatch of __file__'s""" - - sep = os.sep - - def __init__(self, path=None, expanduser=False): - """Initialize and return a local Path instance. - - Path can be relative to the current directory. - If path is None it defaults to the current working directory. - If expanduser is True, tilde-expansion is performed. - Note that Path instances always carry an absolute path. - Note also that passing in a local path object will simply return - the exact same path object. Use new() to get a new copy. - """ - if path is None: - self.strpath = error.checked_call(os.getcwd) - else: - try: - path = os.fspath(path) - except TypeError: - raise ValueError( - "can only pass None, Path instances " - "or non-empty strings to LocalPath" - ) - if expanduser: - path = os.path.expanduser(path) - self.strpath = abspath(path) - - if sys.platform != "win32": - - def chown(self, user, group, rec=0): - """Change ownership to the given user and group. - user and group may be specified by a number or - by a name. if rec is True change ownership - recursively. - """ - uid = getuserid(user) - gid = getgroupid(group) - if rec: - for x in self.visit(rec=lambda x: x.check(link=0)): - if x.check(link=0): - error.checked_call(os.chown, str(x), uid, gid) - error.checked_call(os.chown, str(self), uid, gid) - - def readlink(self): - """Return value of a symbolic link.""" - return error.checked_call(os.readlink, self.strpath) - - def mklinkto(self, oldname): - """Posix style hard link to another name.""" - error.checked_call(os.link, str(oldname), str(self)) - - def mksymlinkto(self, value, absolute=1): - """Create a symbolic link with the given value (pointing to another name).""" - if absolute: - error.checked_call(os.symlink, str(value), self.strpath) - else: - base = self.common(value) - # with posix local paths '/' is always a common base - relsource = self.__class__(value).relto(base) - reldest = self.relto(base) - n = reldest.count(self.sep) - target = self.sep.join(("..",) * n + (relsource,)) - error.checked_call(os.symlink, target, self.strpath) - def __hash__(self): s = self.strpath if iswin32: @@ -740,7 +697,7 @@ def dirpath(self, *args, **kwargs): if args: path = path.join(*args) return path - return super().dirpath(*args, **kwargs) + return self.new(basename="").join(*args, **kwargs) def join(self, *args, **kwargs): """Return a new path by appending all 'args' as path @@ -792,6 +749,22 @@ def islink(self): return islink(self.strpath) def check(self, **kw): + """Check a path for existence and properties. + + Without arguments, return True if the path exists, otherwise False. + + valid checkers:: + + file=1 # is a file + file=0 # is not a file (may not even exist) + dir=1 # is a dir + link=1 # is a link + exists=1 # exists + + You can specify multiple checker definitions, for example:: + + path.check(file=1, link=1) # a link pointing to a file + """ if not kw: return exists(self.strpath) if len(kw) == 1: @@ -799,7 +772,9 @@ def check(self, **kw): return not kw["dir"] ^ isdir(self.strpath) if "file" in kw: return not kw["file"] ^ isfile(self.strpath) - return super().check(**kw) + if not kw: + kw = {"exists": 1} + return Checkers(self)._evaluate(kw) _patternchars = set("*?[" + os.path.sep) From 59d8f8a22324fa7e816c53c271e4096c44bd536b Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 19:26:44 -0400 Subject: [PATCH 414/549] _pytest._py.path: get mypy passing --- src/_pytest/_py/path.py | 82 +++++++++++++++++++++++++++++------------ 1 file changed, 58 insertions(+), 24 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 2e2189cb3cf..00f1515238b 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -22,9 +22,16 @@ from stat import S_ISDIR from stat import S_ISLNK from stat import S_ISREG +from typing import Any +from typing import Callable +from typing import overload +from typing import TYPE_CHECKING from . import error +if TYPE_CHECKING: + from typing import Literal + # Moved from local.py. iswin32 = sys.platform == "win32" or (getattr(os, "_name", False) == "nt") @@ -96,7 +103,9 @@ def _evaluate(self, kw): return False return True - def _stat(self): + _statcache: Stat + + def _stat(self) -> Stat: try: return self._statcache except AttributeError: @@ -129,7 +138,7 @@ def __init__(self, fil, rec, ignore, bf, sort): if isinstance(fil, str): fil = FNMatcher(fil) if isinstance(rec, str): - self.rec = FNMatcher(rec) + self.rec: Callable[[LocalPath], bool] = FNMatcher(rec) elif not hasattr(rec, "__call__") and rec: self.rec = lambda path: True else: @@ -192,7 +201,17 @@ def map_as_list(func, iter): class Stat: - def __getattr__(self, name): + if TYPE_CHECKING: + + @property + def size(self) -> int: + ... + + @property + def mtime(self) -> float: + ... + + def __getattr__(self, name: str) -> Any: return getattr(self._osstatresult, "st_" + name) def __init__(self, path, osstatresult): @@ -295,9 +314,10 @@ def chown(self, user, group, rec=0): error.checked_call(os.chown, str(x), uid, gid) error.checked_call(os.chown, str(self), uid, gid) - def readlink(self): + def readlink(self) -> str: """Return value of a symbolic link.""" - return error.checked_call(os.readlink, self.strpath) + # https://github.com/python/mypy/issues/12278 + return error.checked_call(os.readlink, self.strpath) # type: ignore[arg-type,return-value] def mklinkto(self, oldname): """Posix style hard link to another name.""" @@ -659,22 +679,21 @@ def new(self, **kw): obj.strpath = normpath("%(dirname)s%(sep)s%(basename)s" % kw) return obj - def _getbyspec(self, spec): + def _getbyspec(self, spec: str) -> list[str]: """See new for what 'spec' can be.""" res = [] parts = self.strpath.split(self.sep) args = filter(None, spec.split(",")) - append = res.append for name in args: if name == "drive": - append(parts[0]) + res.append(parts[0]) elif name == "dirname": - append(self.sep.join(parts[:-1])) + res.append(self.sep.join(parts[:-1])) else: basename = parts[-1] if name == "basename": - append(basename) + res.append(basename) else: i = basename.rfind(".") if i == -1: @@ -682,9 +701,9 @@ def _getbyspec(self, spec): else: purebasename, ext = basename[:i], basename[i:] if name == "purebasename": - append(purebasename) + res.append(purebasename) elif name == "ext": - append(ext) + res.append(ext) else: raise ValueError("invalid part specification %r" % name) return res @@ -699,7 +718,7 @@ def dirpath(self, *args, **kwargs): return path return self.new(basename="").join(*args, **kwargs) - def join(self, *args, **kwargs): + def join(self, *args: os.PathLike[str], abs: bool = False) -> LocalPath: """Return a new path by appending all 'args' as path components. if abs=1 is used restart from root if any of the args is an absolute path. @@ -707,8 +726,8 @@ def join(self, *args, **kwargs): sep = self.sep strargs = [os.fspath(arg) for arg in args] strpath = self.strpath - if kwargs.get("abs"): - newargs = [] + if abs: + newargs: list[str] = [] for arg in reversed(strargs): if isabs(arg): strpath = arg @@ -801,11 +820,11 @@ def listdir(self, fil=None, sort=None): self._sortlist(res, sort) return res - def size(self): + def size(self) -> int: """Return size of the underlying file object""" return self.stat().size - def mtime(self): + def mtime(self) -> float: """Return last modification time of the path.""" return self.stat().mtime @@ -936,7 +955,15 @@ def ensure(self, *args, **kwargs): p.open("w").close() return p - def stat(self, raising=True): + @overload + def stat(self, raising: Literal[True] = ...) -> Stat: + ... + + @overload + def stat(self, raising: Literal[False]) -> Stat | None: + ... + + def stat(self, raising: bool = True) -> Stat | None: """Return an os.stat() tuple.""" if raising: return Stat(self, error.checked_call(os.stat, self.strpath)) @@ -947,7 +974,7 @@ def stat(self, raising=True): except Exception: return None - def lstat(self): + def lstat(self) -> Stat: """Return an os.lstat() tuple.""" return Stat(self, error.checked_call(os.lstat, self.strpath)) @@ -1067,7 +1094,7 @@ def pyimport(self, modname=None, ensuresyspath=True): if modname is None: modname = self.purebasename spec = importlib.util.spec_from_file_location(modname, str(self)) - if spec is None: + if spec is None or spec.loader is None: raise ImportError( f"Can't find module {modname} at location {str(self)}" ) @@ -1095,6 +1122,7 @@ def pyimport(self, modname=None, ensuresyspath=True): return mod # we don't check anything as we might # be in a namespace package ... too icky to check modfile = mod.__file__ + assert modfile is not None if modfile[-4:] in (".pyc", ".pyo"): modfile = modfile[:-1] elif modfile.endswith("$py.class"): @@ -1129,16 +1157,22 @@ def pyimport(self, modname=None, ensuresyspath=True): raise return mod - def sysexec(self, *argv, **popen_opts): + def sysexec(self, *argv: os.PathLike[str], **popen_opts: Any) -> str: """Return stdout text from executing a system child process, where the 'self' path points to executable. The process is directly invoked and not through a system shell. """ from subprocess import Popen, PIPE - argv = map_as_list(str, argv) - popen_opts["stdout"] = popen_opts["stderr"] = PIPE - proc = Popen([str(self)] + argv, **popen_opts) + popen_opts.pop("stdout", None) + popen_opts.pop("stderr", None) + proc = Popen( + [str(self)] + [str(arg) for arg in argv], + **popen_opts, + stdout=PIPE, + stderr=PIPE, + ) + stdout: str | bytes stdout, stderr = proc.communicate() ret = proc.wait() if isinstance(stdout, bytes): From 82344ba4f8e6bd49afd52235385a105890dc3d88 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 21:42:11 -0400 Subject: [PATCH 415/549] add py.path.local tests --- testing/_py/test_local.py | 1542 +++++++++++++++++++++++++++++++++++++ 1 file changed, 1542 insertions(+) create mode 100644 testing/_py/test_local.py diff --git a/testing/_py/test_local.py b/testing/_py/test_local.py new file mode 100644 index 00000000000..6e2c44bc2e0 --- /dev/null +++ b/testing/_py/test_local.py @@ -0,0 +1,1542 @@ +import multiprocessing +import os +import sys +import time + +import pytest +from py import error +from py.path import local + + +class CommonFSTests: + def test_constructor_equality(self, path1): + p = path1.__class__(path1) + assert p == path1 + + def test_eq_nonstring(self, path1): + p1 = path1.join("sampledir") + p2 = path1.join("sampledir") + assert p1 == p2 + + def test_new_identical(self, path1): + assert path1 == path1.new() + + def test_join(self, path1): + p = path1.join("sampledir") + strp = str(p) + assert strp.endswith("sampledir") + assert strp.startswith(str(path1)) + + def test_join_normalized(self, path1): + newpath = path1.join(path1.sep + "sampledir") + strp = str(newpath) + assert strp.endswith("sampledir") + assert strp.startswith(str(path1)) + newpath = path1.join((path1.sep * 2) + "sampledir") + strp = str(newpath) + assert strp.endswith("sampledir") + assert strp.startswith(str(path1)) + + def test_join_noargs(self, path1): + newpath = path1.join() + assert path1 == newpath + + def test_add_something(self, path1): + p = path1.join("sample") + p = p + "dir" + assert p.check() + assert p.exists() + assert p.isdir() + assert not p.isfile() + + def test_parts(self, path1): + newpath = path1.join("sampledir", "otherfile") + par = newpath.parts()[-3:] + assert par == [path1, path1.join("sampledir"), newpath] + + revpar = newpath.parts(reverse=True)[:3] + assert revpar == [newpath, path1.join("sampledir"), path1] + + def test_common(self, path1): + other = path1.join("sampledir") + x = other.common(path1) + assert x == path1 + + # def test_parents_nonexisting_file(self, path1): + # newpath = path1 / 'dirnoexist' / 'nonexisting file' + # par = list(newpath.parents()) + # assert par[:2] == [path1 / 'dirnoexist', path1] + + def test_basename_checks(self, path1): + newpath = path1.join("sampledir") + assert newpath.check(basename="sampledir") + assert newpath.check(notbasename="xyz") + assert newpath.basename == "sampledir" + + def test_basename(self, path1): + newpath = path1.join("sampledir") + assert newpath.check(basename="sampledir") + assert newpath.basename, "sampledir" + + def test_dirname(self, path1): + newpath = path1.join("sampledir") + assert newpath.dirname == str(path1) + + def test_dirpath(self, path1): + newpath = path1.join("sampledir") + assert newpath.dirpath() == path1 + + def test_dirpath_with_args(self, path1): + newpath = path1.join("sampledir") + assert newpath.dirpath("x") == path1.join("x") + + def test_newbasename(self, path1): + newpath = path1.join("samplefile") + newbase = newpath.new(basename="samplefile2") + assert newbase.basename == "samplefile2" + assert newbase.dirpath() == newpath.dirpath() + + def test_not_exists(self, path1): + assert not path1.join("does_not_exist").check() + assert path1.join("does_not_exist").check(exists=0) + + def test_exists(self, path1): + assert path1.join("samplefile").check() + assert path1.join("samplefile").check(exists=1) + assert path1.join("samplefile").exists() + assert path1.join("samplefile").isfile() + assert not path1.join("samplefile").isdir() + + def test_dir(self, path1): + # print repr(path1.join("sampledir")) + assert path1.join("sampledir").check(dir=1) + assert path1.join("samplefile").check(notdir=1) + assert not path1.join("samplefile").check(dir=1) + assert path1.join("samplefile").exists() + assert not path1.join("samplefile").isdir() + assert path1.join("samplefile").isfile() + + def test_fnmatch_file(self, path1): + assert path1.join("samplefile").check(fnmatch="s*e") + assert path1.join("samplefile").fnmatch("s*e") + assert not path1.join("samplefile").fnmatch("s*x") + assert not path1.join("samplefile").check(fnmatch="s*x") + + # def test_fnmatch_dir(self, path1): + + # pattern = path1.sep.join(['s*file']) + # sfile = path1.join("samplefile") + # assert sfile.check(fnmatch=pattern) + + def test_relto(self, path1): + p = path1.join("sampledir", "otherfile") + assert p.relto(path1) == p.sep.join(["sampledir", "otherfile"]) + assert p.check(relto=path1) + assert path1.check(notrelto=p) + assert not path1.check(relto=p) + + def test_bestrelpath(self, path1): + curdir = path1 + sep = curdir.sep + s = curdir.bestrelpath(curdir) + assert s == "." + s = curdir.bestrelpath(curdir.join("hello", "world")) + assert s == "hello" + sep + "world" + + s = curdir.bestrelpath(curdir.dirpath().join("sister")) + assert s == ".." + sep + "sister" + assert curdir.bestrelpath(curdir.dirpath()) == ".." + + assert curdir.bestrelpath("hello") == "hello" + + def test_relto_not_relative(self, path1): + l1 = path1.join("bcde") + l2 = path1.join("b") + assert not l1.relto(l2) + assert not l2.relto(l1) + + def test_listdir(self, path1): + p = path1.listdir() + assert path1.join("sampledir") in p + assert path1.join("samplefile") in p + with pytest.raises(error.ENOTDIR): + path1.join("samplefile").listdir() + + def test_listdir_fnmatchstring(self, path1): + p = path1.listdir("s*dir") + assert len(p) + assert p[0], path1.join("sampledir") + + def test_listdir_filter(self, path1): + p = path1.listdir(lambda x: x.check(dir=1)) + assert path1.join("sampledir") in p + assert not path1.join("samplefile") in p + + def test_listdir_sorted(self, path1): + p = path1.listdir(lambda x: x.check(basestarts="sample"), sort=True) + assert path1.join("sampledir") == p[0] + assert path1.join("samplefile") == p[1] + assert path1.join("samplepickle") == p[2] + + def test_visit_nofilter(self, path1): + lst = [] + for i in path1.visit(): + lst.append(i.relto(path1)) + assert "sampledir" in lst + assert path1.sep.join(["sampledir", "otherfile"]) in lst + + def test_visit_norecurse(self, path1): + lst = [] + for i in path1.visit(None, lambda x: x.basename != "sampledir"): + lst.append(i.relto(path1)) + assert "sampledir" in lst + assert not path1.sep.join(["sampledir", "otherfile"]) in lst + + @pytest.mark.parametrize( + "fil", + ["*dir", "*dir", pytest.mark.skip("sys.version_info <" " (3,6)")(b"*dir")], + ) + def test_visit_filterfunc_is_string(self, path1, fil): + lst = [] + for i in path1.visit(fil): + lst.append(i.relto(path1)) + assert len(lst), 2 + assert "sampledir" in lst + assert "otherdir" in lst + + def test_visit_ignore(self, path1): + p = path1.join("nonexisting") + assert list(p.visit(ignore=error.ENOENT)) == [] + + def test_visit_endswith(self, path1): + p = [] + for i in path1.visit(lambda x: x.check(endswith="file")): + p.append(i.relto(path1)) + assert path1.sep.join(["sampledir", "otherfile"]) in p + assert "samplefile" in p + + def test_cmp(self, path1): + path1 = path1.join("samplefile") + path2 = path1.join("samplefile2") + assert (path1 < path2) == ("samplefile" < "samplefile2") + assert not (path1 < path1) + + def test_simple_read(self, path1): + x = path1.join("samplefile").read("r") + assert x == "samplefile\n" + + def test_join_div_operator(self, path1): + newpath = path1 / "/sampledir" / "/test//" + newpath2 = path1.join("sampledir", "test") + assert newpath == newpath2 + + def test_ext(self, path1): + newpath = path1.join("sampledir.ext") + assert newpath.ext == ".ext" + newpath = path1.join("sampledir") + assert not newpath.ext + + def test_purebasename(self, path1): + newpath = path1.join("samplefile.py") + assert newpath.purebasename == "samplefile" + + def test_multiple_parts(self, path1): + newpath = path1.join("samplefile.py") + dirname, purebasename, basename, ext = newpath._getbyspec( + "dirname,purebasename,basename,ext" + ) + assert str(path1).endswith(dirname) # be careful with win32 'drive' + assert purebasename == "samplefile" + assert basename == "samplefile.py" + assert ext == ".py" + + def test_dotted_name_ext(self, path1): + newpath = path1.join("a.b.c") + ext = newpath.ext + assert ext == ".c" + assert newpath.ext == ".c" + + def test_newext(self, path1): + newpath = path1.join("samplefile.py") + newext = newpath.new(ext=".txt") + assert newext.basename == "samplefile.txt" + assert newext.purebasename == "samplefile" + + def test_readlines(self, path1): + fn = path1.join("samplefile") + contents = fn.readlines() + assert contents == ["samplefile\n"] + + def test_readlines_nocr(self, path1): + fn = path1.join("samplefile") + contents = fn.readlines(cr=0) + assert contents == ["samplefile", ""] + + def test_file(self, path1): + assert path1.join("samplefile").check(file=1) + + def test_not_file(self, path1): + assert not path1.join("sampledir").check(file=1) + assert path1.join("sampledir").check(file=0) + + def test_non_existent(self, path1): + assert path1.join("sampledir.nothere").check(dir=0) + assert path1.join("sampledir.nothere").check(file=0) + assert path1.join("sampledir.nothere").check(notfile=1) + assert path1.join("sampledir.nothere").check(notdir=1) + assert path1.join("sampledir.nothere").check(notexists=1) + assert not path1.join("sampledir.nothere").check(notfile=0) + + # pattern = path1.sep.join(['s*file']) + # sfile = path1.join("samplefile") + # assert sfile.check(fnmatch=pattern) + + def test_size(self, path1): + url = path1.join("samplefile") + assert url.size() > len("samplefile") + + def test_mtime(self, path1): + url = path1.join("samplefile") + assert url.mtime() > 0 + + def test_relto_wrong_type(self, path1): + with pytest.raises(TypeError): + path1.relto(42) + + def test_load(self, path1): + p = path1.join("samplepickle") + obj = p.load() + assert type(obj) is dict + assert obj.get("answer", None) == 42 + + def test_visit_filesonly(self, path1): + p = [] + for i in path1.visit(lambda x: x.check(file=1)): + p.append(i.relto(path1)) + assert "sampledir" not in p + assert path1.sep.join(["sampledir", "otherfile"]) in p + + def test_visit_nodotfiles(self, path1): + p = [] + for i in path1.visit(lambda x: x.check(dotfile=0)): + p.append(i.relto(path1)) + assert "sampledir" in p + assert path1.sep.join(["sampledir", "otherfile"]) in p + assert ".dotfile" not in p + + def test_visit_breadthfirst(self, path1): + lst = [] + for i in path1.visit(bf=True): + lst.append(i.relto(path1)) + for i, p in enumerate(lst): + if path1.sep in p: + for j in range(i, len(lst)): + assert path1.sep in lst[j] + break + else: + pytest.fail("huh") + + def test_visit_sort(self, path1): + lst = [] + for i in path1.visit(bf=True, sort=True): + lst.append(i.relto(path1)) + for i, p in enumerate(lst): + if path1.sep in p: + break + assert lst[:i] == sorted(lst[:i]) + assert lst[i:] == sorted(lst[i:]) + + def test_endswith(self, path1): + def chk(p): + return p.check(endswith="pickle") + + assert not chk(path1) + assert not chk(path1.join("samplefile")) + assert chk(path1.join("somepickle")) + + def test_copy_file(self, path1): + otherdir = path1.join("otherdir") + initpy = otherdir.join("__init__.py") + copied = otherdir.join("copied") + initpy.copy(copied) + try: + assert copied.check() + s1 = initpy.read() + s2 = copied.read() + assert s1 == s2 + finally: + if copied.check(): + copied.remove() + + def test_copy_dir(self, path1): + otherdir = path1.join("otherdir") + copied = path1.join("newdir") + try: + otherdir.copy(copied) + assert copied.check(dir=1) + assert copied.join("__init__.py").check(file=1) + s1 = otherdir.join("__init__.py").read() + s2 = copied.join("__init__.py").read() + assert s1 == s2 + finally: + if copied.check(dir=1): + copied.remove(rec=1) + + def test_remove_file(self, path1): + d = path1.ensure("todeleted") + assert d.check() + d.remove() + assert not d.check() + + def test_remove_dir_recursive_by_default(self, path1): + d = path1.ensure("to", "be", "deleted") + assert d.check() + p = path1.join("to") + p.remove() + assert not p.check() + + def test_ensure_dir(self, path1): + b = path1.ensure_dir("001", "002") + assert b.basename == "002" + assert b.isdir() + + def test_mkdir_and_remove(self, path1): + tmpdir = path1 + with pytest.raises(error.EEXIST): + tmpdir.mkdir("sampledir") + new = tmpdir.join("mktest1") + new.mkdir() + assert new.check(dir=1) + new.remove() + + new = tmpdir.mkdir("mktest") + assert new.check(dir=1) + new.remove() + assert tmpdir.join("mktest") == new + + def test_move_file(self, path1): + p = path1.join("samplefile") + newp = p.dirpath("moved_samplefile") + p.move(newp) + try: + assert newp.check(file=1) + assert not p.check() + finally: + dp = newp.dirpath() + if hasattr(dp, "revert"): + dp.revert() + else: + newp.move(p) + assert p.check() + + def test_move_dir(self, path1): + source = path1.join("sampledir") + dest = path1.join("moveddir") + source.move(dest) + assert dest.check(dir=1) + assert dest.join("otherfile").check(file=1) + assert not source.join("sampledir").check() + + def test_fspath_protocol_match_strpath(self, path1): + assert path1.__fspath__() == path1.strpath + + def test_fspath_func_match_strpath(self, path1): + from os import fspath + + assert fspath(path1) == path1.strpath + + @pytest.mark.skip("sys.version_info < (3,6)") + def test_fspath_open(self, path1): + f = path1.join("opentestfile") + open(f) + + @pytest.mark.skip("sys.version_info < (3,6)") + def test_fspath_fsencode(self, path1): + from os import fsencode + + assert fsencode(path1) == fsencode(path1.strpath) + + +def setuptestfs(path): + if path.join("samplefile").check(): + return + # print "setting up test fs for", repr(path) + samplefile = path.ensure("samplefile") + samplefile.write("samplefile\n") + + execfile = path.ensure("execfile") + execfile.write("x=42") + + execfilepy = path.ensure("execfile.py") + execfilepy.write("x=42") + + d = {1: 2, "hello": "world", "answer": 42} + path.ensure("samplepickle").dump(d) + + sampledir = path.ensure("sampledir", dir=1) + sampledir.ensure("otherfile") + + otherdir = path.ensure("otherdir", dir=1) + otherdir.ensure("__init__.py") + + module_a = otherdir.ensure("a.py") + module_a.write("from .b import stuff as result\n") + module_b = otherdir.ensure("b.py") + module_b.write('stuff="got it"\n') + module_c = otherdir.ensure("c.py") + module_c.write( + """import py; +import otherdir.a +value = otherdir.a.result +""" + ) + module_d = otherdir.ensure("d.py") + module_d.write( + """import py; +from otherdir import a +value2 = a.result +""" + ) + + +win32only = pytest.mark.skipif( + "not (sys.platform == 'win32' or getattr(os, '_name', None) == 'nt')" +) +skiponwin32 = pytest.mark.skipif( + "sys.platform == 'win32' or getattr(os, '_name', None) == 'nt'" +) + +ATIME_RESOLUTION = 0.01 + + +@pytest.fixture(scope="session") +def path1(tmpdir_factory): + path = tmpdir_factory.mktemp("path") + setuptestfs(path) + yield path + assert path.join("samplefile").check() + + +@pytest.fixture +def fake_fspath_obj(request): + class FakeFSPathClass: + def __init__(self, path): + self._path = path + + def __fspath__(self): + return self._path + + return FakeFSPathClass(os.path.join("this", "is", "a", "fake", "path")) + + +def batch_make_numbered_dirs(rootdir, repeats): + for i in range(repeats): + dir_ = local.make_numbered_dir(prefix="repro-", rootdir=rootdir) + file_ = dir_.join("foo") + file_.write("%s" % i) + actual = int(file_.read()) + assert actual == i, f"int(file_.read()) is {actual} instead of {i}" + dir_.join(".lock").remove(ignore_errors=True) + return True + + +class TestLocalPath(CommonFSTests): + def test_join_normpath(self, tmpdir): + assert tmpdir.join(".") == tmpdir + p = tmpdir.join("../%s" % tmpdir.basename) + assert p == tmpdir + p = tmpdir.join("..//%s/" % tmpdir.basename) + assert p == tmpdir + + @skiponwin32 + def test_dirpath_abs_no_abs(self, tmpdir): + p = tmpdir.join("foo") + assert p.dirpath("/bar") == tmpdir.join("bar") + assert tmpdir.dirpath("/bar", abs=True) == local("/bar") + + def test_gethash(self, tmpdir): + from hashlib import md5 + from hashlib import sha1 as sha + + fn = tmpdir.join("testhashfile") + data = b"hello" + fn.write(data, mode="wb") + assert fn.computehash("md5") == md5(data).hexdigest() + assert fn.computehash("sha1") == sha(data).hexdigest() + with pytest.raises(ValueError): + fn.computehash("asdasd") + + def test_remove_removes_readonly_file(self, tmpdir): + readonly_file = tmpdir.join("readonly").ensure() + readonly_file.chmod(0) + readonly_file.remove() + assert not readonly_file.check(exists=1) + + def test_remove_removes_readonly_dir(self, tmpdir): + readonly_dir = tmpdir.join("readonlydir").ensure(dir=1) + readonly_dir.chmod(int("500", 8)) + readonly_dir.remove() + assert not readonly_dir.check(exists=1) + + def test_remove_removes_dir_and_readonly_file(self, tmpdir): + readonly_dir = tmpdir.join("readonlydir").ensure(dir=1) + readonly_file = readonly_dir.join("readonlyfile").ensure() + readonly_file.chmod(0) + readonly_dir.remove() + assert not readonly_dir.check(exists=1) + + def test_remove_routes_ignore_errors(self, tmpdir, monkeypatch): + lst = [] + monkeypatch.setattr("shutil.rmtree", lambda *args, **kwargs: lst.append(kwargs)) + tmpdir.remove() + assert not lst[0]["ignore_errors"] + for val in (True, False): + lst[:] = [] + tmpdir.remove(ignore_errors=val) + assert lst[0]["ignore_errors"] == val + + def test_initialize_curdir(self): + assert str(local()) == os.getcwd() + + @skiponwin32 + def test_chdir_gone(self, path1): + p = path1.ensure("dir_to_be_removed", dir=1) + p.chdir() + p.remove() + pytest.raises(error.ENOENT, local) + assert path1.chdir() is None + assert os.getcwd() == str(path1) + + with pytest.raises(error.ENOENT): + with p.as_cwd(): + raise NotImplementedError + + @skiponwin32 + def test_chdir_gone_in_as_cwd(self, path1): + p = path1.ensure("dir_to_be_removed", dir=1) + p.chdir() + p.remove() + + with path1.as_cwd() as old: + assert old is None + + def test_as_cwd(self, path1): + dir = path1.ensure("subdir", dir=1) + old = local() + with dir.as_cwd() as x: + assert x == old + assert local() == dir + assert os.getcwd() == str(old) + + def test_as_cwd_exception(self, path1): + old = local() + dir = path1.ensure("subdir", dir=1) + with pytest.raises(ValueError): + with dir.as_cwd(): + raise ValueError() + assert old == local() + + def test_initialize_reldir(self, path1): + with path1.as_cwd(): + p = local("samplefile") + assert p.check() + + def test_tilde_expansion(self, monkeypatch, tmpdir): + monkeypatch.setenv("HOME", str(tmpdir)) + p = local("~", expanduser=True) + assert p == os.path.expanduser("~") + + @pytest.mark.skipif( + not sys.platform.startswith("win32"), reason="case insensitive only on windows" + ) + def test_eq_hash_are_case_insensitive_on_windows(self): + a = local("/some/path") + b = local("/some/PATH") + assert a == b + assert hash(a) == hash(b) + assert a in {b} + assert a in {b: "b"} + + def test_eq_with_strings(self, path1): + path1 = path1.join("sampledir") + path2 = str(path1) + assert path1 == path2 + assert path2 == path1 + path3 = path1.join("samplefile") + assert path3 != path2 + assert path2 != path3 + + def test_eq_with_none(self, path1): + assert path1 != None # noqa: E711 + + def test_eq_non_ascii_unicode(self, path1): + path2 = path1.join("temp") + path3 = path1.join("ação") + path4 = path1.join("ディレクトリ") + + assert path2 != path3 + assert path2 != path4 + assert path4 != path3 + + def test_gt_with_strings(self, path1): + path2 = path1.join("sampledir") + path3 = str(path1.join("ttt")) + assert path3 > path2 + assert path2 < path3 + assert path2 < "ttt" + assert "ttt" > path2 + path4 = path1.join("aaa") + lst = [path2, path4, path3] + assert sorted(lst) == [path4, path2, path3] + + def test_open_and_ensure(self, path1): + p = path1.join("sub1", "sub2", "file") + with p.open("w", ensure=1) as f: + f.write("hello") + assert p.read() == "hello" + + def test_write_and_ensure(self, path1): + p = path1.join("sub1", "sub2", "file") + p.write("hello", ensure=1) + assert p.read() == "hello" + + @pytest.mark.parametrize("bin", (False, True)) + def test_dump(self, tmpdir, bin): + path = tmpdir.join("dumpfile%s" % int(bin)) + try: + d = {"answer": 42} + path.dump(d, bin=bin) + f = path.open("rb+") + import pickle + + dnew = pickle.load(f) + assert d == dnew + finally: + f.close() + + def test_setmtime(self): + import tempfile + import time + + try: + fd, name = tempfile.mkstemp() + os.close(fd) + except AttributeError: + name = tempfile.mktemp() + open(name, "w").close() + try: + mtime = int(time.time()) - 100 + path = local(name) + assert path.mtime() != mtime + path.setmtime(mtime) + assert path.mtime() == mtime + path.setmtime() + assert path.mtime() != mtime + finally: + os.remove(name) + + def test_normpath(self, path1): + new1 = path1.join("/otherdir") + new2 = path1.join("otherdir") + assert str(new1) == str(new2) + + def test_mkdtemp_creation(self): + d = local.mkdtemp() + try: + assert d.check(dir=1) + finally: + d.remove(rec=1) + + def test_tmproot(self): + d = local.mkdtemp() + tmproot = local.get_temproot() + try: + assert d.check(dir=1) + assert d.dirpath() == tmproot + finally: + d.remove(rec=1) + + def test_chdir(self, tmpdir): + old = local() + try: + res = tmpdir.chdir() + assert str(res) == str(old) + assert os.getcwd() == str(tmpdir) + finally: + old.chdir() + + def test_ensure_filepath_withdir(self, tmpdir): + newfile = tmpdir.join("test1", "test") + newfile.ensure() + assert newfile.check(file=1) + newfile.write("42") + newfile.ensure() + s = newfile.read() + assert s == "42" + + def test_ensure_filepath_withoutdir(self, tmpdir): + newfile = tmpdir.join("test1file") + t = newfile.ensure() + assert t == newfile + assert newfile.check(file=1) + + def test_ensure_dirpath(self, tmpdir): + newfile = tmpdir.join("test1", "testfile") + t = newfile.ensure(dir=1) + assert t == newfile + assert newfile.check(dir=1) + + def test_ensure_non_ascii_unicode(self, tmpdir): + newfile = tmpdir.join("ação", "ディレクトリ") + t = newfile.ensure(dir=1) + assert t == newfile + assert newfile.check(dir=1) + + @pytest.mark.xfail(run=False, reason="unreliable est for long filenames") + def test_long_filenames(self, tmpdir): + if sys.platform == "win32": + pytest.skip("win32: work around needed for path length limit") + # see http://codespeak.net/pipermail/py-dev/2008q2/000922.html + + # testing paths > 260 chars (which is Windows' limitation, but + # depending on how the paths are used), but > 4096 (which is the + # Linux' limitation) - the behaviour of paths with names > 4096 chars + # is undetermined + newfilename = "/test" * 60 + l1 = tmpdir.join(newfilename) + l1.ensure(file=True) + l1.write("foo") + l2 = tmpdir.join(newfilename) + assert l2.read() == "foo" + + def test_visit_depth_first(self, tmpdir): + tmpdir.ensure("a", "1") + tmpdir.ensure("b", "2") + p3 = tmpdir.ensure("breadth") + lst = list(tmpdir.visit(lambda x: x.check(file=1))) + assert len(lst) == 3 + # check that breadth comes last + assert lst[2] == p3 + + def test_visit_rec_fnmatch(self, tmpdir): + p1 = tmpdir.ensure("a", "123") + tmpdir.ensure(".b", "345") + lst = list(tmpdir.visit("???", rec="[!.]*")) + assert len(lst) == 1 + # check that breadth comes last + assert lst[0] == p1 + + def test_fnmatch_file_abspath(self, tmpdir): + b = tmpdir.join("a", "b") + assert b.fnmatch(os.sep.join("ab")) + pattern = os.sep.join([str(tmpdir), "*", "b"]) + assert b.fnmatch(pattern) + + def test_sysfind(self): + name = sys.platform == "win32" and "cmd" or "test" + x = local.sysfind(name) + assert x.check(file=1) + assert local.sysfind("jaksdkasldqwe") is None + assert local.sysfind(name, paths=[]) is None + x2 = local.sysfind(name, paths=[x.dirpath()]) + assert x2 == x + + def test_fspath_protocol_other_class(self, fake_fspath_obj): + # py.path is always absolute + py_path = local(fake_fspath_obj) + str_path = fake_fspath_obj.__fspath__() + assert py_path.check(endswith=str_path) + assert py_path.join(fake_fspath_obj).strpath == os.path.join( + py_path.strpath, str_path + ) + + def test_make_numbered_dir_multiprocess_safe(self, tmpdir): + # https://github.com/pytest-dev/py/issues/30 + with multiprocessing.Pool() as pool: + results = [ + pool.apply_async(batch_make_numbered_dirs, [tmpdir, 100]) + for _ in range(20) + ] + for r in results: + assert r.get() + + +class TestExecutionOnWindows: + pytestmark = win32only + + def test_sysfind_bat_exe_before(self, tmpdir, monkeypatch): + monkeypatch.setenv("PATH", str(tmpdir), prepend=os.pathsep) + tmpdir.ensure("hello") + h = tmpdir.ensure("hello.bat") + x = local.sysfind("hello") + assert x == h + + +class TestExecution: + pytestmark = skiponwin32 + + def test_sysfind_no_permisson_ignored(self, monkeypatch, tmpdir): + noperm = tmpdir.ensure("noperm", dir=True) + monkeypatch.setenv("PATH", str(noperm), prepend=":") + noperm.chmod(0) + try: + assert local.sysfind("jaksdkasldqwe") is None + finally: + noperm.chmod(0o644) + + def test_sysfind_absolute(self): + x = local.sysfind("test") + assert x.check(file=1) + y = local.sysfind(str(x)) + assert y.check(file=1) + assert y == x + + def test_sysfind_multiple(self, tmpdir, monkeypatch): + monkeypatch.setenv( + "PATH", "{}:{}".format(tmpdir.ensure("a"), tmpdir.join("b")), prepend=":" + ) + tmpdir.ensure("b", "a") + x = local.sysfind("a", checker=lambda x: x.dirpath().basename == "b") + assert x.basename == "a" + assert x.dirpath().basename == "b" + assert local.sysfind("a", checker=lambda x: None) is None + + def test_sysexec(self): + x = local.sysfind("ls") + out = x.sysexec("-a") + for x in local().listdir(): + assert out.find(x.basename) != -1 + + def test_sysexec_failing(self): + x = local.sysfind("false") + with pytest.raises(RuntimeError): + x.sysexec("aksjdkasjd") + + def test_make_numbered_dir(self, tmpdir): + tmpdir.ensure("base.not_an_int", dir=1) + for i in range(10): + numdir = local.make_numbered_dir( + prefix="base.", rootdir=tmpdir, keep=2, lock_timeout=0 + ) + assert numdir.check() + assert numdir.basename == "base.%d" % i + if i >= 1: + assert numdir.new(ext=str(i - 1)).check() + if i >= 2: + assert numdir.new(ext=str(i - 2)).check() + if i >= 3: + assert not numdir.new(ext=str(i - 3)).check() + + def test_make_numbered_dir_case(self, tmpdir): + """make_numbered_dir does not make assumptions on the underlying + filesystem based on the platform and will assume it _could_ be case + insensitive. + + See issues: + - https://github.com/pytest-dev/pytest/issues/708 + - https://github.com/pytest-dev/pytest/issues/3451 + """ + d1 = local.make_numbered_dir( + prefix="CAse.", + rootdir=tmpdir, + keep=2, + lock_timeout=0, + ) + d2 = local.make_numbered_dir( + prefix="caSE.", + rootdir=tmpdir, + keep=2, + lock_timeout=0, + ) + assert str(d1).lower() != str(d2).lower() + assert str(d2).endswith(".1") + + def test_make_numbered_dir_NotImplemented_Error(self, tmpdir, monkeypatch): + def notimpl(x, y): + raise NotImplementedError(42) + + monkeypatch.setattr(os, "symlink", notimpl) + x = tmpdir.make_numbered_dir(rootdir=tmpdir, lock_timeout=0) + assert x.relto(tmpdir) + assert x.check() + + def test_locked_make_numbered_dir(self, tmpdir): + for i in range(10): + numdir = local.make_numbered_dir(prefix="base2.", rootdir=tmpdir, keep=2) + assert numdir.check() + assert numdir.basename == "base2.%d" % i + for j in range(i): + assert numdir.new(ext=str(j)).check() + + def test_error_preservation(self, path1): + pytest.raises(EnvironmentError, path1.join("qwoeqiwe").mtime) + pytest.raises(EnvironmentError, path1.join("qwoeqiwe").read) + + # def test_parentdirmatch(self): + # local.parentdirmatch('std', startmodule=__name__) + # + + +class TestImport: + def test_pyimport(self, path1): + obj = path1.join("execfile.py").pyimport() + assert obj.x == 42 + assert obj.__name__ == "execfile" + + def test_pyimport_renamed_dir_creates_mismatch(self, tmpdir, monkeypatch): + p = tmpdir.ensure("a", "test_x123.py") + p.pyimport() + tmpdir.join("a").move(tmpdir.join("b")) + with pytest.raises(tmpdir.ImportMismatchError): + tmpdir.join("b", "test_x123.py").pyimport() + + # Errors can be ignored. + monkeypatch.setenv("PY_IGNORE_IMPORTMISMATCH", "1") + tmpdir.join("b", "test_x123.py").pyimport() + + # PY_IGNORE_IMPORTMISMATCH=0 does not ignore error. + monkeypatch.setenv("PY_IGNORE_IMPORTMISMATCH", "0") + with pytest.raises(tmpdir.ImportMismatchError): + tmpdir.join("b", "test_x123.py").pyimport() + + def test_pyimport_messy_name(self, tmpdir): + # http://bitbucket.org/hpk42/py-trunk/issue/129 + path = tmpdir.ensure("foo__init__.py") + path.pyimport() + + def test_pyimport_dir(self, tmpdir): + p = tmpdir.join("hello_123") + p_init = p.ensure("__init__.py") + m = p.pyimport() + assert m.__name__ == "hello_123" + m = p_init.pyimport() + assert m.__name__ == "hello_123" + + def test_pyimport_execfile_different_name(self, path1): + obj = path1.join("execfile.py").pyimport(modname="0x.y.z") + assert obj.x == 42 + assert obj.__name__ == "0x.y.z" + + def test_pyimport_a(self, path1): + otherdir = path1.join("otherdir") + mod = otherdir.join("a.py").pyimport() + assert mod.result == "got it" + assert mod.__name__ == "otherdir.a" + + def test_pyimport_b(self, path1): + otherdir = path1.join("otherdir") + mod = otherdir.join("b.py").pyimport() + assert mod.stuff == "got it" + assert mod.__name__ == "otherdir.b" + + def test_pyimport_c(self, path1): + otherdir = path1.join("otherdir") + mod = otherdir.join("c.py").pyimport() + assert mod.value == "got it" + + def test_pyimport_d(self, path1): + otherdir = path1.join("otherdir") + mod = otherdir.join("d.py").pyimport() + assert mod.value2 == "got it" + + def test_pyimport_and_import(self, tmpdir): + tmpdir.ensure("xxxpackage", "__init__.py") + mod1path = tmpdir.ensure("xxxpackage", "module1.py") + mod1 = mod1path.pyimport() + assert mod1.__name__ == "xxxpackage.module1" + from xxxpackage import module1 + + assert module1 is mod1 + + def test_pyimport_check_filepath_consistency(self, monkeypatch, tmpdir): + name = "pointsback123" + ModuleType = type(os) + p = tmpdir.ensure(name + ".py") + for ending in (".pyc", "$py.class", ".pyo"): + mod = ModuleType(name) + pseudopath = tmpdir.ensure(name + ending) + mod.__file__ = str(pseudopath) + monkeypatch.setitem(sys.modules, name, mod) + newmod = p.pyimport() + assert mod == newmod + monkeypatch.undo() + mod = ModuleType(name) + pseudopath = tmpdir.ensure(name + "123.py") + mod.__file__ = str(pseudopath) + monkeypatch.setitem(sys.modules, name, mod) + excinfo = pytest.raises(pseudopath.ImportMismatchError, p.pyimport) + modname, modfile, orig = excinfo.value.args + assert modname == name + assert modfile == pseudopath + assert orig == p + assert issubclass(pseudopath.ImportMismatchError, ImportError) + + def test_issue131_pyimport_on__init__(self, tmpdir): + # __init__.py files may be namespace packages, and thus the + # __file__ of an imported module may not be ourselves + # see issue + p1 = tmpdir.ensure("proja", "__init__.py") + p2 = tmpdir.ensure("sub", "proja", "__init__.py") + m1 = p1.pyimport() + m2 = p2.pyimport() + assert m1 == m2 + + def test_ensuresyspath_append(self, tmpdir): + root1 = tmpdir.mkdir("root1") + file1 = root1.ensure("x123.py") + assert str(root1) not in sys.path + file1.pyimport(ensuresyspath="append") + assert str(root1) == sys.path[-1] + assert str(root1) not in sys.path[:-1] + + +class TestImportlibImport: + OPTS = {"ensuresyspath": "importlib"} + + def test_pyimport(self, path1): + obj = path1.join("execfile.py").pyimport(**self.OPTS) + assert obj.x == 42 + assert obj.__name__ == "execfile" + + def test_pyimport_dir_fails(self, tmpdir): + p = tmpdir.join("hello_123") + p.ensure("__init__.py") + with pytest.raises(ImportError): + p.pyimport(**self.OPTS) + + def test_pyimport_execfile_different_name(self, path1): + obj = path1.join("execfile.py").pyimport(modname="0x.y.z", **self.OPTS) + assert obj.x == 42 + assert obj.__name__ == "0x.y.z" + + def test_pyimport_relative_import_fails(self, path1): + otherdir = path1.join("otherdir") + with pytest.raises(ImportError): + otherdir.join("a.py").pyimport(**self.OPTS) + + def test_pyimport_doesnt_use_sys_modules(self, tmpdir): + p = tmpdir.ensure("file738jsk.py") + mod = p.pyimport(**self.OPTS) + assert mod.__name__ == "file738jsk" + assert "file738jsk" not in sys.modules + + +def test_pypkgdir(tmpdir): + pkg = tmpdir.ensure("pkg1", dir=1) + pkg.ensure("__init__.py") + pkg.ensure("subdir/__init__.py") + assert pkg.pypkgpath() == pkg + assert pkg.join("subdir", "__init__.py").pypkgpath() == pkg + + +def test_pypkgdir_unimportable(tmpdir): + pkg = tmpdir.ensure("pkg1-1", dir=1) # unimportable + pkg.ensure("__init__.py") + subdir = pkg.ensure("subdir/__init__.py").dirpath() + assert subdir.pypkgpath() == subdir + assert subdir.ensure("xyz.py").pypkgpath() == subdir + assert not pkg.pypkgpath() + + +def test_isimportable(): + from py.path import isimportable + + assert not isimportable("") + assert isimportable("x") + assert isimportable("x1") + assert isimportable("x_1") + assert isimportable("_") + assert isimportable("_1") + assert not isimportable("x-1") + assert not isimportable("x:1") + + +def test_homedir_from_HOME(monkeypatch): + path = os.getcwd() + monkeypatch.setenv("HOME", path) + assert local._gethomedir() == local(path) + + +def test_homedir_not_exists(monkeypatch): + monkeypatch.delenv("HOME", raising=False) + monkeypatch.delenv("HOMEDRIVE", raising=False) + homedir = local._gethomedir() + assert homedir is None + + +def test_samefile(tmpdir): + assert tmpdir.samefile(tmpdir) + p = tmpdir.ensure("hello") + assert p.samefile(p) + with p.dirpath().as_cwd(): + assert p.samefile(p.basename) + if sys.platform == "win32": + p1 = p.__class__(str(p).lower()) + p2 = p.__class__(str(p).upper()) + assert p1.samefile(p2) + + +@pytest.mark.skipif(not hasattr(os, "symlink"), reason="os.symlink not available") +def test_samefile_symlink(tmpdir): + p1 = tmpdir.ensure("foo.txt") + p2 = tmpdir.join("linked.txt") + try: + os.symlink(str(p1), str(p2)) + except (OSError, NotImplementedError) as e: + # on Windows this might fail if the user doesn't have special symlink permissions + # pypy3 on Windows doesn't implement os.symlink and raises NotImplementedError + pytest.skip(str(e.args[0])) + + assert p1.samefile(p2) + + +def test_listdir_single_arg(tmpdir): + tmpdir.ensure("hello") + assert tmpdir.listdir("hello")[0].basename == "hello" + + +def test_mkdtemp_rootdir(tmpdir): + dtmp = local.mkdtemp(rootdir=tmpdir) + assert tmpdir.listdir() == [dtmp] + + +class TestWINLocalPath: + pytestmark = win32only + + def test_owner_group_not_implemented(self, path1): + with pytest.raises(NotImplementedError): + path1.stat().owner + with pytest.raises(NotImplementedError): + path1.stat().group + + def test_chmod_simple_int(self, path1): + mode = path1.stat().mode + # Ensure that we actually change the mode to something different. + path1.chmod(mode == 0 and 1 or 0) + try: + print(path1.stat().mode) + print(mode) + assert path1.stat().mode != mode + finally: + path1.chmod(mode) + assert path1.stat().mode == mode + + def test_path_comparison_lowercase_mixed(self, path1): + t1 = path1.join("a_path") + t2 = path1.join("A_path") + assert t1 == t1 + assert t1 == t2 + + def test_relto_with_mixed_case(self, path1): + t1 = path1.join("a_path", "fiLe") + t2 = path1.join("A_path") + assert t1.relto(t2) == "fiLe" + + def test_allow_unix_style_paths(self, path1): + t1 = path1.join("a_path") + assert t1 == str(path1) + "\\a_path" + t1 = path1.join("a_path/") + assert t1 == str(path1) + "\\a_path" + t1 = path1.join("dir/a_path") + assert t1 == str(path1) + "\\dir\\a_path" + + def test_sysfind_in_currentdir(self, path1): + cmd = local.sysfind("cmd") + root = cmd.new(dirname="", basename="") # c:\ in most installations + with root.as_cwd(): + x = local.sysfind(cmd.relto(root)) + assert x.check(file=1) + + def test_fnmatch_file_abspath_posix_pattern_on_win32(self, tmpdir): + # path-matching patterns might contain a posix path separator '/' + # Test that we can match that pattern on windows. + import posixpath + + b = tmpdir.join("a", "b") + assert b.fnmatch(posixpath.sep.join("ab")) + pattern = posixpath.sep.join([str(tmpdir), "*", "b"]) + assert b.fnmatch(pattern) + + +class TestPOSIXLocalPath: + pytestmark = skiponwin32 + + def test_hardlink(self, tmpdir): + linkpath = tmpdir.join("test") + filepath = tmpdir.join("file") + filepath.write("Hello") + nlink = filepath.stat().nlink + linkpath.mklinkto(filepath) + assert filepath.stat().nlink == nlink + 1 + + def test_symlink_are_identical(self, tmpdir): + filepath = tmpdir.join("file") + filepath.write("Hello") + linkpath = tmpdir.join("test") + linkpath.mksymlinkto(filepath) + assert linkpath.readlink() == str(filepath) + + def test_symlink_isfile(self, tmpdir): + linkpath = tmpdir.join("test") + filepath = tmpdir.join("file") + filepath.write("") + linkpath.mksymlinkto(filepath) + assert linkpath.check(file=1) + assert not linkpath.check(link=0, file=1) + assert linkpath.islink() + + def test_symlink_relative(self, tmpdir): + linkpath = tmpdir.join("test") + filepath = tmpdir.join("file") + filepath.write("Hello") + linkpath.mksymlinkto(filepath, absolute=False) + assert linkpath.readlink() == "file" + assert filepath.read() == linkpath.read() + + def test_symlink_not_existing(self, tmpdir): + linkpath = tmpdir.join("testnotexisting") + assert not linkpath.check(link=1) + assert linkpath.check(link=0) + + def test_relto_with_root(self, path1, tmpdir): + y = path1.join("x").relto(local("/")) + assert y[0] == str(path1)[1] + + def test_visit_recursive_symlink(self, tmpdir): + linkpath = tmpdir.join("test") + linkpath.mksymlinkto(tmpdir) + visitor = tmpdir.visit(None, lambda x: x.check(link=0)) + assert list(visitor) == [linkpath] + + def test_symlink_isdir(self, tmpdir): + linkpath = tmpdir.join("test") + linkpath.mksymlinkto(tmpdir) + assert linkpath.check(dir=1) + assert not linkpath.check(link=0, dir=1) + + def test_symlink_remove(self, tmpdir): + linkpath = tmpdir.join("test") + linkpath.mksymlinkto(linkpath) # point to itself + assert linkpath.check(link=1) + linkpath.remove() + assert not linkpath.check() + + def test_realpath_file(self, tmpdir): + linkpath = tmpdir.join("test") + filepath = tmpdir.join("file") + filepath.write("") + linkpath.mksymlinkto(filepath) + realpath = linkpath.realpath() + assert realpath.basename == "file" + + def test_owner(self, path1, tmpdir): + from pwd import getpwuid + from grp import getgrgid + + stat = path1.stat() + assert stat.path == path1 + + uid = stat.uid + gid = stat.gid + owner = getpwuid(uid)[0] + group = getgrgid(gid)[0] + + assert uid == stat.uid + assert owner == stat.owner + assert gid == stat.gid + assert group == stat.group + + def test_stat_helpers(self, tmpdir, monkeypatch): + path1 = tmpdir.ensure("file") + stat1 = path1.stat() + stat2 = tmpdir.stat() + assert stat1.isfile() + assert stat2.isdir() + assert not stat1.islink() + assert not stat2.islink() + + def test_stat_non_raising(self, tmpdir): + path1 = tmpdir.join("file") + pytest.raises(error.ENOENT, lambda: path1.stat()) + res = path1.stat(raising=False) + assert res is None + + def test_atime(self, tmpdir): + import time + + path = tmpdir.ensure("samplefile") + now = time.time() + atime1 = path.atime() + # we could wait here but timer resolution is very + # system dependent + path.read() + time.sleep(ATIME_RESOLUTION) + atime2 = path.atime() + time.sleep(ATIME_RESOLUTION) + duration = time.time() - now + assert (atime2 - atime1) <= duration + + def test_commondir(self, path1): + # XXX This is here in local until we find a way to implement this + # using the subversion command line api. + p1 = path1.join("something") + p2 = path1.join("otherthing") + assert p1.common(p2) == path1 + assert p2.common(p1) == path1 + + def test_commondir_nocommon(self, path1): + # XXX This is here in local until we find a way to implement this + # using the subversion command line api. + p1 = path1.join("something") + p2 = local(path1.sep + "blabla") + assert p1.common(p2) == "/" + + def test_join_to_root(self, path1): + root = path1.parts()[0] + assert len(str(root)) == 1 + assert str(root.join("a")) == "/a" + + def test_join_root_to_root_with_no_abs(self, path1): + nroot = path1.join("/") + assert str(path1) == str(nroot) + assert path1 == nroot + + def test_chmod_simple_int(self, path1): + mode = path1.stat().mode + path1.chmod(int(mode / 2)) + try: + assert path1.stat().mode != mode + finally: + path1.chmod(mode) + assert path1.stat().mode == mode + + def test_chmod_rec_int(self, path1): + # XXX fragile test + def recfilter(x): + return x.check(dotfile=0, link=0) + + oldmodes = {} + for x in path1.visit(rec=recfilter): + oldmodes[x] = x.stat().mode + path1.chmod(int("772", 8), rec=recfilter) + try: + for x in path1.visit(rec=recfilter): + assert x.stat().mode & int("777", 8) == int("772", 8) + finally: + for x, y in oldmodes.items(): + x.chmod(y) + + def test_copy_archiving(self, tmpdir): + unicode_fn = "something-\342\200\223.txt" + f = tmpdir.ensure("a", unicode_fn) + a = f.dirpath() + oldmode = f.stat().mode + newmode = oldmode ^ 1 + f.chmod(newmode) + b = tmpdir.join("b") + a.copy(b, mode=True) + assert b.join(f.basename).stat().mode == newmode + + def test_copy_stat_file(self, tmpdir): + src = tmpdir.ensure("src") + dst = tmpdir.join("dst") + # a small delay before the copy + time.sleep(ATIME_RESOLUTION) + src.copy(dst, stat=True) + oldstat = src.stat() + newstat = dst.stat() + assert oldstat.mode == newstat.mode + assert (dst.atime() - src.atime()) < ATIME_RESOLUTION + assert (dst.mtime() - src.mtime()) < ATIME_RESOLUTION + + def test_copy_stat_dir(self, tmpdir): + test_files = ["a", "b", "c"] + src = tmpdir.join("src") + for f in test_files: + src.join(f).write(f, ensure=True) + dst = tmpdir.join("dst") + # a small delay before the copy + time.sleep(ATIME_RESOLUTION) + src.copy(dst, stat=True) + for f in test_files: + oldstat = src.join(f).stat() + newstat = dst.join(f).stat() + assert (newstat.atime - oldstat.atime) < ATIME_RESOLUTION + assert (newstat.mtime - oldstat.mtime) < ATIME_RESOLUTION + assert oldstat.mode == newstat.mode + + def test_chown_identity(self, path1): + owner = path1.stat().owner + group = path1.stat().group + path1.chown(owner, group) + + def test_chown_dangling_link(self, path1): + owner = path1.stat().owner + group = path1.stat().group + x = path1.join("hello") + x.mksymlinkto("qlwkejqwlek") + try: + path1.chown(owner, group, rec=1) + finally: + x.remove(rec=0) + + def test_chown_identity_rec_mayfail(self, path1): + owner = path1.stat().owner + group = path1.stat().group + path1.chown(owner, group) + + +class TestUnicodePy2Py3: + def test_join_ensure(self, tmpdir, monkeypatch): + if sys.version_info >= (3, 0) and "LANG" not in os.environ: + pytest.skip("cannot run test without locale") + x = local(tmpdir.strpath) + part = "hällo" + y = x.ensure(part) + assert x.join(part) == y + + def test_listdir(self, tmpdir): + if sys.version_info >= (3, 0) and "LANG" not in os.environ: + pytest.skip("cannot run test without locale") + x = local(tmpdir.strpath) + part = "hällo" + y = x.ensure(part) + assert x.listdir(part)[0] == y + + @pytest.mark.xfail(reason="changing read/write might break existing usages") + def test_read_write(self, tmpdir): + x = tmpdir.join("hello") + part = "hällo" + x.write(part) + assert x.read() == part + x.write(part.encode(sys.getdefaultencoding())) + assert x.read() == part.encode(sys.getdefaultencoding()) + + +class TestBinaryAndTextMethods: + def test_read_binwrite(self, tmpdir): + x = tmpdir.join("hello") + part = "hällo" + part_utf8 = part.encode("utf8") + x.write_binary(part_utf8) + assert x.read_binary() == part_utf8 + s = x.read_text(encoding="utf8") + assert s == part + assert isinstance(s, str) + + def test_read_textwrite(self, tmpdir): + x = tmpdir.join("hello") + part = "hällo" + part_utf8 = part.encode("utf8") + x.write_text(part, encoding="utf8") + assert x.read_binary() == part_utf8 + assert x.read_text(encoding="utf8") == part + + def test_default_encoding(self, tmpdir): + x = tmpdir.join("hello") + # Can't use UTF8 as the default encoding (ASCII) doesn't support it + part = "hello" + x.write_text(part, "ascii") + s = x.read_text("ascii") + assert s == part + assert type(s) == type(part) From dc0cb0d149c03767b762c8e80ed2a1337aaf6161 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 22:07:53 -0400 Subject: [PATCH 416/549] fix test pollution of sys.modules --- testing/_py/test_local.py | 7 +++++++ testing/test_pathlib.py | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/testing/_py/test_local.py b/testing/_py/test_local.py index 6e2c44bc2e0..ceacd70ae2e 100644 --- a/testing/_py/test_local.py +++ b/testing/_py/test_local.py @@ -2,6 +2,7 @@ import os import sys import time +from unittest import mock import pytest from py import error @@ -978,6 +979,12 @@ def test_error_preservation(self, path1): class TestImport: + @pytest.fixture(autouse=True) + def preserve_sys(self): + with mock.patch.dict(sys.modules): + with mock.patch.object(sys, "path", list(sys.path)): + yield + def test_pyimport(self, path1): obj = path1.join("execfile.py").pyimport() assert obj.x == 42 diff --git a/testing/test_pathlib.py b/testing/test_pathlib.py index c901dc6f435..577c7749fd9 100644 --- a/testing/test_pathlib.py +++ b/testing/test_pathlib.py @@ -91,6 +91,12 @@ def path1(self, tmp_path_factory: TempPathFactory) -> Generator[Path, None, None yield path assert path.joinpath("samplefile").exists() + @pytest.fixture(autouse=True) + def preserve_sys(self): + with unittest.mock.patch.dict(sys.modules): + with unittest.mock.patch.object(sys, "path", list(sys.path)): + yield + def setuptestfs(self, path: Path) -> None: # print "setting up test fs for", repr(path) samplefile = path / "samplefile" From 02a9371259f651f17f38fc9f406eb43a0fcf2e2d Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 19 Oct 2022 22:28:51 -0400 Subject: [PATCH 417/549] adjust tests if py library is installed --- testing/_py/test_local.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/testing/_py/test_local.py b/testing/_py/test_local.py index ceacd70ae2e..31c10b16021 100644 --- a/testing/_py/test_local.py +++ b/testing/_py/test_local.py @@ -909,8 +909,12 @@ def test_sysexec(self): assert out.find(x.basename) != -1 def test_sysexec_failing(self): + try: + from py._process.cmdexec import ExecutionFailed # py library + except ImportError: + ExecutionFailed = RuntimeError # py vendored x = local.sysfind("false") - with pytest.raises(RuntimeError): + with pytest.raises(ExecutionFailed): x.sysexec("aksjdkasjd") def test_make_numbered_dir(self, tmpdir): @@ -1146,7 +1150,10 @@ def test_pypkgdir_unimportable(tmpdir): def test_isimportable(): - from py.path import isimportable + try: + from py.path import isimportable # py vendored version + except ImportError: + from py._path.local import isimportable # py library assert not isimportable("") assert isimportable("x") From 508be0b2bfdafeff31ed33e3d3403aff1252a87f Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 20 Oct 2022 17:15:57 -0400 Subject: [PATCH 418/549] add -pylib tox environment --- .github/workflows/test.yml | 4 ++-- tox.ini | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3f3e7e535eb..b33c88b9f67 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -66,7 +66,7 @@ jobs: - name: "windows-py37-pluggy" python: "3.7" os: windows-latest - tox_env: "py37-pluggymain-xdist" + tox_env: "py37-pluggymain-pylib-xdist" - name: "windows-py38" python: "3.8" os: windows-latest @@ -93,7 +93,7 @@ jobs: - name: "ubuntu-py37-pluggy" python: "3.7" os: ubuntu-latest - tox_env: "py37-pluggymain-xdist" + tox_env: "py37-pluggymain-pylib-xdist" - name: "ubuntu-py37-freeze" python: "3.7" os: ubuntu-latest diff --git a/tox.ini b/tox.ini index f1ab4b815a5..f04242c5c43 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ envlist = py310 py311 pypy3 - py37-{pexpect,xdist,unittestextras,numpy,pluggymain} + py37-{pexpect,xdist,unittestextras,numpy,pluggymain,pylib} doctesting plugins py37-freeze @@ -54,6 +54,7 @@ deps = numpy: numpy>=1.19.4 pexpect: pexpect>=4.8.0 pluggymain: pluggy @ git+https://github.com/pytest-dev/pluggy.git + pylib: py>=1.8.2 unittestextras: twisted unittestextras: asynctest xdist: pytest-xdist>=2.1.0 From 6b905ee6dc7301f95714006037f869a15d518d58 Mon Sep 17 00:00:00 2001 From: Nate Meyvis Date: Fri, 21 Oct 2022 11:17:01 -0400 Subject: [PATCH 419/549] Add note on tags to CONTRIBUTING.rst Tags from the main repository are required for testing to work properly, but the current documentation does not reflect this, and at least one new contributor has been tripped up by this. Update the documentation with a short explanation and directions. --- CONTRIBUTING.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 22c3ecefb6c..222e5bd2ee3 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -243,6 +243,11 @@ Here is a simple overview, with pytest-specific bits: Given we have "major.minor.micro" version numbers, bug fixes will usually be released in micro releases whereas features will be released in minor releases and incompatible changes in major releases. + + You will need the tags to test locally, so be sure you have the tags from the main repository. If you suspect you don't, set the main repository as upstream and fetch the tags:: + + $ git remote add upstream https://github.com/pytest-dev/pytest + $ git fetch upstream --tags If you need some help with Git, follow this quick start guide: https://git.wiki.kernel.org/index.php/QuickStart From 1027dc8c091369ff5e67d97d2a9c09cbf7bc921e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 21 Oct 2022 15:18:44 +0000 Subject: [PATCH 420/549] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- CONTRIBUTING.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 222e5bd2ee3..e7545ea8c60 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -243,9 +243,9 @@ Here is a simple overview, with pytest-specific bits: Given we have "major.minor.micro" version numbers, bug fixes will usually be released in micro releases whereas features will be released in minor releases and incompatible changes in major releases. - + You will need the tags to test locally, so be sure you have the tags from the main repository. If you suspect you don't, set the main repository as upstream and fetch the tags:: - + $ git remote add upstream https://github.com/pytest-dev/pytest $ git fetch upstream --tags From d543a45a6802defbafcff259bdc235af76f7af3a Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 21 Oct 2022 12:46:15 -0400 Subject: [PATCH 421/549] add deprecation changelog for py library vendoring --- changelog/10396.deprecation.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/10396.deprecation.rst diff --git a/changelog/10396.deprecation.rst b/changelog/10396.deprecation.rst new file mode 100644 index 00000000000..84461e82ede --- /dev/null +++ b/changelog/10396.deprecation.rst @@ -0,0 +1 @@ +pytest no longer depends on the ``py`` library. ``pytest`` provides a vendored copy of ``py.error`` and ``py.path`` modules but will use the ``py`` library if it is installed. If you need other ``py.*`` modules, continue to install the deprecated ``py`` library separately, otherwise it can usually be removed as a dependency. From c5c562b645a62a919856d255fd83015cce75014c Mon Sep 17 00:00:00 2001 From: Nate Meyvis Date: Fri, 21 Oct 2022 13:06:44 -0400 Subject: [PATCH 422/549] Fix typos in CONTRIBUTING.rst Fix small grammatical issues in CONTRIBUTING.rst to improve readability. --- CONTRIBUTING.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index e7545ea8c60..791f988306f 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -385,7 +385,7 @@ them. Backporting bug fixes for the next patch release ------------------------------------------------ -Pytest makes feature release every few weeks or months. In between, patch releases +Pytest makes a feature release every few weeks or months. In between, patch releases are made to the previous feature release, containing bug fixes only. The bug fixes usually fix regressions, but may be any change that should reach users before the next feature release. @@ -394,7 +394,7 @@ Suppose for example that the latest release was 1.2.3, and you want to include a bug fix in 1.2.4 (check https://github.com/pytest-dev/pytest/releases for the actual latest release). The procedure for this is: -#. First, make sure the bug is fixed the ``main`` branch, with a regular pull +#. First, make sure the bug is fixed in the ``main`` branch, with a regular pull request, as described above. An exception to this is if the bug fix is not applicable to ``main`` anymore. From d35209826190c831a338fb2a958215c7e4b5b269 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Fri, 21 Oct 2022 13:11:43 -0400 Subject: [PATCH 423/549] allow jobs to pass if codecov.io fails --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3f3e7e535eb..1ca7c924e8a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -184,6 +184,7 @@ jobs: - name: Upload coverage to Codecov if: "matrix.use_coverage" uses: codecov/codecov-action@v3 + continue-on-error: true with: fail_ci_if_error: true files: ./coverage.xml From 9e1804a6ee1a0e2a929713e114f310b980d3c616 Mon Sep 17 00:00:00 2001 From: Itxaso Aizpurua <115184221+itxasos23@users.noreply.github.com> Date: Sun, 23 Oct 2022 23:23:34 +0200 Subject: [PATCH 424/549] Add --log-disable CLI option (#10371) Fixes #7431 --- changelog/7431.feature.rst | 1 + doc/en/how-to/logging.rst | 7 ++++ src/_pytest/logging.py | 16 +++++++ testing/logging/test_reporting.py | 69 +++++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 changelog/7431.feature.rst diff --git a/changelog/7431.feature.rst b/changelog/7431.feature.rst new file mode 100644 index 00000000000..24a64a2ae37 --- /dev/null +++ b/changelog/7431.feature.rst @@ -0,0 +1 @@ +``--log-disable`` CLI option added to disable individual loggers. diff --git a/doc/en/how-to/logging.rst b/doc/en/how-to/logging.rst index c99835a2baf..9957a9bb886 100644 --- a/doc/en/how-to/logging.rst +++ b/doc/en/how-to/logging.rst @@ -55,6 +55,13 @@ These options can also be customized through ``pytest.ini`` file: log_format = %(asctime)s %(levelname)s %(message)s log_date_format = %Y-%m-%d %H:%M:%S +Specific loggers can be disabled via ``--log-disable={logger_name}``. +This argument can be passed multiple times: + +.. code-block:: bash + + pytest --log-disable=main --log-disable=testing + Further it is possible to disable reporting of captured content (stdout, stderr and logs) on failed tests completely with: diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index f9091399f2c..4e3d12475d1 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -297,6 +297,13 @@ def add_option_ini(option, dest, default=None, type=None, **kwargs): default=None, help="Auto-indent multiline messages passed to the logging module. Accepts true|on, false|off or an integer.", ) + group.addoption( + "--log-disable", + action="append", + default=[], + dest="logger_disable", + help="Disable a logger by name. Can be passed multipe times.", + ) _HandlerType = TypeVar("_HandlerType", bound=logging.Handler) @@ -594,6 +601,15 @@ def __init__(self, config: Config) -> None: get_option_ini(config, "log_auto_indent"), ) self.log_cli_handler.setFormatter(log_cli_formatter) + self._disable_loggers(loggers_to_disable=config.option.logger_disable) + + def _disable_loggers(self, loggers_to_disable: List[str]) -> None: + if not loggers_to_disable: + return + + for name in loggers_to_disable: + logger = logging.getLogger(name) + logger.disabled = True def _create_formatter(self, log_format, log_date_format, auto_indent): # Color option doesn't exist if terminal plugin is disabled. diff --git a/testing/logging/test_reporting.py b/testing/logging/test_reporting.py index 323ff7b2446..3cd8599b417 100644 --- a/testing/logging/test_reporting.py +++ b/testing/logging/test_reporting.py @@ -1165,3 +1165,72 @@ def test_log_file_cli_subdirectories_are_successfully_created( result = pytester.runpytest("--log-file=foo/bar/logf.log") assert "logf.log" in os.listdir(expected) assert result.ret == ExitCode.OK + + +def test_disable_loggers(testdir): + testdir.makepyfile( + """ + import logging + import os + disabled_log = logging.getLogger('disabled') + test_log = logging.getLogger('test') + def test_logger_propagation(caplog): + with caplog.at_level(logging.DEBUG): + disabled_log.warning("no log; no stderr") + test_log.debug("Visible text!") + assert caplog.record_tuples == [('test', 10, 'Visible text!')] + """ + ) + result = testdir.runpytest("--log-disable=disabled", "-s") + assert result.ret == ExitCode.OK + assert not result.stderr.lines + + +def test_disable_loggers_does_not_propagate(testdir): + testdir.makepyfile( + """ + import logging + import os + + parent_logger = logging.getLogger("parent") + child_logger = parent_logger.getChild("child") + + def test_logger_propagation_to_parent(caplog): + with caplog.at_level(logging.DEBUG): + parent_logger.warning("some parent logger message") + child_logger.warning("some child logger message") + assert len(caplog.record_tuples) == 1 + assert caplog.record_tuples[0][0] == "parent" + assert caplog.record_tuples[0][2] == "some parent logger message" + """ + ) + + result = testdir.runpytest("--log-disable=parent.child", "-s") + assert result.ret == ExitCode.OK + assert not result.stderr.lines + + +def test_log_disabling_works_with_log_cli(testdir): + testdir.makepyfile( + """ + import logging + disabled_log = logging.getLogger('disabled') + test_log = logging.getLogger('test') + + def test_log_cli_works(caplog): + test_log.info("Visible text!") + disabled_log.warning("This string will be suppressed.") + """ + ) + result = testdir.runpytest( + "--log-cli-level=DEBUG", + "--log-disable=disabled", + ) + assert result.ret == ExitCode.OK + result.stdout.fnmatch_lines( + "INFO test:test_log_disabling_works_with_log_cli.py:6 Visible text!" + ) + result.stdout.no_fnmatch_line( + "WARNING disabled:test_log_disabling_works_with_log_cli.py:7 This string will be suppressed." + ) + assert not result.stderr.lines From 3a68c08426326e6c8129e94f98d263131da9a032 Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Sun, 23 Oct 2022 15:06:29 -0700 Subject: [PATCH 425/549] Use exceptiongroup for teardown errors --- changelog/10226.improvement.rst | 1 + src/_pytest/runner.py | 24 ++++++++++++++++------- testing/test_runner.py | 34 +++++++++++++++++++++++++++++---- 3 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 changelog/10226.improvement.rst diff --git a/changelog/10226.improvement.rst b/changelog/10226.improvement.rst new file mode 100644 index 00000000000..f1506eaf79e --- /dev/null +++ b/changelog/10226.improvement.rst @@ -0,0 +1 @@ +If multiple errors are raised in teardown, we now re-raise an ``ExceptionGroup`` of them instead of discarding all but the last. diff --git a/src/_pytest/runner.py b/src/_pytest/runner.py index 584c3229d5f..cc17cf2f4a8 100644 --- a/src/_pytest/runner.py +++ b/src/_pytest/runner.py @@ -35,6 +35,9 @@ from _pytest.outcomes import Skipped from _pytest.outcomes import TEST_OUTCOME +if sys.version_info[:2] < (3, 11): + from exceptiongroup import BaseExceptionGroup + if TYPE_CHECKING: from typing_extensions import Literal @@ -512,22 +515,29 @@ def teardown_exact(self, nextitem: Optional[Item]) -> None: stack is torn down. """ needed_collectors = nextitem and nextitem.listchain() or [] - exc = None + exceptions: List[BaseException] = [] while self.stack: if list(self.stack.keys()) == needed_collectors[: len(self.stack)]: break node, (finalizers, _) = self.stack.popitem() + these_exceptions = [] while finalizers: fin = finalizers.pop() try: fin() except TEST_OUTCOME as e: - # XXX Only first exception will be seen by user, - # ideally all should be reported. - if exc is None: - exc = e - if exc: - raise exc + these_exceptions.append(e) + + if len(these_exceptions) == 1: + exceptions.extend(these_exceptions) + elif these_exceptions: + msg = f"errors while tearing down {node!r}" + exceptions.append(BaseExceptionGroup(msg, these_exceptions[::-1])) + + if len(exceptions) == 1: + raise exceptions[0] + elif exceptions: + raise BaseExceptionGroup("errors during test teardown", exceptions[::-1]) if nextitem is None: assert not self.stack diff --git a/testing/test_runner.py b/testing/test_runner.py index 2e2c462d978..49adc04fe2f 100644 --- a/testing/test_runner.py +++ b/testing/test_runner.py @@ -2,6 +2,7 @@ import os import sys import types +from functools import partial from pathlib import Path from typing import Dict from typing import List @@ -19,6 +20,9 @@ from _pytest.outcomes import OutcomeException from _pytest.pytester import Pytester +if sys.version_info[:2] < (3, 11): + from exceptiongroup import ExceptionGroup + class TestSetupState: def test_setup(self, pytester: Pytester) -> None: @@ -77,8 +81,6 @@ def fin3(): assert r == ["fin3", "fin1"] def test_teardown_multiple_fail(self, pytester: Pytester) -> None: - # Ensure the first exception is the one which is re-raised. - # Ideally both would be reported however. def fin1(): raise Exception("oops1") @@ -90,9 +92,14 @@ def fin2(): ss.setup(item) ss.addfinalizer(fin1, item) ss.addfinalizer(fin2, item) - with pytest.raises(Exception) as err: + with pytest.raises(ExceptionGroup) as err: ss.teardown_exact(None) - assert err.value.args == ("oops2",) + + # Note that finalizers are run LIFO, but because FIFO is more intuitive for + # users we reverse the order of messages, and see the error from fin1 first. + err1, err2 = err.value.exceptions + assert err1.args == ("oops1",) + assert err2.args == ("oops2",) def test_teardown_multiple_scopes_one_fails(self, pytester: Pytester) -> None: module_teardown = [] @@ -113,6 +120,25 @@ def fin_module(): ss.teardown_exact(None) assert module_teardown == ["fin_module"] + def test_teardown_multiple_scopes_several_fail(self, pytester) -> None: + def raiser(exc): + raise exc + + item = pytester.getitem("def test_func(): pass") + mod = item.listchain()[-2] + ss = item.session._setupstate + ss.setup(item) + ss.addfinalizer(partial(raiser, KeyError("from module scope")), mod) + ss.addfinalizer(partial(raiser, TypeError("from function scope 1")), item) + ss.addfinalizer(partial(raiser, ValueError("from function scope 2")), item) + + with pytest.raises(ExceptionGroup, match="errors during test teardown") as e: + ss.teardown_exact(None) + mod, func = e.value.exceptions + assert isinstance(mod, KeyError) + assert isinstance(func.exceptions[0], TypeError) # type: ignore + assert isinstance(func.exceptions[1], ValueError) # type: ignore + class BaseFunctionalTests: def test_passfunction(self, pytester: Pytester) -> None: From 66db0b7522db8315349e5f28d37165eeac0aa925 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 03:04:15 +0000 Subject: [PATCH 426/549] build(deps): Bump anyio[curio,trio] in /testing/plugins_integration Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio) from 3.6.1 to 3.6.2. - [Release notes](https://github.com/agronholm/anyio/releases) - [Changelog](https://github.com/agronholm/anyio/blob/3.6.2/docs/versionhistory.rst) - [Commits](https://github.com/agronholm/anyio/compare/3.6.1...3.6.2) --- updated-dependencies: - dependency-name: anyio[curio,trio] dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 79156133348..93397263981 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,4 +1,4 @@ -anyio[curio,trio]==3.6.1 +anyio[curio,trio]==3.6.2 django==4.1.2 pytest-asyncio==0.19.0 pytest-bdd==6.0.1 From e75e2d66a06fb406074445ac07205d1ae62815c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 03:04:18 +0000 Subject: [PATCH 427/549] build(deps): Bump pytest-asyncio in /testing/plugins_integration Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.19.0 to 0.20.1. - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Changelog](https://github.com/pytest-dev/pytest-asyncio/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.19.0...v0.20.1) --- updated-dependencies: - dependency-name: pytest-asyncio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 79156133348..e1dacecb34b 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,6 +1,6 @@ anyio[curio,trio]==3.6.1 django==4.1.2 -pytest-asyncio==0.19.0 +pytest-asyncio==0.20.1 pytest-bdd==6.0.1 pytest-cov==4.0.0 pytest-django==4.5.2 From 2b552c224068c7d118ed9a2d1edded977b86c32f Mon Sep 17 00:00:00 2001 From: Klaus Rettinghaus Date: Mon, 24 Oct 2022 14:58:03 +0200 Subject: [PATCH 428/549] update actions --- .github/workflows/backport.yml | 2 +- .github/workflows/deploy.yml | 4 ++-- .github/workflows/prepare-release-pr.yml | 4 ++-- .github/workflows/update-plugin-list.yml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index f7840d537cf..aa90b51e273 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -22,7 +22,7 @@ jobs: pull-requests: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 persist-credentials: true diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 54c74863f84..7341cb8d31e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -23,13 +23,13 @@ jobs: contents: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 persist-credentials: false - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: "3.7" diff --git a/.github/workflows/prepare-release-pr.yml b/.github/workflows/prepare-release-pr.yml index 429834b3f21..76bf14d7e56 100644 --- a/.github/workflows/prepare-release-pr.yml +++ b/.github/workflows/prepare-release-pr.yml @@ -27,12 +27,12 @@ jobs: pull-requests: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: "3.8" diff --git a/.github/workflows/update-plugin-list.yml b/.github/workflows/update-plugin-list.yml index 193469072ff..18f3e9783f2 100644 --- a/.github/workflows/update-plugin-list.yml +++ b/.github/workflows/update-plugin-list.yml @@ -20,12 +20,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.8 From deae8f47f619cb283d01e917b5851101184a30e2 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 24 Oct 2022 19:23:40 -0300 Subject: [PATCH 429/549] Use specific tag in the gh-action-pypi-publish action Otherwise we see this warning: Warning: You are using "pypa/gh-action-pypi-publish@master". The "master" branch of this project has been sunset and will not receive any updates, not even security bug fixes. Please, make sure to use a supported version. If you want to pin to v1 major version, use "pypa/gh-action-pypi-publish@release/v1". If you feel adventurous, you may opt to use use "pypa/gh-action-pypi-publish@unstable/v1" instead. A more general recommendation is to pin to exact tags or commit shas. --- .github/workflows/deploy.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7341cb8d31e..1b865065296 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -43,9 +43,8 @@ jobs: python -m build - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: - user: __token__ password: ${{ secrets.pypi_token }} - name: Publish GitHub release notes From bbe7cbae4aa24f4cb65230704b870c5dcf40781e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 20:25:15 -0300 Subject: [PATCH 430/549] [pre-commit.ci] pre-commit autoupdate (#10418) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/autoflake: v1.7.6 → v1.7.7](https://github.com/PyCQA/autoflake/compare/v1.7.6...v1.7.7) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index de612d96988..ef181f1787a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: exclude: _pytest/(debugging|hookspec).py language_version: python3 - repo: https://github.com/PyCQA/autoflake - rev: v1.7.6 + rev: v1.7.7 hooks: - id: autoflake name: autoflake From 5a040aef97baf5e11fae72ed13c11a877eff16ae Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 25 Oct 2022 13:12:55 +0200 Subject: [PATCH 431/549] Merge pull request #10412 from pytest-dev/release-7.2.0 (#10419) Prepare release 7.2.0 (cherry picked from commit ac4e3cced9fb1df60df271cce308f07713764857) --- changelog/10012.deprecation.rst | 1 - changelog/10150.bugfix.rst | 1 - changelog/10196.trivial.rst | 1 - changelog/10218.improvement.rst | 5 - changelog/10313.trivial.rst | 3 - changelog/10344.doc.rst | 1 - changelog/10381.improvement.rst | 1 - changelog/10382.bugfix.rst | 1 - changelog/10396.deprecation.rst | 1 - changelog/3426.improvement.rst | 1 - changelog/4562.deprecation.rst | 4 - changelog/7337.improvement.rst | 1 - changelog/7792.bugfix.rst | 5 - changelog/8508.improvement.rst | 2 - changelog/8646.improvement.rst | 2 - changelog/9159.bugfix.rst | 1 - changelog/9248.doc.rst | 1 - changelog/9291.doc.rst | 1 - changelog/9741.improvement.rst | 3 - changelog/9742.improvement.rst | 1 - changelog/9823.improvement.rst | 1 - changelog/9873.improvement.rst | 1 - changelog/9877.bugfix.rst | 1 - changelog/9883.improvement.rst | 1 - changelog/9886.deprecation.rst | 10 -- changelog/9897.feature.rst | 1 - changelog/9906.trivial.rst | 1 - changelog/9910.trivial.rst | 1 - changelog/9920.improvement.rst | 1 - changelog/9984.trivial.rst | 4 - changelog/9987.improvement.rst | 1 - doc/en/announce/index.rst | 1 + doc/en/announce/release-7.2.0.rst | 93 +++++++++++++++++++ doc/en/builtin.rst | 27 +++--- doc/en/changelog.rst | 148 ++++++++++++++++++++++++++++++ doc/en/example/markers.rst | 10 +- doc/en/example/simple.rst | 3 +- doc/en/getting-started.rst | 2 +- doc/en/how-to/cache.rst | 4 +- doc/en/how-to/output.rst | 3 +- doc/en/how-to/unittest.rst | 4 +- doc/en/reference/reference.rst | 69 +++++++------- 42 files changed, 302 insertions(+), 122 deletions(-) delete mode 100644 changelog/10012.deprecation.rst delete mode 100644 changelog/10150.bugfix.rst delete mode 100644 changelog/10196.trivial.rst delete mode 100644 changelog/10218.improvement.rst delete mode 100644 changelog/10313.trivial.rst delete mode 100644 changelog/10344.doc.rst delete mode 100644 changelog/10381.improvement.rst delete mode 100644 changelog/10382.bugfix.rst delete mode 100644 changelog/10396.deprecation.rst delete mode 100644 changelog/3426.improvement.rst delete mode 100644 changelog/4562.deprecation.rst delete mode 100644 changelog/7337.improvement.rst delete mode 100644 changelog/7792.bugfix.rst delete mode 100644 changelog/8508.improvement.rst delete mode 100644 changelog/8646.improvement.rst delete mode 100644 changelog/9159.bugfix.rst delete mode 100644 changelog/9248.doc.rst delete mode 100644 changelog/9291.doc.rst delete mode 100644 changelog/9741.improvement.rst delete mode 100644 changelog/9742.improvement.rst delete mode 100644 changelog/9823.improvement.rst delete mode 100644 changelog/9873.improvement.rst delete mode 100644 changelog/9877.bugfix.rst delete mode 100644 changelog/9883.improvement.rst delete mode 100644 changelog/9886.deprecation.rst delete mode 100644 changelog/9897.feature.rst delete mode 100644 changelog/9906.trivial.rst delete mode 100644 changelog/9910.trivial.rst delete mode 100644 changelog/9920.improvement.rst delete mode 100644 changelog/9984.trivial.rst delete mode 100644 changelog/9987.improvement.rst create mode 100644 doc/en/announce/release-7.2.0.rst diff --git a/changelog/10012.deprecation.rst b/changelog/10012.deprecation.rst deleted file mode 100644 index 66681263e32..00000000000 --- a/changelog/10012.deprecation.rst +++ /dev/null @@ -1 +0,0 @@ -Update :class:`pytest.PytestUnhandledCoroutineWarning` to a deprecation; it will raise an error in pytest 8. diff --git a/changelog/10150.bugfix.rst b/changelog/10150.bugfix.rst deleted file mode 100644 index 24c7ccd355a..00000000000 --- a/changelog/10150.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -:data:`sys.stdin` now contains all expected methods of a file-like object when capture is enabled. diff --git a/changelog/10196.trivial.rst b/changelog/10196.trivial.rst deleted file mode 100644 index edf458f84c5..00000000000 --- a/changelog/10196.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -:class:`~pytest.PytestReturnNotNoneWarning` is now a subclass of :class:`~pytest.PytestRemovedIn8Warning`: the plan is to make returning non-``None`` from tests an error in the future. diff --git a/changelog/10218.improvement.rst b/changelog/10218.improvement.rst deleted file mode 100644 index e00325e2567..00000000000 --- a/changelog/10218.improvement.rst +++ /dev/null @@ -1,5 +0,0 @@ -``@pytest.mark.parametrize()`` (and similar functions) now accepts any ``Sequence[str]`` for the argument names, -instead of just ``list[str]`` and ``tuple[str, ...]``. - -(Note that ``str``, which is itself a ``Sequence[str]``, is still treated as a -comma-delimited name list, as before). diff --git a/changelog/10313.trivial.rst b/changelog/10313.trivial.rst deleted file mode 100644 index 8203b580211..00000000000 --- a/changelog/10313.trivial.rst +++ /dev/null @@ -1,3 +0,0 @@ -Made ``_pytest.doctest.DoctestItem`` export ``pytest.DoctestItem`` for -type check and runtime purposes. Made `_pytest.doctest` use internal APIs -to avoid circular imports. diff --git a/changelog/10344.doc.rst b/changelog/10344.doc.rst deleted file mode 100644 index 1c7885edc20..00000000000 --- a/changelog/10344.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Update information on writing plugins to use ``pyproject.toml`` instead of ``setup.py``. diff --git a/changelog/10381.improvement.rst b/changelog/10381.improvement.rst deleted file mode 100644 index f979a83b132..00000000000 --- a/changelog/10381.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -The ``--no-showlocals`` flag has been added. This can be passed directly to tests to override ``--showlocals`` declared through ``addopts``. diff --git a/changelog/10382.bugfix.rst b/changelog/10382.bugfix.rst deleted file mode 100644 index 5876a9a43c2..00000000000 --- a/changelog/10382.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Do not break into pdb when ``raise unittest.SkipTest()`` appears top-level in a file. diff --git a/changelog/10396.deprecation.rst b/changelog/10396.deprecation.rst deleted file mode 100644 index 84461e82ede..00000000000 --- a/changelog/10396.deprecation.rst +++ /dev/null @@ -1 +0,0 @@ -pytest no longer depends on the ``py`` library. ``pytest`` provides a vendored copy of ``py.error`` and ``py.path`` modules but will use the ``py`` library if it is installed. If you need other ``py.*`` modules, continue to install the deprecated ``py`` library separately, otherwise it can usually be removed as a dependency. diff --git a/changelog/3426.improvement.rst b/changelog/3426.improvement.rst deleted file mode 100644 index e232d56aa6a..00000000000 --- a/changelog/3426.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -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 expresed instead. diff --git a/changelog/4562.deprecation.rst b/changelog/4562.deprecation.rst deleted file mode 100644 index d459801d4a6..00000000000 --- a/changelog/4562.deprecation.rst +++ /dev/null @@ -1,4 +0,0 @@ -Deprecate configuring hook specs/impls using attributes/marks. - -Instead use :py:func:`pytest.hookimpl` and :py:func:`pytest.hookspec`. -For more details, see the :ref:`docs `. diff --git a/changelog/7337.improvement.rst b/changelog/7337.improvement.rst deleted file mode 100644 index 74d98d9b6c9..00000000000 --- a/changelog/7337.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -A warning is now emitted if a test function returns something other than `None`. This prevents a common mistake among beginners that expect that returning a `bool` (for example `return foo(a, b) == result`) would cause a test to pass or fail, instead of using `assert`. diff --git a/changelog/7792.bugfix.rst b/changelog/7792.bugfix.rst deleted file mode 100644 index 8f65637896d..00000000000 --- a/changelog/7792.bugfix.rst +++ /dev/null @@ -1,5 +0,0 @@ -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 :func:`pytest.Node.iter_markers` instead. diff --git a/changelog/8508.improvement.rst b/changelog/8508.improvement.rst deleted file mode 100644 index 36fb945829c..00000000000 --- a/changelog/8508.improvement.rst +++ /dev/null @@ -1,2 +0,0 @@ -Introduce multiline display for warning matching via :py:func:`pytest.warns` and -enhance match comparison for :py:func:`_pytest._code.ExceptionInfo.match` as returned by :py:func:`pytest.raises`. diff --git a/changelog/8646.improvement.rst b/changelog/8646.improvement.rst deleted file mode 100644 index 9691c143429..00000000000 --- a/changelog/8646.improvement.rst +++ /dev/null @@ -1,2 +0,0 @@ -Improve :py:func:`pytest.raises`. Previously passing an empty tuple would give a confusing -error. We now raise immediately with a more helpful message. diff --git a/changelog/9159.bugfix.rst b/changelog/9159.bugfix.rst deleted file mode 100644 index 5e7f0a3014d..00000000000 --- a/changelog/9159.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -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``. diff --git a/changelog/9248.doc.rst b/changelog/9248.doc.rst deleted file mode 100644 index 755e7b0f1af..00000000000 --- a/changelog/9248.doc.rst +++ /dev/null @@ -1 +0,0 @@ -The documentation is now built using Sphinx 5.x (up from 3.x previously). diff --git a/changelog/9291.doc.rst b/changelog/9291.doc.rst deleted file mode 100644 index fad8467dc90..00000000000 --- a/changelog/9291.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Update documentation on how :func:`pytest.warns` affects :class:`DeprecationWarning`. diff --git a/changelog/9741.improvement.rst b/changelog/9741.improvement.rst deleted file mode 100644 index 1f9ab3eadf2..00000000000 --- a/changelog/9741.improvement.rst +++ /dev/null @@ -1,3 +0,0 @@ -On Python 3.11, use the standard library's :mod:`tomllib` to parse TOML. - -:mod:`tomli`` is no longer a dependency on Python 3.11. diff --git a/changelog/9742.improvement.rst b/changelog/9742.improvement.rst deleted file mode 100644 index a1abfc27469..00000000000 --- a/changelog/9742.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Display assertion message without escaped newline characters with ``-vv``. diff --git a/changelog/9823.improvement.rst b/changelog/9823.improvement.rst deleted file mode 100644 index 0a14cab6743..00000000000 --- a/changelog/9823.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Improved error message that is shown when no collector is found for a given file. diff --git a/changelog/9873.improvement.rst b/changelog/9873.improvement.rst deleted file mode 100644 index 431f9861b62..00000000000 --- a/changelog/9873.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Some coloring has been added to the short test summary. diff --git a/changelog/9877.bugfix.rst b/changelog/9877.bugfix.rst deleted file mode 100644 index 1d2264c6157..00000000000 --- a/changelog/9877.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Ensure ``caplog.get_records(when)`` returns current/correct data after invoking ``caplog.clear()``. diff --git a/changelog/9883.improvement.rst b/changelog/9883.improvement.rst deleted file mode 100644 index 180784b5dba..00000000000 --- a/changelog/9883.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Normalize the help description of all command-line options. diff --git a/changelog/9886.deprecation.rst b/changelog/9886.deprecation.rst deleted file mode 100644 index 94f51decfda..00000000000 --- a/changelog/9886.deprecation.rst +++ /dev/null @@ -1,10 +0,0 @@ -The functionality for running tests written for ``nose`` has been officially deprecated. - -This includes: - -* Plain ``setup`` and ``teardown`` functions and methods: this might catch users by surprise, as ``setup()`` and ``teardown()`` are not pytest idioms, but part of the ``nose`` support. -* Setup/teardown using the `@with_setup `_ decorator. - -For more details, consult the :ref:`deprecation docs `. - -.. _`with-setup-nose`: https://nose.readthedocs.io/en/latest/testing_tools.html?highlight=with_setup#nose.tools.with_setup diff --git a/changelog/9897.feature.rst b/changelog/9897.feature.rst deleted file mode 100644 index 7464067bfcd..00000000000 --- a/changelog/9897.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Added shell-style wildcard support to ``testpaths``. diff --git a/changelog/9906.trivial.rst b/changelog/9906.trivial.rst deleted file mode 100644 index 8911b7190f6..00000000000 --- a/changelog/9906.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Made ``_pytest.compat`` re-export ``importlib_metadata`` in the eyes of type checkers. diff --git a/changelog/9910.trivial.rst b/changelog/9910.trivial.rst deleted file mode 100644 index 4b1a4683c1e..00000000000 --- a/changelog/9910.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Fix default encoding warning (``EncodingWarning``) in ``cacheprovider`` diff --git a/changelog/9920.improvement.rst b/changelog/9920.improvement.rst deleted file mode 100644 index ed47e872cac..00000000000 --- a/changelog/9920.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Display full crash messages in ``short test summary info``, when runng in a CI environment. diff --git a/changelog/9984.trivial.rst b/changelog/9984.trivial.rst deleted file mode 100644 index cca8170629c..00000000000 --- a/changelog/9984.trivial.rst +++ /dev/null @@ -1,4 +0,0 @@ -Improve the error message when we attempt to access a fixture that has been -torn down. -Add an additional sentence to the docstring explaining when it's not a good -idea to call getfixturevalue. diff --git a/changelog/9987.improvement.rst b/changelog/9987.improvement.rst deleted file mode 100644 index cb1ae17ad2c..00000000000 --- a/changelog/9987.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Added support for hidden configuration file by allowing ``.pytest.ini`` as an alternative to ``pytest.ini``. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 142425cdee7..021cbd1af39 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-7.2.0 release-7.1.3 release-7.1.2 release-7.1.1 diff --git a/doc/en/announce/release-7.2.0.rst b/doc/en/announce/release-7.2.0.rst new file mode 100644 index 00000000000..eca84aeb669 --- /dev/null +++ b/doc/en/announce/release-7.2.0.rst @@ -0,0 +1,93 @@ +pytest-7.2.0 +======================================= + +The pytest team is proud to announce the 7.2.0 release! + +This release contains new features, improvements, and bug fixes, +the full list of changes is available in the changelog: + + https://docs.pytest.org/en/stable/changelog.html + +For complete documentation, please visit: + + https://docs.pytest.org/en/stable/ + +As usual, you can upgrade from PyPI via: + + pip install -U pytest + +Thanks to all of the contributors to this release: + +* Aaron Berdy +* Adam Turner +* Albert Villanova del Moral +* Alice Purcell +* Anthony Sottile +* Anton Yakutovich +* Babak Keyvani +* Brandon Chinn +* Bruno Oliveira +* Chanvin Xiao +* Cheuk Ting Ho +* Chris Wheeler +* EmptyRabbit +* Ezio Melotti +* Florian Best +* Florian Bruhin +* Fredrik Berndtsson +* Gabriel Landau +* Gergely Kalmár +* Hugo van Kemenade +* James Gerity +* John Litborn +* Jon Parise +* Kevin C +* Kian Eliasi +* MatthewFlamm +* Miro Hrončok +* Nate Meyvis +* Neil Girdhar +* Nhieuvu1802 +* Nipunn Koorapati +* Ofek Lev +* Paul Müller +* Paul Reece +* Pax +* Pete Baughman +* Peyman Salehi +* Philipp A +* Ran Benita +* Robert O'Shea +* Ronny Pfannschmidt +* Rowin +* Ruth Comer +* Samuel Colvin +* Samuel Gaist +* Sandro Tosi +* Shantanu +* Simon K +* Stephen Rosen +* Sviatoslav Sydorenko +* Tatiana Ovary +* Thierry Moisan +* Thomas Grainger +* Tim Hoffmann +* Tobias Diez +* Tony Narlock +* Vivaan Verma +* Wolfremium +* Zac Hatfield-Dodds +* Zach OBrien +* aizpurua23a +* gresm +* holesch +* itxasos23 +* johnkangw +* skhomuti +* sommersoft +* wodny +* zx.qiu + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index 7e22002245d..1f55ea156fc 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -33,7 +33,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a Values can be any object handled by the json stdlib module. - capsys -- .../_pytest/capture.py:878 + capsys -- .../_pytest/capture.py:905 Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``. The captured output is made available via ``capsys.readouterr()`` method @@ -51,7 +51,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a captured = capsys.readouterr() assert captured.out == "hello\n" - capsysbinary -- .../_pytest/capture.py:906 + capsysbinary -- .../_pytest/capture.py:933 Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``. The captured output is made available via ``capsysbinary.readouterr()`` @@ -69,7 +69,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a captured = capsysbinary.readouterr() assert captured.out == b"hello\n" - capfd -- .../_pytest/capture.py:934 + capfd -- .../_pytest/capture.py:961 Enable text capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method @@ -87,7 +87,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a captured = capfd.readouterr() assert captured.out == "hello\n" - capfdbinary -- .../_pytest/capture.py:962 + capfdbinary -- .../_pytest/capture.py:989 Enable bytes capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method @@ -105,7 +105,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a captured = capfdbinary.readouterr() assert captured.out == b"hello\n" - doctest_namespace [session scope] -- .../_pytest/doctest.py:735 + doctest_namespace [session scope] -- .../_pytest/doctest.py:738 Fixture that returns a :py:class:`dict` that will be injected into the namespace of doctests. @@ -119,7 +119,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a For more details: :ref:`doctest_namespace`. - pytestconfig [session scope] -- .../_pytest/fixtures.py:1344 + pytestconfig [session scope] -- .../_pytest/fixtures.py:1351 Session-scoped fixture that returns the session's :class:`pytest.Config` object. @@ -163,7 +163,10 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a record_testsuite_property("ARCH", "PPC") record_testsuite_property("STORAGE_TYPE", "CEPH") - ``name`` must be a string, ``value`` will be converted to a string and properly xml-escaped. + :param name: + The property name. + :param value: + The property value. Will be converted to a string. .. warning:: @@ -193,7 +196,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a .. _legacy_path: https://py.readthedocs.io/en/latest/path.html - caplog -- .../_pytest/logging.py:487 + caplog -- .../_pytest/logging.py:491 Access and control log capturing. Captured logs are available through the following properties/methods:: @@ -228,16 +231,16 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a To undo modifications done by the fixture in a contained scope, use :meth:`context() `. - recwarn -- .../_pytest/recwarn.py:29 + recwarn -- .../_pytest/recwarn.py:30 Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions. - See https://docs.python.org/library/how-to/capture-warnings.html for information + See https://docs.pytest.org/en/latest/how-to/capture-warnings.html for information on warning categories. - tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:184 + tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:188 Return a :class:`pytest.TempPathFactory` instance for the test session. - tmp_path -- .../_pytest/tmpdir.py:199 + tmp_path -- .../_pytest/tmpdir.py:203 Return a temporary directory path object which is unique to each test function invocation, created as a sub directory of the base temporary directory. diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index ef3a241cdb1..53ddafc52e7 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -28,6 +28,154 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 7.2.0 (2022-10-23) +========================= + +Deprecations +------------ + +- `#10012 `_: Update :class:`pytest.PytestUnhandledCoroutineWarning` to a deprecation; it will raise an error in pytest 8. + + +- `#10396 `_: pytest no longer depends on the ``py`` library. ``pytest`` provides a vendored copy of ``py.error`` and ``py.path`` modules but will use the ``py`` library if it is installed. If you need other ``py.*`` modules, continue to install the deprecated ``py`` library separately, otherwise it can usually be removed as a dependency. + + +- `#4562 `_: Deprecate configuring hook specs/impls using attributes/marks. + + Instead use :py:func:`pytest.hookimpl` and :py:func:`pytest.hookspec`. + For more details, see the :ref:`docs `. + + +- `#9886 `_: The functionality for running tests written for ``nose`` has been officially deprecated. + + This includes: + + * Plain ``setup`` and ``teardown`` functions and methods: this might catch users by surprise, as ``setup()`` and ``teardown()`` are not pytest idioms, but part of the ``nose`` support. + * Setup/teardown using the `@with_setup `_ decorator. + + For more details, consult the :ref:`deprecation docs `. + + .. _`with-setup-nose`: https://nose.readthedocs.io/en/latest/testing_tools.html?highlight=with_setup#nose.tools.with_setup + + + +Features +-------- + +- `#9897 `_: Added shell-style wildcard support to ``testpaths``. + + + +Improvements +------------ + +- `#10218 `_: ``@pytest.mark.parametrize()`` (and similar functions) now accepts any ``Sequence[str]`` for the argument names, + instead of just ``list[str]`` and ``tuple[str, ...]``. + + (Note that ``str``, which is itself a ``Sequence[str]``, is still treated as a + comma-delimited name list, as before). + + +- `#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 expresed instead. + + +- `#7337 `_: A warning is now emitted if a test function returns something other than `None`. This prevents a common mistake among beginners that expect that returning a `bool` (for example `return foo(a, b) == result`) would cause a test to pass or fail, instead of using `assert`. + + +- `#8508 `_: Introduce multiline display for warning matching via :py:func:`pytest.warns` and + enhance match comparison for :py:func:`_pytest._code.ExceptionInfo.match` as returned by :py:func:`pytest.raises`. + + +- `#8646 `_: Improve :py:func:`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 :mod:`tomllib` to parse TOML. + + :mod:`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 runng in a CI environment. + + +- `#9987 `_: Added support for hidden configuration file by allowing ``.pytest.ini`` as an alternative to ``pytest.ini``. + + + +Bug Fixes +--------- + +- `#10150 `_: :data:`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 :func:`pytest.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 :func:`pytest.warns` affects :class:`DeprecationWarning`. + + + +Trivial/Internal Changes +------------------------ + +- `#10196 `_: :class:`~pytest.PytestReturnNotNoneWarning` is now a subclass of :class:`~pytest.PytestRemovedIn8Warning`: the plan is to make returning non-``None`` from tests an error in the future. + + +- `#10313 `_: Made ``_pytest.doctest.DoctestItem`` export ``pytest.DoctestItem`` for + type check and runtime purposes. Made `_pytest.doctest` use internal APIs + to avoid circular imports. + + +- `#9906 `_: Made ``_pytest.compat`` re-export ``importlib_metadata`` in the eyes of type checkers. + + +- `#9910 `_: Fix default encoding warning (``EncodingWarning``) in ``cacheprovider`` + + +- `#9984 `_: Improve the error message when we attempt to access a fixture that has been + torn down. + Add an additional sentence to the docstring explaining when it's not a good + idea to call getfixturevalue. + + pytest 7.1.3 (2022-08-31) ========================= diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index 34d96c2bc00..55fd1f576cf 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -246,9 +246,9 @@ You can ask which markers exist for your test suite - the list includes our just @pytest.mark.usefixtures(fixturename1, fixturename2, ...): mark tests as needing all of the specified fixtures. see https://docs.pytest.org/en/stable/explanation/fixtures.html#usefixtures - @pytest.mark.tryfirst: mark a hook implementation function such that the plugin machinery will try to call it first/as early as possible. + @pytest.mark.tryfirst: mark a hook implementation function such that the plugin machinery will try to call it first/as early as possible. DEPRECATED, use @pytest.hookimpl(tryfirst=True) instead. - @pytest.mark.trylast: mark a hook implementation function such that the plugin machinery will try to call it last/as late as possible. + @pytest.mark.trylast: mark a hook implementation function such that the plugin machinery will try to call it last/as late as possible. DEPRECATED, use @pytest.hookimpl(trylast=True) instead. For an example on how to add and work with markers from a plugin, see @@ -438,9 +438,9 @@ The ``--markers`` option always gives you a list of available markers: @pytest.mark.usefixtures(fixturename1, fixturename2, ...): mark tests as needing all of the specified fixtures. see https://docs.pytest.org/en/stable/explanation/fixtures.html#usefixtures - @pytest.mark.tryfirst: mark a hook implementation function such that the plugin machinery will try to call it first/as early as possible. + @pytest.mark.tryfirst: mark a hook implementation function such that the plugin machinery will try to call it first/as early as possible. DEPRECATED, use @pytest.hookimpl(tryfirst=True) instead. - @pytest.mark.trylast: mark a hook implementation function such that the plugin machinery will try to call it last/as late as possible. + @pytest.mark.trylast: mark a hook implementation function such that the plugin machinery will try to call it last/as late as possible. DEPRECATED, use @pytest.hookimpl(trylast=True) instead. .. _`passing callables to custom markers`: @@ -611,7 +611,7 @@ then you will see two tests skipped and two executed tests as expected: test_plat.py s.s. [100%] ========================= short test summary info ========================== - SKIPPED [2] conftest.py:12: cannot run on platform linux + SKIPPED [2] conftest.py:13: cannot run on platform linux ======================= 2 passed, 2 skipped in 0.12s ======================= Note that if you specify a platform via the marker-command line option like this: diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index ba1acdfd164..e62060f191c 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -661,8 +661,7 @@ If we run this: test_step.py:11: AssertionError ========================= short test summary info ========================== - XFAIL test_step.py::TestUserHandling::test_deletion - reason: previous test failed (test_modification) + XFAIL test_step.py::TestUserHandling::test_deletion - reason: previous test failed (test_modification) ================== 1 failed, 2 passed, 1 xfailed in 0.12s ================== We'll see that ``test_deletion`` was not executed because ``test_modification`` diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index ce8ce815260..971982c2ce8 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -22,7 +22,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 7.1.3 + pytest 7.2.0 .. _`simpletest`: diff --git a/doc/en/how-to/cache.rst b/doc/en/how-to/cache.rst index 529d97d53fb..8554a984c72 100644 --- a/doc/en/how-to/cache.rst +++ b/doc/en/how-to/cache.rst @@ -233,7 +233,7 @@ If you run this command for the first time, you can see the print statement: > assert mydata == 23 E assert 42 == 23 - test_caching.py:20: AssertionError + test_caching.py:19: AssertionError -------------------------- Captured stdout setup --------------------------- running expensive computation... ========================= short test summary info ========================== @@ -256,7 +256,7 @@ the cache and nothing will be printed: > assert mydata == 23 E assert 42 == 23 - test_caching.py:20: AssertionError + test_caching.py:19: AssertionError ========================= short test summary info ========================== FAILED test_caching.py::test_function - assert 42 == 23 1 failed in 0.12s diff --git a/doc/en/how-to/output.rst b/doc/en/how-to/output.rst index 85081a47c61..7d900ce3fdb 100644 --- a/doc/en/how-to/output.rst +++ b/doc/en/how-to/output.rst @@ -349,8 +349,7 @@ Example: test_example.py:14: AssertionError ========================= short test summary info ========================== SKIPPED [1] test_example.py:22: skipping this test - XFAIL test_example.py::test_xfail - reason: xfailing this test + XFAIL test_example.py::test_xfail - reason: xfailing this test XPASS test_example.py::test_xpass always xfail ERROR test_example.py::test_error - assert 0 FAILED test_example.py::test_fail - assert 0 diff --git a/doc/en/how-to/unittest.rst b/doc/en/how-to/unittest.rst index 658c69a14fd..37caf6e9fb7 100644 --- a/doc/en/how-to/unittest.rst +++ b/doc/en/how-to/unittest.rst @@ -157,7 +157,7 @@ the ``self.db`` values in the traceback: E AssertionError: .DummyDB object at 0xdeadbeef0001> E assert 0 - test_unittest_db.py:10: AssertionError + test_unittest_db.py:11: AssertionError ___________________________ MyTest.test_method2 ____________________________ self = @@ -167,7 +167,7 @@ the ``self.db`` values in the traceback: E AssertionError: .DummyDB object at 0xdeadbeef0001> E assert 0 - test_unittest_db.py:13: AssertionError + test_unittest_db.py:14: AssertionError ========================= short test summary info ========================== FAILED test_unittest_db.py::MyTest::test_method1 - AssertionError: Date: Tue, 25 Oct 2022 10:52:53 -0400 Subject: [PATCH 432/549] upgrade pygments-pytest for 7.2.x coloring --- doc/en/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/requirements.txt b/doc/en/requirements.txt index a0d54cd4c1d..0523772d4b0 100644 --- a/doc/en/requirements.txt +++ b/doc/en/requirements.txt @@ -1,6 +1,6 @@ pallets-sphinx-themes pluggy>=1.0 -pygments-pytest>=2.2.0 +pygments-pytest>=2.3.0 sphinx-removed-in>=0.2.0 sphinx>=5,<6 sphinxcontrib-trio From f07017f91b6af5a7c6942868cb61aea72be4ac31 Mon Sep 17 00:00:00 2001 From: Santiago Castro Date: Tue, 25 Oct 2022 09:43:59 -0700 Subject: [PATCH 433/549] Add the PyPI classifier for Python 3.11 (#10426) --- .pre-commit-config.yaml | 2 +- setup.cfg | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ef181f1787a..03cc80ebd62 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -52,7 +52,7 @@ repos: rev: v2.1.0 hooks: - id: setup-cfg-fmt - args: ["--max-py-version=3.10", "--include-version-classifiers"] + args: ["--max-py-version=3.11", "--include-version-classifiers"] - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.9.0 hooks: diff --git a/setup.cfg b/setup.cfg index 39ade4dff4c..ceb02877af5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,6 +21,7 @@ classifiers = Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 Topic :: Software Development :: Libraries Topic :: Software Development :: Testing Topic :: Utilities From 646a46e5f4b1f1ae5a06dcbc91fcdebfc235a28a Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 25 Oct 2022 19:47:16 +0200 Subject: [PATCH 434/549] Edit changelog for 7.2.0 (#10423) Fix some typos, and consolidate two entries for the same feature into one. --- doc/en/changelog.rst | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 53ddafc52e7..e922dff71da 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -57,6 +57,7 @@ Deprecations .. _`with-setup-nose`: https://nose.readthedocs.io/en/latest/testing_tools.html?highlight=with_setup#nose.tools.with_setup +- `#7337 `_: A deprecation warning is now emitted if a test function returns something other than `None`. This prevents a common mistake among beginners that expect that returning a `bool` (for example `return foo(a, b) == result`) would cause a test to pass or fail, instead of using `assert`. The plan is to make returning non-`None` from tests an error in the future. Features @@ -79,10 +80,7 @@ Improvements - `#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 expresed instead. - - -- `#7337 `_: A warning is now emitted if a test function returns something other than `None`. This prevents a common mistake among beginners that expect that returning a `bool` (for example `return foo(a, b) == result`) would cause a test to pass or fail, instead of using `assert`. +- `#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 :py:func:`pytest.warns` and @@ -95,7 +93,7 @@ Improvements - `#9741 `_: On Python 3.11, use the standard library's :mod:`tomllib` to parse TOML. - :mod:`tomli`` is no longer a dependency on Python 3.11. + :mod:`tomli` is no longer a dependency on Python 3.11. - `#9742 `_: Display assertion message without escaped newline characters with ``-vv``. @@ -110,7 +108,7 @@ Improvements - `#9883 `_: Normalize the help description of all command-line options. -- `#9920 `_: Display full crash messages in ``short test summary info``, when runng in a CI environment. +- `#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``. @@ -156,9 +154,6 @@ Improved Documentation Trivial/Internal Changes ------------------------ -- `#10196 `_: :class:`~pytest.PytestReturnNotNoneWarning` is now a subclass of :class:`~pytest.PytestRemovedIn8Warning`: the plan is to make returning non-``None`` from tests an error in the future. - - - `#10313 `_: Made ``_pytest.doctest.DoctestItem`` export ``pytest.DoctestItem`` for type check and runtime purposes. Made `_pytest.doctest` use internal APIs to avoid circular imports. @@ -173,7 +168,7 @@ Trivial/Internal Changes - `#9984 `_: Improve the error message when we attempt to access a fixture that has been torn down. Add an additional sentence to the docstring explaining when it's not a good - idea to call getfixturevalue. + idea to call ``getfixturevalue``. pytest 7.1.3 (2022-08-31) From 549839bac5d96fd9731f40b537f370cad9fae839 Mon Sep 17 00:00:00 2001 From: Cal Jacobson Date: Sun, 30 Oct 2022 21:59:09 -0500 Subject: [PATCH 435/549] fix type in python_api.py excpected -> expected --- src/_pytest/python_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 515d437f0d8..ea45753cde6 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -801,7 +801,7 @@ def raises( # noqa: F811 r"""Assert that a code block/function call raises an exception. :param typing.Type[E] | typing.Tuple[typing.Type[E], ...] expected_exception: - The excpected exception type, or a tuple if one of multiple possible + The expected exception type, or a tuple if one of multiple possible exception types are excepted. :kwparam str | typing.Pattern[str] | None match: If specified, a string containing a regular expression, From 692ab1160bf2396ceba9fdbb7a2d0c4e2936da61 Mon Sep 17 00:00:00 2001 From: Cal Jacobson Date: Sun, 30 Oct 2022 22:02:18 -0500 Subject: [PATCH 436/549] add Cal Jacobson to AUTHORS --- AUTHORS | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/AUTHORS b/AUTHORS index 7da1f8a0c57..14bb39785c1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -57,6 +57,7 @@ Brian Maissy Brian Okken Brianna Laugher Bruno Oliveira +Cal Jacobson Cal Leeming Carl Friedrich Bolz Carlos Jenkins @@ -182,8 +183,8 @@ Joseph Hunkeler Josh Karpel Joshua Bronson Jurko Gospodnetić -Justyna Janczyszyn Justice Ndou +Justyna Janczyszyn Kale Kundert Kamran Ahmad Karl O. Pinc @@ -235,7 +236,6 @@ Matthias Hafner Maxim Filipenko Maximilian Cosmo Sitter mbyt -Mickey Pashov Michael Aquilina Michael Birtwell Michael Droettboom @@ -244,6 +244,7 @@ Michael Krebs Michael Seifert Michal Wajszczuk Michał Zięba +Mickey Pashov Mihai Capotă Mike Hoyle (hoylemd) Mike Lundy @@ -258,9 +259,9 @@ Niclas Olofsson Nicolas Delaby Nikolay Kondratyev Nipunn Koorapati -Olga Matoula Oleg Pidsadnyi Oleg Sushchenko +Olga Matoula Oliver Bestwalter Omar Kohl Omer Hadari @@ -286,8 +287,8 @@ Pulkit Goyal Punyashloka Biswal Quentin Pradet Ralf Schmitt -Ram Rachum Ralph Giles +Ram Rachum Ran Benita Raphael Castaneda Raphael Pierzina From 0314b50c52658093d79e2d5af5358e384f26d507 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Mon, 31 Oct 2022 17:49:51 +0200 Subject: [PATCH 437/549] Fix 'importlib.abc.TraversableResources' deprecation warning in Python 3.12 (#10452) --- changelog/10452.bugfix.rst | 1 + src/_pytest/assertion/rewrite.py | 7 ++++++- tox.ini | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 changelog/10452.bugfix.rst diff --git a/changelog/10452.bugfix.rst b/changelog/10452.bugfix.rst new file mode 100644 index 00000000000..d8f7dded455 --- /dev/null +++ b/changelog/10452.bugfix.rst @@ -0,0 +1 @@ +Fix 'importlib.abc.TraversableResources' deprecation warning in Python 3.12. diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index 63f9dd8f27b..cb64a33c078 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -275,7 +275,12 @@ def get_data(self, pathname: Union[str, bytes]) -> bytes: if sys.version_info >= (3, 10): - def get_resource_reader(self, name: str) -> importlib.abc.TraversableResources: # type: ignore + if sys.version_info >= (3, 12): + from importlib.resources.abc import TraversableResources + else: + from importlib.abc import TraversableResources + + def get_resource_reader(self, name: str) -> TraversableResources: # type: ignore if sys.version_info < (3, 11): from importlib.readers import FileReader else: diff --git a/tox.ini b/tox.ini index f04242c5c43..c80fdfcd1a4 100644 --- a/tox.ini +++ b/tox.ini @@ -9,6 +9,7 @@ envlist = py39 py310 py311 + py312 pypy3 py37-{pexpect,xdist,unittestextras,numpy,pluggymain,pylib} doctesting From 496196b15c2c115899044353e053f1c159d8c65b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Oct 2022 12:51:34 -0300 Subject: [PATCH 438/549] build(deps): Bump pytest-html in /testing/plugins_integration (#10450) Bumps [pytest-html](https://github.com/pytest-dev/pytest-html) from 3.1.1 to 3.2.0. - [Release notes](https://github.com/pytest-dev/pytest-html/releases) - [Changelog](https://github.com/pytest-dev/pytest-html/blob/master/docs/changelog.rst) - [Commits](https://github.com/pytest-dev/pytest-html/compare/v3.1.1...v3.2.0) --- updated-dependencies: - dependency-name: pytest-html dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index e9ee4c6ce95..2a73a1876ed 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -5,7 +5,7 @@ pytest-bdd==6.0.1 pytest-cov==4.0.0 pytest-django==4.5.2 pytest-flakes==4.0.5 -pytest-html==3.1.1 +pytest-html==3.2.0 pytest-mock==3.10.0 pytest-rerunfailures==10.2 pytest-sugar==0.9.5 From 50b232b0cb39490776da2658ae69c669ce263050 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 31 Oct 2022 21:37:05 -0300 Subject: [PATCH 439/549] [pre-commit.ci] pre-commit autoupdate (#10454) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/reorder_python_imports: v3.8.5 → v3.9.0](https://github.com/asottile/reorder_python_imports/compare/v3.8.5...v3.9.0) - [github.com/asottile/pyupgrade: v3.1.0 → v3.2.0](https://github.com/asottile/pyupgrade/compare/v3.1.0...v3.2.0) - [github.com/asottile/setup-cfg-fmt: v2.1.0 → v2.2.0](https://github.com/asottile/setup-cfg-fmt/compare/v2.1.0...v2.2.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 03cc80ebd62..8ab6c6d3ecb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,17 +39,17 @@ repos: - flake8-typing-imports==1.12.0 - flake8-docstrings==1.5.0 - repo: https://github.com/asottile/reorder_python_imports - rev: v3.8.5 + rev: v3.9.0 hooks: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v3.1.0 + rev: v3.2.0 hooks: - id: pyupgrade args: [--py37-plus] - repo: https://github.com/asottile/setup-cfg-fmt - rev: v2.1.0 + rev: v2.2.0 hooks: - id: setup-cfg-fmt args: ["--max-py-version=3.11", "--include-version-classifiers"] From 1ada62e23739d1061e7bc3fe22e67868e5a45b3f Mon Sep 17 00:00:00 2001 From: Ashish Kurmi <100655670+boahc077@users.noreply.github.com> Date: Fri, 4 Nov 2022 03:41:34 -0700 Subject: [PATCH 440/549] Update dependabot for GitHub Actions (#10464) Signed-off-by: Ashish Kurmi Signed-off-by: Ashish Kurmi --- .github/dependabot.yml | 6 ++++++ AUTHORS | 1 + 2 files changed, 7 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 507789bf5a4..294b13743e2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,3 +9,9 @@ updates: allow: - dependency-type: direct - dependency-type: indirect +- package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + time: "03:00" + open-pull-requests-limit: 10 diff --git a/AUTHORS b/AUTHORS index 14bb39785c1..f2f330c4b24 100644 --- a/AUTHORS +++ b/AUTHORS @@ -43,6 +43,7 @@ Ariel Pillemer Armin Rigo Aron Coyle Aron Curzon +Ashish Kurmi Aviral Verma Aviv Palivoda Babak Keyvani From 2f33ea87c8d303c3439655eb2bea24483bffde5e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 4 Nov 2022 18:38:09 +0100 Subject: [PATCH 441/549] Remove done trainings (#10471) --- doc/en/index.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/en/index.rst b/doc/en/index.rst index 60fbf99aed6..0c94d9d4625 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -2,7 +2,6 @@ .. sidebar:: Next Open Trainings - - Professionelles Testen für Python mit pytest, part of `enterPy `__ (German), `October 28th `__ (sold out) and `November 4th `__, online - `Professional Testing with Python `_, via `Python Academy `_, March 7th to 9th 2023 (3 day in-depth training), Remote and Leipzig, Germany Also see :doc:`previous talks and blogposts `. From 6aec32163d706a0f9404465c65c5498f8a07f161 Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Mon, 7 Nov 2022 21:00:31 +0100 Subject: [PATCH 442/549] scripts/update-plugin-list: Be liberal in accepted summaries Misconfigured packages may have a null summary in the PyPI json response. --- scripts/update-plugin-list.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/update-plugin-list.py b/scripts/update-plugin-list.py index c034c72420b..f8bbd19af50 100644 --- a/scripts/update-plugin-list.py +++ b/scripts/update-plugin-list.py @@ -90,7 +90,9 @@ def iter_plugins(): last_release = release_date.strftime("%b %d, %Y") break name = f':pypi:`{info["name"]}`' - summary = escape_rst(info["summary"].replace("\n", "")) + summary = "" + if info["summary"]: + summary = escape_rst(info["summary"].replace("\n", "")) yield { "name": name, "summary": summary.strip(), From a006dabf6e0852a34ad00d9a83ed4fe526f74a9a Mon Sep 17 00:00:00 2001 From: pytest bot Date: Tue, 8 Nov 2022 11:13:43 +0000 Subject: [PATCH 443/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 800 ++++++++++++++++++++----------- 1 file changed, 520 insertions(+), 280 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 3dff88e5913..d923fe6192c 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1118 plugins. +This list contains 1148 plugins. .. only:: not latex @@ -20,27 +20,29 @@ This list contains 1118 plugins. =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ :pypi:`pytest-abstracts` A contextmanager pytest fixture for handling multiple mock abstracts May 25, 2022 N/A N/A :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Jun 07, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Oct 13, 2022 N/A pytest (>=5.4.0) :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-ads-testplan` Azure DevOps Test Case reporting for pytest tests Sep 15, 2022 N/A N/A :pypi:`pytest-agent` Service that exposes a REST API that can be used to interract remotely with Pytest. It is shipped with a dashboard that enables running tests in a more convenient way. Nov 25, 2021 N/A N/A :pypi:`pytest-aggreport` pytest plugin for pytest-repeat that generate aggregate report of the same test cases with additional statistics details. Mar 07, 2021 4 - Beta pytest (>=6.2.2) :pypi:`pytest-aio` Pytest plugin for testing async python code Oct 20, 2021 4 - Beta pytest :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Nov 01, 2020 N/A pytest (>=6) - :pypi:`pytest-aiomoto` pytest-aiomoto Jul 10, 2022 N/A pytest (>=7.0,<8.0) + :pypi:`pytest-aiomoto` pytest-aiomoto Oct 29, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A - :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Aug 03, 2022 N/A pytest (>=1.0) + :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Nov 01, 2022 N/A pytest (>=6.0) :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) - :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Sep 08, 2022 N/A pytest + :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Oct 21, 2022 N/A pytest :pypi:`pytest-allure-dsl` pytest plugin to test case doc string dls instructions Oct 25, 2020 4 - Beta pytest + :pypi:`pytest-allure-intersection` Oct 27, 2022 N/A pytest (<5) :pypi:`pytest-allure-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-android` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Feb 21, 2019 3 - Alpha pytest @@ -52,7 +54,7 @@ This list contains 1118 plugins. :pypi:`pytest-ansible-units` A pytest plugin for running unit tests within an ansible collection Apr 14, 2022 N/A N/A :pypi:`pytest-antilru` Bust functools.lru_cache when running pytest to avoid test pollution Jul 05, 2022 5 - Production/Stable pytest :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest - :pypi:`pytest-anything` Pytest fixtures to assert anything and something Feb 18, 2021 N/A N/A + :pypi:`pytest-anything` Pytest fixtures to assert anything and something Oct 13, 2022 N/A pytest :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Nov 23, 2021 N/A pytest ; extra == 'test' :pypi:`pytest-aoreporter` pytest report Jun 27, 2022 N/A N/A :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 12, 2022 N/A pytest (>=7.1.1,<8.0.0) @@ -61,11 +63,12 @@ This list contains 1118 plugins. :pypi:`pytest-appengine` AppEngine integration that works well with pytest-django Feb 27, 2017 N/A N/A :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A :pypi:`pytest-approvaltests` A plugin to use approvaltests with pytest May 08, 2022 4 - Beta pytest (>=7.0.1) + :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Oct 27, 2022 5 - Production/Stable pytest :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 4 - Beta pytest (>=4.6) :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A - :pypi:`pytest-assertcount` Plugin to count actual number of asserts in pytest May 22, 2022 N/A N/A + :pypi:`pytest-assertcount` Plugin to count actual number of asserts in pytest Oct 23, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-assertions` Pytest Assertions Apr 27, 2022 N/A N/A :pypi:`pytest-assertutil` pytest-assertutil May 10, 2019 N/A N/A :pypi:`pytest-assert-utils` Useful assertion utilities for use with pytest Apr 14, 2022 3 - Alpha N/A @@ -76,7 +79,7 @@ This list contains 1118 plugins. :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Sep 06, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest - :pypi:`pytest-asyncio` Pytest support for asyncio Jul 15, 2022 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-asyncio` Pytest support for asyncio Oct 21, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jul 11, 2022 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) @@ -90,29 +93,33 @@ This list contains 1118 plugins. :pypi:`pytest-automock` Pytest plugin for automatical mocks creation Aug 04, 2022 N/A pytest ; extra == 'dev' :pypi:`pytest-auto-parametrize` pytest plugin: avoid repeating arguments in parametrize Oct 02, 2016 3 - Alpha N/A :pypi:`pytest-autotest` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Aug 25, 2021 N/A pytest + :pypi:`pytest-aviator` Aviator's Flakybot pytest plugin that automatically reruns flaky tests. Nov 04, 2022 4 - Beta pytest :pypi:`pytest-avoidance` Makes pytest skip tests that don not need rerunning May 23, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-aws` pytest plugin for testing AWS resource configurations Oct 04, 2017 4 - Beta N/A :pypi:`pytest-aws-config` Protect your AWS credentials in unit tests May 28, 2021 N/A N/A :pypi:`pytest-axe` pytest plugin for axe-selenium-python Nov 12, 2018 N/A pytest (>=3.0.0) + :pypi:`pytest-azure` Pytest utilities and mocks for Azure Oct 10, 2022 3 - Alpha pytest :pypi:`pytest-azure-devops` Simplifies using azure devops parallel strategy (https://docs.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner) with pytest. Jun 20, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Mar 16, 2022 4 - Beta pytest (>=5.0.0) + :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Oct 20, 2022 5 - Production/Stable pytest (>=5.0.0) :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-bandit-xayon` A bandit plugin for pytest Oct 17, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) - :pypi:`pytest-bdd` BDD for pytest Jul 07, 2022 6 - Mature pytest (>=5.0) + :pypi:`pytest-bdd` BDD for pytest Nov 05, 2022 6 - Mature pytest (>=6.2.0) :pypi:`pytest-bdd-html` pytest plugin to display BDD info in HTML test report Jul 25, 2022 3 - Alpha pytest (!=6.0.0,>=5.0) - :pypi:`pytest-bdd-ng` BDD for pytest Jul 24, 2022 4 - Beta pytest (>=5.0) + :pypi:`pytest-bdd-ng` BDD for pytest Oct 06, 2022 4 - Beta pytest (>=5.0) :pypi:`pytest-bdd-splinter` Common steps for pytest bdd and splinter integration Aug 12, 2019 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-bdd-web` A simple plugin to use with pytest Jan 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A - :pypi:`pytest-benchmark` A \`\`pytest\`\` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer. Apr 17, 2021 5 - Production/Stable pytest (>=3.8) + :pypi:`pytest-benchmark` A \`\`pytest\`\` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer. Oct 25, 2022 5 - Production/Stable pytest (>=3.8) :pypi:`pytest-bg-process` Pytest plugin to initialize background process Jan 24, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-bigchaindb` A BigchainDB plugin for pytest. Jan 24, 2022 4 - Beta N/A :pypi:`pytest-bigquery-mock` Provides a mock fixture for python bigquery client Aug 05, 2021 N/A pytest (>=5.0) :pypi:`pytest-black` A pytest plugin to enable format checking with black Oct 05, 2020 4 - Beta N/A :pypi:`pytest-black-multipy` Allow '--black' on older Pythons Jan 14, 2021 5 - Production/Stable pytest (!=3.7.3,>=3.5) ; extra == 'testing' + :pypi:`pytest-black-ng` A pytest plugin to enable format checking with black Oct 20, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-blame` A pytest plugin helps developers to debug by providing useful commits history. May 04, 2019 N/A pytest (>=4.4.0) :pypi:`pytest-blender` Blender Pytest plugin. Jun 16, 2022 N/A pytest ; extra == 'dev' :pypi:`pytest-blink1` Pytest plugin to emit notifications via the Blink(1) RGB LED Jan 07, 2018 4 - Beta N/A @@ -137,9 +144,10 @@ This list contains 1118 plugins. :pypi:`pytest-builtin-types` Nov 17, 2021 N/A pytest :pypi:`pytest-bwrap` Run your tests in Bubblewrap sandboxes Oct 26, 2018 3 - Alpha N/A :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A - :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data May 02, 2022 4 - Beta pytest (>=5.0.0) + :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Oct 19, 2022 5 - Production/Stable pytest (>=5.0.0) :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 17, 2022 N/A pytest + :pypi:`pytest-call-checker` Small pytest utility to easily create test doubles Oct 16, 2022 4 - Beta pytest (>=7.1.3,<8.0.0) :pypi:`pytest-camel-collect` Enable CamelCase-aware pytest class collection Aug 02, 2020 N/A pytest (>=2.9) :pypi:`pytest-canonical-data` A plugin which allows to compare results with canonical results, based on previous runs May 08, 2020 2 - Pre-Alpha pytest (>=3.5.0) :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A @@ -152,12 +160,13 @@ This list contains 1118 plugins. :pypi:`pytest-celery` pytest-celery a shim pytest plugin to enable celery.contrib.pytest May 06, 2021 N/A N/A :pypi:`pytest-chainmaker` pytest plugin for chainmaker Oct 15, 2021 N/A N/A :pypi:`pytest-chalice` A set of py.test fixtures for AWS Chalice Jul 01, 2020 4 - Beta N/A + :pypi:`pytest-change-assert` 修改报错中文为英文 Oct 19, 2022 N/A N/A :pypi:`pytest-change-demo` turn . into √,turn F into x Mar 02, 2022 N/A pytest :pypi:`pytest-change-report` turn . into √,turn F into x Sep 14, 2020 N/A pytest :pypi:`pytest-change-xds` turn . into √,turn F into x Apr 16, 2022 N/A pytest :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) - :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Aug 25, 2022 5 - Production/Stable N/A - :pypi:`pytest-checkdocs` check the README when running tests Jul 31, 2021 5 - Production/Stable pytest (>=4.6) ; extra == 'testing' + :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Sep 29, 2022 5 - Production/Stable N/A + :pypi:`pytest-checkdocs` check the README when running tests Oct 09, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) :pypi:`pytest-check-library` check your missing library Jul 17, 2022 N/A N/A :pypi:`pytest-check-libs` check your missing library Jul 17, 2022 N/A N/A @@ -165,11 +174,11 @@ This list contains 1118 plugins. :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest :pypi:`pytest-chunks` Run only a chunk of your test suite Jul 05, 2022 N/A pytest (>=6.0.0) :pypi:`pytest-circleci` py.test plugin for CircleCI May 03, 2019 N/A N/A - :pypi:`pytest-circleci-parallelized` Parallelize pytest across CircleCI workers. Mar 26, 2019 N/A N/A + :pypi:`pytest-circleci-parallelized` Parallelize pytest across CircleCI workers. Oct 20, 2022 N/A N/A :pypi:`pytest-circleci-parallelized-rjp` Parallelize pytest across CircleCI workers. Jun 21, 2022 N/A pytest :pypi:`pytest-ckan` Backport of CKAN 2.9 pytest plugin and fixtures to CAKN 2.8 Apr 28, 2020 4 - Beta pytest :pypi:`pytest-clarity` A plugin providing an alternative, colourful diff output for failing assertions. Jun 11, 2021 N/A N/A - :pypi:`pytest-cldf` Easy quality control for CLDF datasets using pytest May 06, 2019 N/A N/A + :pypi:`pytest-cldf` Easy quality control for CLDF datasets using pytest Nov 07, 2022 N/A pytest (>=3.6) :pypi:`pytest-click` Pytest plugin for Click Feb 11, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-cli-fixtures` Automatically register fixtures for custom CLI arguments Jul 28, 2022 N/A pytest (~=7.0) :pypi:`pytest-clld` Jul 06, 2022 N/A pytest (>=3.6) @@ -183,6 +192,7 @@ This list contains 1118 plugins. :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A :pypi:`pytest-codeowners` Pytest plugin for selecting tests by GitHub CODEOWNERS. Mar 30, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-codestyle` pytest plugin to run pycodestyle Mar 23, 2020 3 - Alpha N/A + :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Nov 06, 2022 5 - Production/Stable N/A :pypi:`pytest-collect-formatter` Formatter for pytest collect output Mar 29, 2021 5 - Production/Stable N/A :pypi:`pytest-collect-formatter2` Formatter for pytest collect output May 31, 2021 5 - Production/Stable N/A :pypi:`pytest-collector` Python package for collecting pytest. Aug 02, 2022 N/A pytest (>=7.0,<8.0) @@ -200,13 +210,13 @@ This list contains 1118 plugins. :pypi:`pytest-cookies` The pytest plugin for your Cookiecutter templates. 🍪 May 24, 2021 5 - Production/Stable pytest (>=3.3.0) :pypi:`pytest-couchdbkit` py.test extension for per-test couchdb databases using couchdbkit Apr 17, 2012 N/A N/A :pypi:`pytest-count` count erros and send email Jan 12, 2018 4 - Beta N/A - :pypi:`pytest-cov` Pytest plugin for measuring coverage. Oct 04, 2021 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-cov` Pytest plugin for measuring coverage. Sep 28, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-cover` Pytest plugin for measuring coverage. Forked from \`pytest-cov\`. Aug 01, 2015 5 - Production/Stable N/A :pypi:`pytest-coverage` Jun 17, 2015 N/A N/A :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' - :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Aug 22, 2022 5 - Production/Stable pytest (>=7.0) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Sep 10, 2022 N/A N/A + :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Sep 23, 2022 5 - Production/Stable pytest (>=7.0) + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Nov 07, 2022 N/A N/A :pypi:`pytest-cqase` Custom qase pytest plugin Aug 22, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) @@ -227,7 +237,7 @@ This list contains 1118 plugins. :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A :pypi:`pytest-databricks` Pytest plugin for remote Databricks notebooks testing Jul 29, 2020 N/A pytest - :pypi:`pytest-datadir` pytest plugin for test data directories and files Oct 22, 2019 5 - Production/Stable pytest (>=2.7.0) + :pypi:`pytest-datadir` pytest plugin for test data directories and files Oct 25, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Aug 16, 2022 5 - Production/Stable pytest (>=7.1) :pypi:`pytest-datadir-ng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Dec 25, 2019 5 - Production/Stable pytest :pypi:`pytest-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Jul 19, 2022 N/A pytest (>=7.0.1) @@ -237,7 +247,7 @@ This list contains 1118 plugins. :pypi:`pytest-data-from-files` pytest plugin to provide data from files loaded automatically Oct 13, 2021 4 - Beta pytest :pypi:`pytest-dataplugin` A pytest plugin for managing an archive of test data. Sep 16, 2017 1 - Planning N/A :pypi:`pytest-datarecorder` A py.test plugin recording and comparing test output. Apr 20, 2020 5 - Production/Stable pytest - :pypi:`pytest-dataset` Plugin for loading different datasets for pytest by prefix from json or yaml files Sep 05, 2022 5 - Production/Stable N/A + :pypi:`pytest-dataset` Plugin for loading different datasets for pytest by prefix from json or yaml files Oct 10, 2022 5 - Production/Stable N/A :pypi:`pytest-data-suites` Class-based pytest parametrization Jul 24, 2022 N/A pytest (>=6.0,<8.0) :pypi:`pytest-datatest` A pytest plugin for test driven data-wrangling (this is the development version of datatest's pytest integration). Oct 15, 2020 4 - Beta pytest (>=3.3) :pypi:`pytest-db` Session scope fixture "db" for mysql query or change Dec 04, 2019 N/A N/A @@ -263,6 +273,7 @@ This list contains 1118 plugins. :pypi:`pytest-dictsdiff` Jul 26, 2019 N/A N/A :pypi:`pytest-diff` A simple plugin to use with pytest Mar 30, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-diff-selector` Get tests affected by code changes (using git) Feb 24, 2022 4 - Beta pytest (>=6.2.2) ; extra == 'all' + :pypi:`pytest-difido` PyTest plugin for generating Difido reports Oct 23, 2022 4 - Beta pytest (>=4.0.0) :pypi:`pytest-disable` pytest plugin to disable a test and skip it from testrun Sep 10, 2015 4 - Beta N/A :pypi:`pytest-disable-plugin` Disable plugins per test Feb 28, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. Mar 27, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) @@ -289,7 +300,7 @@ This list contains 1118 plugins. :pypi:`pytest-doc` A documentation plugin for py.test. Jun 28, 2015 5 - Production/Stable N/A :pypi:`pytest-docfiles` pytest plugin to test codeblocks in your documentation. Dec 22, 2021 4 - Beta pytest (>=3.7.0) :pypi:`pytest-docgen` An RST Documentation Generator for pytest-based test suites Apr 17, 2020 N/A N/A - :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Jul 27, 2022 N/A pytest (<8.0,>=4.0) + :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Sep 14, 2022 N/A pytest (<8.0,>=4.0) :pypi:`pytest-docker-apache-fixtures` Pytest fixtures for testing with apache2 (httpd). Feb 16, 2022 4 - Beta pytest :pypi:`pytest-docker-butla` Jun 16, 2019 3 - Alpha N/A :pypi:`pytest-dockerc` Run, manage and stop Docker Compose project from Docker API Oct 09, 2020 5 - Production/Stable pytest (>=3.0) @@ -302,7 +313,7 @@ This list contains 1118 plugins. :pypi:`pytest-docker-postgresql` A simple plugin to use with pytest Sep 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-docker-py` Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. Nov 27, 2018 N/A pytest (==4.0.0) :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Apr 08, 2022 4 - Beta pytest - :pypi:`pytest-docker-service` pytest plugin to start docker container Mar 21, 2022 3 - Alpha pytest + :pypi:`pytest-docker-service` pytest plugin to start docker container Oct 23, 2022 3 - Alpha pytest :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-tools` Docker integration tests for pytest Feb 17, 2022 4 - Beta pytest (>=6.0.1) :pypi:`pytest-docs` Documentation tool for pytest Nov 11, 2018 4 - Beta pytest (>=3.5.0) @@ -310,7 +321,7 @@ This list contains 1118 plugins. :pypi:`pytest-doctest-custom` A py.test plugin for customizing string representations of doctest results. Jul 25, 2016 4 - Beta N/A :pypi:`pytest-doctest-ellipsis-markers` Setup additional values for ELLIPSIS_MARKER for doctests Jan 12, 2018 4 - Beta N/A :pypi:`pytest-doctest-import` A simple pytest plugin to import names and add them to the doctest namespace. Nov 13, 2018 4 - Beta pytest (>=3.3.0) - :pypi:`pytest-doctestplus` Pytest plugin with advanced doctest features. Feb 25, 2022 3 - Alpha pytest (>=4.6) + :pypi:`pytest-doctestplus` Pytest plugin with advanced doctest features. Sep 26, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-dolphin` Some extra stuff that we use ininternally Nov 30, 2016 4 - Beta pytest (==3.0.4) :pypi:`pytest-doorstop` A pytest plugin for adding test results into doorstop items. Jun 09, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-dotenv` A py.test plugin that parses environment files before running tests Jun 16, 2020 4 - Beta pytest (>=5.0.0) @@ -331,26 +342,27 @@ This list contains 1118 plugins. :pypi:`pytest-ebics-sandbox` A pytest plugin for testing against an EBICS sandbox server. Requires docker. Aug 15, 2022 N/A N/A :pypi:`pytest-ec2` Pytest execution on EC2 instance Oct 22, 2019 3 - Alpha N/A :pypi:`pytest-echo` pytest plugin with mechanisms for echoing environment variables, package version and generic attributes Jan 08, 2020 5 - Production/Stable N/A + :pypi:`pytest-ekstazi` Pytest plugin to select test using Ekstazi algorithm Sep 10, 2022 N/A pytest :pypi:`pytest-elasticsearch` Elasticsearch fixtures and fixture factories for Pytest. Mar 01, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-elements` Tool to help automate user interfaces Jan 13, 2021 N/A pytest (>=5.4,<6.0) :pypi:`pytest-eliot` An eliot plugin for pytest. Aug 31, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Aug 23, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Aug 23, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Aug 23, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Aug 23, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Aug 23, 2022 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Aug 23, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Aug 23, 2022 N/A N/A - :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Aug 27, 2022 N/A pytest (>=7.0,<8.0) + :pypi:`pytest-embedded` pytest embedded plugin Nov 07, 2022 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Nov 07, 2022 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Nov 07, 2022 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Nov 07, 2022 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Nov 07, 2022 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Nov 07, 2022 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Nov 07, 2022 N/A N/A + :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Oct 15, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Jun 22, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-encode` set your encoding and logger Nov 06, 2021 N/A N/A :pypi:`pytest-encode-kane` set your encoding and logger Nov 16, 2021 N/A pytest :pypi:`pytest-enhancements` Improvements for pytest (rejected upstream) Oct 30, 2019 4 - Beta N/A - :pypi:`pytest-env` py.test plugin that allows you to add environment variables. Jun 16, 2017 4 - Beta N/A + :pypi:`pytest-env` py.test plugin that allows you to add environment variables. Oct 23, 2022 5 - Production/Stable N/A :pypi:`pytest-envfiles` A py.test plugin that parses environment files before running tests Oct 08, 2015 3 - Alpha N/A :pypi:`pytest-env-info` Push information about the running pytest into envvars Nov 25, 2017 4 - Beta pytest (>=3.1.1) :pypi:`pytest-envraw` py.test plugin that allows you to add environment variables. Aug 27, 2020 4 - Beta pytest (>=2.6.0) @@ -365,10 +377,10 @@ This list contains 1118 plugins. :pypi:`pytest-excel` pytest plugin for generating excel reports Jan 31, 2022 5 - Production/Stable N/A :pypi:`pytest-exceptional` Better exceptions Mar 16, 2017 4 - Beta N/A :pypi:`pytest-exception-script` Walk your code through exception script to check it's resiliency to failures. Aug 04, 2020 3 - Alpha pytest - :pypi:`pytest-executable` pytest plugin for testing executables Nov 10, 2021 4 - Beta pytest (<6.3,>=4.3) + :pypi:`pytest-executable` pytest plugin for testing executables Nov 05, 2022 N/A pytest (<8,>=4.3) :pypi:`pytest-execution-timer` A timer for the phases of Pytest's execution. Dec 24, 2021 4 - Beta N/A :pypi:`pytest-expect` py.test plugin to store test expectations and mark tests based on them Apr 21, 2016 4 - Beta N/A - :pypi:`pytest-expecter` Better testing with expecter and pytest. Jan 10, 2022 5 - Production/Stable N/A + :pypi:`pytest-expecter` Better testing with expecter and pytest. Sep 18, 2022 5 - Production/Stable N/A :pypi:`pytest-expectr` This plugin is used to expect multiple assert using pytest framework. Oct 05, 2018 N/A pytest (>=2.4.2) :pypi:`pytest-experiments` A pytest plugin to help developers of research-oriented software projects keep track of the results of their numerical experiments. Dec 13, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) :pypi:`pytest-explicit` A Pytest plugin to ignore certain marked tests by default Jun 15, 2021 5 - Production/Stable pytest @@ -414,11 +426,11 @@ This list contains 1118 plugins. :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Mar 18, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Mar 01, 2022 5 - Production/Stable pytest (>=7.0) - :pypi:`pytest-flakefinder` Runs tests multiple times to expose flakiness. Jul 28, 2020 4 - Beta pytest (>=2.7.1) + :pypi:`pytest-flakefinder` Runs tests multiple times to expose flakiness. Oct 26, 2022 4 - Beta pytest (>=2.7.1) :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) :pypi:`pytest-flaptastic` Flaptastic py.test plugin Mar 17, 2019 N/A N/A :pypi:`pytest-flask` A set of py.test fixtures to test Flask applications. Feb 27, 2021 5 - Production/Stable pytest (>=5.2) - :pypi:`pytest-flask-ligand` Pytest fixtures and helper functions to use for testing flask-ligand microservices. Aug 18, 2022 4 - Beta pytest (~=7.1) + :pypi:`pytest-flask-ligand` Pytest fixtures and helper functions to use for testing flask-ligand microservices. Oct 06, 2022 4 - Beta pytest (~=7.1) :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) :pypi:`pytest-fluent` A pytest plugin in order to provide logs via fluentd Jul 12, 2022 4 - Beta pytest @@ -428,6 +440,7 @@ This list contains 1118 plugins. :pypi:`pytest-forward-compatability` A name to avoid typosquating pytest-foward-compatibility Sep 06, 2020 N/A N/A :pypi:`pytest-forward-compatibility` A pytest plugin to shim pytest commandline options for fowards compatibility Sep 29, 2020 N/A N/A :pypi:`pytest-freezegun` Wrap tests with fixtures in freeze_time Jul 19, 2020 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-freezer` Pytest plugin providing a fixture interface for spulec/freezegun Oct 20, 2022 N/A N/A :pypi:`pytest-freeze-reqs` Check if requirement files are frozen Apr 29, 2021 N/A N/A :pypi:`pytest-frozen-uuids` Deterministically frozen UUID's for your tests Apr 17, 2022 N/A pytest (>=3.0) :pypi:`pytest-func-cov` Pytest plugin for measuring function coverage Apr 15, 2021 3 - Alpha pytest (>=5) @@ -442,7 +455,7 @@ This list contains 1118 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Aug 23, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Oct 21, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -461,7 +474,7 @@ This list contains 1118 plugins. :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Jun 10, 2022 5 - Production/Stable N/A :pypi:`pytest-helm-chart` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jun 15, 2020 4 - Beta pytest (>=5.4.2,<6.0.0) - :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Aug 03, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Oct 19, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) :pypi:`pytest-helper` Functions to help in using the pytest testing framework May 31, 2019 5 - Production/Stable N/A :pypi:`pytest-helpers` pytest helpers May 17, 2020 N/A pytest :pypi:`pytest-helpers-namespace` Pytest Helpers Namespace Plugin Dec 29, 2021 5 - Production/Stable pytest (>=6.0.0) @@ -469,13 +482,13 @@ This list contains 1118 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Sep 09, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Nov 05, 2022 3 - Alpha pytest (==7.1.3) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 22, 2022 5 - Production/Stable N/A :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) - :pypi:`pytest-html` pytest plugin for generating HTML reports Dec 13, 2020 5 - Production/Stable pytest (!=6.0.0,>=5.0) + :pypi:`pytest-html` pytest plugin for generating HTML reports Oct 25, 2022 5 - Production/Stable pytest (!=6.0.0,>=5.0) :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-html-merger` Pytest HTML reports merging utility Apr 03, 2022 N/A N/A :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Mar 04, 2022 5 - Production/Stable N/A @@ -487,8 +500,8 @@ This list contains 1118 plugins. :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Mar 16, 2022 5 - Production/Stable pytest ; extra == 'test' :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A - :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Jul 29, 2022 3 - Alpha N/A - :pypi:`pytest-httpx` Send responses to httpx. May 24, 2022 5 - Production/Stable pytest (<8.*,>=6.*) + :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Sep 12, 2022 3 - Alpha N/A + :pypi:`pytest-httpx` Send responses to httpx. Nov 03, 2022 5 - Production/Stable pytest (<8.*,>=6.*) :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest @@ -506,30 +519,32 @@ This list contains 1118 plugins. :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A - :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Sep 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-extensions` Inmanta tests package Aug 10, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Sep 07, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Oct 07, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-extensions` Inmanta tests package Sep 30, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Sep 16, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Jun 16, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A - :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Feb 28, 2022 N/A pytest (>=6.0.2) + :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Nov 02, 2022 N/A pytest (>=7.2.0,<8.0.0) :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) :pypi:`pytest-instrument` pytest plugin to instrument tests Apr 05, 2020 5 - Production/Stable pytest (>=5.1.0) :pypi:`pytest-integration` Organizing pytests by integration or not Apr 16, 2020 N/A N/A :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) - :pypi:`pytest-invenio` "Pytest fixtures for Invenio." Aug 09, 2022 5 - Production/Stable pytest (<7,>=6) + :pypi:`pytest-invenio` Pytest fixtures for Invenio. Oct 25, 2022 5 - Production/Stable pytest (<7.2.0,>=6) :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A - :pypi:`pytest-isort` py.test plugin to check import ordering using isort Feb 08, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-isort` py.test plugin to check import ordering using isort Oct 31, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. Aug 19, 2022 5 - Production/Stable N/A :pypi:`pytest-it` Pytest plugin to display test reports as a plaintext spec, inspired by Rspec: https://github.com/mattduck/pytest-it. Jan 22, 2020 4 - Beta N/A :pypi:`pytest-iterassert` Nicer list and iterable assertion messages for pytest May 11, 2020 3 - Alpha N/A :pypi:`pytest-iters` A contextmanager pytest fixture for handling multiple mock iters May 24, 2022 N/A N/A :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) + :pypi:`pytest-jinja` A plugin to generate customizable jinja-based HTML reports in pytest Oct 04, 2022 3 - Alpha pytest (>=6.2.5,<7.0.0) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A + :pypi:`pytest-jira-xfail` Plugin skips (xfail) tests if unresolved Jira issue(s) linked Nov 07, 2022 N/A pytest (~=7.2.0) :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Aug 25, 2022 4 - Beta pytest :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) @@ -537,7 +552,8 @@ This list contains 1118 plugins. :pypi:`pytest-json-fixtures` JSON output for the --fixtures flag Aug 09, 2022 4 - Beta pytest (>=7.1.0) :pypi:`pytest-jsonlint` UNKNOWN Aug 04, 2016 N/A N/A :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Mar 15, 2022 4 - Beta pytest (>=3.8.0) - :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Aug 24, 2021 N/A pytest + :pypi:`pytest-jtr` pytest plugin supporting json test report output Oct 24, 2022 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Oct 01, 2022 N/A pytest :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest :pypi:`pytest-kexi` Apr 29, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Sep 08, 2022 5 - Production/Stable N/A @@ -566,9 +582,9 @@ This list contains 1118 plugins. :pypi:`pytest-listener` A simple network listener May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) :pypi:`pytest-live` Live results for pytest Mar 08, 2020 N/A pytest - :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Aug 25, 2021 5 - Production/Stable pytest + :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Oct 04, 2022 5 - Production/Stable pytest :pypi:`pytest-localserver` pytest plugin to test server connections locally. Aug 30, 2022 4 - Beta N/A - :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Aug 22, 2019 4 - Beta pytest (>=3.3.0) + :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Oct 17, 2022 4 - Beta pytest (>=6.0.0,<7.0.0) :pypi:`pytest-lockable` lockable resource plugin for pytest Jul 20, 2022 5 - Production/Stable pytest :pypi:`pytest-locker` Used to lock object during testing. Essentially changing assertions from being hard coded to asserting that nothing changed Oct 29, 2021 N/A pytest (>=5.4) :pypi:`pytest-log` print log Aug 15, 2021 N/A pytest (>=3.8) @@ -577,10 +593,12 @@ This list contains 1118 plugins. :pypi:`pytest-logfest` Pytest plugin providing three logger fixtures with basic or full writing to log files Jul 21, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-logger` Plugin configuring handlers for loggers from Python logging module. Jul 25, 2019 4 - Beta pytest (>=3.2) :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A + :pypi:`pytest-logging-end-to-end-test-tool` Sep 23, 2022 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-logikal` Common testing environment Oct 19, 2022 5 - Production/Stable pytest (==7.1.3) :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A :pypi:`pytest-loop` pytest plugin for looping tests Jul 22, 2022 5 - Production/Stable pytest (>=6) - :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Jul 18, 2022 3 - Alpha pytest + :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Oct 15, 2022 3 - Alpha pytest :pypi:`pytest-manual-marker` pytest marker for marking manual tests Aug 04, 2022 3 - Alpha N/A :pypi:`pytest-markdoctest` A pytest plugin to doctest your markdown files Jul 22, 2022 4 - Beta pytest (>=6) :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) @@ -605,29 +623,30 @@ This list contains 1118 plugins. :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) :pypi:`pytest-messenger` Pytest to Slack reporting plugin Feb 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-metadata` pytest plugin for test session metadata Jul 15, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) + :pypi:`pytest-metadata` pytest plugin for test session metadata Oct 30, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ml` Test your machine learning! May 04, 2019 4 - Beta N/A :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) - :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Jul 05, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Oct 05, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-mock-api` A mock API server with configurable routes and responses available as a fixture. Feb 13, 2019 1 - Planning pytest (>=4.0.0) :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator May 16, 2022 5 - Production/Stable N/A :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Aug 24, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Oct 27, 2022 N/A pytest (>=1.0) :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) + :pypi:`pytest-mocktcp` A pytest plugin for testing TCP clients Oct 11, 2022 N/A pytest :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A :pypi:`pytest-modifyjunit` Utility for adding additional properties to junit xml for IDM QE Jan 10, 2019 N/A N/A :pypi:`pytest-modifyscope` pytest plugin to modify fixture scope Apr 12, 2020 N/A pytest :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Mar 29, 2022 5 - Production/Stable pytest (>=7.0.0) :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Jun 07, 2021 5 - Production/Stable pytest :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures Dec 07, 2019 5 - Production/Stable pytest (>=2.5.2) - :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. May 18, 2022 5 - Production/Stable pytest + :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Oct 22, 2022 5 - Production/Stable pytest :pypi:`pytest-monkeyplus` pytest's monkeypatch subclass with extra functionalities Sep 18, 2012 5 - Production/Stable N/A :pypi:`pytest-monkeytype` pytest-monkeytype: Generate Monkeytype annotations from your pytest tests. Jul 29, 2020 4 - Beta N/A :pypi:`pytest-moto` Fixtures for integration tests of AWS services,uses moto mocking library. Aug 28, 2015 1 - Planning N/A @@ -635,21 +654,22 @@ This list contains 1118 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 23, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Sep 04, 2022 4 - Beta pytest (>=6) - :pypi:`pytest-multi-check` Pytest-плагин, реализует возможность мульти проверок и мягких проверок Jul 12, 2022 N/A pytest + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Oct 29, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mqtt` pytest-mqtt supports testing systems based on MQTT Sep 20, 2022 4 - Beta pytest (<8) ; extra == 'test' :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A - :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jun 10, 2021 N/A N/A + :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Sep 18, 2022 N/A pytest :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Aug 12, 2021 N/A pytest (>=3.6) - :pypi:`pytest-multithreading-allure` pytest_multithreading_allure Mar 22, 2022 N/A N/A + :pypi:`pytest-multithreading-allure` pytest_multithreading_allure Oct 20, 2022 N/A N/A :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) - :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Feb 07, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" + :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Sep 27, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" - :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Aug 15, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Oct 26, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A N/A :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. May 30, 2022 N/A N/A :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 15, 2022 5 - Production/Stable pytest (>=6.2) :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) + :pypi:`pytest-netdut` "Automated software testing for switches using pytest" Oct 14, 2022 N/A pytest (>=3.5.0) :pypi:`pytest-network` A simple plugin to disable network on socket level. May 07, 2020 N/A N/A :pypi:`pytest-network-endpoints` Network endpoints plugin for pytest Mar 06, 2022 N/A pytest :pypi:`pytest-never-sleep` pytest plugin helps to avoid adding tests without mock \`time.sleep\` May 05, 2021 3 - Alpha pytest (>=3.5.1) @@ -657,7 +677,7 @@ This list contains 1118 plugins. :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Aug 23, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Oct 07, 2022 N/A pytest (==6.2.5) :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A :pypi:`pytest-nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Jul 07, 2021 N/A N/A @@ -669,26 +689,27 @@ This list contains 1118 plugins. :pypi:`pytest-notifier` A pytest plugin to notify test result Jun 12, 2020 3 - Alpha pytest :pypi:`pytest-notimplemented` Pytest markers for not implemented features and tests. Aug 27, 2019 N/A pytest (>=5.1,<6.0) :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A - :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Jul 26, 2022 4 - Beta N/A + :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Oct 20, 2022 5 - Production/Stable pytest (>=4.6.0) :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jul 31, 2022 5 - Production/Stable pytest :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A - :pypi:`pytest-odoo` py.test plugin to run Odoo tests Feb 08, 2022 4 - Beta N/A + :pypi:`pytest-odoo` py.test plugin to run Odoo tests Oct 31, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A :pypi:`pytest-oerp` pytest plugin to test OpenERP modules Feb 28, 2012 3 - Alpha N/A :pypi:`pytest-ok` The ultimate pytest output plugin Apr 01, 2019 4 - Beta N/A :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jun 14, 2022 5 - Production/Stable pytest (<7.1); python_version <= "3.6" :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) - :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry Sep 07, 2022 N/A pytest + :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry Sep 18, 2022 N/A pytest :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Jun 02, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Aug 17, 2022 N/A pytest + :pypi:`pytest-operator` Fixtures for Operators Sep 28, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A :pypi:`pytest-order` pytest plugin to run your tests in a specific order Jan 09, 2022 4 - Beta pytest (>=5.0) ; python_version < "3.10" :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest + :pypi:`pytest-order-modify` 新增run_marker 来自定义用例的执行顺序 Nov 04, 2022 N/A N/A :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A - :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed May 26, 2022 N/A N/A + :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Oct 19, 2022 N/A N/A :pypi:`pytest-owner` Add owner mark for tests Apr 25, 2022 N/A N/A :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A :pypi:`pytest-pahrametahrize` Parametrize your tests with a Boston accent. Nov 24, 2021 4 - Beta pytest (>=6.0,<7.0) @@ -698,7 +719,7 @@ This list contains 1118 plugins. :pypi:`pytest-paramark` Configure pytest fixtures using a combination of"parametrize" and markers Jan 10, 2020 4 - Beta pytest (>=4.5.0) :pypi:`pytest-parametrization` Simpler PyTest parametrization May 22, 2022 5 - Production/Stable N/A :pypi:`pytest-parametrize-cases` A more user-friendly way to write parametrized tests. Mar 13, 2022 N/A pytest (>=6.1.2) - :pypi:`pytest-parametrized` Pytest plugin for parametrizing tests with default iterables. Oct 19, 2020 5 - Production/Stable pytest + :pypi:`pytest-parametrized` Pytest decorator for parametrizing tests with default iterables. Sep 13, 2022 5 - Production/Stable pytest :pypi:`pytest-parawtf` Finally spell paramete?ri[sz]e correctly Dec 03, 2018 4 - Beta pytest (>=3.6.0) :pypi:`pytest-pass` Check out https://github.com/elilutsky/pytest-pass Dec 04, 2019 N/A N/A :pypi:`pytest-passrunner` Pytest plugin providing the 'run_on_pass' marker Feb 10, 2021 5 - Production/Stable pytest (>=4.6.0) @@ -712,13 +733,14 @@ This list contains 1118 plugins. :pypi:`pytest-perf` pytest-perf Jun 23, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) :pypi:`pytest-persistence` Pytest tool for persistent objects Jun 27, 2022 N/A N/A - :pypi:`pytest-pg` A tiny plugin for pytest which runs PostgreSQL in Docker Jun 07, 2022 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-pg` A tiny plugin for pytest which runs PostgreSQL in Docker Sep 19, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Apr 15, 2022 4 - Beta pytest (>=5.4.3) :pypi:`pytest-picked` Run the tests related to the changed files Dec 23, 2020 N/A pytest (>=3.5.0) :pypi:`pytest-pigeonhole` Jun 25, 2018 5 - Production/Stable pytest (>=3.4) :pypi:`pytest-pikachu` Show surprise when tests are passing Aug 05, 2021 5 - Production/Stable pytest :pypi:`pytest-pilot` Slice in your test base thanks to powerful markers. Oct 09, 2020 5 - Production/Stable N/A + :pypi:`pytest-pingguo-pytest-plugin` pingguo test Oct 26, 2022 4 - Beta N/A :pypi:`pytest-pings` 🦊 The pytest plugin for Firefox Telemetry 📊 Jun 29, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-pinned` A simple pytest plugin for pinning tests Sep 17, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-pinpoint` A pytest plugin which runs SBFL algorithms to detect faults. Sep 25, 2020 N/A pytest (>=4.4.0) @@ -747,6 +769,7 @@ This list contains 1118 plugins. :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 27, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) + :pypi:`pytest-pretty` pytest plugin for printing summary data as I want it Nov 03, 2022 4 - Beta N/A :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 31, 2022 N/A pytest (>=3.4.1) :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Dec 28, 2021 5 - Production/Stable pytest (>=6) @@ -754,20 +777,21 @@ This list contains 1118 plugins. :pypi:`pytest-profiling` Profiling plugin for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-progress` pytest plugin for instant test progress status Jan 31, 2022 5 - Production/Stable N/A :pypi:`pytest-prometheus` Report test pass / failures to a Prometheus PushGateway Oct 03, 2017 N/A N/A - :pypi:`pytest-prometheus-pushgateway` Pytest report plugin for Zulip Sep 01, 2022 5 - Production/Stable pytest + :pypi:`pytest-prometheus-pushgateway` Pytest report plugin for Zulip Sep 27, 2022 5 - Production/Stable pytest :pypi:`pytest-prosper` Test helpers for Prosper projects Sep 24, 2018 N/A N/A :pypi:`pytest-pspec` A rspec format reporter for Python ptest Jun 02, 2020 4 - Beta pytest (>=3.0.0) :pypi:`pytest-psqlgraph` pytest plugin for testing applications that use psqlgraph Oct 19, 2021 4 - Beta pytest (>=6.0) :pypi:`pytest-ptera` Use ptera probes in tests Mar 01, 2022 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-pudb` Pytest PuDB debugger integration Oct 25, 2018 3 - Alpha pytest (>=2.0) + :pypi:`pytest-pumpkin-spice` A pytest plugin that makes your test reporting pumpkin-spiced Sep 18, 2022 4 - Beta N/A :pypi:`pytest-purkinje` py.test plugin for purkinje test runner Oct 28, 2017 2 - Pre-Alpha N/A :pypi:`pytest-pycharm` Plugin for py.test to enter PyCharm debugger on uncaught exceptions Aug 13, 2020 5 - Production/Stable pytest (>=2.3) - :pypi:`pytest-pycodestyle` pytest plugin to run pycodestyle Mar 13, 2022 3 - Alpha N/A + :pypi:`pytest-pycodestyle` pytest plugin to run pycodestyle Oct 28, 2022 3 - Alpha N/A :pypi:`pytest-pydev` py.test plugin to connect to a remote debug server with PyDev or PyCharm. Nov 15, 2017 3 - Alpha N/A - :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Mar 13, 2022 3 - Alpha N/A + :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Oct 28, 2022 3 - Alpha N/A :pypi:`pytest-pylint` pytest plugin to check source code with pylint Sep 10, 2022 5 - Production/Stable pytest (>=5.4) :pypi:`pytest-pymysql-autorecord` Record PyMySQL queries and mock with the stored data. Sep 02, 2022 N/A N/A - :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Sep 08, 2022 N/A pytest + :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Oct 26, 2022 N/A pytest :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) @@ -783,10 +807,10 @@ This list contains 1118 plugins. :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jun 26, 2022 5 - Production/Stable pytest (>=6.2.3) :pypi:`pytest-qml` Run QML Tests with pytest Dec 02, 2020 4 - Beta pytest (>=6.0.0) :pypi:`pytest-qr` pytest plugin to generate test result QR codes Nov 25, 2021 4 - Beta N/A - :pypi:`pytest-qt` pytest support for PyQt and PySide applications Jun 23, 2022 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-qt` pytest support for PyQt and PySide applications Oct 25, 2022 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-qt-app` QT app fixture for py.test Dec 23, 2015 5 - Production/Stable N/A :pypi:`pytest-quarantine` A plugin for pytest to manage expected test failures Nov 24, 2019 5 - Production/Stable pytest (>=4.6) - :pypi:`pytest-quickcheck` pytest plugin to generate random data inspired by QuickCheck Nov 15, 2020 4 - Beta pytest (<6.0.0,>=4.0) + :pypi:`pytest-quickcheck` pytest plugin to generate random data inspired by QuickCheck Nov 05, 2022 4 - Beta pytest (>=4.0) :pypi:`pytest-rabbitmq` RabbitMQ process and client fixtures for pytest Feb 11, 2022 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-race` Race conditions tester for pytest Jun 07, 2022 4 - Beta N/A :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A @@ -801,7 +825,7 @@ This list contains 1118 plugins. :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-readme` Test your README.md file Sep 02, 2022 5 - Production/Stable N/A - :pypi:`pytest-reana` Pytest fixtures for REANA. May 16, 2022 3 - Alpha N/A + :pypi:`pytest-reana` Pytest fixtures for REANA. Oct 06, 2022 3 - Alpha N/A :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jun 20, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) @@ -810,7 +834,7 @@ This list contains 1118 plugins. :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A :pypi:`pytest-regex-dependency` Management of Pytest dependencies via regex patterns Jun 12, 2022 N/A pytest - :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Jan 19, 2022 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Sep 17, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-regtest` pytest plugin for regression tests Jul 08, 2022 N/A N/A :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Jun 14, 2019 5 - Production/Stable pytest (<5,>=3) @@ -836,15 +860,16 @@ This list contains 1118 plugins. :pypi:`pytest-requestselapsed` collect and show http requests elapsed time Aug 14, 2022 N/A N/A :pypi:`pytest-requests-futures` Pytest Plugin to Mock Requests Futures Jul 06, 2022 5 - Production/Stable pytest :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Jun 17, 2021 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Sep 20, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Aug 12, 2022 N/A N/A :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-resource-usage` Pytest plugin for reporting running time and peak memory usage Nov 06, 2022 5 - Production/Stable N/A :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A - :pypi:`pytest-responses` py.test integration for responses Apr 26, 2021 N/A pytest (>=2.5) + :pypi:`pytest-responses` py.test integration for responses Oct 11, 2022 N/A pytest (>=2.5) :pypi:`pytest-rest-api` Aug 08, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A @@ -852,6 +877,7 @@ This list contains 1118 plugins. :pypi:`pytest-reverse` Pytest plugin to reverse test order. May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) + :pypi:`pytest-richtrace` Nov 05, 2022 N/A pytest (>=7.2.0,<8.0.0) :pypi:`pytest-ringo` pytest plugin to test webapplications using the Ringo webframework Sep 27, 2017 3 - Alpha N/A :pypi:`pytest-rmsis` Sycronise pytest results to Jira RMsis Aug 10, 2022 N/A pytest (>=5.3.5) :pypi:`pytest-rng` Fixtures for seeding tests and making randomness reproducible Aug 08, 2019 5 - Production/Stable pytest @@ -867,38 +893,39 @@ This list contains 1118 plugins. :pypi:`pytest-runner` Invoke py.test as distutils command with dependency resolution Feb 25, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Jul 03, 2022 5 - Production/Stable pytest :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A N/A - :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). May 10, 2022 3 - Alpha N/A + :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Oct 31, 2022 3 - Alpha N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A - :pypi:`pytest-salt-factories` Pytest Salt Plugin Aug 25, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Nov 04, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Sep 09, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Nov 07, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) - :pypi:`pytest-selenium` pytest plugin for Selenium Mar 28, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Sep 09, 2022 5 - Production/Stable N/A + :pypi:`pytest-selenium` pytest plugin for Selenium Sep 21, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Nov 07, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A - :pypi:`pytest-servers` pytest servers Aug 22, 2022 3 - Alpha pytest (==7.1.2) + :pypi:`pytest-servers` pytest servers Nov 01, 2022 3 - Alpha pytest (>=6.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :pypi:`pytest-session2file` pytest-session2file (aka: pytest-session_to_file for v0.1.0 - v0.1.2) is a py.test plugin for capturing and saving to file the stdout of py.test. Jan 26, 2021 3 - Alpha pytest :pypi:`pytest-session-fixture-globalize` py.test plugin to make session fixtures behave as if written in conftest, even if it is written in some modules May 15, 2018 4 - Beta N/A :pypi:`pytest-session_to_file` pytest-session_to_file is a py.test plugin for capturing and saving to file the stdout of py.test. Oct 01, 2015 3 - Alpha N/A :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest + :pypi:`pytest-share-hdf` Plugin to save test data in HDF files and retrieve them for comparison Sep 21, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-sharkreport` this is pytest report plugin. Jul 11, 2022 N/A pytest (>=3.5) :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A - :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Jul 28, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Sep 23, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 5 - Production/Stable pytest (>=3.5.1) :pypi:`pytest-shortcuts` Expand command-line shortcuts listed in pytest configuration Oct 29, 2020 4 - Beta pytest (>=3.5.0) @@ -943,12 +970,12 @@ This list contains 1118 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Sep 08, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Oct 06, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Mar 13, 2018 3 - Alpha N/A - :pypi:`pytest-sqlalchemy-mock` pytest sqlalchemy plugin for mock Aug 10, 2022 3 - Alpha pytest (>=2.0) + :pypi:`pytest-sqlalchemy-mock` pytest sqlalchemy plugin for mock Sep 25, 2022 3 - Alpha pytest (>=2.0) :pypi:`pytest-sql-bigquery` Yet another SQL-testing framework for BigQuery provided by pytest plugin Dec 19, 2019 N/A pytest :pypi:`pytest-squadcast` Pytest report plugin for Squadcast Feb 22, 2022 5 - Production/Stable pytest :pypi:`pytest-srcpaths` Add paths to sys.path Oct 15, 2021 N/A N/A @@ -958,7 +985,7 @@ This list contains 1118 plugins. :pypi:`pytest-stepfunctions` A small description May 08, 2021 4 - Beta pytest :pypi:`pytest-steps` Create step-wise / incremental tests in pytest. Sep 23, 2021 5 - Production/Stable N/A :pypi:`pytest-stepwise` Run a test suite one failing test at a time. Dec 01, 2015 4 - Beta N/A - :pypi:`pytest-stf` pytest plugin for openSTF Sep 09, 2022 N/A pytest (>=5.0) + :pypi:`pytest-stf` pytest plugin for openSTF Sep 30, 2022 N/A pytest (>=5.0) :pypi:`pytest-stoq` A plugin to pytest stoq Feb 09, 2021 4 - Beta N/A :pypi:`pytest-stress` A Pytest plugin that allows you to loop tests for a user defined amount of time. Dec 07, 2019 4 - Beta pytest (>=3.6.0) :pypi:`pytest-structlog` Structured logging assertions Sep 21, 2021 N/A pytest @@ -966,27 +993,29 @@ This list contains 1118 plugins. :pypi:`pytest-stub` Stub packages, modules and attributes. Apr 28, 2020 5 - Production/Stable N/A :pypi:`pytest-stubprocess` Provide stub implementations for subprocesses in Python tests Sep 17, 2018 3 - Alpha pytest (>=3.5.0) :pypi:`pytest-study` A pytest plugin to organize long run tests (named studies) without interfering the regular tests Sep 26, 2017 3 - Alpha pytest (>=2.0) - :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Feb 09, 2022 5 - Production/Stable pytest (>=4.0.0) + :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Oct 02, 2022 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Jul 16, 2022 N/A N/A - :pypi:`pytest-subtests` unittest subTest() support and subtests fixture May 26, 2022 4 - Beta pytest (>=7.0) + :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Oct 28, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A - :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Jul 10, 2022 3 - Alpha pytest (>=2.9) + :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Nov 05, 2022 3 - Alpha pytest (>=2.9) :pypi:`pytest-sugar-bugfix159` Workaround for https://github.com/Frozenball/pytest-sugar/issues/159 Nov 07, 2018 5 - Production/Stable pytest (!=3.7.3,>=3.5); extra == 'testing' :pypi:`pytest-super-check` Pytest plugin to check your TestCase classes call super in setUp, tearDown, etc. May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-svn` SVN repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-symbols` pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. Nov 20, 2017 3 - Alpha N/A :pypi:`pytest-system-statistics` Pytest plugin to track and report system usage statistics Feb 16, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-system-test-plugin` Pyst - Pytest System-Test Plugin Feb 03, 2022 N/A N/A + :pypi:`pytest-tagging` a pytest plugin to tag tests Oct 23, 2022 N/A pytest (>=7.1.3,<8.0.0) :pypi:`pytest-takeltest` Fixtures for ansible, testinfra and molecule Jan 04, 2022 N/A N/A :pypi:`pytest-talisker` Nov 28, 2021 N/A N/A :pypi:`pytest-tap` Test Anything Protocol (TAP) reporting plugin for pytest Oct 27, 2021 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-tape` easy assertion with expected results saved to yaml files Mar 17, 2021 4 - Beta N/A :pypi:`pytest-target` Pytest plugin for remote target orchestration. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) :pypi:`pytest-tblineinfo` tblineinfo is a py.test plugin that insert the node id in the final py.test report when --tb=line option is used Dec 01, 2015 3 - Alpha pytest (>=2.0) + :pypi:`pytest-tcpclient` A pytest plugin for testing TCP clients Oct 24, 2022 N/A pytest (<8,>=7.1.3) :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-terra-fixt` Terraform and Terragrunt fixtures for pytest Sep 09, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-terra-fixt` Terraform and Terragrunt fixtures for pytest Sep 15, 2022 N/A pytest (==6.2.5) :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Sep 01, 2022 N/A pytest (>=6.0) :pypi:`pytest-terraform-fixture` generate terraform resources to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-testbook` A plugin to run tests written in Jupyter notebook Dec 11, 2016 3 - Alpha N/A @@ -997,14 +1026,12 @@ This list contains 1118 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Jun 19, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Sep 09, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Oct 30, 2022 4 - Beta N/A :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) :pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Jun 13, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) - :pypi:`pytest-testrail2` A small example package Nov 17, 2020 N/A pytest (>=5) - :pypi:`pytest-testrail-api` Плагин Pytest, для интеграции с TestRail Aug 29, 2022 N/A pytest (>=5.5) :pypi:`pytest-testrail-api-client` TestRail Api Python Client Dec 14, 2021 N/A pytest :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A @@ -1032,17 +1059,18 @@ This list contains 1118 plugins. :pypi:`pytest-timestamps` A simple plugin to view timestamps for each test Jan 16, 2022 N/A pytest (>=5.2) :pypi:`pytest-tipsi-django` Nov 17, 2021 4 - Beta pytest (>=6.0.0) :pypi:`pytest-tipsi-testing` Better fixtures management. Various helpers Nov 04, 2020 4 - Beta pytest (>=3.3.0) - :pypi:`pytest-tldr` A pytest plugin that limits the output to just the things you need. Mar 12, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-tldr` A pytest plugin that limits the output to just the things you need. Oct 26, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-tm4j-reporter` Cloud Jira Test Management (TM4J) PyTest reporter plugin Sep 01, 2020 N/A pytest :pypi:`pytest-tmnet` A small example package Mar 01, 2022 N/A N/A :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest :pypi:`pytest-tmpfs` A pytest plugin that helps you on using a temporary filesystem for testing. Aug 29, 2022 N/A pytest :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Aug 12, 2022 N/A N/A + :pypi:`pytest-tmux` Sep 22, 2022 4 - Beta N/A :pypi:`pytest-todo` A small plugin for the pytest testing framework, marking TODO comments as failure May 23, 2019 4 - Beta pytest :pypi:`pytest-tomato` Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-toolbelt` This is just a collection of utilities for pytest, but don't really belong in pytest proper. Aug 12, 2019 3 - Alpha N/A :pypi:`pytest-toolbox` Numerous useful plugins for pytest. Apr 07, 2018 N/A pytest (>=3.5.0) - :pypi:`pytest-tools` Pytest tools Jul 04, 2022 4 - Beta N/A + :pypi:`pytest-tools` Pytest tools Oct 21, 2022 4 - Beta N/A :pypi:`pytest-tornado` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Jun 17, 2020 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-tornado5` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Nov 16, 2018 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-tornado-yen3` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Oct 15, 2018 5 - Production/Stable N/A @@ -1054,26 +1082,26 @@ This list contains 1118 plugins. :pypi:`pytest-trello` Plugin for py.test that integrates trello using markers Nov 20, 2015 5 - Production/Stable N/A :pypi:`pytest-trepan` Pytest plugin for trepan debugger. Jul 28, 2018 5 - Production/Stable N/A :pypi:`pytest-trialtemp` py.test plugin for using the same _trial_temp working directory as trial Jun 08, 2015 N/A N/A - :pypi:`pytest-trio` Pytest plugin for trio Oct 16, 2020 N/A N/A - :pypi:`pytest-trytond` Pytest plugin for the Tryton server framework Feb 02, 2022 3 - Alpha pytest (>=5) + :pypi:`pytest-trio` Pytest plugin for trio Nov 01, 2022 N/A pytest (>=7.2.0) + :pypi:`pytest-trytond` Pytest plugin for the Tryton server framework Nov 04, 2022 4 - Beta pytest (>=5) :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Apr 27, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A - :pypi:`pytest-tui` Text User Interface (TUI) for Pytest, with optional auto-launch and HTML export Sep 07, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) and HTML report for Pytest test runs Sep 21, 2022 4 - Beta pytest (>=6.2.5) :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A - :pypi:`pytest-twisted` A twisted plugin for pytest. Aug 30, 2021 5 - Production/Stable pytest (>=2.3) + :pypi:`pytest-twisted` A twisted plugin for pytest. Oct 16, 2022 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Mar 07, 2022 4 - Beta N/A + :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Nov 04, 2022 4 - Beta N/A :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) :pypi:`pytest-ubersmith` Easily mock calls to ubersmith at the \`requests\` level. Apr 13, 2015 N/A N/A :pypi:`pytest-ui` Text User Interface for running python tests Jul 05, 2021 4 - Beta pytest - :pypi:`pytest-unflakable` Unflakable plugin for PyTest Jun 14, 2022 4 - Beta pytest (>=6.2.0) + :pypi:`pytest-unflakable` Unflakable plugin for PyTest Oct 26, 2022 4 - Beta pytest (>=6.2.0) :pypi:`pytest-unhandled-exception-exit-code` Plugin for py.test set a different exit code on uncaught exceptions Jun 22, 2020 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) :pypi:`pytest-unmarked` Run only unmarked tests Aug 27, 2019 5 - Production/Stable N/A :pypi:`pytest-unordered` Test equality of unordered collections in pytest Jul 08, 2022 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Jun 10, 2022 4 - Beta N/A + :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Sep 27, 2022 4 - Beta N/A :pypi:`pytest-upload-report` pytest-upload-report is a plugin for pytest that upload your test report for test results. Jun 18, 2021 5 - Production/Stable N/A :pypi:`pytest-utils` Some helpers for pytest. Dec 04, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) :pypi:`pytest-vagrant` A py.test plugin providing access to vagrant. Sep 07, 2021 5 - Production/Stable pytest @@ -1083,8 +1111,9 @@ This list contains 1118 plugins. :pypi:`pytest-vcr` Plugin for managing VCR.py cassettes Apr 26, 2019 5 - Production/Stable pytest (>=3.6.0) :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Jun 20, 2022 5 - Production/Stable pytest (>=6.2.2) :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest + :pypi:`pytest-vcs` Sep 22, 2022 4 - Beta N/A :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest - :pypi:`pytest-ver` Pytest module with Verification Report Aug 21, 2022 2 - Pre-Alpha N/A + :pypi:`pytest-ver` Pytest module with Verification Protocol, Verification Report and Trace Matrix Nov 07, 2022 2 - Pre-Alpha N/A :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) :pypi:`pytest-virtualenv` Virtualenv fixture for py.test May 28, 2019 5 - Production/Stable pytest @@ -1092,13 +1121,15 @@ This list contains 1118 plugins. :pypi:`pytest-voluptuous` Pytest plugin for asserting data against voluptuous schema. Jun 09, 2020 N/A pytest :pypi:`pytest-vscodedebug` A pytest plugin to easily enable debugging tests within Visual Studio Code Dec 04, 2020 4 - Beta N/A :pypi:`pytest-vts` pytest plugin for automatic recording of http stubbed tests Jun 05, 2019 N/A pytest (>=2.3) + :pypi:`pytest-vulture` A pytest plugin to checks dead code with vulture Oct 12, 2022 N/A pytest (>=7.0.0) :pypi:`pytest-vw` pytest-vw makes your failing test cases succeed under CI tools scrutiny Oct 07, 2015 4 - Beta N/A :pypi:`pytest-vyper` Plugin for the vyper smart contract language. May 28, 2020 2 - Pre-Alpha N/A :pypi:`pytest-wa-e2e-plugin` Pytest plugin for testing whatsapp bots with end to end tests Feb 18, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-wake` Aug 30, 2022 N/A pytest + :pypi:`pytest-wake` Sep 28, 2022 N/A pytest :pypi:`pytest-watch` Local continuous test runner with pytest and watchdog. May 20, 2018 N/A N/A - :pypi:`pytest-watcher` Continiously runs pytest on changes in \*.py files Dec 30, 2021 3 - Alpha N/A + :pypi:`pytest-watcher` Continiously runs pytest on changes in \*.py files Oct 30, 2022 3 - Alpha N/A :pypi:`pytest-wdl` Pytest plugin for testing WDL workflows. Nov 17, 2020 5 - Production/Stable N/A + :pypi:`pytest-web3-data` Sep 15, 2022 4 - Beta pytest :pypi:`pytest-webdriver` Selenium webdriver fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-wetest` Welian API Automation test framework pytest plugin Nov 10, 2018 4 - Beta N/A :pypi:`pytest-whirlwind` Testing Tornado. Jun 12, 2020 N/A N/A @@ -1108,20 +1139,19 @@ This list contains 1118 plugins. :pypi:`pytest-wiremock` A pytest plugin for programmatically using wiremock in integration tests Mar 27, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-with-docker` pytest with docker helpers. Nov 09, 2021 N/A pytest :pypi:`pytest-workflow` A pytest plugin for configuring workflow/pipeline tests using YAML files Dec 03, 2021 5 - Production/Stable pytest (>=5.4.0) - :pypi:`pytest-xdist` pytest xdist plugin for distributed testing and loop-on-failing modes Dec 10, 2021 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-xdist` pytest xdist plugin for distributed testing and loop-on-failing modes Oct 25, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-xdist-debug-for-graingert` pytest xdist plugin for distributed testing and loop-on-failing modes Jul 24, 2019 5 - Production/Stable pytest (>=4.4.0) :pypi:`pytest-xdist-forked` forked from pytest-xdist Feb 10, 2020 5 - Production/Stable pytest (>=4.4.0) :pypi:`pytest-xdist-tracker` pytest plugin helps to reproduce failures for particular xdist node Nov 18, 2021 3 - Alpha pytest (>=3.5.1) :pypi:`pytest-xfaillist` Maintain a xfaillist in an additional file to avoid merge-conflicts. Sep 17, 2021 N/A pytest (>=6.2.2,<7.0.0) :pypi:`pytest-xfiles` Pytest fixtures providing data read from function, module or package related (x)files. Feb 27, 2018 N/A N/A :pypi:`pytest-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A - :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Aug 04, 2022 N/A N/A + :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Nov 06, 2022 N/A N/A :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Aug 29, 2022 4 - Beta pytest (>=2.8) :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) - :pypi:`pytest-xreport` May 17, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-xvfb` A pytest plugin to run Xvfb for tests. Jun 09, 2020 4 - Beta pytest (>=2.8.1) :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) @@ -1129,7 +1159,7 @@ This list contains 1118 plugins. :pypi:`pytest-yapf` Run yapf Jul 06, 2017 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) :pypi:`pytest-yield` PyTest plugin to run tests concurrently, each \`yield\` switch context to other one Jan 23, 2019 N/A N/A - :pypi:`pytest-yls` Pytest plugin to test the YLS as a whole. Aug 08, 2022 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-yls` Pytest plugin to test the YLS as a whole. Oct 21, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A @@ -1156,7 +1186,7 @@ This list contains 1118 plugins. A pytest-plugin for updating doctest outputs :pypi:`pytest-adaptavist` - *last release*: Jun 07, 2022, + *last release*: Oct 13, 2022, *status*: N/A, *requires*: pytest (>=5.4.0) @@ -1183,6 +1213,13 @@ This list contains 1118 plugins. Pytest plugin for writing Azure Data Factory integration tests + :pypi:`pytest-ads-testplan` + *last release*: Sep 15, 2022, + *status*: N/A, + *requires*: N/A + + Azure DevOps Test Case reporting for pytest tests + :pypi:`pytest-agent` *last release*: Nov 25, 2021, *status*: N/A, @@ -1226,7 +1263,7 @@ This list contains 1118 plugins. Pytest \`client\` fixture for the Aiohttp :pypi:`pytest-aiomoto` - *last release*: Jul 10, 2022, + *last release*: Oct 29, 2022, *status*: N/A, *requires*: pytest (>=7.0,<8.0) @@ -1261,9 +1298,9 @@ This list contains 1118 plugins. :pypi:`pytest-alembic` - *last release*: Aug 03, 2022, + *last release*: Nov 01, 2022, *status*: N/A, - *requires*: pytest (>=1.0) + *requires*: pytest (>=6.0) A pytest plugin for verifying alembic migrations. @@ -1289,7 +1326,7 @@ This list contains 1118 plugins. Plugin for py.test to generate allure xml reports :pypi:`pytest-allure-collection` - *last release*: Sep 08, 2022, + *last release*: Oct 21, 2022, *status*: N/A, *requires*: pytest @@ -1302,6 +1339,13 @@ This list contains 1118 plugins. pytest plugin to test case doc string dls instructions + :pypi:`pytest-allure-intersection` + *last release*: Oct 27, 2022, + *status*: N/A, + *requires*: pytest (<5) + + + :pypi:`pytest-allure-spec-coverage` *last release*: Oct 26, 2021, *status*: N/A, @@ -1380,9 +1424,9 @@ This list contains 1118 plugins. The pytest anyio plugin is built into anyio. You don't need this package. :pypi:`pytest-anything` - *last release*: Feb 18, 2021, + *last release*: Oct 13, 2022, *status*: N/A, - *requires*: N/A + *requires*: pytest Pytest fixtures to assert anything and something @@ -1442,6 +1486,13 @@ This list contains 1118 plugins. A plugin to use approvaltests with pytest + :pypi:`pytest-approvaltests-geo` + *last release*: Oct 27, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest + + Extension for ApprovalTests.Python specific to geo data verification + :pypi:`pytest-argus` *last release*: Jun 24, 2021, *status*: 5 - Production/Stable, @@ -1471,9 +1522,9 @@ This list contains 1118 plugins. test Answer Set Programming programs :pypi:`pytest-assertcount` - *last release*: May 22, 2022, + *last release*: Oct 23, 2022, *status*: N/A, - *requires*: N/A + *requires*: pytest (>=5.0.0) Plugin to count actual number of asserts in pytest @@ -1548,7 +1599,7 @@ This list contains 1118 plugins. :pypi:`pytest-asyncio` - *last release*: Jul 15, 2022, + *last release*: Oct 21, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.1.0) @@ -1645,6 +1696,13 @@ This list contains 1118 plugins. This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. + :pypi:`pytest-aviator` + *last release*: Nov 04, 2022, + *status*: 4 - Beta, + *requires*: pytest + + Aviator's Flakybot pytest plugin that automatically reruns flaky tests. + :pypi:`pytest-avoidance` *last release*: May 23, 2019, *status*: 4 - Beta, @@ -1673,6 +1731,13 @@ This list contains 1118 plugins. pytest plugin for axe-selenium-python + :pypi:`pytest-azure` + *last release*: Oct 10, 2022, + *status*: 3 - Alpha, + *requires*: pytest + + Pytest utilities and mocks for Azure + :pypi:`pytest-azure-devops` *last release*: Jun 20, 2022, *status*: 4 - Beta, @@ -1681,8 +1746,8 @@ This list contains 1118 plugins. Simplifies using azure devops parallel strategy (https://docs.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner) with pytest. :pypi:`pytest-azurepipelines` - *last release*: Mar 16, 2022, - *status*: 4 - Beta, + *last release*: Oct 20, 2022, + *status*: 5 - Production/Stable, *requires*: pytest (>=5.0.0) Formatting PyTest output for Azure Pipelines UI @@ -1694,6 +1759,13 @@ This list contains 1118 plugins. A bandit plugin for pytest + :pypi:`pytest-bandit-xayon` + *last release*: Oct 17, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + A bandit plugin for pytest + :pypi:`pytest-base-url` *last release*: Mar 27, 2022, *status*: 5 - Production/Stable, @@ -1702,9 +1774,9 @@ This list contains 1118 plugins. pytest plugin for URL based testing :pypi:`pytest-bdd` - *last release*: Jul 07, 2022, + *last release*: Nov 05, 2022, *status*: 6 - Mature, - *requires*: pytest (>=5.0) + *requires*: pytest (>=6.2.0) BDD for pytest @@ -1716,7 +1788,7 @@ This list contains 1118 plugins. pytest plugin to display BDD info in HTML test report :pypi:`pytest-bdd-ng` - *last release*: Jul 24, 2022, + *last release*: Oct 06, 2022, *status*: 4 - Beta, *requires*: pytest (>=5.0) @@ -1765,7 +1837,7 @@ This list contains 1118 plugins. Benchmark utility that plugs into pytest. :pypi:`pytest-benchmark` - *last release*: Apr 17, 2021, + *last release*: Oct 25, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=3.8) @@ -1806,6 +1878,13 @@ This list contains 1118 plugins. Allow '--black' on older Pythons + :pypi:`pytest-black-ng` + *last release*: Oct 20, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=7.0.0) + + A pytest plugin to enable format checking with black + :pypi:`pytest-blame` *last release*: May 04, 2019, *status*: N/A, @@ -1975,8 +2054,8 @@ This list contains 1118 plugins. pytest plugin with mechanisms for caching across test runs :pypi:`pytest-cache-assert` - *last release*: May 02, 2022, - *status*: 4 - Beta, + *last release*: Oct 19, 2022, + *status*: 5 - Production/Stable, *requires*: pytest (>=5.0.0) Cache assertion data to simplify regression testing of complex serializable data @@ -1995,6 +2074,13 @@ This list contains 1118 plugins. Pytest support for cairo-lang and starknet + :pypi:`pytest-call-checker` + *last release*: Oct 16, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=7.1.3,<8.0.0) + + Small pytest utility to easily create test doubles + :pypi:`pytest-camel-collect` *last release*: Aug 02, 2020, *status*: N/A, @@ -2079,6 +2165,13 @@ This list contains 1118 plugins. A set of py.test fixtures for AWS Chalice + :pypi:`pytest-change-assert` + *last release*: Oct 19, 2022, + *status*: N/A, + *requires*: N/A + + 修改报错中文为英文 + :pypi:`pytest-change-demo` *last release*: Mar 02, 2022, *status*: N/A, @@ -2108,16 +2201,16 @@ This list contains 1118 plugins. A pytest fixture for changing current working directory :pypi:`pytest-check` - *last release*: Aug 25, 2022, + *last release*: Sep 29, 2022, *status*: 5 - Production/Stable, *requires*: N/A A pytest plugin that allows multiple failures per test. :pypi:`pytest-checkdocs` - *last release*: Jul 31, 2021, + *last release*: Oct 09, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=4.6) ; extra == 'testing' + *requires*: pytest (>=6) ; extra == 'testing' check the README when running tests @@ -2171,7 +2264,7 @@ This list contains 1118 plugins. py.test plugin for CircleCI :pypi:`pytest-circleci-parallelized` - *last release*: Mar 26, 2019, + *last release*: Oct 20, 2022, *status*: N/A, *requires*: N/A @@ -2199,9 +2292,9 @@ This list contains 1118 plugins. A plugin providing an alternative, colourful diff output for failing assertions. :pypi:`pytest-cldf` - *last release*: May 06, 2019, + *last release*: Nov 07, 2022, *status*: N/A, - *requires*: N/A + *requires*: pytest (>=3.6) Easy quality control for CLDF datasets using pytest @@ -2296,6 +2389,13 @@ This list contains 1118 plugins. pytest plugin to run pycodestyle + :pypi:`pytest-codspeed` + *last release*: Nov 06, 2022, + *status*: 5 - Production/Stable, + *requires*: N/A + + Pytest plugin to create CodSpeed benchmarks + :pypi:`pytest-collect-formatter` *last release*: Mar 29, 2021, *status*: 5 - Production/Stable, @@ -2416,7 +2516,7 @@ This list contains 1118 plugins. count erros and send email :pypi:`pytest-cov` - *last release*: Oct 04, 2021, + *last release*: Sep 28, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.6) @@ -2451,14 +2551,14 @@ This list contains 1118 plugins. Pytest plugin for excluding tests based on coverage data :pypi:`pytest-cpp` - *last release*: Aug 22, 2022, + *last release*: Sep 23, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=7.0) Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Sep 10, 2022, + *last release*: Nov 07, 2022, *status*: N/A, *requires*: N/A @@ -2605,9 +2705,9 @@ This list contains 1118 plugins. Pytest plugin for remote Databricks notebooks testing :pypi:`pytest-datadir` - *last release*: Oct 22, 2019, + *last release*: Oct 25, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=2.7.0) + *requires*: pytest (>=5.0) pytest plugin for test data directories and files @@ -2675,7 +2775,7 @@ This list contains 1118 plugins. A py.test plugin recording and comparing test output. :pypi:`pytest-dataset` - *last release*: Sep 05, 2022, + *last release*: Oct 10, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -2856,6 +2956,13 @@ This list contains 1118 plugins. Get tests affected by code changes (using git) + :pypi:`pytest-difido` + *last release*: Oct 23, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=4.0.0) + + PyTest plugin for generating Difido reports + :pypi:`pytest-disable` *last release*: Sep 10, 2015, *status*: 4 - Beta, @@ -3039,7 +3146,7 @@ This list contains 1118 plugins. An RST Documentation Generator for pytest-based test suites :pypi:`pytest-docker` - *last release*: Jul 27, 2022, + *last release*: Sep 14, 2022, *status*: N/A, *requires*: pytest (<8.0,>=4.0) @@ -3130,7 +3237,7 @@ This list contains 1118 plugins. Pytest fixtures for testing with docker registries. :pypi:`pytest-docker-service` - *last release*: Mar 21, 2022, + *last release*: Oct 23, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -3186,7 +3293,7 @@ This list contains 1118 plugins. A simple pytest plugin to import names and add them to the doctest namespace. :pypi:`pytest-doctestplus` - *last release*: Feb 25, 2022, + *last release*: Sep 26, 2022, *status*: 3 - Alpha, *requires*: pytest (>=4.6) @@ -3332,6 +3439,13 @@ This list contains 1118 plugins. pytest plugin with mechanisms for echoing environment variables, package version and generic attributes + :pypi:`pytest-ekstazi` + *last release*: Sep 10, 2022, + *status*: N/A, + *requires*: pytest + + Pytest plugin to select test using Ekstazi algorithm + :pypi:`pytest-elasticsearch` *last release*: Mar 01, 2022, *status*: 5 - Production/Stable, @@ -3368,56 +3482,56 @@ This list contains 1118 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Aug 23, 2022, + *last release*: Nov 07, 2022, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Aug 23, 2022, + *last release*: Nov 07, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Aug 23, 2022, + *last release*: Nov 07, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Aug 23, 2022, + *last release*: Nov 07, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Aug 23, 2022, + *last release*: Nov 07, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Aug 23, 2022, + *last release*: Nov 07, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Aug 23, 2022, + *last release*: Nov 07, 2022, *status*: N/A, *requires*: N/A pytest embedded plugin for testing espressif boards via serial ports :pypi:`pytest-embrace` - *last release*: Aug 27, 2022, + *last release*: Oct 15, 2022, *status*: N/A, *requires*: pytest (>=7.0,<8.0) @@ -3466,8 +3580,8 @@ This list contains 1118 plugins. Improvements for pytest (rejected upstream) :pypi:`pytest-env` - *last release*: Jun 16, 2017, - *status*: 4 - Beta, + *last release*: Oct 23, 2022, + *status*: 5 - Production/Stable, *requires*: N/A py.test plugin that allows you to add environment variables. @@ -3571,9 +3685,9 @@ This list contains 1118 plugins. Walk your code through exception script to check it's resiliency to failures. :pypi:`pytest-executable` - *last release*: Nov 10, 2021, - *status*: 4 - Beta, - *requires*: pytest (<6.3,>=4.3) + *last release*: Nov 05, 2022, + *status*: N/A, + *requires*: pytest (<8,>=4.3) pytest plugin for testing executables @@ -3592,7 +3706,7 @@ This list contains 1118 plugins. py.test plugin to store test expectations and mark tests based on them :pypi:`pytest-expecter` - *last release*: Jan 10, 2022, + *last release*: Sep 18, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -3914,7 +4028,7 @@ This list contains 1118 plugins. pytest plugin to check FLAKE8 requirements :pypi:`pytest-flakefinder` - *last release*: Jul 28, 2020, + *last release*: Oct 26, 2022, *status*: 4 - Beta, *requires*: pytest (>=2.7.1) @@ -3942,7 +4056,7 @@ This list contains 1118 plugins. A set of py.test fixtures to test Flask applications. :pypi:`pytest-flask-ligand` - *last release*: Aug 18, 2022, + *last release*: Oct 06, 2022, *status*: 4 - Beta, *requires*: pytest (~=7.1) @@ -4011,6 +4125,13 @@ This list contains 1118 plugins. Wrap tests with fixtures in freeze_time + :pypi:`pytest-freezer` + *last release*: Oct 20, 2022, + *status*: N/A, + *requires*: N/A + + Pytest plugin providing a fixture interface for spulec/freezegun + :pypi:`pytest-freeze-reqs` *last release*: Apr 29, 2021, *status*: N/A, @@ -4110,7 +4231,7 @@ This list contains 1118 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Aug 23, 2022, + *last release*: Oct 21, 2022, *status*: N/A, *requires*: N/A @@ -4243,7 +4364,7 @@ This list contains 1118 plugins. A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. :pypi:`pytest-helm-charts` - *last release*: Aug 03, 2022, + *last release*: Oct 19, 2022, *status*: 4 - Beta, *requires*: pytest (>=7.1.2,<8.0.0) @@ -4299,9 +4420,9 @@ This list contains 1118 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Sep 09, 2022, + *last release*: Nov 05, 2022, *status*: 3 - Alpha, - *requires*: pytest (==7.1.2) + *requires*: pytest (==7.1.3) Experimental package to automatically extract test plugins for Home Assistant custom components @@ -4341,7 +4462,7 @@ This list contains 1118 plugins. Helpers for testing hpfeeds in your python project :pypi:`pytest-html` - *last release*: Dec 13, 2020, + *last release*: Oct 25, 2022, *status*: 5 - Production/Stable, *requires*: pytest (!=6.0.0,>=5.0) @@ -4425,14 +4546,14 @@ This list contains 1118 plugins. A thin wrapper of HTTPretty for pytest :pypi:`pytest-httpserver` - *last release*: Jul 29, 2022, + *last release*: Sep 12, 2022, *status*: 3 - Alpha, *requires*: N/A pytest-httpserver is a httpserver for pytest :pypi:`pytest-httpx` - *last release*: May 24, 2022, + *last release*: Nov 03, 2022, *status*: 5 - Production/Stable, *requires*: pytest (<8.*,>=6.*) @@ -4558,21 +4679,21 @@ This list contains 1118 plugins. Reuse pytest.ini to store env variables :pypi:`pytest-inmanta` - *last release*: Sep 07, 2022, + *last release*: Oct 07, 2022, *status*: 5 - Production/Stable, *requires*: N/A A py.test plugin providing fixtures to simplify inmanta modules testing. :pypi:`pytest-inmanta-extensions` - *last release*: Aug 10, 2022, + *last release*: Sep 30, 2022, *status*: 5 - Production/Stable, *requires*: N/A Inmanta tests package :pypi:`pytest-inmanta-lsm` - *last release*: Sep 07, 2022, + *last release*: Sep 16, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4593,9 +4714,9 @@ This list contains 1118 plugins. A simple image diff plugin for pytest :pypi:`pytest-insta` - *last release*: Feb 28, 2022, + *last release*: Nov 02, 2022, *status*: N/A, - *requires*: pytest (>=6.0.2) + *requires*: pytest (>=7.2.0,<8.0.0) A practical snapshot testing plugin for pytest @@ -4642,11 +4763,11 @@ This list contains 1118 plugins. Pytest plugin for intercepting outgoing connection requests during pytest run. :pypi:`pytest-invenio` - *last release*: Aug 09, 2022, + *last release*: Oct 25, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (<7,>=6) + *requires*: pytest (<7.2.0,>=6) - "Pytest fixtures for Invenio." + Pytest fixtures for Invenio. :pypi:`pytest-involve` *last release*: Feb 02, 2020, @@ -4670,7 +4791,7 @@ This list contains 1118 plugins. THIS PROJECT IS ABANDONED :pypi:`pytest-isort` - *last release*: Feb 08, 2022, + *last release*: Oct 31, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) @@ -4718,6 +4839,13 @@ This list contains 1118 plugins. A custom jest-pytest oriented Pytest reporter + :pypi:`pytest-jinja` + *last release*: Oct 04, 2022, + *status*: 3 - Alpha, + *requires*: pytest (>=6.2.5,<7.0.0) + + A plugin to generate customizable jinja-based HTML reports in pytest + :pypi:`pytest-jira` *last release*: Apr 07, 2022, *status*: 3 - Alpha, @@ -4725,6 +4853,13 @@ This list contains 1118 plugins. py.test JIRA integration plugin, using markers + :pypi:`pytest-jira-xfail` + *last release*: Nov 07, 2022, + *status*: N/A, + *requires*: pytest (~=7.2.0) + + Plugin skips (xfail) tests if unresolved Jira issue(s) linked + :pypi:`pytest-jira-xray` *last release*: Aug 25, 2022, *status*: 4 - Beta, @@ -4774,8 +4909,15 @@ This list contains 1118 plugins. A pytest plugin to report test results as JSON files + :pypi:`pytest-jtr` + *last release*: Oct 24, 2022, + *status*: N/A, + *requires*: pytest (>=7.1.2,<8.0.0) + + pytest plugin supporting json test report output + :pypi:`pytest-kafka` - *last release*: Aug 24, 2021, + *last release*: Oct 01, 2022, *status*: N/A, *requires*: pytest @@ -4978,7 +5120,7 @@ This list contains 1118 plugins. Live results for pytest :pypi:`pytest-localftpserver` - *last release*: Aug 25, 2021, + *last release*: Oct 04, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -4992,9 +5134,9 @@ This list contains 1118 plugins. pytest plugin to test server connections locally. :pypi:`pytest-localstack` - *last release*: Aug 22, 2019, + *last release*: Oct 17, 2022, *status*: 4 - Beta, - *requires*: pytest (>=3.3.0) + *requires*: pytest (>=6.0.0,<7.0.0) Pytest plugin for AWS integration tests @@ -5054,6 +5196,20 @@ This list contains 1118 plugins. Configures logging and allows tweaking the log level with a py.test flag + :pypi:`pytest-logging-end-to-end-test-tool` + *last release*: Sep 23, 2022, + *status*: N/A, + *requires*: pytest (>=7.1.2,<8.0.0) + + + + :pypi:`pytest-logikal` + *last release*: Oct 19, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest (==7.1.3) + + Common testing environment + :pypi:`pytest-log-report` *last release*: Dec 26, 2019, *status*: N/A, @@ -5076,7 +5232,7 @@ This list contains 1118 plugins. pytest plugin for looping tests :pypi:`pytest-lsp` - *last release*: Jul 18, 2022, + *last release*: Oct 15, 2022, *status*: 3 - Alpha, *requires*: pytest @@ -5251,7 +5407,7 @@ This list contains 1118 plugins. Pytest to Slack reporting plugin :pypi:`pytest-metadata` - *last release*: Jul 15, 2022, + *last release*: Oct 30, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=3.0.0,<8.0.0) @@ -5300,7 +5456,7 @@ This list contains 1118 plugins. pytest plugin to display test execution output like a mochajs :pypi:`pytest-mock` - *last release*: Jul 05, 2022, + *last release*: Oct 05, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) @@ -5342,7 +5498,7 @@ This list contains 1118 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Aug 24, 2022, + *last release*: Oct 27, 2022, *status*: N/A, *requires*: pytest (>=1.0) @@ -5362,6 +5518,13 @@ This list contains 1118 plugins. A set of fixtures to test your requests to HTTP/UDP servers + :pypi:`pytest-mocktcp` + *last release*: Oct 11, 2022, + *status*: N/A, + *requires*: pytest + + A pytest plugin for testing TCP clients + :pypi:`pytest-modified-env` *last release*: Jan 29, 2022, *status*: 4 - Beta, @@ -5405,7 +5568,7 @@ This list contains 1118 plugins. pytest plugin for MongoDB fixtures :pypi:`pytest-monitor` - *last release*: May 18, 2022, + *last release*: Oct 22, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -5461,18 +5624,18 @@ This list contains 1118 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Sep 04, 2022, + *last release*: Oct 29, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) low-startup-overhead, scalable, distributed-testing pytest plugin - :pypi:`pytest-multi-check` - *last release*: Jul 12, 2022, - *status*: N/A, - *requires*: pytest + :pypi:`pytest-mqtt` + *last release*: Sep 20, 2022, + *status*: 4 - Beta, + *requires*: pytest (<8) ; extra == 'test' - Pytest-плагин, реализует возможность мульти проверок и мягких проверок + pytest-mqtt supports testing systems based on MQTT :pypi:`pytest-multihost` *last release*: Apr 07, 2020, @@ -5482,9 +5645,9 @@ This list contains 1118 plugins. Utility for writing multi-host tests for pytest :pypi:`pytest-multilog` - *last release*: Jun 10, 2021, + *last release*: Sep 18, 2022, *status*: N/A, - *requires*: N/A + *requires*: pytest Multi-process logs handling and other helpers for pytest @@ -5496,7 +5659,7 @@ This list contains 1118 plugins. a pytest plugin for th and concurrent testing :pypi:`pytest-multithreading-allure` - *last release*: Mar 22, 2022, + *last release*: Oct 20, 2022, *status*: N/A, *requires*: N/A @@ -5510,7 +5673,7 @@ This list contains 1118 plugins. Add the mutation testing feature to pytest :pypi:`pytest-mypy` - *last release*: Feb 07, 2022, + *last release*: Sep 27, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2) ; python_version >= "3.10" @@ -5524,7 +5687,7 @@ This list contains 1118 plugins. Mypy static type checker plugin for Pytest :pypi:`pytest-mypy-plugins` - *last release*: Aug 15, 2022, + *last release*: Oct 26, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -5565,6 +5728,13 @@ This list contains 1118 plugins. pytest-neo is a plugin for pytest that shows tests like screen of Matrix. + :pypi:`pytest-netdut` + *last release*: Oct 14, 2022, + *status*: N/A, + *requires*: pytest (>=3.5.0) + + "Automated software testing for switches using pytest" + :pypi:`pytest-network` *last release*: May 07, 2020, *status*: N/A, @@ -5615,7 +5785,7 @@ This list contains 1118 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Aug 23, 2022, + *last release*: Oct 07, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -5699,9 +5869,9 @@ This list contains 1118 plugins. A PyTest Reporter to send test runs to Notion.so :pypi:`pytest-nunit` - *last release*: Jul 26, 2022, - *status*: 4 - Beta, - *requires*: N/A + *last release*: Oct 20, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest (>=4.6.0) A pytest plugin for generating NUnit3 test result XML output @@ -5720,9 +5890,9 @@ This list contains 1118 plugins. pytest results data-base and HTML reporter :pypi:`pytest-odoo` - *last release*: Feb 08, 2022, + *last release*: Oct 31, 2022, *status*: 4 - Beta, - *requires*: N/A + *requires*: pytest (>=7.0.0) py.test plugin to run Odoo tests @@ -5769,7 +5939,7 @@ This list contains 1118 plugins. Pytest plugin for detecting inadvertent open file handles :pypi:`pytest-opentelemetry` - *last release*: Sep 07, 2022, + *last release*: Sep 18, 2022, *status*: N/A, *requires*: pytest @@ -5783,7 +5953,7 @@ This list contains 1118 plugins. pytest plugin for publish results to opentmi :pypi:`pytest-operator` - *last release*: Aug 17, 2022, + *last release*: Sep 28, 2022, *status*: N/A, *requires*: pytest @@ -5824,6 +5994,13 @@ This list contains 1118 plugins. pytest plugin to run your tests in a specific order + :pypi:`pytest-order-modify` + *last release*: Nov 04, 2022, + *status*: N/A, + *requires*: N/A + + 新增run_marker 来自定义用例的执行顺序 + :pypi:`pytest-osxnotify` *last release*: May 15, 2015, *status*: N/A, @@ -5832,7 +6009,7 @@ This list contains 1118 plugins. OS X notifications for py.test results. :pypi:`pytest-otel` - *last release*: May 26, 2022, + *last release*: Oct 19, 2022, *status*: N/A, *requires*: N/A @@ -5902,11 +6079,11 @@ This list contains 1118 plugins. A more user-friendly way to write parametrized tests. :pypi:`pytest-parametrized` - *last release*: Oct 19, 2020, + *last release*: Sep 13, 2022, *status*: 5 - Production/Stable, *requires*: pytest - Pytest plugin for parametrizing tests with default iterables. + Pytest decorator for parametrizing tests with default iterables. :pypi:`pytest-parawtf` *last release*: Dec 03, 2018, @@ -6000,7 +6177,7 @@ This list contains 1118 plugins. Pytest tool for persistent objects :pypi:`pytest-pg` - *last release*: Jun 07, 2022, + *last release*: Sep 19, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.0.0) @@ -6048,6 +6225,13 @@ This list contains 1118 plugins. Slice in your test base thanks to powerful markers. + :pypi:`pytest-pingguo-pytest-plugin` + *last release*: Oct 26, 2022, + *status*: 4 - Beta, + *requires*: N/A + + pingguo test + :pypi:`pytest-pings` *last release*: Jun 29, 2019, *status*: 3 - Alpha, @@ -6244,6 +6428,13 @@ This list contains 1118 plugins. A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. + :pypi:`pytest-pretty` + *last release*: Nov 03, 2022, + *status*: 4 - Beta, + *requires*: N/A + + pytest plugin for printing summary data as I want it + :pypi:`pytest-pretty-terminal` *last release*: Jan 31, 2022, *status*: N/A, @@ -6294,7 +6485,7 @@ This list contains 1118 plugins. Report test pass / failures to a Prometheus PushGateway :pypi:`pytest-prometheus-pushgateway` - *last release*: Sep 01, 2022, + *last release*: Sep 27, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6335,6 +6526,13 @@ This list contains 1118 plugins. Pytest PuDB debugger integration + :pypi:`pytest-pumpkin-spice` + *last release*: Sep 18, 2022, + *status*: 4 - Beta, + *requires*: N/A + + A pytest plugin that makes your test reporting pumpkin-spiced + :pypi:`pytest-purkinje` *last release*: Oct 28, 2017, *status*: 2 - Pre-Alpha, @@ -6350,7 +6548,7 @@ This list contains 1118 plugins. Plugin for py.test to enter PyCharm debugger on uncaught exceptions :pypi:`pytest-pycodestyle` - *last release*: Mar 13, 2022, + *last release*: Oct 28, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -6364,7 +6562,7 @@ This list contains 1118 plugins. py.test plugin to connect to a remote debug server with PyDev or PyCharm. :pypi:`pytest-pydocstyle` - *last release*: Mar 13, 2022, + *last release*: Oct 28, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -6385,7 +6583,7 @@ This list contains 1118 plugins. Record PyMySQL queries and mock with the stored data. :pypi:`pytest-pyodide` - *last release*: Sep 08, 2022, + *last release*: Oct 26, 2022, *status*: N/A, *requires*: pytest @@ -6497,7 +6695,7 @@ This list contains 1118 plugins. pytest plugin to generate test result QR codes :pypi:`pytest-qt` - *last release*: Jun 23, 2022, + *last release*: Oct 25, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=3.0.0) @@ -6518,9 +6716,9 @@ This list contains 1118 plugins. A plugin for pytest to manage expected test failures :pypi:`pytest-quickcheck` - *last release*: Nov 15, 2020, + *last release*: Nov 05, 2022, *status*: 4 - Beta, - *requires*: pytest (<6.0.0,>=4.0) + *requires*: pytest (>=4.0) pytest plugin to generate random data inspired by QuickCheck @@ -6623,7 +6821,7 @@ This list contains 1118 plugins. Test your README.md file :pypi:`pytest-reana` - *last release*: May 16, 2022, + *last release*: Oct 06, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -6686,9 +6884,9 @@ This list contains 1118 plugins. Management of Pytest dependencies via regex patterns :pypi:`pytest-regressions` - *last release*: Jan 19, 2022, + *last release*: Sep 17, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=3.5.0) + *requires*: pytest (>=6.2.0) Easy to use fixtures to write regression tests. @@ -6868,7 +7066,7 @@ This list contains 1118 plugins. A pytest plugin to elegantly skip tests with optional requirements :pypi:`pytest-reraise` - *last release*: Jun 17, 2021, + *last release*: Sep 20, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.6) @@ -6916,6 +7114,13 @@ This list contains 1118 plugins. Provides path for uniform access to test resources in isolated directory + :pypi:`pytest-resource-usage` + *last release*: Nov 06, 2022, + *status*: 5 - Production/Stable, + *requires*: N/A + + Pytest plugin for reporting running time and peak memory usage + :pypi:`pytest-responsemock` *last release*: Mar 10, 2022, *status*: 5 - Production/Stable, @@ -6924,7 +7129,7 @@ This list contains 1118 plugins. Simplified requests calls mocking for pytest :pypi:`pytest-responses` - *last release*: Apr 26, 2021, + *last release*: Oct 11, 2022, *status*: N/A, *requires*: pytest (>=2.5) @@ -6979,6 +7184,13 @@ This list contains 1118 plugins. A pytest plugin using Rich for beautiful test result formatting. + :pypi:`pytest-richtrace` + *last release*: Nov 05, 2022, + *status*: N/A, + *requires*: pytest (>=7.2.0,<8.0.0) + + + :pypi:`pytest-ringo` *last release*: Sep 27, 2017, *status*: 3 - Alpha, @@ -7085,7 +7297,7 @@ This list contains 1118 plugins. Call runtime_xfail() to mark running test as xfail. :pypi:`pytest-saccharin` - *last release*: May 10, 2022, + *last release*: Oct 31, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -7106,7 +7318,7 @@ This list contains 1118 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Aug 25, 2022, + *last release*: Nov 04, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -7148,7 +7360,7 @@ This list contains 1118 plugins. :pypi:`pytest-sbase` - *last release*: Sep 09, 2022, + *last release*: Nov 07, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7183,14 +7395,14 @@ This list contains 1118 plugins. A pytest plugin which allows to (de-)select tests from a file. :pypi:`pytest-selenium` - *last release*: Mar 28, 2022, + *last release*: Sep 21, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.0.0,<7.0.0) pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Sep 09, 2022, + *last release*: Nov 07, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7239,9 +7451,9 @@ This list contains 1118 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Aug 22, 2022, + *last release*: Nov 01, 2022, *status*: 3 - Alpha, - *requires*: pytest (==7.1.2) + *requires*: pytest (>=6.2) pytest servers @@ -7287,6 +7499,13 @@ This list contains 1118 plugins. + :pypi:`pytest-share-hdf` + *last release*: Sep 21, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + Plugin to save test data in HDF files and retrieve them for comparison + :pypi:`pytest-sharkreport` *last release*: Jul 11, 2022, *status*: N/A, @@ -7302,7 +7521,7 @@ This list contains 1118 plugins. A pytest plugin to help with testing shell scripts / black box commands :pypi:`pytest-shell-utilities` - *last release*: Jul 28, 2022, + *last release*: Sep 23, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -7617,7 +7836,7 @@ This list contains 1118 plugins. :pypi:`pytest-splunk-addon` - *last release*: Sep 08, 2022, + *last release*: Oct 06, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7652,7 +7871,7 @@ This list contains 1118 plugins. pytest plugin with sqlalchemy related fixtures :pypi:`pytest-sqlalchemy-mock` - *last release*: Aug 10, 2022, + *last release*: Sep 25, 2022, *status*: 3 - Alpha, *requires*: pytest (>=2.0) @@ -7722,7 +7941,7 @@ This list contains 1118 plugins. Run a test suite one failing test at a time. :pypi:`pytest-stf` - *last release*: Sep 09, 2022, + *last release*: Sep 30, 2022, *status*: N/A, *requires*: pytest (>=5.0) @@ -7778,7 +7997,7 @@ This list contains 1118 plugins. A pytest plugin to organize long run tests (named studies) without interfering the regular tests :pypi:`pytest-subprocess` - *last release*: Feb 09, 2022, + *last release*: Oct 02, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.0.0) @@ -7792,7 +8011,7 @@ This list contains 1118 plugins. A hack to explicitly set up and tear down fixtures. :pypi:`pytest-subtests` - *last release*: May 26, 2022, + *last release*: Oct 28, 2022, *status*: 4 - Beta, *requires*: pytest (>=7.0) @@ -7806,7 +8025,7 @@ This list contains 1118 plugins. pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. :pypi:`pytest-sugar` - *last release*: Jul 10, 2022, + *last release*: Nov 05, 2022, *status*: 3 - Alpha, *requires*: pytest (>=2.9) @@ -7854,6 +8073,13 @@ This list contains 1118 plugins. Pyst - Pytest System-Test Plugin + :pypi:`pytest-tagging` + *last release*: Oct 23, 2022, + *status*: N/A, + *requires*: pytest (>=7.1.3,<8.0.0) + + a pytest plugin to tag tests + :pypi:`pytest-takeltest` *last release*: Jan 04, 2022, *status*: N/A, @@ -7896,6 +8122,13 @@ This list contains 1118 plugins. tblineinfo is a py.test plugin that insert the node id in the final py.test report when --tb=line option is used + :pypi:`pytest-tcpclient` + *last release*: Oct 24, 2022, + *status*: N/A, + *requires*: pytest (<8,>=7.1.3) + + A pytest plugin for testing TCP clients + :pypi:`pytest-teamcity-logblock` *last release*: May 15, 2018, *status*: 4 - Beta, @@ -7918,7 +8151,7 @@ This list contains 1118 plugins. Predictable and repeatable tempdir support. :pypi:`pytest-terra-fixt` - *last release*: Sep 09, 2022, + *last release*: Sep 15, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -7995,7 +8228,7 @@ This list contains 1118 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Sep 09, 2022, + *last release*: Oct 30, 2022, *status*: 4 - Beta, *requires*: N/A @@ -8036,20 +8269,6 @@ This list contains 1118 plugins. pytest plugin for creating TestRail runs and adding results - :pypi:`pytest-testrail2` - *last release*: Nov 17, 2020, - *status*: N/A, - *requires*: pytest (>=5) - - A small example package - - :pypi:`pytest-testrail-api` - *last release*: Aug 29, 2022, - *status*: N/A, - *requires*: pytest (>=5.5) - - Плагин Pytest, для интеграции с TestRail - :pypi:`pytest-testrail-api-client` *last release*: Dec 14, 2021, *status*: N/A, @@ -8240,7 +8459,7 @@ This list contains 1118 plugins. Better fixtures management. Various helpers :pypi:`pytest-tldr` - *last release*: Mar 12, 2021, + *last release*: Oct 26, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) @@ -8281,6 +8500,13 @@ This list contains 1118 plugins. this is a vue-element ui report for pytest + :pypi:`pytest-tmux` + *last release*: Sep 22, 2022, + *status*: 4 - Beta, + *requires*: N/A + + + :pypi:`pytest-todo` *last release*: May 23, 2019, *status*: 4 - Beta, @@ -8310,7 +8536,7 @@ This list contains 1118 plugins. Numerous useful plugins for pytest. :pypi:`pytest-tools` - *last release*: Jul 04, 2022, + *last release*: Oct 21, 2022, *status*: 4 - Beta, *requires*: N/A @@ -8394,15 +8620,15 @@ This list contains 1118 plugins. py.test plugin for using the same _trial_temp working directory as trial :pypi:`pytest-trio` - *last release*: Oct 16, 2020, + *last release*: Nov 01, 2022, *status*: N/A, - *requires*: N/A + *requires*: pytest (>=7.2.0) Pytest plugin for trio :pypi:`pytest-trytond` - *last release*: Feb 02, 2022, - *status*: 3 - Alpha, + *last release*: Nov 04, 2022, + *status*: 4 - Beta, *requires*: pytest (>=5) Pytest plugin for the Tryton server framework @@ -8429,11 +8655,11 @@ This list contains 1118 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: Sep 07, 2022, + *last release*: Sep 21, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.5) - Text User Interface (TUI) for Pytest, with optional auto-launch and HTML export + Text User Interface (TUI) and HTML report for Pytest test runs :pypi:`pytest-twilio-conversations-client-mock` *last release*: Aug 02, 2022, @@ -8443,7 +8669,7 @@ This list contains 1118 plugins. :pypi:`pytest-twisted` - *last release*: Aug 30, 2021, + *last release*: Oct 16, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=2.3) @@ -8464,7 +8690,7 @@ This list contains 1118 plugins. A Typhoon HIL plugin that facilitates test parameter configuration at runtime :pypi:`pytest-typhoon-xray` - *last release*: Mar 07, 2022, + *last release*: Nov 04, 2022, *status*: 4 - Beta, *requires*: N/A @@ -8492,7 +8718,7 @@ This list contains 1118 plugins. Text User Interface for running python tests :pypi:`pytest-unflakable` - *last release*: Jun 14, 2022, + *last release*: Oct 26, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2.0) @@ -8527,7 +8753,7 @@ This list contains 1118 plugins. Test equality of unordered collections in pytest :pypi:`pytest-unstable` - *last release*: Jun 10, 2022, + *last release*: Sep 27, 2022, *status*: 4 - Beta, *requires*: N/A @@ -8596,6 +8822,13 @@ This list contains 1118 plugins. Test from HTTP interactions to dataframe processed. + :pypi:`pytest-vcs` + *last release*: Sep 22, 2022, + *status*: 4 - Beta, + *requires*: N/A + + + :pypi:`pytest-venv` *last release*: Aug 04, 2020, *status*: 4 - Beta, @@ -8604,11 +8837,11 @@ This list contains 1118 plugins. py.test fixture for creating a virtual environment :pypi:`pytest-ver` - *last release*: Aug 21, 2022, + *last release*: Nov 07, 2022, *status*: 2 - Pre-Alpha, *requires*: N/A - Pytest module with Verification Report + Pytest module with Verification Protocol, Verification Report and Trace Matrix :pypi:`pytest-verbose-parametrize` *last release*: May 28, 2019, @@ -8659,6 +8892,13 @@ This list contains 1118 plugins. pytest plugin for automatic recording of http stubbed tests + :pypi:`pytest-vulture` + *last release*: Oct 12, 2022, + *status*: N/A, + *requires*: pytest (>=7.0.0) + + A pytest plugin to checks dead code with vulture + :pypi:`pytest-vw` *last release*: Oct 07, 2015, *status*: 4 - Beta, @@ -8681,7 +8921,7 @@ This list contains 1118 plugins. Pytest plugin for testing whatsapp bots with end to end tests :pypi:`pytest-wake` - *last release*: Aug 30, 2022, + *last release*: Sep 28, 2022, *status*: N/A, *requires*: pytest @@ -8695,7 +8935,7 @@ This list contains 1118 plugins. Local continuous test runner with pytest and watchdog. :pypi:`pytest-watcher` - *last release*: Dec 30, 2021, + *last release*: Oct 30, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -8708,6 +8948,13 @@ This list contains 1118 plugins. Pytest plugin for testing WDL workflows. + :pypi:`pytest-web3-data` + *last release*: Sep 15, 2022, + *status*: 4 - Beta, + *requires*: pytest + + + :pypi:`pytest-webdriver` *last release*: May 28, 2019, *status*: 5 - Production/Stable, @@ -8772,7 +9019,7 @@ This list contains 1118 plugins. A pytest plugin for configuring workflow/pipeline tests using YAML files :pypi:`pytest-xdist` - *last release*: Dec 10, 2021, + *last release*: Oct 25, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2.0) @@ -8821,7 +9068,7 @@ This list contains 1118 plugins. Extended logging for test and decorators :pypi:`pytest-xlsx` - *last release*: Aug 04, 2022, + *last release*: Nov 06, 2022, *status*: N/A, *requires*: N/A @@ -8862,13 +9109,6 @@ This list contains 1118 plugins. - :pypi:`pytest-xreport` - *last release*: May 17, 2022, - *status*: 4 - Beta, - *requires*: pytest (>=3.5.0) - - - :pypi:`pytest-xvfb` *last release*: Jun 09, 2020, *status*: 4 - Beta, @@ -8919,7 +9159,7 @@ This list contains 1118 plugins. PyTest plugin to run tests concurrently, each \`yield\` switch context to other one :pypi:`pytest-yls` - *last release*: Aug 08, 2022, + *last release*: Oct 21, 2022, *status*: N/A, *requires*: pytest (>=7.1.2,<8.0.0) From b635e16d30c3991397b6c5d303b0cfc801e8e266 Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Tue, 8 Nov 2022 19:05:10 +0100 Subject: [PATCH 444/549] scripts/update-plugin-list: Improve requirement detection PEP 566 does not require a space after the dependency name. --- scripts/update-plugin-list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-plugin-list.py b/scripts/update-plugin-list.py index f8bbd19af50..3f3641d7d3e 100644 --- a/scripts/update-plugin-list.py +++ b/scripts/update-plugin-list.py @@ -78,7 +78,7 @@ def iter_plugins(): requires = "N/A" if info["requires_dist"]: for requirement in info["requires_dist"]: - if requirement == "pytest" or "pytest " in requirement: + if re.match(r"pytest(?![-.\w])", requirement): requires = requirement break releases = response.json()["releases"] From b55e264a675f7621b8351e227b93742f19e01c7d Mon Sep 17 00:00:00 2001 From: Daniel Valenzuela Date: Wed, 9 Nov 2022 19:43:10 -0300 Subject: [PATCH 445/549] Fix test_raising_repr test Closes #10473 Python <3.11 versions depend on `exceptiongroup>=1.0.0rc8`, and they released version `1.0.1` 6 days ago (2022/11/03) that as a side-effect changed the output of exceptions. --- testing/test_assertion.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/testing/test_assertion.py b/testing/test_assertion.py index d8844f2e41d..75745922108 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -1664,15 +1664,7 @@ def test_raising_repr(): """ ) result = pytester.runpytest() - if sys.version_info >= (3, 11): - # python 3.11 has native support for un-str-able exceptions - result.stdout.fnmatch_lines( - ["E AssertionError: "] - ) - else: - result.stdout.fnmatch_lines( - ["E AssertionError: "] - ) + result.stdout.fnmatch_lines(["E AssertionError: "]) def test_issue_1944(pytester: Pytester) -> None: From 593178d90954b9820b63f9d0b587251752d74be8 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 13 Nov 2022 00:22:21 +0000 Subject: [PATCH 446/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 144 +++++++++++++++++-------------- 1 file changed, 80 insertions(+), 64 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index d923fe6192c..13dcbb9f579 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1148 plugins. +This list contains 1150 plugins. .. only:: not latex @@ -31,7 +31,7 @@ This list contains 1148 plugins. :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Nov 01, 2020 N/A pytest (>=6) - :pypi:`pytest-aiomoto` pytest-aiomoto Oct 29, 2022 N/A pytest (>=7.0,<8.0) + :pypi:`pytest-aiomoto` pytest-aiomoto Nov 09, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) @@ -63,7 +63,7 @@ This list contains 1148 plugins. :pypi:`pytest-appengine` AppEngine integration that works well with pytest-django Feb 27, 2017 N/A N/A :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A :pypi:`pytest-approvaltests` A plugin to use approvaltests with pytest May 08, 2022 4 - Beta pytest (>=7.0.1) - :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Oct 27, 2022 5 - Production/Stable pytest + :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Nov 10, 2022 5 - Production/Stable pytest :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 4 - Beta pytest (>=4.6) :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) @@ -79,7 +79,7 @@ This list contains 1148 plugins. :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Sep 06, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest - :pypi:`pytest-asyncio` Pytest support for asyncio Oct 21, 2022 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-asyncio` Pytest support for asyncio Nov 11, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jul 11, 2022 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) @@ -104,7 +104,7 @@ This list contains 1148 plugins. :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-bandit-xayon` A bandit plugin for pytest Oct 17, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) - :pypi:`pytest-bdd` BDD for pytest Nov 05, 2022 6 - Mature pytest (>=6.2.0) + :pypi:`pytest-bdd` BDD for pytest Nov 08, 2022 6 - Mature pytest (>=6.2.0) :pypi:`pytest-bdd-html` pytest plugin to display BDD info in HTML test report Jul 25, 2022 3 - Alpha pytest (!=6.0.0,>=5.0) :pypi:`pytest-bdd-ng` BDD for pytest Oct 06, 2022 4 - Beta pytest (>=5.0) :pypi:`pytest-bdd-splinter` Common steps for pytest bdd and splinter integration Aug 12, 2019 5 - Production/Stable pytest (>=4.0.0) @@ -192,7 +192,7 @@ This list contains 1148 plugins. :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A :pypi:`pytest-codeowners` Pytest plugin for selecting tests by GitHub CODEOWNERS. Mar 30, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-codestyle` pytest plugin to run pycodestyle Mar 23, 2020 3 - Alpha N/A - :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Nov 06, 2022 5 - Production/Stable N/A + :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Nov 10, 2022 5 - Production/Stable pytest>=3.8 :pypi:`pytest-collect-formatter` Formatter for pytest collect output Mar 29, 2021 5 - Production/Stable N/A :pypi:`pytest-collect-formatter2` Formatter for pytest collect output May 31, 2021 5 - Production/Stable N/A :pypi:`pytest-collector` Python package for collecting pytest. Aug 02, 2022 N/A pytest (>=7.0,<8.0) @@ -240,6 +240,7 @@ This list contains 1148 plugins. :pypi:`pytest-datadir` pytest plugin for test data directories and files Oct 25, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Aug 16, 2022 5 - Production/Stable pytest (>=7.1) :pypi:`pytest-datadir-ng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Dec 25, 2019 5 - Production/Stable pytest + :pypi:`pytest-datadir-nng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Nov 09, 2022 5 - Production/Stable pytest (>=7.0.0,<8.0.0) :pypi:`pytest-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Jul 19, 2022 N/A pytest (>=7.0.1) :pypi:`pytest-data-file` Fixture "data" and "case_data" for test from yaml file Dec 04, 2019 N/A N/A :pypi:`pytest-datafiles` py.test plugin to create a 'tmpdir' containing predefined files/directories. May 01, 2022 5 - Production/Stable pytest (>=3.6) @@ -279,7 +280,7 @@ This list contains 1148 plugins. :pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. Mar 27, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :pypi:`pytest-django` A Django plugin for pytest. Dec 07, 2021 5 - Production/Stable pytest (>=5.4.0) :pypi:`pytest-django-ahead` A Django plugin for pytest. Oct 27, 2016 5 - Production/Stable pytest (>=2.9) - :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Aug 04, 2021 4 - Beta N/A + :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Nov 09, 2022 4 - Beta N/A :pypi:`pytest-django-cache-xdist` A djangocachexdist plugin for pytest May 12, 2020 4 - Beta N/A :pypi:`pytest-django-casperjs` Integrate CasperJS with your django tests as a pytest fixture. Mar 15, 2015 2 - Pre-Alpha N/A :pypi:`pytest-django-dotenv` Pytest plugin used to setup environment variables with django-dotenv Nov 26, 2019 4 - Beta pytest (>=2.6.0) @@ -362,7 +363,7 @@ This list contains 1148 plugins. :pypi:`pytest-encode` set your encoding and logger Nov 06, 2021 N/A N/A :pypi:`pytest-encode-kane` set your encoding and logger Nov 16, 2021 N/A pytest :pypi:`pytest-enhancements` Improvements for pytest (rejected upstream) Oct 30, 2019 4 - Beta N/A - :pypi:`pytest-env` py.test plugin that allows you to add environment variables. Oct 23, 2022 5 - Production/Stable N/A + :pypi:`pytest-env` py.test plugin that allows you to add environment variables. Oct 23, 2022 5 - Production/Stable pytest>=7.1.3 :pypi:`pytest-envfiles` A py.test plugin that parses environment files before running tests Oct 08, 2015 3 - Alpha N/A :pypi:`pytest-env-info` Push information about the running pytest into envvars Nov 25, 2017 4 - Beta pytest (>=3.1.1) :pypi:`pytest-envraw` py.test plugin that allows you to add environment variables. Aug 27, 2020 4 - Beta pytest (>=2.6.0) @@ -440,7 +441,7 @@ This list contains 1148 plugins. :pypi:`pytest-forward-compatability` A name to avoid typosquating pytest-foward-compatibility Sep 06, 2020 N/A N/A :pypi:`pytest-forward-compatibility` A pytest plugin to shim pytest commandline options for fowards compatibility Sep 29, 2020 N/A N/A :pypi:`pytest-freezegun` Wrap tests with fixtures in freeze_time Jul 19, 2020 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-freezer` Pytest plugin providing a fixture interface for spulec/freezegun Oct 20, 2022 N/A N/A + :pypi:`pytest-freezer` Pytest plugin providing a fixture interface for spulec/freezegun Oct 20, 2022 N/A pytest>=3.6 :pypi:`pytest-freeze-reqs` Check if requirement files are frozen Apr 29, 2021 N/A N/A :pypi:`pytest-frozen-uuids` Deterministically frozen UUID's for your tests Apr 17, 2022 N/A pytest (>=3.0) :pypi:`pytest-func-cov` Pytest plugin for measuring function coverage Apr 15, 2021 3 - Alpha pytest (>=5) @@ -455,7 +456,7 @@ This list contains 1148 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Oct 21, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Nov 09, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -463,6 +464,7 @@ This list contains 1148 plugins. :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Jul 02, 2022 N/A pytest (>=4.0.0) :pypi:`pytest-github-report` Generate a GitHub report using pytest in GitHub Workflows Jun 03, 2022 4 - Beta N/A :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A + :pypi:`pytest-git-selector` Utility for finding test files to run based on git diff against the branch base Nov 09, 2022 N/A N/A :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Jul 22, 2022 4 - Beta pytest :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest :pypi:`pytest-golden` Plugin for pytest that offloads expected outputs to data files Jul 18, 2022 N/A pytest (>=6.1.2) @@ -482,7 +484,7 @@ This list contains 1148 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Nov 05, 2022 3 - Alpha pytest (==7.1.3) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Nov 09, 2022 3 - Alpha pytest (==7.1.3) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) @@ -506,7 +508,7 @@ This list contains 1148 plugins. :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A - :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Aug 05, 2022 4 - Beta N/A + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Aug 05, 2022 4 - Beta pytest>=7.1 :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Aug 09, 2022 4 - Beta N/A :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Sep 07, 2022 5 - Production/Stable N/A @@ -599,7 +601,7 @@ This list contains 1148 plugins. :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A :pypi:`pytest-loop` pytest plugin for looping tests Jul 22, 2022 5 - Production/Stable pytest (>=6) :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Oct 15, 2022 3 - Alpha pytest - :pypi:`pytest-manual-marker` pytest marker for marking manual tests Aug 04, 2022 3 - Alpha N/A + :pypi:`pytest-manual-marker` pytest marker for marking manual tests Aug 04, 2022 3 - Alpha pytest>=7 :pypi:`pytest-markdoctest` A pytest plugin to doctest your markdown files Jul 22, 2022 4 - Beta pytest (>=6) :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) :pypi:`pytest-markdown-docs` Run markdown code fences through pytest Sep 02, 2022 N/A N/A @@ -617,7 +619,7 @@ This list contains 1148 plugins. :pypi:`pytest-md` Plugin for generating Markdown reports for pytest results Jul 11, 2019 3 - Alpha pytest (>=4.2.1) :pypi:`pytest-md-report` A pytest plugin to make a test results report with Markdown table format. Aug 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :pypi:`pytest-memprof` Estimates memory consumption of test functions Mar 29, 2019 4 - Beta N/A - :pypi:`pytest-memray` A simple plugin to use with pytest Aug 21, 2022 N/A N/A + :pypi:`pytest-memray` A simple plugin to use with pytest Aug 21, 2022 N/A pytest>=7.1.2 :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) @@ -661,11 +663,11 @@ This list contains 1148 plugins. :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Aug 12, 2021 N/A pytest (>=3.6) :pypi:`pytest-multithreading-allure` pytest_multithreading_allure Oct 20, 2022 N/A N/A :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) - :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Sep 27, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" + :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Nov 10, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Oct 26, 2022 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A N/A - :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. May 30, 2022 N/A N/A + :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A pytest>=6.0.0 + :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. May 30, 2022 N/A pytest>=6,<8 :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 15, 2022 5 - Production/Stable pytest (>=6.2) :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) @@ -699,7 +701,7 @@ This list contains 1148 plugins. :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jun 14, 2022 5 - Production/Stable pytest (<7.1); python_version <= "3.6" :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) - :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry Sep 18, 2022 N/A pytest + :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry Nov 12, 2022 N/A pytest :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Jun 02, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-operator` Fixtures for Operators Sep 28, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A @@ -769,7 +771,7 @@ This list contains 1148 plugins. :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 27, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) - :pypi:`pytest-pretty` pytest plugin for printing summary data as I want it Nov 03, 2022 4 - Beta N/A + :pypi:`pytest-pretty` pytest plugin for printing summary data as I want it Nov 03, 2022 4 - Beta pytest>=7 :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 31, 2022 N/A pytest (>=3.4.1) :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Dec 28, 2021 5 - Production/Stable pytest (>=6) @@ -867,7 +869,7 @@ This list contains 1148 plugins. :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Aug 12, 2022 N/A N/A :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-resource-usage` Pytest plugin for reporting running time and peak memory usage Nov 06, 2022 5 - Production/Stable N/A + :pypi:`pytest-resource-usage` Pytest plugin for reporting running time and peak memory usage Nov 06, 2022 5 - Production/Stable pytest>=7.0.0 :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A :pypi:`pytest-responses` py.test integration for responses Oct 11, 2022 N/A pytest (>=2.5) :pypi:`pytest-rest-api` Aug 08, 2022 N/A pytest (>=7.1.2,<8.0.0) @@ -881,7 +883,7 @@ This list contains 1148 plugins. :pypi:`pytest-ringo` pytest plugin to test webapplications using the Ringo webframework Sep 27, 2017 3 - Alpha N/A :pypi:`pytest-rmsis` Sycronise pytest results to Jira RMsis Aug 10, 2022 N/A pytest (>=5.3.5) :pypi:`pytest-rng` Fixtures for seeding tests and making randomness reproducible Aug 08, 2019 5 - Production/Stable pytest - :pypi:`pytest-roast` pytest plugin for ROAST configuration override and fixtures Jul 29, 2021 5 - Production/Stable pytest + :pypi:`pytest-roast` pytest plugin for ROAST configuration override and fixtures Nov 09, 2022 5 - Production/Stable pytest :pypi:`pytest-rocketchat` Pytest to Rocket.Chat reporting plugin Apr 18, 2021 5 - Production/Stable N/A :pypi:`pytest-rotest` Pytest integration with rotest Sep 08, 2019 N/A pytest (>=3.5.0) :pypi:`pytest-rpc` Extend py.test for RPC OpenStack testing. Feb 22, 2019 4 - Beta pytest (~=3.6) @@ -891,8 +893,8 @@ This list contains 1148 plugins. :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A :pypi:`pytest-runner` Invoke py.test as distutils command with dependency resolution Feb 25, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' - :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Jul 03, 2022 5 - Production/Stable pytest - :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A N/A + :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Nov 12, 2022 5 - Production/Stable pytest + :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A pytest>=5.0.0 :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Oct 31, 2022 3 - Alpha N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A @@ -902,20 +904,20 @@ This list contains 1148 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Nov 07, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Nov 11, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 21, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Nov 07, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Nov 11, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A - :pypi:`pytest-servers` pytest servers Nov 01, 2022 3 - Alpha pytest (>=6.2) + :pypi:`pytest-servers` pytest servers Nov 09, 2022 3 - Alpha pytest (>=6.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :pypi:`pytest-session2file` pytest-session2file (aka: pytest-session_to_file for v0.1.0 - v0.1.2) is a py.test plugin for capturing and saving to file the stdout of py.test. Jan 26, 2021 3 - Alpha pytest :pypi:`pytest-session-fixture-globalize` py.test plugin to make session fixtures behave as if written in conftest, even if it is written in some modules May 15, 2018 4 - Beta N/A @@ -937,7 +939,7 @@ This list contains 1148 plugins. :pypi:`pytest-skip-markers` Pytest Salt Plugin May 09, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-skipper` A plugin that selects only tests with changes in execution path Mar 26, 2017 3 - Alpha pytest (>=3.0.6) :pypi:`pytest-skippy` Automatically skip tests that don't need to run! Jan 27, 2018 3 - Alpha pytest (>=2.3.4) - :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Apr 26, 2022 N/A N/A + :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Apr 26, 2022 N/A pytest>=6.2.0 :pypi:`pytest-slack` Pytest to Slack reporting plugin Dec 15, 2020 5 - Production/Stable N/A :pypi:`pytest-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A :pypi:`pytest-smartcollect` A plugin for collecting tests that touch changed code Oct 04, 2018 N/A pytest (>=3.5.0) @@ -970,7 +972,7 @@ This list contains 1148 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Oct 06, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Nov 11, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A @@ -978,7 +980,7 @@ This list contains 1148 plugins. :pypi:`pytest-sqlalchemy-mock` pytest sqlalchemy plugin for mock Sep 25, 2022 3 - Alpha pytest (>=2.0) :pypi:`pytest-sql-bigquery` Yet another SQL-testing framework for BigQuery provided by pytest plugin Dec 19, 2019 N/A pytest :pypi:`pytest-squadcast` Pytest report plugin for Squadcast Feb 22, 2022 5 - Production/Stable pytest - :pypi:`pytest-srcpaths` Add paths to sys.path Oct 15, 2021 N/A N/A + :pypi:`pytest-srcpaths` Add paths to sys.path Oct 15, 2021 N/A pytest>=6.2.0 :pypi:`pytest-ssh` pytest plugin for ssh command run May 27, 2019 N/A pytest :pypi:`pytest-start-from` Start pytest run from a given point Apr 11, 2016 N/A N/A :pypi:`pytest-statsd` pytest plugin for reporting to graphite Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) @@ -1011,7 +1013,7 @@ This list contains 1148 plugins. :pypi:`pytest-tape` easy assertion with expected results saved to yaml files Mar 17, 2021 4 - Beta N/A :pypi:`pytest-target` Pytest plugin for remote target orchestration. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) :pypi:`pytest-tblineinfo` tblineinfo is a py.test plugin that insert the node id in the final py.test report when --tb=line option is used Dec 01, 2015 3 - Alpha pytest (>=2.0) - :pypi:`pytest-tcpclient` A pytest plugin for testing TCP clients Oct 24, 2022 N/A pytest (<8,>=7.1.3) + :pypi:`pytest-tcpclient` A pytest plugin for testing TCP clients Nov 10, 2022 N/A pytest (<8,>=7.1.3) :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) @@ -1146,7 +1148,7 @@ This list contains 1148 plugins. :pypi:`pytest-xfaillist` Maintain a xfaillist in an additional file to avoid merge-conflicts. Sep 17, 2021 N/A pytest (>=6.2.2,<7.0.0) :pypi:`pytest-xfiles` Pytest fixtures providing data read from function, module or package related (x)files. Feb 27, 2018 N/A N/A :pypi:`pytest-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A - :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Nov 06, 2022 N/A N/A + :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Nov 06, 2022 N/A pytest>=7.1.2 :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Aug 29, 2022 4 - Beta pytest (>=2.8) :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A @@ -1160,7 +1162,7 @@ This list contains 1148 plugins. :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) :pypi:`pytest-yield` PyTest plugin to run tests concurrently, each \`yield\` switch context to other one Jan 23, 2019 N/A N/A :pypi:`pytest-yls` Pytest plugin to test the YLS as a whole. Oct 21, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A N/A + :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A pytest>=5.0.0 :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Jun 02, 2022 5 - Production/Stable pytest (>=4.5.0) @@ -1263,7 +1265,7 @@ This list contains 1148 plugins. Pytest \`client\` fixture for the Aiohttp :pypi:`pytest-aiomoto` - *last release*: Oct 29, 2022, + *last release*: Nov 09, 2022, *status*: N/A, *requires*: pytest (>=7.0,<8.0) @@ -1487,7 +1489,7 @@ This list contains 1148 plugins. A plugin to use approvaltests with pytest :pypi:`pytest-approvaltests-geo` - *last release*: Oct 27, 2022, + *last release*: Nov 10, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -1599,7 +1601,7 @@ This list contains 1148 plugins. :pypi:`pytest-asyncio` - *last release*: Oct 21, 2022, + *last release*: Nov 11, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.1.0) @@ -1774,7 +1776,7 @@ This list contains 1148 plugins. pytest plugin for URL based testing :pypi:`pytest-bdd` - *last release*: Nov 05, 2022, + *last release*: Nov 08, 2022, *status*: 6 - Mature, *requires*: pytest (>=6.2.0) @@ -2390,9 +2392,9 @@ This list contains 1148 plugins. pytest plugin to run pycodestyle :pypi:`pytest-codspeed` - *last release*: Nov 06, 2022, + *last release*: Nov 10, 2022, *status*: 5 - Production/Stable, - *requires*: N/A + *requires*: pytest>=3.8 Pytest plugin to create CodSpeed benchmarks @@ -2725,6 +2727,13 @@ This list contains 1148 plugins. Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. + :pypi:`pytest-datadir-nng` + *last release*: Nov 09, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest (>=7.0.0,<8.0.0) + + Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. + :pypi:`pytest-data-extractor` *last release*: Jul 19, 2022, *status*: N/A, @@ -2999,7 +3008,7 @@ This list contains 1148 plugins. A Django plugin for pytest. :pypi:`pytest-djangoapp` - *last release*: Aug 04, 2021, + *last release*: Nov 09, 2022, *status*: 4 - Beta, *requires*: N/A @@ -3582,7 +3591,7 @@ This list contains 1148 plugins. :pypi:`pytest-env` *last release*: Oct 23, 2022, *status*: 5 - Production/Stable, - *requires*: N/A + *requires*: pytest>=7.1.3 py.test plugin that allows you to add environment variables. @@ -4128,7 +4137,7 @@ This list contains 1148 plugins. :pypi:`pytest-freezer` *last release*: Oct 20, 2022, *status*: N/A, - *requires*: N/A + *requires*: pytest>=3.6 Pytest plugin providing a fixture interface for spulec/freezegun @@ -4231,7 +4240,7 @@ This list contains 1148 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Oct 21, 2022, + *last release*: Nov 09, 2022, *status*: N/A, *requires*: N/A @@ -4286,6 +4295,13 @@ This list contains 1148 plugins. py.test plugin to ignore the same files as git + :pypi:`pytest-git-selector` + *last release*: Nov 09, 2022, + *status*: N/A, + *requires*: N/A + + Utility for finding test files to run based on git diff against the branch base + :pypi:`pytest-glamor-allure` *last release*: Jul 22, 2022, *status*: 4 - Beta, @@ -4420,7 +4436,7 @@ This list contains 1148 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Nov 05, 2022, + *last release*: Nov 09, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.3) @@ -4590,7 +4606,7 @@ This list contains 1148 plugins. :pypi:`pytest-ibutsu` *last release*: Aug 05, 2022, *status*: 4 - Beta, - *requires*: N/A + *requires*: pytest>=7.1 A plugin to sent pytest results to an Ibutsu server @@ -5241,7 +5257,7 @@ This list contains 1148 plugins. :pypi:`pytest-manual-marker` *last release*: Aug 04, 2022, *status*: 3 - Alpha, - *requires*: N/A + *requires*: pytest>=7 pytest marker for marking manual tests @@ -5367,7 +5383,7 @@ This list contains 1148 plugins. :pypi:`pytest-memray` *last release*: Aug 21, 2022, *status*: N/A, - *requires*: N/A + *requires*: pytest>=7.1.2 A simple plugin to use with pytest @@ -5673,7 +5689,7 @@ This list contains 1148 plugins. Add the mutation testing feature to pytest :pypi:`pytest-mypy` - *last release*: Sep 27, 2022, + *last release*: Nov 10, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2) ; python_version >= "3.10" @@ -5696,14 +5712,14 @@ This list contains 1148 plugins. :pypi:`pytest-mypy-plugins-shim` *last release*: Apr 12, 2021, *status*: N/A, - *requires*: N/A + *requires*: pytest>=6.0.0 Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. :pypi:`pytest-mypy-testing` *last release*: May 30, 2022, *status*: N/A, - *requires*: N/A + *requires*: pytest>=6,<8 Pytest plugin to check mypy output. @@ -5939,7 +5955,7 @@ This list contains 1148 plugins. Pytest plugin for detecting inadvertent open file handles :pypi:`pytest-opentelemetry` - *last release*: Sep 18, 2022, + *last release*: Nov 12, 2022, *status*: N/A, *requires*: pytest @@ -6431,7 +6447,7 @@ This list contains 1148 plugins. :pypi:`pytest-pretty` *last release*: Nov 03, 2022, *status*: 4 - Beta, - *requires*: N/A + *requires*: pytest>=7 pytest plugin for printing summary data as I want it @@ -7117,7 +7133,7 @@ This list contains 1148 plugins. :pypi:`pytest-resource-usage` *last release*: Nov 06, 2022, *status*: 5 - Production/Stable, - *requires*: N/A + *requires*: pytest>=7.0.0 Pytest plugin for reporting running time and peak memory usage @@ -7213,7 +7229,7 @@ This list contains 1148 plugins. Fixtures for seeding tests and making randomness reproducible :pypi:`pytest-roast` - *last release*: Jul 29, 2021, + *last release*: Nov 09, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -7283,7 +7299,7 @@ This list contains 1148 plugins. Invoke py.test as distutils command with dependency resolution :pypi:`pytest-run-subprocess` - *last release*: Jul 03, 2022, + *last release*: Nov 12, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -7292,7 +7308,7 @@ This list contains 1148 plugins. :pypi:`pytest-runtime-xfail` *last release*: Aug 26, 2021, *status*: N/A, - *requires*: N/A + *requires*: pytest>=5.0.0 Call runtime_xfail() to mark running test as xfail. @@ -7360,7 +7376,7 @@ This list contains 1148 plugins. :pypi:`pytest-sbase` - *last release*: Nov 07, 2022, + *last release*: Nov 11, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7402,7 +7418,7 @@ This list contains 1148 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Nov 07, 2022, + *last release*: Nov 11, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7451,7 +7467,7 @@ This list contains 1148 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Nov 01, 2022, + *last release*: Nov 09, 2022, *status*: 3 - Alpha, *requires*: pytest (>=6.2) @@ -7607,7 +7623,7 @@ This list contains 1148 plugins. :pypi:`pytest-skip-slow` *last release*: Apr 26, 2022, *status*: N/A, - *requires*: N/A + *requires*: pytest>=6.2.0 A pytest plugin to skip \`@pytest.mark.slow\` tests by default. @@ -7836,7 +7852,7 @@ This list contains 1148 plugins. :pypi:`pytest-splunk-addon` - *last release*: Oct 06, 2022, + *last release*: Nov 11, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -7894,7 +7910,7 @@ This list contains 1148 plugins. :pypi:`pytest-srcpaths` *last release*: Oct 15, 2021, *status*: N/A, - *requires*: N/A + *requires*: pytest>=6.2.0 Add paths to sys.path @@ -8123,7 +8139,7 @@ This list contains 1148 plugins. tblineinfo is a py.test plugin that insert the node id in the final py.test report when --tb=line option is used :pypi:`pytest-tcpclient` - *last release*: Oct 24, 2022, + *last release*: Nov 10, 2022, *status*: N/A, *requires*: pytest (<8,>=7.1.3) @@ -9070,7 +9086,7 @@ This list contains 1148 plugins. :pypi:`pytest-xlsx` *last release*: Nov 06, 2022, *status*: N/A, - *requires*: N/A + *requires*: pytest>=7.1.2 pytest plugin for generating test cases by xlsx(excel) @@ -9168,7 +9184,7 @@ This list contains 1148 plugins. :pypi:`pytest-yuk` *last release*: Mar 26, 2021, *status*: N/A, - *requires*: N/A + *requires*: pytest>=5.0.0 Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. From f97f3dc3a38452dbb602b5fafe52bb39a07cdd23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 03:00:43 +0000 Subject: [PATCH 447/549] build(deps): Bump pytest-bdd in /testing/plugins_integration Bumps [pytest-bdd](https://github.com/pytest-dev/pytest-bdd) from 6.0.1 to 6.1.1. - [Release notes](https://github.com/pytest-dev/pytest-bdd/releases) - [Changelog](https://github.com/pytest-dev/pytest-bdd/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-bdd/compare/6.0.1...6.1.1) --- updated-dependencies: - dependency-name: pytest-bdd dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 2a73a1876ed..7b54b42ac31 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,7 +1,7 @@ anyio[curio,trio]==3.6.2 django==4.1.2 pytest-asyncio==0.20.1 -pytest-bdd==6.0.1 +pytest-bdd==6.1.1 pytest-cov==4.0.0 pytest-django==4.5.2 pytest-flakes==4.0.5 From 506b10d295f8023e2752c3e3bcb15f6ea1fd444d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 11:36:00 +0000 Subject: [PATCH 448/549] build(deps): Bump pytest-asyncio in /testing/plugins_integration (#10494) Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.20.1 to 0.20.2. - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Changelog](https://github.com/pytest-dev/pytest-asyncio/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.20.1...v0.20.2) --- updated-dependencies: - dependency-name: pytest-asyncio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bruno Oliveira --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 7b54b42ac31..ceab31d160d 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,6 +1,6 @@ anyio[curio,trio]==3.6.2 django==4.1.2 -pytest-asyncio==0.20.1 +pytest-asyncio==0.20.2 pytest-bdd==6.1.1 pytest-cov==4.0.0 pytest-django==4.5.2 From c842893b02ec908ae96a67adffdd4f5a651fa3b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 11:36:55 +0000 Subject: [PATCH 449/549] build(deps): Bump django in /testing/plugins_integration Bumps [django](https://github.com/django/django) from 4.1.2 to 4.1.3. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/4.1.2...4.1.3) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index ceab31d160d..594c592c3b8 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.6.2 -django==4.1.2 +django==4.1.3 pytest-asyncio==0.20.2 pytest-bdd==6.1.1 pytest-cov==4.0.0 From 4fce29f15d88a30d655c701e503a4ecb6920e289 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 00:17:06 +0000 Subject: [PATCH 450/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.2.0 → v3.2.2](https://github.com/asottile/pyupgrade/compare/v3.2.0...v3.2.2) - [github.com/pre-commit/mirrors-mypy: v0.982 → v0.990](https://github.com/pre-commit/mirrors-mypy/compare/v0.982...v0.990) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8ab6c6d3ecb..cff5546d4a5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,7 +44,7 @@ repos: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v3.2.0 + rev: v3.2.2 hooks: - id: pyupgrade args: [--py37-plus] @@ -58,7 +58,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.982 + rev: v0.990 hooks: - id: mypy files: ^(src/|testing/) From d5466b39173a62fbcbe0dd2554ede7781a6ae759 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 15 Nov 2022 08:53:23 -0300 Subject: [PATCH 451/549] Fix typing errors after mypy update --- src/_pytest/_py/path.py | 11 ++++++----- src/_pytest/hookspec.py | 10 ++++++---- testing/_py/test_local.py | 6 +++--- testing/test_monkeypatch.py | 2 +- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 00f1515238b..c3905d0d39b 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -24,6 +24,7 @@ from stat import S_ISREG from typing import Any from typing import Callable +from typing import cast from typing import overload from typing import TYPE_CHECKING @@ -146,7 +147,7 @@ def __init__(self, fil, rec, ignore, bf, sort): self.fil = fil self.ignore = ignore self.breadthfirst = bf - self.optsort = sort and sorted or (lambda x: x) + self.optsort = cast(Callable[[Any], Any], sorted) if sort else (lambda x: x) def gen(self, path): try: @@ -224,7 +225,7 @@ def owner(self): raise NotImplementedError("XXX win32") import pwd - entry = error.checked_call(pwd.getpwuid, self.uid) + entry = error.checked_call(pwd.getpwuid, self.uid) # type:ignore[attr-defined] return entry[0] @property @@ -234,7 +235,7 @@ def group(self): raise NotImplementedError("XXX win32") import grp - entry = error.checked_call(grp.getgrgid, self.gid) + entry = error.checked_call(grp.getgrgid, self.gid) # type:ignore[attr-defined] return entry[0] def isdir(self): @@ -252,7 +253,7 @@ def getuserid(user): import pwd if not isinstance(user, int): - user = pwd.getpwnam(user)[2] + user = pwd.getpwnam(user)[2] # type:ignore[attr-defined] return user @@ -260,7 +261,7 @@ def getgroupid(group): import grp if not isinstance(group, int): - group = grp.getgrnam(group)[2] + group = grp.getgrnam(group)[2] # type:ignore[attr-defined] return group diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index cc0828dd19e..446f580ee06 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -738,7 +738,7 @@ def pytest_assertion_pass(item: "Item", lineno: int, orig: str, expl: str) -> No # ------------------------------------------------------------------------- -def pytest_report_header( +def pytest_report_header( # type:ignore[empty-body] config: "Config", start_path: Path, startdir: "LEGACY_PATH" ) -> Union[str, List[str]]: """Return a string or list of strings to be displayed as header info for terminal reporting. @@ -767,7 +767,7 @@ def pytest_report_header( """ -def pytest_report_collectionfinish( +def pytest_report_collectionfinish( # type:ignore[empty-body] config: "Config", start_path: Path, startdir: "LEGACY_PATH", @@ -800,7 +800,7 @@ def pytest_report_collectionfinish( @hookspec(firstresult=True) -def pytest_report_teststatus( +def pytest_report_teststatus( # type:ignore[empty-body] report: Union["CollectReport", "TestReport"], config: "Config" ) -> Tuple[str, str, Union[str, Mapping[str, bool]]]: """Return result-category, shortletter and verbose word for status @@ -880,7 +880,9 @@ def pytest_warning_recorded( # ------------------------------------------------------------------------- -def pytest_markeval_namespace(config: "Config") -> Dict[str, Any]: +def pytest_markeval_namespace( # type:ignore[empty-body] + config: "Config", +) -> Dict[str, Any]: """Called when constructing the globals dictionary used for evaluating string conditions in xfail/skipif markers. diff --git a/testing/_py/test_local.py b/testing/_py/test_local.py index 31c10b16021..b463d769d4c 100644 --- a/testing/_py/test_local.py +++ b/testing/_py/test_local.py @@ -803,7 +803,7 @@ def test_long_filenames(self, tmpdir): # depending on how the paths are used), but > 4096 (which is the # Linux' limitation) - the behaviour of paths with names > 4096 chars # is undetermined - newfilename = "/test" * 60 + newfilename = "/test" * 60 # type:ignore[unreachable] l1 = tmpdir.join(newfilename) l1.ensure(file=True) l1.write("foo") @@ -1344,8 +1344,8 @@ def test_realpath_file(self, tmpdir): assert realpath.basename == "file" def test_owner(self, path1, tmpdir): - from pwd import getpwuid - from grp import getgrgid + from pwd import getpwuid # type:ignore[attr-defined] + from grp import getgrgid # type:ignore[attr-defined] stat = path1.stat() assert stat.path == path1 diff --git a/testing/test_monkeypatch.py b/testing/test_monkeypatch.py index 49635f95e79..b32e67bd766 100644 --- a/testing/test_monkeypatch.py +++ b/testing/test_monkeypatch.py @@ -92,7 +92,7 @@ def test_delattr(self, monkeypatch: MonkeyPatch) -> None: mp.delattr("os.path.abspath") assert not hasattr(os.path, "abspath") mp.undo() - assert os.path.abspath + assert os.path.abspath # type:ignore[truthy-function] def test_delattr() -> None: From cca029d55eaef33c24281e998bf76dca6eef387f Mon Sep 17 00:00:00 2001 From: Yusuke Kadowaki <60080334+yusuke-kadowaki@users.noreply.github.com> Date: Tue, 15 Nov 2022 21:11:39 +0900 Subject: [PATCH 452/549] Add configuration options to control how `tmp_path` directories are kept (#10442) Close #8141 --- AUTHORS | 1 + changelog/8141.feature.rst | 2 + doc/en/reference/reference.rst | 34 +++++++++++ src/_pytest/pathlib.py | 17 +++++- src/_pytest/tmpdir.py | 102 ++++++++++++++++++++++++++++++++- testing/test_tmpdir.py | 70 ++++++++++++++++++++-- 6 files changed, 216 insertions(+), 10 deletions(-) create mode 100644 changelog/8141.feature.rst diff --git a/AUTHORS b/AUTHORS index f2f330c4b24..d47d75961cd 100644 --- a/AUTHORS +++ b/AUTHORS @@ -374,6 +374,7 @@ Xixi Zhao Xuan Luong Xuecong Liao Yoav Caspi +Yusuke Kadowaki Yuval Shimon Zac Hatfield-Dodds Zachary Kneupper diff --git a/changelog/8141.feature.rst b/changelog/8141.feature.rst new file mode 100644 index 00000000000..70de099e6f2 --- /dev/null +++ b/changelog/8141.feature.rst @@ -0,0 +1,2 @@ +Added :confval:`tmp_path_retention_count` and :confval:`tmp_path_retention_policy` configuration options to control how directories created by the :fixture:`tmp_path` fixture are kept. +The default behavior has changed to keep only directories for failed tests, equivalent to `tmp_path_retention_policy="failed"`. diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index b7bd4d1199a..25d76568a39 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1723,6 +1723,40 @@ passed multiple times. The expected format is ``name=value``. For example:: directories when executing from the root directory. +.. confval:: tmp_path_retention_count + + + + How many sessions should we keep the `tmp_path` directories, + according to `tmp_path_retention_policy`. + + .. code-block:: ini + + [pytest] + tmp_path_retention_count = 3 + + Default: 3 + + +.. confval:: tmp_path_retention_policy + + + + Controls which directories created by the `tmp_path` fixture are kept around, + based on test outcome. + + * `all`: retains directories for all tests, regardless of the outcome. + * `failed`: retains directories only for tests with outcome `error` or `failed`. + * `none`: directories are always removed after each test ends, regardless of the outcome. + + .. code-block:: ini + + [pytest] + tmp_path_retention_policy = "all" + + Default: failed + + .. confval:: usefixtures List of fixtures that will be applied to all test functions; this is semantically the same to apply diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py index c5a411b5963..533335c6607 100644 --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -335,15 +335,26 @@ def cleanup_candidates(root: Path, prefix: str, keep: int) -> Iterator[Path]: yield path +def cleanup_dead_symlink(root: Path): + for left_dir in root.iterdir(): + if left_dir.is_symlink(): + if not left_dir.resolve().exists(): + left_dir.unlink() + + def cleanup_numbered_dir( root: Path, prefix: str, keep: int, consider_lock_dead_if_created_before: float ) -> None: """Cleanup for lock driven numbered directories.""" + if not root.exists(): + return for path in cleanup_candidates(root, prefix, keep): try_cleanup(path, consider_lock_dead_if_created_before) for path in root.glob("garbage-*"): try_cleanup(path, consider_lock_dead_if_created_before) + cleanup_dead_symlink(root) + def make_numbered_dir_with_cleanup( root: Path, @@ -357,8 +368,10 @@ def make_numbered_dir_with_cleanup( for i in range(10): try: p = make_numbered_dir(root, prefix, mode) - lock_path = create_cleanup_lock(p) - register_cleanup_lock_removal(lock_path) + # Only lock the current dir when keep is not 0 + if keep != 0: + lock_path = create_cleanup_lock(p) + register_cleanup_lock_removal(lock_path) except Exception as exc: e = exc else: diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index 9497a0d49da..7b8e42017a3 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -4,16 +4,30 @@ import sys import tempfile from pathlib import Path +from shutil import rmtree +from typing import Generator from typing import Optional +from typing import TYPE_CHECKING +from typing import Union + +if TYPE_CHECKING: + from typing_extensions import Literal + + RetentionType = Literal["all", "failed", "none"] + import attr +from _pytest.config.argparsing import Parser from .pathlib import LOCK_TIMEOUT from .pathlib import make_numbered_dir from .pathlib import make_numbered_dir_with_cleanup from .pathlib import rm_rf +from .pathlib import cleanup_dead_symlink from _pytest.compat import final from _pytest.config import Config +from _pytest.config import ExitCode +from _pytest.config import hookimpl from _pytest.deprecated import check_ispytest from _pytest.fixtures import fixture from _pytest.fixtures import FixtureRequest @@ -31,10 +45,14 @@ class TempPathFactory: _given_basetemp = attr.ib(type=Optional[Path]) _trace = attr.ib() _basetemp = attr.ib(type=Optional[Path]) + _retention_count = attr.ib(type=int) + _retention_policy = attr.ib(type="RetentionType") def __init__( self, given_basetemp: Optional[Path], + retention_count: int, + retention_policy: "RetentionType", trace, basetemp: Optional[Path] = None, *, @@ -49,6 +67,8 @@ def __init__( # Path.absolute() exists, but it is not public (see https://bugs.python.org/issue25012). self._given_basetemp = Path(os.path.abspath(str(given_basetemp))) self._trace = trace + self._retention_count = retention_count + self._retention_policy = retention_policy self._basetemp = basetemp @classmethod @@ -63,9 +83,23 @@ def from_config( :meta private: """ check_ispytest(_ispytest) + count = int(config.getini("tmp_path_retention_count")) + if count < 0: + raise ValueError( + f"tmp_path_retention_count must be >= 0. Current input: {count}." + ) + + policy = config.getini("tmp_path_retention_policy") + if policy not in ("all", "failed", "none"): + raise ValueError( + f"tmp_path_retention_policy must be either all, failed, none. Current intput: {policy}." + ) + return cls( given_basetemp=config.option.basetemp, trace=config.trace.get("tmpdir"), + retention_count=count, + retention_policy=policy, _ispytest=True, ) @@ -146,10 +180,13 @@ def getbasetemp(self) -> Path: ) if (rootdir_stat.st_mode & 0o077) != 0: os.chmod(rootdir, rootdir_stat.st_mode & ~0o077) + keep = self._retention_count + if self._retention_policy == "none": + keep = 0 basetemp = make_numbered_dir_with_cleanup( prefix="pytest-", root=rootdir, - keep=3, + keep=keep, lock_timeout=LOCK_TIMEOUT, mode=0o700, ) @@ -184,6 +221,21 @@ def pytest_configure(config: Config) -> None: mp.setattr(config, "_tmp_path_factory", _tmp_path_factory, raising=False) +def pytest_addoption(parser: Parser) -> None: + parser.addini( + "tmp_path_retention_count", + help="How many sessions should we keep the `tmp_path` directories, according to `tmp_path_retention_policy`.", + default=3, + ) + + parser.addini( + "tmp_path_retention_policy", + help="Controls which directories created by the `tmp_path` fixture are kept around, based on test outcome. " + "(all/failed/none)", + default="failed", + ) + + @fixture(scope="session") def tmp_path_factory(request: FixtureRequest) -> TempPathFactory: """Return a :class:`pytest.TempPathFactory` instance for the test session.""" @@ -200,7 +252,9 @@ def _mk_tmp(request: FixtureRequest, factory: TempPathFactory) -> Path: @fixture -def tmp_path(request: FixtureRequest, tmp_path_factory: TempPathFactory) -> Path: +def tmp_path( + request: FixtureRequest, tmp_path_factory: TempPathFactory +) -> Generator[Path, None, None]: """Return a temporary directory path object which is unique to each test function invocation, created as a sub directory of the base temporary directory. @@ -213,4 +267,46 @@ def tmp_path(request: FixtureRequest, tmp_path_factory: TempPathFactory) -> Path The returned object is a :class:`pathlib.Path` object. """ - return _mk_tmp(request, tmp_path_factory) + path = _mk_tmp(request, tmp_path_factory) + yield path + + # Remove the tmpdir if the policy is "failed" and the test passed. + tmp_path_factory: TempPathFactory = request.session.config._tmp_path_factory # type: ignore + policy = tmp_path_factory._retention_policy + if policy == "failed" and request.node._tmp_path_result_call.passed: + # We do a "best effort" to remove files, but it might not be possible due to some leaked resource, + # permissions, etc, in which case we ignore it. + rmtree(path, ignore_errors=True) + + # remove dead symlink + basetemp = tmp_path_factory._basetemp + if basetemp is None: + return + cleanup_dead_symlink(basetemp) + + +def pytest_sessionfinish(session, exitstatus: Union[int, ExitCode]): + """After each session, remove base directory if all the tests passed, + the policy is "failed", and the basetemp is not specified by a user. + """ + tmp_path_factory: TempPathFactory = session.config._tmp_path_factory + if tmp_path_factory._basetemp is None: + return + policy = tmp_path_factory._retention_policy + if ( + exitstatus == 0 + and policy == "failed" + and tmp_path_factory._given_basetemp is None + ): + passed_dir = tmp_path_factory._basetemp + if passed_dir.exists(): + # We do a "best effort" to remove files, but it might not be possible due to some leaked resource, + # permissions, etc, in which case we ignore it. + rmtree(passed_dir, ignore_errors=True) + + +@hookimpl(tryfirst=True, hookwrapper=True) +def pytest_runtest_makereport(item, call): + outcome = yield + result = outcome.get_result() + setattr(item, "_tmp_path_result_" + result.when, result) diff --git a/testing/test_tmpdir.py b/testing/test_tmpdir.py index 4f7c5384700..e681470a43a 100644 --- a/testing/test_tmpdir.py +++ b/testing/test_tmpdir.py @@ -42,6 +42,14 @@ def trace(self): def get(self, key): return lambda *k: None + def getini(self, name): + if name == "tmp_path_retention_count": + return 3 + elif name == "tmp_path_retention_policy": + return "failed" + else: + assert False + @property def option(self): return self @@ -84,6 +92,53 @@ def test_1(tmp_path): assert mytemp.exists() assert not mytemp.joinpath("hello").exists() + def test_policy_failed_removes_only_passed_dir(self, pytester: Pytester) -> None: + p = pytester.makepyfile( + """ + def test_1(tmp_path): + assert 0 == 0 + def test_2(tmp_path): + assert 0 == 1 + """ + ) + + pytester.inline_run(p) + root = pytester._test_tmproot + + for child in root.iterdir(): + base_dir = list( + filter(lambda x: x.is_dir() and not x.is_symlink(), child.iterdir()) + ) + assert len(base_dir) == 1 + test_dir = list( + filter( + lambda x: x.is_dir() and not x.is_symlink(), base_dir[0].iterdir() + ) + ) + # Check only the failed one remains + assert len(test_dir) == 1 + assert test_dir[0].name == "test_20" + + def test_policy_failed_removes_basedir_when_all_passed( + self, pytester: Pytester + ) -> None: + p = pytester.makepyfile( + """ + def test_1(tmp_path): + assert 0 == 0 + """ + ) + + pytester.inline_run(p) + root = pytester._test_tmproot + for child in root.iterdir(): + # This symlink will be deleted by cleanup_numbered_dir **after** + # the test finishes because it's triggered by atexit. + # So it has to be ignored here. + base_dir = filter(lambda x: not x.is_symlink(), child.iterdir()) + # Check the base dir itself is gone + assert len(list(base_dir)) == 0 + testdata = [ ("mypath", True), @@ -275,12 +330,12 @@ def test_lock_register_cleanup_removal(self, tmp_path: Path) -> None: assert not lock.exists() - def _do_cleanup(self, tmp_path: Path) -> None: + def _do_cleanup(self, tmp_path: Path, keep: int = 2) -> None: self.test_make(tmp_path) cleanup_numbered_dir( root=tmp_path, prefix=self.PREFIX, - keep=2, + keep=keep, consider_lock_dead_if_created_before=0, ) @@ -289,6 +344,11 @@ def test_cleanup_keep(self, tmp_path): a, b = (x for x in tmp_path.iterdir() if not x.is_symlink()) print(a, b) + def test_cleanup_keep_0(self, tmp_path: Path): + self._do_cleanup(tmp_path, 0) + dir_num = len(list(tmp_path.iterdir())) + assert dir_num == 0 + def test_cleanup_locked(self, tmp_path): p = make_numbered_dir(root=tmp_path, prefix=self.PREFIX) @@ -446,7 +506,7 @@ def test_tmp_path_factory_create_directory_with_safe_permissions( """Verify that pytest creates directories under /tmp with private permissions.""" # Use the test's tmp_path as the system temproot (/tmp). monkeypatch.setenv("PYTEST_DEBUG_TEMPROOT", str(tmp_path)) - tmp_factory = TempPathFactory(None, lambda *args: None, _ispytest=True) + tmp_factory = TempPathFactory(None, 3, "failed", lambda *args: None, _ispytest=True) basetemp = tmp_factory.getbasetemp() # No world-readable permissions. @@ -466,14 +526,14 @@ def test_tmp_path_factory_fixes_up_world_readable_permissions( """ # Use the test's tmp_path as the system temproot (/tmp). monkeypatch.setenv("PYTEST_DEBUG_TEMPROOT", str(tmp_path)) - tmp_factory = TempPathFactory(None, lambda *args: None, _ispytest=True) + tmp_factory = TempPathFactory(None, 3, "failed", lambda *args: None, _ispytest=True) basetemp = tmp_factory.getbasetemp() # Before - simulate bad perms. os.chmod(basetemp.parent, 0o777) assert (basetemp.parent.stat().st_mode & 0o077) != 0 - tmp_factory = TempPathFactory(None, lambda *args: None, _ispytest=True) + tmp_factory = TempPathFactory(None, 3, "failed", lambda *args: None, _ispytest=True) basetemp = tmp_factory.getbasetemp() # After - fixed. From b817aa457cb40e9ebe54c4ac1753ffbeac07b9c6 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 16 Nov 2022 19:20:16 -0500 Subject: [PATCH 453/549] remove no_implicit_optional this is the default in mypy 0.990 Committed via https://github.com/asottile/all-repos --- setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index ceb02877af5..261ffec8f3c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -96,7 +96,6 @@ mypy_path = src check_untyped_defs = True disallow_any_generics = True ignore_missing_imports = True -no_implicit_optional = True show_error_codes = True strict_equality = True warn_redundant_casts = True From 791b51d0faea365aa9474bb83f9cd964fe265c21 Mon Sep 17 00:00:00 2001 From: Daniel Valenzuela Date: Fri, 18 Nov 2022 09:20:38 -0300 Subject: [PATCH 454/549] Show test name when skipping from fixture (#10482) Fixes #10457 --- AUTHORS | 1 + changelog/10457.bugfix.rst | 1 + src/_pytest/fixtures.py | 5 +++++ testing/test_skipping.py | 21 +++++++++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 changelog/10457.bugfix.rst diff --git a/AUTHORS b/AUTHORS index d47d75961cd..4e7c756c0c3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -90,6 +90,7 @@ Daniel Grana Daniel Hahler Daniel Nuri Daniel Sánchez Castelló +Daniel Valenzuela Zenteno Daniel Wandschneider Daniele Procida Danielle Jenkins diff --git a/changelog/10457.bugfix.rst b/changelog/10457.bugfix.rst new file mode 100644 index 00000000000..26522e9f0e1 --- /dev/null +++ b/changelog/10457.bugfix.rst @@ -0,0 +1 @@ +If a test is skipped from inside a fixture, the test summary now shows the test location instead of the fixture location. diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index d79895c262b..7ef261b969a 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -58,6 +58,7 @@ from _pytest.mark import ParameterSet from _pytest.mark.structures import MarkDecorator from _pytest.outcomes import fail +from _pytest.outcomes import skip from _pytest.outcomes import TEST_OUTCOME from _pytest.pathlib import absolutepath from _pytest.pathlib import bestrelpath @@ -1129,6 +1130,10 @@ def pytest_fixture_setup( except TEST_OUTCOME: exc_info = sys.exc_info() assert exc_info[0] is not None + if isinstance( + exc_info[1], skip.Exception + ) and not fixturefunc.__name__.startswith("xunit_setup"): + exc_info[1]._use_item_location = True # type: ignore[attr-defined] fixturedef.cached_result = (None, my_cache_key, exc_info) raise fixturedef.cached_result = (result, my_cache_key, None) diff --git a/testing/test_skipping.py b/testing/test_skipping.py index 6415480ef4f..892ed85476b 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -1439,6 +1439,27 @@ def test_pass(): ) +def test_skip_from_fixture(pytester: Pytester) -> None: + pytester.makepyfile( + **{ + "tests/test_1.py": """ + import pytest + def test_pass(arg): + pass + @pytest.fixture + def arg(): + condition = True + if condition: + pytest.skip("Fixture conditional skip") + """, + } + ) + result = pytester.runpytest("-rs", "tests/test_1.py", "--rootdir=tests") + result.stdout.fnmatch_lines( + ["SKIPPED [[]1[]] tests/test_1.py:2: Fixture conditional skip"] + ) + + def test_skip_using_reason_works_ok(pytester: Pytester) -> None: p = pytester.makepyfile( """ From 7710e18b4c21f87e93a081a4e98ebe162fd99d86 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 22 Nov 2022 08:05:40 -0300 Subject: [PATCH 455/549] [automated] Update plugin list (#10519) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 180 +++++++++++++++++++++++-------- 1 file changed, 138 insertions(+), 42 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 13dcbb9f579..03fb5be2bd9 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1150 plugins. +This list contains 1162 plugins. .. only:: not latex @@ -214,6 +214,7 @@ This list contains 1150 plugins. :pypi:`pytest-cover` Pytest plugin for measuring coverage. Forked from \`pytest-cov\`. Aug 01, 2015 5 - Production/Stable N/A :pypi:`pytest-coverage` Jun 17, 2015 N/A N/A :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-coveragemarkers` Using pytest markers to track functional coverage and filtering of tests Nov 17, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Sep 23, 2022 5 - Production/Stable pytest (>=7.0) :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Nov 07, 2022 N/A N/A @@ -307,7 +308,7 @@ This list contains 1150 plugins. :pypi:`pytest-dockerc` Run, manage and stop Docker Compose project from Docker API Oct 09, 2020 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-docker-compose` Manages Docker containers during your integration tests Jan 26, 2021 5 - Production/Stable pytest (>=3.3) :pypi:`pytest-docker-db` A plugin to use docker databases for pytests Mar 20, 2021 5 - Production/Stable pytest (>=3.1.1) - :pypi:`pytest-docker-fixtures` pytest docker fixtures Jul 06, 2022 3 - Alpha N/A + :pypi:`pytest-docker-fixtures` pytest docker fixtures Nov 17, 2022 3 - Alpha N/A :pypi:`pytest-docker-git-fixtures` Pytest fixtures for testing with git scm. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-haproxy-fixtures` Pytest fixtures for testing with haproxy. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-pexpect` pytest plugin for writing functional tests with pexpect and docker Jan 14, 2019 N/A pytest @@ -416,10 +417,12 @@ This list contains 1150 plugins. :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Apr 09, 2022 4 - Beta pytest (>=4.3.0) :pypi:`pytest-finer-verdicts` A pytest plugin to treat non-assertion failures as test errors. Jun 18, 2020 N/A pytest (>=5.4.3) :pypi:`pytest-firefox` pytest plugin to manipulate firefox Aug 08, 2017 3 - Alpha pytest (>=3.0.2) + :pypi:`pytest-fixture-classes` Give you the ability to write typed fixture classes that work well with dependency injection, autocompletetion, type checkers, and language servers Nov 14, 2022 4 - Beta pytest :pypi:`pytest-fixture-config` Fixture configuration utils for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-fixture-maker` Pytest plugin to load fixtures from YAML files Sep 21, 2021 N/A N/A :pypi:`pytest-fixture-marker` A pytest plugin to add markers based on fixtures used. Oct 11, 2020 5 - Production/Stable N/A :pypi:`pytest-fixture-order` pytest plugin to control fixture evaluation order May 16, 2022 5 - Production/Stable pytest (>=3.0) + :pypi:`pytest-fixture-ref` Lets users reference fixtures without name matching magic. Nov 17, 2022 4 - Beta N/A :pypi:`pytest-fixture-rtttg` Warn or fail on fixture name clash Feb 23, 2022 N/A pytest (>=7.0.1,<8.0.0) :pypi:`pytest-fixtures` Common fixtures for pytest May 01, 2019 5 - Production/Stable N/A :pypi:`pytest-fixture-tools` Plugin for pytest which provides tools for fixtures Aug 18, 2020 6 - Mature pytest @@ -456,7 +459,7 @@ This list contains 1150 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Nov 09, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Nov 17, 2022 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -464,7 +467,7 @@ This list contains 1150 plugins. :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Jul 02, 2022 N/A pytest (>=4.0.0) :pypi:`pytest-github-report` Generate a GitHub report using pytest in GitHub Workflows Jun 03, 2022 4 - Beta N/A :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A - :pypi:`pytest-git-selector` Utility for finding test files to run based on git diff against the branch base Nov 09, 2022 N/A N/A + :pypi:`pytest-git-selector` Utility to select tests that have had its dependencies modified (as identified by git diff) Nov 17, 2022 N/A N/A :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Jul 22, 2022 4 - Beta pytest :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest :pypi:`pytest-golden` Plugin for pytest that offloads expected outputs to data files Jul 18, 2022 N/A pytest (>=6.1.2) @@ -484,10 +487,10 @@ This list contains 1150 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Nov 09, 2022 3 - Alpha pytest (==7.1.3) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Nov 17, 2022 3 - Alpha pytest (==7.1.3) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A - :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Mar 28, 2022 N/A pytest (>=5.0) + :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Nov 17, 2022 N/A pytest (>=5.0) :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 22, 2022 5 - Production/Stable N/A :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) :pypi:`pytest-html` pytest plugin for generating HTML reports Oct 25, 2022 5 - Production/Stable pytest (!=6.0.0,>=5.0) @@ -503,6 +506,7 @@ This list contains 1150 plugins. :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Sep 12, 2022 3 - Alpha N/A + :pypi:`pytest-httptesting` http_testing framework on top of pytest Nov 16, 2022 N/A pytest (>=7.2.0,<8.0.0) :pypi:`pytest-httpx` Send responses to httpx. Nov 03, 2022 5 - Production/Stable pytest (<8.*,>=6.*) :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A @@ -521,6 +525,7 @@ This list contains 1150 plugins. :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A + :pypi:`pytest-inline` A simple plugin to use with pytest Nov 13, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Oct 07, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Sep 30, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Sep 16, 2022 5 - Production/Stable N/A @@ -529,7 +534,7 @@ This list contains 1150 plugins. :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Nov 02, 2022 N/A pytest (>=7.2.0,<8.0.0) :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) :pypi:`pytest-instrument` pytest plugin to instrument tests Apr 05, 2020 5 - Production/Stable pytest (>=5.1.0) - :pypi:`pytest-integration` Organizing pytests by integration or not Apr 16, 2020 N/A N/A + :pypi:`pytest-integration` Organizing pytests by integration or not Nov 17, 2022 N/A N/A :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) @@ -543,6 +548,7 @@ This list contains 1150 plugins. :pypi:`pytest-iterassert` Nicer list and iterable assertion messages for pytest May 11, 2020 3 - Alpha N/A :pypi:`pytest-iters` A contextmanager pytest fixture for handling multiple mock iters May 24, 2022 N/A N/A :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A + :pypi:`pytest-jelastic` Pytest plugin defining the necessary command-line options to pass to pytests testing a Jelastic environment. Nov 16, 2022 N/A pytest (>=7.2.0,<8.0.0) :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) :pypi:`pytest-jinja` A plugin to generate customizable jinja-based HTML reports in pytest Oct 04, 2022 3 - Alpha pytest (>=6.2.5,<7.0.0) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A @@ -566,6 +572,7 @@ This list contains 1150 plugins. :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. Aug 20, 2022 3 - Alpha pytest (>=3.6,<8) :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A + :pypi:`pytest-lark` A package for enhancing pytest Nov 15, 2022 N/A N/A :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 14, 2022 N/A pytest (>=4.2.0) :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A :pypi:`pytest-lazy-fixture` It helps to use fixtures in pytest.mark.parametrize Feb 01, 2020 4 - Beta pytest (>=3.2.5) @@ -619,7 +626,7 @@ This list contains 1150 plugins. :pypi:`pytest-md` Plugin for generating Markdown reports for pytest results Jul 11, 2019 3 - Alpha pytest (>=4.2.1) :pypi:`pytest-md-report` A pytest plugin to make a test results report with Markdown table format. Aug 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :pypi:`pytest-memprof` Estimates memory consumption of test functions Mar 29, 2019 4 - Beta N/A - :pypi:`pytest-memray` A simple plugin to use with pytest Aug 21, 2022 N/A pytest>=7.1.2 + :pypi:`pytest-memray` A simple plugin to use with pytest Nov 14, 2022 N/A pytest>=7.1.2 :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) @@ -656,7 +663,7 @@ This list contains 1150 plugins. :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 23, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Oct 29, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Nov 15, 2022 4 - Beta pytest (>=6) :pypi:`pytest-mqtt` pytest-mqtt supports testing systems based on MQTT Sep 20, 2022 4 - Beta pytest (<8) ; extra == 'test' :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Sep 18, 2022 N/A pytest @@ -671,7 +678,7 @@ This list contains 1150 plugins. :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 15, 2022 5 - Production/Stable pytest (>=6.2) :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) - :pypi:`pytest-netdut` "Automated software testing for switches using pytest" Oct 14, 2022 N/A pytest (>=3.5.0) + :pypi:`pytest-netdut` "Automated software testing for switches using pytest" Nov 18, 2022 N/A pytest (>=3.5.0) :pypi:`pytest-network` A simple plugin to disable network on socket level. May 07, 2020 N/A N/A :pypi:`pytest-network-endpoints` Network endpoints plugin for pytest Mar 06, 2022 N/A pytest :pypi:`pytest-never-sleep` pytest plugin helps to avoid adding tests without mock \`time.sleep\` May 05, 2021 3 - Alpha pytest (>=3.5.1) @@ -679,7 +686,7 @@ This list contains 1150 plugins. :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Oct 07, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Nov 16, 2022 N/A pytest (==6.2.5) :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A :pypi:`pytest-nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Jul 07, 2021 N/A N/A @@ -694,9 +701,10 @@ This list contains 1150 plugins. :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Oct 20, 2022 5 - Production/Stable pytest (>=4.6.0) :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jul 31, 2022 5 - Production/Stable pytest :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A - :pypi:`pytest-odoo` py.test plugin to run Odoo tests Oct 31, 2022 4 - Beta pytest (>=7.0.0) + :pypi:`pytest-odoo` py.test plugin to run Odoo tests Nov 17, 2022 4 - Beta pytest (>=7.2.0) :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A :pypi:`pytest-oerp` pytest plugin to test OpenERP modules Feb 28, 2012 3 - Alpha N/A + :pypi:`pytest-ogsm-plugin` 针对特定项目定制化插件,优化了pytest报告展示方式,并添加了项目所需特定参数 Nov 17, 2022 N/A N/A :pypi:`pytest-ok` The ultimate pytest output plugin Apr 01, 2019 4 - Beta N/A :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jun 14, 2022 5 - Production/Stable pytest (<7.1); python_version <= "3.6" :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A @@ -769,6 +777,7 @@ This list contains 1150 plugins. :pypi:`pytest-portion` Select a portion of the collected tests Jan 28, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-pot` A package for enhancing pytest Nov 15, 2022 N/A N/A :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 27, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) :pypi:`pytest-pretty` pytest plugin for printing summary data as I want it Nov 03, 2022 4 - Beta pytest>=7 @@ -793,7 +802,7 @@ This list contains 1150 plugins. :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Oct 28, 2022 3 - Alpha N/A :pypi:`pytest-pylint` pytest plugin to check source code with pylint Sep 10, 2022 5 - Production/Stable pytest (>=5.4) :pypi:`pytest-pymysql-autorecord` Record PyMySQL queries and mock with the stored data. Sep 02, 2022 N/A N/A - :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Oct 26, 2022 N/A pytest + :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Nov 15, 2022 N/A pytest :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) @@ -804,6 +813,7 @@ This list contains 1150 plugins. :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.0) :pypi:`pytest-pythonpath` pytest plugin for adding to the PYTHONPATH from command line or configs. Feb 10, 2022 5 - Production/Stable pytest (<7,>=2.5.2) :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest + :pypi:`pytest-pyvista` Pytest-pyvista package Nov 18, 2022 4 - Beta pytest>=3.5.0 :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Jun 26, 2021 4 - Beta pytest (>=6.2.0) :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jun 26, 2022 5 - Production/Stable pytest (>=6.2.3) @@ -866,7 +876,7 @@ This list contains 1150 plugins. :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Aug 12, 2022 N/A N/A + :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Nov 17, 2022 N/A N/A :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-resource-usage` Pytest plugin for reporting running time and peak memory usage Nov 06, 2022 5 - Production/Stable pytest>=7.0.0 @@ -904,17 +914,17 @@ This list contains 1150 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Nov 11, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Nov 18, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 21, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Nov 11, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Nov 18, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A - :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Apr 21, 2021 N/A pytest + :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Nov 16, 2022 N/A N/A :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A :pypi:`pytest-servers` pytest servers Nov 09, 2022 3 - Alpha pytest (>=6.2) @@ -957,7 +967,7 @@ This list contains 1150 plugins. :pypi:`pytest-solidity` A PyTest library plugin for Solidity language. Jan 15, 2022 1 - Planning pytest (<7,>=6.0.1) ; extra == 'tests' :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) :pypi:`pytest-sorter` A simple plugin to first execute tests that historically failed more Apr 20, 2021 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Apr 11, 2022 2 - Pre-Alpha pytest + :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Nov 17, 2022 2 - Pre-Alpha pytest :pypi:`pytest-sourceorder` Test-ordering plugin for pytest Sep 01, 2021 4 - Beta pytest :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. Feb 23, 2020 4 - Beta pytest :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A @@ -1013,7 +1023,7 @@ This list contains 1150 plugins. :pypi:`pytest-tape` easy assertion with expected results saved to yaml files Mar 17, 2021 4 - Beta N/A :pypi:`pytest-target` Pytest plugin for remote target orchestration. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) :pypi:`pytest-tblineinfo` tblineinfo is a py.test plugin that insert the node id in the final py.test report when --tb=line option is used Dec 01, 2015 3 - Alpha pytest (>=2.0) - :pypi:`pytest-tcpclient` A pytest plugin for testing TCP clients Nov 10, 2022 N/A pytest (<8,>=7.1.3) + :pypi:`pytest-tcpclient` A pytest plugin for testing TCP clients Nov 16, 2022 N/A pytest (<8,>=7.1.3) :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) @@ -1028,7 +1038,7 @@ This list contains 1150 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Jun 19, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Oct 30, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Nov 17, 2022 4 - Beta N/A :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) :pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Jun 13, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) @@ -1098,6 +1108,7 @@ This list contains 1150 plugins. :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) :pypi:`pytest-ubersmith` Easily mock calls to ubersmith at the \`requests\` level. Apr 13, 2015 N/A N/A :pypi:`pytest-ui` Text User Interface for running python tests Jul 05, 2021 4 - Beta pytest + :pypi:`pytest-ui-failed-screenshot` UI自动测试失败时自动截图,并将截图加入到测试报告中 Nov 16, 2022 N/A N/A :pypi:`pytest-unflakable` Unflakable plugin for PyTest Oct 26, 2022 4 - Beta pytest (>=6.2.0) :pypi:`pytest-unhandled-exception-exit-code` Plugin for py.test set a different exit code on uncaught exceptions Jun 22, 2020 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) @@ -1166,6 +1177,7 @@ This list contains 1150 plugins. :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Jun 02, 2022 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zest` Zesty additions to pytest. Nov 17, 2022 N/A N/A :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ @@ -2545,6 +2557,13 @@ This list contains 1150 plugins. Coverage dynamic context support for PyTest, including sub-processes + :pypi:`pytest-coveragemarkers` + *last release*: Nov 17, 2022, + *status*: N/A, + *requires*: pytest (>=7.1.2,<8.0.0) + + Using pytest markers to track functional coverage and filtering of tests + :pypi:`pytest-cov-exclude` *last release*: Apr 29, 2016, *status*: 4 - Beta, @@ -3197,7 +3216,7 @@ This list contains 1150 plugins. A plugin to use docker databases for pytests :pypi:`pytest-docker-fixtures` - *last release*: Jul 06, 2022, + *last release*: Nov 17, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -3959,6 +3978,13 @@ This list contains 1150 plugins. pytest plugin to manipulate firefox + :pypi:`pytest-fixture-classes` + *last release*: Nov 14, 2022, + *status*: 4 - Beta, + *requires*: pytest + + Give you the ability to write typed fixture classes that work well with dependency injection, autocompletetion, type checkers, and language servers + :pypi:`pytest-fixture-config` *last release*: May 28, 2019, *status*: 5 - Production/Stable, @@ -3987,6 +4013,13 @@ This list contains 1150 plugins. pytest plugin to control fixture evaluation order + :pypi:`pytest-fixture-ref` + *last release*: Nov 17, 2022, + *status*: 4 - Beta, + *requires*: N/A + + Lets users reference fixtures without name matching magic. + :pypi:`pytest-fixture-rtttg` *last release*: Feb 23, 2022, *status*: N/A, @@ -4240,7 +4273,7 @@ This list contains 1150 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Nov 09, 2022, + *last release*: Nov 17, 2022, *status*: N/A, *requires*: N/A @@ -4296,11 +4329,11 @@ This list contains 1150 plugins. py.test plugin to ignore the same files as git :pypi:`pytest-git-selector` - *last release*: Nov 09, 2022, + *last release*: Nov 17, 2022, *status*: N/A, *requires*: N/A - Utility for finding test files to run based on git diff against the branch base + Utility to select tests that have had its dependencies modified (as identified by git diff) :pypi:`pytest-glamor-allure` *last release*: Jul 22, 2022, @@ -4436,7 +4469,7 @@ This list contains 1150 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Nov 09, 2022, + *last release*: Nov 17, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.3) @@ -4457,7 +4490,7 @@ This list contains 1150 plugins. Report on tests that honor constraints, and guard against regressions :pypi:`pytest-hoverfly` - *last release*: Mar 28, 2022, + *last release*: Nov 17, 2022, *status*: N/A, *requires*: pytest (>=5.0) @@ -4568,6 +4601,13 @@ This list contains 1150 plugins. pytest-httpserver is a httpserver for pytest + :pypi:`pytest-httptesting` + *last release*: Nov 16, 2022, + *status*: N/A, + *requires*: pytest (>=7.2.0,<8.0.0) + + http_testing framework on top of pytest + :pypi:`pytest-httpx` *last release*: Nov 03, 2022, *status*: 5 - Production/Stable, @@ -4694,6 +4734,13 @@ This list contains 1150 plugins. Reuse pytest.ini to store env variables + :pypi:`pytest-inline` + *last release*: Nov 13, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=7.0.0) + + A simple plugin to use with pytest + :pypi:`pytest-inmanta` *last release*: Oct 07, 2022, *status*: 5 - Production/Stable, @@ -4751,7 +4798,7 @@ This list contains 1150 plugins. pytest plugin to instrument tests :pypi:`pytest-integration` - *last release*: Apr 16, 2020, + *last release*: Nov 17, 2022, *status*: N/A, *requires*: N/A @@ -4848,6 +4895,13 @@ This list contains 1150 plugins. Run jasmine tests from your pytest test suite + :pypi:`pytest-jelastic` + *last release*: Nov 16, 2022, + *status*: N/A, + *requires*: pytest (>=7.2.0,<8.0.0) + + Pytest plugin defining the necessary command-line options to pass to pytests testing a Jelastic environment. + :pypi:`pytest-jest` *last release*: May 22, 2018, *status*: 4 - Beta, @@ -5009,6 +5063,13 @@ This list contains 1150 plugins. + :pypi:`pytest-lark` + *last release*: Nov 15, 2022, + *status*: N/A, + *requires*: N/A + + A package for enhancing pytest + :pypi:`pytest-launchable` *last release*: Jun 14, 2022, *status*: N/A, @@ -5381,7 +5442,7 @@ This list contains 1150 plugins. Estimates memory consumption of test functions :pypi:`pytest-memray` - *last release*: Aug 21, 2022, + *last release*: Nov 14, 2022, *status*: N/A, *requires*: pytest>=7.1.2 @@ -5640,7 +5701,7 @@ This list contains 1150 plugins. pytest plugin to help with testing figures output from Matplotlib :pypi:`pytest-mproc` - *last release*: Oct 29, 2022, + *last release*: Nov 15, 2022, *status*: 4 - Beta, *requires*: pytest (>=6) @@ -5745,7 +5806,7 @@ This list contains 1150 plugins. pytest-neo is a plugin for pytest that shows tests like screen of Matrix. :pypi:`pytest-netdut` - *last release*: Oct 14, 2022, + *last release*: Nov 18, 2022, *status*: N/A, *requires*: pytest (>=3.5.0) @@ -5801,7 +5862,7 @@ This list contains 1150 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Oct 07, 2022, + *last release*: Nov 16, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -5906,9 +5967,9 @@ This list contains 1150 plugins. pytest results data-base and HTML reporter :pypi:`pytest-odoo` - *last release*: Oct 31, 2022, + *last release*: Nov 17, 2022, *status*: 4 - Beta, - *requires*: pytest (>=7.0.0) + *requires*: pytest (>=7.2.0) py.test plugin to run Odoo tests @@ -5926,6 +5987,13 @@ This list contains 1150 plugins. pytest plugin to test OpenERP modules + :pypi:`pytest-ogsm-plugin` + *last release*: Nov 17, 2022, + *status*: N/A, + *requires*: N/A + + 针对特定项目定制化插件,优化了pytest报告展示方式,并添加了项目所需特定参数 + :pypi:`pytest-ok` *last release*: Apr 01, 2019, *status*: 4 - Beta, @@ -6430,6 +6498,13 @@ This list contains 1150 plugins. Postgresql fixtures and fixture factories for Pytest. + :pypi:`pytest-pot` + *last release*: Nov 15, 2022, + *status*: N/A, + *requires*: N/A + + A package for enhancing pytest + :pypi:`pytest-power` *last release*: Dec 31, 2020, *status*: N/A, @@ -6599,7 +6674,7 @@ This list contains 1150 plugins. Record PyMySQL queries and mock with the stored data. :pypi:`pytest-pyodide` - *last release*: Oct 26, 2022, + *last release*: Nov 15, 2022, *status*: N/A, *requires*: pytest @@ -6675,6 +6750,13 @@ This list contains 1150 plugins. pytest plugin for a better developer experience when working with the PyTorch test suite + :pypi:`pytest-pyvista` + *last release*: Nov 18, 2022, + *status*: 4 - Beta, + *requires*: pytest>=3.5.0 + + Pytest-pyvista package + :pypi:`pytest-qasync` *last release*: Jul 12, 2021, *status*: 4 - Beta, @@ -7110,7 +7192,7 @@ This list contains 1150 plugins. pytest plugin to re-run tests to eliminate flaky failures :pypi:`pytest-resilient-circuits` - *last release*: Aug 12, 2022, + *last release*: Nov 17, 2022, *status*: N/A, *requires*: N/A @@ -7376,7 +7458,7 @@ This list contains 1150 plugins. :pypi:`pytest-sbase` - *last release*: Nov 11, 2022, + *last release*: Nov 18, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7418,7 +7500,7 @@ This list contains 1150 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Nov 11, 2022, + *last release*: Nov 18, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7446,9 +7528,9 @@ This list contains 1150 plugins. Send pytest execution result email :pypi:`pytest-sentry` - *last release*: Apr 21, 2021, + *last release*: Nov 16, 2022, *status*: N/A, - *requires*: pytest + *requires*: N/A A pytest plugin to send testrun information to Sentry.io @@ -7747,7 +7829,7 @@ This list contains 1150 plugins. A simple plugin to first execute tests that historically failed more :pypi:`pytest-sosu` - *last release*: Apr 11, 2022, + *last release*: Nov 17, 2022, *status*: 2 - Pre-Alpha, *requires*: pytest @@ -8139,7 +8221,7 @@ This list contains 1150 plugins. tblineinfo is a py.test plugin that insert the node id in the final py.test report when --tb=line option is used :pypi:`pytest-tcpclient` - *last release*: Nov 10, 2022, + *last release*: Nov 16, 2022, *status*: N/A, *requires*: pytest (<8,>=7.1.3) @@ -8244,7 +8326,7 @@ This list contains 1150 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Oct 30, 2022, + *last release*: Nov 17, 2022, *status*: 4 - Beta, *requires*: N/A @@ -8733,6 +8815,13 @@ This list contains 1150 plugins. Text User Interface for running python tests + :pypi:`pytest-ui-failed-screenshot` + *last release*: Nov 16, 2022, + *status*: N/A, + *requires*: N/A + + UI自动测试失败时自动截图,并将截图加入到测试报告中 + :pypi:`pytest-unflakable` *last release*: Oct 26, 2022, *status*: 4 - Beta, @@ -9209,6 +9298,13 @@ This list contains 1150 plugins. Pytest connector for Zebrunner reporting + :pypi:`pytest-zest` + *last release*: Nov 17, 2022, + *status*: N/A, + *requires*: N/A + + Zesty additions to pytest. + :pypi:`pytest-zigzag` *last release*: Feb 27, 2019, *status*: 4 - Beta, From 56544c11b563c1e0e3d3796a124a3f2570376e73 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Nov 2022 08:27:55 -0300 Subject: [PATCH 456/549] [pre-commit.ci] pre-commit autoupdate (#10522) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.990 → v0.991](https://github.com/pre-commit/mirrors-mypy/compare/v0.990...v0.991) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cff5546d4a5..f836f2aab78 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -58,7 +58,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.990 + rev: v0.991 hooks: - id: mypy files: ^(src/|testing/) From 99dfc19fe62c15cd8717d30a3d5b50352931697a Mon Sep 17 00:00:00 2001 From: Yusuke Kadowaki <60080334+yusuke-kadowaki@users.noreply.github.com> Date: Wed, 23 Nov 2022 22:48:29 +0900 Subject: [PATCH 457/549] Fix `tmp_path_retention_policy` crash when skipping from fixture (#10517) Also uses the stash to save the test status. Fix #10502 --- src/_pytest/tmpdir.py | 20 +++++++++++-- testing/test_tmpdir.py | 64 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 3 deletions(-) diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index 7b8e42017a3..3fd8168b6d2 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -5,11 +5,15 @@ import tempfile from pathlib import Path from shutil import rmtree +from typing import Dict from typing import Generator from typing import Optional from typing import TYPE_CHECKING from typing import Union +from _pytest.nodes import Item +from _pytest.stash import StashKey + if TYPE_CHECKING: from typing_extensions import Literal @@ -33,6 +37,8 @@ from _pytest.fixtures import FixtureRequest from _pytest.monkeypatch import MonkeyPatch +tmppath_result_key = StashKey[Dict[str, bool]]() + @final @attr.s(init=False) @@ -273,11 +279,15 @@ def tmp_path( # Remove the tmpdir if the policy is "failed" and the test passed. tmp_path_factory: TempPathFactory = request.session.config._tmp_path_factory # type: ignore policy = tmp_path_factory._retention_policy - if policy == "failed" and request.node._tmp_path_result_call.passed: + result_dict = request.node.stash[tmppath_result_key] + + if policy == "failed" and result_dict.get("call", True): # We do a "best effort" to remove files, but it might not be possible due to some leaked resource, # permissions, etc, in which case we ignore it. rmtree(path, ignore_errors=True) + del request.node.stash[tmppath_result_key] + # remove dead symlink basetemp = tmp_path_factory._basetemp if basetemp is None: @@ -306,7 +316,11 @@ def pytest_sessionfinish(session, exitstatus: Union[int, ExitCode]): @hookimpl(tryfirst=True, hookwrapper=True) -def pytest_runtest_makereport(item, call): +def pytest_runtest_makereport(item: Item, call): outcome = yield result = outcome.get_result() - setattr(item, "_tmp_path_result_" + result.when, result) + + if tmppath_result_key not in item.stash: + item.stash[tmppath_result_key] = {result.when: result.passed} + else: + item.stash[tmppath_result_key][result.when] = result.passed diff --git a/testing/test_tmpdir.py b/testing/test_tmpdir.py index e681470a43a..57f442b04ce 100644 --- a/testing/test_tmpdir.py +++ b/testing/test_tmpdir.py @@ -139,6 +139,70 @@ def test_1(tmp_path): # Check the base dir itself is gone assert len(list(base_dir)) == 0 + # issue #10502 + def test_policy_failed_removes_dir_when_skipped_from_fixture( + self, pytester: Pytester + ) -> None: + p = pytester.makepyfile( + """ + import pytest + + @pytest.fixture + def fixt(tmp_path): + pytest.skip() + + def test_fixt(fixt): + pass + """ + ) + pytester.inline_run(p) + + # Check if the whole directory is removed + root = pytester._test_tmproot + for child in root.iterdir(): + base_dir = list( + filter(lambda x: x.is_dir() and not x.is_symlink(), child.iterdir()) + ) + assert len(base_dir) == 0 + + # issue #10502 + def test_policy_all_keeps_dir_when_skipped_from_fixture( + self, pytester: Pytester + ) -> None: + p = pytester.makepyfile( + """ + import pytest + + @pytest.fixture + def fixt(tmp_path): + pytest.skip() + + def test_fixt(fixt): + pass + """ + ) + pytester.makepyprojecttoml( + """ + [tool.pytest.ini_options] + tmp_path_retention_policy = "all" + """ + ) + pytester.inline_run(p) + + # Check if the whole directory is kept + root = pytester._test_tmproot + for child in root.iterdir(): + base_dir = list( + filter(lambda x: x.is_dir() and not x.is_symlink(), child.iterdir()) + ) + assert len(base_dir) == 1 + test_dir = list( + filter( + lambda x: x.is_dir() and not x.is_symlink(), base_dir[0].iterdir() + ) + ) + assert len(test_dir) == 1 + testdata = [ ("mypath", True), From 857e34ef8555c48cb5c44f143a0d6692efb6c60f Mon Sep 17 00:00:00 2001 From: Prerak Patel <62869089+PrerakPatelCS@users.noreply.github.com> Date: Wed, 23 Nov 2022 12:46:00 -0500 Subject: [PATCH 458/549] Fix bug where file system root was erroneously be used as rootdir on Windows Fix #10506 --- changelog/10506.bugfix.rst | 1 + src/_pytest/config/findpaths.py | 11 +++++++++-- testing/test_findpaths.py | 17 +++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 changelog/10506.bugfix.rst diff --git a/changelog/10506.bugfix.rst b/changelog/10506.bugfix.rst new file mode 100644 index 00000000000..6b161f69282 --- /dev/null +++ b/changelog/10506.bugfix.rst @@ -0,0 +1 @@ +Fix bug where sometimes pytest would use the file system root directory as :ref:`rootdir ` on Windows. diff --git a/src/_pytest/config/findpaths.py b/src/_pytest/config/findpaths.py index 43c2367793e..234b9e12906 100644 --- a/src/_pytest/config/findpaths.py +++ b/src/_pytest/config/findpaths.py @@ -203,8 +203,7 @@ def determine_setup( else: cwd = Path.cwd() rootdir = get_common_ancestor([cwd, ancestor]) - is_fs_root = os.path.splitdrive(str(rootdir))[1] == "/" - if is_fs_root: + if is_fs_root(rootdir): rootdir = ancestor if rootdir_cmd_arg: rootdir = absolutepath(os.path.expandvars(rootdir_cmd_arg)) @@ -216,3 +215,11 @@ def determine_setup( ) assert rootdir is not None return rootdir, inipath, inicfg or {} + + +def is_fs_root(p: Path) -> bool: + r""" + Return True if the given path is pointing to the root of the + file system ("/" on Unix and "C:\\" on Windows for example). + """ + return os.path.splitdrive(str(p))[1] == os.sep diff --git a/testing/test_findpaths.py b/testing/test_findpaths.py index 3a2917261a2..8287de603ed 100644 --- a/testing/test_findpaths.py +++ b/testing/test_findpaths.py @@ -1,3 +1,4 @@ +import os from pathlib import Path from textwrap import dedent @@ -5,6 +6,7 @@ from _pytest.config import UsageError from _pytest.config.findpaths import get_common_ancestor from _pytest.config.findpaths import get_dirs_from_args +from _pytest.config.findpaths import is_fs_root from _pytest.config.findpaths import load_config_dict_from_file @@ -133,3 +135,18 @@ def test_get_dirs_from_args(tmp_path): assert get_dirs_from_args( [str(fn), str(tmp_path / "does_not_exist"), str(d), option, xdist_rsync_option] ) == [fn.parent, d] + + +@pytest.mark.parametrize( + "path, expected", + [ + pytest.param( + f"e:{os.sep}", True, marks=pytest.mark.skipif("sys.platform != 'win32'") + ), + (f"{os.sep}", True), + (f"e:{os.sep}projects", False), + (f"{os.sep}projects", False), + ], +) +def test_is_fs_root(path: Path, expected: bool) -> None: + assert is_fs_root(Path(path)) is expected From f513d33d5a863e1d97daab5c5a7ee8ead2669a92 Mon Sep 17 00:00:00 2001 From: Yusuke Kadowaki <60080334+yusuke-kadowaki@users.noreply.github.com> Date: Mon, 28 Nov 2022 05:09:56 +0900 Subject: [PATCH 459/549] Modify documentation to use `.stash` when storing test results. (#10535) --- doc/en/example/simple.rst | 17 +++++++++-------- src/_pytest/tmpdir.py | 9 ++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index e62060f191c..a528e50ef6e 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -895,6 +895,8 @@ here is a little example implemented via a local plugin: import pytest + phase_report_key = StashKey[Dict[str, CollectReport]]() + @pytest.hookimpl(tryfirst=True, hookwrapper=True) def pytest_runtest_makereport(item, call): @@ -902,10 +904,9 @@ here is a little example implemented via a local plugin: outcome = yield rep = outcome.get_result() - # set a report attribute for each phase of a call, which can + # store test results for each phase of a call, which can # be "setup", "call", "teardown" - - setattr(item, "rep_" + rep.when, rep) + item.stash.setdefault(phase_report_key, {})[rep.when] = rep @pytest.fixture @@ -913,11 +914,11 @@ here is a little example implemented via a local plugin: yield # request.node is an "item" because we use the default # "function" scope - if request.node.rep_setup.failed: - print("setting up a test failed!", request.node.nodeid) - elif request.node.rep_setup.passed: - if request.node.rep_call.failed: - print("executing test failed", request.node.nodeid) + report = request.node.stash[phase_report_key] + if report["setup"].failed: + print("setting up a test failed or skipped", request.node.nodeid) + elif ("call" not in report) or report["call"].failed: + print("executing test failed or skipped", request.node.nodeid) if you then have failing tests: diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index 3fd8168b6d2..48670b6c42d 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -12,6 +12,7 @@ from typing import Union from _pytest.nodes import Item +from _pytest.reports import CollectReport from _pytest.stash import StashKey if TYPE_CHECKING: @@ -318,9 +319,7 @@ def pytest_sessionfinish(session, exitstatus: Union[int, ExitCode]): @hookimpl(tryfirst=True, hookwrapper=True) def pytest_runtest_makereport(item: Item, call): outcome = yield - result = outcome.get_result() + result: CollectReport = outcome.get_result() - if tmppath_result_key not in item.stash: - item.stash[tmppath_result_key] = {result.when: result.passed} - else: - item.stash[tmppath_result_key][result.when] = result.passed + empty: Dict[str, bool] = {} + item.stash.setdefault(tmppath_result_key, empty)[result.when] = result.passed From 49a4ed14cf3e106d7803b0b186008a7c4a77dc67 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 29 Nov 2022 02:01:34 +0000 Subject: [PATCH 460/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.4.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.3.0...v4.4.0) - [github.com/PyCQA/autoflake: v1.7.7 → v2.0.0](https://github.com/PyCQA/autoflake/compare/v1.7.7...v2.0.0) - [github.com/PyCQA/flake8: 5.0.4 → 6.0.0](https://github.com/PyCQA/flake8/compare/5.0.4...6.0.0) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f836f2aab78..babcfbedc79 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - id: blacken-docs additional_dependencies: [black==20.8b1] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -23,7 +23,7 @@ repos: exclude: _pytest/(debugging|hookspec).py language_version: python3 - repo: https://github.com/PyCQA/autoflake - rev: v1.7.7 + rev: v2.0.0 hooks: - id: autoflake name: autoflake @@ -31,7 +31,7 @@ repos: language: python files: \.py$ - repo: https://github.com/PyCQA/flake8 - rev: 5.0.4 + rev: 6.0.0 hooks: - id: flake8 language_version: python3 From eb984a717a9d937e2ebd7a7c6b2ea01f36ceb56e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Nov 2022 09:55:24 +0100 Subject: [PATCH 461/549] build(deps): Bump pytest-rerunfailures in /testing/plugins_integration (#10537) Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 10.2 to 10.3. - [Release notes](https://github.com/pytest-dev/pytest-rerunfailures/releases) - [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/10.2...10.3) --- updated-dependencies: - dependency-name: pytest-rerunfailures dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 594c592c3b8..237e43ac07d 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -7,7 +7,7 @@ pytest-django==4.5.2 pytest-flakes==4.0.5 pytest-html==3.2.0 pytest-mock==3.10.0 -pytest-rerunfailures==10.2 +pytest-rerunfailures==10.3 pytest-sugar==0.9.5 pytest-trio==0.7.0 pytest-twisted==1.14.0 From fd30759d94d16357441d50d5a82ca88e423da5c0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 29 Nov 2022 09:14:38 +0000 Subject: [PATCH 462/549] [automated] Update plugin list (#10536) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 134 +++++++++++++++++++------------ 1 file changed, 83 insertions(+), 51 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 03fb5be2bd9..16c605ce0b0 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1162 plugins. +This list contains 1166 plugins. .. only:: not latex @@ -64,6 +64,7 @@ This list contains 1162 plugins. :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A :pypi:`pytest-approvaltests` A plugin to use approvaltests with pytest May 08, 2022 4 - Beta pytest (>=7.0.1) :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Nov 10, 2022 5 - Production/Stable pytest + :pypi:`pytest-archon` Rule your architecture like a real developer Nov 26, 2022 N/A pytest (>=7.2) :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 4 - Beta pytest (>=4.6) :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) @@ -105,7 +106,7 @@ This list contains 1162 plugins. :pypi:`pytest-bandit-xayon` A bandit plugin for pytest Oct 17, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-bdd` BDD for pytest Nov 08, 2022 6 - Mature pytest (>=6.2.0) - :pypi:`pytest-bdd-html` pytest plugin to display BDD info in HTML test report Jul 25, 2022 3 - Alpha pytest (!=6.0.0,>=5.0) + :pypi:`pytest-bdd-html` pytest plugin to display BDD info in HTML test report Nov 22, 2022 3 - Alpha pytest (!=6.0.0,>=5.0) :pypi:`pytest-bdd-ng` BDD for pytest Oct 06, 2022 4 - Beta pytest (>=5.0) :pypi:`pytest-bdd-splinter` Common steps for pytest bdd and splinter integration Aug 12, 2019 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-bdd-web` A simple plugin to use with pytest Jan 02, 2020 4 - Beta pytest (>=3.5.0) @@ -165,7 +166,7 @@ This list contains 1162 plugins. :pypi:`pytest-change-report` turn . into √,turn F into x Sep 14, 2020 N/A pytest :pypi:`pytest-change-xds` turn . into √,turn F into x Apr 16, 2022 N/A pytest :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) - :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Sep 29, 2022 5 - Production/Stable N/A + :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Nov 25, 2022 5 - Production/Stable pytest :pypi:`pytest-checkdocs` check the README when running tests Oct 09, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) :pypi:`pytest-check-library` check your missing library Jul 17, 2022 N/A N/A @@ -192,7 +193,7 @@ This list contains 1162 plugins. :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A :pypi:`pytest-codeowners` Pytest plugin for selecting tests by GitHub CODEOWNERS. Mar 30, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-codestyle` pytest plugin to run pycodestyle Mar 23, 2020 3 - Alpha N/A - :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Nov 10, 2022 5 - Production/Stable pytest>=3.8 + :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Nov 22, 2022 5 - Production/Stable pytest>=3.8 :pypi:`pytest-collect-formatter` Formatter for pytest collect output Mar 29, 2021 5 - Production/Stable N/A :pypi:`pytest-collect-formatter2` Formatter for pytest collect output May 31, 2021 5 - Production/Stable N/A :pypi:`pytest-collector` Python package for collecting pytest. Aug 02, 2022 N/A pytest (>=7.0,<8.0) @@ -360,7 +361,7 @@ This list contains 1162 plugins. :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Oct 15, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) - :pypi:`pytest-enabler` Enable installed pytest plugins Jun 22, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-enabler` Enable installed pytest plugins Nov 23, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-encode` set your encoding and logger Nov 06, 2021 N/A N/A :pypi:`pytest-encode-kane` set your encoding and logger Nov 16, 2021 N/A pytest :pypi:`pytest-enhancements` Improvements for pytest (rejected upstream) Oct 30, 2019 4 - Beta N/A @@ -487,7 +488,7 @@ This list contains 1162 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Nov 17, 2022 3 - Alpha pytest (==7.1.3) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Nov 21, 2022 3 - Alpha pytest (==7.1.3) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Nov 17, 2022 N/A pytest (>=5.0) @@ -525,7 +526,7 @@ This list contains 1162 plugins. :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A - :pypi:`pytest-inline` A simple plugin to use with pytest Nov 13, 2022 4 - Beta pytest (>=7.0.0) + :pypi:`pytest-inline` A pytest plugin for writing inline tests. Nov 23, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Oct 07, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Sep 30, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Sep 16, 2022 5 - Production/Stable N/A @@ -568,11 +569,12 @@ This list contains 1162 plugins. :pypi:`pytest-kivy` Kivy GUI tests fixtures using pytest Jul 06, 2021 4 - Beta pytest (>=3.6) :pypi:`pytest-knows` A pytest plugin that can automaticly skip test case based on dependence info calculated by trace Aug 22, 2014 N/A N/A :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A + :pypi:`pytest-koopmans` A plugin for testing the koopmans package Nov 21, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. Aug 20, 2022 3 - Alpha pytest (>=3.6,<8) :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A - :pypi:`pytest-lark` A package for enhancing pytest Nov 15, 2022 N/A N/A + :pypi:`pytest-lark` A package for enhancing pytest Nov 20, 2022 N/A N/A :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 14, 2022 N/A pytest (>=4.2.0) :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A :pypi:`pytest-lazy-fixture` It helps to use fixtures in pytest.mark.parametrize Feb 01, 2020 4 - Beta pytest (>=3.2.5) @@ -631,7 +633,7 @@ This list contains 1162 plugins. :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) - :pypi:`pytest-messenger` Pytest to Slack reporting plugin Feb 07, 2022 5 - Production/Stable N/A + :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A :pypi:`pytest-metadata` pytest plugin for test session metadata Oct 30, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) @@ -668,9 +670,9 @@ This list contains 1162 plugins. :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Sep 18, 2022 N/A pytest :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Aug 12, 2021 N/A pytest (>=3.6) - :pypi:`pytest-multithreading-allure` pytest_multithreading_allure Oct 20, 2022 N/A N/A + :pypi:`pytest-multithreading-allure` pytest_multithreading_allure Nov 25, 2022 N/A N/A :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) - :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Nov 10, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" + :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Nov 25, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Oct 26, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A pytest>=6.0.0 @@ -678,7 +680,7 @@ This list contains 1162 plugins. :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 15, 2022 5 - Production/Stable pytest (>=6.2) :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) - :pypi:`pytest-netdut` "Automated software testing for switches using pytest" Nov 18, 2022 N/A pytest (>=3.5.0) + :pypi:`pytest-netdut` "Automated software testing for switches using pytest" Nov 22, 2022 N/A pytest (>=3.5.0) :pypi:`pytest-network` A simple plugin to disable network on socket level. May 07, 2020 N/A N/A :pypi:`pytest-network-endpoints` Network endpoints plugin for pytest Mar 06, 2022 N/A pytest :pypi:`pytest-never-sleep` pytest plugin helps to avoid adding tests without mock \`time.sleep\` May 05, 2021 3 - Alpha pytest (>=3.5.1) @@ -686,7 +688,7 @@ This list contains 1162 plugins. :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Nov 16, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Nov 25, 2022 N/A pytest (==6.2.5) :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A :pypi:`pytest-nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Jul 07, 2021 N/A N/A @@ -777,7 +779,7 @@ This list contains 1162 plugins. :pypi:`pytest-portion` Select a portion of the collected tests Jan 28, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) - :pypi:`pytest-pot` A package for enhancing pytest Nov 15, 2022 N/A N/A + :pypi:`pytest-pot` A package for enhancing pytest Nov 20, 2022 N/A N/A :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 27, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) :pypi:`pytest-pretty` pytest plugin for printing summary data as I want it Nov 03, 2022 4 - Beta pytest>=7 @@ -809,11 +811,11 @@ This list contains 1162 plugins. :pypi:`pytest-pyq` Pytest fixture "q" for pyq Mar 10, 2020 5 - Production/Stable N/A :pypi:`pytest-pyramid` pytest_pyramid - provides fixtures for testing pyramid applications with pytest test suite Oct 15, 2021 5 - Production/Stable pytest :pypi:`pytest-pyramid-server` Pyramid server fixture for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-pyright` Pytest plugin for type checking code with Pyright Aug 16, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-pyright` Pytest plugin for type checking code with Pyright Nov 20, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.0) :pypi:`pytest-pythonpath` pytest plugin for adding to the PYTHONPATH from command line or configs. Feb 10, 2022 5 - Production/Stable pytest (<7,>=2.5.2) :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest - :pypi:`pytest-pyvista` Pytest-pyvista package Nov 18, 2022 4 - Beta pytest>=3.5.0 + :pypi:`pytest-pyvista` Pytest-pyvista package Nov 21, 2022 4 - Beta pytest>=3.5.0 :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Jun 26, 2021 4 - Beta pytest (>=6.2.0) :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jun 26, 2022 5 - Production/Stable pytest (>=6.2.3) @@ -837,7 +839,7 @@ This list contains 1162 plugins. :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-readme` Test your README.md file Sep 02, 2022 5 - Production/Stable N/A - :pypi:`pytest-reana` Pytest fixtures for REANA. Oct 06, 2022 3 - Alpha N/A + :pypi:`pytest-reana` Pytest fixtures for REANA. Nov 25, 2022 3 - Alpha N/A :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jun 20, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) @@ -874,8 +876,9 @@ This list contains 1162 plugins. :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Sep 20, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) - :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Sep 17, 2021 5 - Production/Stable pytest (>=5.3) + :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Nov 22, 2022 5 - Production/Stable pytest (>=5.3) :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A + :pypi:`pytest-reserial` Pytest fixture for recording and replaying serial port traffic. Nov 25, 2022 4 - Beta pytest :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Nov 17, 2022 N/A N/A :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) @@ -914,17 +917,17 @@ This list contains 1162 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Nov 18, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Nov 26, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 21, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Nov 18, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Nov 26, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A - :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Nov 16, 2022 N/A N/A + :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Nov 22, 2022 N/A pytest :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A :pypi:`pytest-servers` pytest servers Nov 09, 2022 3 - Alpha pytest (>=6.2) @@ -982,7 +985,7 @@ This list contains 1162 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Nov 11, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Nov 25, 2022 N/A pytest (>5.4.0,<6.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A @@ -997,7 +1000,7 @@ This list contains 1162 plugins. :pypi:`pytest-stepfunctions` A small description May 08, 2021 4 - Beta pytest :pypi:`pytest-steps` Create step-wise / incremental tests in pytest. Sep 23, 2021 5 - Production/Stable N/A :pypi:`pytest-stepwise` Run a test suite one failing test at a time. Dec 01, 2015 4 - Beta N/A - :pypi:`pytest-stf` pytest plugin for openSTF Sep 30, 2022 N/A pytest (>=5.0) + :pypi:`pytest-stf` pytest plugin for openSTF Nov 25, 2022 N/A pytest (>=5.0) :pypi:`pytest-stoq` A plugin to pytest stoq Feb 09, 2021 4 - Beta N/A :pypi:`pytest-stress` A Pytest plugin that allows you to loop tests for a user defined amount of time. Dec 07, 2019 4 - Beta pytest (>=3.6.0) :pypi:`pytest-structlog` Structured logging assertions Sep 21, 2021 N/A pytest @@ -1038,7 +1041,7 @@ This list contains 1162 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Jun 19, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Nov 17, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Nov 23, 2022 4 - Beta N/A :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) :pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Jun 13, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) @@ -1169,6 +1172,7 @@ This list contains 1162 plugins. :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yamlwsgi` Run tests against wsgi apps defined in yaml May 11, 2010 N/A N/A + :pypi:`pytest-yaml-yoyo` http/https API run by yaml Nov 24, 2022 N/A N/A :pypi:`pytest-yapf` Run yapf Jul 06, 2017 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) :pypi:`pytest-yield` PyTest plugin to run tests concurrently, each \`yield\` switch context to other one Jan 23, 2019 N/A N/A @@ -1507,6 +1511,13 @@ This list contains 1162 plugins. Extension for ApprovalTests.Python specific to geo data verification + :pypi:`pytest-archon` + *last release*: Nov 26, 2022, + *status*: N/A, + *requires*: pytest (>=7.2) + + Rule your architecture like a real developer + :pypi:`pytest-argus` *last release*: Jun 24, 2021, *status*: 5 - Production/Stable, @@ -1795,7 +1806,7 @@ This list contains 1162 plugins. BDD for pytest :pypi:`pytest-bdd-html` - *last release*: Jul 25, 2022, + *last release*: Nov 22, 2022, *status*: 3 - Alpha, *requires*: pytest (!=6.0.0,>=5.0) @@ -2215,9 +2226,9 @@ This list contains 1162 plugins. A pytest fixture for changing current working directory :pypi:`pytest-check` - *last release*: Sep 29, 2022, + *last release*: Nov 25, 2022, *status*: 5 - Production/Stable, - *requires*: N/A + *requires*: pytest A pytest plugin that allows multiple failures per test. @@ -2404,7 +2415,7 @@ This list contains 1162 plugins. pytest plugin to run pycodestyle :pypi:`pytest-codspeed` - *last release*: Nov 10, 2022, + *last release*: Nov 22, 2022, *status*: 5 - Production/Stable, *requires*: pytest>=3.8 @@ -3580,7 +3591,7 @@ This list contains 1162 plugins. Pytest plugin to represent test output with emoji support :pypi:`pytest-enabler` - *last release*: Jun 22, 2022, + *last release*: Nov 23, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6) ; extra == 'testing' @@ -4469,7 +4480,7 @@ This list contains 1162 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Nov 17, 2022, + *last release*: Nov 21, 2022, *status*: 3 - Alpha, *requires*: pytest (==7.1.3) @@ -4735,11 +4746,11 @@ This list contains 1162 plugins. Reuse pytest.ini to store env variables :pypi:`pytest-inline` - *last release*: Nov 13, 2022, + *last release*: Nov 23, 2022, *status*: 4 - Beta, *requires*: pytest (>=7.0.0) - A simple plugin to use with pytest + A pytest plugin for writing inline tests. :pypi:`pytest-inmanta` *last release*: Oct 07, 2022, @@ -5035,6 +5046,13 @@ This list contains 1162 plugins. Run Konira DSL tests with py.test + :pypi:`pytest-koopmans` + *last release*: Nov 21, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + A plugin for testing the koopmans package + :pypi:`pytest-krtech-common` *last release*: Nov 28, 2016, *status*: 4 - Beta, @@ -5064,7 +5082,7 @@ This list contains 1162 plugins. :pypi:`pytest-lark` - *last release*: Nov 15, 2022, + *last release*: Nov 20, 2022, *status*: N/A, *requires*: N/A @@ -5477,7 +5495,7 @@ This list contains 1162 plugins. Pytest plugin for sending report message of marked tests execution :pypi:`pytest-messenger` - *last release*: Feb 07, 2022, + *last release*: Nov 24, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -5736,7 +5754,7 @@ This list contains 1162 plugins. a pytest plugin for th and concurrent testing :pypi:`pytest-multithreading-allure` - *last release*: Oct 20, 2022, + *last release*: Nov 25, 2022, *status*: N/A, *requires*: N/A @@ -5750,7 +5768,7 @@ This list contains 1162 plugins. Add the mutation testing feature to pytest :pypi:`pytest-mypy` - *last release*: Nov 10, 2022, + *last release*: Nov 25, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2) ; python_version >= "3.10" @@ -5806,7 +5824,7 @@ This list contains 1162 plugins. pytest-neo is a plugin for pytest that shows tests like screen of Matrix. :pypi:`pytest-netdut` - *last release*: Nov 18, 2022, + *last release*: Nov 22, 2022, *status*: N/A, *requires*: pytest (>=3.5.0) @@ -5862,7 +5880,7 @@ This list contains 1162 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Nov 16, 2022, + *last release*: Nov 25, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -6499,7 +6517,7 @@ This list contains 1162 plugins. Postgresql fixtures and fixture factories for Pytest. :pypi:`pytest-pot` - *last release*: Nov 15, 2022, + *last release*: Nov 20, 2022, *status*: N/A, *requires*: N/A @@ -6723,9 +6741,9 @@ This list contains 1162 plugins. Pyramid server fixture for py.test :pypi:`pytest-pyright` - *last release*: Aug 16, 2021, + *last release*: Nov 20, 2022, *status*: 4 - Beta, - *requires*: pytest (>=3.5.0) + *requires*: pytest (>=7.0.0) Pytest plugin for type checking code with Pyright @@ -6751,7 +6769,7 @@ This list contains 1162 plugins. pytest plugin for a better developer experience when working with the PyTorch test suite :pypi:`pytest-pyvista` - *last release*: Nov 18, 2022, + *last release*: Nov 21, 2022, *status*: 4 - Beta, *requires*: pytest>=3.5.0 @@ -6919,7 +6937,7 @@ This list contains 1162 plugins. Test your README.md file :pypi:`pytest-reana` - *last release*: Oct 06, 2022, + *last release*: Nov 25, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -7178,7 +7196,7 @@ This list contains 1162 plugins. Re-run only changed files in specified branch :pypi:`pytest-rerunfailures` - *last release*: Sep 17, 2021, + *last release*: Nov 22, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=5.3) @@ -7191,6 +7209,13 @@ This list contains 1162 plugins. pytest plugin to re-run tests to eliminate flaky failures + :pypi:`pytest-reserial` + *last release*: Nov 25, 2022, + *status*: 4 - Beta, + *requires*: pytest + + Pytest fixture for recording and replaying serial port traffic. + :pypi:`pytest-resilient-circuits` *last release*: Nov 17, 2022, *status*: N/A, @@ -7458,7 +7483,7 @@ This list contains 1162 plugins. :pypi:`pytest-sbase` - *last release*: Nov 18, 2022, + *last release*: Nov 26, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7500,7 +7525,7 @@ This list contains 1162 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Nov 18, 2022, + *last release*: Nov 26, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7528,9 +7553,9 @@ This list contains 1162 plugins. Send pytest execution result email :pypi:`pytest-sentry` - *last release*: Nov 16, 2022, + *last release*: Nov 22, 2022, *status*: N/A, - *requires*: N/A + *requires*: pytest A pytest plugin to send testrun information to Sentry.io @@ -7934,7 +7959,7 @@ This list contains 1162 plugins. :pypi:`pytest-splunk-addon` - *last release*: Nov 11, 2022, + *last release*: Nov 25, 2022, *status*: N/A, *requires*: pytest (>5.4.0,<6.3) @@ -8039,7 +8064,7 @@ This list contains 1162 plugins. Run a test suite one failing test at a time. :pypi:`pytest-stf` - *last release*: Sep 30, 2022, + *last release*: Nov 25, 2022, *status*: N/A, *requires*: pytest (>=5.0) @@ -8326,7 +8351,7 @@ This list contains 1162 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Nov 17, 2022, + *last release*: Nov 23, 2022, *status*: 4 - Beta, *requires*: N/A @@ -9242,6 +9267,13 @@ This list contains 1162 plugins. Run tests against wsgi apps defined in yaml + :pypi:`pytest-yaml-yoyo` + *last release*: Nov 24, 2022, + *status*: N/A, + *requires*: N/A + + http/https API run by yaml + :pypi:`pytest-yapf` *last release*: Jul 06, 2017, *status*: 4 - Beta, From 62e75c7d55cabaaba33c37b1551ff987f7e45a23 Mon Sep 17 00:00:00 2001 From: Yusuke Kadowaki Date: Thu, 1 Dec 2022 22:29:46 +0900 Subject: [PATCH 463/549] Documentation update for tmp_path configurations --- doc/en/how-to/tmp_path.rst | 9 ++++++--- src/_pytest/tmpdir.py | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/en/how-to/tmp_path.rst b/doc/en/how-to/tmp_path.rst index a2f936d3352..21be898f622 100644 --- a/doc/en/how-to/tmp_path.rst +++ b/doc/en/how-to/tmp_path.rst @@ -131,10 +131,13 @@ The default base temporary directory Temporary directories are by default created as sub-directories of the system temporary directory. The base name will be ``pytest-NUM`` where -``NUM`` will be incremented with each test run. Moreover, entries older -than 3 temporary directories will be removed. +``NUM`` will be incremented with each test run. +By default, only the directories of failed tests will be kept. +Also only the last 3 directries will remain at most. +This behavior can be configured with :confval:`tmp_path_retention_count` and +:confval:`tmp_path_retention_policy`. -The number of entries currently cannot be changed, but using the ``--basetemp`` +Using the ``--basetemp`` option will remove the directory before every run, effectively meaning the temporary directories of only the most recent run will be kept. diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index 48670b6c42d..57671483fe0 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -267,8 +267,10 @@ def tmp_path( directory. By default, a new base temporary directory is created each test session, - and old bases are removed after 3 sessions, to aid in debugging. If - ``--basetemp`` is used then it is cleared each session. See :ref:`base + and only the base of failed session is kept. Also it only keeps the last 3 bases + at most. This can be configured with :confval:`tmp_path_retention_count` and + :confval:`tmp_path_retention_policy`. + If ``--basetemp`` is used then it is cleared each session. See :ref:`base temporary directory`. The returned object is a :class:`pathlib.Path` object. From fb701b538c404bd0687f7fb3ec40327cd5cf13d2 Mon Sep 17 00:00:00 2001 From: Daniel Scheffler Date: Thu, 1 Dec 2022 18:16:02 +0100 Subject: [PATCH 464/549] Use os.sep instead of os.path.sep. Signed-off-by: Daniel Scheffler --- src/_pytest/_argcomplete.py | 6 +++--- src/_pytest/_py/path.py | 4 ++-- src/_pytest/assertion/rewrite.py | 2 +- src/_pytest/pathlib.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/_pytest/_argcomplete.py b/src/_pytest/_argcomplete.py index 120f09ff68f..6a8083770ae 100644 --- a/src/_pytest/_argcomplete.py +++ b/src/_pytest/_argcomplete.py @@ -78,15 +78,15 @@ def __init__(self, directories: bool = True) -> None: def __call__(self, prefix: str, **kwargs: Any) -> List[str]: # Only called on non option completions. - if os.path.sep in prefix[1:]: - prefix_dir = len(os.path.dirname(prefix) + os.path.sep) + if os.sep in prefix[1:]: + prefix_dir = len(os.path.dirname(prefix) + os.sep) else: prefix_dir = 0 completion = [] globbed = [] if "*" not in prefix and "?" not in prefix: # We are on unix, otherwise no bash. - if not prefix or prefix[-1] == os.path.sep: + if not prefix or prefix[-1] == os.sep: globbed.extend(glob(prefix + ".*")) prefix += "*" globbed.extend(glob(prefix)) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index c3905d0d39b..fb64830f814 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -796,7 +796,7 @@ def check(self, **kw): kw = {"exists": 1} return Checkers(self)._evaluate(kw) - _patternchars = set("*?[" + os.path.sep) + _patternchars = set("*?[" + os.sep) def listdir(self, fil=None, sort=None): """List directory contents, possibly filter by the given fil func @@ -1128,7 +1128,7 @@ def pyimport(self, modname=None, ensuresyspath=True): modfile = modfile[:-1] elif modfile.endswith("$py.class"): modfile = modfile[:-9] + ".py" - if modfile.endswith(os.path.sep + "__init__.py"): + if modfile.endswith(os.sep + "__init__.py"): if self.basename != "__init__.py": modfile = modfile[:-12] try: diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index cb64a33c078..e2648029ced 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -180,7 +180,7 @@ def _early_rewrite_bailout(self, name: str, state: "AssertionState") -> bool: for initial_path in self.session._initialpaths: # Make something as c:/projects/my_project/path.py -> # ['c:', 'projects', 'my_project', 'path.py'] - parts = str(initial_path).split(os.path.sep) + parts = str(initial_path).split(os.sep) # add 'path' to basenames to be checked. self._basenames_to_check_rewrite.add(os.path.splitext(parts[-1])[0]) diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py index 533335c6607..1fc16f5cde9 100644 --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -557,8 +557,8 @@ def import_path( if module_file.endswith((".pyc", ".pyo")): module_file = module_file[:-1] - if module_file.endswith(os.path.sep + "__init__.py"): - module_file = module_file[: -(len(os.path.sep + "__init__.py"))] + if module_file.endswith(os.sep + "__init__.py"): + module_file = module_file[: -(len(os.sep + "__init__.py"))] try: is_same = _is_same(str(path), module_file) From 9fbd67dd4b1baa6889dbb2073c17b85da39f80d9 Mon Sep 17 00:00:00 2001 From: Marko Pacak <45235847+markopacak@users.noreply.github.com> Date: Fri, 2 Dec 2022 16:53:04 +0100 Subject: [PATCH 465/549] Class methods can now be discovered as tests (#10552) Fix #10525 --- AUTHORS | 1 + changelog/10525.feature.rst | 1 + doc/en/explanation/goodpractices.rst | 4 ++-- src/_pytest/python.py | 4 ++-- testing/python/integration.py | 8 ++++---- testing/test_collection.py | 14 ++++++++++++++ 6 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 changelog/10525.feature.rst diff --git a/AUTHORS b/AUTHORS index 4e7c756c0c3..b6141187490 100644 --- a/AUTHORS +++ b/AUTHORS @@ -225,6 +225,7 @@ Marcin Bachry Marco Gorelli Mark Abramowitz Mark Dickinson +Marko Pacak Markus Unterwaditzer Martijn Faassen Martin Altmayer diff --git a/changelog/10525.feature.rst b/changelog/10525.feature.rst new file mode 100644 index 00000000000..15652b0246d --- /dev/null +++ b/changelog/10525.feature.rst @@ -0,0 +1 @@ +Test methods decorated with ``@classmethod`` can now be discovered as tests, following the same rules as normal methods. This fills the gap that static methods were discoverable as tests but not class methods. diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 6b3af861a0d..0e23e9e4798 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -50,8 +50,8 @@ Conventions for Python test discovery * In those directories, search for ``test_*.py`` or ``*_test.py`` files, imported by their `test package name`_. * From those files, collect test items: - * ``test`` prefixed test functions or methods outside of class - * ``test`` prefixed test functions or methods inside ``Test`` prefixed test classes (without an ``__init__`` method) + * ``test`` prefixed test functions or methods outside of class. + * ``test`` prefixed test functions or methods inside ``Test`` prefixed test classes (without an ``__init__`` method). Methods decorated with ``@staticmethod`` and ``@classmethods`` are also considered. For examples of how to customize your test discovery :doc:`/example/pythoncollection`. diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 1e30d42ce9c..e143d28d1d9 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -403,8 +403,8 @@ def classnamefilter(self, name: str) -> bool: def istestfunction(self, obj: object, name: str) -> bool: if self.funcnamefilter(name) or self.isnosetest(obj): - if isinstance(obj, staticmethod): - # staticmethods need to be unwrapped. + if isinstance(obj, (staticmethod, classmethod)): + # staticmethods and classmethods need to be unwrapped. obj = safe_getattr(obj, "__func__", False) return callable(obj) and fixtures.getfixturemarker(obj) is None else: diff --git a/testing/python/integration.py b/testing/python/integration.py index 6b5c53c98c4..054c14a39e4 100644 --- a/testing/python/integration.py +++ b/testing/python/integration.py @@ -416,7 +416,7 @@ def test_class(cls): pass def test_static(): pass """ ) - assert len(items) == 3 + assert len(items) == 4 assert isinstance(items[0], Function) assert items[0].name == "test_func" assert items[0].instance is None @@ -424,6 +424,6 @@ def test_static(): pass assert items[1].name == "test_method" assert items[1].instance is not None assert items[1].instance.__class__.__name__ == "TestIt" - assert isinstance(items[2], Function) - assert items[2].name == "test_static" - assert items[2].instance is None + assert isinstance(items[3], Function) + assert items[3].name == "test_static" + assert items[3].instance is None diff --git a/testing/test_collection.py b/testing/test_collection.py index 58e1d862a35..d907244d551 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -735,6 +735,20 @@ def testmethod_two(self, arg0): assert s.endswith("test_example_items1.testone") print(s) + def test_classmethod_is_discovered(self, pytester: Pytester) -> None: + """Test that classmethods are discovered""" + p = pytester.makepyfile( + """ + class TestCase: + @classmethod + def test_classmethod(cls) -> None: + pass + """ + ) + items, reprec = pytester.inline_genitems(p) + ids = [x.getmodpath() for x in items] # type: ignore[attr-defined] + assert ids == ["TestCase.test_classmethod"] + def test_class_and_functions_discovery_using_glob(self, pytester: Pytester) -> None: """Test that Python_classes and Python_functions config options work as prefixes and glob-like patterns (#600).""" From 39b6bb551c8ec1fd113548ec19b44830fa9f63e7 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 4 Dec 2022 00:20:05 +0000 Subject: [PATCH 466/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 188 ++++++++++++++++++++----------- 1 file changed, 122 insertions(+), 66 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 16c605ce0b0..6d7b2f7a844 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1166 plugins. +This list contains 1173 plugins. .. only:: not latex @@ -55,7 +55,7 @@ This list contains 1166 plugins. :pypi:`pytest-antilru` Bust functools.lru_cache when running pytest to avoid test pollution Jul 05, 2022 5 - Production/Stable pytest :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest :pypi:`pytest-anything` Pytest fixtures to assert anything and something Oct 13, 2022 N/A pytest - :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Nov 23, 2021 N/A pytest ; extra == 'test' + :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Dec 02, 2022 N/A pytest ; extra == 'test' :pypi:`pytest-aoreporter` pytest report Jun 27, 2022 N/A N/A :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 12, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A @@ -63,8 +63,8 @@ This list contains 1166 plugins. :pypi:`pytest-appengine` AppEngine integration that works well with pytest-django Feb 27, 2017 N/A N/A :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A :pypi:`pytest-approvaltests` A plugin to use approvaltests with pytest May 08, 2022 4 - Beta pytest (>=7.0.1) - :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Nov 10, 2022 5 - Production/Stable pytest - :pypi:`pytest-archon` Rule your architecture like a real developer Nov 26, 2022 N/A pytest (>=7.2) + :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Nov 29, 2022 5 - Production/Stable pytest + :pypi:`pytest-archon` Rule your architecture like a real developer Nov 29, 2022 N/A pytest (>=7.2) :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 4 - Beta pytest (>=4.6) :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) @@ -128,6 +128,7 @@ This list contains 1166 plugins. :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A :pypi:`pytest-blue` A pytest plugin that adds a \`blue\` fixture for printing stuff in blue. Sep 05, 2022 N/A N/A :pypi:`pytest-board` Local continuous test runner with pytest and watchdog. Jan 20, 2019 N/A N/A + :pypi:`pytest-boost-xml` Plugin for pytest to generate boost xml reports Nov 30, 2022 4 - Beta N/A :pypi:`pytest-bootstrap` Mar 04, 2022 N/A N/A :pypi:`pytest-bpdb` A py.test plug-in to enable drop to bpdb debugger on test failure. Jan 19, 2015 2 - Pre-Alpha N/A :pypi:`pytest-bravado` Pytest-bravado automatically generates from OpenAPI specification client fixtures. Feb 15, 2022 N/A N/A @@ -166,7 +167,7 @@ This list contains 1166 plugins. :pypi:`pytest-change-report` turn . into √,turn F into x Sep 14, 2020 N/A pytest :pypi:`pytest-change-xds` turn . into √,turn F into x Apr 16, 2022 N/A pytest :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) - :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Nov 25, 2022 5 - Production/Stable pytest + :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Dec 02, 2022 5 - Production/Stable pytest :pypi:`pytest-checkdocs` check the README when running tests Oct 09, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) :pypi:`pytest-check-library` check your missing library Jul 17, 2022 N/A N/A @@ -186,14 +187,15 @@ This list contains 1166 plugins. :pypi:`pytest-cloud` Distributed tests planner plugin for pytest testing framework. Oct 05, 2020 6 - Mature N/A :pypi:`pytest-cloudflare-worker` pytest plugin for testing cloudflare workers Mar 30, 2021 4 - Beta pytest (>=6.0.0) :pypi:`pytest-cloudist` Distribute tests to cloud machines without fuss Sep 02, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-cmake` Provide CMake module for Pytest Nov 30, 2022 1 - Planning N/A :pypi:`pytest-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) :pypi:`pytest-codecarbon` Pytest plugin for measuring carbon emissions Jun 15, 2022 N/A pytest :pypi:`pytest-codecheckers` pytest plugin to add source code sanity checks (pep8 and friends) Feb 13, 2010 N/A N/A - :pypi:`pytest-codecov` Pytest plugin for uploading pytest-cov results to codecov.io Apr 12, 2022 4 - Beta pytest (>=4.6.0) + :pypi:`pytest-codecov` Pytest plugin for uploading pytest-cov results to codecov.io Nov 29, 2022 4 - Beta pytest (>=4.6.0) :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A :pypi:`pytest-codeowners` Pytest plugin for selecting tests by GitHub CODEOWNERS. Mar 30, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-codestyle` pytest plugin to run pycodestyle Mar 23, 2020 3 - Alpha N/A - :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Nov 22, 2022 5 - Production/Stable pytest>=3.8 + :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Dec 02, 2022 5 - Production/Stable pytest>=3.8 :pypi:`pytest-collect-formatter` Formatter for pytest collect output Mar 29, 2021 5 - Production/Stable N/A :pypi:`pytest-collect-formatter2` Formatter for pytest collect output May 31, 2021 5 - Production/Stable N/A :pypi:`pytest-collector` Python package for collecting pytest. Aug 02, 2022 N/A pytest (>=7.0,<8.0) @@ -215,7 +217,7 @@ This list contains 1166 plugins. :pypi:`pytest-cover` Pytest plugin for measuring coverage. Forked from \`pytest-cov\`. Aug 01, 2015 5 - Production/Stable N/A :pypi:`pytest-coverage` Jun 17, 2015 N/A N/A :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-coveragemarkers` Using pytest markers to track functional coverage and filtering of tests Nov 17, 2022 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-coveragemarkers` Using pytest markers to track functional coverage and filtering of tests Nov 29, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Sep 23, 2022 5 - Production/Stable pytest (>=7.0) :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Nov 07, 2022 N/A N/A @@ -260,6 +262,7 @@ This list contains 1166 plugins. :pypi:`pytest-dbt-conventions` A pytest plugin for linting a dbt project's conventions Mar 02, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-dbt-core` Pytest extension for dbt. Jul 22, 2022 N/A pytest (>=6.2.5) ; extra == 'test' :pypi:`pytest-dbus-notification` D-BUS notifications for pytest results. Mar 05, 2014 5 - Production/Stable N/A + :pypi:`pytest-dbx` Pytest plugin to run unit tests for dbx (Databricks CLI extensions) related code Nov 29, 2022 N/A pytest (>=7.1.3,<8.0.0) :pypi:`pytest-deadfixtures` A simple plugin to list unused fixtures in pytest Jul 23, 2020 5 - Production/Stable N/A :pypi:`pytest-deepcov` deepcov Mar 30, 2021 N/A N/A :pypi:`pytest-defer` Aug 24, 2021 N/A N/A @@ -393,9 +396,10 @@ This list contains 1166 plugins. :pypi:`pytest-extra-durations` A pytest plugin to get durations on a per-function basis and per module basis. Apr 21, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-fabric` Provides test utilities to run fabric task tests by using docker containers Sep 12, 2018 5 - Production/Stable N/A :pypi:`pytest-factory` Use factories for test setup with py.test Sep 06, 2020 3 - Alpha pytest (>4.3) - :pypi:`pytest-factoryboy` Factory Boy support for pytest. Jun 14, 2022 6 - Mature pytest (>=5.0.0) + :pypi:`pytest-factoryboy` Factory Boy support for pytest. Dec 01, 2022 6 - Mature pytest (>=5.0.0) :pypi:`pytest-factoryboy-fixtures` Generates pytest fixtures that allow the use of type hinting Jun 25, 2020 N/A N/A :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-failed-screen-record` Create a video of the screen when pytest fails Nov 29, 2022 4 - Beta pytest (>=7.1.2d,<8.0.0) :pypi:`pytest-failed-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A :pypi:`pytest-failed-to-verify` A pytest plugin that helps better distinguishing real test failures from setup flakiness. Aug 08, 2019 5 - Production/Stable pytest (>=4.1.0) :pypi:`pytest-fail-slow` Fail tests that take too long to run Aug 13, 2022 4 - Beta pytest (>=6.0) @@ -488,7 +492,7 @@ This list contains 1166 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Nov 21, 2022 3 - Alpha pytest (==7.1.3) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Dec 03, 2022 3 - Alpha pytest (==7.2.0) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Nov 17, 2022 N/A pytest (>=5.0) @@ -528,7 +532,7 @@ This list contains 1166 plugins. :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A :pypi:`pytest-inline` A pytest plugin for writing inline tests. Nov 23, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Oct 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-extensions` Inmanta tests package Sep 30, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-extensions` Inmanta tests package Dec 01, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Sep 16, 2022 5 - Production/Stable N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Jun 16, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A @@ -553,7 +557,7 @@ This list contains 1166 plugins. :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) :pypi:`pytest-jinja` A plugin to generate customizable jinja-based HTML reports in pytest Oct 04, 2022 3 - Alpha pytest (>=6.2.5,<7.0.0) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A - :pypi:`pytest-jira-xfail` Plugin skips (xfail) tests if unresolved Jira issue(s) linked Nov 07, 2022 N/A pytest (~=7.2.0) + :pypi:`pytest-jira-xfail` Plugin skips (xfail) tests if unresolved Jira issue(s) linked Dec 01, 2022 N/A pytest (~=7.2.0) :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Aug 25, 2022 4 - Beta pytest :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) @@ -561,11 +565,12 @@ This list contains 1166 plugins. :pypi:`pytest-json-fixtures` JSON output for the --fixtures flag Aug 09, 2022 4 - Beta pytest (>=7.1.0) :pypi:`pytest-jsonlint` UNKNOWN Aug 04, 2016 N/A N/A :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Mar 15, 2022 4 - Beta pytest (>=3.8.0) - :pypi:`pytest-jtr` pytest plugin supporting json test report output Oct 24, 2022 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-jtr` pytest plugin supporting json test report output Nov 29, 2022 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-jupyter` A pytest plugin for testing Jupyter libraries and extensions. Nov 30, 2022 4 - Beta pytest :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Oct 01, 2022 N/A pytest :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest :pypi:`pytest-kexi` Apr 29, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Sep 08, 2022 5 - Production/Stable N/A + :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Nov 30, 2022 5 - Production/Stable N/A :pypi:`pytest-kivy` Kivy GUI tests fixtures using pytest Jul 06, 2021 4 - Beta pytest (>=3.6) :pypi:`pytest-knows` A pytest plugin that can automaticly skip test case based on dependence info calculated by trace Aug 22, 2014 N/A N/A :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A @@ -605,7 +610,7 @@ This list contains 1166 plugins. :pypi:`pytest-logger` Plugin configuring handlers for loggers from Python logging module. Jul 25, 2019 4 - Beta pytest (>=3.2) :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A :pypi:`pytest-logging-end-to-end-test-tool` Sep 23, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-logikal` Common testing environment Oct 19, 2022 5 - Production/Stable pytest (==7.1.3) + :pypi:`pytest-logikal` Common testing environment Dec 03, 2022 5 - Production/Stable pytest (==7.2.0) :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A :pypi:`pytest-loop` pytest plugin for looping tests Jul 22, 2022 5 - Production/Stable pytest (>=6) @@ -628,7 +633,7 @@ This list contains 1166 plugins. :pypi:`pytest-md` Plugin for generating Markdown reports for pytest results Jul 11, 2019 3 - Alpha pytest (>=4.2.1) :pypi:`pytest-md-report` A pytest plugin to make a test results report with Markdown table format. Aug 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :pypi:`pytest-memprof` Estimates memory consumption of test functions Mar 29, 2019 4 - Beta N/A - :pypi:`pytest-memray` A simple plugin to use with pytest Nov 14, 2022 N/A pytest>=7.1.2 + :pypi:`pytest-memray` A simple plugin to use with pytest Dec 02, 2022 N/A pytest>=7.2 :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) @@ -688,7 +693,7 @@ This list contains 1166 plugins. :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Nov 25, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Dec 01, 2022 N/A pytest (==6.2.5) :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A :pypi:`pytest-nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Jul 07, 2021 N/A N/A @@ -798,6 +803,8 @@ This list contains 1166 plugins. :pypi:`pytest-pudb` Pytest PuDB debugger integration Oct 25, 2018 3 - Alpha pytest (>=2.0) :pypi:`pytest-pumpkin-spice` A pytest plugin that makes your test reporting pumpkin-spiced Sep 18, 2022 4 - Beta N/A :pypi:`pytest-purkinje` py.test plugin for purkinje test runner Oct 28, 2017 2 - Pre-Alpha N/A + :pypi:`pytest-py125` Dec 03, 2022 N/A N/A + :pypi:`pytest-py15` Dec 01, 2022 N/A N/A :pypi:`pytest-pycharm` Plugin for py.test to enter PyCharm debugger on uncaught exceptions Aug 13, 2020 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-pycodestyle` pytest plugin to run pycodestyle Oct 28, 2022 3 - Alpha N/A :pypi:`pytest-pydev` py.test plugin to connect to a remote debug server with PyDev or PyCharm. Nov 15, 2017 3 - Alpha N/A @@ -837,7 +844,7 @@ This list contains 1166 plugins. :pypi:`pytest-randomly` Pytest plugin to randomly order tests and control random.seed. May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-randomness` Pytest plugin about random seed management May 30, 2019 3 - Alpha N/A :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A - :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Dec 03, 2022 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-readme` Test your README.md file Sep 02, 2022 5 - Production/Stable N/A :pypi:`pytest-reana` Pytest fixtures for REANA. Nov 25, 2022 3 - Alpha N/A :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jun 20, 2022 4 - Beta pytest (>=3.5.0) @@ -868,7 +875,7 @@ This list contains 1166 plugins. :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility Dec 11, 2020 3 - Alpha pytest (>=5.2) :pypi:`pytest-report-me` A pytest plugin to generate report. Dec 31, 2020 N/A pytest :pypi:`pytest-report-parameters` pytest plugin for adding tests' parameters to junit report Jun 18, 2020 3 - Alpha pytest (>=2.4.2) - :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Jun 24, 2022 N/A pytest (>=3.8.0) + :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Nov 30, 2022 N/A pytest (>=3.8.0) :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-requestselapsed` collect and show http requests elapsed time Aug 14, 2022 N/A N/A @@ -878,7 +885,7 @@ This list contains 1166 plugins. :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Nov 22, 2022 5 - Production/Stable pytest (>=5.3) :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-reserial` Pytest fixture for recording and replaying serial port traffic. Nov 25, 2022 4 - Beta pytest + :pypi:`pytest-reserial` Pytest fixture for recording and replaying serial port traffic. Nov 29, 2022 4 - Beta pytest :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Nov 17, 2022 N/A N/A :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) @@ -911,19 +918,19 @@ This list contains 1166 plugins. :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Oct 31, 2022 3 - Alpha N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A - :pypi:`pytest-salt-factories` Pytest Salt Plugin Nov 04, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Dec 02, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Nov 26, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Dec 03, 2022 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 21, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Nov 26, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Dec 03, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -985,7 +992,7 @@ This list contains 1166 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Nov 25, 2022 N/A pytest (>5.4.0,<6.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Nov 29, 2022 N/A pytest (>5.4.0,<7.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A @@ -1000,7 +1007,7 @@ This list contains 1166 plugins. :pypi:`pytest-stepfunctions` A small description May 08, 2021 4 - Beta pytest :pypi:`pytest-steps` Create step-wise / incremental tests in pytest. Sep 23, 2021 5 - Production/Stable N/A :pypi:`pytest-stepwise` Run a test suite one failing test at a time. Dec 01, 2015 4 - Beta N/A - :pypi:`pytest-stf` pytest plugin for openSTF Nov 25, 2022 N/A pytest (>=5.0) + :pypi:`pytest-stf` pytest plugin for openSTF Dec 02, 2022 N/A pytest (>=5.0) :pypi:`pytest-stoq` A plugin to pytest stoq Feb 09, 2021 4 - Beta N/A :pypi:`pytest-stress` A Pytest plugin that allows you to loop tests for a user defined amount of time. Dec 07, 2019 4 - Beta pytest (>=3.6.0) :pypi:`pytest-structlog` Structured logging assertions Sep 21, 2021 N/A pytest @@ -1039,7 +1046,7 @@ This list contains 1166 plugins. :pypi:`pytest-testdox` A testdox format reporter for pytest Apr 19, 2022 5 - Production/Stable pytest (>=4.6.0) :pypi:`pytest-test-grouping` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Jun 17, 2022 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A - :pypi:`pytest-testinfra` Test infrastructures Jun 19, 2022 5 - Production/Stable pytest (!=3.0.2) + :pypi:`pytest-testinfra` Test infrastructures Dec 01, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) :pypi:`pytest-testmon` selects tests affected by changed files and methods Nov 23, 2022 4 - Beta N/A :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) @@ -1055,7 +1062,7 @@ This list contains 1166 plugins. :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Aug 12, 2022 N/A N/A :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A - :pypi:`pytest-testreport` May 23, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-testreport` Dec 01, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testreport-new` Aug 15, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) @@ -1116,7 +1123,7 @@ This list contains 1166 plugins. :pypi:`pytest-unhandled-exception-exit-code` Plugin for py.test set a different exit code on uncaught exceptions Jun 22, 2020 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) :pypi:`pytest-unmarked` Run only unmarked tests Aug 27, 2019 5 - Production/Stable N/A - :pypi:`pytest-unordered` Test equality of unordered collections in pytest Jul 08, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-unordered` Test equality of unordered collections in pytest Nov 28, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Sep 27, 2022 4 - Beta N/A :pypi:`pytest-upload-report` pytest-upload-report is a plugin for pytest that upload your test report for test results. Jun 18, 2021 5 - Production/Stable N/A :pypi:`pytest-utils` Some helpers for pytest. Dec 04, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) @@ -1155,7 +1162,7 @@ This list contains 1166 plugins. :pypi:`pytest-wiremock` A pytest plugin for programmatically using wiremock in integration tests Mar 27, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-with-docker` pytest with docker helpers. Nov 09, 2021 N/A pytest :pypi:`pytest-workflow` A pytest plugin for configuring workflow/pipeline tests using YAML files Dec 03, 2021 5 - Production/Stable pytest (>=5.4.0) - :pypi:`pytest-xdist` pytest xdist plugin for distributed testing and loop-on-failing modes Oct 25, 2022 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-xdist` pytest xdist plugin for distributed testing, most importantly across multiple CPUs Dec 03, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-xdist-debug-for-graingert` pytest xdist plugin for distributed testing and loop-on-failing modes Jul 24, 2019 5 - Production/Stable pytest (>=4.4.0) :pypi:`pytest-xdist-forked` forked from pytest-xdist Feb 10, 2020 5 - Production/Stable pytest (>=4.4.0) :pypi:`pytest-xdist-tracker` pytest plugin helps to reproduce failures for particular xdist node Nov 18, 2021 3 - Alpha pytest (>=3.5.1) @@ -1164,7 +1171,7 @@ This list contains 1166 plugins. :pypi:`pytest-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Nov 06, 2022 N/A pytest>=7.1.2 :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest - :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Aug 29, 2022 4 - Beta pytest (>=2.8) + :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Nov 27, 2022 4 - Beta pytest (>=2.8) :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) @@ -1172,7 +1179,7 @@ This list contains 1166 plugins. :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yamlwsgi` Run tests against wsgi apps defined in yaml May 11, 2010 N/A N/A - :pypi:`pytest-yaml-yoyo` http/https API run by yaml Nov 24, 2022 N/A N/A + :pypi:`pytest-yaml-yoyo` http/https API run by yaml Nov 30, 2022 N/A N/A :pypi:`pytest-yapf` Run yapf Jul 06, 2017 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) :pypi:`pytest-yield` PyTest plugin to run tests concurrently, each \`yield\` switch context to other one Jan 23, 2019 N/A N/A @@ -1449,7 +1456,7 @@ This list contains 1166 plugins. Pytest fixtures to assert anything and something :pypi:`pytest-aoc` - *last release*: Nov 23, 2021, + *last release*: Dec 02, 2022, *status*: N/A, *requires*: pytest ; extra == 'test' @@ -1505,14 +1512,14 @@ This list contains 1166 plugins. A plugin to use approvaltests with pytest :pypi:`pytest-approvaltests-geo` - *last release*: Nov 10, 2022, + *last release*: Nov 29, 2022, *status*: 5 - Production/Stable, *requires*: pytest Extension for ApprovalTests.Python specific to geo data verification :pypi:`pytest-archon` - *last release*: Nov 26, 2022, + *last release*: Nov 29, 2022, *status*: N/A, *requires*: pytest (>=7.2) @@ -1959,6 +1966,13 @@ This list contains 1166 plugins. Local continuous test runner with pytest and watchdog. + :pypi:`pytest-boost-xml` + *last release*: Nov 30, 2022, + *status*: 4 - Beta, + *requires*: N/A + + Plugin for pytest to generate boost xml reports + :pypi:`pytest-bootstrap` *last release*: Mar 04, 2022, *status*: N/A, @@ -2226,7 +2240,7 @@ This list contains 1166 plugins. A pytest fixture for changing current working directory :pypi:`pytest-check` - *last release*: Nov 25, 2022, + *last release*: Dec 02, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -2365,6 +2379,13 @@ This list contains 1166 plugins. Distribute tests to cloud machines without fuss + :pypi:`pytest-cmake` + *last release*: Nov 30, 2022, + *status*: 1 - Planning, + *requires*: N/A + + Provide CMake module for Pytest + :pypi:`pytest-cobra` *last release*: Jun 29, 2019, *status*: 3 - Alpha, @@ -2387,7 +2408,7 @@ This list contains 1166 plugins. pytest plugin to add source code sanity checks (pep8 and friends) :pypi:`pytest-codecov` - *last release*: Apr 12, 2022, + *last release*: Nov 29, 2022, *status*: 4 - Beta, *requires*: pytest (>=4.6.0) @@ -2415,7 +2436,7 @@ This list contains 1166 plugins. pytest plugin to run pycodestyle :pypi:`pytest-codspeed` - *last release*: Nov 22, 2022, + *last release*: Dec 02, 2022, *status*: 5 - Production/Stable, *requires*: pytest>=3.8 @@ -2569,7 +2590,7 @@ This list contains 1166 plugins. Coverage dynamic context support for PyTest, including sub-processes :pypi:`pytest-coveragemarkers` - *last release*: Nov 17, 2022, + *last release*: Nov 29, 2022, *status*: N/A, *requires*: pytest (>=7.1.2,<8.0.0) @@ -2883,6 +2904,13 @@ This list contains 1166 plugins. D-BUS notifications for pytest results. + :pypi:`pytest-dbx` + *last release*: Nov 29, 2022, + *status*: N/A, + *requires*: pytest (>=7.1.3,<8.0.0) + + Pytest plugin to run unit tests for dbx (Databricks CLI extensions) related code + :pypi:`pytest-deadfixtures` *last release*: Jul 23, 2020, *status*: 5 - Production/Stable, @@ -3815,7 +3843,7 @@ This list contains 1166 plugins. Use factories for test setup with py.test :pypi:`pytest-factoryboy` - *last release*: Jun 14, 2022, + *last release*: Dec 01, 2022, *status*: 6 - Mature, *requires*: pytest (>=5.0.0) @@ -3835,6 +3863,13 @@ This list contains 1166 plugins. Simple factoryboy random state management + :pypi:`pytest-failed-screen-record` + *last release*: Nov 29, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=7.1.2d,<8.0.0) + + Create a video of the screen when pytest fails + :pypi:`pytest-failed-screenshot` *last release*: Apr 21, 2021, *status*: N/A, @@ -4480,9 +4515,9 @@ This list contains 1166 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Nov 21, 2022, + *last release*: Dec 03, 2022, *status*: 3 - Alpha, - *requires*: pytest (==7.1.3) + *requires*: pytest (==7.2.0) Experimental package to automatically extract test plugins for Home Assistant custom components @@ -4760,7 +4795,7 @@ This list contains 1166 plugins. A py.test plugin providing fixtures to simplify inmanta modules testing. :pypi:`pytest-inmanta-extensions` - *last release*: Sep 30, 2022, + *last release*: Dec 01, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -4935,7 +4970,7 @@ This list contains 1166 plugins. py.test JIRA integration plugin, using markers :pypi:`pytest-jira-xfail` - *last release*: Nov 07, 2022, + *last release*: Dec 01, 2022, *status*: N/A, *requires*: pytest (~=7.2.0) @@ -4991,12 +5026,19 @@ This list contains 1166 plugins. A pytest plugin to report test results as JSON files :pypi:`pytest-jtr` - *last release*: Oct 24, 2022, + *last release*: Nov 29, 2022, *status*: N/A, *requires*: pytest (>=7.1.2,<8.0.0) pytest plugin supporting json test report output + :pypi:`pytest-jupyter` + *last release*: Nov 30, 2022, + *status*: 4 - Beta, + *requires*: pytest + + A pytest plugin for testing Jupyter libraries and extensions. + :pypi:`pytest-kafka` *last release*: Oct 01, 2022, *status*: N/A, @@ -5019,7 +5061,7 @@ This list contains 1166 plugins. :pypi:`pytest-kind` - *last release*: Sep 08, 2022, + *last release*: Nov 30, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -5299,9 +5341,9 @@ This list contains 1166 plugins. :pypi:`pytest-logikal` - *last release*: Oct 19, 2022, + *last release*: Dec 03, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (==7.1.3) + *requires*: pytest (==7.2.0) Common testing environment @@ -5460,9 +5502,9 @@ This list contains 1166 plugins. Estimates memory consumption of test functions :pypi:`pytest-memray` - *last release*: Nov 14, 2022, + *last release*: Dec 02, 2022, *status*: N/A, - *requires*: pytest>=7.1.2 + *requires*: pytest>=7.2 A simple plugin to use with pytest @@ -5880,7 +5922,7 @@ This list contains 1166 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Nov 25, 2022, + *last release*: Dec 01, 2022, *status*: N/A, *requires*: pytest (==6.2.5) @@ -6649,6 +6691,20 @@ This list contains 1166 plugins. py.test plugin for purkinje test runner + :pypi:`pytest-py125` + *last release*: Dec 03, 2022, + *status*: N/A, + *requires*: N/A + + + + :pypi:`pytest-py15` + *last release*: Dec 01, 2022, + *status*: N/A, + *requires*: N/A + + + :pypi:`pytest-pycharm` *last release*: Aug 13, 2020, *status*: 5 - Production/Stable, @@ -6923,7 +6979,7 @@ This list contains 1166 plugins. Randomise the order in which pytest tests are run with some control over the randomness :pypi:`pytest-random-order` - *last release*: Nov 30, 2018, + *last release*: Dec 03, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=3.0.0) @@ -7140,7 +7196,7 @@ This list contains 1166 plugins. pytest plugin for adding tests' parameters to junit report :pypi:`pytest-reportportal` - *last release*: Jun 24, 2022, + *last release*: Nov 30, 2022, *status*: N/A, *requires*: pytest (>=3.8.0) @@ -7210,7 +7266,7 @@ This list contains 1166 plugins. pytest plugin to re-run tests to eliminate flaky failures :pypi:`pytest-reserial` - *last release*: Nov 25, 2022, + *last release*: Nov 29, 2022, *status*: 4 - Beta, *requires*: pytest @@ -7441,7 +7497,7 @@ This list contains 1166 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Nov 04, 2022, + *last release*: Dec 02, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -7483,7 +7539,7 @@ This list contains 1166 plugins. :pypi:`pytest-sbase` - *last release*: Nov 26, 2022, + *last release*: Dec 03, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7525,7 +7581,7 @@ This list contains 1166 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Nov 26, 2022, + *last release*: Dec 03, 2022, *status*: 5 - Production/Stable, *requires*: N/A @@ -7959,9 +8015,9 @@ This list contains 1166 plugins. :pypi:`pytest-splunk-addon` - *last release*: Nov 25, 2022, + *last release*: Nov 29, 2022, *status*: N/A, - *requires*: pytest (>5.4.0,<6.3) + *requires*: pytest (>5.4.0,<7.3) A Dynamic test tool for Splunk Apps and Add-ons @@ -8064,7 +8120,7 @@ This list contains 1166 plugins. Run a test suite one failing test at a time. :pypi:`pytest-stf` - *last release*: Nov 25, 2022, + *last release*: Dec 02, 2022, *status*: N/A, *requires*: pytest (>=5.0) @@ -8337,7 +8393,7 @@ This list contains 1166 plugins. A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. :pypi:`pytest-testinfra` - *last release*: Jun 19, 2022, + *last release*: Dec 01, 2022, *status*: 5 - Production/Stable, *requires*: pytest (!=3.0.2) @@ -8449,7 +8505,7 @@ This list contains 1166 plugins. :pypi:`pytest-testreport` - *last release*: May 23, 2022, + *last release*: Dec 01, 2022, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) @@ -8876,7 +8932,7 @@ This list contains 1166 plugins. Run only unmarked tests :pypi:`pytest-unordered` - *last release*: Jul 08, 2022, + *last release*: Nov 28, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -9149,11 +9205,11 @@ This list contains 1166 plugins. A pytest plugin for configuring workflow/pipeline tests using YAML files :pypi:`pytest-xdist` - *last release*: Oct 25, 2022, + *last release*: Dec 03, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2.0) - pytest xdist plugin for distributed testing and loop-on-failing modes + pytest xdist plugin for distributed testing, most importantly across multiple CPUs :pypi:`pytest-xdist-debug-for-graingert` *last release*: Jul 24, 2019, @@ -9212,7 +9268,7 @@ This list contains 1166 plugins. An extended parametrizing plugin of pytest. :pypi:`pytest-xprocess` - *last release*: Aug 29, 2022, + *last release*: Nov 27, 2022, *status*: 4 - Beta, *requires*: pytest (>=2.8) @@ -9268,7 +9324,7 @@ This list contains 1166 plugins. Run tests against wsgi apps defined in yaml :pypi:`pytest-yaml-yoyo` - *last release*: Nov 24, 2022, + *last release*: Nov 30, 2022, *status*: N/A, *requires*: N/A From 3a58fc2d4449c59a8e7d0c51e606a6810ef5d77d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Dec 2022 03:15:13 +0000 Subject: [PATCH 467/549] build(deps): Bump peter-evans/create-pull-request from 3.7.0 to 4.2.3 Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 3.7.0 to 4.2.3. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/2455e1596942c2902952003bbb574afbbe2ab2e6...2b011faafdcbc9ceb11414d64d0573f37c774b04) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/update-plugin-list.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-plugin-list.yml b/.github/workflows/update-plugin-list.yml index 18f3e9783f2..033eb89bcae 100644 --- a/.github/workflows/update-plugin-list.yml +++ b/.github/workflows/update-plugin-list.yml @@ -38,7 +38,7 @@ jobs: run: python scripts/update-plugin-list.py - name: Create Pull Request - uses: peter-evans/create-pull-request@2455e1596942c2902952003bbb574afbbe2ab2e6 + uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 with: commit-message: '[automated] Update plugin list' author: 'pytest bot ' From 0079decf29d5cef943d52a99394eabfc231bff64 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 6 Dec 2022 00:36:28 +0000 Subject: [PATCH 468/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/pyupgrade: v3.2.2 → v3.3.0](https://github.com/asottile/pyupgrade/compare/v3.2.2...v3.3.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index babcfbedc79..b12bcb68399 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,7 +44,7 @@ repos: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v3.2.2 + rev: v3.3.0 hooks: - id: pyupgrade args: [--py37-plus] From 1eca228bd52d2164ff151518104fc5f338e70de6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 13 Dec 2022 01:28:21 +0000 Subject: [PATCH 469/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 22.10.0 → 22.12.0](https://github.com/psf/black/compare/22.10.0...22.12.0) - [github.com/asottile/pyupgrade: v3.3.0 → v3.3.1](https://github.com/asottile/pyupgrade/compare/v3.3.0...v3.3.1) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b12bcb68399..601b4f8571e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ default_language_version: python: "3.10" repos: - repo: https://github.com/psf/black - rev: 22.10.0 + rev: 22.12.0 hooks: - id: black args: [--safe, --quiet] @@ -44,7 +44,7 @@ repos: - id: reorder-python-imports args: ['--application-directories=.:src', --py37-plus] - repo: https://github.com/asottile/pyupgrade - rev: v3.3.0 + rev: v3.3.1 hooks: - id: pyupgrade args: [--py37-plus] From 3e52124185327a1add7441f2858198ec5ea987d0 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 13 Dec 2022 08:12:42 -0300 Subject: [PATCH 470/549] Fix passenv setting for tox.ini In tox 4.0 `passenv` is required to be one per-line, or comma-separated. --- tox.ini | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index c80fdfcd1a4..f619287fbcb 100644 --- a/tox.ini +++ b/tox.ini @@ -30,7 +30,11 @@ commands = doctesting: {env:_PYTEST_TOX_COVERAGE_RUN:} pytest --doctest-modules --pyargs _pytest coverage: coverage combine coverage: coverage report -m -passenv = USER USERNAME COVERAGE_* PYTEST_ADDOPTS TERM SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST +passenv = + COVERAGE_* + PYTEST_ADDOPTS + TERM + SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST setenv = _PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_DOCTESTING:} {env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:} @@ -93,7 +97,8 @@ commands = [testenv:regen] changedir = doc/en basepython = python3 -passenv = SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST +passenv = + SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST deps = dataclasses PyYAML @@ -161,7 +166,10 @@ commands = python scripts/prepare-release-pr.py {posargs} description = create GitHub release after deployment basepython = python3 usedevelop = True -passenv = GH_RELEASE_NOTES_TOKEN GITHUB_REF GITHUB_REPOSITORY +passenv = + GH_RELEASE_NOTES_TOKEN + GITHUB_REF + GITHUB_REPOSITORY deps = github3.py pypandoc From 19807ab79a3186748062affd507ae7d5f203520c Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 13 Dec 2022 09:54:48 -0300 Subject: [PATCH 471/549] Pin packaging while building docs Packaging >=22 no longer supports 'latest' versions, which is the version that is assigned when building the docs. https://github.com/pytest-dev/pytest/pull/10578#issuecomment-1348249045 Also first install pytest, then `docs/en/requirements.txt`: Installing the requirements last will honor pins of libraries shared between pytest and the docs build. --- .readthedocs.yml | 9 ++++++--- doc/en/requirements.txt | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index bc44d38b4c7..b506c5f4039 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -2,9 +2,12 @@ version: 2 python: install: - - requirements: doc/en/requirements.txt - - method: pip - path: . + # Install pytest first, then doc/en/requirements.txt. + # This order is important to honor any pins in doc/en/requirements.txt + # when the pinned library is also a dependency of pytest. + - method: pip + path: . + - requirements: doc/en/requirements.txt build: os: ubuntu-20.04 diff --git a/doc/en/requirements.txt b/doc/en/requirements.txt index 0523772d4b0..b6059723cd5 100644 --- a/doc/en/requirements.txt +++ b/doc/en/requirements.txt @@ -5,3 +5,7 @@ sphinx-removed-in>=0.2.0 sphinx>=5,<6 sphinxcontrib-trio sphinxcontrib-svg2pdfconverter +# Pin packaging because it no longer handles 'latest' version, which +# is the version that is assigned to the docs. +# See https://github.com/pytest-dev/pytest/pull/10578#issuecomment-1348249045. +packaging <22 From b90e7b84d0082994a87001d408ee8d9d7ca9ddba Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 14 Dec 2022 08:24:28 -0300 Subject: [PATCH 472/549] Remove reference to explicit pytest tox support This reference no longer exists in tox 4.0 docs. --- doc/en/explanation/goodpractices.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 0e23e9e4798..98b4b56eb9f 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -270,8 +270,8 @@ tox Once you are done with your work and want to make sure that your actual package passes all tests you may want to look into :doc:`tox `, the -virtualenv test automation tool and its :doc:`pytest support `. -tox helps you to setup virtualenv environments with pre-defined +virtualenv test automation tool. +``tox`` helps you to setup virtualenv environments with pre-defined dependencies and then executing a pre-configured test command with options. It will run tests against the installed package and not against your source code checkout, helping to detect packaging From b31db4809be18b43ba714b80b10285b463cc9315 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sat, 17 Dec 2022 14:24:46 +0100 Subject: [PATCH 473/549] Avoid truncation when truncating means longer output (#10446) Fixes #6267 --- AUTHORS | 1 + changelog/6267.improvement.rst | 2 + src/_pytest/assertion/truncate.py | 67 ++++++++++++++++++++----------- testing/test_assertion.py | 49 ++++++++++++++++------ 4 files changed, 84 insertions(+), 35 deletions(-) create mode 100644 changelog/6267.improvement.rst diff --git a/AUTHORS b/AUTHORS index b6141187490..a4ca9926760 100644 --- a/AUTHORS +++ b/AUTHORS @@ -280,6 +280,7 @@ Paweł Adamczak Pedro Algarvio Petter Strandmark Philipp Loose +Pierre Sassoulas Pieter Mulder Piotr Banaszkiewicz Piotr Helm diff --git a/changelog/6267.improvement.rst b/changelog/6267.improvement.rst new file mode 100644 index 00000000000..ed551cecc33 --- /dev/null +++ b/changelog/6267.improvement.rst @@ -0,0 +1,2 @@ +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. diff --git a/src/_pytest/assertion/truncate.py b/src/_pytest/assertion/truncate.py index ce148dca095..dfd6f65d281 100644 --- a/src/_pytest/assertion/truncate.py +++ b/src/_pytest/assertion/truncate.py @@ -38,9 +38,9 @@ def _truncate_explanation( """Truncate given list of strings that makes up the assertion explanation. Truncates to either 8 lines, or 640 characters - whichever the input reaches - first. The remaining lines will be replaced by a usage message. + first, taking the truncation explanation into account. The remaining lines + will be replaced by a usage message. """ - if max_lines is None: max_lines = DEFAULT_MAX_LINES if max_chars is None: @@ -48,35 +48,56 @@ def _truncate_explanation( # Check if truncation required input_char_count = len("".join(input_lines)) - if len(input_lines) <= max_lines and input_char_count <= max_chars: + # The length of the truncation explanation depends on the number of lines + # removed but is at least 68 characters: + # The real value is + # 64 (for the base message: + # '...\n...Full output truncated (1 line hidden), use '-vv' to show")' + # ) + # + 1 (for plural) + # + int(math.log10(len(input_lines) - max_lines)) (number of hidden line, at least 1) + # + 3 for the '...' added to the truncated line + # But if there's more than 100 lines it's very likely that we're going to + # truncate, so we don't need the exact value using log10. + tolerable_max_chars = ( + max_chars + 70 # 64 + 1 (for plural) + 2 (for '99') + 3 for '...' + ) + # The truncation explanation add two lines to the output + tolerable_max_lines = max_lines + 2 + if ( + len(input_lines) <= tolerable_max_lines + and input_char_count <= tolerable_max_chars + ): return input_lines - - # Truncate first to max_lines, and then truncate to max_chars if max_chars - # is exceeded. + # Truncate first to max_lines, and then truncate to max_chars if necessary truncated_explanation = input_lines[:max_lines] - truncated_explanation = _truncate_by_char_count(truncated_explanation, max_chars) - - # Add ellipsis to final line - truncated_explanation[-1] = truncated_explanation[-1] + "..." + truncated_char = True + # We reevaluate the need to truncate chars following removal of some lines + if len("".join(truncated_explanation)) > tolerable_max_chars: + truncated_explanation = _truncate_by_char_count( + truncated_explanation, max_chars + ) + else: + truncated_char = False - # Append useful message to explanation truncated_line_count = len(input_lines) - len(truncated_explanation) - truncated_line_count += 1 # Account for the part-truncated final line - msg = "...Full output truncated" - if truncated_line_count == 1: - msg += f" ({truncated_line_count} line hidden)" + if truncated_explanation[-1]: + # Add ellipsis and take into account part-truncated final line + truncated_explanation[-1] = truncated_explanation[-1] + "..." + if truncated_char: + # It's possible that we did not remove any char from this line + truncated_line_count += 1 else: - msg += f" ({truncated_line_count} lines hidden)" - msg += f", {USAGE_MSG}" - truncated_explanation.extend(["", str(msg)]) - return truncated_explanation + # Add proper ellipsis when we were able to fit a full line exactly + truncated_explanation[-1] = "..." + return truncated_explanation + [ + "", + f"...Full output truncated ({truncated_line_count} line" + f"{'' if truncated_line_count == 1 else 's'} hidden), {USAGE_MSG}", + ] def _truncate_by_char_count(input_lines: List[str], max_chars: int) -> List[str]: - # Check if truncation required - if len("".join(input_lines)) <= max_chars: - return input_lines - # Find point at which input length exceeds total allowed length iterated_char_count = 0 for iterated_index, input_line in enumerate(input_lines): diff --git a/testing/test_assertion.py b/testing/test_assertion.py index 75745922108..473ae44d98d 100644 --- a/testing/test_assertion.py +++ b/testing/test_assertion.py @@ -807,9 +807,9 @@ def test_dataclasses(self, pytester: Pytester) -> None: "E ['field_b']", "E ", "E Drill down into differing attribute field_b:", - "E field_b: 'b' != 'c'...", - "E ", - "E ...Full output truncated (3 lines hidden), use '-vv' to show", + "E field_b: 'b' != 'c'", + "E - c", + "E + b", ], consecutive=True, ) @@ -827,7 +827,7 @@ def test_recursive_dataclasses(self, pytester: Pytester) -> None: "E Drill down into differing attribute g:", "E g: S(a=10, b='ten') != S(a=20, b='xxx')...", "E ", - "E ...Full output truncated (52 lines hidden), use '-vv' to show", + "E ...Full output truncated (51 lines hidden), use '-vv' to show", ], consecutive=True, ) @@ -1188,30 +1188,55 @@ def test_doesnt_truncate_at_when_input_is_5_lines_and_LT_max_chars(self) -> None def test_truncates_at_8_lines_when_given_list_of_empty_strings(self) -> None: expl = ["" for x in range(50)] result = truncate._truncate_explanation(expl, max_lines=8, max_chars=100) + assert len(result) != len(expl) assert result != expl assert len(result) == 8 + self.LINES_IN_TRUNCATION_MSG assert "Full output truncated" in result[-1] - assert "43 lines hidden" in result[-1] + assert "42 lines hidden" in result[-1] last_line_before_trunc_msg = result[-self.LINES_IN_TRUNCATION_MSG - 1] assert last_line_before_trunc_msg.endswith("...") def test_truncates_at_8_lines_when_first_8_lines_are_LT_max_chars(self) -> None: - expl = ["a" for x in range(100)] + total_lines = 100 + expl = ["a" for x in range(total_lines)] result = truncate._truncate_explanation(expl, max_lines=8, max_chars=8 * 80) assert result != expl assert len(result) == 8 + self.LINES_IN_TRUNCATION_MSG assert "Full output truncated" in result[-1] - assert "93 lines hidden" in result[-1] + assert f"{total_lines - 8} lines hidden" in result[-1] last_line_before_trunc_msg = result[-self.LINES_IN_TRUNCATION_MSG - 1] assert last_line_before_trunc_msg.endswith("...") + def test_truncates_at_8_lines_when_there_is_one_line_to_remove(self) -> None: + """The number of line in the result is 9, the same number as if we truncated.""" + expl = ["a" for x in range(9)] + result = truncate._truncate_explanation(expl, max_lines=8, max_chars=8 * 80) + assert result == expl + assert "truncated" not in result[-1] + + def test_truncates_edgecase_when_truncation_message_makes_the_result_longer_for_chars( + self, + ) -> None: + line = "a" * 10 + expl = [line, line] + result = truncate._truncate_explanation(expl, max_lines=10, max_chars=10) + assert result == [line, line] + + def test_truncates_edgecase_when_truncation_message_makes_the_result_longer_for_lines( + self, + ) -> None: + line = "a" * 10 + expl = [line, line] + result = truncate._truncate_explanation(expl, max_lines=1, max_chars=100) + assert result == [line, line] + def test_truncates_at_8_lines_when_first_8_lines_are_EQ_max_chars(self) -> None: - expl = ["a" * 80 for x in range(16)] + expl = [chr(97 + x) * 80 for x in range(16)] result = truncate._truncate_explanation(expl, max_lines=8, max_chars=8 * 80) assert result != expl - assert len(result) == 8 + self.LINES_IN_TRUNCATION_MSG + assert len(result) == 16 - 8 + self.LINES_IN_TRUNCATION_MSG assert "Full output truncated" in result[-1] - assert "9 lines hidden" in result[-1] + assert "8 lines hidden" in result[-1] last_line_before_trunc_msg = result[-self.LINES_IN_TRUNCATION_MSG - 1] assert last_line_before_trunc_msg.endswith("...") @@ -1240,7 +1265,7 @@ def test_full_output_truncated(self, monkeypatch, pytester: Pytester) -> None: line_count = 7 line_len = 100 - expected_truncated_lines = 2 + expected_truncated_lines = 1 pytester.makepyfile( r""" def test_many_lines(): @@ -1261,7 +1286,7 @@ def test_many_lines(): "*+ 1*", "*+ 3*", "*+ 5*", - "*truncated (%d lines hidden)*use*-vv*" % expected_truncated_lines, + "*truncated (%d line hidden)*use*-vv*" % expected_truncated_lines, ] ) From 215ea7fd03b84e6b227b71edfe1281064aeacdc4 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 21 Dec 2022 13:49:20 -0300 Subject: [PATCH 474/549] Fix update-plugin-list workflow due to new 'packaging' The latest 'packaging' release has dropped support for `LegacyVersion`, meaning that version strings which do not conform to the standard now raise an error. --- scripts/update-plugin-list.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/update-plugin-list.py b/scripts/update-plugin-list.py index 3f3641d7d3e..34d1c8bb639 100644 --- a/scripts/update-plugin-list.py +++ b/scripts/update-plugin-list.py @@ -81,8 +81,20 @@ def iter_plugins(): if re.match(r"pytest(?![-.\w])", requirement): requires = requirement break + + def version_sort_key(version_string): + """ + Return the sort key for the given version string + returned by the API. + """ + try: + return packaging.version.parse(version_string) + except packaging.version.InvalidVersion: + # Use a hard-coded pre-release version. + return packaging.version.Version("0.0.0alpha") + releases = response.json()["releases"] - for release in sorted(releases, key=packaging.version.parse, reverse=True): + for release in sorted(releases, key=version_sort_key, reverse=True): if releases[release]: release_date = datetime.date.fromisoformat( releases[release][-1]["upload_time_iso_8601"].split("T")[0] @@ -124,7 +136,7 @@ def main(): reference_dir = pathlib.Path("doc", "en", "reference") plugin_list = reference_dir / "plugin_list.rst" - with plugin_list.open("w") as f: + with plugin_list.open("w", encoding="UTF-8") as f: f.write(FILE_HEAD) f.write(f"This list contains {len(plugins)} plugins.\n\n") f.write(".. only:: not latex\n\n") From a98b00cd0960948e8240006bd84c4cc15a2e2d8d Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 21 Dec 2022 13:55:58 -0300 Subject: [PATCH 475/549] Use a more descriptive job name for update-plugin-list workflow --- .github/workflows/update-plugin-list.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-plugin-list.yml b/.github/workflows/update-plugin-list.yml index 033eb89bcae..56aa631ec74 100644 --- a/.github/workflows/update-plugin-list.yml +++ b/.github/workflows/update-plugin-list.yml @@ -11,7 +11,7 @@ on: permissions: {} jobs: - createPullRequest: + update-plugin-list: if: github.repository_owner == 'pytest-dev' runs-on: ubuntu-latest permissions: From 10220d3f31acdf1d4a325a1009637b4b1cd81c4b Mon Sep 17 00:00:00 2001 From: Yusuke Kadowaki Date: Sun, 25 Dec 2022 00:18:38 +0900 Subject: [PATCH 476/549] Change the default policy to all --- changelog/8141.feature.rst | 1 - doc/en/how-to/tmp_path.rst | 3 +-- doc/en/reference/reference.rst | 2 +- src/_pytest/tmpdir.py | 6 +++--- testing/test_tmpdir.py | 27 +++++++++++++++++++++++---- 5 files changed, 28 insertions(+), 11 deletions(-) diff --git a/changelog/8141.feature.rst b/changelog/8141.feature.rst index 70de099e6f2..b589ed2e98b 100644 --- a/changelog/8141.feature.rst +++ b/changelog/8141.feature.rst @@ -1,2 +1 @@ Added :confval:`tmp_path_retention_count` and :confval:`tmp_path_retention_policy` configuration options to control how directories created by the :fixture:`tmp_path` fixture are kept. -The default behavior has changed to keep only directories for failed tests, equivalent to `tmp_path_retention_policy="failed"`. diff --git a/doc/en/how-to/tmp_path.rst b/doc/en/how-to/tmp_path.rst index 21be898f622..792933dd87e 100644 --- a/doc/en/how-to/tmp_path.rst +++ b/doc/en/how-to/tmp_path.rst @@ -132,8 +132,7 @@ The default base temporary directory Temporary directories are by default created as sub-directories of the system temporary directory. The base name will be ``pytest-NUM`` where ``NUM`` will be incremented with each test run. -By default, only the directories of failed tests will be kept. -Also only the last 3 directries will remain at most. +By default, entries older than 3 temporary directories will be removed. This behavior can be configured with :confval:`tmp_path_retention_count` and :confval:`tmp_path_retention_policy`. diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 25d76568a39..288a4050dbb 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1754,7 +1754,7 @@ passed multiple times. The expected format is ``name=value``. For example:: [pytest] tmp_path_retention_policy = "all" - Default: failed + Default: all .. confval:: usefixtures diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index 57671483fe0..8aca6d9f56c 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -239,7 +239,7 @@ def pytest_addoption(parser: Parser) -> None: "tmp_path_retention_policy", help="Controls which directories created by the `tmp_path` fixture are kept around, based on test outcome. " "(all/failed/none)", - default="failed", + default="all", ) @@ -267,8 +267,8 @@ def tmp_path( directory. By default, a new base temporary directory is created each test session, - and only the base of failed session is kept. Also it only keeps the last 3 bases - at most. This can be configured with :confval:`tmp_path_retention_count` and + and old bases are removed after 3 sessions, to aid in debugging. + This behavior can be configured with :confval:`tmp_path_retention_count` and :confval:`tmp_path_retention_policy`. If ``--basetemp`` is used then it is cleared each session. See :ref:`base temporary directory`. diff --git a/testing/test_tmpdir.py b/testing/test_tmpdir.py index 57f442b04ce..43437c9ab87 100644 --- a/testing/test_tmpdir.py +++ b/testing/test_tmpdir.py @@ -46,7 +46,7 @@ def getini(self, name): if name == "tmp_path_retention_count": return 3 elif name == "tmp_path_retention_policy": - return "failed" + return "all" else: assert False @@ -101,6 +101,12 @@ def test_2(tmp_path): assert 0 == 1 """ ) + pytester.makepyprojecttoml( + """ + [tool.pytest.ini_options] + tmp_path_retention_policy = "failed" + """ + ) pytester.inline_run(p) root = pytester._test_tmproot @@ -128,6 +134,12 @@ def test_1(tmp_path): assert 0 == 0 """ ) + pytester.makepyprojecttoml( + """ + [tool.pytest.ini_options] + tmp_path_retention_policy = "failed" + """ + ) pytester.inline_run(p) root = pytester._test_tmproot @@ -155,6 +167,13 @@ def test_fixt(fixt): pass """ ) + pytester.makepyprojecttoml( + """ + [tool.pytest.ini_options] + tmp_path_retention_policy = "failed" + """ + ) + pytester.inline_run(p) # Check if the whole directory is removed @@ -570,7 +589,7 @@ def test_tmp_path_factory_create_directory_with_safe_permissions( """Verify that pytest creates directories under /tmp with private permissions.""" # Use the test's tmp_path as the system temproot (/tmp). monkeypatch.setenv("PYTEST_DEBUG_TEMPROOT", str(tmp_path)) - tmp_factory = TempPathFactory(None, 3, "failed", lambda *args: None, _ispytest=True) + tmp_factory = TempPathFactory(None, 3, "all", lambda *args: None, _ispytest=True) basetemp = tmp_factory.getbasetemp() # No world-readable permissions. @@ -590,14 +609,14 @@ def test_tmp_path_factory_fixes_up_world_readable_permissions( """ # Use the test's tmp_path as the system temproot (/tmp). monkeypatch.setenv("PYTEST_DEBUG_TEMPROOT", str(tmp_path)) - tmp_factory = TempPathFactory(None, 3, "failed", lambda *args: None, _ispytest=True) + tmp_factory = TempPathFactory(None, 3, "all", lambda *args: None, _ispytest=True) basetemp = tmp_factory.getbasetemp() # Before - simulate bad perms. os.chmod(basetemp.parent, 0o777) assert (basetemp.parent.stat().st_mode & 0o077) != 0 - tmp_factory = TempPathFactory(None, 3, "failed", lambda *args: None, _ispytest=True) + tmp_factory = TempPathFactory(None, 3, "all", lambda *args: None, _ispytest=True) basetemp = tmp_factory.getbasetemp() # After - fixed. From 61f70a5a759bd22457c89f3564c0cfbb91b0cd8d Mon Sep 17 00:00:00 2001 From: Daniel Garcia Moreno Date: Wed, 4 Jan 2023 09:29:53 +0100 Subject: [PATCH 477/549] Fix tests pygments 2.14.0 Fix https://github.com/pytest-dev/pytest/issues/10630 --- testing/conftest.py | 1 + testing/io/test_terminalwriter.py | 2 +- testing/test_terminal.py | 24 ++++++++++++------------ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/testing/conftest.py b/testing/conftest.py index 107aad86b25..8a9816799d9 100644 --- a/testing/conftest.py +++ b/testing/conftest.py @@ -157,6 +157,7 @@ class ColorMapping: "number": "\x1b[94m", "str": "\x1b[33m", "print": "\x1b[96m", + "endline": "\x1b[90m\x1b[39;49;00m", } RE_COLORS = {k: re.escape(v) for k, v in COLORS.items()} diff --git a/testing/io/test_terminalwriter.py b/testing/io/test_terminalwriter.py index 6fe718b5341..b5a04a99f18 100644 --- a/testing/io/test_terminalwriter.py +++ b/testing/io/test_terminalwriter.py @@ -254,7 +254,7 @@ def test_combining(self) -> None: pytest.param( True, True, - "{kw}assert{hl-reset} {number}0{hl-reset}\n", + "{kw}assert{hl-reset} {number}0{hl-reset}{endline}\n", id="with markup and code_highlight", ), pytest.param( diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 9de9a85f093..453f183236f 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -1265,14 +1265,14 @@ def test_this(): "=*= FAILURES =*=", "{red}{bold}_*_ test_this _*_{reset}", "", - " {kw}def{hl-reset} {function}test_this{hl-reset}():", - "> fail()", + " {kw}def{hl-reset} {function}test_this{hl-reset}():{endline}", + "> fail(){endline}", "", "{bold}{red}test_color_yes.py{reset}:5: ", "_ _ * _ _*", "", - " {kw}def{hl-reset} {function}fail{hl-reset}():", - "> {kw}assert{hl-reset} {number}0{hl-reset}", + " {kw}def{hl-reset} {function}fail{hl-reset}():{endline}", + "> {kw}assert{hl-reset} {number}0{hl-reset}{endline}", "{bold}{red}E assert 0{reset}", "", "{bold}{red}test_color_yes.py{reset}:2: AssertionError", @@ -1292,9 +1292,9 @@ def test_this(): "=*= FAILURES =*=", "{red}{bold}_*_ test_this _*_{reset}", "{bold}{red}test_color_yes.py{reset}:5: in test_this", - " fail()", + " fail(){endline}", "{bold}{red}test_color_yes.py{reset}:2: in fail", - " {kw}assert{hl-reset} {number}0{hl-reset}", + " {kw}assert{hl-reset} {number}0{hl-reset}{endline}", "{bold}{red}E assert 0{reset}", "{red}=*= {red}{bold}1 failed{reset}{red} in *s{reset}{red} =*={reset}", ] @@ -2472,8 +2472,8 @@ def test_foo(): result.stdout.fnmatch_lines( color_mapping.format_for_fnmatch( [ - " {kw}def{hl-reset} {function}test_foo{hl-reset}():", - "> {kw}assert{hl-reset} {number}1{hl-reset} == {number}10{hl-reset}", + " {kw}def{hl-reset} {function}test_foo{hl-reset}():{endline}", + "> {kw}assert{hl-reset} {number}1{hl-reset} == {number}10{hl-reset}{endline}", "{bold}{red}E assert 1 == 10{reset}", ] ) @@ -2494,9 +2494,9 @@ def test_foo(): result.stdout.fnmatch_lines( color_mapping.format_for_fnmatch( [ - " {kw}def{hl-reset} {function}test_foo{hl-reset}():", + " {kw}def{hl-reset} {function}test_foo{hl-reset}():{endline}", " {print}print{hl-reset}({str}'''{hl-reset}{str}{hl-reset}", - "> {str} {hl-reset}{str}'''{hl-reset}); {kw}assert{hl-reset} {number}0{hl-reset}", + "> {str} {hl-reset}{str}'''{hl-reset}); {kw}assert{hl-reset} {number}0{hl-reset}{endline}", "{bold}{red}E assert 0{reset}", ] ) @@ -2517,8 +2517,8 @@ def test_foo(): result.stdout.fnmatch_lines( color_mapping.format_for_fnmatch( [ - " {kw}def{hl-reset} {function}test_foo{hl-reset}():", - "> {kw}assert{hl-reset} {number}1{hl-reset} == {number}10{hl-reset}", + " {kw}def{hl-reset} {function}test_foo{hl-reset}():{endline}", + "> {kw}assert{hl-reset} {number}1{hl-reset} == {number}10{hl-reset}{endline}", "{bold}{red}E assert 1 == 10{reset}", ] ) From 3ad4344656e8abe95d5b86cd83087836ae9cdaa5 Mon Sep 17 00:00:00 2001 From: Kadino Date: Fri, 6 Jan 2023 04:12:24 -0800 Subject: [PATCH 478/549] Mitigate directory creation race condition (#10607) Fixes https://github.com/pytest-dev/pytest/issues/10604 which could intermittently display unexpected behavior between checking if the path exists and requesting creation. This was fairly prevalent when pytest was being invoked in parallel by another test runner (CTest) and trying to create the same parent-folder for multiple XMLs. A modest amount of testing did not reproduce other filesystem race conditions. This notably does not work around an edge case where the parent path of the XML could be created as a file instead of a folder or link. That vanishingly rare case should cause file creation to fail on the next line, with a fairly obvious exception message. --- changelog/10607.bugfix.rst | 1 + src/_pytest/junitxml.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelog/10607.bugfix.rst diff --git a/changelog/10607.bugfix.rst b/changelog/10607.bugfix.rst new file mode 100644 index 00000000000..e89504695c2 --- /dev/null +++ b/changelog/10607.bugfix.rst @@ -0,0 +1 @@ +Fix a race condition when creating junitxml reports, which could occur when multiple instances of pytest execute in parallel. diff --git a/src/_pytest/junitxml.py b/src/_pytest/junitxml.py index 7a5170f328b..9242d46d9df 100644 --- a/src/_pytest/junitxml.py +++ b/src/_pytest/junitxml.py @@ -645,8 +645,8 @@ def pytest_sessionstart(self) -> None: def pytest_sessionfinish(self) -> None: dirname = os.path.dirname(os.path.abspath(self.logfile)) - if not os.path.isdir(dirname): - os.makedirs(dirname) + # exist_ok avoids filesystem race conditions between checking path existence and requesting creation + os.makedirs(dirname, exist_ok=True) with open(self.logfile, "w", encoding="utf-8") as logfile: suite_stop_time = timing.time() From 8efb4bb9c1339b5ae6403d56e533a14a428102cf Mon Sep 17 00:00:00 2001 From: s-padmanaban <73488630+s-padmanaban@users.noreply.github.com> Date: Fri, 13 Jan 2023 02:14:52 -0800 Subject: [PATCH 479/549] Do not update cache from xdist worker (#10641) --- AUTHORS | 1 + changelog/10641.bugfix.rst | 1 + src/_pytest/stepwise.py | 8 ++++ testing/test_stepwise.py | 77 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 87 insertions(+) create mode 100644 changelog/10641.bugfix.rst diff --git a/AUTHORS b/AUTHORS index a4ca9926760..7cf1748e606 100644 --- a/AUTHORS +++ b/AUTHORS @@ -315,6 +315,7 @@ Samuel Searles-Bryant Samuele Pedroni Sanket Duthade Sankt Petersbug +Saravanan Padmanaban Segev Finer Serhii Mozghovyi Seth Junot diff --git a/changelog/10641.bugfix.rst b/changelog/10641.bugfix.rst new file mode 100644 index 00000000000..ac293f6ae68 --- /dev/null +++ b/changelog/10641.bugfix.rst @@ -0,0 +1 @@ +Fix a race condition when creating or updating the stepwise plugin's cache, which could occur when multiple xdist worker nodes try to simultaneously update the stepwise plugin's cache. diff --git a/src/_pytest/stepwise.py b/src/_pytest/stepwise.py index 84f1a6ce8fe..74ad9dbd4dd 100644 --- a/src/_pytest/stepwise.py +++ b/src/_pytest/stepwise.py @@ -48,6 +48,10 @@ def pytest_configure(config: Config) -> None: def pytest_sessionfinish(session: Session) -> None: if not session.config.getoption("stepwise"): assert session.config.cache is not None + if hasattr(session.config, "workerinput"): + # Do not update cache if this process is a xdist worker to prevent + # race conditions (#10641). + return # Clear the list of failing tests if the plugin is not active. session.config.cache.set(STEPWISE_CACHE_DIR, []) @@ -119,4 +123,8 @@ def pytest_report_collectionfinish(self) -> Optional[str]: return None def pytest_sessionfinish(self) -> None: + if hasattr(self.config, "workerinput"): + # Do not update cache if this process is a xdist worker to prevent + # race conditions (#10641). + return self.cache.set(STEPWISE_CACHE_DIR, self.lastfailed) diff --git a/testing/test_stepwise.py b/testing/test_stepwise.py index 20781d42cce..2094abc4e50 100644 --- a/testing/test_stepwise.py +++ b/testing/test_stepwise.py @@ -1,6 +1,10 @@ +from pathlib import Path + import pytest +from _pytest.cacheprovider import Cache from _pytest.monkeypatch import MonkeyPatch from _pytest.pytester import Pytester +from _pytest.stepwise import STEPWISE_CACHE_DIR @pytest.fixture @@ -278,3 +282,76 @@ def test_three(): def test_sw_skip_help(pytester: Pytester) -> None: result = pytester.runpytest("-h") result.stdout.fnmatch_lines("*Implicitly enables --stepwise.") + + +def test_stepwise_xdist_dont_store_lastfailed(pytester: Pytester) -> None: + pytester.makefile( + ext=".ini", + pytest=f"[pytest]\ncache_dir = {pytester.path}\n", + ) + + pytester.makepyfile( + conftest=""" +import pytest + +@pytest.hookimpl(tryfirst=True) +def pytest_configure(config) -> None: + config.workerinput = True +""" + ) + pytester.makepyfile( + test_one=""" +def test_one(): + assert False +""" + ) + result = pytester.runpytest("--stepwise") + assert result.ret == pytest.ExitCode.INTERRUPTED + + stepwise_cache_file = ( + pytester.path / Cache._CACHE_PREFIX_VALUES / STEPWISE_CACHE_DIR + ) + assert not Path(stepwise_cache_file).exists() + + +def test_disabled_stepwise_xdist_dont_clear_cache(pytester: Pytester) -> None: + pytester.makefile( + ext=".ini", + pytest=f"[pytest]\ncache_dir = {pytester.path}\n", + ) + + stepwise_cache_file = ( + pytester.path / Cache._CACHE_PREFIX_VALUES / STEPWISE_CACHE_DIR + ) + stepwise_cache_dir = stepwise_cache_file.parent + stepwise_cache_dir.mkdir(exist_ok=True, parents=True) + + stepwise_cache_file_relative = f"{Cache._CACHE_PREFIX_VALUES}/{STEPWISE_CACHE_DIR}" + + expected_value = '"test_one.py::test_one"' + content = {f"{stepwise_cache_file_relative}": expected_value} + + pytester.makefile(ext="", **content) + + pytester.makepyfile( + conftest=""" +import pytest + +@pytest.hookimpl(tryfirst=True) +def pytest_configure(config) -> None: + config.workerinput = True +""" + ) + pytester.makepyfile( + test_one=""" +def test_one(): + assert True +""" + ) + result = pytester.runpytest() + assert result.ret == 0 + + assert Path(stepwise_cache_file).exists() + with stepwise_cache_file.open() as file_handle: + observed_value = file_handle.readlines() + assert [expected_value] == observed_value From 5e0583f4b9b9026185dc47865b7db60780437b0a Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 13 Jan 2023 07:15:41 -0300 Subject: [PATCH 480/549] Fix regen tox environment (#10640) Since tox 4.0, the whitelist_external option has been renamed to allowlist_externals. Co-authored-by: pytest bot --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index f619287fbcb..663ada60caf 100644 --- a/tox.ini +++ b/tox.ini @@ -104,7 +104,7 @@ deps = PyYAML regendoc>=0.8.1 sphinx -whitelist_externals = +allowlist_externals = make commands = make regen From 7421f3bb94df80ff2d131e932223b190f9b6d7b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Jan 2023 07:16:43 -0300 Subject: [PATCH 481/549] build(deps): Bump django in /testing/plugins_integration (#10643) Bumps [django](https://github.com/django/django) from 4.1.3 to 4.1.5. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/4.1.3...4.1.5) --- updated-dependencies: - dependency-name: django dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 237e43ac07d..7e7a5d63398 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.6.2 -django==4.1.3 +django==4.1.5 pytest-asyncio==0.20.2 pytest-bdd==6.1.1 pytest-cov==4.0.0 From 1a96f16401c7bf10d4873f54b02f7bbbf94f492d Mon Sep 17 00:00:00 2001 From: Ilya Konstantinov Date: Fri, 13 Jan 2023 09:29:38 -0500 Subject: [PATCH 482/549] Derive pytest.raises from AbstractContextManager Makes `AbstractContextManager` the shared base class between "raises" and other context managers. The motivation is for type checkers to narrow `pytest.raises(...) if x else nullcontext()` to a `ContextManager` rather than `object`. --- changelog/10660.bugfix.rst | 2 ++ src/_pytest/python_api.py | 4 ++-- testing/typing_checks.py | 11 +++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 changelog/10660.bugfix.rst diff --git a/changelog/10660.bugfix.rst b/changelog/10660.bugfix.rst new file mode 100644 index 00000000000..62e3549413b --- /dev/null +++ b/changelog/10660.bugfix.rst @@ -0,0 +1,2 @@ +Fix :py:func:`pytest.raises` to return a 'ContextManager' so that type-checkers could narrow +:code:`pytest.raises(...) if ... else nullcontext()` down to 'ContextManager' rather than 'object'. diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index ea45753cde6..4bc9348613a 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -8,7 +8,7 @@ from typing import Any from typing import Callable from typing import cast -from typing import Generic +from typing import ContextManager from typing import List from typing import Mapping from typing import Optional @@ -957,7 +957,7 @@ def raises( # noqa: F811 @final -class RaisesContext(Generic[E]): +class RaisesContext(ContextManager[_pytest._code.ExceptionInfo[E]]): def __init__( self, expected_exception: Union[Type[E], Tuple[Type[E], ...]], diff --git a/testing/typing_checks.py b/testing/typing_checks.py index 0a6b5ad2841..d15b3988bb5 100644 --- a/testing/typing_checks.py +++ b/testing/typing_checks.py @@ -3,6 +3,11 @@ This file is not executed, it is only checked by mypy to ensure that none of the code triggers any mypy errors. """ +import contextlib +from typing import Optional + +from typing_extensions import assert_type + import pytest @@ -22,3 +27,9 @@ def check_fixture_ids_callable() -> None: @pytest.mark.parametrize("func", [str, int], ids=lambda x: str(x.__name__)) def check_parametrize_ids_callable(func) -> None: pass + + +def check_raises_is_a_context_manager(val: bool) -> None: + with pytest.raises(RuntimeError) if val else contextlib.nullcontext() as excinfo: + pass + assert_type(excinfo, Optional[pytest.ExceptionInfo[RuntimeError]]) From b2ac31cc9fd7191134fca7fd44f177fa645f4465 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sat, 14 Jan 2023 09:20:20 -0300 Subject: [PATCH 483/549] Merge pull request #10659 from pytest-dev/release-7.2.1 Prepare release 7.2.1 (cherry picked from commit 94c05bc2a489a3d6eb5cb47991741f8a61bb4099) --- changelog/10452.bugfix.rst | 1 - changelog/10457.bugfix.rst | 1 - changelog/10506.bugfix.rst | 1 - changelog/10607.bugfix.rst | 1 - changelog/10641.bugfix.rst | 1 - doc/en/announce/index.rst | 1 + doc/en/announce/release-7.2.1.rst | 25 +++++++++++++++++++++++++ doc/en/builtin.rst | 2 +- doc/en/changelog.rst | 21 +++++++++++++++++++++ doc/en/example/parametrize.rst | 8 ++++---- doc/en/getting-started.rst | 2 +- 11 files changed, 53 insertions(+), 11 deletions(-) delete mode 100644 changelog/10452.bugfix.rst delete mode 100644 changelog/10457.bugfix.rst delete mode 100644 changelog/10506.bugfix.rst delete mode 100644 changelog/10607.bugfix.rst delete mode 100644 changelog/10641.bugfix.rst create mode 100644 doc/en/announce/release-7.2.1.rst diff --git a/changelog/10452.bugfix.rst b/changelog/10452.bugfix.rst deleted file mode 100644 index d8f7dded455..00000000000 --- a/changelog/10452.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix 'importlib.abc.TraversableResources' deprecation warning in Python 3.12. diff --git a/changelog/10457.bugfix.rst b/changelog/10457.bugfix.rst deleted file mode 100644 index 26522e9f0e1..00000000000 --- a/changelog/10457.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -If a test is skipped from inside a fixture, the test summary now shows the test location instead of the fixture location. diff --git a/changelog/10506.bugfix.rst b/changelog/10506.bugfix.rst deleted file mode 100644 index 6b161f69282..00000000000 --- a/changelog/10506.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix bug where sometimes pytest would use the file system root directory as :ref:`rootdir ` on Windows. diff --git a/changelog/10607.bugfix.rst b/changelog/10607.bugfix.rst deleted file mode 100644 index e89504695c2..00000000000 --- a/changelog/10607.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix a race condition when creating junitxml reports, which could occur when multiple instances of pytest execute in parallel. diff --git a/changelog/10641.bugfix.rst b/changelog/10641.bugfix.rst deleted file mode 100644 index ac293f6ae68..00000000000 --- a/changelog/10641.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix a race condition when creating or updating the stepwise plugin's cache, which could occur when multiple xdist worker nodes try to simultaneously update the stepwise plugin's cache. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 021cbd1af39..4df3228822c 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-7.2.1 release-7.2.0 release-7.1.3 release-7.1.2 diff --git a/doc/en/announce/release-7.2.1.rst b/doc/en/announce/release-7.2.1.rst new file mode 100644 index 00000000000..80ac7aff07f --- /dev/null +++ b/doc/en/announce/release-7.2.1.rst @@ -0,0 +1,25 @@ +pytest-7.2.1 +======================================= + +pytest 7.2.1 has just been released to PyPI. + +This is a bug-fix release, being a drop-in replacement. To upgrade:: + + pip install --upgrade pytest + +The full changelog is available at https://docs.pytest.org/en/stable/changelog.html. + +Thanks to all of the contributors to this release: + +* Anthony Sottile +* Bruno Oliveira +* Daniel Valenzuela +* Kadino +* Prerak Patel +* Ronny Pfannschmidt +* Santiago Castro +* s-padmanaban + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index 1f55ea156fc..4b6d8d84457 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -119,7 +119,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a For more details: :ref:`doctest_namespace`. - pytestconfig [session scope] -- .../_pytest/fixtures.py:1351 + pytestconfig [session scope] -- .../_pytest/fixtures.py:1356 Session-scoped fixture that returns the session's :class:`pytest.Config` object. diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index e922dff71da..988e083d0e5 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -28,6 +28,27 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 7.2.1 (2023-01-13) +========================= + +Bug Fixes +--------- + +- `#10452 `_: Fix 'importlib.abc.TraversableResources' deprecation warning in Python 3.12. + + +- `#10457 `_: If a test is skipped from inside a fixture, the test summary now shows the test location instead of the fixture location. + + +- `#10506 `_: Fix bug where sometimes pytest would use the file system root directory as :ref:`rootdir ` on Windows. + + +- `#10607 `_: Fix a race condition when creating junitxml reports, which could occur when multiple instances of pytest execute in parallel. + + +- `#10641 `_: Fix a race condition when creating or updating the stepwise plugin's cache, which could occur when multiple xdist worker nodes try to simultaneously update the stepwise plugin's cache. + + pytest 7.2.0 (2022-10-23) ========================= diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index f8147683975..df2859b14e0 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -504,9 +504,9 @@ Running it results in some skips if we don't have all the python interpreters in . $ pytest -rs -q multipython.py sssssssssssssssssssssssssss [100%] ========================= short test summary info ========================== - SKIPPED [9] multipython.py:29: 'python3.5' not found - SKIPPED [9] multipython.py:29: 'python3.6' not found - SKIPPED [9] multipython.py:29: 'python3.7' not found + SKIPPED [9] multipython.py:69: 'python3.5' not found + SKIPPED [9] multipython.py:69: 'python3.6' not found + SKIPPED [9] multipython.py:69: 'python3.7' not found 27 skipped in 0.12s Indirect parametrization of optional implementations/imports @@ -574,7 +574,7 @@ If you run this with reporting for skips enabled: test_module.py .s [100%] ========================= short test summary info ========================== - SKIPPED [1] conftest.py:12: could not import 'opt2': No module named 'opt2' + SKIPPED [1] test_module.py:3: could not import 'opt2': No module named 'opt2' ======================= 1 passed, 1 skipped in 0.12s ======================= You'll see that we don't have an ``opt2`` module and thus the second test run diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index 971982c2ce8..e109839bf3e 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -22,7 +22,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 7.2.0 + pytest 7.2.1 .. _`simpletest`: From 95c62eb527db6fc569427bc090053cd619fb8dd7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jan 2023 03:00:46 +0000 Subject: [PATCH 484/549] build(deps): Bump pytest-rerunfailures in /testing/plugins_integration Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 10.3 to 11.0. - [Release notes](https://github.com/pytest-dev/pytest-rerunfailures/releases) - [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/10.3...11.0) --- updated-dependencies: - dependency-name: pytest-rerunfailures dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 7e7a5d63398..7c20cfe08b7 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -7,7 +7,7 @@ pytest-django==4.5.2 pytest-flakes==4.0.5 pytest-html==3.2.0 pytest-mock==3.10.0 -pytest-rerunfailures==10.3 +pytest-rerunfailures==11.0 pytest-sugar==0.9.5 pytest-trio==0.7.0 pytest-twisted==1.14.0 From 61cfaacec695d91ab3b52477f780db4d441170a4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 17 Jan 2023 12:09:19 +0200 Subject: [PATCH 485/549] [pre-commit.ci] pre-commit autoupdate (#10671) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/asottile/blacken-docs: v1.12.1 → 1.13.0](https://github.com/asottile/blacken-docs/compare/v1.12.1...1.13.0) - [github.com/pre-commit/pygrep-hooks: v1.9.0 → v1.10.0](https://github.com/pre-commit/pygrep-hooks/compare/v1.9.0...v1.10.0) --- .pre-commit-config.yaml | 6 +++--- doc/en/deprecations.rst | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 601b4f8571e..2a92f89b3f8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,10 +7,10 @@ repos: - id: black args: [--safe, --quiet] - repo: https://github.com/asottile/blacken-docs - rev: v1.12.1 + rev: 1.13.0 hooks: - id: blacken-docs - additional_dependencies: [black==20.8b1] + additional_dependencies: [black==22.12.0] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: @@ -54,7 +54,7 @@ repos: - id: setup-cfg-fmt args: ["--max-py-version=3.11", "--include-version-classifiers"] - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.9.0 + rev: v1.10.0 hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy diff --git a/doc/en/deprecations.rst b/doc/en/deprecations.rst index a73c11fb846..4f7830a2791 100644 --- a/doc/en/deprecations.rst +++ b/doc/en/deprecations.rst @@ -1052,7 +1052,7 @@ that are then turned into proper test methods. Example: .. code-block:: python def check(x, y): - assert x ** x == y + assert x**x == y def test_squared(): @@ -1067,7 +1067,7 @@ This form of test function doesn't support fixtures properly, and users should s @pytest.mark.parametrize("x, y", [(2, 4), (3, 9)]) def test_squared(x, y): - assert x ** x == y + assert x**x == y .. _internal classes accessed through node deprecated: From 4d4ed42c34fbd6b30bff1bbdf664aeac3300a83a Mon Sep 17 00:00:00 2001 From: Ramsey <37647536@qq.com> Date: Thu, 19 Jan 2023 20:44:57 +0800 Subject: [PATCH 486/549] Fix crash if `--cache-show` and `--help` are passed at the same time Closes #10592 --- AUTHORS | 1 + changelog/10592.bugfix.rst | 1 + src/_pytest/cacheprovider.py | 3 +-- testing/test_cacheprovider.py | 5 +++++ 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 changelog/10592.bugfix.rst diff --git a/AUTHORS b/AUTHORS index 7cf1748e606..cd5b71ffb1e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -378,6 +378,7 @@ Xixi Zhao Xuan Luong Xuecong Liao Yoav Caspi +Yuliang Shao Yusuke Kadowaki Yuval Shimon Zac Hatfield-Dodds diff --git a/changelog/10592.bugfix.rst b/changelog/10592.bugfix.rst new file mode 100644 index 00000000000..62c1c7e3c34 --- /dev/null +++ b/changelog/10592.bugfix.rst @@ -0,0 +1 @@ +Fixed crash if `--cache-show` and `--help` are passed at the same time. diff --git a/src/_pytest/cacheprovider.py b/src/_pytest/cacheprovider.py index 777c1b0b05a..c236dd4176b 100755 --- a/src/_pytest/cacheprovider.py +++ b/src/_pytest/cacheprovider.py @@ -32,7 +32,6 @@ from _pytest.python import Package from _pytest.reports import TestReport - README_CONTENT = """\ # pytest cache directory # @@ -492,7 +491,7 @@ def pytest_addoption(parser: Parser) -> None: def pytest_cmdline_main(config: Config) -> Optional[Union[int, ExitCode]]: - if config.option.cacheshow: + if config.option.cacheshow and not config.option.help: from _pytest.main import wrap_session return wrap_session(config, cacheshow) diff --git a/testing/test_cacheprovider.py b/testing/test_cacheprovider.py index 2baa3c8f189..c381a8448ce 100644 --- a/testing/test_cacheprovider.py +++ b/testing/test_cacheprovider.py @@ -1249,3 +1249,8 @@ def test_cachedir_tag(pytester: Pytester) -> None: cache.set("foo", "bar") cachedir_tag_path = cache._cachedir.joinpath("CACHEDIR.TAG") assert cachedir_tag_path.read_bytes() == CACHEDIR_TAG_CONTENT + + +def test_clioption_with_cacheshow_and_help(pytester: Pytester) -> None: + result = pytester.runpytest("--cache-show", "--help") + assert result.ret == 0 From 310b67b2271cb05f575054c1cdd2ece2412c89a2 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 20 Jan 2023 11:13:36 +0200 Subject: [PATCH 487/549] Drop attrs dependency, use dataclasses instead (#10669) Since pytest now requires Python>=3.7, we can use the stdlib attrs clone, dataclasses, instead of the OG package. attrs is still somewhat nicer than dataclasses and has some extra functionality, but for pytest usage there's not really a justification IMO to impose the extra dependency on users when a standard alternative exists. --- changelog/10669.trivial.rst | 1 + setup.cfg | 2 +- src/_pytest/_code/code.py | 64 ++++++++++++++++++++-------------- src/_pytest/cacheprovider.py | 11 +++--- src/_pytest/compat.py | 7 ++-- src/_pytest/config/__init__.py | 21 +++++++---- src/_pytest/fixtures.py | 28 ++++++++------- src/_pytest/legacypath.py | 4 +-- src/_pytest/main.py | 7 ++-- src/_pytest/mark/__init__.py | 11 +++--- src/_pytest/mark/expression.py | 6 ++-- src/_pytest/mark/structures.py | 15 ++++---- src/_pytest/python.py | 33 +++++++++++------- src/_pytest/reports.py | 16 +++++---- src/_pytest/runner.py | 5 ++- src/_pytest/skipping.py | 9 ++--- src/_pytest/terminal.py | 4 +-- src/_pytest/tmpdir.py | 16 +++++---- src/_pytest/warning_types.py | 5 ++- testing/acceptance_test.py | 25 +++++++------ testing/conftest.py | 13 ++++--- testing/python/metafunc.py | 14 ++++---- testing/test_config.py | 19 +++++----- testing/test_pathlib.py | 8 ++--- testing/test_tmpdir.py | 14 ++++---- 25 files changed, 199 insertions(+), 159 deletions(-) create mode 100644 changelog/10669.trivial.rst diff --git a/changelog/10669.trivial.rst b/changelog/10669.trivial.rst new file mode 100644 index 00000000000..6cebe12ec26 --- /dev/null +++ b/changelog/10669.trivial.rst @@ -0,0 +1 @@ +pytest no longer depends on the `attrs` package (don't worry, nice diffs for attrs classes are still supported). diff --git a/setup.cfg b/setup.cfg index 261ffec8f3c..56dadae7bf5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -44,7 +44,6 @@ packages = pytest py_modules = py install_requires = - attrs>=19.2.0 iniconfig packaging pluggy>=0.12,<2.0 @@ -68,6 +67,7 @@ console_scripts = [options.extras_require] testing = argcomplete + attrs>=19.2.0 hypothesis>=3.56 mock nose diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index 97985def1c3..44ce8fac91a 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -1,4 +1,5 @@ import ast +import dataclasses import inspect import os import re @@ -32,7 +33,6 @@ from typing import Union from weakref import ref -import attr import pluggy import _pytest @@ -445,7 +445,7 @@ def recursionindex(self) -> Optional[int]: @final -@attr.s(repr=False, init=False, auto_attribs=True) +@dataclasses.dataclass class ExceptionInfo(Generic[E]): """Wraps sys.exc_info() objects and offers help for navigating the traceback.""" @@ -649,12 +649,12 @@ def getrepr( """ if style == "native": return ReprExceptionInfo( - ReprTracebackNative( + reprtraceback=ReprTracebackNative( traceback.format_exception( self.type, self.value, self.traceback[0]._rawentry ) ), - self._getreprcrash(), + reprcrash=self._getreprcrash(), ) fmt = FormattedExcinfo( @@ -684,7 +684,7 @@ def match(self, regexp: Union[str, Pattern[str]]) -> "Literal[True]": return True -@attr.s(auto_attribs=True) +@dataclasses.dataclass class FormattedExcinfo: """Presenting information about failing Functions and Generators.""" @@ -699,8 +699,8 @@ class FormattedExcinfo: funcargs: bool = False truncate_locals: bool = True chain: bool = True - astcache: Dict[Union[str, Path], ast.AST] = attr.ib( - factory=dict, init=False, repr=False + astcache: Dict[Union[str, Path], ast.AST] = dataclasses.field( + default_factory=dict, init=False, repr=False ) def _getindent(self, source: "Source") -> int: @@ -978,7 +978,7 @@ def repr_excinfo( return ExceptionChainRepr(repr_chain) -@attr.s(eq=False, auto_attribs=True) +@dataclasses.dataclass(eq=False) class TerminalRepr: def __str__(self) -> str: # FYI this is called from pytest-xdist's serialization of exception @@ -996,14 +996,14 @@ def toterminal(self, tw: TerminalWriter) -> None: # This class is abstract -- only subclasses are instantiated. -@attr.s(eq=False) +@dataclasses.dataclass(eq=False) class ExceptionRepr(TerminalRepr): # Provided by subclasses. - reprcrash: Optional["ReprFileLocation"] reprtraceback: "ReprTraceback" - - def __attrs_post_init__(self) -> None: - self.sections: List[Tuple[str, str, str]] = [] + reprcrash: Optional["ReprFileLocation"] + sections: List[Tuple[str, str, str]] = dataclasses.field( + init=False, default_factory=list + ) def addsection(self, name: str, content: str, sep: str = "-") -> None: self.sections.append((name, content, sep)) @@ -1014,16 +1014,23 @@ def toterminal(self, tw: TerminalWriter) -> None: tw.line(content) -@attr.s(eq=False, auto_attribs=True) +@dataclasses.dataclass(eq=False) class ExceptionChainRepr(ExceptionRepr): chain: Sequence[Tuple["ReprTraceback", Optional["ReprFileLocation"], Optional[str]]] - def __attrs_post_init__(self) -> None: - super().__attrs_post_init__() + def __init__( + self, + chain: Sequence[ + Tuple["ReprTraceback", Optional["ReprFileLocation"], Optional[str]] + ], + ) -> None: # reprcrash and reprtraceback of the outermost (the newest) exception # in the chain. - self.reprtraceback = self.chain[-1][0] - self.reprcrash = self.chain[-1][1] + super().__init__( + reprtraceback=chain[-1][0], + reprcrash=chain[-1][1], + ) + self.chain = chain def toterminal(self, tw: TerminalWriter) -> None: for element in self.chain: @@ -1034,7 +1041,7 @@ def toterminal(self, tw: TerminalWriter) -> None: super().toterminal(tw) -@attr.s(eq=False, auto_attribs=True) +@dataclasses.dataclass(eq=False) class ReprExceptionInfo(ExceptionRepr): reprtraceback: "ReprTraceback" reprcrash: "ReprFileLocation" @@ -1044,7 +1051,7 @@ def toterminal(self, tw: TerminalWriter) -> None: super().toterminal(tw) -@attr.s(eq=False, auto_attribs=True) +@dataclasses.dataclass(eq=False) class ReprTraceback(TerminalRepr): reprentries: Sequence[Union["ReprEntry", "ReprEntryNative"]] extraline: Optional[str] @@ -1073,12 +1080,12 @@ def toterminal(self, tw: TerminalWriter) -> None: class ReprTracebackNative(ReprTraceback): def __init__(self, tblines: Sequence[str]) -> None: - self.style = "native" self.reprentries = [ReprEntryNative(tblines)] self.extraline = None + self.style = "native" -@attr.s(eq=False, auto_attribs=True) +@dataclasses.dataclass(eq=False) class ReprEntryNative(TerminalRepr): lines: Sequence[str] @@ -1088,7 +1095,7 @@ def toterminal(self, tw: TerminalWriter) -> None: tw.write("".join(self.lines)) -@attr.s(eq=False, auto_attribs=True) +@dataclasses.dataclass(eq=False) class ReprEntry(TerminalRepr): lines: Sequence[str] reprfuncargs: Optional["ReprFuncArgs"] @@ -1168,12 +1175,15 @@ def __str__(self) -> str: ) -@attr.s(eq=False, auto_attribs=True) +@dataclasses.dataclass(eq=False) class ReprFileLocation(TerminalRepr): - path: str = attr.ib(converter=str) + path: str lineno: int message: str + def __post_init__(self) -> None: + self.path = str(self.path) + def toterminal(self, tw: TerminalWriter) -> None: # Filename and lineno output for each entry, using an output format # that most editors understand. @@ -1185,7 +1195,7 @@ def toterminal(self, tw: TerminalWriter) -> None: tw.line(f":{self.lineno}: {msg}") -@attr.s(eq=False, auto_attribs=True) +@dataclasses.dataclass(eq=False) class ReprLocals(TerminalRepr): lines: Sequence[str] @@ -1194,7 +1204,7 @@ def toterminal(self, tw: TerminalWriter, indent="") -> None: tw.line(indent + line) -@attr.s(eq=False, auto_attribs=True) +@dataclasses.dataclass(eq=False) class ReprFuncArgs(TerminalRepr): args: Sequence[Tuple[str, object]] diff --git a/src/_pytest/cacheprovider.py b/src/_pytest/cacheprovider.py index c236dd4176b..719b32f7e0e 100755 --- a/src/_pytest/cacheprovider.py +++ b/src/_pytest/cacheprovider.py @@ -1,6 +1,7 @@ """Implementation of the cache provider.""" # This plugin was not named "cache" to avoid conflicts with the external # pytest-cache version. +import dataclasses import json import os from pathlib import Path @@ -12,8 +13,6 @@ from typing import Set from typing import Union -import attr - from .pathlib import resolve_from_str from .pathlib import rm_rf from .reports import CollectReport @@ -52,10 +51,12 @@ @final -@attr.s(init=False, auto_attribs=True) +@dataclasses.dataclass class Cache: - _cachedir: Path = attr.ib(repr=False) - _config: Config = attr.ib(repr=False) + """Instance of the `cache` fixture.""" + + _cachedir: Path = dataclasses.field(repr=False) + _config: Config = dataclasses.field(repr=False) # Sub-directory under cache-dir for directories created by `mkdir()`. _CACHE_PREFIX_DIRS = "d" diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index 211407b2374..6cede213337 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -1,4 +1,5 @@ """Python version compatibility code.""" +import dataclasses import enum import functools import inspect @@ -17,8 +18,6 @@ from typing import TypeVar from typing import Union -import attr - import py # fmt: off @@ -253,7 +252,7 @@ def ascii_escaped(val: Union[bytes, str]) -> str: return _translate_non_printable(ret) -@attr.s +@dataclasses.dataclass class _PytestWrapper: """Dummy wrapper around a function object for internal use only. @@ -262,7 +261,7 @@ class _PytestWrapper: decorator to issue warnings when the fixture function is called directly. """ - obj = attr.ib() + obj: Any def get_real_func(obj): diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 25f156f8b20..5c0c62108a5 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -2,6 +2,7 @@ import argparse import collections.abc import copy +import dataclasses import enum import glob import inspect @@ -34,7 +35,6 @@ from typing import TYPE_CHECKING from typing import Union -import attr from pluggy import HookimplMarker from pluggy import HookspecMarker from pluggy import PluginManager @@ -886,10 +886,6 @@ def _iter_rewritable_modules(package_files: Iterable[str]) -> Iterator[str]: yield from _iter_rewritable_modules(new_package_files) -def _args_converter(args: Iterable[str]) -> Tuple[str, ...]: - return tuple(args) - - @final class Config: """Access to configuration values, pluginmanager and plugin hooks. @@ -903,7 +899,7 @@ class Config: """ @final - @attr.s(frozen=True, auto_attribs=True) + @dataclasses.dataclass(frozen=True) class InvocationParams: """Holds parameters passed during :func:`pytest.main`. @@ -919,13 +915,24 @@ class InvocationParams: Plugins accessing ``InvocationParams`` must be aware of that. """ - args: Tuple[str, ...] = attr.ib(converter=_args_converter) + args: Tuple[str, ...] """The command-line arguments as passed to :func:`pytest.main`.""" plugins: Optional[Sequence[Union[str, _PluggyPlugin]]] """Extra plugins, might be `None`.""" dir: Path """The directory from which :func:`pytest.main` was invoked.""" + def __init__( + self, + *, + args: Iterable[str], + plugins: Optional[Sequence[Union[str, _PluggyPlugin]]], + dir: Path, + ) -> None: + object.__setattr__(self, "args", tuple(args)) + object.__setattr__(self, "plugins", plugins) + object.__setattr__(self, "dir", dir) + class ArgsSource(enum.Enum): """Indicates the source of the test arguments. diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 7ef261b969a..007245b241c 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -1,3 +1,4 @@ +import dataclasses import functools import inspect import os @@ -28,8 +29,6 @@ from typing import TypeVar from typing import Union -import attr - import _pytest from _pytest import nodes from _pytest._code import getfslineno @@ -103,7 +102,7 @@ ] -@attr.s(frozen=True, auto_attribs=True) +@dataclasses.dataclass(frozen=True) class PseudoFixtureDef(Generic[FixtureValue]): cached_result: "_FixtureCachedResult[FixtureValue]" _scope: Scope @@ -350,8 +349,10 @@ def get_direct_param_fixture_func(request: "FixtureRequest") -> Any: return request.param -@attr.s(slots=True, auto_attribs=True) +@dataclasses.dataclass class FuncFixtureInfo: + __slots__ = ("argnames", "initialnames", "names_closure", "name2fixturedefs") + # Original function argument names. argnames: Tuple[str, ...] # Argnames that function immediately requires. These include argnames + @@ -1181,19 +1182,21 @@ def result(*args, **kwargs): @final -@attr.s(frozen=True, auto_attribs=True) +@dataclasses.dataclass(frozen=True) class FixtureFunctionMarker: scope: "Union[_ScopeName, Callable[[str, Config], _ScopeName]]" - params: Optional[Tuple[object, ...]] = attr.ib(converter=_params_converter) + params: Optional[Tuple[object, ...]] autouse: bool = False ids: Optional[ Union[Tuple[Optional[object], ...], Callable[[Any], Optional[object]]] - ] = attr.ib( - default=None, - converter=_ensure_immutable_ids, - ) + ] = None name: Optional[str] = None + _ispytest: dataclasses.InitVar[bool] = False + + def __post_init__(self, _ispytest: bool) -> None: + check_ispytest(_ispytest) + def __call__(self, function: FixtureFunction) -> FixtureFunction: if inspect.isclass(function): raise ValueError("class fixtures not supported (maybe in the future)") @@ -1313,10 +1316,11 @@ def fixture( # noqa: F811 """ fixture_marker = FixtureFunctionMarker( scope=scope, - params=params, + params=tuple(params) if params is not None else None, autouse=autouse, - ids=ids, + ids=None if ids is None else ids if callable(ids) else tuple(ids), name=name, + _ispytest=True, ) # Direct decoration. diff --git a/src/_pytest/legacypath.py b/src/_pytest/legacypath.py index f71e7e96ead..af1d0c07e3c 100644 --- a/src/_pytest/legacypath.py +++ b/src/_pytest/legacypath.py @@ -1,4 +1,5 @@ """Add backward compatibility support for the legacy py path type.""" +import dataclasses import shlex import subprocess from pathlib import Path @@ -7,7 +8,6 @@ from typing import TYPE_CHECKING from typing import Union -import attr from iniconfig import SectionWrapper from _pytest.cacheprovider import Cache @@ -268,7 +268,7 @@ def testdir(pytester: Pytester) -> Testdir: @final -@attr.s(init=False, auto_attribs=True) +@dataclasses.dataclass class TempdirFactory: """Backward compatibility wrapper that implements :class:`py.path.local` for :class:`TempPathFactory`. diff --git a/src/_pytest/main.py b/src/_pytest/main.py index 61fb7eaa4e3..5f8ac46895a 100644 --- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -1,5 +1,6 @@ """Core implementation of the testing process: init, session, runtest loop.""" import argparse +import dataclasses import fnmatch import functools import importlib @@ -19,8 +20,6 @@ from typing import TYPE_CHECKING from typing import Union -import attr - import _pytest._code from _pytest import nodes from _pytest.compat import final @@ -442,8 +441,10 @@ class Failed(Exception): """Signals a stop as failed test run.""" -@attr.s(slots=True, auto_attribs=True) +@dataclasses.dataclass class _bestrelpath_cache(Dict[Path, str]): + __slots__ = ("path",) + path: Path def __missing__(self, path: Path) -> str: diff --git a/src/_pytest/mark/__init__.py b/src/_pytest/mark/__init__.py index 6717d1135ee..de46b4c8a75 100644 --- a/src/_pytest/mark/__init__.py +++ b/src/_pytest/mark/__init__.py @@ -1,4 +1,5 @@ """Generic mechanism for marking and selecting python functions.""" +import dataclasses from typing import AbstractSet from typing import Collection from typing import List @@ -6,8 +7,6 @@ from typing import TYPE_CHECKING from typing import Union -import attr - from .expression import Expression from .expression import ParseError from .structures import EMPTY_PARAMETERSET_OPTION @@ -130,7 +129,7 @@ def pytest_cmdline_main(config: Config) -> Optional[Union[int, ExitCode]]: return None -@attr.s(slots=True, auto_attribs=True) +@dataclasses.dataclass class KeywordMatcher: """A matcher for keywords. @@ -145,6 +144,8 @@ class KeywordMatcher: any item, as well as names directly assigned to test functions. """ + __slots__ = ("_names",) + _names: AbstractSet[str] @classmethod @@ -201,13 +202,15 @@ def deselect_by_keyword(items: "List[Item]", config: Config) -> None: items[:] = remaining -@attr.s(slots=True, auto_attribs=True) +@dataclasses.dataclass class MarkMatcher: """A matcher for markers which are present. Tries to match on any marker names, attached to the given colitem. """ + __slots__ = ("own_mark_names",) + own_mark_names: AbstractSet[str] @classmethod diff --git a/src/_pytest/mark/expression.py b/src/_pytest/mark/expression.py index 0a2e7c65676..f82a81d44c5 100644 --- a/src/_pytest/mark/expression.py +++ b/src/_pytest/mark/expression.py @@ -15,6 +15,7 @@ - or/and/not evaluate according to the usual boolean semantics. """ import ast +import dataclasses import enum import re import types @@ -25,8 +26,6 @@ from typing import Optional from typing import Sequence -import attr - __all__ = [ "Expression", @@ -44,8 +43,9 @@ class TokenType(enum.Enum): EOF = "end of input" -@attr.s(frozen=True, slots=True, auto_attribs=True) +@dataclasses.dataclass(frozen=True) class Token: + __slots__ = ("type", "value", "pos") type: TokenType value: str pos: int diff --git a/src/_pytest/mark/structures.py b/src/_pytest/mark/structures.py index 5186c9ea3b6..8dbff1dc93a 100644 --- a/src/_pytest/mark/structures.py +++ b/src/_pytest/mark/structures.py @@ -1,4 +1,5 @@ import collections.abc +import dataclasses import inspect import warnings from typing import Any @@ -20,8 +21,6 @@ from typing import TypeVar from typing import Union -import attr - from .._code import getfslineno from ..compat import ascii_escaped from ..compat import final @@ -191,8 +190,10 @@ def _for_parametrize( @final -@attr.s(frozen=True, init=False, auto_attribs=True) +@dataclasses.dataclass(frozen=True) class Mark: + """A pytest mark.""" + #: Name of the mark. name: str #: Positional arguments of the mark decorator. @@ -201,9 +202,11 @@ class Mark: kwargs: Mapping[str, Any] #: Source Mark for ids with parametrize Marks. - _param_ids_from: Optional["Mark"] = attr.ib(default=None, repr=False) + _param_ids_from: Optional["Mark"] = dataclasses.field(default=None, repr=False) #: Resolved/generated ids with parametrize Marks. - _param_ids_generated: Optional[Sequence[str]] = attr.ib(default=None, repr=False) + _param_ids_generated: Optional[Sequence[str]] = dataclasses.field( + default=None, repr=False + ) def __init__( self, @@ -261,7 +264,7 @@ def combined_with(self, other: "Mark") -> "Mark": Markable = TypeVar("Markable", bound=Union[Callable[..., object], type]) -@attr.s(init=False, auto_attribs=True) +@dataclasses.dataclass class MarkDecorator: """A decorator for applying a mark on test functions and classes. diff --git a/src/_pytest/python.py b/src/_pytest/python.py index e143d28d1d9..b24a3803eb8 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1,4 +1,5 @@ """Python test discovery, setup and run of test functions.""" +import dataclasses import enum import fnmatch import inspect @@ -27,8 +28,6 @@ from typing import TYPE_CHECKING from typing import Union -import attr - import _pytest from _pytest import fixtures from _pytest import nodes @@ -956,10 +955,20 @@ def hasnew(obj: object) -> bool: @final -@attr.s(frozen=True, auto_attribs=True, slots=True) +@dataclasses.dataclass(frozen=True) class IdMaker: """Make IDs for a parametrization.""" + __slots__ = ( + "argnames", + "parametersets", + "idfn", + "ids", + "config", + "nodeid", + "func_name", + ) + # The argnames of the parametrization. argnames: Sequence[str] # The ParameterSets of the parametrization. @@ -1109,7 +1118,7 @@ def _idval_from_argname(argname: str, idx: int) -> str: @final -@attr.s(frozen=True, slots=True, auto_attribs=True) +@dataclasses.dataclass(frozen=True) class CallSpec2: """A planned parameterized invocation of a test function. @@ -1120,18 +1129,18 @@ class CallSpec2: # arg name -> arg value which will be passed to the parametrized test # function (direct parameterization). - funcargs: Dict[str, object] = attr.Factory(dict) + funcargs: Dict[str, object] = dataclasses.field(default_factory=dict) # arg name -> arg value which will be passed to a fixture of the same name # (indirect parametrization). - params: Dict[str, object] = attr.Factory(dict) + params: Dict[str, object] = dataclasses.field(default_factory=dict) # arg name -> arg index. - indices: Dict[str, int] = attr.Factory(dict) + indices: Dict[str, int] = dataclasses.field(default_factory=dict) # Used for sorting parametrized resources. - _arg2scope: Dict[str, Scope] = attr.Factory(dict) + _arg2scope: Dict[str, Scope] = dataclasses.field(default_factory=dict) # Parts which will be added to the item's name in `[..]` separated by "-". - _idlist: List[str] = attr.Factory(list) + _idlist: List[str] = dataclasses.field(default_factory=list) # Marks which will be applied to the item. - marks: List[Mark] = attr.Factory(list) + marks: List[Mark] = dataclasses.field(default_factory=list) def setmulti( self, @@ -1163,9 +1172,9 @@ def setmulti( return CallSpec2( funcargs=funcargs, params=params, - arg2scope=arg2scope, indices=indices, - idlist=[*self._idlist, id], + _arg2scope=arg2scope, + _idlist=[*self._idlist, id], marks=[*self.marks, *normalize_mark_list(marks)], ) diff --git a/src/_pytest/reports.py b/src/_pytest/reports.py index c35f7087e41..1b2821c719a 100644 --- a/src/_pytest/reports.py +++ b/src/_pytest/reports.py @@ -1,3 +1,4 @@ +import dataclasses import os from io import StringIO from pprint import pprint @@ -16,8 +17,6 @@ from typing import TypeVar from typing import Union -import attr - from _pytest._code.code import ExceptionChainRepr from _pytest._code.code import ExceptionInfo from _pytest._code.code import ExceptionRepr @@ -459,15 +458,15 @@ def _report_to_json(report: BaseReport) -> Dict[str, Any]: def serialize_repr_entry( entry: Union[ReprEntry, ReprEntryNative] ) -> Dict[str, Any]: - data = attr.asdict(entry) + data = dataclasses.asdict(entry) for key, value in data.items(): if hasattr(value, "__dict__"): - data[key] = attr.asdict(value) + data[key] = dataclasses.asdict(value) entry_data = {"type": type(entry).__name__, "data": data} return entry_data def serialize_repr_traceback(reprtraceback: ReprTraceback) -> Dict[str, Any]: - result = attr.asdict(reprtraceback) + result = dataclasses.asdict(reprtraceback) result["reprentries"] = [ serialize_repr_entry(x) for x in reprtraceback.reprentries ] @@ -477,7 +476,7 @@ def serialize_repr_crash( reprcrash: Optional[ReprFileLocation], ) -> Optional[Dict[str, Any]]: if reprcrash is not None: - return attr.asdict(reprcrash) + return dataclasses.asdict(reprcrash) else: return None @@ -594,7 +593,10 @@ def deserialize_repr_crash(repr_crash_dict: Optional[Dict[str, Any]]): ExceptionChainRepr, ReprExceptionInfo ] = ExceptionChainRepr(chain) else: - exception_info = ReprExceptionInfo(reprtraceback, reprcrash) + exception_info = ReprExceptionInfo( + reprtraceback=reprtraceback, + reprcrash=reprcrash, + ) for section in reportdict["longrepr"]["sections"]: exception_info.addsection(*section) diff --git a/src/_pytest/runner.py b/src/_pytest/runner.py index cc17cf2f4a8..f861c05a451 100644 --- a/src/_pytest/runner.py +++ b/src/_pytest/runner.py @@ -1,5 +1,6 @@ """Basic collect and runtest protocol implementations.""" import bdb +import dataclasses import os import sys from typing import Callable @@ -14,8 +15,6 @@ from typing import TypeVar from typing import Union -import attr - from .reports import BaseReport from .reports import CollectErrorRepr from .reports import CollectReport @@ -268,7 +267,7 @@ def call_runtest_hook( @final -@attr.s(repr=False, init=False, auto_attribs=True) +@dataclasses.dataclass class CallInfo(Generic[TResult]): """Result/Exception info of a function invocation.""" diff --git a/src/_pytest/skipping.py b/src/_pytest/skipping.py index b20442350d6..26ce73758a0 100644 --- a/src/_pytest/skipping.py +++ b/src/_pytest/skipping.py @@ -1,4 +1,5 @@ """Support for skip/xfail functions and markers.""" +import dataclasses import os import platform import sys @@ -9,8 +10,6 @@ from typing import Tuple from typing import Type -import attr - from _pytest.config import Config from _pytest.config import hookimpl from _pytest.config.argparsing import Parser @@ -157,7 +156,7 @@ def evaluate_condition(item: Item, mark: Mark, condition: object) -> Tuple[bool, return result, reason -@attr.s(slots=True, frozen=True, auto_attribs=True) +@dataclasses.dataclass(frozen=True) class Skip: """The result of evaluate_skip_marks().""" @@ -192,10 +191,12 @@ def evaluate_skip_marks(item: Item) -> Optional[Skip]: return None -@attr.s(slots=True, frozen=True, auto_attribs=True) +@dataclasses.dataclass(frozen=True) class Xfail: """The result of evaluate_xfail_marks().""" + __slots__ = ("reason", "run", "strict", "raises") + reason: str run: bool strict: bool diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index d967a3ee6f1..1b73da89bf4 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -3,6 +3,7 @@ This is a good source for looking at the various reporting hooks. """ import argparse +import dataclasses import datetime import inspect import platform @@ -27,7 +28,6 @@ from typing import TYPE_CHECKING from typing import Union -import attr import pluggy import _pytest._version @@ -287,7 +287,7 @@ def pytest_report_teststatus(report: BaseReport) -> Tuple[str, str, str]: return outcome, letter, outcome.upper() -@attr.s(auto_attribs=True) +@dataclasses.dataclass class WarningReport: """Simple structure to hold warnings information captured by ``pytest_warning_recorded``. diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index 8aca6d9f56c..ec44623dc24 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -1,10 +1,12 @@ """Support for providing temporary directories to test functions.""" +import dataclasses import os import re import sys import tempfile from pathlib import Path from shutil import rmtree +from typing import Any from typing import Dict from typing import Generator from typing import Optional @@ -21,7 +23,6 @@ RetentionType = Literal["all", "failed", "none"] -import attr from _pytest.config.argparsing import Parser from .pathlib import LOCK_TIMEOUT @@ -42,18 +43,19 @@ @final -@attr.s(init=False) +@dataclasses.dataclass class TempPathFactory: """Factory for temporary directories under the common base temp directory. The base directory can be configured using the ``--basetemp`` option. """ - _given_basetemp = attr.ib(type=Optional[Path]) - _trace = attr.ib() - _basetemp = attr.ib(type=Optional[Path]) - _retention_count = attr.ib(type=int) - _retention_policy = attr.ib(type="RetentionType") + _given_basetemp: Optional[Path] + # pluggy TagTracerSub, not currently exposed, so Any. + _trace: Any + _basetemp: Optional[Path] + _retention_count: int + _retention_policy: "RetentionType" def __init__( self, diff --git a/src/_pytest/warning_types.py b/src/_pytest/warning_types.py index 620860c1bc4..86fa9a07e0c 100644 --- a/src/_pytest/warning_types.py +++ b/src/_pytest/warning_types.py @@ -1,3 +1,4 @@ +import dataclasses import inspect import warnings from types import FunctionType @@ -6,8 +7,6 @@ from typing import Type from typing import TypeVar -import attr - from _pytest.compat import final @@ -130,7 +129,7 @@ class PytestUnhandledThreadExceptionWarning(PytestWarning): @final -@attr.s(auto_attribs=True) +@dataclasses.dataclass class UnformattedWarning(Generic[_W]): """A warning meant to be formatted during runtime. diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index c7139b538b2..46352e13015 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -1,9 +1,8 @@ +import dataclasses import os import sys import types -import attr - import pytest from _pytest.compat import importlib_metadata from _pytest.config import ExitCode @@ -115,11 +114,11 @@ def test_early_load_setuptools_name( loaded = [] - @attr.s + @dataclasses.dataclass class DummyEntryPoint: - name = attr.ib() - module = attr.ib() - group = "pytest11" + name: str + module: str + group: str = "pytest11" def load(self): __import__(self.module) @@ -132,10 +131,10 @@ def load(self): DummyEntryPoint("mycov", "mycov_module"), ] - @attr.s + @dataclasses.dataclass class DummyDist: - entry_points = attr.ib() - files = () + entry_points: object + files: object = () def my_dists(): return (DummyDist(entry_points),) @@ -1037,14 +1036,14 @@ def test_fixture_values_leak(pytester: Pytester) -> None: """ pytester.makepyfile( """ - import attr + import dataclasses import gc import pytest import weakref - @attr.s - class SomeObj(object): - name = attr.ib() + @dataclasses.dataclass + class SomeObj: + name: str fix_of_test1_ref = None session_ref = None diff --git a/testing/conftest.py b/testing/conftest.py index 8a9816799d9..a83552fd256 100644 --- a/testing/conftest.py +++ b/testing/conftest.py @@ -1,3 +1,4 @@ +import dataclasses import re import sys from typing import List @@ -192,20 +193,18 @@ def mock_timing(monkeypatch: MonkeyPatch): Time is static, and only advances through `sleep` calls, thus tests might sleep over large numbers and obtain accurate time() calls at the end, making tests reliable and instant. """ - import attr - @attr.s + @dataclasses.dataclass class MockTiming: + _current_time: float = 1590150050.0 - _current_time = attr.ib(default=1590150050.0) - - def sleep(self, seconds): + def sleep(self, seconds: float) -> None: self._current_time += seconds - def time(self): + def time(self) -> float: return self._current_time - def patch(self): + def patch(self) -> None: from _pytest import timing monkeypatch.setattr(timing, "sleep", self.sleep) diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index 2fed22718b0..c1cc9c3d3bb 100644 --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -1,3 +1,4 @@ +import dataclasses import itertools import re import sys @@ -12,7 +13,6 @@ from typing import Tuple from typing import Union -import attr import hypothesis from hypothesis import strategies @@ -39,14 +39,14 @@ class FuncFixtureInfoMock: def __init__(self, names): self.names_closure = names - @attr.s + @dataclasses.dataclass class DefinitionMock(python.FunctionDefinition): - obj = attr.ib() - _nodeid = attr.ib() + _nodeid: str + obj: object names = getfuncargnames(func) fixtureinfo: Any = FuncFixtureInfoMock(names) - definition: Any = DefinitionMock._create(func, "mock::nodeid") + definition: Any = DefinitionMock._create(obj=func, _nodeid="mock::nodeid") return python.Metafunc(definition, fixtureinfo, config, _ispytest=True) def test_no_funcargs(self) -> None: @@ -140,9 +140,9 @@ def test_find_parametrized_scope(self) -> None: """Unit test for _find_parametrized_scope (#3941).""" from _pytest.python import _find_parametrized_scope - @attr.s + @dataclasses.dataclass class DummyFixtureDef: - _scope = attr.ib() + _scope: Scope fixtures_defs = cast( Dict[str, Sequence[fixtures.FixtureDef[object]]], diff --git a/testing/test_config.py b/testing/test_config.py index f5b6d7f9816..db50869c591 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -1,3 +1,4 @@ +import dataclasses import os import re import sys @@ -10,8 +11,6 @@ from typing import Type from typing import Union -import attr - import _pytest._code import pytest from _pytest.compat import importlib_metadata @@ -423,11 +422,11 @@ def test_missing_required_plugins( This test installs a mock "myplugin-1.5" which is used in the parametrized test cases. """ - @attr.s + @dataclasses.dataclass class DummyEntryPoint: - name = attr.ib() - module = attr.ib() - group = "pytest11" + name: str + module: str + group: str = "pytest11" def load(self): __import__(self.module) @@ -437,11 +436,11 @@ def load(self): DummyEntryPoint("myplugin1", "myplugin1_module"), ] - @attr.s + @dataclasses.dataclass class DummyDist: - entry_points = attr.ib() - files = () - version = plugin_version + entry_points: object + files: object = () + version: str = plugin_version @property def metadata(self): diff --git a/testing/test_pathlib.py b/testing/test_pathlib.py index 577c7749fd9..481d7a606b0 100644 --- a/testing/test_pathlib.py +++ b/testing/test_pathlib.py @@ -518,10 +518,10 @@ def test_importmode_importlib_with_pickle_separate_modules( fn1.write_text( dedent( """ - import attr + import dataclasses import pickle - @attr.s(auto_attribs=True) + @dataclasses.dataclass class Data: x: int = 42 """ @@ -533,10 +533,10 @@ class Data: fn2.write_text( dedent( """ - import attr + import dataclasses import pickle - @attr.s(auto_attribs=True) + @dataclasses.dataclass class Data: x: str = "" """ diff --git a/testing/test_tmpdir.py b/testing/test_tmpdir.py index 43437c9ab87..fcb0775dd5f 100644 --- a/testing/test_tmpdir.py +++ b/testing/test_tmpdir.py @@ -1,3 +1,4 @@ +import dataclasses import os import stat import sys @@ -6,8 +7,7 @@ from typing import Callable from typing import cast from typing import List - -import attr +from typing import Union import pytest from _pytest import pathlib @@ -31,9 +31,9 @@ def test_tmp_path_fixture(pytester: Pytester) -> None: results.stdout.fnmatch_lines(["*1 passed*"]) -@attr.s +@dataclasses.dataclass class FakeConfig: - basetemp = attr.ib() + basetemp: Union[str, Path] @property def trace(self): @@ -56,7 +56,7 @@ def option(self): class TestTmpPathHandler: - def test_mktemp(self, tmp_path): + def test_mktemp(self, tmp_path: Path) -> None: config = cast(Config, FakeConfig(tmp_path)) t = TempPathFactory.from_config(config, _ispytest=True) tmp = t.mktemp("world") @@ -67,7 +67,9 @@ def test_mktemp(self, tmp_path): assert str(tmp2.relative_to(t.getbasetemp())).startswith("this") assert tmp2 != tmp - def test_tmppath_relative_basetemp_absolute(self, tmp_path, monkeypatch): + def test_tmppath_relative_basetemp_absolute( + self, tmp_path: Path, monkeypatch: MonkeyPatch + ) -> None: """#4425""" monkeypatch.chdir(tmp_path) config = cast(Config, FakeConfig("hello")) From 6a714d7b70f22dbc9415e28800f0e8d24f645087 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 21 Jan 2023 09:39:58 +0200 Subject: [PATCH 488/549] capture: `CaptureResult` can be a namedtuple again (#10678) mypy now supports generic NamedTuple. --- src/_pytest/capture.py | 65 ++++++++++-------------------------------- 1 file changed, 15 insertions(+), 50 deletions(-) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index 6131a46df47..4b66bb45190 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -1,6 +1,6 @@ """Per-test stdout/stderr capturing mechanism.""" +import collections import contextlib -import functools import io import os import sys @@ -10,7 +10,7 @@ from typing import AnyStr from typing import Generator from typing import Generic -from typing import Iterator +from typing import NamedTuple from typing import Optional from typing import TextIO from typing import Tuple @@ -492,59 +492,24 @@ def writeorg(self, data): # MultiCapture -# This class was a namedtuple, but due to mypy limitation[0] it could not be -# made generic, so was replaced by a regular class which tries to emulate the -# pertinent parts of a namedtuple. If the mypy limitation is ever lifted, can -# make it a namedtuple again. -# [0]: https://github.com/python/mypy/issues/685 -@final -@functools.total_ordering -class CaptureResult(Generic[AnyStr]): - """The result of :method:`CaptureFixture.readouterr`.""" +# Generic NamedTuple only supported since Python 3.11. +if sys.version_info >= (3, 11) or TYPE_CHECKING: - __slots__ = ("out", "err") + @final + class CaptureResult(NamedTuple, Generic[AnyStr]): + """The result of :method:`CaptureFixture.readouterr`.""" - def __init__(self, out: AnyStr, err: AnyStr) -> None: - self.out: AnyStr = out - self.err: AnyStr = err + out: AnyStr + err: AnyStr - def __len__(self) -> int: - return 2 +else: - def __iter__(self) -> Iterator[AnyStr]: - return iter((self.out, self.err)) + class CaptureResult( + collections.namedtuple("CaptureResult", ["out", "err"]), Generic[AnyStr] + ): + """The result of :method:`CaptureFixture.readouterr`.""" - def __getitem__(self, item: int) -> AnyStr: - return tuple(self)[item] - - def _replace( - self, *, out: Optional[AnyStr] = None, err: Optional[AnyStr] = None - ) -> "CaptureResult[AnyStr]": - return CaptureResult( - out=self.out if out is None else out, err=self.err if err is None else err - ) - - def count(self, value: AnyStr) -> int: - return tuple(self).count(value) - - def index(self, value) -> int: - return tuple(self).index(value) - - def __eq__(self, other: object) -> bool: - if not isinstance(other, (CaptureResult, tuple)): - return NotImplemented - return tuple(self) == tuple(other) - - def __hash__(self) -> int: - return hash(tuple(self)) - - def __lt__(self, other: object) -> bool: - if not isinstance(other, (CaptureResult, tuple)): - return NotImplemented - return tuple(self) < tuple(other) - - def __repr__(self) -> str: - return f"CaptureResult(out={self.out!r}, err={self.err!r})" + __slots__ = () class MultiCapture(Generic[AnyStr]): From 7d4b40337b3c2642e40ac462ba45d69f164a3f02 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 21 Jan 2023 09:48:07 +0200 Subject: [PATCH 489/549] capture: fix some Anys --- src/_pytest/capture.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index 4b66bb45190..c9ea433ee1f 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -858,7 +858,9 @@ def _is_started(self) -> bool: @contextlib.contextmanager def disabled(self) -> Generator[None, None, None]: """Temporarily disable capturing while inside the ``with`` block.""" - capmanager = self.request.config.pluginmanager.getplugin("capturemanager") + capmanager: CaptureManager = self.request.config.pluginmanager.getplugin( + "capturemanager" + ) with capmanager.global_and_fixture_disabled(): yield @@ -885,7 +887,7 @@ def test_output(capsys): captured = capsys.readouterr() assert captured.out == "hello\n" """ - capman = request.config.pluginmanager.getplugin("capturemanager") + capman: CaptureManager = request.config.pluginmanager.getplugin("capturemanager") capture_fixture = CaptureFixture[str](SysCapture, request, _ispytest=True) capman.set_fixture(capture_fixture) capture_fixture._start() @@ -913,7 +915,7 @@ def test_output(capsysbinary): captured = capsysbinary.readouterr() assert captured.out == b"hello\n" """ - capman = request.config.pluginmanager.getplugin("capturemanager") + capman: CaptureManager = request.config.pluginmanager.getplugin("capturemanager") capture_fixture = CaptureFixture[bytes](SysCaptureBinary, request, _ispytest=True) capman.set_fixture(capture_fixture) capture_fixture._start() @@ -941,7 +943,7 @@ def test_system_echo(capfd): captured = capfd.readouterr() assert captured.out == "hello\n" """ - capman = request.config.pluginmanager.getplugin("capturemanager") + capman: CaptureManager = request.config.pluginmanager.getplugin("capturemanager") capture_fixture = CaptureFixture[str](FDCapture, request, _ispytest=True) capman.set_fixture(capture_fixture) capture_fixture._start() @@ -970,7 +972,7 @@ def test_system_echo(capfdbinary): assert captured.out == b"hello\n" """ - capman = request.config.pluginmanager.getplugin("capturemanager") + capman: CaptureManager = request.config.pluginmanager.getplugin("capturemanager") capture_fixture = CaptureFixture[bytes](FDCaptureBinary, request, _ispytest=True) capman.set_fixture(capture_fixture) capture_fixture._start() From bd7919e03d1d1fd14b30cfa9211b2a51a00f81ba Mon Sep 17 00:00:00 2001 From: q0w <43147888+q0w@users.noreply.github.com> Date: Sat, 21 Jan 2023 14:19:54 +0300 Subject: [PATCH 490/549] Initialize args and args_source during Config.__init__ Closes #10626 Co-authored-by: Bruno Oliveira --- AUTHORS | 1 + changelog/10626.bugfix.rst | 1 + src/_pytest/config/__init__.py | 6 ++++-- testing/python/fixtures.py | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 changelog/10626.bugfix.rst diff --git a/AUTHORS b/AUTHORS index cd5b71ffb1e..fe60b68653b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -290,6 +290,7 @@ Prashant Sharma Pulkit Goyal Punyashloka Biswal Quentin Pradet +q0w Ralf Schmitt Ralph Giles Ram Rachum diff --git a/changelog/10626.bugfix.rst b/changelog/10626.bugfix.rst new file mode 100644 index 00000000000..c3c7ef77840 --- /dev/null +++ b/changelog/10626.bugfix.rst @@ -0,0 +1 @@ +Fix crash if ``--fixtures`` and ``--help`` are passed at the same time. diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index 5c0c62108a5..a08a965a6dc 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -1005,6 +1005,8 @@ def __init__( self.hook.pytest_addoption.call_historic( kwargs=dict(parser=self._parser, pluginmanager=self.pluginmanager) ) + self.args_source = Config.ArgsSource.ARGS + self.args: List[str] = [] if TYPE_CHECKING: from _pytest.cacheprovider import Cache @@ -1344,8 +1346,8 @@ def _get_unknown_ini_keys(self) -> List[str]: def parse(self, args: List[str], addopts: bool = True) -> None: # Parse given cmdline arguments into this config object. - assert not hasattr( - self, "args" + assert ( + self.args == [] ), "can only parse cmdline args at most once per Config object" self.hook.pytest_addhooks.call_historic( kwargs=dict(pluginmanager=self.pluginmanager) diff --git a/testing/python/fixtures.py b/testing/python/fixtures.py index 3ce5cb34ddd..d996f80bb93 100644 --- a/testing/python/fixtures.py +++ b/testing/python/fixtures.py @@ -3338,6 +3338,10 @@ def test_funcarg_compat(self, pytester: Pytester) -> None: config = pytester.parseconfigure("--funcargs") assert config.option.showfixtures + def test_show_help(self, pytester: Pytester) -> None: + result = pytester.runpytest("--fixtures", "--help") + assert not result.ret + def test_show_fixtures(self, pytester: Pytester) -> None: result = pytester.runpytest("--fixtures") result.stdout.fnmatch_lines( From af4143729f04fdbe8ecd206d40ceb58c07da56f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannick=20P=C3=89ROUX?= Date: Sat, 21 Jan 2023 12:22:44 +0100 Subject: [PATCH 491/549] Allow spaces in -p arguments (#10658) --- AUTHORS | 1 + changelog/10658.improvement.rst | 3 +++ src/_pytest/config/__init__.py | 1 + testing/test_config.py | 4 ++++ 4 files changed, 9 insertions(+) create mode 100644 changelog/10658.improvement.rst diff --git a/AUTHORS b/AUTHORS index fe60b68653b..ceb19559e50 100644 --- a/AUTHORS +++ b/AUTHORS @@ -378,6 +378,7 @@ Wouter van Ackooy Xixi Zhao Xuan Luong Xuecong Liao +Yannick Péroux Yoav Caspi Yuliang Shao Yusuke Kadowaki diff --git a/changelog/10658.improvement.rst b/changelog/10658.improvement.rst new file mode 100644 index 00000000000..54e5ae84f24 --- /dev/null +++ b/changelog/10658.improvement.rst @@ -0,0 +1,3 @@ +Allow ``-p`` arguments to include spaces (eg: ``-p no:logging`` instead of +``-pno:logging``). Mostly useful in the ``addopts`` section of the configuration +file. diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index a08a965a6dc..b4dbc0da4be 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -697,6 +697,7 @@ def consider_preparse( parg = opt[2:] else: continue + parg = parg.strip() if exclude_only and not parg.startswith("no:"): continue self.consider_pluginarg(parg) diff --git a/testing/test_config.py b/testing/test_config.py index db50869c591..35e2a601ca4 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -1808,6 +1808,10 @@ def test_config_does_not_load_blocked_plugin_from_args(pytester: Pytester) -> No result.stderr.fnmatch_lines(["*: error: unrecognized arguments: -s"]) assert result.ret == ExitCode.USAGE_ERROR + result = pytester.runpytest(str(p), "-p no:capture", "-s") + result.stderr.fnmatch_lines(["*: error: unrecognized arguments: -s"]) + assert result.ret == ExitCode.USAGE_ERROR + def test_invocation_args(pytester: Pytester) -> None: """Ensure that Config.invocation_* arguments are correctly defined""" From a3693ce50396e05910c9602443a825831d97a214 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 20 Jan 2023 14:14:44 +0200 Subject: [PATCH 492/549] capture: improve `DontReadFromInput` typing Have `DontReadFromInput` inherit from `TextIO`, ensuring it's fully compatible with `sys.stdin` (which has type `TextIO`). --- src/_pytest/capture.py | 50 +++++++++++++++++++++++++++++++---------- testing/test_capture.py | 5 ++++- 2 files changed, 42 insertions(+), 13 deletions(-) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index c9ea433ee1f..29d4f1524d8 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -6,14 +6,20 @@ import sys from io import UnsupportedOperation from tempfile import TemporaryFile +from types import TracebackType from typing import Any from typing import AnyStr +from typing import BinaryIO from typing import Generator from typing import Generic +from typing import Iterable +from typing import Iterator +from typing import List from typing import NamedTuple from typing import Optional from typing import TextIO from typing import Tuple +from typing import Type from typing import TYPE_CHECKING from typing import Union @@ -185,19 +191,27 @@ def write(self, s: str) -> int: return self._other.write(s) -class DontReadFromInput: - encoding = None +class DontReadFromInput(TextIO): + @property + def encoding(self) -> str: + return sys.__stdin__.encoding - def read(self, *args): + def read(self, size: int = -1) -> str: raise OSError( "pytest: reading from stdin while output is captured! Consider using `-s`." ) readline = read - readlines = read - __next__ = read - def __iter__(self): + def __next__(self) -> str: + return self.readline() + + def readlines(self, hint: Optional[int] = -1) -> List[str]: + raise OSError( + "pytest: reading from stdin while output is captured! Consider using `-s`." + ) + + def __iter__(self) -> Iterator[str]: return self def fileno(self) -> int: @@ -215,7 +229,7 @@ def close(self) -> None: def readable(self) -> bool: return False - def seek(self, offset: int) -> int: + def seek(self, offset: int, whence: int = 0) -> int: raise UnsupportedOperation("redirected stdin is pseudofile, has no seek(int)") def seekable(self) -> bool: @@ -224,22 +238,34 @@ def seekable(self) -> bool: def tell(self) -> int: raise UnsupportedOperation("redirected stdin is pseudofile, has no tell()") - def truncate(self, size: int) -> None: + def truncate(self, size: Optional[int] = None) -> int: raise UnsupportedOperation("cannont truncate stdin") - def write(self, *args) -> None: + def write(self, data: str) -> int: raise UnsupportedOperation("cannot write to stdin") - def writelines(self, *args) -> None: + def writelines(self, lines: Iterable[str]) -> None: raise UnsupportedOperation("Cannot write to stdin") def writable(self) -> bool: return False - @property - def buffer(self): + def __enter__(self) -> "DontReadFromInput": return self + def __exit__( + self, + type: Optional[Type[BaseException]], + value: Optional[BaseException], + traceback: Optional[TracebackType], + ) -> None: + pass + + @property + def buffer(self) -> BinaryIO: + # The str/bytes doesn't actually matter in this type, so OK to fake. + return self # type: ignore[return-value] + # Capture classes. diff --git a/testing/test_capture.py b/testing/test_capture.py index 00cab19330b..fcd3183474d 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -890,7 +890,7 @@ def test_dontreadfrominput() -> None: from _pytest.capture import DontReadFromInput f = DontReadFromInput() - assert f.buffer is f + assert f.buffer is f # type: ignore[comparison-overlap] assert not f.isatty() pytest.raises(OSError, f.read) pytest.raises(OSError, f.readlines) @@ -906,7 +906,10 @@ def test_dontreadfrominput() -> None: pytest.raises(UnsupportedOperation, f.write, b"") pytest.raises(UnsupportedOperation, f.writelines, []) assert not f.writable() + assert isinstance(f.encoding, str) f.close() # just for completeness + with f: + pass def test_captureresult() -> None: From c746d2b016a149338c68511d2c5bee8cc5a31325 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 20 Jan 2023 14:08:08 +0200 Subject: [PATCH 493/549] capture: improve `SysCapture`/`FDCapture` typing Instead of `SysCapture`/`FDCapture` inheriting from `SysCaptureBinary`/`FDCaptureBinary`, have both inherit from a common `SysCaptureBase`/`FDCaptureBase`. This fixes a Liskov substitution violation. --- src/_pytest/capture.py | 92 +++++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 42 deletions(-) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index 29d4f1524d8..cb5b966c9e0 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -278,13 +278,12 @@ class NoCapture: __init__ = start = done = suspend = resume = lambda *args: None -class SysCaptureBinary: - - EMPTY_BUFFER = b"" - - def __init__(self, fd: int, tmpfile=None, *, tee: bool = False) -> None: +class SysCaptureBase: + def __init__( + self, fd: int, tmpfile: Optional[TextIO] = None, *, tee: bool = False + ) -> None: name = patchsysdict[fd] - self._old = getattr(sys, name) + self._old: TextIO = getattr(sys, name) self.name = name if tmpfile is None: if name == "stdin": @@ -324,14 +323,6 @@ def start(self) -> None: setattr(sys, self.name, self.tmpfile) self._state = "started" - def snap(self): - self._assert_state("snap", ("started", "suspended")) - self.tmpfile.seek(0) - res = self.tmpfile.buffer.read() - self.tmpfile.seek(0) - self.tmpfile.truncate() - return res - def done(self) -> None: self._assert_state("done", ("initialized", "started", "suspended", "done")) if self._state == "done": @@ -353,36 +344,43 @@ def resume(self) -> None: setattr(sys, self.name, self.tmpfile) self._state = "started" - def writeorg(self, data) -> None: + +class SysCaptureBinary(SysCaptureBase): + EMPTY_BUFFER = b"" + + def snap(self) -> bytes: + self._assert_state("snap", ("started", "suspended")) + self.tmpfile.seek(0) + res = self.tmpfile.buffer.read() + self.tmpfile.seek(0) + self.tmpfile.truncate() + return res + + def writeorg(self, data: bytes) -> None: self._assert_state("writeorg", ("started", "suspended")) self._old.flush() self._old.buffer.write(data) self._old.buffer.flush() -class SysCapture(SysCaptureBinary): - EMPTY_BUFFER = "" # type: ignore[assignment] +class SysCapture(SysCaptureBase): + EMPTY_BUFFER = "" - def snap(self): + def snap(self) -> str: + self._assert_state("snap", ("started", "suspended")) + assert isinstance(self.tmpfile, CaptureIO) res = self.tmpfile.getvalue() self.tmpfile.seek(0) self.tmpfile.truncate() return res - def writeorg(self, data): + def writeorg(self, data: str) -> None: self._assert_state("writeorg", ("started", "suspended")) self._old.write(data) self._old.flush() -class FDCaptureBinary: - """Capture IO to/from a given OS-level file descriptor. - - snap() produces `bytes`. - """ - - EMPTY_BUFFER = b"" - +class FDCaptureBase: def __init__(self, targetfd: int) -> None: self.targetfd = targetfd @@ -447,14 +445,6 @@ def start(self) -> None: self.syscapture.start() self._state = "started" - def snap(self): - self._assert_state("snap", ("started", "suspended")) - self.tmpfile.seek(0) - res = self.tmpfile.buffer.read() - self.tmpfile.seek(0) - self.tmpfile.truncate() - return res - def done(self) -> None: """Stop capturing, restore streams, return original capture file, seeked to position zero.""" @@ -487,22 +477,38 @@ def resume(self) -> None: os.dup2(self.tmpfile.fileno(), self.targetfd) self._state = "started" - def writeorg(self, data): + +class FDCaptureBinary(FDCaptureBase): + """Capture IO to/from a given OS-level file descriptor. + + snap() produces `bytes`. + """ + + EMPTY_BUFFER = b"" + + def snap(self) -> bytes: + self._assert_state("snap", ("started", "suspended")) + self.tmpfile.seek(0) + res = self.tmpfile.buffer.read() + self.tmpfile.seek(0) + self.tmpfile.truncate() + return res + + def writeorg(self, data: bytes) -> None: """Write to original file descriptor.""" self._assert_state("writeorg", ("started", "suspended")) os.write(self.targetfd_save, data) -class FDCapture(FDCaptureBinary): +class FDCapture(FDCaptureBase): """Capture IO to/from a given OS-level file descriptor. snap() produces text. """ - # Ignore type because it doesn't match the type in the superclass (bytes). - EMPTY_BUFFER = "" # type: ignore + EMPTY_BUFFER = "" - def snap(self): + def snap(self) -> str: self._assert_state("snap", ("started", "suspended")) self.tmpfile.seek(0) res = self.tmpfile.read() @@ -510,9 +516,11 @@ def snap(self): self.tmpfile.truncate() return res - def writeorg(self, data): + def writeorg(self, data: str) -> None: """Write to original file descriptor.""" - super().writeorg(data.encode("utf-8")) # XXX use encoding of original stream + self._assert_state("writeorg", ("started", "suspended")) + # XXX use encoding of original stream + os.write(self.targetfd_save, data.encode("utf-8")) # MultiCapture From 54911acf8dd5af091e91f215b6fca78e06ef5a9d Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 21 Jan 2023 10:09:28 +0200 Subject: [PATCH 494/549] capture: improve `captureclass` typing Previously, the any `captureclass` arguments were Any. We need to introduce another common base class to fix this. --- src/_pytest/capture.py | 84 +++++++++++++++++++++++++++++++---------- testing/test_capture.py | 1 + 2 files changed, 66 insertions(+), 19 deletions(-) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index cb5b966c9e0..0ff583e041e 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -1,4 +1,5 @@ """Per-test stdout/stderr capturing mechanism.""" +import abc import collections import contextlib import io @@ -270,6 +271,38 @@ def buffer(self) -> BinaryIO: # Capture classes. +class CaptureBase(abc.ABC, Generic[AnyStr]): + EMPTY_BUFFER: AnyStr + + @abc.abstractmethod + def __init__(self, fd: int) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def start(self) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def done(self) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def suspend(self) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def resume(self) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def writeorg(self, data: AnyStr) -> None: + raise NotImplementedError() + + @abc.abstractmethod + def snap(self) -> AnyStr: + raise NotImplementedError() + + patchsysdict = {0: "stdin", 1: "stdout", 2: "stderr"} @@ -278,7 +311,7 @@ class NoCapture: __init__ = start = done = suspend = resume = lambda *args: None -class SysCaptureBase: +class SysCaptureBase(CaptureBase[AnyStr]): def __init__( self, fd: int, tmpfile: Optional[TextIO] = None, *, tee: bool = False ) -> None: @@ -345,7 +378,7 @@ def resume(self) -> None: self._state = "started" -class SysCaptureBinary(SysCaptureBase): +class SysCaptureBinary(SysCaptureBase[bytes]): EMPTY_BUFFER = b"" def snap(self) -> bytes: @@ -363,7 +396,7 @@ def writeorg(self, data: bytes) -> None: self._old.buffer.flush() -class SysCapture(SysCaptureBase): +class SysCapture(SysCaptureBase[str]): EMPTY_BUFFER = "" def snap(self) -> str: @@ -380,7 +413,7 @@ def writeorg(self, data: str) -> None: self._old.flush() -class FDCaptureBase: +class FDCaptureBase(CaptureBase[AnyStr]): def __init__(self, targetfd: int) -> None: self.targetfd = targetfd @@ -478,7 +511,7 @@ def resume(self) -> None: self._state = "started" -class FDCaptureBinary(FDCaptureBase): +class FDCaptureBinary(FDCaptureBase[bytes]): """Capture IO to/from a given OS-level file descriptor. snap() produces `bytes`. @@ -500,7 +533,7 @@ def writeorg(self, data: bytes) -> None: os.write(self.targetfd_save, data) -class FDCapture(FDCaptureBase): +class FDCapture(FDCaptureBase[str]): """Capture IO to/from a given OS-level file descriptor. snap() produces text. @@ -550,10 +583,15 @@ class MultiCapture(Generic[AnyStr]): _state = None _in_suspended = False - def __init__(self, in_, out, err) -> None: - self.in_ = in_ - self.out = out - self.err = err + def __init__( + self, + in_: Optional[CaptureBase[AnyStr]], + out: Optional[CaptureBase[AnyStr]], + err: Optional[CaptureBase[AnyStr]], + ) -> None: + self.in_: Optional[CaptureBase[AnyStr]] = in_ + self.out: Optional[CaptureBase[AnyStr]] = out + self.err: Optional[CaptureBase[AnyStr]] = err def __repr__(self) -> str: return "".format( @@ -577,8 +615,10 @@ def pop_outerr_to_orig(self) -> Tuple[AnyStr, AnyStr]: """Pop current snapshot out/err capture and flush to orig streams.""" out, err = self.readouterr() if out: + assert self.out is not None self.out.writeorg(out) if err: + assert self.err is not None self.err.writeorg(err) return out, err @@ -599,6 +639,7 @@ def resume_capturing(self) -> None: if self.err: self.err.resume() if self._in_suspended: + assert self.in_ is not None self.in_.resume() self._in_suspended = False @@ -621,7 +662,8 @@ def is_started(self) -> bool: def readouterr(self) -> CaptureResult[AnyStr]: out = self.out.snap() if self.out else "" err = self.err.snap() if self.err else "" - return CaptureResult(out, err) + # TODO: This type error is real, need to fix. + return CaptureResult(out, err) # type: ignore[arg-type] def _get_multicapture(method: "_CaptureMethod") -> MultiCapture[str]: @@ -830,14 +872,18 @@ class CaptureFixture(Generic[AnyStr]): :fixture:`capfd` and :fixture:`capfdbinary` fixtures.""" def __init__( - self, captureclass, request: SubRequest, *, _ispytest: bool = False + self, + captureclass: Type[CaptureBase[AnyStr]], + request: SubRequest, + *, + _ispytest: bool = False, ) -> None: check_ispytest(_ispytest) - self.captureclass = captureclass + self.captureclass: Type[CaptureBase[AnyStr]] = captureclass self.request = request self._capture: Optional[MultiCapture[AnyStr]] = None - self._captured_out = self.captureclass.EMPTY_BUFFER - self._captured_err = self.captureclass.EMPTY_BUFFER + self._captured_out: AnyStr = self.captureclass.EMPTY_BUFFER + self._captured_err: AnyStr = self.captureclass.EMPTY_BUFFER def _start(self) -> None: if self._capture is None: @@ -922,7 +968,7 @@ def test_output(capsys): assert captured.out == "hello\n" """ capman: CaptureManager = request.config.pluginmanager.getplugin("capturemanager") - capture_fixture = CaptureFixture[str](SysCapture, request, _ispytest=True) + capture_fixture = CaptureFixture(SysCapture, request, _ispytest=True) capman.set_fixture(capture_fixture) capture_fixture._start() yield capture_fixture @@ -950,7 +996,7 @@ def test_output(capsysbinary): assert captured.out == b"hello\n" """ capman: CaptureManager = request.config.pluginmanager.getplugin("capturemanager") - capture_fixture = CaptureFixture[bytes](SysCaptureBinary, request, _ispytest=True) + capture_fixture = CaptureFixture(SysCaptureBinary, request, _ispytest=True) capman.set_fixture(capture_fixture) capture_fixture._start() yield capture_fixture @@ -978,7 +1024,7 @@ def test_system_echo(capfd): assert captured.out == "hello\n" """ capman: CaptureManager = request.config.pluginmanager.getplugin("capturemanager") - capture_fixture = CaptureFixture[str](FDCapture, request, _ispytest=True) + capture_fixture = CaptureFixture(FDCapture, request, _ispytest=True) capman.set_fixture(capture_fixture) capture_fixture._start() yield capture_fixture @@ -1007,7 +1053,7 @@ def test_system_echo(capfdbinary): """ capman: CaptureManager = request.config.pluginmanager.getplugin("capturemanager") - capture_fixture = CaptureFixture[bytes](FDCaptureBinary, request, _ispytest=True) + capture_fixture = CaptureFixture(FDCaptureBinary, request, _ispytest=True) capman.set_fixture(capture_fixture) capture_fixture._start() yield capture_fixture diff --git a/testing/test_capture.py b/testing/test_capture.py index fcd3183474d..26c1a5f74ba 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -1352,6 +1352,7 @@ def test_capsys_results_accessible_by_attribute(capsys: CaptureFixture[str]) -> def test_fdcapture_tmpfile_remains_the_same() -> None: cap = StdCaptureFD(out=False, err=True) + assert isinstance(cap.err, capture.FDCapture) try: cap.start_capturing() capfile = cap.err.tmpfile From 54b8b40f83308dd87695d0ec596d1ad767f3f5ab Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 21 Jan 2023 10:53:28 +0200 Subject: [PATCH 495/549] capture: improve NoCapture typing --- src/_pytest/capture.py | 30 +++++++++++++++++++++++++----- testing/test_capture.py | 1 + 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index 0ff583e041e..4b838604e71 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -306,9 +306,29 @@ def snap(self) -> AnyStr: patchsysdict = {0: "stdin", 1: "stdout", 2: "stderr"} -class NoCapture: - EMPTY_BUFFER = None - __init__ = start = done = suspend = resume = lambda *args: None +class NoCapture(CaptureBase[str]): + EMPTY_BUFFER = "" + + def __init__(self, fd: int) -> None: + pass + + def start(self) -> None: + pass + + def done(self) -> None: + pass + + def suspend(self) -> None: + pass + + def resume(self) -> None: + pass + + def snap(self) -> str: + return "" + + def writeorg(self, data: str) -> None: + pass class SysCaptureBase(CaptureBase[AnyStr]): @@ -439,7 +459,7 @@ def __init__(self, targetfd: int) -> None: if targetfd == 0: self.tmpfile = open(os.devnull, encoding="utf-8") - self.syscapture = SysCapture(targetfd) + self.syscapture: CaptureBase[str] = SysCapture(targetfd) else: self.tmpfile = EncodedFile( TemporaryFile(buffering=0), @@ -451,7 +471,7 @@ def __init__(self, targetfd: int) -> None: if targetfd in patchsysdict: self.syscapture = SysCapture(targetfd, self.tmpfile) else: - self.syscapture = NoCapture() + self.syscapture = NoCapture(targetfd) self._state = "initialized" diff --git a/testing/test_capture.py b/testing/test_capture.py index 26c1a5f74ba..5d6ef64ef71 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -1052,6 +1052,7 @@ def test_simple_resume_suspend(self) -> None: ) ) # Should not crash with missing "_old". + assert isinstance(cap.syscapture, capture.SysCapture) assert repr(cap.syscapture) == ( " _state='done' tmpfile={!r}>".format( cap.syscapture.tmpfile From 8c53dbf9d746292a36160d290c77a350533cbdba Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 21 Jan 2023 11:00:25 +0200 Subject: [PATCH 496/549] capture: fix pyright type error This is OK in mypy, but doesn't hurt to fix. --- src/_pytest/capture.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index 4b838604e71..275322cc335 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -36,6 +36,7 @@ from _pytest.nodes import Item if TYPE_CHECKING: + from typing_extensions import Final from typing_extensions import Literal _CaptureMethod = Literal["fd", "sys", "no", "tee-sys"] @@ -723,7 +724,7 @@ class CaptureManager: """ def __init__(self, method: "_CaptureMethod") -> None: - self._method = method + self._method: Final = method self._global_capturing: Optional[MultiCapture[str]] = None self._capture_fixture: Optional[CaptureFixture[Any]] = None From ca40380e99c2cdaab1d0c041f9f28cff37ef8ff9 Mon Sep 17 00:00:00 2001 From: Jay <43951088+jayendra-patil33@users.noreply.github.com> Date: Tue, 24 Jan 2023 15:37:42 +0530 Subject: [PATCH 497/549] Add check for zero denominator in approx (#10624) Closes #10533 --- changelog/10533.bugfix.rst | 1 + src/_pytest/python_api.py | 14 ++++++++++---- testing/python/approx.py | 13 +++++++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 changelog/10533.bugfix.rst diff --git a/changelog/10533.bugfix.rst b/changelog/10533.bugfix.rst new file mode 100644 index 00000000000..c49e4c3aabf --- /dev/null +++ b/changelog/10533.bugfix.rst @@ -0,0 +1 @@ +Fix :func:`pytest.approx` handling of dictionaries containing one or more values of `0.0` in class ApproxMapping. diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index 4bc9348613a..e1cbce210a8 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -269,10 +269,16 @@ def _repr_compare(self, other_side: Mapping[object, float]) -> List[str]: max_abs_diff = max( max_abs_diff, abs(approx_value.expected - other_value) ) - max_rel_diff = max( - max_rel_diff, - abs((approx_value.expected - other_value) / approx_value.expected), - ) + if approx_value.expected == 0.0: + max_rel_diff = math.inf + else: + max_rel_diff = max( + max_rel_diff, + abs( + (approx_value.expected - other_value) + / approx_value.expected + ), + ) different_ids.append(approx_key) message_data = [ diff --git a/testing/python/approx.py b/testing/python/approx.py index 6acb466ffb1..631e52b56ac 100644 --- a/testing/python/approx.py +++ b/testing/python/approx.py @@ -630,6 +630,19 @@ def test_dict_nonnumeric(self): def test_dict_vs_other(self): assert 1 != approx({"a": 0}) + def test_dict_for_div_by_zero(self, assert_approx_raises_regex): + assert_approx_raises_regex( + {"foo": 42.0}, + {"foo": 0.0}, + [ + r" comparison failed. Mismatched elements: 1 / 1:", + rf" Max absolute difference: {SOME_FLOAT}", + r" Max relative difference: inf", + r" Index \| Obtained\s+\| Expected ", + rf" foo | {SOME_FLOAT} \| {SOME_FLOAT} ± {SOME_FLOAT}", + ], + ) + def test_numpy_array(self): np = pytest.importorskip("numpy") From 86a1beba072cb72c1a265ec523cbed84f377913a Mon Sep 17 00:00:00 2001 From: vin01 <30344579+vin01@users.noreply.github.com> Date: Fri, 27 Jan 2023 12:11:00 +0100 Subject: [PATCH 498/549] Clarify docs for `match` regarding escaping (#10695) Add example using `re.escape` to escape arbitrary literal strings which might contain regular expression characters like `.` or `)`. Closes #10595 --- doc/en/how-to/capture-warnings.rst | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/doc/en/how-to/capture-warnings.rst b/doc/en/how-to/capture-warnings.rst index 91565002ccc..51e85badd2a 100644 --- a/doc/en/how-to/capture-warnings.rst +++ b/doc/en/how-to/capture-warnings.rst @@ -270,20 +270,34 @@ which works in a similar manner to :ref:`raises ` (except that warnings.warn("my warning", UserWarning) The test will fail if the warning in question is not raised. Use the keyword -argument ``match`` to assert that the warning matches a text or regex:: +argument ``match`` to assert that the warning matches a text or regex. +To match a literal string that may contain regular expression metacharacters like ``(`` or ``.``, the pattern can +first be escaped with ``re.escape``. - >>> with warns(UserWarning, match='must be 0 or None'): +Some examples: + +.. code-block:: pycon + + + >>> with warns(UserWarning, match="must be 0 or None"): ... warnings.warn("value must be 0 or None", UserWarning) + ... - >>> with warns(UserWarning, match=r'must be \d+$'): + >>> with warns(UserWarning, match=r"must be \d+$"): ... warnings.warn("value must be 42", UserWarning) + ... - >>> with warns(UserWarning, match=r'must be \d+$'): + >>> with warns(UserWarning, match=r"must be \d+$"): ... warnings.warn("this is not here", UserWarning) + ... Traceback (most recent call last): ... Failed: DID NOT WARN. No warnings of type ...UserWarning... were emitted... + >>> with warns(UserWarning, match=re.escape("issue with foo() func")): + ... warnings.warn("issue with foo() func") + ... + You can also call :func:`pytest.warns` on a function or code string: .. code-block:: python From 5dbfb8e108e04d287a47527aa1ede8d6371f8b0b Mon Sep 17 00:00:00 2001 From: Teejay Date: Fri, 27 Jan 2023 09:33:46 -0800 Subject: [PATCH 499/549] Fix fixtures named teardown being considered by nose (#10696) Closes #10597 --- AUTHORS | 1 + changelog/10597.bugfix.rst | 1 + src/_pytest/python.py | 6 +++--- testing/test_nose.py | 21 +++++++++++++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 changelog/10597.bugfix.rst diff --git a/AUTHORS b/AUTHORS index ceb19559e50..2f50a295065 100644 --- a/AUTHORS +++ b/AUTHORS @@ -348,6 +348,7 @@ Thomas Grainger Thomas Hisch Tim Hoffmann Tim Strazny +TJ Bruno Tobias Diez Tom Dalton Tom Viner diff --git a/changelog/10597.bugfix.rst b/changelog/10597.bugfix.rst new file mode 100644 index 00000000000..9070e74a310 --- /dev/null +++ b/changelog/10597.bugfix.rst @@ -0,0 +1 @@ +Fix bug where a fixture method named ``teardown`` would be called as part of ``nose`` teardown stage. diff --git a/src/_pytest/python.py b/src/_pytest/python.py index b24a3803eb8..62c31b0f4a3 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -847,7 +847,7 @@ def _inject_setup_class_fixture(self) -> None: other fixtures (#517). """ setup_class = _get_first_non_fixture_func(self.obj, ("setup_class",)) - teardown_class = getattr(self.obj, "teardown_class", None) + teardown_class = _get_first_non_fixture_func(self.obj, ("teardown_class",)) if setup_class is None and teardown_class is None: return @@ -884,12 +884,12 @@ def _inject_setup_method_fixture(self) -> None: emit_nose_setup_warning = True setup_method = _get_first_non_fixture_func(self.obj, (setup_name,)) teardown_name = "teardown_method" - teardown_method = getattr(self.obj, teardown_name, None) + teardown_method = _get_first_non_fixture_func(self.obj, (teardown_name,)) emit_nose_teardown_warning = False if teardown_method is None and has_nose: teardown_name = "teardown" emit_nose_teardown_warning = True - teardown_method = getattr(self.obj, teardown_name, None) + teardown_method = _get_first_non_fixture_func(self.obj, (teardown_name,)) if setup_method is None and teardown_method is None: return diff --git a/testing/test_nose.py b/testing/test_nose.py index 92d6b95fd87..e838e79ddd5 100644 --- a/testing/test_nose.py +++ b/testing/test_nose.py @@ -496,3 +496,24 @@ def test_it(): ) result = pytester.runpytest(p, "-p", "nose") assert result.ret == 0 + + +@pytest.mark.parametrize("fixture_name", ("teardown", "teardown_class")) +def test_teardown_fixture_not_called_directly(fixture_name, pytester: Pytester) -> None: + """Regression test for #10597.""" + p = pytester.makepyfile( + f""" + import pytest + + class TestHello: + + @pytest.fixture + def {fixture_name}(self): + yield + + def test_hello(self, {fixture_name}): + assert True + """ + ) + result = pytester.runpytest(p, "-p", "nose") + assert result.ret == 0 From 4a46ee8bc957b06265c016cc837862447dde79d2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 10:15:02 -0300 Subject: [PATCH 500/549] [automated] Update plugin list (#10699) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 600 ++++++++++++++++++++----------- 1 file changed, 392 insertions(+), 208 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 6d7b2f7a844..e6f2ccd490c 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1173 plugins. +This list contains 1196 plugins. .. only:: not latex @@ -19,7 +19,7 @@ This list contains 1173 plugins. name summary last release status requires =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ :pypi:`pytest-abstracts` A contextmanager pytest fixture for handling multiple mock abstracts May 25, 2022 N/A N/A - :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Jan 07, 2022 N/A pytest (>=6,<8) + :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Dec 21, 2022 N/A pytest (>=6,<8) :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Oct 13, 2022 N/A pytest (>=5.4.0) :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) @@ -30,7 +30,7 @@ This list contains 1173 plugins. :pypi:`pytest-aio` Pytest plugin for testing async python code Oct 20, 2021 4 - Beta pytest :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Nov 01, 2020 N/A pytest (>=6) + :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Jan 10, 2023 N/A pytest (>=7.2.0,<8.0.0) :pypi:`pytest-aiomoto` pytest-aiomoto Nov 09, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) @@ -55,7 +55,7 @@ This list contains 1173 plugins. :pypi:`pytest-antilru` Bust functools.lru_cache when running pytest to avoid test pollution Jul 05, 2022 5 - Production/Stable pytest :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest :pypi:`pytest-anything` Pytest fixtures to assert anything and something Oct 13, 2022 N/A pytest - :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Dec 02, 2022 N/A pytest ; extra == 'test' + :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Dec 08, 2022 N/A pytest ; extra == 'test' :pypi:`pytest-aoreporter` pytest report Jun 27, 2022 N/A N/A :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 12, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A @@ -63,8 +63,8 @@ This list contains 1173 plugins. :pypi:`pytest-appengine` AppEngine integration that works well with pytest-django Feb 27, 2017 N/A N/A :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A :pypi:`pytest-approvaltests` A plugin to use approvaltests with pytest May 08, 2022 4 - Beta pytest (>=7.0.1) - :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Nov 29, 2022 5 - Production/Stable pytest - :pypi:`pytest-archon` Rule your architecture like a real developer Nov 29, 2022 N/A pytest (>=7.2) + :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Dec 21, 2022 5 - Production/Stable pytest + :pypi:`pytest-archon` Rule your architecture like a real developer Jan 09, 2023 5 - Production/Stable pytest (>=7.2) :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 4 - Beta pytest (>=4.6) :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) @@ -80,7 +80,7 @@ This list contains 1173 plugins. :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Sep 06, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest - :pypi:`pytest-asyncio` Pytest support for asyncio Nov 11, 2022 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-asyncio` Pytest support for asyncio Dec 08, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jul 11, 2022 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) @@ -99,7 +99,7 @@ This list contains 1173 plugins. :pypi:`pytest-aws` pytest plugin for testing AWS resource configurations Oct 04, 2017 4 - Beta N/A :pypi:`pytest-aws-config` Protect your AWS credentials in unit tests May 28, 2021 N/A N/A :pypi:`pytest-axe` pytest plugin for axe-selenium-python Nov 12, 2018 N/A pytest (>=3.0.0) - :pypi:`pytest-azure` Pytest utilities and mocks for Azure Oct 10, 2022 3 - Alpha pytest + :pypi:`pytest-azure` Pytest utilities and mocks for Azure Jan 18, 2023 3 - Alpha pytest :pypi:`pytest-azure-devops` Simplifies using azure devops parallel strategy (https://docs.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner) with pytest. Jun 20, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Oct 20, 2022 5 - Production/Stable pytest (>=5.0.0) :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) @@ -117,12 +117,12 @@ This list contains 1173 plugins. :pypi:`pytest-benchmark` A \`\`pytest\`\` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer. Oct 25, 2022 5 - Production/Stable pytest (>=3.8) :pypi:`pytest-bg-process` Pytest plugin to initialize background process Jan 24, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-bigchaindb` A BigchainDB plugin for pytest. Jan 24, 2022 4 - Beta N/A - :pypi:`pytest-bigquery-mock` Provides a mock fixture for python bigquery client Aug 05, 2021 N/A pytest (>=5.0) + :pypi:`pytest-bigquery-mock` Provides a mock fixture for python bigquery client Dec 28, 2022 N/A pytest (>=5.0) :pypi:`pytest-black` A pytest plugin to enable format checking with black Oct 05, 2020 4 - Beta N/A :pypi:`pytest-black-multipy` Allow '--black' on older Pythons Jan 14, 2021 5 - Production/Stable pytest (!=3.7.3,>=3.5) ; extra == 'testing' :pypi:`pytest-black-ng` A pytest plugin to enable format checking with black Oct 20, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-blame` A pytest plugin helps developers to debug by providing useful commits history. May 04, 2019 N/A pytest (>=4.4.0) - :pypi:`pytest-blender` Blender Pytest plugin. Jun 16, 2022 N/A pytest ; extra == 'dev' + :pypi:`pytest-blender` Blender Pytest plugin. Jan 04, 2023 N/A pytest ; extra == 'dev' :pypi:`pytest-blink1` Pytest plugin to emit notifications via the Blink(1) RGB LED Jan 07, 2018 4 - Beta N/A :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A @@ -138,6 +138,7 @@ This list contains 1173 plugins. :pypi:`pytest-browser` A pytest plugin for console based browser test selection just after the collection phase Dec 10, 2016 3 - Alpha N/A :pypi:`pytest-browsermob-proxy` BrowserMob proxy plugin for py.test. Jun 11, 2013 4 - Beta N/A :pypi:`pytest-browserstack-local` \`\`py.test\`\` plugin to run \`\`BrowserStackLocal\`\` in background. Feb 09, 2018 N/A N/A + :pypi:`pytest-budosystems` Budo Systems Pytest Plugin. Jan 22, 2023 N/A pytest ; extra == 'test' :pypi:`pytest-bug` Pytest plugin for marking tests as a bug Apr 13, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-bugtong-tag` pytest-bugtong-tag is a plugin for pytest Jan 16, 2022 N/A N/A :pypi:`pytest-bugzilla` py.test bugzilla integration plugin May 05, 2010 4 - Beta N/A @@ -146,7 +147,7 @@ This list contains 1173 plugins. :pypi:`pytest-builtin-types` Nov 17, 2021 N/A pytest :pypi:`pytest-bwrap` Run your tests in Bubblewrap sandboxes Oct 26, 2018 3 - Alpha N/A :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A - :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Oct 19, 2022 5 - Production/Stable pytest (>=5.0.0) + :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Jan 10, 2023 5 - Production/Stable pytest (>=5.0.0) :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 17, 2022 N/A pytest :pypi:`pytest-call-checker` Small pytest utility to easily create test doubles Oct 16, 2022 4 - Beta pytest (>=7.1.3,<8.0.0) @@ -167,12 +168,12 @@ This list contains 1173 plugins. :pypi:`pytest-change-report` turn . into √,turn F into x Sep 14, 2020 N/A pytest :pypi:`pytest-change-xds` turn . into √,turn F into x Apr 16, 2022 N/A pytest :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) - :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Dec 02, 2022 5 - Production/Stable pytest + :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Jan 13, 2023 5 - Production/Stable pytest :pypi:`pytest-checkdocs` check the README when running tests Oct 09, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) :pypi:`pytest-check-library` check your missing library Jul 17, 2022 N/A N/A :pypi:`pytest-check-libs` check your missing library Jul 17, 2022 N/A N/A - :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest (>=7.0) + :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest>=7.0 :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest :pypi:`pytest-chunks` Run only a chunk of your test suite Jul 05, 2022 N/A pytest (>=6.0.0) :pypi:`pytest-circleci` py.test plugin for CircleCI May 03, 2019 N/A N/A @@ -187,7 +188,8 @@ This list contains 1173 plugins. :pypi:`pytest-cloud` Distributed tests planner plugin for pytest testing framework. Oct 05, 2020 6 - Mature N/A :pypi:`pytest-cloudflare-worker` pytest plugin for testing cloudflare workers Mar 30, 2021 4 - Beta pytest (>=6.0.0) :pypi:`pytest-cloudist` Distribute tests to cloud machines without fuss Sep 02, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-cmake` Provide CMake module for Pytest Nov 30, 2022 1 - Planning N/A + :pypi:`pytest-cmake` Provide CMake module for Pytest Jan 21, 2023 N/A pytest<8,>=4 + :pypi:`pytest-cmake-presets` Execute CMake Presets via pytest Dec 26, 2022 N/A pytest (>=7.2.0,<8.0.0) :pypi:`pytest-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) :pypi:`pytest-codecarbon` Pytest plugin for measuring carbon emissions Jun 15, 2022 N/A pytest :pypi:`pytest-codecheckers` pytest plugin to add source code sanity checks (pep8 and friends) Feb 13, 2010 N/A N/A @@ -202,6 +204,7 @@ This list contains 1173 plugins. :pypi:`pytest-colordots` Colorizes the progress indicators Oct 06, 2017 5 - Production/Stable N/A :pypi:`pytest-commander` An interactive GUI test runner for PyTest Aug 17, 2021 N/A pytest (<7.0.0,>=6.2.4) :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method May 15, 2022 N/A pytest (>=3.6,<8) + :pypi:`pytest-compare` pytest plugin for comparing call arguments. Jan 22, 2023 5 - Production/Stable pytest :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-config` Base configurations and utilities for developing your Python project test suite with pytest. Nov 07, 2014 5 - Production/Stable N/A :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Apr 17, 2022 N/A N/A @@ -220,7 +223,7 @@ This list contains 1173 plugins. :pypi:`pytest-coveragemarkers` Using pytest markers to track functional coverage and filtering of tests Nov 29, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Sep 23, 2022 5 - Production/Stable pytest (>=7.0) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Nov 07, 2022 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Jan 23, 2023 N/A N/A :pypi:`pytest-cqase` Custom qase pytest plugin Aug 22, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) @@ -251,7 +254,7 @@ This list contains 1173 plugins. :pypi:`pytest-datafixtures` Data fixtures for pytest made simple Dec 05, 2020 5 - Production/Stable N/A :pypi:`pytest-data-from-files` pytest plugin to provide data from files loaded automatically Oct 13, 2021 4 - Beta pytest :pypi:`pytest-dataplugin` A pytest plugin for managing an archive of test data. Sep 16, 2017 1 - Planning N/A - :pypi:`pytest-datarecorder` A py.test plugin recording and comparing test output. Apr 20, 2020 5 - Production/Stable pytest + :pypi:`pytest-datarecorder` A py.test plugin recording and comparing test output. Jan 08, 2023 5 - Production/Stable pytest :pypi:`pytest-dataset` Plugin for loading different datasets for pytest by prefix from json or yaml files Oct 10, 2022 5 - Production/Stable N/A :pypi:`pytest-data-suites` Class-based pytest parametrization Jul 24, 2022 N/A pytest (>=6.0,<8.0) :pypi:`pytest-datatest` A pytest plugin for test driven data-wrangling (this is the development version of datatest's pytest integration). Oct 15, 2020 4 - Beta pytest (>=3.3) @@ -354,19 +357,20 @@ This list contains 1173 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Aug 31, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Nov 07, 2022 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Nov 07, 2022 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Nov 07, 2022 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Nov 07, 2022 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Nov 07, 2022 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Nov 07, 2022 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Nov 07, 2022 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Jan 05, 2023 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jan 05, 2023 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jan 05, 2023 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jan 05, 2023 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jan 05, 2023 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jan 05, 2023 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jan 05, 2023 N/A N/A :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Oct 15, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) - :pypi:`pytest-enabler` Enable installed pytest plugins Nov 23, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-enabler` Enable installed pytest plugins Jan 27, 2023 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-encode` set your encoding and logger Nov 06, 2021 N/A N/A :pypi:`pytest-encode-kane` set your encoding and logger Nov 16, 2021 N/A pytest + :pypi:`pytest-enhanced-reports` Enhanced test reports for pytest Dec 15, 2022 N/A N/A :pypi:`pytest-enhancements` Improvements for pytest (rejected upstream) Oct 30, 2019 4 - Beta N/A :pypi:`pytest-env` py.test plugin that allows you to add environment variables. Oct 23, 2022 5 - Production/Stable pytest>=7.1.3 :pypi:`pytest-envfiles` A py.test plugin that parses environment files before running tests Oct 08, 2015 3 - Alpha N/A @@ -386,6 +390,7 @@ This list contains 1173 plugins. :pypi:`pytest-executable` pytest plugin for testing executables Nov 05, 2022 N/A pytest (<8,>=4.3) :pypi:`pytest-execution-timer` A timer for the phases of Pytest's execution. Dec 24, 2021 4 - Beta N/A :pypi:`pytest-expect` py.test plugin to store test expectations and mark tests based on them Apr 21, 2016 4 - Beta N/A + :pypi:`pytest-expectdir` A pytest plugin to provide initial/expected directories, and check a test transforms the initial directory to the expected one Jan 24, 2023 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-expecter` Better testing with expecter and pytest. Sep 18, 2022 5 - Production/Stable N/A :pypi:`pytest-expectr` This plugin is used to expect multiple assert using pytest framework. Oct 05, 2018 N/A pytest (>=2.4.2) :pypi:`pytest-experiments` A pytest plugin to help developers of research-oriented software projects keep track of the results of their numerical experiments. Dec 13, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) @@ -399,7 +404,7 @@ This list contains 1173 plugins. :pypi:`pytest-factoryboy` Factory Boy support for pytest. Dec 01, 2022 6 - Mature pytest (>=5.0.0) :pypi:`pytest-factoryboy-fixtures` Generates pytest fixtures that allow the use of type hinting Jun 25, 2020 N/A N/A :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-failed-screen-record` Create a video of the screen when pytest fails Nov 29, 2022 4 - Beta pytest (>=7.1.2d,<8.0.0) + :pypi:`pytest-failed-screen-record` Create a video of the screen when pytest fails Jan 05, 2023 4 - Beta pytest (>=7.1.2d,<8.0.0) :pypi:`pytest-failed-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A :pypi:`pytest-failed-to-verify` A pytest plugin that helps better distinguishing real test failures from setup flakiness. Aug 08, 2019 5 - Production/Stable pytest (>=4.1.0) :pypi:`pytest-fail-slow` Fail tests that take too long to run Aug 13, 2022 4 - Beta pytest (>=6.0) @@ -410,7 +415,7 @@ This list contains 1173 plugins. :pypi:`pytest-fastapi` Dec 27, 2020 N/A N/A :pypi:`pytest-fastapi-deps` A fixture which allows easy replacement of fastapi dependencies for testing Jul 20, 2022 5 - Production/Stable pytest :pypi:`pytest-fastest` Use SCM and coverage to run only needed tests Mar 05, 2020 N/A N/A - :pypi:`pytest-fast-first` Pytest plugin that runs fast tests first Apr 02, 2021 3 - Alpha pytest + :pypi:`pytest-fast-first` Pytest plugin that runs fast tests first Jan 19, 2023 3 - Alpha pytest :pypi:`pytest-faulthandler` py.test plugin that activates the fault handler module for tests (dummy package) Jul 04, 2019 6 - Mature pytest (>=5.0) :pypi:`pytest-fauxfactory` Integration of fauxfactory into pytest. Dec 06, 2017 5 - Production/Stable pytest (>=3.2) :pypi:`pytest-figleaf` py.test figleaf coverage plugin Jan 18, 2010 5 - Production/Stable N/A @@ -418,11 +423,11 @@ This list contains 1173 plugins. :pypi:`pytest-filedata` easily load data from files Jan 17, 2019 4 - Beta N/A :pypi:`pytest-filemarker` A pytest plugin that runs marked tests when files change. Dec 01, 2020 N/A pytest :pypi:`pytest-filter-case` run test cases filter by mark Nov 05, 2020 N/A N/A - :pypi:`pytest-filter-subpackage` Pytest plugin for filtering based on sub-packages Jan 09, 2020 3 - Alpha pytest (>=3.0) + :pypi:`pytest-filter-subpackage` Pytest plugin for filtering based on sub-packages Dec 12, 2022 3 - Alpha pytest (>=3.0) :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Apr 09, 2022 4 - Beta pytest (>=4.3.0) :pypi:`pytest-finer-verdicts` A pytest plugin to treat non-assertion failures as test errors. Jun 18, 2020 N/A pytest (>=5.4.3) :pypi:`pytest-firefox` pytest plugin to manipulate firefox Aug 08, 2017 3 - Alpha pytest (>=3.0.2) - :pypi:`pytest-fixture-classes` Give you the ability to write typed fixture classes that work well with dependency injection, autocompletetion, type checkers, and language servers Nov 14, 2022 4 - Beta pytest + :pypi:`pytest-fixture-classes` Fixtures as classes that work well with dependency injection, autocompletetion, type checkers, and language servers Jan 20, 2023 4 - Beta pytest :pypi:`pytest-fixture-config` Fixture configuration utils for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-fixture-maker` Pytest plugin to load fixtures from YAML files Sep 21, 2021 N/A N/A :pypi:`pytest-fixture-marker` A pytest plugin to add markers based on fixtures used. Oct 11, 2020 5 - Production/Stable N/A @@ -469,7 +474,7 @@ This list contains 1173 plugins. :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest :pypi:`pytest-github` Plugin for py.test that associates tests with github issues using a marker. Mar 07, 2019 5 - Production/Stable N/A - :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Jul 02, 2022 N/A pytest (>=4.0.0) + :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Dec 19, 2022 N/A pytest (>=4.0.0) :pypi:`pytest-github-report` Generate a GitHub report using pytest in GitHub Workflows Jun 03, 2022 4 - Beta N/A :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A :pypi:`pytest-git-selector` Utility to select tests that have had its dependencies modified (as identified by git diff) Nov 17, 2022 N/A N/A @@ -482,6 +487,7 @@ This list contains 1173 plugins. :pypi:`pytest-growl` Growl notifications for pytest results. Jan 13, 2014 5 - Production/Stable N/A :pypi:`pytest-grpc` pytest plugin for grpc May 01, 2020 N/A pytest (>=3.6.0) :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest + :pypi:`pytest-harmony` Chain tests and data with pytest Jan 17, 2023 N/A pytest (>=7.2.1,<8.0.0) :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Jun 10, 2022 5 - Production/Stable N/A :pypi:`pytest-helm-chart` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jun 15, 2020 4 - Beta pytest (>=5.4.2,<6.0.0) :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Oct 19, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) @@ -492,9 +498,10 @@ This list contains 1173 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Dec 03, 2022 3 - Alpha pytest (==7.2.0) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jan 23, 2023 3 - Alpha pytest (==7.2.0) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A + :pypi:`pytest-hot-test` A plugin that tracks test changes Dec 10, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Nov 17, 2022 N/A pytest (>=5.0) :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 22, 2022 5 - Production/Stable N/A :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) @@ -511,8 +518,8 @@ This list contains 1173 plugins. :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Sep 12, 2022 3 - Alpha N/A - :pypi:`pytest-httptesting` http_testing framework on top of pytest Nov 16, 2022 N/A pytest (>=7.2.0,<8.0.0) - :pypi:`pytest-httpx` Send responses to httpx. Nov 03, 2022 5 - Production/Stable pytest (<8.*,>=6.*) + :pypi:`pytest-httptesting` http_testing framework on top of pytest Dec 08, 2022 N/A pytest (>=7.2.0,<8.0.0) + :pypi:`pytest-httpx` Send responses to httpx. Jan 20, 2023 5 - Production/Stable pytest (<8.0,>=6.0) :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest @@ -531,9 +538,9 @@ This list contains 1173 plugins. :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A :pypi:`pytest-inline` A pytest plugin for writing inline tests. Nov 23, 2022 4 - Beta pytest (>=7.0.0) - :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Oct 07, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Jan 20, 2023 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Dec 01, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Sep 16, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jan 27, 2023 5 - Production/Stable N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Jun 16, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Nov 02, 2022 N/A pytest (>=7.2.0,<8.0.0) @@ -545,7 +552,7 @@ This list contains 1173 plugins. :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) :pypi:`pytest-invenio` Pytest fixtures for Invenio. Oct 25, 2022 5 - Production/Stable pytest (<7.2.0,>=6) :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Sep 02, 2014 2 - Pre-Alpha N/A + :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Mar 20, 2013 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A :pypi:`pytest-isort` py.test plugin to check import ordering using isort Oct 31, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. Aug 19, 2022 5 - Production/Stable N/A @@ -558,7 +565,8 @@ This list contains 1173 plugins. :pypi:`pytest-jinja` A plugin to generate customizable jinja-based HTML reports in pytest Oct 04, 2022 3 - Alpha pytest (>=6.2.5,<7.0.0) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A :pypi:`pytest-jira-xfail` Plugin skips (xfail) tests if unresolved Jira issue(s) linked Dec 01, 2022 N/A pytest (~=7.2.0) - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Aug 25, 2022 4 - Beta pytest + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Jan 02, 2023 4 - Beta pytest + :pypi:`pytest-job-selection` A pytest plugin for load balancing test suites Jan 28, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A @@ -566,9 +574,11 @@ This list contains 1173 plugins. :pypi:`pytest-jsonlint` UNKNOWN Aug 04, 2016 N/A N/A :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Mar 15, 2022 4 - Beta pytest (>=3.8.0) :pypi:`pytest-jtr` pytest plugin supporting json test report output Nov 29, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-jupyter` A pytest plugin for testing Jupyter libraries and extensions. Nov 30, 2022 4 - Beta pytest + :pypi:`pytest-jupyter` A pytest plugin for testing Jupyter libraries and extensions. Dec 19, 2022 4 - Beta pytest :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Oct 01, 2022 N/A pytest :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest + :pypi:`pytest-kasima` Display horizontal lines above and below the captured standard output for easy viewing. Jan 26, 2023 5 - Production/Stable pytest (>=7.2.1,<8.0.0) + :pypi:`pytest-keep-together` Pytest plugin to customize test ordering by running all 'related' tests together Dec 07, 2022 5 - Production/Stable pytest :pypi:`pytest-kexi` Apr 29, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Nov 30, 2022 5 - Production/Stable N/A :pypi:`pytest-kivy` Kivy GUI tests fixtures using pytest Jul 06, 2021 4 - Beta pytest (>=3.6) @@ -593,13 +603,14 @@ This list contains 1173 plugins. :pypi:`pytest-ligo` Jan 16, 2020 4 - Beta N/A :pypi:`pytest-lineno` A pytest plugin to show the line numbers of test functions Dec 04, 2020 N/A pytest :pypi:`pytest-line-profiler` Profile code executed by pytest May 03, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-line-profiler-apn` Profile code executed by pytest Aug 14, 2022 4 - Beta N/A + :pypi:`pytest-line-profiler-apn` Profile code executed by pytest Dec 05, 2022 N/A pytest (>=3.5.0) :pypi:`pytest-lisa` Pytest plugin for organizing tests. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) :pypi:`pytest-listener` A simple network listener May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) :pypi:`pytest-live` Live results for pytest Mar 08, 2020 N/A pytest + :pypi:`pytest-local-badge` Generate local badges (shields) reporting your test suite status. Jan 15, 2023 N/A pytest (>=6.1.0) :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Oct 04, 2022 5 - Production/Stable pytest - :pypi:`pytest-localserver` pytest plugin to test server connections locally. Aug 30, 2022 4 - Beta N/A + :pypi:`pytest-localserver` pytest plugin to test server connections locally. Jan 26, 2023 4 - Beta N/A :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Oct 17, 2022 4 - Beta pytest (>=6.0.0,<7.0.0) :pypi:`pytest-lockable` lockable resource plugin for pytest Jul 20, 2022 5 - Production/Stable pytest :pypi:`pytest-locker` Used to lock object during testing. Essentially changing assertions from being hard coded to asserting that nothing changed Oct 29, 2021 N/A pytest (>=5.4) @@ -610,11 +621,11 @@ This list contains 1173 plugins. :pypi:`pytest-logger` Plugin configuring handlers for loggers from Python logging module. Jul 25, 2019 4 - Beta pytest (>=3.2) :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A :pypi:`pytest-logging-end-to-end-test-tool` Sep 23, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-logikal` Common testing environment Dec 03, 2022 5 - Production/Stable pytest (==7.2.0) + :pypi:`pytest-logikal` Common testing environment Jan 26, 2023 5 - Production/Stable pytest (==7.2.1) :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A :pypi:`pytest-loop` pytest plugin for looping tests Jul 22, 2022 5 - Production/Stable pytest (>=6) - :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Oct 15, 2022 3 - Alpha pytest + :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Jan 14, 2023 3 - Alpha pytest :pypi:`pytest-manual-marker` pytest marker for marking manual tests Aug 04, 2022 3 - Alpha pytest>=7 :pypi:`pytest-markdoctest` A pytest plugin to doctest your markdown files Jul 22, 2022 4 - Beta pytest (>=6) :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) @@ -652,7 +663,7 @@ This list contains 1173 plugins. :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Oct 27, 2022 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Jan 19, 2023 N/A pytest (>=1.0) :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-mocktcp` A pytest plugin for testing TCP clients Oct 11, 2022 N/A pytest @@ -673,11 +684,11 @@ This list contains 1173 plugins. :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Nov 15, 2022 4 - Beta pytest (>=6) :pypi:`pytest-mqtt` pytest-mqtt supports testing systems based on MQTT Sep 20, 2022 4 - Beta pytest (<8) ; extra == 'test' :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A - :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Sep 18, 2022 N/A pytest - :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Aug 12, 2021 N/A pytest (>=3.6) + :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jan 17, 2023 N/A pytest + :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Dec 07, 2022 N/A N/A :pypi:`pytest-multithreading-allure` pytest_multithreading_allure Nov 25, 2022 N/A N/A :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) - :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Nov 25, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" + :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Dec 18, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Oct 26, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A pytest>=6.0.0 @@ -685,7 +696,7 @@ This list contains 1173 plugins. :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 15, 2022 5 - Production/Stable pytest (>=6.2) :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) - :pypi:`pytest-netdut` "Automated software testing for switches using pytest" Nov 22, 2022 N/A pytest (>=3.5.0) + :pypi:`pytest-netdut` "Automated software testing for switches using pytest" Jan 11, 2023 N/A pytest (>=3.5.0) :pypi:`pytest-network` A simple plugin to disable network on socket level. May 07, 2020 N/A N/A :pypi:`pytest-network-endpoints` Network endpoints plugin for pytest Mar 06, 2022 N/A pytest :pypi:`pytest-never-sleep` pytest plugin helps to avoid adding tests without mock \`time.sleep\` May 05, 2021 3 - Alpha pytest (>=3.5.1) @@ -693,7 +704,7 @@ This list contains 1173 plugins. :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Dec 01, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Jan 09, 2023 N/A pytest (==6.2.5) :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A :pypi:`pytest-nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Jul 07, 2021 N/A N/A @@ -711,7 +722,7 @@ This list contains 1173 plugins. :pypi:`pytest-odoo` py.test plugin to run Odoo tests Nov 17, 2022 4 - Beta pytest (>=7.2.0) :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A :pypi:`pytest-oerp` pytest plugin to test OpenERP modules Feb 28, 2012 3 - Alpha N/A - :pypi:`pytest-ogsm-plugin` 针对特定项目定制化插件,优化了pytest报告展示方式,并添加了项目所需特定参数 Nov 17, 2022 N/A N/A + :pypi:`pytest-ogsm-plugin` 针对特定项目定制化插件,优化了pytest报告展示方式,并添加了项目所需特定参数 Jan 09, 2023 N/A N/A :pypi:`pytest-ok` The ultimate pytest output plugin Apr 01, 2019 4 - Beta N/A :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jun 14, 2022 5 - Production/Stable pytest (<7.1); python_version <= "3.6" :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A @@ -726,17 +737,19 @@ This list contains 1173 plugins. :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest :pypi:`pytest-order-modify` 新增run_marker 来自定义用例的执行顺序 Nov 04, 2022 N/A N/A :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A - :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Oct 19, 2022 N/A N/A + :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Jan 18, 2023 N/A N/A :pypi:`pytest-owner` Add owner mark for tests Apr 25, 2022 N/A N/A :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A :pypi:`pytest-pahrametahrize` Parametrize your tests with a Boston accent. Nov 24, 2021 4 - Beta pytest (>=6.0,<7.0) :pypi:`pytest-parallel` a pytest plugin for parallel and concurrent testing Oct 10, 2021 3 - Alpha pytest (>=3.0.0) :pypi:`pytest-parallel-39` a pytest plugin for parallel and concurrent testing Jul 12, 2021 3 - Alpha pytest (>=3.0.0) + :pypi:`pytest-parallelize-tests` pytest plugin that parallelizes test execution across multiple hosts Jan 27, 2023 4 - Beta N/A :pypi:`pytest-param` pytest plugin to test all, first, last or random params Sep 11, 2016 4 - Beta pytest (>=2.6.0) :pypi:`pytest-paramark` Configure pytest fixtures using a combination of"parametrize" and markers Jan 10, 2020 4 - Beta pytest (>=4.5.0) :pypi:`pytest-parametrization` Simpler PyTest parametrization May 22, 2022 5 - Production/Stable N/A :pypi:`pytest-parametrize-cases` A more user-friendly way to write parametrized tests. Mar 13, 2022 N/A pytest (>=6.1.2) :pypi:`pytest-parametrized` Pytest decorator for parametrizing tests with default iterables. Sep 13, 2022 5 - Production/Stable pytest + :pypi:`pytest-parametrize-suite` A simple pytest extension for creating a named test suite. Jan 19, 2023 5 - Production/Stable pytest :pypi:`pytest-parawtf` Finally spell paramete?ri[sz]e correctly Dec 03, 2018 4 - Beta pytest (>=3.6.0) :pypi:`pytest-pass` Check out https://github.com/elilutsky/pytest-pass Dec 04, 2019 N/A N/A :pypi:`pytest-passrunner` Pytest plugin providing the 'run_on_pass' marker Feb 10, 2021 5 - Production/Stable pytest (>=4.6.0) @@ -769,11 +782,12 @@ This list contains 1173 plugins. :pypi:`pytest-playwrights` A pytest wrapper with fixtures for Playwright to automate web browsers Dec 02, 2021 N/A N/A :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A :pypi:`pytest-playwright-visual` A pytest fixture for visual testing with Playwright Apr 28, 2022 N/A N/A + :pypi:`pytest-plone` Pytest plugin to test Plone addons Jan 05, 2023 3 - Alpha pytest :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Aug 17, 2020 5 - Production/Stable pytest :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Mar 19, 2020 5 - Production/Stable pytest (>=3.50) + :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Dec 24, 2022 5 - Production/Stable pytest (>=6.0.1) :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A - :pypi:`pytest-pointers` Pytest plugin to define functions you test with special marks for better navigation and reports Oct 14, 2021 N/A N/A + :pypi:`pytest-pointers` Pytest plugin to define functions you test with special marks for better navigation and reports Dec 26, 2022 N/A N/A :pypi:`pytest-polarion-cfme` pytest plugin for collecting test cases and recording test results Nov 13, 2017 3 - Alpha N/A :pypi:`pytest-polarion-collect` pytest plugin for collecting polarion test cases data Jun 18, 2020 3 - Alpha pytest :pypi:`pytest-polecat` Provides Polecat pytest fixtures Aug 12, 2019 4 - Beta N/A @@ -787,7 +801,7 @@ This list contains 1173 plugins. :pypi:`pytest-pot` A package for enhancing pytest Nov 20, 2022 N/A N/A :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 27, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) - :pypi:`pytest-pretty` pytest plugin for printing summary data as I want it Nov 03, 2022 4 - Beta pytest>=7 + :pypi:`pytest-pretty` pytest plugin for printing summary data as I want it Jan 22, 2023 5 - Production/Stable pytest>=7 :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 31, 2022 N/A pytest (>=3.4.1) :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Dec 28, 2021 5 - Production/Stable pytest (>=6) @@ -803,26 +817,27 @@ This list contains 1173 plugins. :pypi:`pytest-pudb` Pytest PuDB debugger integration Oct 25, 2018 3 - Alpha pytest (>=2.0) :pypi:`pytest-pumpkin-spice` A pytest plugin that makes your test reporting pumpkin-spiced Sep 18, 2022 4 - Beta N/A :pypi:`pytest-purkinje` py.test plugin for purkinje test runner Oct 28, 2017 2 - Pre-Alpha N/A + :pypi:`pytest-pusher` pytest plugin for push report to minio Jan 06, 2023 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-py125` Dec 03, 2022 N/A N/A :pypi:`pytest-py15` Dec 01, 2022 N/A N/A :pypi:`pytest-pycharm` Plugin for py.test to enter PyCharm debugger on uncaught exceptions Aug 13, 2020 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-pycodestyle` pytest plugin to run pycodestyle Oct 28, 2022 3 - Alpha N/A :pypi:`pytest-pydev` py.test plugin to connect to a remote debug server with PyDev or PyCharm. Nov 15, 2017 3 - Alpha N/A - :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Oct 28, 2022 3 - Alpha N/A + :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Jan 05, 2023 3 - Alpha N/A :pypi:`pytest-pylint` pytest plugin to check source code with pylint Sep 10, 2022 5 - Production/Stable pytest (>=5.4) :pypi:`pytest-pymysql-autorecord` Record PyMySQL queries and mock with the stored data. Sep 02, 2022 N/A N/A - :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Nov 15, 2022 N/A pytest + :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Jan 05, 2023 N/A pytest :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) :pypi:`pytest-pyq` Pytest fixture "q" for pyq Mar 10, 2020 5 - Production/Stable N/A - :pypi:`pytest-pyramid` pytest_pyramid - provides fixtures for testing pyramid applications with pytest test suite Oct 15, 2021 5 - Production/Stable pytest + :pypi:`pytest-pyramid` pytest_pyramid - provides fixtures for testing pyramid applications with pytest test suite Dec 13, 2022 5 - Production/Stable pytest :pypi:`pytest-pyramid-server` Pyramid server fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-pyright` Pytest plugin for type checking code with Pyright Nov 20, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.0) :pypi:`pytest-pythonpath` pytest plugin for adding to the PYTHONPATH from command line or configs. Feb 10, 2022 5 - Production/Stable pytest (<7,>=2.5.2) :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest - :pypi:`pytest-pyvista` Pytest-pyvista package Nov 21, 2022 4 - Beta pytest>=3.5.0 + :pypi:`pytest-pyvista` Pytest-pyvista package Jan 08, 2023 4 - Beta pytest>=3.5.0 :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Jun 26, 2021 4 - Beta pytest (>=6.2.0) :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jun 26, 2022 5 - Production/Stable pytest (>=6.2.3) @@ -846,7 +861,7 @@ This list contains 1173 plugins. :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Dec 03, 2022 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-readme` Test your README.md file Sep 02, 2022 5 - Production/Stable N/A - :pypi:`pytest-reana` Pytest fixtures for REANA. Nov 25, 2022 3 - Alpha N/A + :pypi:`pytest-reana` Pytest fixtures for REANA. Dec 13, 2022 3 - Alpha N/A :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jun 20, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) @@ -855,12 +870,12 @@ This list contains 1173 plugins. :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A :pypi:`pytest-regex-dependency` Management of Pytest dependencies via regex patterns Jun 12, 2022 N/A pytest - :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Sep 17, 2022 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Jan 13, 2023 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-regtest` pytest plugin for regression tests Jul 08, 2022 N/A N/A :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A - :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Jun 14, 2019 5 - Production/Stable pytest (<5,>=3) + :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Dec 31, 2022 5 - Production/Stable pytest (>=7) :pypi:`pytest-remfiles` Pytest plugin to create a temporary directory with remote files Jul 01, 2019 5 - Production/Stable N/A - :pypi:`pytest-remotedata` Pytest plugin for controlling remote data access. Dec 21, 2021 3 - Alpha pytest (>=4.6) + :pypi:`pytest-remotedata` Pytest plugin for controlling remote data access. Dec 12, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-remote-response` Pytest plugin for capturing and mocking connection requests. Jun 05, 2022 4 - Beta pytest (>=4.6) :pypi:`pytest-remove-stale-bytecode` py.test plugin to remove stale byte code files. Mar 04, 2020 4 - Beta pytest :pypi:`pytest-reorder` Reorder tests depending on their paths and names. May 31, 2018 4 - Beta pytest @@ -870,6 +885,7 @@ This list contains 1173 plugins. :pypi:`pytest-report` Creates json report that is compatible with atom.io's linter message format May 11, 2016 4 - Beta N/A :pypi:`pytest-reporter` Generate Pytest reports with templates Jul 22, 2021 4 - Beta pytest :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest Jun 08, 2021 4 - Beta N/A + :pypi:`pytest-reporter-html-dots` A basic HTML report for pytest using Jinja2 template engine. Jan 22, 2023 N/A N/A :pypi:`pytest-reportinfra` Pytest plugin for reportinfra Aug 11, 2019 3 - Alpha N/A :pypi:`pytest-reporting` A plugin to report summarized results in a table format Oct 25, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility Dec 11, 2020 3 - Alpha pytest (>=5.2) @@ -883,10 +899,10 @@ This list contains 1173 plugins. :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Sep 20, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) - :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Nov 22, 2022 5 - Production/Stable pytest (>=5.3) + :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Jan 12, 2023 5 - Production/Stable pytest (>=5.3) :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A :pypi:`pytest-reserial` Pytest fixture for recording and replaying serial port traffic. Nov 29, 2022 4 - Beta pytest - :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Nov 17, 2022 N/A N/A + :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Dec 12, 2022 N/A N/A :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-resource-usage` Pytest plugin for reporting running time and peak memory usage Nov 06, 2022 5 - Production/Stable pytest>=7.0.0 @@ -894,6 +910,7 @@ This list contains 1173 plugins. :pypi:`pytest-responses` py.test integration for responses Oct 11, 2022 N/A pytest (>=2.5) :pypi:`pytest-rest-api` Aug 08, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-result-log` Write the execution result of the case to the log Jan 07, 2023 N/A pytest>=7.2.0 :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Aug 16, 2022 N/A pytest (>=7.0.0) :pypi:`pytest-reverse` Pytest plugin to reverse test order. May 11, 2022 5 - Production/Stable pytest @@ -907,7 +924,7 @@ This list contains 1173 plugins. :pypi:`pytest-rocketchat` Pytest to Rocket.Chat reporting plugin Apr 18, 2021 5 - Production/Stable N/A :pypi:`pytest-rotest` Pytest integration with rotest Sep 08, 2019 N/A pytest (>=3.5.0) :pypi:`pytest-rpc` Extend py.test for RPC OpenStack testing. Feb 22, 2019 4 - Beta pytest (~=3.6) - :pypi:`pytest-rst` Test code from RST documents with pytest Aug 02, 2022 N/A N/A + :pypi:`pytest-rst` Test code from RST documents with pytest Jan 26, 2023 N/A N/A :pypi:`pytest-rt` pytest data collector plugin for Testgr May 05, 2022 N/A N/A :pypi:`pytest-rts` Coverage-based regression test selection (RTS) plugin for pytest May 17, 2021 N/A pytest :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest @@ -918,30 +935,32 @@ This list contains 1173 plugins. :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Oct 31, 2022 3 - Alpha N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A - :pypi:`pytest-salt-factories` Pytest Salt Plugin Dec 02, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-factories` Pytest Salt Plugin Dec 15, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Dec 03, 2022 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jan 26, 2023 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A + :pypi:`pytest-schedule` The job of test scheduling for humans. Jan 07, 2023 5 - Production/Stable N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 21, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Dec 03, 2022 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jan 26, 2023 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A - :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Nov 22, 2022 N/A pytest + :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Jan 05, 2023 N/A N/A :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A - :pypi:`pytest-servers` pytest servers Nov 09, 2022 3 - Alpha pytest (>=6.2) + :pypi:`pytest-servers` pytest servers Jan 20, 2023 3 - Alpha pytest (>=6.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :pypi:`pytest-session2file` pytest-session2file (aka: pytest-session_to_file for v0.1.0 - v0.1.2) is a py.test plugin for capturing and saving to file the stdout of py.test. Jan 26, 2021 3 - Alpha pytest :pypi:`pytest-session-fixture-globalize` py.test plugin to make session fixtures behave as if written in conftest, even if it is written in some modules May 15, 2018 4 - Beta N/A :pypi:`pytest-session_to_file` pytest-session_to_file is a py.test plugin for capturing and saving to file the stdout of py.test. Oct 01, 2015 3 - Alpha N/A + :pypi:`pytest-setupinfo` Displaying setup info during pytest command run Jan 23, 2023 N/A N/A :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest :pypi:`pytest-share-hdf` Plugin to save test data in HDF files and retrieve them for comparison Sep 21, 2022 4 - Beta pytest (>=3.5.0) @@ -949,19 +968,21 @@ This list contains 1173 plugins. :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Sep 23, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest - :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Nov 18, 2021 5 - Production/Stable pytest (>=3.5.1) + :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Jan 16, 2023 5 - Production/Stable pytest (>=3.5.1) :pypi:`pytest-shortcuts` Expand command-line shortcuts listed in pytest configuration Oct 29, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-shutil` A goodie-bag of unix shell and environment tools for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-simplehttpserver` Simple pytest fixture to spin up an HTTP server Jun 24, 2021 4 - Beta N/A :pypi:`pytest-simple-plugin` Simple pytest plugin Nov 27, 2019 N/A N/A :pypi:`pytest-simple-settings` simple-settings plugin for pytest Nov 17, 2020 4 - Beta pytest :pypi:`pytest-single-file-logging` Allow for multiple processes to log to a single file May 05, 2016 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-skip-markers` Pytest Salt Plugin May 09, 2022 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-skip-markers` Pytest Salt Plugin Dec 20, 2022 5 - Production/Stable pytest (>=7.1.0) :pypi:`pytest-skipper` A plugin that selects only tests with changes in execution path Mar 26, 2017 3 - Alpha pytest (>=3.0.6) :pypi:`pytest-skippy` Automatically skip tests that don't need to run! Jan 27, 2018 3 - Alpha pytest (>=2.3.4) :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Apr 26, 2022 N/A pytest>=6.2.0 :pypi:`pytest-slack` Pytest to Slack reporting plugin Dec 15, 2020 5 - Production/Stable N/A :pypi:`pytest-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A + :pypi:`pytest-slowest-first` Sort tests by their last duration, slowest first Dec 11, 2022 4 - Beta N/A + :pypi:`pytest-slow-last` Run tests in order of execution time (faster tests first) Dec 10, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-smartcollect` A plugin for collecting tests that touch changed code Oct 04, 2018 N/A pytest (>=3.5.0) :pypi:`pytest-smartcov` Smart coverage plugin for pytest. Sep 30, 2017 3 - Alpha N/A :pypi:`pytest-smell` Automated bad smell detection tool for Pytest Jun 26, 2022 N/A N/A @@ -983,7 +1004,7 @@ This list contains 1173 plugins. :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. May 04, 2021 N/A N/A :pypi:`pytest-spec2md` Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. Jun 26, 2022 N/A pytest (>7.0) - :pypi:`pytest-speed` Modern benchmarking library for python with pytest integration. Jul 06, 2022 3 - Alpha pytest (>=7) + :pypi:`pytest-speed` Modern benchmarking library for python with pytest integration. Jan 22, 2023 3 - Alpha pytest>=7 :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Sep 06, 2022 4 - Beta pytest (>=7.0.0) :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Sep 09, 2022 6 - Mature pytest (>=3.0.0) @@ -992,13 +1013,14 @@ This list contains 1173 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Nov 29, 2022 N/A pytest (>5.4.0,<7.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Jan 26, 2023 N/A pytest (>5.4.0,<7.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Mar 13, 2018 3 - Alpha N/A :pypi:`pytest-sqlalchemy-mock` pytest sqlalchemy plugin for mock Sep 25, 2022 3 - Alpha pytest (>=2.0) :pypi:`pytest-sql-bigquery` Yet another SQL-testing framework for BigQuery provided by pytest plugin Dec 19, 2019 N/A pytest + :pypi:`pytest-sqlfluff` A pytest plugin to use sqlfluff to enable format checking of sql files. Dec 21, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-squadcast` Pytest report plugin for Squadcast Feb 22, 2022 5 - Production/Stable pytest :pypi:`pytest-srcpaths` Add paths to sys.path Oct 15, 2021 N/A pytest>=6.2.0 :pypi:`pytest-ssh` pytest plugin for ssh command run May 27, 2019 N/A pytest @@ -1007,21 +1029,20 @@ This list contains 1173 plugins. :pypi:`pytest-stepfunctions` A small description May 08, 2021 4 - Beta pytest :pypi:`pytest-steps` Create step-wise / incremental tests in pytest. Sep 23, 2021 5 - Production/Stable N/A :pypi:`pytest-stepwise` Run a test suite one failing test at a time. Dec 01, 2015 4 - Beta N/A - :pypi:`pytest-stf` pytest plugin for openSTF Dec 02, 2022 N/A pytest (>=5.0) + :pypi:`pytest-stf` pytest plugin for openSTF Dec 04, 2022 N/A pytest (>=5.0) :pypi:`pytest-stoq` A plugin to pytest stoq Feb 09, 2021 4 - Beta N/A :pypi:`pytest-stress` A Pytest plugin that allows you to loop tests for a user defined amount of time. Dec 07, 2019 4 - Beta pytest (>=3.6.0) - :pypi:`pytest-structlog` Structured logging assertions Sep 21, 2021 N/A pytest + :pypi:`pytest-structlog` Structured logging assertions Dec 18, 2022 N/A pytest :pypi:`pytest-structmpd` provide structured temporary directory Oct 17, 2018 N/A N/A :pypi:`pytest-stub` Stub packages, modules and attributes. Apr 28, 2020 5 - Production/Stable N/A :pypi:`pytest-stubprocess` Provide stub implementations for subprocesses in Python tests Sep 17, 2018 3 - Alpha pytest (>=3.5.0) :pypi:`pytest-study` A pytest plugin to organize long run tests (named studies) without interfering the regular tests Sep 26, 2017 3 - Alpha pytest (>=2.0) - :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Oct 02, 2022 5 - Production/Stable pytest (>=4.0.0) + :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Jan 28, 2023 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Jul 16, 2022 N/A N/A :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Oct 28, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Nov 05, 2022 3 - Alpha pytest (>=2.9) - :pypi:`pytest-sugar-bugfix159` Workaround for https://github.com/Frozenball/pytest-sugar/issues/159 Nov 07, 2018 5 - Production/Stable pytest (!=3.7.3,>=3.5); extra == 'testing' - :pypi:`pytest-super-check` Pytest plugin to check your TestCase classes call super in setUp, tearDown, etc. May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-summary` A pytest plugin to send a report and printing summary of tests. Jan 04, 2023 5 - Production/Stable N/A :pypi:`pytest-svn` SVN repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-symbols` pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. Nov 20, 2017 3 - Alpha N/A :pypi:`pytest-system-statistics` Pytest plugin to track and report system usage statistics Feb 16, 2022 5 - Production/Stable pytest (>=6.0.0) @@ -1036,6 +1057,7 @@ This list contains 1173 plugins. :pypi:`pytest-tcpclient` A pytest plugin for testing TCP clients Nov 16, 2022 N/A pytest (<8,>=7.1.3) :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A + :pypi:`pytest-telegram-notifier` Telegram notification plugin for Pytest Jan 23, 2023 5 - Production/Stable N/A :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) :pypi:`pytest-terra-fixt` Terraform and Terragrunt fixtures for pytest Sep 15, 2022 N/A pytest (==6.2.5) :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Sep 01, 2022 N/A pytest (>=6.0) @@ -1048,7 +1070,7 @@ This list contains 1173 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Dec 01, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Nov 23, 2022 4 - Beta N/A + :pypi:`pytest-testmon` selects tests affected by changed files and methods Jan 25, 2023 4 - Beta pytest (<8,>=5) :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) :pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Jun 13, 2022 4 - Beta N/A :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) @@ -1067,7 +1089,7 @@ This list contains 1173 plugins. :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) :pypi:`pytest-test-utils` Jul 14, 2022 N/A pytest (>=5) - :pypi:`pytest-tesults` Tesults plugin for pytest Dec 31, 2021 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-tesults` Tesults plugin for pytest Dec 23, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-tezos` pytest-ligo Jan 16, 2020 4 - Beta N/A :pypi:`pytest-th2-bdd` pytest_th2_bdd May 13, 2022 N/A N/A :pypi:`pytest-thawgun` Pytest plugin for time travel May 26, 2020 3 - Alpha N/A @@ -1087,7 +1109,7 @@ This list contains 1173 plugins. :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest :pypi:`pytest-tmpfs` A pytest plugin that helps you on using a temporary filesystem for testing. Aug 29, 2022 N/A pytest :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Aug 12, 2022 N/A N/A - :pypi:`pytest-tmux` Sep 22, 2022 4 - Beta N/A + :pypi:`pytest-tmux` A pytest plugin that enables tmux driven tests Dec 31, 2022 4 - Beta N/A :pypi:`pytest-todo` A small plugin for the pytest testing framework, marking TODO comments as failure May 23, 2019 4 - Beta pytest :pypi:`pytest-tomato` Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-toolbelt` This is just a collection of utilities for pytest, but don't really belong in pytest proper. Aug 12, 2019 3 - Alpha N/A @@ -1109,7 +1131,7 @@ This list contains 1173 plugins. :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Apr 27, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A - :pypi:`pytest-tui` Text User Interface (TUI) and HTML report for Pytest test runs Sep 21, 2022 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) and HTML report for Pytest test runs Jan 17, 2023 4 - Beta pytest (>=6.2.5) :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Oct 16, 2022 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) @@ -1118,7 +1140,8 @@ This list contains 1173 plugins. :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) :pypi:`pytest-ubersmith` Easily mock calls to ubersmith at the \`requests\` level. Apr 13, 2015 N/A N/A :pypi:`pytest-ui` Text User Interface for running python tests Jul 05, 2021 4 - Beta pytest - :pypi:`pytest-ui-failed-screenshot` UI自动测试失败时自动截图,并将截图加入到测试报告中 Nov 16, 2022 N/A N/A + :pypi:`pytest-ui-failed-screenshot` UI自动测试失败时自动截图,并将截图加入到测试报告中 Dec 06, 2022 N/A N/A + :pypi:`pytest-ui-failed-screenshot-allure` UI自动测试失败时自动截图,并将截图加入到Allure测试报告中 Dec 06, 2022 N/A N/A :pypi:`pytest-unflakable` Unflakable plugin for PyTest Oct 26, 2022 4 - Beta pytest (>=6.2.0) :pypi:`pytest-unhandled-exception-exit-code` Plugin for py.test set a different exit code on uncaught exceptions Jun 22, 2020 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) @@ -1136,7 +1159,7 @@ This list contains 1173 plugins. :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest :pypi:`pytest-vcs` Sep 22, 2022 4 - Beta N/A :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest - :pypi:`pytest-ver` Pytest module with Verification Protocol, Verification Report and Trace Matrix Nov 07, 2022 2 - Pre-Alpha N/A + :pypi:`pytest-ver` Pytest module with Verification Protocol, Verification Report and Trace Matrix Jan 23, 2023 2 - Pre-Alpha N/A :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) :pypi:`pytest-virtualenv` Virtualenv fixture for py.test May 28, 2019 5 - Production/Stable pytest @@ -1150,7 +1173,7 @@ This list contains 1173 plugins. :pypi:`pytest-wa-e2e-plugin` Pytest plugin for testing whatsapp bots with end to end tests Feb 18, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-wake` Sep 28, 2022 N/A pytest :pypi:`pytest-watch` Local continuous test runner with pytest and watchdog. May 20, 2018 N/A N/A - :pypi:`pytest-watcher` Continiously runs pytest on changes in \*.py files Oct 30, 2022 3 - Alpha N/A + :pypi:`pytest-watcher` Continiously runs pytest on changes in \*.py files Dec 11, 2022 3 - Alpha N/A :pypi:`pytest-wdl` Pytest plugin for testing WDL workflows. Nov 17, 2020 5 - Production/Stable N/A :pypi:`pytest-web3-data` Sep 15, 2022 4 - Beta pytest :pypi:`pytest-webdriver` Selenium webdriver fixture for py.test May 28, 2019 5 - Production/Stable pytest @@ -1161,7 +1184,7 @@ This list contains 1173 plugins. :pypi:`pytest-winnotify` Windows tray notifications for py.test results. Apr 22, 2016 N/A N/A :pypi:`pytest-wiremock` A pytest plugin for programmatically using wiremock in integration tests Mar 27, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-with-docker` pytest with docker helpers. Nov 09, 2021 N/A pytest - :pypi:`pytest-workflow` A pytest plugin for configuring workflow/pipeline tests using YAML files Dec 03, 2021 5 - Production/Stable pytest (>=5.4.0) + :pypi:`pytest-workflow` A pytest plugin for configuring workflow/pipeline tests using YAML files Jan 13, 2023 5 - Production/Stable pytest (>=7.0.0) :pypi:`pytest-xdist` pytest xdist plugin for distributed testing, most importantly across multiple CPUs Dec 03, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-xdist-debug-for-graingert` pytest xdist plugin for distributed testing and loop-on-failing modes Jul 24, 2019 5 - Production/Stable pytest (>=4.4.0) :pypi:`pytest-xdist-forked` forked from pytest-xdist Feb 10, 2020 5 - Production/Stable pytest (>=4.4.0) @@ -1169,9 +1192,9 @@ This list contains 1173 plugins. :pypi:`pytest-xfaillist` Maintain a xfaillist in an additional file to avoid merge-conflicts. Sep 17, 2021 N/A pytest (>=6.2.2,<7.0.0) :pypi:`pytest-xfiles` Pytest fixtures providing data read from function, module or package related (x)files. Feb 27, 2018 N/A N/A :pypi:`pytest-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A - :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Nov 06, 2022 N/A pytest>=7.1.2 + :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Dec 13, 2022 N/A pytest>=7.2.0 :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest - :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Nov 27, 2022 4 - Beta pytest (>=2.8) + :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Jan 05, 2023 4 - Beta pytest (>=2.8) :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) @@ -1179,15 +1202,15 @@ This list contains 1173 plugins. :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yamlwsgi` Run tests against wsgi apps defined in yaml May 11, 2010 N/A N/A - :pypi:`pytest-yaml-yoyo` http/https API run by yaml Nov 30, 2022 N/A N/A + :pypi:`pytest-yaml-yoyo` http/https API run by yaml Dec 17, 2022 N/A N/A :pypi:`pytest-yapf` Run yapf Jul 06, 2017 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) :pypi:`pytest-yield` PyTest plugin to run tests concurrently, each \`yield\` switch context to other one Jan 23, 2019 N/A N/A - :pypi:`pytest-yls` Pytest plugin to test the YLS as a whole. Oct 21, 2022 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-yls` Pytest plugin to test the YLS as a whole. Jan 10, 2023 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A pytest>=5.0.0 :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A - :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Jun 02, 2022 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Dec 12, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zest` Zesty additions to pytest. Nov 17, 2022 N/A N/A :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest @@ -1204,7 +1227,7 @@ This list contains 1173 plugins. A contextmanager pytest fixture for handling multiple mock abstracts :pypi:`pytest-accept` - *last release*: Jan 07, 2022, + *last release*: Dec 21, 2022, *status*: N/A, *requires*: pytest (>=6,<8) @@ -1281,9 +1304,9 @@ This list contains 1173 plugins. Pytest plugin for aiohttp support :pypi:`pytest-aiohttp-client` - *last release*: Nov 01, 2020, + *last release*: Jan 10, 2023, *status*: N/A, - *requires*: pytest (>=6) + *requires*: pytest (>=7.2.0,<8.0.0) Pytest \`client\` fixture for the Aiohttp @@ -1456,7 +1479,7 @@ This list contains 1173 plugins. Pytest fixtures to assert anything and something :pypi:`pytest-aoc` - *last release*: Dec 02, 2022, + *last release*: Dec 08, 2022, *status*: N/A, *requires*: pytest ; extra == 'test' @@ -1512,15 +1535,15 @@ This list contains 1173 plugins. A plugin to use approvaltests with pytest :pypi:`pytest-approvaltests-geo` - *last release*: Nov 29, 2022, + *last release*: Dec 21, 2022, *status*: 5 - Production/Stable, *requires*: pytest Extension for ApprovalTests.Python specific to geo data verification :pypi:`pytest-archon` - *last release*: Nov 29, 2022, - *status*: N/A, + *last release*: Jan 09, 2023, + *status*: 5 - Production/Stable, *requires*: pytest (>=7.2) Rule your architecture like a real developer @@ -1631,7 +1654,7 @@ This list contains 1173 plugins. :pypi:`pytest-asyncio` - *last release*: Nov 11, 2022, + *last release*: Dec 08, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.1.0) @@ -1764,7 +1787,7 @@ This list contains 1173 plugins. pytest plugin for axe-selenium-python :pypi:`pytest-azure` - *last release*: Oct 10, 2022, + *last release*: Jan 18, 2023, *status*: 3 - Alpha, *requires*: pytest @@ -1890,7 +1913,7 @@ This list contains 1173 plugins. A BigchainDB plugin for pytest. :pypi:`pytest-bigquery-mock` - *last release*: Aug 05, 2021, + *last release*: Dec 28, 2022, *status*: N/A, *requires*: pytest (>=5.0) @@ -1925,7 +1948,7 @@ This list contains 1173 plugins. A pytest plugin helps developers to debug by providing useful commits history. :pypi:`pytest-blender` - *last release*: Jun 16, 2022, + *last release*: Jan 04, 2023, *status*: N/A, *requires*: pytest ; extra == 'dev' @@ -2036,6 +2059,13 @@ This list contains 1173 plugins. \`\`py.test\`\` plugin to run \`\`BrowserStackLocal\`\` in background. + :pypi:`pytest-budosystems` + *last release*: Jan 22, 2023, + *status*: N/A, + *requires*: pytest ; extra == 'test' + + Budo Systems Pytest Plugin. + :pypi:`pytest-bug` *last release*: Apr 13, 2022, *status*: 5 - Production/Stable, @@ -2093,7 +2123,7 @@ This list contains 1173 plugins. pytest plugin with mechanisms for caching across test runs :pypi:`pytest-cache-assert` - *last release*: Oct 19, 2022, + *last release*: Jan 10, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0.0) @@ -2240,7 +2270,7 @@ This list contains 1173 plugins. A pytest fixture for changing current working directory :pypi:`pytest-check` - *last release*: Dec 02, 2022, + *last release*: Jan 13, 2023, *status*: 5 - Production/Stable, *requires*: pytest @@ -2277,7 +2307,7 @@ This list contains 1173 plugins. :pypi:`pytest-check-links` *last release*: Jul 29, 2020, *status*: N/A, - *requires*: pytest (>=7.0) + *requires*: pytest>=7.0 Check links in files @@ -2380,12 +2410,19 @@ This list contains 1173 plugins. Distribute tests to cloud machines without fuss :pypi:`pytest-cmake` - *last release*: Nov 30, 2022, - *status*: 1 - Planning, - *requires*: N/A + *last release*: Jan 21, 2023, + *status*: N/A, + *requires*: pytest<8,>=4 Provide CMake module for Pytest + :pypi:`pytest-cmake-presets` + *last release*: Dec 26, 2022, + *status*: N/A, + *requires*: pytest (>=7.2.0,<8.0.0) + + Execute CMake Presets via pytest + :pypi:`pytest-cobra` *last release*: Jun 29, 2019, *status*: 3 - Alpha, @@ -2484,6 +2521,13 @@ This list contains 1173 plugins. pytest framework for testing different aspects of a common method + :pypi:`pytest-compare` + *last release*: Jan 22, 2023, + *status*: 5 - Production/Stable, + *requires*: pytest + + pytest plugin for comparing call arguments. + :pypi:`pytest-concurrent` *last release*: Jan 12, 2019, *status*: 4 - Beta, @@ -2611,7 +2655,7 @@ This list contains 1173 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Nov 07, 2022, + *last release*: Jan 23, 2023, *status*: N/A, *requires*: N/A @@ -2828,7 +2872,7 @@ This list contains 1173 plugins. A pytest plugin for managing an archive of test data. :pypi:`pytest-datarecorder` - *last release*: Apr 20, 2020, + *last release*: Jan 08, 2023, *status*: 5 - Production/Stable, *requires*: pytest @@ -3549,49 +3593,49 @@ This list contains 1173 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Nov 07, 2022, + *last release*: Jan 05, 2023, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Nov 07, 2022, + *last release*: Jan 05, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Nov 07, 2022, + *last release*: Jan 05, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Nov 07, 2022, + *last release*: Jan 05, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Nov 07, 2022, + *last release*: Jan 05, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Nov 07, 2022, + *last release*: Jan 05, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Nov 07, 2022, + *last release*: Jan 05, 2023, *status*: N/A, *requires*: N/A @@ -3619,7 +3663,7 @@ This list contains 1173 plugins. Pytest plugin to represent test output with emoji support :pypi:`pytest-enabler` - *last release*: Nov 23, 2022, + *last release*: Jan 27, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=6) ; extra == 'testing' @@ -3639,6 +3683,13 @@ This list contains 1173 plugins. set your encoding and logger + :pypi:`pytest-enhanced-reports` + *last release*: Dec 15, 2022, + *status*: N/A, + *requires*: N/A + + Enhanced test reports for pytest + :pypi:`pytest-enhancements` *last release*: Oct 30, 2019, *status*: 4 - Beta, @@ -3772,6 +3823,13 @@ This list contains 1173 plugins. py.test plugin to store test expectations and mark tests based on them + :pypi:`pytest-expectdir` + *last release*: Jan 24, 2023, + *status*: 5 - Production/Stable, + *requires*: pytest (>=5.0) + + A pytest plugin to provide initial/expected directories, and check a test transforms the initial directory to the expected one + :pypi:`pytest-expecter` *last release*: Sep 18, 2022, *status*: 5 - Production/Stable, @@ -3864,7 +3922,7 @@ This list contains 1173 plugins. Simple factoryboy random state management :pypi:`pytest-failed-screen-record` - *last release*: Nov 29, 2022, + *last release*: Jan 05, 2023, *status*: 4 - Beta, *requires*: pytest (>=7.1.2d,<8.0.0) @@ -3941,7 +3999,7 @@ This list contains 1173 plugins. Use SCM and coverage to run only needed tests :pypi:`pytest-fast-first` - *last release*: Apr 02, 2021, + *last release*: Jan 19, 2023, *status*: 3 - Alpha, *requires*: pytest @@ -3997,7 +4055,7 @@ This list contains 1173 plugins. run test cases filter by mark :pypi:`pytest-filter-subpackage` - *last release*: Jan 09, 2020, + *last release*: Dec 12, 2022, *status*: 3 - Alpha, *requires*: pytest (>=3.0) @@ -4025,11 +4083,11 @@ This list contains 1173 plugins. pytest plugin to manipulate firefox :pypi:`pytest-fixture-classes` - *last release*: Nov 14, 2022, + *last release*: Jan 20, 2023, *status*: 4 - Beta, *requires*: pytest - Give you the ability to write typed fixture classes that work well with dependency injection, autocompletetion, type checkers, and language servers + Fixtures as classes that work well with dependency injection, autocompletetion, type checkers, and language servers :pypi:`pytest-fixture-config` *last release*: May 28, 2019, @@ -4354,7 +4412,7 @@ This list contains 1173 plugins. Plugin for py.test that associates tests with github issues using a marker. :pypi:`pytest-github-actions-annotate-failures` - *last release*: Jul 02, 2022, + *last release*: Dec 19, 2022, *status*: N/A, *requires*: pytest (>=4.0.0) @@ -4444,6 +4502,13 @@ This list contains 1173 plugins. Display "🔨 " instead of "." for passed pytest tests. + :pypi:`pytest-harmony` + *last release*: Jan 17, 2023, + *status*: N/A, + *requires*: pytest (>=7.2.1,<8.0.0) + + Chain tests and data with pytest + :pypi:`pytest-harvest` *last release*: Jun 10, 2022, *status*: 5 - Production/Stable, @@ -4515,7 +4580,7 @@ This list contains 1173 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Dec 03, 2022, + *last release*: Jan 23, 2023, *status*: 3 - Alpha, *requires*: pytest (==7.2.0) @@ -4535,6 +4600,13 @@ This list contains 1173 plugins. Report on tests that honor constraints, and guard against regressions + :pypi:`pytest-hot-test` + *last release*: Dec 10, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + A plugin that tracks test changes + :pypi:`pytest-hoverfly` *last release*: Nov 17, 2022, *status*: N/A, @@ -4648,16 +4720,16 @@ This list contains 1173 plugins. pytest-httpserver is a httpserver for pytest :pypi:`pytest-httptesting` - *last release*: Nov 16, 2022, + *last release*: Dec 08, 2022, *status*: N/A, *requires*: pytest (>=7.2.0,<8.0.0) http_testing framework on top of pytest :pypi:`pytest-httpx` - *last release*: Nov 03, 2022, + *last release*: Jan 20, 2023, *status*: 5 - Production/Stable, - *requires*: pytest (<8.*,>=6.*) + *requires*: pytest (<8.0,>=6.0) Send responses to httpx. @@ -4788,7 +4860,7 @@ This list contains 1173 plugins. A pytest plugin for writing inline tests. :pypi:`pytest-inmanta` - *last release*: Oct 07, 2022, + *last release*: Jan 20, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -4802,7 +4874,7 @@ This list contains 1173 plugins. Inmanta tests package :pypi:`pytest-inmanta-lsm` - *last release*: Sep 16, 2022, + *last release*: Jan 27, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -4886,7 +4958,7 @@ This list contains 1173 plugins. Run tests covering a specific file or changeset :pypi:`pytest-ipdb` - *last release*: Sep 02, 2014, + *last release*: Mar 20, 2013, *status*: 2 - Pre-Alpha, *requires*: N/A @@ -4977,12 +5049,19 @@ This list contains 1173 plugins. Plugin skips (xfail) tests if unresolved Jira issue(s) linked :pypi:`pytest-jira-xray` - *last release*: Aug 25, 2022, + *last release*: Jan 02, 2023, *status*: 4 - Beta, *requires*: pytest pytest plugin to integrate tests with JIRA XRAY + :pypi:`pytest-job-selection` + *last release*: Jan 28, 2023, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + A pytest plugin for load balancing test suites + :pypi:`pytest-jobserver` *last release*: May 15, 2019, *status*: 5 - Production/Stable, @@ -5033,7 +5112,7 @@ This list contains 1173 plugins. pytest plugin supporting json test report output :pypi:`pytest-jupyter` - *last release*: Nov 30, 2022, + *last release*: Dec 19, 2022, *status*: 4 - Beta, *requires*: pytest @@ -5053,6 +5132,20 @@ This list contains 1173 plugins. A plugin to send pytest events to Kafka + :pypi:`pytest-kasima` + *last release*: Jan 26, 2023, + *status*: 5 - Production/Stable, + *requires*: pytest (>=7.2.1,<8.0.0) + + Display horizontal lines above and below the captured standard output for easy viewing. + + :pypi:`pytest-keep-together` + *last release*: Dec 07, 2022, + *status*: 5 - Production/Stable, + *requires*: pytest + + Pytest plugin to customize test ordering by running all 'related' tests together + :pypi:`pytest-kexi` *last release*: Apr 29, 2022, *status*: N/A, @@ -5222,9 +5315,9 @@ This list contains 1173 plugins. Profile code executed by pytest :pypi:`pytest-line-profiler-apn` - *last release*: Aug 14, 2022, - *status*: 4 - Beta, - *requires*: N/A + *last release*: Dec 05, 2022, + *status*: N/A, + *requires*: pytest (>=3.5.0) Profile code executed by pytest @@ -5256,6 +5349,13 @@ This list contains 1173 plugins. Live results for pytest + :pypi:`pytest-local-badge` + *last release*: Jan 15, 2023, + *status*: N/A, + *requires*: pytest (>=6.1.0) + + Generate local badges (shields) reporting your test suite status. + :pypi:`pytest-localftpserver` *last release*: Oct 04, 2022, *status*: 5 - Production/Stable, @@ -5264,7 +5364,7 @@ This list contains 1173 plugins. A PyTest plugin which provides an FTP fixture for your tests :pypi:`pytest-localserver` - *last release*: Aug 30, 2022, + *last release*: Jan 26, 2023, *status*: 4 - Beta, *requires*: N/A @@ -5341,9 +5441,9 @@ This list contains 1173 plugins. :pypi:`pytest-logikal` - *last release*: Dec 03, 2022, + *last release*: Jan 26, 2023, *status*: 5 - Production/Stable, - *requires*: pytest (==7.2.0) + *requires*: pytest (==7.2.1) Common testing environment @@ -5369,7 +5469,7 @@ This list contains 1173 plugins. pytest plugin for looping tests :pypi:`pytest-lsp` - *last release*: Oct 15, 2022, + *last release*: Jan 14, 2023, *status*: 3 - Alpha, *requires*: pytest @@ -5635,7 +5735,7 @@ This list contains 1173 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Oct 27, 2022, + *last release*: Jan 19, 2023, *status*: N/A, *requires*: pytest (>=1.0) @@ -5782,16 +5882,16 @@ This list contains 1173 plugins. Utility for writing multi-host tests for pytest :pypi:`pytest-multilog` - *last release*: Sep 18, 2022, + *last release*: Jan 17, 2023, *status*: N/A, *requires*: pytest Multi-process logs handling and other helpers for pytest :pypi:`pytest-multithreading` - *last release*: Aug 12, 2021, + *last release*: Dec 07, 2022, *status*: N/A, - *requires*: pytest (>=3.6) + *requires*: N/A a pytest plugin for th and concurrent testing @@ -5810,7 +5910,7 @@ This list contains 1173 plugins. Add the mutation testing feature to pytest :pypi:`pytest-mypy` - *last release*: Nov 25, 2022, + *last release*: Dec 18, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.2) ; python_version >= "3.10" @@ -5866,7 +5966,7 @@ This list contains 1173 plugins. pytest-neo is a plugin for pytest that shows tests like screen of Matrix. :pypi:`pytest-netdut` - *last release*: Nov 22, 2022, + *last release*: Jan 11, 2023, *status*: N/A, *requires*: pytest (>=3.5.0) @@ -5922,7 +6022,7 @@ This list contains 1173 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Dec 01, 2022, + *last release*: Jan 09, 2023, *status*: N/A, *requires*: pytest (==6.2.5) @@ -6048,7 +6148,7 @@ This list contains 1173 plugins. pytest plugin to test OpenERP modules :pypi:`pytest-ogsm-plugin` - *last release*: Nov 17, 2022, + *last release*: Jan 09, 2023, *status*: N/A, *requires*: N/A @@ -6153,7 +6253,7 @@ This list contains 1173 plugins. OS X notifications for py.test results. :pypi:`pytest-otel` - *last release*: Oct 19, 2022, + *last release*: Jan 18, 2023, *status*: N/A, *requires*: N/A @@ -6194,6 +6294,13 @@ This list contains 1173 plugins. a pytest plugin for parallel and concurrent testing + :pypi:`pytest-parallelize-tests` + *last release*: Jan 27, 2023, + *status*: 4 - Beta, + *requires*: N/A + + pytest plugin that parallelizes test execution across multiple hosts + :pypi:`pytest-param` *last release*: Sep 11, 2016, *status*: 4 - Beta, @@ -6229,6 +6336,13 @@ This list contains 1173 plugins. Pytest decorator for parametrizing tests with default iterables. + :pypi:`pytest-parametrize-suite` + *last release*: Jan 19, 2023, + *status*: 5 - Production/Stable, + *requires*: pytest + + A simple pytest extension for creating a named test suite. + :pypi:`pytest-parawtf` *last release*: Dec 03, 2018, *status*: 4 - Beta, @@ -6453,6 +6567,13 @@ This list contains 1173 plugins. A pytest fixture for visual testing with Playwright + :pypi:`pytest-plone` + *last release*: Jan 05, 2023, + *status*: 3 - Alpha, + *requires*: pytest + + Pytest plugin to test Plone addons + :pypi:`pytest-plt` *last release*: Aug 17, 2020, *status*: 5 - Production/Stable, @@ -6468,9 +6589,9 @@ This list contains 1173 plugins. A plugin to help developing and testing other plugins :pypi:`pytest-plus` - *last release*: Mar 19, 2020, + *last release*: Dec 24, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=3.50) + *requires*: pytest (>=6.0.1) PyTest Plus Plugin :: extends pytest functionality @@ -6482,7 +6603,7 @@ This list contains 1173 plugins. :pypi:`pytest-pointers` - *last release*: Oct 14, 2021, + *last release*: Dec 26, 2022, *status*: N/A, *requires*: N/A @@ -6580,8 +6701,8 @@ This list contains 1173 plugins. A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. :pypi:`pytest-pretty` - *last release*: Nov 03, 2022, - *status*: 4 - Beta, + *last release*: Jan 22, 2023, + *status*: 5 - Production/Stable, *requires*: pytest>=7 pytest plugin for printing summary data as I want it @@ -6691,6 +6812,13 @@ This list contains 1173 plugins. py.test plugin for purkinje test runner + :pypi:`pytest-pusher` + *last release*: Jan 06, 2023, + *status*: 5 - Production/Stable, + *requires*: pytest (>=3.6) + + pytest plugin for push report to minio + :pypi:`pytest-py125` *last release*: Dec 03, 2022, *status*: N/A, @@ -6727,7 +6855,7 @@ This list contains 1173 plugins. py.test plugin to connect to a remote debug server with PyDev or PyCharm. :pypi:`pytest-pydocstyle` - *last release*: Oct 28, 2022, + *last release*: Jan 05, 2023, *status*: 3 - Alpha, *requires*: N/A @@ -6748,7 +6876,7 @@ This list contains 1173 plugins. Record PyMySQL queries and mock with the stored data. :pypi:`pytest-pyodide` - *last release*: Nov 15, 2022, + *last release*: Jan 05, 2023, *status*: N/A, *requires*: pytest @@ -6783,7 +6911,7 @@ This list contains 1173 plugins. Pytest fixture "q" for pyq :pypi:`pytest-pyramid` - *last release*: Oct 15, 2021, + *last release*: Dec 13, 2022, *status*: 5 - Production/Stable, *requires*: pytest @@ -6825,7 +6953,7 @@ This list contains 1173 plugins. pytest plugin for a better developer experience when working with the PyTorch test suite :pypi:`pytest-pyvista` - *last release*: Nov 21, 2022, + *last release*: Jan 08, 2023, *status*: 4 - Beta, *requires*: pytest>=3.5.0 @@ -6993,7 +7121,7 @@ This list contains 1173 plugins. Test your README.md file :pypi:`pytest-reana` - *last release*: Nov 25, 2022, + *last release*: Dec 13, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -7056,7 +7184,7 @@ This list contains 1173 plugins. Management of Pytest dependencies via regex patterns :pypi:`pytest-regressions` - *last release*: Sep 17, 2022, + *last release*: Jan 13, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2.0) @@ -7077,9 +7205,9 @@ This list contains 1173 plugins. a pytest plugin that sorts tests using "before" and "after" markers :pypi:`pytest-relaxed` - *last release*: Jun 14, 2019, + *last release*: Dec 31, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (<5,>=3) + *requires*: pytest (>=7) Relaxed test discovery/organization for pytest @@ -7091,7 +7219,7 @@ This list contains 1173 plugins. Pytest plugin to create a temporary directory with remote files :pypi:`pytest-remotedata` - *last release*: Dec 21, 2021, + *last release*: Dec 12, 2022, *status*: 3 - Alpha, *requires*: pytest (>=4.6) @@ -7160,6 +7288,13 @@ This list contains 1173 plugins. A basic HTML report template for Pytest + :pypi:`pytest-reporter-html-dots` + *last release*: Jan 22, 2023, + *status*: N/A, + *requires*: N/A + + A basic HTML report for pytest using Jinja2 template engine. + :pypi:`pytest-reportinfra` *last release*: Aug 11, 2019, *status*: 3 - Alpha, @@ -7252,7 +7387,7 @@ This list contains 1173 plugins. Re-run only changed files in specified branch :pypi:`pytest-rerunfailures` - *last release*: Nov 22, 2022, + *last release*: Jan 12, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=5.3) @@ -7273,7 +7408,7 @@ This list contains 1173 plugins. Pytest fixture for recording and replaying serial port traffic. :pypi:`pytest-resilient-circuits` - *last release*: Nov 17, 2022, + *last release*: Dec 12, 2022, *status*: N/A, *requires*: N/A @@ -7328,6 +7463,13 @@ This list contains 1173 plugins. Pytest plugin to restrict the test types allowed + :pypi:`pytest-result-log` + *last release*: Jan 07, 2023, + *status*: N/A, + *requires*: pytest>=7.2.0 + + Write the execution result of the case to the log + :pypi:`pytest-rethinkdb` *last release*: Jul 24, 2016, *status*: 4 - Beta, @@ -7420,7 +7562,7 @@ This list contains 1173 plugins. Extend py.test for RPC OpenStack testing. :pypi:`pytest-rst` - *last release*: Aug 02, 2022, + *last release*: Jan 26, 2023, *status*: N/A, *requires*: N/A @@ -7497,7 +7639,7 @@ This list contains 1173 plugins. A Pytest plugin that builds and creates docker containers :pypi:`pytest-salt-factories` - *last release*: Dec 02, 2022, + *last release*: Dec 15, 2022, *status*: 4 - Beta, *requires*: pytest (>=6.0.0) @@ -7539,7 +7681,7 @@ This list contains 1173 plugins. :pypi:`pytest-sbase` - *last release*: Dec 03, 2022, + *last release*: Jan 26, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -7552,6 +7694,13 @@ This list contains 1173 plugins. pytest plugin for test scenarios + :pypi:`pytest-schedule` + *last release*: Jan 07, 2023, + *status*: 5 - Production/Stable, + *requires*: N/A + + The job of test scheduling for humans. + :pypi:`pytest-schema` *last release*: Mar 14, 2022, *status*: 5 - Production/Stable, @@ -7581,7 +7730,7 @@ This list contains 1173 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Dec 03, 2022, + *last release*: Jan 26, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -7609,9 +7758,9 @@ This list contains 1173 plugins. Send pytest execution result email :pypi:`pytest-sentry` - *last release*: Nov 22, 2022, + *last release*: Jan 05, 2023, *status*: N/A, - *requires*: pytest + *requires*: N/A A pytest plugin to send testrun information to Sentry.io @@ -7630,7 +7779,7 @@ This list contains 1173 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Nov 09, 2022, + *last release*: Jan 20, 2023, *status*: 3 - Alpha, *requires*: pytest (>=6.2) @@ -7664,6 +7813,13 @@ This list contains 1173 plugins. pytest-session_to_file is a py.test plugin for capturing and saving to file the stdout of py.test. + :pypi:`pytest-setupinfo` + *last release*: Jan 23, 2023, + *status*: N/A, + *requires*: N/A + + Displaying setup info during pytest command run + :pypi:`pytest-sftpserver` *last release*: Sep 16, 2019, *status*: 4 - Beta, @@ -7714,7 +7870,7 @@ This list contains 1173 plugins. Versatile ZODB abstraction layer - pytest fixtures :pypi:`pytest-sherlock` - *last release*: Nov 18, 2021, + *last release*: Jan 16, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=3.5.1) @@ -7763,9 +7919,9 @@ This list contains 1173 plugins. Allow for multiple processes to log to a single file :pypi:`pytest-skip-markers` - *last release*: May 09, 2022, + *last release*: Dec 20, 2022, *status*: 5 - Production/Stable, - *requires*: pytest (>=6.0.0) + *requires*: pytest (>=7.1.0) Pytest Salt Plugin @@ -7804,6 +7960,20 @@ This list contains 1173 plugins. A pytest plugin to skip \`@pytest.mark.slow\` tests by default. + :pypi:`pytest-slowest-first` + *last release*: Dec 11, 2022, + *status*: 4 - Beta, + *requires*: N/A + + Sort tests by their last duration, slowest first + + :pypi:`pytest-slow-last` + *last release*: Dec 10, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + Run tests in order of execution time (faster tests first) + :pypi:`pytest-smartcollect` *last release*: Oct 04, 2018, *status*: N/A, @@ -7952,9 +8122,9 @@ This list contains 1173 plugins. Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. :pypi:`pytest-speed` - *last release*: Jul 06, 2022, + *last release*: Jan 22, 2023, *status*: 3 - Alpha, - *requires*: pytest (>=7) + *requires*: pytest>=7 Modern benchmarking library for python with pytest integration. @@ -8015,7 +8185,7 @@ This list contains 1173 plugins. :pypi:`pytest-splunk-addon` - *last release*: Nov 29, 2022, + *last release*: Jan 26, 2023, *status*: N/A, *requires*: pytest (>5.4.0,<7.3) @@ -8063,6 +8233,13 @@ This list contains 1173 plugins. Yet another SQL-testing framework for BigQuery provided by pytest plugin + :pypi:`pytest-sqlfluff` + *last release*: Dec 21, 2022, + *status*: 4 - Beta, + *requires*: pytest (>=3.5.0) + + A pytest plugin to use sqlfluff to enable format checking of sql files. + :pypi:`pytest-squadcast` *last release*: Feb 22, 2022, *status*: 5 - Production/Stable, @@ -8120,7 +8297,7 @@ This list contains 1173 plugins. Run a test suite one failing test at a time. :pypi:`pytest-stf` - *last release*: Dec 02, 2022, + *last release*: Dec 04, 2022, *status*: N/A, *requires*: pytest (>=5.0) @@ -8141,7 +8318,7 @@ This list contains 1173 plugins. A Pytest plugin that allows you to loop tests for a user defined amount of time. :pypi:`pytest-structlog` - *last release*: Sep 21, 2021, + *last release*: Dec 18, 2022, *status*: N/A, *requires*: pytest @@ -8176,7 +8353,7 @@ This list contains 1173 plugins. A pytest plugin to organize long run tests (named studies) without interfering the regular tests :pypi:`pytest-subprocess` - *last release*: Oct 02, 2022, + *last release*: Jan 28, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=4.0.0) @@ -8210,19 +8387,12 @@ This list contains 1173 plugins. pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). - :pypi:`pytest-sugar-bugfix159` - *last release*: Nov 07, 2018, - *status*: 5 - Production/Stable, - *requires*: pytest (!=3.7.3,>=3.5); extra == 'testing' - - Workaround for https://github.com/Frozenball/pytest-sugar/issues/159 - - :pypi:`pytest-super-check` - *last release*: May 11, 2022, + :pypi:`pytest-summary` + *last release*: Jan 04, 2023, *status*: 5 - Production/Stable, - *requires*: pytest + *requires*: N/A - Pytest plugin to check your TestCase classes call super in setUp, tearDown, etc. + A pytest plugin to send a report and printing summary of tests. :pypi:`pytest-svn` *last release*: May 28, 2019, @@ -8322,6 +8492,13 @@ This list contains 1173 plugins. Pytest to Telegram reporting plugin + :pypi:`pytest-telegram-notifier` + *last release*: Jan 23, 2023, + *status*: 5 - Production/Stable, + *requires*: N/A + + Telegram notification plugin for Pytest + :pypi:`pytest-tempdir` *last release*: Oct 11, 2019, *status*: 4 - Beta, @@ -8407,9 +8584,9 @@ This list contains 1173 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Nov 23, 2022, + *last release*: Jan 25, 2023, *status*: 4 - Beta, - *requires*: N/A + *requires*: pytest (<8,>=5) selects tests affected by changed files and methods @@ -8540,7 +8717,7 @@ This list contains 1173 plugins. :pypi:`pytest-tesults` - *last release*: Dec 31, 2021, + *last release*: Dec 23, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=3.5.0) @@ -8680,11 +8857,11 @@ This list contains 1173 plugins. this is a vue-element ui report for pytest :pypi:`pytest-tmux` - *last release*: Sep 22, 2022, + *last release*: Dec 31, 2022, *status*: 4 - Beta, *requires*: N/A - + A pytest plugin that enables tmux driven tests :pypi:`pytest-todo` *last release*: May 23, 2019, @@ -8834,7 +9011,7 @@ This list contains 1173 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: Sep 21, 2022, + *last release*: Jan 17, 2023, *status*: 4 - Beta, *requires*: pytest (>=6.2.5) @@ -8897,12 +9074,19 @@ This list contains 1173 plugins. Text User Interface for running python tests :pypi:`pytest-ui-failed-screenshot` - *last release*: Nov 16, 2022, + *last release*: Dec 06, 2022, *status*: N/A, *requires*: N/A UI自动测试失败时自动截图,并将截图加入到测试报告中 + :pypi:`pytest-ui-failed-screenshot-allure` + *last release*: Dec 06, 2022, + *status*: N/A, + *requires*: N/A + + UI自动测试失败时自动截图,并将截图加入到Allure测试报告中 + :pypi:`pytest-unflakable` *last release*: Oct 26, 2022, *status*: 4 - Beta, @@ -9023,7 +9207,7 @@ This list contains 1173 plugins. py.test fixture for creating a virtual environment :pypi:`pytest-ver` - *last release*: Nov 07, 2022, + *last release*: Jan 23, 2023, *status*: 2 - Pre-Alpha, *requires*: N/A @@ -9121,7 +9305,7 @@ This list contains 1173 plugins. Local continuous test runner with pytest and watchdog. :pypi:`pytest-watcher` - *last release*: Oct 30, 2022, + *last release*: Dec 11, 2022, *status*: 3 - Alpha, *requires*: N/A @@ -9198,9 +9382,9 @@ This list contains 1173 plugins. pytest with docker helpers. :pypi:`pytest-workflow` - *last release*: Dec 03, 2021, + *last release*: Jan 13, 2023, *status*: 5 - Production/Stable, - *requires*: pytest (>=5.4.0) + *requires*: pytest (>=7.0.0) A pytest plugin for configuring workflow/pipeline tests using YAML files @@ -9254,9 +9438,9 @@ This list contains 1173 plugins. Extended logging for test and decorators :pypi:`pytest-xlsx` - *last release*: Nov 06, 2022, + *last release*: Dec 13, 2022, *status*: N/A, - *requires*: pytest>=7.1.2 + *requires*: pytest>=7.2.0 pytest plugin for generating test cases by xlsx(excel) @@ -9268,7 +9452,7 @@ This list contains 1173 plugins. An extended parametrizing plugin of pytest. :pypi:`pytest-xprocess` - *last release*: Nov 27, 2022, + *last release*: Jan 05, 2023, *status*: 4 - Beta, *requires*: pytest (>=2.8) @@ -9324,7 +9508,7 @@ This list contains 1173 plugins. Run tests against wsgi apps defined in yaml :pypi:`pytest-yaml-yoyo` - *last release*: Nov 30, 2022, + *last release*: Dec 17, 2022, *status*: N/A, *requires*: N/A @@ -9352,7 +9536,7 @@ This list contains 1173 plugins. PyTest plugin to run tests concurrently, each \`yield\` switch context to other one :pypi:`pytest-yls` - *last release*: Oct 21, 2022, + *last release*: Jan 10, 2023, *status*: N/A, *requires*: pytest (>=7.1.2,<8.0.0) @@ -9380,7 +9564,7 @@ This list contains 1173 plugins. OWASP ZAP plugin for py.test. :pypi:`pytest-zebrunner` - *last release*: Jun 02, 2022, + *last release*: Dec 12, 2022, *status*: 5 - Production/Stable, *requires*: pytest (>=4.5.0) From 9c93c96b14f904edab43aa715b67db33204e88a0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 7 Feb 2023 07:59:57 -0300 Subject: [PATCH 501/549] [automated] Update plugin list (#10707) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 186 ++++++++++++++++++------------- 1 file changed, 109 insertions(+), 77 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index e6f2ccd490c..d5921c7d36e 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1196 plugins. +This list contains 1200 plugins. .. only:: not latex @@ -27,7 +27,7 @@ This list contains 1196 plugins. :pypi:`pytest-ads-testplan` Azure DevOps Test Case reporting for pytest tests Sep 15, 2022 N/A N/A :pypi:`pytest-agent` Service that exposes a REST API that can be used to interract remotely with Pytest. It is shipped with a dashboard that enables running tests in a more convenient way. Nov 25, 2021 N/A N/A :pypi:`pytest-aggreport` pytest plugin for pytest-repeat that generate aggregate report of the same test cases with additional statistics details. Mar 07, 2021 4 - Beta pytest (>=6.2.2) - :pypi:`pytest-aio` Pytest plugin for testing async python code Oct 20, 2021 4 - Beta pytest + :pypi:`pytest-aio` Pytest plugin for testing async python code Feb 03, 2023 4 - Beta pytest :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Jan 10, 2023 N/A pytest (>=7.2.0,<8.0.0) @@ -36,7 +36,7 @@ This list contains 1196 plugins. :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A - :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Nov 01, 2022 N/A pytest (>=6.0) + :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Feb 03, 2023 N/A pytest (>=6.0) :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) @@ -64,7 +64,7 @@ This list contains 1196 plugins. :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A :pypi:`pytest-approvaltests` A plugin to use approvaltests with pytest May 08, 2022 4 - Beta pytest (>=7.0.1) :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Dec 21, 2022 5 - Production/Stable pytest - :pypi:`pytest-archon` Rule your architecture like a real developer Jan 09, 2023 5 - Production/Stable pytest (>=7.2) + :pypi:`pytest-archon` Rule your architecture like a real developer Jan 31, 2023 5 - Production/Stable pytest (>=7.2) :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 4 - Beta pytest (>=4.6) :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) @@ -139,7 +139,7 @@ This list contains 1196 plugins. :pypi:`pytest-browsermob-proxy` BrowserMob proxy plugin for py.test. Jun 11, 2013 4 - Beta N/A :pypi:`pytest-browserstack-local` \`\`py.test\`\` plugin to run \`\`BrowserStackLocal\`\` in background. Feb 09, 2018 N/A N/A :pypi:`pytest-budosystems` Budo Systems Pytest Plugin. Jan 22, 2023 N/A pytest ; extra == 'test' - :pypi:`pytest-bug` Pytest plugin for marking tests as a bug Apr 13, 2022 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-bug` Pytest plugin for marking tests as a bug Jan 29, 2023 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-bugtong-tag` pytest-bugtong-tag is a plugin for pytest Jan 16, 2022 N/A N/A :pypi:`pytest-bugzilla` py.test bugzilla integration plugin May 05, 2010 4 - Beta N/A :pypi:`pytest-bugzilla-notifier` A plugin that allows you to execute create, update, and read information from BugZilla bugs Jun 15, 2018 4 - Beta pytest (>=2.9.2) @@ -175,6 +175,7 @@ This list contains 1196 plugins. :pypi:`pytest-check-libs` check your missing library Jul 17, 2022 N/A N/A :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest>=7.0 :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest + :pypi:`pytest-chic-report` A pytest plugin to send a report and printing summary of tests. Jan 31, 2023 5 - Production/Stable N/A :pypi:`pytest-chunks` Run only a chunk of your test suite Jul 05, 2022 N/A pytest (>=6.0.0) :pypi:`pytest-circleci` py.test plugin for CircleCI May 03, 2019 N/A N/A :pypi:`pytest-circleci-parallelized` Parallelize pytest across CircleCI workers. Oct 20, 2022 N/A N/A @@ -222,7 +223,7 @@ This list contains 1196 plugins. :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) :pypi:`pytest-coveragemarkers` Using pytest markers to track functional coverage and filtering of tests Nov 29, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' - :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Sep 23, 2022 5 - Production/Stable pytest (>=7.0) + :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Jan 30, 2023 5 - Production/Stable pytest (>=7.0) :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Jan 23, 2023 N/A N/A :pypi:`pytest-cqase` Custom qase pytest plugin Aug 22, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A @@ -357,13 +358,13 @@ This list contains 1196 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Aug 31, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Jan 05, 2023 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jan 05, 2023 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jan 05, 2023 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jan 05, 2023 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jan 05, 2023 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jan 05, 2023 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jan 05, 2023 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Jan 29, 2023 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jan 29, 2023 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jan 29, 2023 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jan 29, 2023 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jan 29, 2023 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jan 29, 2023 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jan 29, 2023 N/A N/A :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Oct 15, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) @@ -447,6 +448,7 @@ This list contains 1196 plugins. :pypi:`pytest-flask-ligand` Pytest fixtures and helper functions to use for testing flask-ligand microservices. Oct 06, 2022 4 - Beta pytest (~=7.1) :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) + :pypi:`pytest-flexreport` Feb 01, 2023 4 - Beta N/A :pypi:`pytest-fluent` A pytest plugin in order to provide logs via fluentd Jul 12, 2022 4 - Beta pytest :pypi:`pytest-flyte` Pytest fixtures for simplifying Flyte integration testing May 03, 2021 N/A pytest :pypi:`pytest-focus` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest @@ -469,7 +471,7 @@ This list contains 1196 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Nov 17, 2022 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Feb 01, 2023 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -486,6 +488,7 @@ This list contains 1196 plugins. :pypi:`pytest-greendots` Green progress dots Feb 08, 2014 3 - Alpha N/A :pypi:`pytest-growl` Growl notifications for pytest results. Jan 13, 2014 5 - Production/Stable N/A :pypi:`pytest-grpc` pytest plugin for grpc May 01, 2020 N/A pytest (>=3.6.0) + :pypi:`pytest-grunnur` Uniform API for PyOpenCL and PyCUDA. Jan 29, 2023 N/A N/A :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest :pypi:`pytest-harmony` Chain tests and data with pytest Jan 17, 2023 N/A pytest (>=7.2.1,<8.0.0) :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Jun 10, 2022 5 - Production/Stable N/A @@ -498,11 +501,11 @@ This list contains 1196 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Jan 23, 2023 3 - Alpha pytest (==7.2.0) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Feb 03, 2023 3 - Alpha pytest (==7.2.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-test` A plugin that tracks test changes Dec 10, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Nov 17, 2022 N/A pytest (>=5.0) + :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jan 30, 2023 N/A pytest (>=5.0) :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 22, 2022 5 - Production/Stable N/A :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) :pypi:`pytest-html` pytest plugin for generating HTML reports Oct 25, 2022 5 - Production/Stable pytest (!=6.0.0,>=5.0) @@ -530,7 +533,7 @@ This list contains 1196 plugins. :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Sep 07, 2022 5 - Production/Stable N/A :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jul 25, 2022 N/A N/A :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A - :pypi:`pytest-image-diff` Jun 08, 2022 3 - Alpha pytest + :pypi:`pytest-image-diff` Jan 29, 2023 3 - Alpha pytest :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A :pypi:`pytest-influxdb` Plugin for influxdb and pytest integration. Apr 20, 2021 N/A N/A :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A @@ -538,9 +541,9 @@ This list contains 1196 plugins. :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A :pypi:`pytest-inline` A pytest plugin for writing inline tests. Nov 23, 2022 4 - Beta pytest (>=7.0.0) - :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Jan 20, 2023 5 - Production/Stable N/A + :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Feb 02, 2023 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Dec 01, 2022 5 - Production/Stable N/A - :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jan 27, 2023 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jan 30, 2023 5 - Production/Stable N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Jun 16, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Nov 02, 2022 N/A pytest (>=7.2.0,<8.0.0) @@ -566,7 +569,7 @@ This list contains 1196 plugins. :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A :pypi:`pytest-jira-xfail` Plugin skips (xfail) tests if unresolved Jira issue(s) linked Dec 01, 2022 N/A pytest (~=7.2.0) :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Jan 02, 2023 4 - Beta pytest - :pypi:`pytest-job-selection` A pytest plugin for load balancing test suites Jan 28, 2023 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-job-selection` A pytest plugin for load balancing test suites Jan 30, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A @@ -610,7 +613,7 @@ This list contains 1196 plugins. :pypi:`pytest-live` Live results for pytest Mar 08, 2020 N/A pytest :pypi:`pytest-local-badge` Generate local badges (shields) reporting your test suite status. Jan 15, 2023 N/A pytest (>=6.1.0) :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Oct 04, 2022 5 - Production/Stable pytest - :pypi:`pytest-localserver` pytest plugin to test server connections locally. Jan 26, 2023 4 - Beta N/A + :pypi:`pytest-localserver` pytest plugin to test server connections locally. Jan 30, 2023 4 - Beta N/A :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Oct 17, 2022 4 - Beta pytest (>=6.0.0,<7.0.0) :pypi:`pytest-lockable` lockable resource plugin for pytest Jul 20, 2022 5 - Production/Stable pytest :pypi:`pytest-locker` Used to lock object during testing. Essentially changing assertions from being hard coded to asserting that nothing changed Oct 29, 2021 N/A pytest (>=5.4) @@ -621,7 +624,7 @@ This list contains 1196 plugins. :pypi:`pytest-logger` Plugin configuring handlers for loggers from Python logging module. Jul 25, 2019 4 - Beta pytest (>=3.2) :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A :pypi:`pytest-logging-end-to-end-test-tool` Sep 23, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-logikal` Common testing environment Jan 26, 2023 5 - Production/Stable pytest (==7.2.1) + :pypi:`pytest-logikal` Common testing environment Feb 03, 2023 5 - Production/Stable pytest (==7.2.1) :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A :pypi:`pytest-loop` pytest plugin for looping tests Jul 22, 2022 5 - Production/Stable pytest (>=6) @@ -801,7 +804,7 @@ This list contains 1196 plugins. :pypi:`pytest-pot` A package for enhancing pytest Nov 20, 2022 N/A N/A :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 27, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) - :pypi:`pytest-pretty` pytest plugin for printing summary data as I want it Jan 22, 2023 5 - Production/Stable pytest>=7 + :pypi:`pytest-pretty` pytest plugin for printing summary data as I want it Feb 01, 2023 5 - Production/Stable pytest>=7 :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 31, 2022 N/A pytest (>=3.4.1) :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Dec 28, 2021 5 - Production/Stable pytest (>=6) @@ -837,7 +840,7 @@ This list contains 1196 plugins. :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.0) :pypi:`pytest-pythonpath` pytest plugin for adding to the PYTHONPATH from command line or configs. Feb 10, 2022 5 - Production/Stable pytest (<7,>=2.5.2) :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest - :pypi:`pytest-pyvista` Pytest-pyvista package Jan 08, 2023 4 - Beta pytest>=3.5.0 + :pypi:`pytest-pyvista` Pytest-pyvista package Jan 29, 2023 4 - Beta pytest>=3.5.0 :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Jun 26, 2021 4 - Beta pytest (>=6.2.0) :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jun 26, 2022 5 - Production/Stable pytest (>=6.2.3) @@ -910,7 +913,7 @@ This list contains 1196 plugins. :pypi:`pytest-responses` py.test integration for responses Oct 11, 2022 N/A pytest (>=2.5) :pypi:`pytest-rest-api` Aug 08, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed May 11, 2022 5 - Production/Stable pytest - :pypi:`pytest-result-log` Write the execution result of the case to the log Jan 07, 2023 N/A pytest>=7.2.0 + :pypi:`pytest-result-log` Write the execution result of the case to the log Feb 02, 2023 N/A pytest>=7.2.0 :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Aug 16, 2022 N/A pytest (>=7.0.0) :pypi:`pytest-reverse` Pytest plugin to reverse test order. May 11, 2022 5 - Production/Stable pytest @@ -941,14 +944,14 @@ This list contains 1196 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Jan 26, 2023 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Feb 04, 2023 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schedule` The job of test scheduling for humans. Jan 07, 2023 5 - Production/Stable N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 21, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Jan 26, 2023 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Feb 04, 2023 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -992,7 +995,7 @@ This list contains 1196 plugins. :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Apr 23, 2022 4 - Beta pytest (>=3.0.0) :pypi:`pytest-snmpserver` May 12, 2021 N/A N/A :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Jan 05, 2022 4 - Beta pytest (>=6.2.0) - :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Jan 23, 2022 4 - Beta pytest (>=3.6.3) + :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Feb 03, 2023 4 - Beta pytest (>=3.6.3) :pypi:`pytest-sofaepione` Test the installation of SOFA and the SofaEpione plugin. Aug 17, 2022 N/A N/A :pypi:`pytest-soft-assertions` May 05, 2020 3 - Alpha pytest :pypi:`pytest-solidity` A PyTest library plugin for Solidity language. Jan 15, 2022 1 - Planning pytest (<7,>=6.0.1) ; extra == 'tests' @@ -1042,7 +1045,6 @@ This list contains 1196 plugins. :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Oct 28, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Nov 05, 2022 3 - Alpha pytest (>=2.9) - :pypi:`pytest-summary` A pytest plugin to send a report and printing summary of tests. Jan 04, 2023 5 - Production/Stable N/A :pypi:`pytest-svn` SVN repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-symbols` pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. Nov 20, 2017 3 - Alpha N/A :pypi:`pytest-system-statistics` Pytest plugin to track and report system usage statistics Feb 16, 2022 5 - Production/Stable pytest (>=6.0.0) @@ -1057,7 +1059,7 @@ This list contains 1196 plugins. :pypi:`pytest-tcpclient` A pytest plugin for testing TCP clients Nov 16, 2022 N/A pytest (<8,>=7.1.3) :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A - :pypi:`pytest-telegram-notifier` Telegram notification plugin for Pytest Jan 23, 2023 5 - Production/Stable N/A + :pypi:`pytest-telegram-notifier` Telegram notification plugin for Pytest Feb 04, 2023 5 - Production/Stable N/A :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) :pypi:`pytest-terra-fixt` Terraform and Terragrunt fixtures for pytest Sep 15, 2022 N/A pytest (==6.2.5) :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Sep 01, 2022 N/A pytest (>=6.0) @@ -1066,7 +1068,7 @@ This list contains 1196 plugins. :pypi:`pytest-testconfig` Test configuration plugin for pytest. Jan 11, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-testdirectory` A py.test plugin providing temporary directories in unit tests. Feb 21, 2022 5 - Production/Stable pytest :pypi:`pytest-testdox` A testdox format reporter for pytest Apr 19, 2022 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-test-grouping` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Jun 17, 2022 5 - Production/Stable pytest (>=2.5) + :pypi:`pytest-test-grouping` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Feb 01, 2023 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Dec 01, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) @@ -1076,6 +1078,7 @@ This list contains 1196 plugins. :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) + :pypi:`pytest-testrail2` A pytest plugin to upload results to TestRail. Feb 03, 2023 N/A pytest (<8.0,>=7.2.0) :pypi:`pytest-testrail-api-client` TestRail Api Python Client Dec 14, 2021 N/A pytest :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A @@ -1109,7 +1112,7 @@ This list contains 1196 plugins. :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest :pypi:`pytest-tmpfs` A pytest plugin that helps you on using a temporary filesystem for testing. Aug 29, 2022 N/A pytest :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Aug 12, 2022 N/A N/A - :pypi:`pytest-tmux` A pytest plugin that enables tmux driven tests Dec 31, 2022 4 - Beta N/A + :pypi:`pytest-tmux` A pytest plugin that enables tmux driven tests Jan 30, 2023 4 - Beta N/A :pypi:`pytest-todo` A small plugin for the pytest testing framework, marking TODO comments as failure May 23, 2019 4 - Beta pytest :pypi:`pytest-tomato` Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-toolbelt` This is just a collection of utilities for pytest, but don't really belong in pytest proper. Aug 12, 2019 3 - Alpha N/A @@ -1131,7 +1134,7 @@ This list contains 1196 plugins. :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Apr 27, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A - :pypi:`pytest-tui` Text User Interface (TUI) and HTML report for Pytest test runs Jan 17, 2023 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) and HTML report for Pytest test runs Feb 01, 2023 4 - Beta pytest (>=6.2.5) :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Oct 16, 2022 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) @@ -1149,7 +1152,7 @@ This list contains 1196 plugins. :pypi:`pytest-unordered` Test equality of unordered collections in pytest Nov 28, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Sep 27, 2022 4 - Beta N/A :pypi:`pytest-upload-report` pytest-upload-report is a plugin for pytest that upload your test report for test results. Jun 18, 2021 5 - Production/Stable N/A - :pypi:`pytest-utils` Some helpers for pytest. Dec 04, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-utils` Some helpers for pytest. Feb 02, 2023 4 - Beta pytest (>=7.0.0,<8.0.0) :pypi:`pytest-vagrant` A py.test plugin providing access to vagrant. Sep 07, 2021 5 - Production/Stable pytest :pypi:`pytest-valgrind` May 19, 2021 N/A N/A :pypi:`pytest-variables` pytest plugin for providing variables to tests/fixtures Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) @@ -1159,13 +1162,14 @@ This list contains 1196 plugins. :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest :pypi:`pytest-vcs` Sep 22, 2022 4 - Beta N/A :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest - :pypi:`pytest-ver` Pytest module with Verification Protocol, Verification Report and Trace Matrix Jan 23, 2023 2 - Pre-Alpha N/A + :pypi:`pytest-ver` Pytest module with Verification Protocol, Verification Report and Trace Matrix Jan 29, 2023 2 - Pre-Alpha N/A :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) :pypi:`pytest-virtualenv` Virtualenv fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-vnc` VNC client for Pytest Jun 03, 2022 N/A pytest :pypi:`pytest-voluptuous` Pytest plugin for asserting data against voluptuous schema. Jun 09, 2020 N/A pytest :pypi:`pytest-vscodedebug` A pytest plugin to easily enable debugging tests within Visual Studio Code Dec 04, 2020 4 - Beta N/A + :pypi:`pytest-vscode-pycharm-cls` A PyTest helper to enable start remote debugger on test start or failure or when pytest.set_trace is used. Feb 01, 2023 N/A pytest :pypi:`pytest-vts` pytest plugin for automatic recording of http stubbed tests Jun 05, 2019 N/A pytest (>=2.3) :pypi:`pytest-vulture` A pytest plugin to checks dead code with vulture Oct 12, 2022 N/A pytest (>=7.0.0) :pypi:`pytest-vw` pytest-vw makes your failing test cases succeed under CI tools scrutiny Oct 07, 2015 4 - Beta N/A @@ -1283,7 +1287,7 @@ This list contains 1196 plugins. pytest plugin for pytest-repeat that generate aggregate report of the same test cases with additional statistics details. :pypi:`pytest-aio` - *last release*: Oct 20, 2021, + *last release*: Feb 03, 2023, *status*: 4 - Beta, *requires*: pytest @@ -1346,7 +1350,7 @@ This list contains 1196 plugins. :pypi:`pytest-alembic` - *last release*: Nov 01, 2022, + *last release*: Feb 03, 2023, *status*: N/A, *requires*: pytest (>=6.0) @@ -1542,7 +1546,7 @@ This list contains 1196 plugins. Extension for ApprovalTests.Python specific to geo data verification :pypi:`pytest-archon` - *last release*: Jan 09, 2023, + *last release*: Jan 31, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=7.2) @@ -2067,7 +2071,7 @@ This list contains 1196 plugins. Budo Systems Pytest Plugin. :pypi:`pytest-bug` - *last release*: Apr 13, 2022, + *last release*: Jan 29, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2.0) @@ -2318,6 +2322,13 @@ This list contains 1196 plugins. pytest plugin to test Check_MK checks + :pypi:`pytest-chic-report` + *last release*: Jan 31, 2023, + *status*: 5 - Production/Stable, + *requires*: N/A + + A pytest plugin to send a report and printing summary of tests. + :pypi:`pytest-chunks` *last release*: Jul 05, 2022, *status*: N/A, @@ -2648,7 +2659,7 @@ This list contains 1196 plugins. Pytest plugin for excluding tests based on coverage data :pypi:`pytest-cpp` - *last release*: Sep 23, 2022, + *last release*: Jan 30, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=7.0) @@ -3593,49 +3604,49 @@ This list contains 1196 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Jan 05, 2023, + *last release*: Jan 29, 2023, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Jan 05, 2023, + *last release*: Jan 29, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Jan 05, 2023, + *last release*: Jan 29, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Jan 05, 2023, + *last release*: Jan 29, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Jan 05, 2023, + *last release*: Jan 29, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Jan 05, 2023, + *last release*: Jan 29, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Jan 05, 2023, + *last release*: Jan 29, 2023, *status*: N/A, *requires*: N/A @@ -4222,6 +4233,13 @@ This list contains 1196 plugins. Run tests in transactions using pytest, Flask, and SQLalchemy. + :pypi:`pytest-flexreport` + *last release*: Feb 01, 2023, + *status*: 4 - Beta, + *requires*: N/A + + + :pypi:`pytest-fluent` *last release*: Jul 12, 2022, *status*: 4 - Beta, @@ -4377,7 +4395,7 @@ This list contains 1196 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Nov 17, 2022, + *last release*: Feb 01, 2023, *status*: N/A, *requires*: N/A @@ -4495,6 +4513,13 @@ This list contains 1196 plugins. pytest plugin for grpc + :pypi:`pytest-grunnur` + *last release*: Jan 29, 2023, + *status*: N/A, + *requires*: N/A + + Uniform API for PyOpenCL and PyCUDA. + :pypi:`pytest-hammertime` *last release*: Jul 28, 2018, *status*: N/A, @@ -4580,9 +4605,9 @@ This list contains 1196 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Jan 23, 2023, + *last release*: Feb 03, 2023, *status*: 3 - Alpha, - *requires*: pytest (==7.2.0) + *requires*: pytest (==7.2.1) Experimental package to automatically extract test plugins for Home Assistant custom components @@ -4608,7 +4633,7 @@ This list contains 1196 plugins. A plugin that tracks test changes :pypi:`pytest-hoverfly` - *last release*: Nov 17, 2022, + *last release*: Jan 30, 2023, *status*: N/A, *requires*: pytest (>=5.0) @@ -4804,7 +4829,7 @@ This list contains 1196 plugins. ignore failures from flaky tests (pytest plugin) :pypi:`pytest-image-diff` - *last release*: Jun 08, 2022, + *last release*: Jan 29, 2023, *status*: 3 - Alpha, *requires*: pytest @@ -4860,7 +4885,7 @@ This list contains 1196 plugins. A pytest plugin for writing inline tests. :pypi:`pytest-inmanta` - *last release*: Jan 20, 2023, + *last release*: Feb 02, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -4874,7 +4899,7 @@ This list contains 1196 plugins. Inmanta tests package :pypi:`pytest-inmanta-lsm` - *last release*: Jan 27, 2023, + *last release*: Jan 30, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -5056,7 +5081,7 @@ This list contains 1196 plugins. pytest plugin to integrate tests with JIRA XRAY :pypi:`pytest-job-selection` - *last release*: Jan 28, 2023, + *last release*: Jan 30, 2023, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) @@ -5364,7 +5389,7 @@ This list contains 1196 plugins. A PyTest plugin which provides an FTP fixture for your tests :pypi:`pytest-localserver` - *last release*: Jan 26, 2023, + *last release*: Jan 30, 2023, *status*: 4 - Beta, *requires*: N/A @@ -5441,7 +5466,7 @@ This list contains 1196 plugins. :pypi:`pytest-logikal` - *last release*: Jan 26, 2023, + *last release*: Feb 03, 2023, *status*: 5 - Production/Stable, *requires*: pytest (==7.2.1) @@ -6701,7 +6726,7 @@ This list contains 1196 plugins. A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. :pypi:`pytest-pretty` - *last release*: Jan 22, 2023, + *last release*: Feb 01, 2023, *status*: 5 - Production/Stable, *requires*: pytest>=7 @@ -6953,7 +6978,7 @@ This list contains 1196 plugins. pytest plugin for a better developer experience when working with the PyTorch test suite :pypi:`pytest-pyvista` - *last release*: Jan 08, 2023, + *last release*: Jan 29, 2023, *status*: 4 - Beta, *requires*: pytest>=3.5.0 @@ -7464,7 +7489,7 @@ This list contains 1196 plugins. Pytest plugin to restrict the test types allowed :pypi:`pytest-result-log` - *last release*: Jan 07, 2023, + *last release*: Feb 02, 2023, *status*: N/A, *requires*: pytest>=7.2.0 @@ -7681,7 +7706,7 @@ This list contains 1196 plugins. :pypi:`pytest-sbase` - *last release*: Jan 26, 2023, + *last release*: Feb 04, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -7730,7 +7755,7 @@ This list contains 1196 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Jan 26, 2023, + *last release*: Feb 04, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -8038,7 +8063,7 @@ This list contains 1196 plugins. Setup test data and run tests on snowflake in BDD style! :pypi:`pytest-socket` - *last release*: Jan 23, 2022, + *last release*: Feb 03, 2023, *status*: 4 - Beta, *requires*: pytest (>=3.6.3) @@ -8387,13 +8412,6 @@ This list contains 1196 plugins. pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). - :pypi:`pytest-summary` - *last release*: Jan 04, 2023, - *status*: 5 - Production/Stable, - *requires*: N/A - - A pytest plugin to send a report and printing summary of tests. - :pypi:`pytest-svn` *last release*: May 28, 2019, *status*: 5 - Production/Stable, @@ -8493,7 +8511,7 @@ This list contains 1196 plugins. Pytest to Telegram reporting plugin :pypi:`pytest-telegram-notifier` - *last release*: Jan 23, 2023, + *last release*: Feb 04, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -8556,7 +8574,7 @@ This list contains 1196 plugins. A testdox format reporter for pytest :pypi:`pytest-test-grouping` - *last release*: Jun 17, 2022, + *last release*: Feb 01, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=2.5) @@ -8625,6 +8643,13 @@ This list contains 1196 plugins. pytest plugin for creating TestRail runs and adding results + :pypi:`pytest-testrail2` + *last release*: Feb 03, 2023, + *status*: N/A, + *requires*: pytest (<8.0,>=7.2.0) + + A pytest plugin to upload results to TestRail. + :pypi:`pytest-testrail-api-client` *last release*: Dec 14, 2021, *status*: N/A, @@ -8857,7 +8882,7 @@ This list contains 1196 plugins. this is a vue-element ui report for pytest :pypi:`pytest-tmux` - *last release*: Dec 31, 2022, + *last release*: Jan 30, 2023, *status*: 4 - Beta, *requires*: N/A @@ -9011,7 +9036,7 @@ This list contains 1196 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: Jan 17, 2023, + *last release*: Feb 01, 2023, *status*: 4 - Beta, *requires*: pytest (>=6.2.5) @@ -9137,9 +9162,9 @@ This list contains 1196 plugins. pytest-upload-report is a plugin for pytest that upload your test report for test results. :pypi:`pytest-utils` - *last release*: Dec 04, 2021, + *last release*: Feb 02, 2023, *status*: 4 - Beta, - *requires*: pytest (>=6.2.5,<7.0.0) + *requires*: pytest (>=7.0.0,<8.0.0) Some helpers for pytest. @@ -9207,7 +9232,7 @@ This list contains 1196 plugins. py.test fixture for creating a virtual environment :pypi:`pytest-ver` - *last release*: Jan 23, 2023, + *last release*: Jan 29, 2023, *status*: 2 - Pre-Alpha, *requires*: N/A @@ -9255,6 +9280,13 @@ This list contains 1196 plugins. A pytest plugin to easily enable debugging tests within Visual Studio Code + :pypi:`pytest-vscode-pycharm-cls` + *last release*: Feb 01, 2023, + *status*: N/A, + *requires*: pytest + + A PyTest helper to enable start remote debugger on test start or failure or when pytest.set_trace is used. + :pypi:`pytest-vts` *last release*: Jun 05, 2019, *status*: N/A, From a2b7db7655d96ca3d77348031f107cf1c88563a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Feb 2023 08:00:16 -0300 Subject: [PATCH 502/549] build(deps): Bump django in /testing/plugins_integration (#10706) Bumps [django](https://github.com/django/django) from 4.1.5 to 4.1.6. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/4.1.5...4.1.6) --- updated-dependencies: - dependency-name: django dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 7c20cfe08b7..cdcd99be4a3 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.6.2 -django==4.1.5 +django==4.1.6 pytest-asyncio==0.20.2 pytest-bdd==6.1.1 pytest-cov==4.0.0 From af990401236973b7f9c1cd319c0d180741d1fe2e Mon Sep 17 00:00:00 2001 From: Mahesh Vashishtha Date: Tue, 7 Feb 2023 16:27:34 -0600 Subject: [PATCH 503/549] Add a note about -W vs filterwarnings. (#10713) Closes #10687 Signed-off-by: mvashishtha --- doc/en/how-to/capture-warnings.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/en/how-to/capture-warnings.rst b/doc/en/how-to/capture-warnings.rst index 51e85badd2a..0390230b8ea 100644 --- a/doc/en/how-to/capture-warnings.rst +++ b/doc/en/how-to/capture-warnings.rst @@ -109,6 +109,18 @@ When a warning matches more than one option in the list, the action for the last is performed. +.. note:: + + The ``-W`` flag and the ``filterwarnings`` ini option use warning filters that are + similar in structure, but each configuration option interprets its filter + differently. For example, *message* in ``filterwarnings`` is a string containing a + regular expression that the start of the warning message must match, + case-insensitively, while *message* in ``-W`` is a literal string that the start of + the warning message must contain (case-insensitively), ignoring any whitespace at + the start or end of message. Consult the `warning filter`_ documentation for more + details. + + .. _`filterwarnings`: ``@pytest.mark.filterwarnings`` From 59e7d2bbc9f6b29734fc744664a58beec65c6ccb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 7 Feb 2023 19:30:33 -0300 Subject: [PATCH 504/549] [pre-commit.ci] pre-commit autoupdate (#10712) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 22.12.0 → 23.1.0](https://github.com/psf/black/compare/22.12.0...23.1.0) - [github.com/PyCQA/autoflake: v2.0.0 → v2.0.1](https://github.com/PyCQA/autoflake/compare/v2.0.0...v2.0.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update .pre-commit-config.yaml * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bruno Oliveira --- .pre-commit-config.yaml | 6 +++--- doc/en/how-to/fixtures.rst | 1 - doc/en/how-to/monkeypatch.rst | 9 +++------ doc/en/how-to/writing_hook_functions.rst | 1 + src/_pytest/assertion/rewrite.py | 1 - src/_pytest/config/__init__.py | 2 -- src/_pytest/config/compat.py | 1 - src/_pytest/doctest.py | 1 - src/_pytest/outcomes.py | 1 - src/_pytest/python.py | 3 ++- src/_pytest/reports.py | 1 - testing/acceptance_test.py | 1 - testing/test_cacheprovider.py | 1 - testing/test_doctest.py | 2 -- testing/test_junitxml.py | 2 -- testing/test_runner.py | 1 + 16 files changed, 10 insertions(+), 24 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2a92f89b3f8..2adcc4d4930 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ default_language_version: python: "3.10" repos: - repo: https://github.com/psf/black - rev: 22.12.0 + rev: 23.1.0 hooks: - id: black args: [--safe, --quiet] @@ -10,7 +10,7 @@ repos: rev: 1.13.0 hooks: - id: blacken-docs - additional_dependencies: [black==22.12.0] + additional_dependencies: [black==23.1.0] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: @@ -23,7 +23,7 @@ repos: exclude: _pytest/(debugging|hookspec).py language_version: python3 - repo: https://github.com/PyCQA/autoflake - rev: v2.0.0 + rev: v2.0.1 hooks: - id: autoflake name: autoflake diff --git a/doc/en/how-to/fixtures.rst b/doc/en/how-to/fixtures.rst index 3acf39d0fa0..d8517c2c8f3 100644 --- a/doc/en/how-to/fixtures.rst +++ b/doc/en/how-to/fixtures.rst @@ -1237,7 +1237,6 @@ If the data created by the factory requires managing, the fixture can take care @pytest.fixture def make_customer_record(): - created_records = [] def _make_customer_record(name): diff --git a/doc/en/how-to/monkeypatch.rst b/doc/en/how-to/monkeypatch.rst index 81edd00bda5..a9504dcb32a 100644 --- a/doc/en/how-to/monkeypatch.rst +++ b/doc/en/how-to/monkeypatch.rst @@ -135,10 +135,10 @@ This can be done in our test file by defining a class to represent ``r``. # this is the previous code block example import app + # custom class to be the mock return value # will override the requests.Response returned from requests.get class MockResponse: - # mock json() method always returns a specific testing dictionary @staticmethod def json(): @@ -146,7 +146,6 @@ This can be done in our test file by defining a class to represent ``r``. def test_get_json(monkeypatch): - # Any arguments may be passed and mock_get() will always return our # mocked object, which only has the .json() method. def mock_get(*args, **kwargs): @@ -181,6 +180,7 @@ This mock can be shared across tests using a ``fixture``: # app.py that includes the get_json() function import app + # custom class to be the mock return value of requests.get() class MockResponse: @staticmethod @@ -358,7 +358,6 @@ For testing purposes we can patch the ``DEFAULT_CONFIG`` dictionary to specific def test_connection(monkeypatch): - # Patch the values of DEFAULT_CONFIG to specific # testing values only for this test. monkeypatch.setitem(app.DEFAULT_CONFIG, "user", "test_user") @@ -383,7 +382,6 @@ You can use the :py:meth:`monkeypatch.delitem ` to remove v def test_missing_user(monkeypatch): - # patch the DEFAULT_CONFIG t be missing the 'user' key monkeypatch.delitem(app.DEFAULT_CONFIG, "user", raising=False) @@ -404,6 +402,7 @@ separate fixtures for each potential mock and reference them in the needed tests # app.py with the connection string function import app + # all of the mocks are moved into separated fixtures @pytest.fixture def mock_test_user(monkeypatch): @@ -425,7 +424,6 @@ separate fixtures for each potential mock and reference them in the needed tests # tests reference only the fixture mocks that are needed def test_connection(mock_test_user, mock_test_database): - expected = "User Id=test_user; Location=test_db;" result = app.create_connection_string() @@ -433,7 +431,6 @@ separate fixtures for each potential mock and reference them in the needed tests def test_missing_user(mock_missing_default_user): - with pytest.raises(KeyError): _ = app.create_connection_string() diff --git a/doc/en/how-to/writing_hook_functions.rst b/doc/en/how-to/writing_hook_functions.rst index da2961c9708..71379016f2e 100644 --- a/doc/en/how-to/writing_hook_functions.rst +++ b/doc/en/how-to/writing_hook_functions.rst @@ -249,6 +249,7 @@ and use pytest_addoption as follows: # contents of hooks.py + # Use firstresult=True because we only want one plugin to define this # default value @hookspec(firstresult=True) diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index e2648029ced..42664add432 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -274,7 +274,6 @@ def get_data(self, pathname: Union[str, bytes]) -> bytes: return f.read() if sys.version_info >= (3, 10): - if sys.version_info >= (3, 12): from importlib.resources.abc import TraversableResources else: diff --git a/src/_pytest/config/__init__.py b/src/_pytest/config/__init__.py index b4dbc0da4be..720f3953153 100644 --- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -62,7 +62,6 @@ from _pytest.warning_types import warn_explicit_for if TYPE_CHECKING: - from _pytest._code.code import _TracebackStyle from _pytest.terminal import TerminalReporter from .argparsing import Argument @@ -1067,7 +1066,6 @@ def pytest_cmdline_parse( try: self.parse(args) except UsageError: - # Handle --version and --help here in a minimal fashion. # This gets done via helpconfig normally, but its # pytest_cmdline_main is not called in case of errors. diff --git a/src/_pytest/config/compat.py b/src/_pytest/config/compat.py index ba267d21505..5bd922a4a87 100644 --- a/src/_pytest/config/compat.py +++ b/src/_pytest/config/compat.py @@ -43,7 +43,6 @@ def __getattr__(self, key, _wraps=functools.wraps): @_wraps(hook) def fixed_hook(**kw): - path_value: Optional[Path] = kw.pop(path_var, None) fspath_value: Optional[LEGACY_PATH] = kw.pop(fspath_var, None) if fspath_value is not None: diff --git a/src/_pytest/doctest.py b/src/_pytest/doctest.py index 771f0890d88..455ad62cc9c 100644 --- a/src/_pytest/doctest.py +++ b/src/_pytest/doctest.py @@ -531,7 +531,6 @@ def _find( if _is_mocked(obj): return with _patch_unwrap_mock_aware(): - # Type ignored because this is a private function. super()._find( # type:ignore[misc] tests, obj, name, module, source_lines, globs, seen diff --git a/src/_pytest/outcomes.py b/src/_pytest/outcomes.py index e46b663dd50..2a998e421ea 100644 --- a/src/_pytest/outcomes.py +++ b/src/_pytest/outcomes.py @@ -219,7 +219,6 @@ def _resolve_msg_to_reason( """ __tracebackhide__ = True if msg is not None: - if reason: from pytest import UsageError diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 62c31b0f4a3..d04b6fa4ded 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -789,7 +789,8 @@ def _call_with_optional_argument(func, arg) -> None: def _get_first_non_fixture_func(obj: object, names: Iterable[str]) -> Optional[object]: """Return the attribute from the given object to be used as a setup/teardown - xunit-style function, but only if not marked as a fixture to avoid calling it twice.""" + xunit-style function, but only if not marked as a fixture to avoid calling it twice. + """ for name in names: meth: Optional[object] = getattr(obj, name, None) if meth is not None and fixtures.getfixturemarker(meth) is None: diff --git a/src/_pytest/reports.py b/src/_pytest/reports.py index 1b2821c719a..b49dfb32afe 100644 --- a/src/_pytest/reports.py +++ b/src/_pytest/reports.py @@ -572,7 +572,6 @@ def deserialize_repr_crash(repr_crash_dict: Optional[Dict[str, Any]]): and "reprcrash" in reportdict["longrepr"] and "reprtraceback" in reportdict["longrepr"] ): - reprtraceback = deserialize_repr_traceback( reportdict["longrepr"]["reprtraceback"] ) diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 46352e13015..62acf120945 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -871,7 +871,6 @@ def test_calls(self, pytester: Pytester, mock_timing) -> None: ) def test_calls_show_2(self, pytester: Pytester, mock_timing) -> None: - pytester.makepyfile(self.source) result = pytester.runpytest_inprocess("--durations=2") assert result.ret == 0 diff --git a/testing/test_cacheprovider.py b/testing/test_cacheprovider.py index c381a8448ce..2f8517f9962 100644 --- a/testing/test_cacheprovider.py +++ b/testing/test_cacheprovider.py @@ -494,7 +494,6 @@ def test_a2(): pass def test_lastfailed_collectfailure( self, pytester: Pytester, monkeypatch: MonkeyPatch ) -> None: - pytester.makepyfile( test_maybe=""" import os diff --git a/testing/test_doctest.py b/testing/test_doctest.py index 2f73feb8c4b..d2944fa2bcf 100644 --- a/testing/test_doctest.py +++ b/testing/test_doctest.py @@ -1236,7 +1236,6 @@ def my_config_context(): class TestDoctestAutoUseFixtures: - SCOPES = ["module", "session", "class", "function"] def test_doctest_module_session_fixture(self, pytester: Pytester): @@ -1379,7 +1378,6 @@ def auto(request): class TestDoctestNamespaceFixture: - SCOPES = ["module", "session", "class", "function"] @pytest.mark.parametrize("scope", SCOPES) diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index b266c76d922..90804c61902 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -253,7 +253,6 @@ def test_junit_duration_report( duration_report: str, run_and_parse: RunAndParse, ) -> None: - # mock LogXML.node_reporter so it always sets a known duration to each test report object original_node_reporter = LogXML.node_reporter @@ -603,7 +602,6 @@ def test_func(arg1): node.assert_attr(failures=3, tests=3) for index, char in enumerate("<&'"): - tnode = node.find_nth_by_tag("testcase", index) tnode.assert_attr( classname="test_failure_escape", name="test_func[%s]" % char diff --git a/testing/test_runner.py b/testing/test_runner.py index 49adc04fe2f..c6d5b8aaf37 100644 --- a/testing/test_runner.py +++ b/testing/test_runner.py @@ -906,6 +906,7 @@ def test_fix(foo): def test_store_except_info_on_error() -> None: """Test that upon test failure, the exception info is stored on sys.last_traceback and friends.""" + # Simulate item that might raise a specific exception, depending on `raise_error` class var class ItemMightRaise: nodeid = "item_that_raises" From 5e1c3d2477a32b27e11a555ef10cc18707b93c09 Mon Sep 17 00:00:00 2001 From: HTRafal <123557622+HTRafal@users.noreply.github.com> Date: Fri, 10 Feb 2023 21:52:54 +0100 Subject: [PATCH 505/549] Propagate timestamps from CallInfo to TestReport objects (#10711) This makes it possible to correlate pytest stages with external events, and also makes it readable when TestReports are exported externall (for example with pytest-reportlog). Closes #10710 --- AUTHORS | 1 + changelog/10710.improvement.rst | 1 + src/_pytest/reports.py | 11 +++++++++++ testing/test_reports.py | 21 +++++++++++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 changelog/10710.improvement.rst diff --git a/AUTHORS b/AUTHORS index 2f50a295065..0395feceb60 100644 --- a/AUTHORS +++ b/AUTHORS @@ -297,6 +297,7 @@ Ram Rachum Ran Benita Raphael Castaneda Raphael Pierzina +Rafal Semik Raquel Alegre Ravi Chandra Robert Holt diff --git a/changelog/10710.improvement.rst b/changelog/10710.improvement.rst new file mode 100644 index 00000000000..a893eec0257 --- /dev/null +++ b/changelog/10710.improvement.rst @@ -0,0 +1 @@ +Added ``start`` and ``stop`` timestamps to ``TestReport`` objects. diff --git a/src/_pytest/reports.py b/src/_pytest/reports.py index b49dfb32afe..a8fa61787ae 100644 --- a/src/_pytest/reports.py +++ b/src/_pytest/reports.py @@ -262,6 +262,8 @@ def __init__( when: "Literal['setup', 'call', 'teardown']", sections: Iterable[Tuple[str, str]] = (), duration: float = 0, + start: float = 0, + stop: float = 0, user_properties: Optional[Iterable[Tuple[str, object]]] = None, **extra, ) -> None: @@ -299,6 +301,11 @@ def __init__( #: Time it took to run just the test. self.duration: float = duration + #: The system time when the call started, in seconds since the epoch. + self.start: float = start + #: The system time when the call ended, in seconds since the epoch. + self.stop: float = stop + self.__dict__.update(extra) def __repr__(self) -> str: @@ -317,6 +324,8 @@ def from_item_and_call(cls, item: Item, call: "CallInfo[None]") -> "TestReport": # Remove "collect" from the Literal type -- only for collection calls. assert when != "collect" duration = call.duration + start = call.start + stop = call.stop keywords = {x: 1 for x in item.keywords} excinfo = call.excinfo sections = [] @@ -361,6 +370,8 @@ def from_item_and_call(cls, item: Item, call: "CallInfo[None]") -> "TestReport": when, sections, duration, + start, + stop, user_properties=item.user_properties, ) diff --git a/testing/test_reports.py b/testing/test_reports.py index 31b6cf1afc6..e101b51dacb 100644 --- a/testing/test_reports.py +++ b/testing/test_reports.py @@ -6,6 +6,7 @@ from _pytest._code.code import ExceptionRepr from _pytest.config import Config from _pytest.pytester import Pytester +from _pytest.python_api import approx from _pytest.reports import CollectReport from _pytest.reports import TestReport @@ -415,6 +416,26 @@ def test_report_prevent_ConftestImportFailure_hiding_exception( result.stdout.fnmatch_lines(["E *Error: No module named 'unknown'"]) result.stdout.no_fnmatch_line("ERROR - *ConftestImportFailure*") + def test_report_timestamps_match_duration(self, pytester: Pytester, mock_timing): + reprec = pytester.inline_runsource( + """ + import pytest + from _pytest import timing + @pytest.fixture + def fixture_(): + timing.sleep(5) + yield + timing.sleep(5) + def test_1(fixture_): timing.sleep(10) + """ + ) + reports = reprec.getreports("pytest_runtest_logreport") + assert len(reports) == 3 + for report in reports: + data = report._to_json() + loaded_report = TestReport._from_json(data) + assert loaded_report.stop - loaded_report.start == approx(report.duration) + class TestHooks: """Test that the hooks are working correctly for plugins""" From 7a829cb57d879e0732045305696cf8bd3ef419d8 Mon Sep 17 00:00:00 2001 From: Ilya Konstantinov Date: Sun, 12 Feb 2023 09:20:53 -0500 Subject: [PATCH 506/549] Document the location tuple (#10700) --- src/_pytest/hookspec.py | 8 ++++++-- src/_pytest/nodes.py | 9 +++++++-- src/_pytest/reports.py | 6 +++++- testing/test_runner.py | 1 + 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/_pytest/hookspec.py b/src/_pytest/hookspec.py index 446f580ee06..143ec190c2d 100644 --- a/src/_pytest/hookspec.py +++ b/src/_pytest/hookspec.py @@ -505,7 +505,9 @@ def pytest_runtest_logstart( See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. :param nodeid: Full node ID of the item. - :param location: A tuple of ``(filename, lineno, testname)``. + :param location: A tuple of ``(filename, lineno, testname)`` + where ``filename`` is a file path relative to ``config.rootpath`` + and ``lineno`` is 0-based. """ @@ -517,7 +519,9 @@ def pytest_runtest_logfinish( See :hook:`pytest_runtest_protocol` for a description of the runtest protocol. :param nodeid: Full node ID of the item. - :param location: A tuple of ``(filename, lineno, testname)``. + :param location: A tuple of ``(filename, lineno, testname)`` + where ``filename`` is a file path relative to ``config.rootpath`` + and ``lineno`` is 0-based. """ diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py index cfb9b5a3634..c74740dbc8a 100644 --- a/src/_pytest/nodes.py +++ b/src/_pytest/nodes.py @@ -511,7 +511,7 @@ def get_fslocation_from_item(node: "Node") -> Tuple[Union[str, Path], Optional[i * "obj": a Python object that the node wraps. * "fspath": just a path - :rtype: A tuple of (str|Path, int) with filename and line number. + :rtype: A tuple of (str|Path, int) with filename and 0-based line number. """ # See Item.location. location: Optional[Tuple[str, Optional[int], str]] = getattr(node, "location", None) @@ -755,7 +755,7 @@ def reportinfo(self) -> Tuple[Union["os.PathLike[str]", str], Optional[int], str Returns a tuple with three elements: - The path of the test (default ``self.path``) - - The line number of the test (default ``None``) + - The 0-based line number of the test (default ``None``) - A name of the test to be shown (default ``""``) .. seealso:: :ref:`non-python tests` @@ -764,6 +764,11 @@ def reportinfo(self) -> Tuple[Union["os.PathLike[str]", str], Optional[int], str @cached_property def location(self) -> Tuple[str, Optional[int], str]: + """ + 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. + """ location = self.reportinfo() path = absolutepath(os.fspath(location[0])) relfspath = self.session._node_location_to_relpath(path) diff --git a/src/_pytest/reports.py b/src/_pytest/reports.py index a8fa61787ae..2e36514eae5 100644 --- a/src/_pytest/reports.py +++ b/src/_pytest/reports.py @@ -273,6 +273,8 @@ def __init__( #: 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. self.location: Tuple[str, Optional[int], str] = location #: A name -> value dictionary containing all keywords and @@ -417,7 +419,9 @@ def __init__( self.__dict__.update(extra) @property - def location(self): + def location( # type:ignore[override] + self, + ) -> Optional[Tuple[str, Optional[int], str]]: return (self.fspath, None, self.fspath) def __repr__(self) -> str: diff --git a/testing/test_runner.py b/testing/test_runner.py index c6d5b8aaf37..de3e18184c7 100644 --- a/testing/test_runner.py +++ b/testing/test_runner.py @@ -473,6 +473,7 @@ class TestClass(object): assert not rep.skipped assert rep.passed locinfo = rep.location + assert locinfo is not None assert locinfo[0] == col.path.name assert not locinfo[1] assert locinfo[2] == col.path.name From 27165cf8db836c18bd818989ae9478cd4f3a1ee7 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Sun, 12 Feb 2023 21:37:40 -0300 Subject: [PATCH 507/549] Use build-and-inspect-python-package action (#10722) This uses https://github.com/hynek/build-and-inspect-python-package to ensure our package is correct, both during testing and deploy, --- .github/workflows/deploy.yml | 27 ++++++++++++++++----------- .github/workflows/test.yml | 12 ++++++++++++ pyproject.toml | 5 +++++ 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1b865065296..25280994687 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,24 +28,29 @@ jobs: fetch-depth: 0 persist-credentials: false + - name: Build and Check Package + uses: hynek/build-and-inspect-python-package@v1.5 + + - name: Download Package + uses: actions/download-artifact@v3 + with: + name: Packages + path: dist + + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.pypi_token }} + - name: Set up Python uses: actions/setup-python@v4 with: python-version: "3.7" - - name: Install dependencies + - name: Install tox run: | python -m pip install --upgrade pip - pip install --upgrade build tox - - - name: Build package - run: | - python -m build - - - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.pypi_token }} + pip install --upgrade tox - name: Publish GitHub release notes env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 524260961b4..cd1ffdbf9d4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,11 @@ on: env: PYTEST_ADDOPTS: "--color=yes" +# Cancel running jobs for the same workflow and branch. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + # Set permissions at the job level. permissions: {} @@ -189,3 +194,10 @@ jobs: fail_ci_if_error: true files: ./coverage.xml verbose: true + + check-package: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build and Check Package + uses: hynek/build-and-inspect-python-package@v1.5 diff --git a/pyproject.toml b/pyproject.toml index fc9a119f6f0..a4139a5c051 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -114,3 +114,8 @@ template = "changelog/_template.rst" [tool.black] target-version = ['py37'] + +# check-wheel-contents is executed by the build-and-inspect-python-package action. +[tool.check-wheel-contents] +# W009: Wheel contains multiple toplevel library entries +ignore = "W009" From 9048621002fab610e187d1c9e2c251fd8ff65eb3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 12 Feb 2023 21:39:45 -0300 Subject: [PATCH 508/549] [automated] Update plugin list (#10726) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 202 ++++++++++++++++++++----------- 1 file changed, 133 insertions(+), 69 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index d5921c7d36e..86331ed35e8 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1200 plugins. +This list contains 1208 plugins. .. only:: not latex @@ -81,7 +81,7 @@ This list contains 1200 plugins. :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Sep 06, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest :pypi:`pytest-asyncio` Pytest support for asyncio Dec 08, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Jul 11, 2022 N/A N/A + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Feb 10, 2023 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) :pypi:`pytest-async-sqlalchemy` Database testing fixtures using the SQLAlchemy asyncio API Oct 07, 2021 4 - Beta pytest (>=6.0.0) @@ -168,13 +168,14 @@ This list contains 1200 plugins. :pypi:`pytest-change-report` turn . into √,turn F into x Sep 14, 2020 N/A pytest :pypi:`pytest-change-xds` turn . into √,turn F into x Apr 16, 2022 N/A pytest :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) - :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Jan 13, 2023 5 - Production/Stable pytest + :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Feb 09, 2023 5 - Production/Stable pytest :pypi:`pytest-checkdocs` check the README when running tests Oct 09, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) :pypi:`pytest-check-library` check your missing library Jul 17, 2022 N/A N/A :pypi:`pytest-check-libs` check your missing library Jul 17, 2022 N/A N/A :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest>=7.0 :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest + :pypi:`pytest-check-requirements` A package to prevent Dependency Confusion attacks against Yandex. Feb 10, 2023 N/A N/A :pypi:`pytest-chic-report` A pytest plugin to send a report and printing summary of tests. Jan 31, 2023 5 - Production/Stable N/A :pypi:`pytest-chunks` Run only a chunk of your test suite Jul 05, 2022 N/A pytest (>=6.0.0) :pypi:`pytest-circleci` py.test plugin for CircleCI May 03, 2019 N/A N/A @@ -224,7 +225,7 @@ This list contains 1200 plugins. :pypi:`pytest-coveragemarkers` Using pytest markers to track functional coverage and filtering of tests Nov 29, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Jan 30, 2023 5 - Production/Stable pytest (>=7.0) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Jan 23, 2023 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Feb 07, 2023 N/A N/A :pypi:`pytest-cqase` Custom qase pytest plugin Aug 22, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) @@ -282,11 +283,12 @@ This list contains 1200 plugins. :pypi:`pytest-dicom` pytest plugin to provide DICOM fixtures Dec 19, 2018 3 - Alpha pytest :pypi:`pytest-dictsdiff` Jul 26, 2019 N/A N/A :pypi:`pytest-diff` A simple plugin to use with pytest Mar 30, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-diffeo` A package to prevent Dependency Confusion attacks against Yandex. Feb 10, 2023 N/A N/A :pypi:`pytest-diff-selector` Get tests affected by code changes (using git) Feb 24, 2022 4 - Beta pytest (>=6.2.2) ; extra == 'all' :pypi:`pytest-difido` PyTest plugin for generating Difido reports Oct 23, 2022 4 - Beta pytest (>=4.0.0) :pypi:`pytest-disable` pytest plugin to disable a test and skip it from testrun Sep 10, 2015 4 - Beta N/A :pypi:`pytest-disable-plugin` Disable plugins per test Feb 28, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. Mar 27, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) + :pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. Feb 05, 2023 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :pypi:`pytest-django` A Django plugin for pytest. Dec 07, 2021 5 - Production/Stable pytest (>=5.4.0) :pypi:`pytest-django-ahead` A Django plugin for pytest. Oct 27, 2016 5 - Production/Stable pytest (>=2.9) :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Nov 09, 2022 4 - Beta N/A @@ -358,13 +360,13 @@ This list contains 1200 plugins. :pypi:`pytest-eliot` An eliot plugin for pytest. Aug 31, 2022 1 - Planning pytest (>=5.4.0) :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Jan 29, 2023 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Jan 29, 2023 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Jan 29, 2023 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Jan 29, 2023 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Jan 29, 2023 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Jan 29, 2023 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Jan 29, 2023 N/A N/A + :pypi:`pytest-embedded` pytest embedded plugin Feb 06, 2023 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Feb 06, 2023 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Feb 06, 2023 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Feb 06, 2023 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Feb 06, 2023 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Feb 06, 2023 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Feb 06, 2023 N/A N/A :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Oct 15, 2022 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) @@ -401,6 +403,7 @@ This list contains 1200 plugins. :pypi:`pytest-external-blockers` a special outcome for tests that are blocked for external reasons Oct 05, 2021 N/A pytest :pypi:`pytest-extra-durations` A pytest plugin to get durations on a per-function basis and per module basis. Apr 21, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-fabric` Provides test utilities to run fabric task tests by using docker containers Sep 12, 2018 5 - Production/Stable N/A + :pypi:`pytest-factor` A package to prevent Dependency Confusion attacks against Yandex. Feb 10, 2023 N/A N/A :pypi:`pytest-factory` Use factories for test setup with py.test Sep 06, 2020 3 - Alpha pytest (>4.3) :pypi:`pytest-factoryboy` Factory Boy support for pytest. Dec 01, 2022 6 - Mature pytest (>=5.0.0) :pypi:`pytest-factoryboy-fixtures` Generates pytest fixtures that allow the use of type hinting Jun 25, 2020 N/A N/A @@ -445,10 +448,10 @@ This list contains 1200 plugins. :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) :pypi:`pytest-flaptastic` Flaptastic py.test plugin Mar 17, 2019 N/A N/A :pypi:`pytest-flask` A set of py.test fixtures to test Flask applications. Feb 27, 2021 5 - Production/Stable pytest (>=5.2) - :pypi:`pytest-flask-ligand` Pytest fixtures and helper functions to use for testing flask-ligand microservices. Oct 06, 2022 4 - Beta pytest (~=7.1) + :pypi:`pytest-flask-ligand` Pytest fixtures and helper functions to use for testing flask-ligand microservices. Feb 10, 2023 4 - Beta pytest (~=7.2) :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) - :pypi:`pytest-flexreport` Feb 01, 2023 4 - Beta N/A + :pypi:`pytest-flexreport` Feb 05, 2023 4 - Beta N/A :pypi:`pytest-fluent` A pytest plugin in order to provide logs via fluentd Jul 12, 2022 4 - Beta pytest :pypi:`pytest-flyte` Pytest fixtures for simplifying Flyte integration testing May 03, 2021 N/A pytest :pypi:`pytest-focus` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest @@ -488,7 +491,7 @@ This list contains 1200 plugins. :pypi:`pytest-greendots` Green progress dots Feb 08, 2014 3 - Alpha N/A :pypi:`pytest-growl` Growl notifications for pytest results. Jan 13, 2014 5 - Production/Stable N/A :pypi:`pytest-grpc` pytest plugin for grpc May 01, 2020 N/A pytest (>=3.6.0) - :pypi:`pytest-grunnur` Uniform API for PyOpenCL and PyCUDA. Jan 29, 2023 N/A N/A + :pypi:`pytest-grunnur` Py.Test plugin for Grunnur-based packages. Feb 05, 2023 N/A N/A :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest :pypi:`pytest-harmony` Chain tests and data with pytest Jan 17, 2023 N/A pytest (>=7.2.1,<8.0.0) :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Jun 10, 2022 5 - Production/Stable N/A @@ -501,7 +504,7 @@ This list contains 1200 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Feb 03, 2023 3 - Alpha pytest (==7.2.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Feb 08, 2023 3 - Alpha pytest (==7.2.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-test` A plugin that tracks test changes Dec 10, 2022 4 - Beta pytest (>=3.5.0) @@ -540,9 +543,9 @@ This list contains 1200 plugins. :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A - :pypi:`pytest-inline` A pytest plugin for writing inline tests. Nov 23, 2022 4 - Beta pytest (>=7.0.0) + :pypi:`pytest-inline` A pytest plugin for writing inline tests. Feb 08, 2023 4 - Beta pytest (>=7.0.0) :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Feb 02, 2023 5 - Production/Stable N/A - :pypi:`pytest-inmanta-extensions` Inmanta tests package Dec 01, 2022 5 - Production/Stable N/A + :pypi:`pytest-inmanta-extensions` Inmanta tests package Feb 09, 2023 5 - Production/Stable N/A :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jan 30, 2023 5 - Production/Stable N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Jun 16, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A @@ -568,7 +571,7 @@ This list contains 1200 plugins. :pypi:`pytest-jinja` A plugin to generate customizable jinja-based HTML reports in pytest Oct 04, 2022 3 - Alpha pytest (>=6.2.5,<7.0.0) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A :pypi:`pytest-jira-xfail` Plugin skips (xfail) tests if unresolved Jira issue(s) linked Dec 01, 2022 N/A pytest (~=7.2.0) - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Jan 02, 2023 4 - Beta pytest + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Feb 09, 2023 4 - Beta pytest :pypi:`pytest-job-selection` A pytest plugin for load balancing test suites Jan 30, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) @@ -589,6 +592,7 @@ This list contains 1200 plugins. :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A :pypi:`pytest-koopmans` A plugin for testing the koopmans package Nov 21, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A + :pypi:`pytest-kuaisu-rumen-zhinan` Pytest 快速入门指南 Feb 07, 2023 4 - Beta N/A :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. Aug 20, 2022 3 - Alpha pytest (>=3.6,<8) :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A @@ -624,7 +628,7 @@ This list contains 1200 plugins. :pypi:`pytest-logger` Plugin configuring handlers for loggers from Python logging module. Jul 25, 2019 4 - Beta pytest (>=3.2) :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A :pypi:`pytest-logging-end-to-end-test-tool` Sep 23, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-logikal` Common testing environment Feb 03, 2023 5 - Production/Stable pytest (==7.2.1) + :pypi:`pytest-logikal` Common testing environment Feb 11, 2023 5 - Production/Stable pytest (==7.2.1) :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A :pypi:`pytest-loop` pytest plugin for looping tests Jul 22, 2022 5 - Production/Stable pytest (>=6) @@ -657,6 +661,7 @@ This list contains 1200 plugins. :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) + :pypi:`pytest-mini` A plugin to test mp Feb 06, 2023 N/A pytest (>=7.2.0,<8.0.0) :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ml` Test your machine learning! May 04, 2019 4 - Beta N/A :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) @@ -822,7 +827,6 @@ This list contains 1200 plugins. :pypi:`pytest-purkinje` py.test plugin for purkinje test runner Oct 28, 2017 2 - Pre-Alpha N/A :pypi:`pytest-pusher` pytest plugin for push report to minio Jan 06, 2023 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-py125` Dec 03, 2022 N/A N/A - :pypi:`pytest-py15` Dec 01, 2022 N/A N/A :pypi:`pytest-pycharm` Plugin for py.test to enter PyCharm debugger on uncaught exceptions Aug 13, 2020 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-pycodestyle` pytest plugin to run pycodestyle Oct 28, 2022 3 - Alpha N/A :pypi:`pytest-pydev` py.test plugin to connect to a remote debug server with PyDev or PyCharm. Nov 15, 2017 3 - Alpha N/A @@ -840,7 +844,7 @@ This list contains 1200 plugins. :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.0) :pypi:`pytest-pythonpath` pytest plugin for adding to the PYTHONPATH from command line or configs. Feb 10, 2022 5 - Production/Stable pytest (<7,>=2.5.2) :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest - :pypi:`pytest-pyvista` Pytest-pyvista package Jan 29, 2023 4 - Beta pytest>=3.5.0 + :pypi:`pytest-pyvista` Pytest-pyvista package Feb 07, 2023 4 - Beta pytest>=3.5.0 :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Jun 26, 2021 4 - Beta pytest (>=6.2.0) :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jun 26, 2022 5 - Production/Stable pytest (>=6.2.3) @@ -902,7 +906,7 @@ This list contains 1200 plugins. :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Sep 20, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) - :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Jan 12, 2023 5 - Production/Stable pytest (>=5.3) + :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Feb 09, 2023 5 - Production/Stable pytest (>=5.3) :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A :pypi:`pytest-reserial` Pytest fixture for recording and replaying serial port traffic. Nov 29, 2022 4 - Beta pytest :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Dec 12, 2022 N/A N/A @@ -930,10 +934,12 @@ This list contains 1200 plugins. :pypi:`pytest-rst` Test code from RST documents with pytest Jan 26, 2023 N/A N/A :pypi:`pytest-rt` pytest data collector plugin for Testgr May 05, 2022 N/A N/A :pypi:`pytest-rts` Coverage-based regression test selection (RTS) plugin for pytest May 17, 2021 N/A pytest + :pypi:`pytest-ruff` pytest plugin to check ruff requirements. Feb 10, 2023 4 - Beta N/A :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A :pypi:`pytest-runner` Invoke py.test as distutils command with dependency resolution Feb 25, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Nov 12, 2022 5 - Production/Stable pytest + :pypi:`pytest-runtime-types` Checks type annotations on runtime while running tests. Feb 09, 2023 N/A pytest :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A pytest>=5.0.0 :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Oct 31, 2022 3 - Alpha N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A @@ -944,14 +950,14 @@ This list contains 1200 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Feb 04, 2023 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Feb 09, 2023 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schedule` The job of test scheduling for humans. Jan 07, 2023 5 - Production/Stable N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 21, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Feb 04, 2023 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Feb 09, 2023 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -981,7 +987,7 @@ This list contains 1200 plugins. :pypi:`pytest-skip-markers` Pytest Salt Plugin Dec 20, 2022 5 - Production/Stable pytest (>=7.1.0) :pypi:`pytest-skipper` A plugin that selects only tests with changes in execution path Mar 26, 2017 3 - Alpha pytest (>=3.0.6) :pypi:`pytest-skippy` Automatically skip tests that don't need to run! Jan 27, 2018 3 - Alpha pytest (>=2.3.4) - :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Apr 26, 2022 N/A pytest>=6.2.0 + :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Feb 09, 2023 N/A pytest>=6.2.0 :pypi:`pytest-slack` Pytest to Slack reporting plugin Dec 15, 2020 5 - Production/Stable N/A :pypi:`pytest-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A :pypi:`pytest-slowest-first` Sort tests by their last duration, slowest first Dec 11, 2022 4 - Beta N/A @@ -1028,6 +1034,7 @@ This list contains 1200 plugins. :pypi:`pytest-srcpaths` Add paths to sys.path Oct 15, 2021 N/A pytest>=6.2.0 :pypi:`pytest-ssh` pytest plugin for ssh command run May 27, 2019 N/A pytest :pypi:`pytest-start-from` Start pytest run from a given point Apr 11, 2016 N/A N/A + :pypi:`pytest-star-track-issue` A package to prevent Dependency Confusion attacks against Yandex. Feb 10, 2023 N/A N/A :pypi:`pytest-statsd` pytest plugin for reporting to graphite Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-stepfunctions` A small description May 08, 2021 4 - Beta pytest :pypi:`pytest-steps` Create step-wise / incremental tests in pytest. Sep 23, 2021 5 - Production/Stable N/A @@ -1059,7 +1066,7 @@ This list contains 1200 plugins. :pypi:`pytest-tcpclient` A pytest plugin for testing TCP clients Nov 16, 2022 N/A pytest (<8,>=7.1.3) :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A - :pypi:`pytest-telegram-notifier` Telegram notification plugin for Pytest Feb 04, 2023 5 - Production/Stable N/A + :pypi:`pytest-telegram-notifier` Telegram notification plugin for Pytest Feb 07, 2023 5 - Production/Stable N/A :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) :pypi:`pytest-terra-fixt` Terraform and Terragrunt fixtures for pytest Sep 15, 2022 N/A pytest (==6.2.5) :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Sep 01, 2022 N/A pytest (>=6.0) @@ -1078,7 +1085,7 @@ This list contains 1200 plugins. :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) - :pypi:`pytest-testrail2` A pytest plugin to upload results to TestRail. Feb 03, 2023 N/A pytest (<8.0,>=7.2.0) + :pypi:`pytest-testrail2` A pytest plugin to upload results to TestRail. Feb 10, 2023 N/A pytest (<8.0,>=7.2.0) :pypi:`pytest-testrail-api-client` TestRail Api Python Client Dec 14, 2021 N/A pytest :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A @@ -1162,7 +1169,7 @@ This list contains 1200 plugins. :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest :pypi:`pytest-vcs` Sep 22, 2022 4 - Beta N/A :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest - :pypi:`pytest-ver` Pytest module with Verification Protocol, Verification Report and Trace Matrix Jan 29, 2023 2 - Pre-Alpha N/A + :pypi:`pytest-ver` Pytest module with Verification Protocol, Verification Report and Trace Matrix Feb 05, 2023 2 - Pre-Alpha N/A :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) :pypi:`pytest-virtualenv` Virtualenv fixture for py.test May 28, 2019 5 - Production/Stable pytest @@ -1189,19 +1196,20 @@ This list contains 1200 plugins. :pypi:`pytest-wiremock` A pytest plugin for programmatically using wiremock in integration tests Mar 27, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-with-docker` pytest with docker helpers. Nov 09, 2021 N/A pytest :pypi:`pytest-workflow` A pytest plugin for configuring workflow/pipeline tests using YAML files Jan 13, 2023 5 - Production/Stable pytest (>=7.0.0) - :pypi:`pytest-xdist` pytest xdist plugin for distributed testing, most importantly across multiple CPUs Dec 03, 2022 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-xdist` pytest xdist plugin for distributed testing, most importantly across multiple CPUs Feb 07, 2023 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-xdist-debug-for-graingert` pytest xdist plugin for distributed testing and loop-on-failing modes Jul 24, 2019 5 - Production/Stable pytest (>=4.4.0) :pypi:`pytest-xdist-forked` forked from pytest-xdist Feb 10, 2020 5 - Production/Stable pytest (>=4.4.0) :pypi:`pytest-xdist-tracker` pytest plugin helps to reproduce failures for particular xdist node Nov 18, 2021 3 - Alpha pytest (>=3.5.1) :pypi:`pytest-xfaillist` Maintain a xfaillist in an additional file to avoid merge-conflicts. Sep 17, 2021 N/A pytest (>=6.2.2,<7.0.0) :pypi:`pytest-xfiles` Pytest fixtures providing data read from function, module or package related (x)files. Feb 27, 2018 N/A N/A :pypi:`pytest-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A - :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Dec 13, 2022 N/A pytest>=7.2.0 + :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Feb 09, 2023 N/A pytest>=7.2.0 :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Jan 05, 2023 4 - Beta pytest (>=2.8) :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) + :pypi:`pytest-xskynet` A package to prevent Dependency Confusion attacks against Yandex. Feb 10, 2023 N/A N/A :pypi:`pytest-xvfb` A pytest plugin to run Xvfb for tests. Jun 09, 2020 4 - Beta pytest (>=2.8.1) :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) @@ -1665,7 +1673,7 @@ This list contains 1200 plugins. Pytest support for asyncio :pypi:`pytest-asyncio-cooperative` - *last release*: Jul 11, 2022, + *last release*: Feb 10, 2023, *status*: N/A, *requires*: N/A @@ -2274,7 +2282,7 @@ This list contains 1200 plugins. A pytest fixture for changing current working directory :pypi:`pytest-check` - *last release*: Jan 13, 2023, + *last release*: Feb 09, 2023, *status*: 5 - Production/Stable, *requires*: pytest @@ -2322,6 +2330,13 @@ This list contains 1200 plugins. pytest plugin to test Check_MK checks + :pypi:`pytest-check-requirements` + *last release*: Feb 10, 2023, + *status*: N/A, + *requires*: N/A + + A package to prevent Dependency Confusion attacks against Yandex. + :pypi:`pytest-chic-report` *last release*: Jan 31, 2023, *status*: 5 - Production/Stable, @@ -2666,7 +2681,7 @@ This list contains 1200 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Jan 23, 2023, + *last release*: Feb 07, 2023, *status*: N/A, *requires*: N/A @@ -3071,6 +3086,13 @@ This list contains 1200 plugins. A simple plugin to use with pytest + :pypi:`pytest-diffeo` + *last release*: Feb 10, 2023, + *status*: N/A, + *requires*: N/A + + A package to prevent Dependency Confusion attacks against Yandex. + :pypi:`pytest-diff-selector` *last release*: Feb 24, 2022, *status*: 4 - Beta, @@ -3100,7 +3122,7 @@ This list contains 1200 plugins. Disable plugins per test :pypi:`pytest-discord` - *last release*: Mar 27, 2022, + *last release*: Feb 05, 2023, *status*: 4 - Beta, *requires*: pytest (!=6.0.0,<8,>=3.3.2) @@ -3604,49 +3626,49 @@ This list contains 1200 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Jan 29, 2023, + *last release*: Feb 06, 2023, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Jan 29, 2023, + *last release*: Feb 06, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Jan 29, 2023, + *last release*: Feb 06, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Jan 29, 2023, + *last release*: Feb 06, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Jan 29, 2023, + *last release*: Feb 06, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Jan 29, 2023, + *last release*: Feb 06, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Jan 29, 2023, + *last release*: Feb 06, 2023, *status*: N/A, *requires*: N/A @@ -3904,6 +3926,13 @@ This list contains 1200 plugins. Provides test utilities to run fabric task tests by using docker containers + :pypi:`pytest-factor` + *last release*: Feb 10, 2023, + *status*: N/A, + *requires*: N/A + + A package to prevent Dependency Confusion attacks against Yandex. + :pypi:`pytest-factory` *last release*: Sep 06, 2020, *status*: 3 - Alpha, @@ -4213,9 +4242,9 @@ This list contains 1200 plugins. A set of py.test fixtures to test Flask applications. :pypi:`pytest-flask-ligand` - *last release*: Oct 06, 2022, + *last release*: Feb 10, 2023, *status*: 4 - Beta, - *requires*: pytest (~=7.1) + *requires*: pytest (~=7.2) Pytest fixtures and helper functions to use for testing flask-ligand microservices. @@ -4234,7 +4263,7 @@ This list contains 1200 plugins. Run tests in transactions using pytest, Flask, and SQLalchemy. :pypi:`pytest-flexreport` - *last release*: Feb 01, 2023, + *last release*: Feb 05, 2023, *status*: 4 - Beta, *requires*: N/A @@ -4514,11 +4543,11 @@ This list contains 1200 plugins. pytest plugin for grpc :pypi:`pytest-grunnur` - *last release*: Jan 29, 2023, + *last release*: Feb 05, 2023, *status*: N/A, *requires*: N/A - Uniform API for PyOpenCL and PyCUDA. + Py.Test plugin for Grunnur-based packages. :pypi:`pytest-hammertime` *last release*: Jul 28, 2018, @@ -4605,7 +4634,7 @@ This list contains 1200 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Feb 03, 2023, + *last release*: Feb 08, 2023, *status*: 3 - Alpha, *requires*: pytest (==7.2.1) @@ -4878,7 +4907,7 @@ This list contains 1200 plugins. Reuse pytest.ini to store env variables :pypi:`pytest-inline` - *last release*: Nov 23, 2022, + *last release*: Feb 08, 2023, *status*: 4 - Beta, *requires*: pytest (>=7.0.0) @@ -4892,7 +4921,7 @@ This list contains 1200 plugins. A py.test plugin providing fixtures to simplify inmanta modules testing. :pypi:`pytest-inmanta-extensions` - *last release*: Dec 01, 2022, + *last release*: Feb 09, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -5074,7 +5103,7 @@ This list contains 1200 plugins. Plugin skips (xfail) tests if unresolved Jira issue(s) linked :pypi:`pytest-jira-xray` - *last release*: Jan 02, 2023, + *last release*: Feb 09, 2023, *status*: 4 - Beta, *requires*: pytest @@ -5220,6 +5249,13 @@ This list contains 1200 plugins. pytest krtech common library + :pypi:`pytest-kuaisu-rumen-zhinan` + *last release*: Feb 07, 2023, + *status*: 4 - Beta, + *requires*: N/A + + Pytest 快速入门指南 + :pypi:`pytest-kwparametrize` *last release*: Jan 22, 2021, *status*: N/A, @@ -5466,7 +5502,7 @@ This list contains 1200 plugins. :pypi:`pytest-logikal` - *last release*: Feb 03, 2023, + *last release*: Feb 11, 2023, *status*: 5 - Production/Stable, *requires*: pytest (==7.2.1) @@ -5696,6 +5732,13 @@ This list contains 1200 plugins. A pytest plugin for running tests against Minecraft releases + :pypi:`pytest-mini` + *last release*: Feb 06, 2023, + *status*: N/A, + *requires*: pytest (>=7.2.0,<8.0.0) + + A plugin to test mp + :pypi:`pytest-missing-fixtures` *last release*: Oct 14, 2020, *status*: 4 - Beta, @@ -6851,13 +6894,6 @@ This list contains 1200 plugins. - :pypi:`pytest-py15` - *last release*: Dec 01, 2022, - *status*: N/A, - *requires*: N/A - - - :pypi:`pytest-pycharm` *last release*: Aug 13, 2020, *status*: 5 - Production/Stable, @@ -6978,7 +7014,7 @@ This list contains 1200 plugins. pytest plugin for a better developer experience when working with the PyTorch test suite :pypi:`pytest-pyvista` - *last release*: Jan 29, 2023, + *last release*: Feb 07, 2023, *status*: 4 - Beta, *requires*: pytest>=3.5.0 @@ -7412,7 +7448,7 @@ This list contains 1200 plugins. Re-run only changed files in specified branch :pypi:`pytest-rerunfailures` - *last release*: Jan 12, 2023, + *last release*: Feb 09, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=5.3) @@ -7607,6 +7643,13 @@ This list contains 1200 plugins. Coverage-based regression test selection (RTS) plugin for pytest + :pypi:`pytest-ruff` + *last release*: Feb 10, 2023, + *status*: 4 - Beta, + *requires*: N/A + + pytest plugin to check ruff requirements. + :pypi:`pytest-run-changed` *last release*: Apr 02, 2021, *status*: 3 - Alpha, @@ -7635,6 +7678,13 @@ This list contains 1200 plugins. Pytest Plugin for running and testing subprocesses. + :pypi:`pytest-runtime-types` + *last release*: Feb 09, 2023, + *status*: N/A, + *requires*: pytest + + Checks type annotations on runtime while running tests. + :pypi:`pytest-runtime-xfail` *last release*: Aug 26, 2021, *status*: N/A, @@ -7706,7 +7756,7 @@ This list contains 1200 plugins. :pypi:`pytest-sbase` - *last release*: Feb 04, 2023, + *last release*: Feb 09, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -7755,7 +7805,7 @@ This list contains 1200 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Feb 04, 2023, + *last release*: Feb 09, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -7965,7 +8015,7 @@ This list contains 1200 plugins. Automatically skip tests that don't need to run! :pypi:`pytest-skip-slow` - *last release*: Apr 26, 2022, + *last release*: Feb 09, 2023, *status*: N/A, *requires*: pytest>=6.2.0 @@ -8293,6 +8343,13 @@ This list contains 1200 plugins. Start pytest run from a given point + :pypi:`pytest-star-track-issue` + *last release*: Feb 10, 2023, + *status*: N/A, + *requires*: N/A + + A package to prevent Dependency Confusion attacks against Yandex. + :pypi:`pytest-statsd` *last release*: Nov 30, 2018, *status*: 5 - Production/Stable, @@ -8511,7 +8568,7 @@ This list contains 1200 plugins. Pytest to Telegram reporting plugin :pypi:`pytest-telegram-notifier` - *last release*: Feb 04, 2023, + *last release*: Feb 07, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -8644,7 +8701,7 @@ This list contains 1200 plugins. pytest plugin for creating TestRail runs and adding results :pypi:`pytest-testrail2` - *last release*: Feb 03, 2023, + *last release*: Feb 10, 2023, *status*: N/A, *requires*: pytest (<8.0,>=7.2.0) @@ -9232,7 +9289,7 @@ This list contains 1200 plugins. py.test fixture for creating a virtual environment :pypi:`pytest-ver` - *last release*: Jan 29, 2023, + *last release*: Feb 05, 2023, *status*: 2 - Pre-Alpha, *requires*: N/A @@ -9421,7 +9478,7 @@ This list contains 1200 plugins. A pytest plugin for configuring workflow/pipeline tests using YAML files :pypi:`pytest-xdist` - *last release*: Dec 03, 2022, + *last release*: Feb 07, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2.0) @@ -9470,7 +9527,7 @@ This list contains 1200 plugins. Extended logging for test and decorators :pypi:`pytest-xlsx` - *last release*: Dec 13, 2022, + *last release*: Feb 09, 2023, *status*: N/A, *requires*: pytest>=7.2.0 @@ -9511,6 +9568,13 @@ This list contains 1200 plugins. + :pypi:`pytest-xskynet` + *last release*: Feb 10, 2023, + *status*: N/A, + *requires*: N/A + + A package to prevent Dependency Confusion attacks against Yandex. + :pypi:`pytest-xvfb` *last release*: Jun 09, 2020, *status*: 4 - Beta, From 00c94ab01bfc567e6c89330c67f2dc65a6126208 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Feb 2023 08:05:47 -0300 Subject: [PATCH 509/549] build(deps): Bump pytest-rerunfailures in /testing/plugins_integration (#10731) Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 11.0 to 11.1. - [Release notes](https://github.com/pytest-dev/pytest-rerunfailures/releases) - [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/11.0...11.1) --- updated-dependencies: - dependency-name: pytest-rerunfailures dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index cdcd99be4a3..665196bcdf4 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -7,7 +7,7 @@ pytest-django==4.5.2 pytest-flakes==4.0.5 pytest-html==3.2.0 pytest-mock==3.10.0 -pytest-rerunfailures==11.0 +pytest-rerunfailures==11.1 pytest-sugar==0.9.5 pytest-trio==0.7.0 pytest-twisted==1.14.0 From e9f3a01392d944fc291633579274021dc7b2f948 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 14 Feb 2023 07:30:12 -0300 Subject: [PATCH 510/549] [pre-commit.ci] pre-commit autoupdate (#10733) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v0.991 → v1.0.0](https://github.com/pre-commit/mirrors-mypy/compare/v0.991...v1.0.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2adcc4d4930..56cd282fe11 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -58,7 +58,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.991 + rev: v1.0.0 hooks: - id: mypy files: ^(src/|testing/) From aa72496d24bf0664d13f1ea19c221762708f83c9 Mon Sep 17 00:00:00 2001 From: Garvit Shubham <70941313+itsmegarvi@users.noreply.github.com> Date: Tue, 14 Feb 2023 19:27:32 +0530 Subject: [PATCH 511/549] Fix entry-points declaration in the documentation example using Hatch Closes #10721 --- changelog/10721.doc.rst | 1 + doc/en/how-to/writing_plugins.rst | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) create mode 100644 changelog/10721.doc.rst diff --git a/changelog/10721.doc.rst b/changelog/10721.doc.rst new file mode 100644 index 00000000000..33ba405124c --- /dev/null +++ b/changelog/10721.doc.rst @@ -0,0 +1 @@ +Fixed entry-points declaration in the documentation example using Hatch. diff --git a/doc/en/how-to/writing_plugins.rst b/doc/en/how-to/writing_plugins.rst index f15b69c2317..4eee1b2e120 100644 --- a/doc/en/how-to/writing_plugins.rst +++ b/doc/en/how-to/writing_plugins.rst @@ -167,13 +167,8 @@ it in your ``pyproject.toml`` file. "Framework :: Pytest", ] - [tool.setuptools] - packages = ["myproject"] - - [project.entry_points] - pytest11 = [ - "myproject = myproject.pluginmodule", - ] + [project.entry-points.pytest11] + myproject = "myproject.pluginmodule" If a package is installed this way, ``pytest`` will load ``myproject.pluginmodule`` as a plugin which can define From 464f29901fd437d03a3434bbcda0918c9c330868 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 15 Feb 2023 15:06:24 +0100 Subject: [PATCH 512/549] Update open training (#10739) --- doc/en/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/index.rst b/doc/en/index.rst index 0c94d9d4625..c277cc30721 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -2,7 +2,7 @@ .. sidebar:: Next Open Trainings - - `Professional Testing with Python `_, via `Python Academy `_, March 7th to 9th 2023 (3 day in-depth training), Remote and Leipzig, Germany + - `Professional Testing with Python `_, via `Python Academy `_, March 7th to 9th 2023 (3 day in-depth training), Remote Also see :doc:`previous talks and blogposts `. From 835cac8d8bfd4e3c0d63a6b1c5edf929c0345504 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Feb 2023 20:40:12 +0000 Subject: [PATCH 513/549] build(deps): Bump django in /testing/plugins_integration Bumps [django](https://github.com/django/django) from 4.1.6 to 4.1.7. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/4.1.6...4.1.7) --- updated-dependencies: - dependency-name: django dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 665196bcdf4..7170587f732 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,5 +1,5 @@ anyio[curio,trio]==3.6.2 -django==4.1.6 +django==4.1.7 pytest-asyncio==0.20.2 pytest-bdd==6.1.1 pytest-cov==4.0.0 From 051f8f1f0fd14e77e467372fa4b83e84a329e57c Mon Sep 17 00:00:00 2001 From: bitzge <4791819+bitzge@users.noreply.github.com> Date: Sat, 18 Feb 2023 22:52:14 +0100 Subject: [PATCH 514/549] Add CI and BUILD_NUMBER env var in docs (#10749) --- changelog/10690.doc.rst | 1 + doc/en/reference/reference.rst | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 changelog/10690.doc.rst diff --git a/changelog/10690.doc.rst b/changelog/10690.doc.rst new file mode 100644 index 00000000000..faf61b3cc44 --- /dev/null +++ b/changelog/10690.doc.rst @@ -0,0 +1 @@ +Added `CI` and `BUILD_NUMBER` environment variables to the documentation. diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 288a4050dbb..c882157eeb7 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1047,6 +1047,14 @@ Environment Variables Environment variables that can be used to change pytest's behavior. +.. envvar:: CI + +When set (regardless of value), pytest acknowledges that is running in a CI process. Alterative to ``BUILD_NUMBER`` variable. + +.. envvar:: BUILD_NUMBER + +When set (regardless of value), pytest acknowledges that is running in a CI process. Alterative to CI variable. + .. envvar:: PYTEST_ADDOPTS This contains a command-line (parsed by the py:mod:`shlex` module) that will be **prepended** to the command line given From da626e7186cc7bf213bc9f8d52e42ff0daf28b92 Mon Sep 17 00:00:00 2001 From: Manuel Jacob Date: Sat, 18 Feb 2023 22:55:46 +0100 Subject: [PATCH 515/549] Update import mode documentation to not refer to __import__() anymore. (#10747) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nowadays, the prepend and append import modes use importlib.import_module() instead of __import__(). There was a phrase “which avoids having to use `__import__`”, in which I couldn’t just replace `__import__` by `importlib.import_module` because the latter is used (in insert_missing_modules()) also when using importlib mode. Therefore I removed the part from the sentence. --- doc/en/explanation/pythonpath.rst | 6 +++--- src/_pytest/pathlib.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/en/explanation/pythonpath.rst b/doc/en/explanation/pythonpath.rst index e1d240b498a..5b533f47fdc 100644 --- a/doc/en/explanation/pythonpath.rst +++ b/doc/en/explanation/pythonpath.rst @@ -16,7 +16,7 @@ import process can be controlled through the ``--import-mode`` command-line flag these values: * ``prepend`` (default): the directory path containing each module will be inserted into the *beginning* - of :py:data:`sys.path` if not already there, and then imported with the :func:`__import__ <__import__>` builtin. + of :py:data:`sys.path` if not already there, and then imported with the :func:`importlib.import_module ` function. This requires test module names to be unique when the test directory tree is not arranged in packages, because the modules will put in :py:data:`sys.modules` after importing. @@ -24,7 +24,7 @@ these values: 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 :py:data:`sys.path` if not already - there, and imported with ``__import__``. + there, and imported with :func:`importlib.import_module `. This better allows to run test modules against installed versions of a package even if the package under test has the same import root. For example: @@ -43,7 +43,7 @@ these values: Same as ``prepend``, requires test module names to be unique when the test directory tree is not arranged in packages, because the modules will put in :py:data:`sys.modules` after importing. -* ``importlib``: new in pytest-6.0, this mode uses :mod:`importlib` to import test modules. This gives full control over the import process, and doesn't require changing :py:data:`sys.path`. +* ``importlib``: new in pytest-6.0, this mode uses more fine control mechanisms provided by :mod:`importlib` to import test modules. This gives full control over the import process, and doesn't require changing :py:data:`sys.path`. For this reason this doesn't require test module names to be unique. diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py index 1fc16f5cde9..9f9463d8862 100644 --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -477,14 +477,14 @@ def import_path( * `mode == ImportMode.prepend`: the directory containing the module (or package, taking `__init__.py` files into account) will be put at the *start* of `sys.path` before - being imported with `__import__. + being imported with `importlib.import_module`. * `mode == ImportMode.append`: same as `prepend`, but the directory will be appended to the end of `sys.path`, if not already in `sys.path`. * `mode == ImportMode.importlib`: uses more fine control mechanisms provided by `importlib` - to import the module, which avoids having to use `__import__` and muck with `sys.path` - at all. It effectively allows having same-named test modules in different places. + to import the module, which avoids having to muck with `sys.path` at all. It effectively + allows having same-named test modules in different places. :param root: Used as an anchor when mode == ImportMode.importlib to obtain From 77152d26e7f4c0236c778009e3e07653bba4131c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 21 Feb 2023 03:03:45 +0000 Subject: [PATCH 516/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-mypy: v1.0.0 → v1.0.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.0.0...v1.0.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 56cd282fe11..bfc1d893b9a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -58,7 +58,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.0.0 + rev: v1.0.1 hooks: - id: mypy files: ^(src/|testing/) From c237297b3d673b8d141a388991c3a4b182e12332 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 24 Feb 2023 23:23:44 +0100 Subject: [PATCH 517/549] Fix OSError in tmpdir on emscripten due to missing getuid() Fixes #10765 --- changelog/10765.bugfix.rst | 1 + src/_pytest/tmpdir.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog/10765.bugfix.rst diff --git a/changelog/10765.bugfix.rst b/changelog/10765.bugfix.rst new file mode 100644 index 00000000000..754abd72c5b --- /dev/null +++ b/changelog/10765.bugfix.rst @@ -0,0 +1 @@ +Fix temp_path fixture always raising OSError on emscripten due to missing getuid diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index ec44623dc24..64f1de07253 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -176,7 +176,7 @@ def getbasetemp(self) -> Path: # Also, to keep things private, fixup any world-readable temp # rootdir's permissions. Historically 0o755 was used, so we can't # just error out on this, at least for a while. - if sys.platform != "win32": + if sys.platform != "win32" and sys.platform != "emscripten": uid = os.getuid() rootdir_stat = rootdir.stat() # getuid shouldn't fail, but cpython defines such a case. From 135600fca39bc9326150d86f6f34707c1cad4fac Mon Sep 17 00:00:00 2001 From: Alex Hadley Date: Fri, 24 Feb 2023 15:04:42 -0800 Subject: [PATCH 518/549] Fix typo in python_api.py --- src/_pytest/python_api.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py index e1cbce210a8..b03a251abaf 100644 --- a/src/_pytest/python_api.py +++ b/src/_pytest/python_api.py @@ -808,7 +808,7 @@ def raises( # noqa: F811 :param typing.Type[E] | typing.Tuple[typing.Type[E], ...] expected_exception: The expected exception type, or a tuple if one of multiple possible - exception types are excepted. + exception types are expected. :kwparam str | typing.Pattern[str] | None match: If specified, a string containing a regular expression, or a regular expression object, that is tested against the string @@ -924,10 +924,10 @@ def raises( # noqa: F811 f"any special code to say 'this should never raise an exception'." ) if isinstance(expected_exception, type): - excepted_exceptions: Tuple[Type[E], ...] = (expected_exception,) + expected_exceptions: Tuple[Type[E], ...] = (expected_exception,) else: - excepted_exceptions = expected_exception - for exc in excepted_exceptions: + expected_exceptions = expected_exception + for exc in expected_exceptions: if not isinstance(exc, type) or not issubclass(exc, BaseException): msg = "expected exception must be a BaseException type, not {}" # type: ignore[unreachable] not_a = exc.__name__ if isinstance(exc, type) else type(exc).__name__ From 13ea4780b8c88a19928bd1c97f255b0ec584846c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 08:55:33 -0300 Subject: [PATCH 519/549] [automated] Update plugin list (#10752) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 126 +++++++++++++++++++------------ 1 file changed, 79 insertions(+), 47 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 86331ed35e8..e320292a30d 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1208 plugins. +This list contains 1212 plugins. .. only:: not latex @@ -138,7 +138,7 @@ This list contains 1208 plugins. :pypi:`pytest-browser` A pytest plugin for console based browser test selection just after the collection phase Dec 10, 2016 3 - Alpha N/A :pypi:`pytest-browsermob-proxy` BrowserMob proxy plugin for py.test. Jun 11, 2013 4 - Beta N/A :pypi:`pytest-browserstack-local` \`\`py.test\`\` plugin to run \`\`BrowserStackLocal\`\` in background. Feb 09, 2018 N/A N/A - :pypi:`pytest-budosystems` Budo Systems Pytest Plugin. Jan 22, 2023 N/A pytest ; extra == 'test' + :pypi:`pytest-budosystems` Budo Systems is a martial arts school management system. This module is the Budo Systems Pytest Plugin. Feb 14, 2023 3 - Alpha pytest :pypi:`pytest-bug` Pytest plugin for marking tests as a bug Jan 29, 2023 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-bugtong-tag` pytest-bugtong-tag is a plugin for pytest Jan 16, 2022 N/A N/A :pypi:`pytest-bugzilla` py.test bugzilla integration plugin May 05, 2010 4 - Beta N/A @@ -168,7 +168,7 @@ This list contains 1208 plugins. :pypi:`pytest-change-report` turn . into √,turn F into x Sep 14, 2020 N/A pytest :pypi:`pytest-change-xds` turn . into √,turn F into x Apr 16, 2022 N/A pytest :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) - :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Feb 09, 2023 5 - Production/Stable pytest + :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Feb 13, 2023 5 - Production/Stable pytest :pypi:`pytest-checkdocs` check the README when running tests Oct 09, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) :pypi:`pytest-check-library` check your missing library Jul 17, 2022 N/A N/A @@ -206,7 +206,7 @@ This list contains 1208 plugins. :pypi:`pytest-colordots` Colorizes the progress indicators Oct 06, 2017 5 - Production/Stable N/A :pypi:`pytest-commander` An interactive GUI test runner for PyTest Aug 17, 2021 N/A pytest (<7.0.0,>=6.2.4) :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method May 15, 2022 N/A pytest (>=3.6,<8) - :pypi:`pytest-compare` pytest plugin for comparing call arguments. Jan 22, 2023 5 - Production/Stable pytest + :pypi:`pytest-compare` pytest plugin for comparing call arguments. Feb 15, 2023 5 - Production/Stable pytest :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-config` Base configurations and utilities for developing your Python project test suite with pytest. Nov 07, 2014 5 - Production/Stable N/A :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Apr 17, 2022 N/A N/A @@ -229,6 +229,7 @@ This list contains 1208 plugins. :pypi:`pytest-cqase` Custom qase pytest plugin Aug 22, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) + :pypi:`pytest-create` pytest-create Feb 15, 2023 1 - Planning N/A :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest :pypi:`pytest-crontab` add crontab task in crontab Dec 09, 2019 N/A N/A :pypi:`pytest-csv` CSV output for pytest. Apr 22, 2021 N/A pytest (>=6.0) @@ -240,7 +241,7 @@ This list contains 1208 plugins. :pypi:`pytest-custom-nodeid` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 07, 2021 N/A N/A :pypi:`pytest-custom-report` Configure the symbols displayed for test outcomes Jan 30, 2019 N/A pytest :pypi:`pytest-custom-scheduling` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 01, 2021 N/A N/A - :pypi:`pytest-cython` A plugin for testing Cython extension modules Mar 26, 2022 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-cython` A plugin for testing Cython extension modules Feb 16, 2023 5 - Production/Stable pytest (>=4.6.0) :pypi:`pytest-cython-collect` Jun 17, 2022 N/A pytest :pypi:`pytest-darker` A pytest plugin for checking of modified code using Darker Aug 16, 2020 N/A pytest (>=6.0.1) ; extra == 'test' :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A @@ -504,7 +505,7 @@ This list contains 1208 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Feb 08, 2023 3 - Alpha pytest (==7.2.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Feb 16, 2023 3 - Alpha pytest (==7.2.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-test` A plugin that tracks test changes Dec 10, 2022 4 - Beta pytest (>=3.5.0) @@ -526,7 +527,7 @@ This list contains 1208 plugins. :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Sep 12, 2022 3 - Alpha N/A :pypi:`pytest-httptesting` http_testing framework on top of pytest Dec 08, 2022 N/A pytest (>=7.2.0,<8.0.0) :pypi:`pytest-httpx` Send responses to httpx. Jan 20, 2023 5 - Production/Stable pytest (<8.0,>=6.0) - :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Nov 16, 2021 N/A pytest (>=6.2.5) + :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Feb 16, 2023 N/A pytest (>=7.2.1) :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A @@ -593,6 +594,8 @@ This list contains 1208 plugins. :pypi:`pytest-koopmans` A plugin for testing the koopmans package Nov 21, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A :pypi:`pytest-kuaisu-rumen-zhinan` Pytest 快速入门指南 Feb 07, 2023 4 - Beta N/A + :pypi:`pytest-kuaisu-rumen-zhinan-jifan` Pytest 快速入门指南(机翻) Feb 11, 2023 4 - Beta N/A + :pypi:`pytest-kubernetes` Feb 16, 2023 N/A pytest (>=7.2.1,<8.0.0) :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. Aug 20, 2022 3 - Alpha pytest (>=3.6,<8) :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A @@ -601,7 +604,7 @@ This list contains 1208 plugins. :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A :pypi:`pytest-lazy-fixture` It helps to use fixtures in pytest.mark.parametrize Feb 01, 2020 4 - Beta pytest (>=3.2.5) :pypi:`pytest-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest - :pypi:`pytest-leak-finder` Find the previous test that makes another to fail Apr 18, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-leak-finder` Find the test that's leaking before the one that fails Feb 15, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-leaks` A pytest plugin to trace resource leaks. Nov 27, 2019 1 - Planning N/A :pypi:`pytest-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest. Dec 22, 2018 4 - Beta pytest (>=3.0.0) @@ -730,7 +733,7 @@ This list contains 1208 plugins. :pypi:`pytest-odoo` py.test plugin to run Odoo tests Nov 17, 2022 4 - Beta pytest (>=7.2.0) :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A :pypi:`pytest-oerp` pytest plugin to test OpenERP modules Feb 28, 2012 3 - Alpha N/A - :pypi:`pytest-ogsm-plugin` 针对特定项目定制化插件,优化了pytest报告展示方式,并添加了项目所需特定参数 Jan 09, 2023 N/A N/A + :pypi:`pytest-ogsm-plugin` 针对特定项目定制化插件,优化了pytest报告展示方式,并添加了项目所需特定参数 Feb 17, 2023 N/A N/A :pypi:`pytest-ok` The ultimate pytest output plugin Apr 01, 2019 4 - Beta N/A :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jun 14, 2022 5 - Production/Stable pytest (<7.1); python_version <= "3.6" :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A @@ -846,7 +849,7 @@ This list contains 1208 plugins. :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest :pypi:`pytest-pyvista` Pytest-pyvista package Feb 07, 2023 4 - Beta pytest>=3.5.0 :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) - :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Jun 26, 2021 4 - Beta pytest (>=6.2.0) + :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Feb 14, 2023 4 - Beta pytest (>=6.2.0) :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jun 26, 2022 5 - Production/Stable pytest (>=6.2.3) :pypi:`pytest-qml` Run QML Tests with pytest Dec 02, 2020 4 - Beta pytest (>=6.0.0) :pypi:`pytest-qr` pytest plugin to generate test result QR codes Nov 25, 2021 4 - Beta N/A @@ -869,7 +872,7 @@ This list contains 1208 plugins. :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Dec 03, 2022 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-readme` Test your README.md file Sep 02, 2022 5 - Production/Stable N/A :pypi:`pytest-reana` Pytest fixtures for REANA. Dec 13, 2022 3 - Alpha N/A - :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Jun 20, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Feb 16, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-redislite` Pytest plugin for testing code using Redis Apr 05, 2022 4 - Beta pytest @@ -898,7 +901,7 @@ This list contains 1208 plugins. :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility Dec 11, 2020 3 - Alpha pytest (>=5.2) :pypi:`pytest-report-me` A pytest plugin to generate report. Dec 31, 2020 N/A pytest :pypi:`pytest-report-parameters` pytest plugin for adding tests' parameters to junit report Jun 18, 2020 3 - Alpha pytest (>=2.4.2) - :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Nov 30, 2022 N/A pytest (>=3.8.0) + :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Feb 17, 2023 N/A pytest (>=3.8.0) :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-requestselapsed` collect and show http requests elapsed time Aug 14, 2022 N/A N/A @@ -906,7 +909,7 @@ This list contains 1208 plugins. :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Sep 20, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) - :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Feb 09, 2023 5 - Production/Stable pytest (>=5.3) + :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Feb 17, 2023 5 - Production/Stable pytest (>=5.3) :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A :pypi:`pytest-reserial` Pytest fixture for recording and replaying serial port traffic. Nov 29, 2022 4 - Beta pytest :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Dec 12, 2022 N/A N/A @@ -950,14 +953,14 @@ This list contains 1208 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Feb 09, 2023 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Feb 18, 2023 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schedule` The job of test scheduling for humans. Jan 07, 2023 5 - Production/Stable N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 21, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Feb 09, 2023 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Feb 18, 2023 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -1007,7 +1010,7 @@ This list contains 1208 plugins. :pypi:`pytest-solidity` A PyTest library plugin for Solidity language. Jan 15, 2022 1 - Planning pytest (<7,>=6.0.1) ; extra == 'tests' :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) :pypi:`pytest-sorter` A simple plugin to first execute tests that historically failed more Apr 20, 2021 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Nov 17, 2022 2 - Pre-Alpha pytest + :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Feb 14, 2023 2 - Pre-Alpha pytest :pypi:`pytest-sourceorder` Test-ordering plugin for pytest Sep 01, 2021 4 - Beta pytest :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. Feb 23, 2020 4 - Beta pytest :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A @@ -1022,7 +1025,7 @@ This list contains 1208 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Jan 26, 2023 N/A pytest (>5.4.0,<7.3) + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Feb 16, 2023 N/A pytest (>5.4.0,<7.3) :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A @@ -1049,7 +1052,7 @@ This list contains 1208 plugins. :pypi:`pytest-study` A pytest plugin to organize long run tests (named studies) without interfering the regular tests Sep 26, 2017 3 - Alpha pytest (>=2.0) :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Jan 28, 2023 5 - Production/Stable pytest (>=4.0.0) :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Jul 16, 2022 N/A N/A - :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Oct 28, 2022 4 - Beta pytest (>=7.0) + :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Feb 16, 2023 4 - Beta pytest (>=7.0) :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Nov 05, 2022 3 - Alpha pytest (>=2.9) :pypi:`pytest-svn` SVN repository fixture for py.test May 28, 2019 5 - Production/Stable pytest @@ -1057,7 +1060,7 @@ This list contains 1208 plugins. :pypi:`pytest-system-statistics` Pytest plugin to track and report system usage statistics Feb 16, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-system-test-plugin` Pyst - Pytest System-Test Plugin Feb 03, 2022 N/A N/A :pypi:`pytest-tagging` a pytest plugin to tag tests Oct 23, 2022 N/A pytest (>=7.1.3,<8.0.0) - :pypi:`pytest-takeltest` Fixtures for ansible, testinfra and molecule Jan 04, 2022 N/A N/A + :pypi:`pytest-takeltest` Fixtures for ansible, testinfra and molecule Feb 15, 2023 N/A N/A :pypi:`pytest-talisker` Nov 28, 2021 N/A N/A :pypi:`pytest-tap` Test Anything Protocol (TAP) reporting plugin for pytest Oct 27, 2021 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-tape` easy assertion with expected results saved to yaml files Mar 17, 2021 4 - Beta N/A @@ -1119,7 +1122,7 @@ This list contains 1208 plugins. :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest :pypi:`pytest-tmpfs` A pytest plugin that helps you on using a temporary filesystem for testing. Aug 29, 2022 N/A pytest :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Aug 12, 2022 N/A N/A - :pypi:`pytest-tmux` A pytest plugin that enables tmux driven tests Jan 30, 2023 4 - Beta N/A + :pypi:`pytest-tmux` A pytest plugin that enables tmux driven tests Feb 15, 2023 4 - Beta N/A :pypi:`pytest-todo` A small plugin for the pytest testing framework, marking TODO comments as failure May 23, 2019 4 - Beta pytest :pypi:`pytest-tomato` Mar 01, 2019 5 - Production/Stable N/A :pypi:`pytest-toolbelt` This is just a collection of utilities for pytest, but don't really belong in pytest proper. Aug 12, 2019 3 - Alpha N/A @@ -1214,7 +1217,7 @@ This list contains 1208 plugins. :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yamlwsgi` Run tests against wsgi apps defined in yaml May 11, 2010 N/A N/A - :pypi:`pytest-yaml-yoyo` http/https API run by yaml Dec 17, 2022 N/A N/A + :pypi:`pytest-yaml-yoyo` http/https API run by yaml Feb 17, 2023 N/A pytest (==7.2.0) :pypi:`pytest-yapf` Run yapf Jul 06, 2017 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) :pypi:`pytest-yield` PyTest plugin to run tests concurrently, each \`yield\` switch context to other one Jan 23, 2019 N/A N/A @@ -1224,6 +1227,7 @@ This list contains 1208 plugins. :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Dec 12, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zest` Zesty additions to pytest. Nov 17, 2022 N/A N/A + :pypi:`pytest-zhongwen-wendang` PyTest 中文文档 Feb 13, 2023 4 - Beta N/A :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ @@ -2072,11 +2076,11 @@ This list contains 1208 plugins. \`\`py.test\`\` plugin to run \`\`BrowserStackLocal\`\` in background. :pypi:`pytest-budosystems` - *last release*: Jan 22, 2023, - *status*: N/A, - *requires*: pytest ; extra == 'test' + *last release*: Feb 14, 2023, + *status*: 3 - Alpha, + *requires*: pytest - Budo Systems Pytest Plugin. + Budo Systems is a martial arts school management system. This module is the Budo Systems Pytest Plugin. :pypi:`pytest-bug` *last release*: Jan 29, 2023, @@ -2282,7 +2286,7 @@ This list contains 1208 plugins. A pytest fixture for changing current working directory :pypi:`pytest-check` - *last release*: Feb 09, 2023, + *last release*: Feb 13, 2023, *status*: 5 - Production/Stable, *requires*: pytest @@ -2548,7 +2552,7 @@ This list contains 1208 plugins. pytest framework for testing different aspects of a common method :pypi:`pytest-compare` - *last release*: Jan 22, 2023, + *last release*: Feb 15, 2023, *status*: 5 - Production/Stable, *requires*: pytest @@ -2708,6 +2712,13 @@ This list contains 1208 plugins. Manages CrateDB instances during your integration tests + :pypi:`pytest-create` + *last release*: Feb 15, 2023, + *status*: 1 - Planning, + *requires*: N/A + + pytest-create + :pypi:`pytest-cricri` *last release*: Jan 27, 2018, *status*: N/A, @@ -2786,7 +2797,7 @@ This list contains 1208 plugins. Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report :pypi:`pytest-cython` - *last release*: Mar 26, 2022, + *last release*: Feb 16, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=4.6.0) @@ -4634,7 +4645,7 @@ This list contains 1208 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Feb 08, 2023, + *last release*: Feb 16, 2023, *status*: 3 - Alpha, *requires*: pytest (==7.2.1) @@ -4788,9 +4799,9 @@ This list contains 1208 plugins. Send responses to httpx. :pypi:`pytest-httpx-blockage` - *last release*: Nov 16, 2021, + *last release*: Feb 16, 2023, *status*: N/A, - *requires*: pytest (>=6.2.5) + *requires*: pytest (>=7.2.1) Disable httpx requests during a test run @@ -5256,6 +5267,20 @@ This list contains 1208 plugins. Pytest 快速入门指南 + :pypi:`pytest-kuaisu-rumen-zhinan-jifan` + *last release*: Feb 11, 2023, + *status*: 4 - Beta, + *requires*: N/A + + Pytest 快速入门指南(机翻) + + :pypi:`pytest-kubernetes` + *last release*: Feb 16, 2023, + *status*: N/A, + *requires*: pytest (>=7.2.1,<8.0.0) + + + :pypi:`pytest-kwparametrize` *last release*: Jan 22, 2021, *status*: N/A, @@ -5313,11 +5338,11 @@ This list contains 1208 plugins. python-ldap fixtures for pytest :pypi:`pytest-leak-finder` - *last release*: Apr 18, 2022, + *last release*: Feb 15, 2023, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) - Find the previous test that makes another to fail + Find the test that's leaking before the one that fails :pypi:`pytest-leaks` *last release*: Nov 27, 2019, @@ -6216,7 +6241,7 @@ This list contains 1208 plugins. pytest plugin to test OpenERP modules :pypi:`pytest-ogsm-plugin` - *last release*: Jan 09, 2023, + *last release*: Feb 17, 2023, *status*: N/A, *requires*: N/A @@ -7028,7 +7053,7 @@ This list contains 1208 plugins. Pytest support for qasync. :pypi:`pytest-qatouch` - *last release*: Jun 26, 2021, + *last release*: Feb 14, 2023, *status*: 4 - Beta, *requires*: pytest (>=6.2.0) @@ -7189,7 +7214,7 @@ This list contains 1208 plugins. Pytest fixtures for REANA. :pypi:`pytest-recording` - *last release*: Jun 20, 2022, + *last release*: Feb 16, 2023, *status*: 4 - Beta, *requires*: pytest (>=3.5.0) @@ -7392,7 +7417,7 @@ This list contains 1208 plugins. pytest plugin for adding tests' parameters to junit report :pypi:`pytest-reportportal` - *last release*: Nov 30, 2022, + *last release*: Feb 17, 2023, *status*: N/A, *requires*: pytest (>=3.8.0) @@ -7448,7 +7473,7 @@ This list contains 1208 plugins. Re-run only changed files in specified branch :pypi:`pytest-rerunfailures` - *last release*: Feb 09, 2023, + *last release*: Feb 17, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=5.3) @@ -7756,7 +7781,7 @@ This list contains 1208 plugins. :pypi:`pytest-sbase` - *last release*: Feb 09, 2023, + *last release*: Feb 18, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -7805,7 +7830,7 @@ This list contains 1208 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Feb 09, 2023, + *last release*: Feb 18, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -8155,7 +8180,7 @@ This list contains 1208 plugins. A simple plugin to first execute tests that historically failed more :pypi:`pytest-sosu` - *last release*: Nov 17, 2022, + *last release*: Feb 14, 2023, *status*: 2 - Pre-Alpha, *requires*: pytest @@ -8260,7 +8285,7 @@ This list contains 1208 plugins. :pypi:`pytest-splunk-addon` - *last release*: Jan 26, 2023, + *last release*: Feb 16, 2023, *status*: N/A, *requires*: pytest (>5.4.0,<7.3) @@ -8449,7 +8474,7 @@ This list contains 1208 plugins. A hack to explicitly set up and tear down fixtures. :pypi:`pytest-subtests` - *last release*: Oct 28, 2022, + *last release*: Feb 16, 2023, *status*: 4 - Beta, *requires*: pytest (>=7.0) @@ -8505,7 +8530,7 @@ This list contains 1208 plugins. a pytest plugin to tag tests :pypi:`pytest-takeltest` - *last release*: Jan 04, 2022, + *last release*: Feb 15, 2023, *status*: N/A, *requires*: N/A @@ -8939,7 +8964,7 @@ This list contains 1208 plugins. this is a vue-element ui report for pytest :pypi:`pytest-tmux` - *last release*: Jan 30, 2023, + *last release*: Feb 15, 2023, *status*: 4 - Beta, *requires*: N/A @@ -9604,9 +9629,9 @@ This list contains 1208 plugins. Run tests against wsgi apps defined in yaml :pypi:`pytest-yaml-yoyo` - *last release*: Dec 17, 2022, + *last release*: Feb 17, 2023, *status*: N/A, - *requires*: N/A + *requires*: pytest (==7.2.0) http/https API run by yaml @@ -9673,6 +9698,13 @@ This list contains 1208 plugins. Zesty additions to pytest. + :pypi:`pytest-zhongwen-wendang` + *last release*: Feb 13, 2023, + *status*: 4 - Beta, + *requires*: N/A + + PyTest 中文文档 + :pypi:`pytest-zigzag` *last release*: Feb 27, 2019, *status*: 4 - Beta, From 44afed9b13cda220155338fe7a7d381a4c50068d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 08:56:25 -0300 Subject: [PATCH 520/549] build(deps): Bump pytest-rerunfailures in /testing/plugins_integration (#10754) Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 11.1 to 11.1.1. - [Release notes](https://github.com/pytest-dev/pytest-rerunfailures/releases) - [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/11.1...11.1.1) --- updated-dependencies: - dependency-name: pytest-rerunfailures dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index 7170587f732..bf0e3017650 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -7,7 +7,7 @@ pytest-django==4.5.2 pytest-flakes==4.0.5 pytest-html==3.2.0 pytest-mock==3.10.0 -pytest-rerunfailures==11.1 +pytest-rerunfailures==11.1.1 pytest-sugar==0.9.5 pytest-trio==0.7.0 pytest-twisted==1.14.0 From 07e7deb4a79833309b0165b0d0456a321755c14d Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 28 Feb 2023 10:59:23 -0300 Subject: [PATCH 521/549] Update changelog/10765.bugfix.rst --- changelog/10765.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/10765.bugfix.rst b/changelog/10765.bugfix.rst index 754abd72c5b..8283d754e31 100644 --- a/changelog/10765.bugfix.rst +++ b/changelog/10765.bugfix.rst @@ -1 +1 @@ -Fix temp_path fixture always raising OSError on emscripten due to missing getuid +Fixed :fixture:`temp_path` fixture always raising :class:`OSError` on ``emscripten`` platform due to missing :func:`os.getuid`. From d72da480c43521eae289200b63131a0228fc7da8 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 28 Feb 2023 11:02:17 -0300 Subject: [PATCH 522/549] Apply suggestions from code review --- changelog/10765.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/10765.bugfix.rst b/changelog/10765.bugfix.rst index 8283d754e31..89391f1f0cd 100644 --- a/changelog/10765.bugfix.rst +++ b/changelog/10765.bugfix.rst @@ -1 +1 @@ -Fixed :fixture:`temp_path` fixture always raising :class:`OSError` on ``emscripten`` platform due to missing :func:`os.getuid`. +Fixed :fixture:`tmp_path` fixture always raising :class:`OSError` on ``emscripten`` platform due to missing :func:`os.getuid`. From cb9e8be301cc32d285fe7a0dc50b2efb904f5344 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 28 Feb 2023 11:05:56 -0300 Subject: [PATCH 523/549] Move logic to get_user_id in compat --- src/_pytest/compat.py | 38 ++++++++++++++++++++++++-------------- src/_pytest/tmpdir.py | 24 ++++++++++-------------- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py index 6cede213337..352211de8aa 100644 --- a/src/_pytest/compat.py +++ b/src/_pytest/compat.py @@ -1,4 +1,6 @@ """Python version compatibility code.""" +from __future__ import annotations + import dataclasses import enum import functools @@ -12,11 +14,8 @@ from typing import Callable from typing import Generic from typing import NoReturn -from typing import Optional -from typing import Tuple from typing import TYPE_CHECKING from typing import TypeVar -from typing import Union import py @@ -46,7 +45,7 @@ # fmt: on -def legacy_path(path: Union[str, "os.PathLike[str]"]) -> LEGACY_PATH: +def legacy_path(path: str | os.PathLike[str]) -> LEGACY_PATH: """Internal wrapper to prepare lazy proxies for legacy_path instances""" return LEGACY_PATH(path) @@ -56,7 +55,7 @@ def legacy_path(path: Union[str, "os.PathLike[str]"]) -> LEGACY_PATH: # https://www.python.org/dev/peps/pep-0484/#support-for-singleton-types-in-unions class NotSetType(enum.Enum): token = 0 -NOTSET: "Final" = NotSetType.token # noqa: E305 +NOTSET: Final = NotSetType.token # noqa: E305 # fmt: on if sys.version_info >= (3, 8): @@ -94,7 +93,7 @@ def is_async_function(func: object) -> bool: return iscoroutinefunction(func) or inspect.isasyncgenfunction(func) -def getlocation(function, curdir: Optional[str] = None) -> str: +def getlocation(function, curdir: str | None = None) -> str: function = get_real_func(function) fn = Path(inspect.getfile(function)) lineno = function.__code__.co_firstlineno @@ -132,8 +131,8 @@ def getfuncargnames( *, name: str = "", is_method: bool = False, - cls: Optional[type] = None, -) -> Tuple[str, ...]: + cls: type | None = None, +) -> tuple[str, ...]: """Return the names of a function's mandatory arguments. Should return the names of all function arguments that: @@ -197,7 +196,7 @@ def getfuncargnames( return arg_names -def get_default_arg_names(function: Callable[..., Any]) -> Tuple[str, ...]: +def get_default_arg_names(function: Callable[..., Any]) -> tuple[str, ...]: # Note: this code intentionally mirrors the code at the beginning of # getfuncargnames, to get the arguments which were excluded from its result # because they had default values. @@ -228,7 +227,7 @@ def _bytes_to_ascii(val: bytes) -> str: return val.decode("ascii", "backslashreplace") -def ascii_escaped(val: Union[bytes, str]) -> str: +def ascii_escaped(val: bytes | str) -> str: r"""If val is pure ASCII, return it as an str, otherwise, escape bytes objects into a sequence of escaped bytes: @@ -355,7 +354,6 @@ def final(f): if sys.version_info >= (3, 8): from functools import cached_property as cached_property else: - from typing import Type class cached_property(Generic[_S, _T]): __slots__ = ("func", "__doc__") @@ -366,12 +364,12 @@ def __init__(self, func: Callable[[_S], _T]) -> None: @overload def __get__( - self, instance: None, owner: Optional[Type[_S]] = ... - ) -> "cached_property[_S, _T]": + self, instance: None, owner: type[_S] | None = ... + ) -> cached_property[_S, _T]: ... @overload - def __get__(self, instance: _S, owner: Optional[Type[_S]] = ...) -> _T: + def __get__(self, instance: _S, owner: type[_S] | None = ...) -> _T: ... def __get__(self, instance, owner=None): @@ -381,6 +379,18 @@ def __get__(self, instance, owner=None): return value +def get_user_id() -> int | None: + """Return the current user id, or None if we cannot get it reliably on the current platform.""" + # win32 does not have a getuid() function. + # On Emscripten, getuid() is a stub that always returns 0. + if sys.platform in ("win32", "emscripten"): + return None + # getuid shouldn't fail, but cpython defines such a case. + # Let's hope for the best. + uid = os.getuid() + return uid if uid != -1 else None + + # Perform exhaustiveness checking. # # Consider this example: diff --git a/src/_pytest/tmpdir.py b/src/_pytest/tmpdir.py index 64f1de07253..5f347665f9a 100644 --- a/src/_pytest/tmpdir.py +++ b/src/_pytest/tmpdir.py @@ -2,7 +2,6 @@ import dataclasses import os import re -import sys import tempfile from pathlib import Path from shutil import rmtree @@ -30,7 +29,7 @@ from .pathlib import make_numbered_dir_with_cleanup from .pathlib import rm_rf from .pathlib import cleanup_dead_symlink -from _pytest.compat import final +from _pytest.compat import final, get_user_id from _pytest.config import Config from _pytest.config import ExitCode from _pytest.config import hookimpl @@ -176,19 +175,16 @@ def getbasetemp(self) -> Path: # Also, to keep things private, fixup any world-readable temp # rootdir's permissions. Historically 0o755 was used, so we can't # just error out on this, at least for a while. - if sys.platform != "win32" and sys.platform != "emscripten": - uid = os.getuid() + uid = get_user_id() + if uid is not None: rootdir_stat = rootdir.stat() - # getuid shouldn't fail, but cpython defines such a case. - # Let's hope for the best. - if uid != -1: - if rootdir_stat.st_uid != uid: - raise OSError( - f"The temporary directory {rootdir} is not owned by the current user. " - "Fix this and try again." - ) - if (rootdir_stat.st_mode & 0o077) != 0: - os.chmod(rootdir, rootdir_stat.st_mode & ~0o077) + if rootdir_stat.st_uid != uid: + raise OSError( + f"The temporary directory {rootdir} is not owned by the current user. " + "Fix this and try again." + ) + if (rootdir_stat.st_mode & 0o077) != 0: + os.chmod(rootdir, rootdir_stat.st_mode & ~0o077) keep = self._retention_count if self._retention_policy == "none": keep = 0 From 72ad32411f5db346933925a07de04463ebafcbdf Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 28 Feb 2023 16:41:31 +0100 Subject: [PATCH 524/549] Docs: be more explicit about module level skip preventing collection (#10753) --- changelog/10753.doc.rst | 2 ++ src/_pytest/outcomes.py | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 changelog/10753.doc.rst diff --git a/changelog/10753.doc.rst b/changelog/10753.doc.rst new file mode 100644 index 00000000000..701d81a7c2c --- /dev/null +++ b/changelog/10753.doc.rst @@ -0,0 +1,2 @@ +Change wording of the module level skip to be very explicit +about not collecting and not executing the rest of the module. diff --git a/src/_pytest/outcomes.py b/src/_pytest/outcomes.py index 2a998e421ea..1be97dda4ea 100644 --- a/src/_pytest/outcomes.py +++ b/src/_pytest/outcomes.py @@ -157,8 +157,12 @@ def skip( The message to show the user as reason for the skip. :param allow_module_level: - Allows this function to be called at module level, skipping the rest - of the module. Defaults to False. + 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. :param msg: Same as ``reason``, but deprecated. Will be removed in a future version, use ``reason`` instead. From 88c9e92258a15697c4f125ea1b930856ebe2975f Mon Sep 17 00:00:00 2001 From: Billy Date: Tue, 28 Feb 2023 10:42:33 -0500 Subject: [PATCH 525/549] Minor updates to fixtures docs (#10724) Updated the c fixture to be a little more consistent with other fixtures in the corresponding image. for example both e and g both have edges connected with the fixtures that they explicitly depend on. --- doc/en/example/fixtures/test_fixtures_order_dependencies.py | 2 +- doc/en/reference/fixtures.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/en/example/fixtures/test_fixtures_order_dependencies.py b/doc/en/example/fixtures/test_fixtures_order_dependencies.py index b3512c2a64d..e76e3f93c62 100644 --- a/doc/en/example/fixtures/test_fixtures_order_dependencies.py +++ b/doc/en/example/fixtures/test_fixtures_order_dependencies.py @@ -17,7 +17,7 @@ def b(a, order): @pytest.fixture -def c(a, b, order): +def c(b, order): order.append("c") diff --git a/doc/en/reference/fixtures.rst b/doc/en/reference/fixtures.rst index d25979ab95d..01f825222ea 100644 --- a/doc/en/reference/fixtures.rst +++ b/doc/en/reference/fixtures.rst @@ -335,7 +335,7 @@ For example: .. literalinclude:: /example/fixtures/test_fixtures_order_dependencies.py -If we map out what depends on what, we get something that look like this: +If we map out what depends on what, we get something that looks like this: .. image:: /example/fixtures/test_fixtures_order_dependencies.* :align: center From 97a2761d72d881f6b0d313428835cf161b608d69 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 3 Mar 2023 12:25:33 -0300 Subject: [PATCH 526/549] Fix test_cmdline_python_namespace_package (#10788) pgk_resources.declare_namespace has been deprecated, so added an ignore warnings option to the test. --- testing/acceptance_test.py | 9 ++++++++- testing/test_monkeypatch.py | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 62acf120945..6b421dde641 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -693,7 +693,14 @@ def test_cmdline_python_namespace_package( # mixed module and filenames: monkeypatch.chdir("world") - result = pytester.runpytest("--pyargs", "-v", "ns_pkg.hello", "ns_pkg/world") + + # pgk_resources.declare_namespace has been deprecated in favor of implicit namespace packages. + # While we could change the test to use implicit namespace packages, seems better + # to still ensure the old declaration via declare_namespace still works. + ignore_w = r"-Wignore:Deprecated call to `pkg_resources.declare_namespace" + result = pytester.runpytest( + "--pyargs", "-v", "ns_pkg.hello", "ns_pkg/world", ignore_w + ) assert result.ret == 0 result.stdout.fnmatch_lines( [ diff --git a/testing/test_monkeypatch.py b/testing/test_monkeypatch.py index b32e67bd766..3d09ef4263a 100644 --- a/testing/test_monkeypatch.py +++ b/testing/test_monkeypatch.py @@ -425,6 +425,9 @@ class A: assert A.x == 1 +@pytest.mark.filterwarnings( + "ignore:Deprecated call to `pkg_resources.declare_namespace" +) def test_syspath_prepend_with_namespace_packages( pytester: Pytester, monkeypatch: MonkeyPatch ) -> None: From 4e259590c99b75c32ab2b498b0f75cd18ee24629 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 3 Mar 2023 12:53:38 -0300 Subject: [PATCH 527/549] Normalize how changelog entries are written (#10779) Went over all changelog entries making sure they follow our guidelines as written at: https://github.com/pytest-dev/pytest/blob/88c9e92258a15697c4f125ea1b930856ebe2975f/.github/PULL_REQUEST_TEMPLATE.md?plain=1#L18-L21 --- changelog/10533.bugfix.rst | 2 +- changelog/10597.bugfix.rst | 2 +- changelog/10626.bugfix.rst | 2 +- changelog/10660.bugfix.rst | 2 +- changelog/10753.doc.rst | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/changelog/10533.bugfix.rst b/changelog/10533.bugfix.rst index c49e4c3aabf..c7e49189d1f 100644 --- a/changelog/10533.bugfix.rst +++ b/changelog/10533.bugfix.rst @@ -1 +1 @@ -Fix :func:`pytest.approx` handling of dictionaries containing one or more values of `0.0` in class ApproxMapping. +Fixed :func:`pytest.approx` handling of dictionaries containing one or more values of `0.0`. diff --git a/changelog/10597.bugfix.rst b/changelog/10597.bugfix.rst index 9070e74a310..793d35b3620 100644 --- a/changelog/10597.bugfix.rst +++ b/changelog/10597.bugfix.rst @@ -1 +1 @@ -Fix bug where a fixture method named ``teardown`` would be called as part of ``nose`` teardown stage. +Fixed bug where a fixture method named ``teardown`` would be called as part of ``nose`` teardown stage. diff --git a/changelog/10626.bugfix.rst b/changelog/10626.bugfix.rst index c3c7ef77840..4032f69e02d 100644 --- a/changelog/10626.bugfix.rst +++ b/changelog/10626.bugfix.rst @@ -1 +1 @@ -Fix crash if ``--fixtures`` and ``--help`` are passed at the same time. +Fixed crash if ``--fixtures`` and ``--help`` are passed at the same time. diff --git a/changelog/10660.bugfix.rst b/changelog/10660.bugfix.rst index 62e3549413b..84a913fe980 100644 --- a/changelog/10660.bugfix.rst +++ b/changelog/10660.bugfix.rst @@ -1,2 +1,2 @@ -Fix :py:func:`pytest.raises` to return a 'ContextManager' so that type-checkers could narrow +Fixed :py:func:`pytest.raises` to return a 'ContextManager' so that type-checkers could narrow :code:`pytest.raises(...) if ... else nullcontext()` down to 'ContextManager' rather than 'object'. diff --git a/changelog/10753.doc.rst b/changelog/10753.doc.rst index 701d81a7c2c..13b021ea75b 100644 --- a/changelog/10753.doc.rst +++ b/changelog/10753.doc.rst @@ -1,2 +1,2 @@ -Change wording of the module level skip to be very explicit -about not collecting and not executing the rest of the module. +Changed wording of the module level skip to be very explicit +about not collecting tests and not executing the rest of the module. From 517e02e59e2960c8688dbbcd000cf231b7531348 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 3 Mar 2023 16:13:19 -0300 Subject: [PATCH 528/549] Merge pull request #10792 from pytest-dev/release-7.2.2 Prepare release 7.2.2 (cherry picked from commit 3ce6030f0cc0e6fb18cbee1a4a8b1cec8c6d0b0c) --- changelog/10533.bugfix.rst | 1 - changelog/10592.bugfix.rst | 1 - changelog/10597.bugfix.rst | 1 - changelog/10626.bugfix.rst | 1 - changelog/10660.bugfix.rst | 2 -- changelog/10690.doc.rst | 1 - changelog/10721.doc.rst | 1 - changelog/10753.doc.rst | 2 -- doc/en/announce/index.rst | 1 + doc/en/announce/release-7.2.2.rst | 25 +++++++++++++++++++++ doc/en/builtin.rst | 2 +- doc/en/changelog.rst | 36 +++++++++++++++++++++++++++++++ doc/en/getting-started.rst | 2 +- 13 files changed, 64 insertions(+), 12 deletions(-) delete mode 100644 changelog/10533.bugfix.rst delete mode 100644 changelog/10592.bugfix.rst delete mode 100644 changelog/10597.bugfix.rst delete mode 100644 changelog/10626.bugfix.rst delete mode 100644 changelog/10660.bugfix.rst delete mode 100644 changelog/10690.doc.rst delete mode 100644 changelog/10721.doc.rst delete mode 100644 changelog/10753.doc.rst create mode 100644 doc/en/announce/release-7.2.2.rst diff --git a/changelog/10533.bugfix.rst b/changelog/10533.bugfix.rst deleted file mode 100644 index c7e49189d1f..00000000000 --- a/changelog/10533.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed :func:`pytest.approx` handling of dictionaries containing one or more values of `0.0`. diff --git a/changelog/10592.bugfix.rst b/changelog/10592.bugfix.rst deleted file mode 100644 index 62c1c7e3c34..00000000000 --- a/changelog/10592.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed crash if `--cache-show` and `--help` are passed at the same time. diff --git a/changelog/10597.bugfix.rst b/changelog/10597.bugfix.rst deleted file mode 100644 index 793d35b3620..00000000000 --- a/changelog/10597.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed bug where a fixture method named ``teardown`` would be called as part of ``nose`` teardown stage. diff --git a/changelog/10626.bugfix.rst b/changelog/10626.bugfix.rst deleted file mode 100644 index 4032f69e02d..00000000000 --- a/changelog/10626.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed crash if ``--fixtures`` and ``--help`` are passed at the same time. diff --git a/changelog/10660.bugfix.rst b/changelog/10660.bugfix.rst deleted file mode 100644 index 84a913fe980..00000000000 --- a/changelog/10660.bugfix.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fixed :py:func:`pytest.raises` to return a 'ContextManager' so that type-checkers could narrow -:code:`pytest.raises(...) if ... else nullcontext()` down to 'ContextManager' rather than 'object'. diff --git a/changelog/10690.doc.rst b/changelog/10690.doc.rst deleted file mode 100644 index faf61b3cc44..00000000000 --- a/changelog/10690.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Added `CI` and `BUILD_NUMBER` environment variables to the documentation. diff --git a/changelog/10721.doc.rst b/changelog/10721.doc.rst deleted file mode 100644 index 33ba405124c..00000000000 --- a/changelog/10721.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed entry-points declaration in the documentation example using Hatch. diff --git a/changelog/10753.doc.rst b/changelog/10753.doc.rst deleted file mode 100644 index 13b021ea75b..00000000000 --- a/changelog/10753.doc.rst +++ /dev/null @@ -1,2 +0,0 @@ -Changed wording of the module level skip to be very explicit -about not collecting tests and not executing the rest of the module. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index 4df3228822c..fa57ca5c8af 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-7.2.2 release-7.2.1 release-7.2.0 release-7.1.3 diff --git a/doc/en/announce/release-7.2.2.rst b/doc/en/announce/release-7.2.2.rst new file mode 100644 index 00000000000..b34a6ff5c1e --- /dev/null +++ b/doc/en/announce/release-7.2.2.rst @@ -0,0 +1,25 @@ +pytest-7.2.2 +======================================= + +pytest 7.2.2 has just been released to PyPI. + +This is a bug-fix release, being a drop-in replacement. To upgrade:: + + pip install --upgrade pytest + +The full changelog is available at https://docs.pytest.org/en/stable/changelog.html. + +Thanks to all of the contributors to this release: + +* Bruno Oliveira +* Garvit Shubham +* Mahesh Vashishtha +* Ramsey +* Ronny Pfannschmidt +* Teejay +* q0w +* vin01 + + +Happy testing, +The pytest Development Team diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index 4b6d8d84457..453be4ad320 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -22,7 +22,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a cachedir: .pytest_cache rootdir: /home/sweet/project collected 0 items - cache -- .../_pytest/cacheprovider.py:510 + cache -- .../_pytest/cacheprovider.py:509 Return a cache object that can persist state between testing sessions. cache.get(key, default) diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 988e083d0e5..020e6289e48 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -28,6 +28,42 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 7.2.2 (2023-03-03) +========================= + +Bug Fixes +--------- + +- `#10533 `_: Fixed :func:`pytest.approx` handling of dictionaries containing one or more values of `0.0`. + + +- `#10592 `_: Fixed crash if `--cache-show` and `--help` are passed at the same time. + + +- `#10597 `_: Fixed bug where a fixture method named ``teardown`` would be called as part of ``nose`` teardown stage. + + +- `#10626 `_: Fixed crash if ``--fixtures`` and ``--help`` are passed at the same time. + + +- `#10660 `_: Fixed :py:func:`pytest.raises` to return a 'ContextManager' so that type-checkers could narrow + :code:`pytest.raises(...) if ... else nullcontext()` down to 'ContextManager' rather than 'object'. + + + +Improved Documentation +---------------------- + +- `#10690 `_: Added `CI` and `BUILD_NUMBER` environment variables to the documentation. + + +- `#10721 `_: Fixed entry-points declaration in the documentation example using Hatch. + + +- `#10753 `_: Changed wording of the module level skip to be very explicit + about not collecting tests and not executing the rest of the module. + + pytest 7.2.1 (2023-01-13) ========================= diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index e109839bf3e..b36c2e3ccae 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -22,7 +22,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 7.2.1 + pytest 7.2.2 .. _`simpletest`: From 1d48b3021ddae7efe659008ac8221bed51e8c317 Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sun, 5 Mar 2023 00:25:29 +0000 Subject: [PATCH 529/549] [automated] Update plugin list --- doc/en/reference/plugin_list.rst | 230 +++++++++++++++++-------------- 1 file changed, 127 insertions(+), 103 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index e320292a30d..99e9447295f 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1212 plugins. +This list contains 1215 plugins. .. only:: not latex @@ -63,7 +63,7 @@ This list contains 1212 plugins. :pypi:`pytest-appengine` AppEngine integration that works well with pytest-django Feb 27, 2017 N/A N/A :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A :pypi:`pytest-approvaltests` A plugin to use approvaltests with pytest May 08, 2022 4 - Beta pytest (>=7.0.1) - :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Dec 21, 2022 5 - Production/Stable pytest + :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Mar 04, 2023 5 - Production/Stable pytest :pypi:`pytest-archon` Rule your architecture like a real developer Jan 31, 2023 5 - Production/Stable pytest (>=7.2) :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 4 - Beta pytest (>=4.6) @@ -147,7 +147,7 @@ This list contains 1212 plugins. :pypi:`pytest-builtin-types` Nov 17, 2021 N/A pytest :pypi:`pytest-bwrap` Run your tests in Bubblewrap sandboxes Oct 26, 2018 3 - Alpha N/A :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A - :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Jan 10, 2023 5 - Production/Stable pytest (>=5.0.0) + :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Feb 26, 2023 5 - Production/Stable pytest (>=5.0.0) :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 17, 2022 N/A pytest :pypi:`pytest-call-checker` Small pytest utility to easily create test doubles Oct 16, 2022 4 - Beta pytest (>=7.1.3,<8.0.0) @@ -156,7 +156,7 @@ This list contains 1212 plugins. :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A :pypi:`pytest-capture-deprecatedwarnings` pytest plugin to capture all deprecatedwarnings and put them in one file Apr 30, 2019 N/A N/A :pypi:`pytest-capture-warnings` pytest plugin to capture all warnings and put them in one file of your choice May 03, 2022 N/A pytest - :pypi:`pytest-cases` Separate test code from test cases in pytest. May 20, 2022 5 - Production/Stable N/A + :pypi:`pytest-cases` Separate test code from test cases in pytest. Feb 23, 2023 5 - Production/Stable N/A :pypi:`pytest-cassandra` Cassandra CCM Test Fixtures for pytest Nov 04, 2017 1 - Planning N/A :pypi:`pytest-catchlog` py.test plugin to catch log messages. This is a fork of pytest-capturelog. Jan 24, 2016 4 - Beta pytest (>=2.6) :pypi:`pytest-catch-server` Pytest plugin with server for catching HTTP requests. Dec 12, 2019 5 - Production/Stable N/A @@ -225,10 +225,11 @@ This list contains 1212 plugins. :pypi:`pytest-coveragemarkers` Using pytest markers to track functional coverage and filtering of tests Nov 29, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Jan 30, 2023 5 - Production/Stable pytest (>=7.0) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Feb 07, 2023 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Feb 28, 2023 N/A N/A :pypi:`pytest-cqase` Custom qase pytest plugin Aug 22, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) + :pypi:`pytest-crayons` A pytest plugin for colorful print statements Feb 20, 2023 N/A pytest :pypi:`pytest-create` pytest-create Feb 15, 2023 1 - Planning N/A :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest :pypi:`pytest-crontab` add crontab task in crontab Dec 09, 2019 N/A N/A @@ -253,7 +254,7 @@ This list contains 1212 plugins. :pypi:`pytest-datadir-nng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Nov 09, 2022 5 - Production/Stable pytest (>=7.0.0,<8.0.0) :pypi:`pytest-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Jul 19, 2022 N/A pytest (>=7.0.1) :pypi:`pytest-data-file` Fixture "data" and "case_data" for test from yaml file Dec 04, 2019 N/A N/A - :pypi:`pytest-datafiles` py.test plugin to create a 'tmpdir' containing predefined files/directories. May 01, 2022 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-datafiles` py.test plugin to create a 'tmp_path' containing predefined files/directories. Feb 24, 2023 5 - Production/Stable pytest (>=3.6) :pypi:`pytest-datafixtures` Data fixtures for pytest made simple Dec 05, 2020 5 - Production/Stable N/A :pypi:`pytest-data-from-files` pytest plugin to provide data from files loaded automatically Oct 13, 2021 4 - Beta pytest :pypi:`pytest-dataplugin` A pytest plugin for managing an archive of test data. Sep 16, 2017 1 - Planning N/A @@ -266,7 +267,7 @@ This list contains 1212 plugins. :pypi:`pytest-db-plugin` Nov 27, 2021 N/A pytest (>=5.0) :pypi:`pytest-dbt-adapter` A pytest plugin for testing dbt adapter plugins Nov 24, 2021 N/A pytest (<7,>=6) :pypi:`pytest-dbt-conventions` A pytest plugin for linting a dbt project's conventions Mar 02, 2022 N/A pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-dbt-core` Pytest extension for dbt. Jul 22, 2022 N/A pytest (>=6.2.5) ; extra == 'test' + :pypi:`pytest-dbt-core` Pytest extension for dbt. Mar 01, 2023 N/A pytest (>=6.2.5) ; extra == 'test' :pypi:`pytest-dbus-notification` D-BUS notifications for pytest results. Mar 05, 2014 5 - Production/Stable N/A :pypi:`pytest-dbx` Pytest plugin to run unit tests for dbx (Databricks CLI extensions) related code Nov 29, 2022 N/A pytest (>=7.1.3,<8.0.0) :pypi:`pytest-deadfixtures` A simple plugin to list unused fixtures in pytest Jul 23, 2020 5 - Production/Stable N/A @@ -326,7 +327,7 @@ This list contains 1212 plugins. :pypi:`pytest-docker-postgresql` A simple plugin to use with pytest Sep 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-docker-py` Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. Nov 27, 2018 N/A pytest (==4.0.0) :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Apr 08, 2022 4 - Beta pytest - :pypi:`pytest-docker-service` pytest plugin to start docker container Oct 23, 2022 3 - Alpha pytest + :pypi:`pytest-docker-service` pytest plugin to start docker container Feb 22, 2023 3 - Alpha pytest (>=7.1.3) :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-tools` Docker integration tests for pytest Feb 17, 2022 4 - Beta pytest (>=6.0.1) :pypi:`pytest-docs` Documentation tool for pytest Nov 11, 2018 4 - Beta pytest (>=3.5.0) @@ -346,7 +347,7 @@ This list contains 1212 plugins. :pypi:`pytest-duration-insights` Jun 25, 2021 N/A N/A :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Apr 22, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-dynamicrerun` A pytest plugin to rerun tests dynamically based off of test outcome and output. Aug 15, 2020 4 - Beta N/A - :pypi:`pytest-dynamodb` DynamoDB fixtures for pytest Jun 03, 2021 5 - Production/Stable pytest + :pypi:`pytest-dynamodb` DynamoDB fixtures for pytest Mar 03, 2023 5 - Production/Stable pytest :pypi:`pytest-easy-addoption` pytest-easy-addoption: Easy way to work with pytest addoption Jan 22, 2020 N/A N/A :pypi:`pytest-easy-api` Simple API testing with pytest Mar 26, 2018 N/A N/A :pypi:`pytest-easyMPI` Package that supports mpi tests in pytest Oct 21, 2020 N/A N/A @@ -475,7 +476,7 @@ This list contains 1212 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Feb 01, 2023 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Mar 03, 2023 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -505,13 +506,13 @@ This list contains 1212 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Feb 16, 2023 3 - Alpha pytest (==7.2.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 03, 2023 3 - Alpha pytest (==7.2.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-test` A plugin that tracks test changes Dec 10, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jan 30, 2023 N/A pytest (>=5.0) - :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 22, 2022 5 - Production/Stable N/A - :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Aug 27, 2021 4 - Beta pytest (>=6.2.4,<7.0.0) + :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 27, 2023 5 - Production/Stable pytest (>=3.7.0) + :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Feb 28, 2023 4 - Beta pytest (>=6.2.4,<7.0.0) :pypi:`pytest-html` pytest plugin for generating HTML reports Oct 25, 2022 5 - Production/Stable pytest (!=6.0.0,>=5.0) :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-html-merger` Pytest HTML reports merging utility Apr 03, 2022 N/A N/A @@ -545,9 +546,9 @@ This list contains 1212 plugins. :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A :pypi:`pytest-inline` A pytest plugin for writing inline tests. Feb 08, 2023 4 - Beta pytest (>=7.0.0) - :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Feb 02, 2023 5 - Production/Stable N/A + :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Feb 23, 2023 5 - Production/Stable N/A :pypi:`pytest-inmanta-extensions` Inmanta tests package Feb 09, 2023 5 - Production/Stable N/A - :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Jan 30, 2023 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Feb 21, 2023 5 - Production/Stable N/A :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Jun 16, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Nov 02, 2022 N/A pytest (>=7.2.0,<8.0.0) @@ -561,6 +562,7 @@ This list contains 1212 plugins. :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Mar 20, 2013 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A + :pypi:`pytest-isolate` Feb 20, 2023 4 - Beta pytest :pypi:`pytest-isort` py.test plugin to check import ordering using isort Oct 31, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. Aug 19, 2022 5 - Production/Stable N/A :pypi:`pytest-it` Pytest plugin to display test reports as a plaintext spec, inspired by Rspec: https://github.com/mattduck/pytest-it. Jan 22, 2020 4 - Beta N/A @@ -593,12 +595,11 @@ This list contains 1212 plugins. :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A :pypi:`pytest-koopmans` A plugin for testing the koopmans package Nov 21, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A - :pypi:`pytest-kuaisu-rumen-zhinan` Pytest 快速入门指南 Feb 07, 2023 4 - Beta N/A - :pypi:`pytest-kuaisu-rumen-zhinan-jifan` Pytest 快速入门指南(机翻) Feb 11, 2023 4 - Beta N/A :pypi:`pytest-kubernetes` Feb 16, 2023 N/A pytest (>=7.2.1,<8.0.0) :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. Aug 20, 2022 3 - Alpha pytest (>=3.6,<8) :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A + :pypi:`pytest-langchain` Pytest-style test runner for langchain agents Feb 26, 2023 N/A pytest :pypi:`pytest-lark` A package for enhancing pytest Nov 20, 2022 N/A N/A :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 14, 2022 N/A pytest (>=4.2.0) :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A @@ -631,7 +632,7 @@ This list contains 1212 plugins. :pypi:`pytest-logger` Plugin configuring handlers for loggers from Python logging module. Jul 25, 2019 4 - Beta pytest (>=3.2) :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A :pypi:`pytest-logging-end-to-end-test-tool` Sep 23, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-logikal` Common testing environment Feb 11, 2023 5 - Production/Stable pytest (==7.2.1) + :pypi:`pytest-logikal` Common testing environment Feb 28, 2023 5 - Production/Stable pytest (==7.2.1) :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A :pypi:`pytest-loop` pytest plugin for looping tests Jul 22, 2022 5 - Production/Stable pytest (>=6) @@ -674,7 +675,7 @@ This list contains 1212 plugins. :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Jan 19, 2023 N/A pytest (>=1.0) + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Mar 03, 2023 N/A pytest (>=1.0) :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) :pypi:`pytest-mocktcp` A pytest plugin for testing TCP clients Oct 11, 2022 N/A pytest @@ -703,7 +704,7 @@ This list contains 1212 plugins. :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Oct 26, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A pytest>=6.0.0 - :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. May 30, 2022 N/A pytest>=6,<8 + :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Feb 25, 2023 N/A pytest>=7,<8 :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 15, 2022 5 - Production/Stable pytest (>=6.2) :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) @@ -728,12 +729,13 @@ This list contains 1212 plugins. :pypi:`pytest-notimplemented` Pytest markers for not implemented features and tests. Aug 27, 2019 N/A pytest (>=5.1,<6.0) :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Oct 20, 2022 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-oar` PyTest plugin for the OAR testing framework Feb 22, 2023 N/A pytest>=6.0.1 :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jul 31, 2022 5 - Production/Stable pytest :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A :pypi:`pytest-odoo` py.test plugin to run Odoo tests Nov 17, 2022 4 - Beta pytest (>=7.2.0) :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A :pypi:`pytest-oerp` pytest plugin to test OpenERP modules Feb 28, 2012 3 - Alpha N/A - :pypi:`pytest-ogsm-plugin` 针对特定项目定制化插件,优化了pytest报告展示方式,并添加了项目所需特定参数 Feb 17, 2023 N/A N/A + :pypi:`pytest-ogsm-plugin` 针对特定项目定制化插件,优化了pytest报告展示方式,并添加了项目所需特定参数 Feb 21, 2023 N/A N/A :pypi:`pytest-ok` The ultimate pytest output plugin Apr 01, 2019 4 - Beta N/A :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jun 14, 2022 5 - Production/Stable pytest (<7.1); python_version <= "3.6" :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A @@ -749,6 +751,7 @@ This list contains 1212 plugins. :pypi:`pytest-order-modify` 新增run_marker 来自定义用例的执行顺序 Nov 04, 2022 N/A N/A :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Jan 18, 2023 N/A N/A + :pypi:`pytest-override-env-var` Pytest mark to override a value of an environment variable. Feb 25, 2023 N/A N/A :pypi:`pytest-owner` Add owner mark for tests Apr 25, 2022 N/A N/A :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A :pypi:`pytest-pahrametahrize` Parametrize your tests with a Boston accent. Nov 24, 2021 4 - Beta pytest (>=6.0,<7.0) @@ -789,7 +792,7 @@ This list contains 1212 plugins. :pypi:`pytest-platform-markers` Markers for pytest to skip tests on specific platforms Sep 09, 2019 4 - Beta pytest (>=3.6.0) :pypi:`pytest-play` pytest plugin that let you automate actions and assertions with test metrics reporting executing plain YAML files Jun 12, 2019 5 - Production/Stable N/A :pypi:`pytest-playbook` Pytest plugin for reading playbooks. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) - :pypi:`pytest-playwright` A pytest wrapper with fixtures for Playwright to automate web browsers Mar 16, 2022 N/A pytest + :pypi:`pytest-playwright` A pytest wrapper with fixtures for Playwright to automate web browsers Feb 28, 2023 N/A pytest (<8.0.0,>=6.2.4) :pypi:`pytest-playwrights` A pytest wrapper with fixtures for Playwright to automate web browsers Dec 02, 2021 N/A N/A :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A :pypi:`pytest-playwright-visual` A pytest fixture for visual testing with Playwright Apr 28, 2022 N/A N/A @@ -844,6 +847,7 @@ This list contains 1212 plugins. :pypi:`pytest-pyramid` pytest_pyramid - provides fixtures for testing pyramid applications with pytest test suite Dec 13, 2022 5 - Production/Stable pytest :pypi:`pytest-pyramid-server` Pyramid server fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-pyright` Pytest plugin for type checking code with Pyright Nov 20, 2022 4 - Beta pytest (>=7.0.0) + :pypi:`pytest-pyspec` A python test spec based on pytest Mar 01, 2023 N/A pytest (>=7.2.1,<8.0.0) :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.0) :pypi:`pytest-pythonpath` pytest plugin for adding to the PYTHONPATH from command line or configs. Feb 10, 2022 5 - Production/Stable pytest (<7,>=2.5.2) :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest @@ -901,7 +905,7 @@ This list contains 1212 plugins. :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility Dec 11, 2020 3 - Alpha pytest (>=5.2) :pypi:`pytest-report-me` A pytest plugin to generate report. Dec 31, 2020 N/A pytest :pypi:`pytest-report-parameters` pytest plugin for adding tests' parameters to junit report Jun 18, 2020 3 - Alpha pytest (>=2.4.2) - :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Feb 17, 2023 N/A pytest (>=3.8.0) + :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Feb 20, 2023 N/A pytest (>=3.8.0) :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-requestselapsed` collect and show http requests elapsed time Aug 14, 2022 N/A N/A @@ -912,7 +916,7 @@ This list contains 1212 plugins. :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Feb 17, 2023 5 - Production/Stable pytest (>=5.3) :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A :pypi:`pytest-reserial` Pytest fixture for recording and replaying serial port traffic. Nov 29, 2022 4 - Beta pytest - :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest. Dec 12, 2022 N/A N/A + :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest Feb 28, 2023 N/A pytest (~=4.6) ; python_version == "2.7" :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-resource-usage` Pytest plugin for reporting running time and peak memory usage Nov 06, 2022 5 - Production/Stable pytest>=7.0.0 @@ -937,7 +941,7 @@ This list contains 1212 plugins. :pypi:`pytest-rst` Test code from RST documents with pytest Jan 26, 2023 N/A N/A :pypi:`pytest-rt` pytest data collector plugin for Testgr May 05, 2022 N/A N/A :pypi:`pytest-rts` Coverage-based regression test selection (RTS) plugin for pytest May 17, 2021 N/A pytest - :pypi:`pytest-ruff` pytest plugin to check ruff requirements. Feb 10, 2023 4 - Beta N/A + :pypi:`pytest-ruff` pytest plugin to check ruff requirements. Feb 27, 2023 4 - Beta N/A :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A :pypi:`pytest-runner` Invoke py.test as distutils command with dependency resolution Feb 25, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -953,21 +957,21 @@ This list contains 1212 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Feb 18, 2023 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 04, 2023 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schedule` The job of test scheduling for humans. Jan 07, 2023 5 - Production/Stable N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 21, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Feb 18, 2023 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 04, 2023 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Jan 05, 2023 N/A N/A :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A - :pypi:`pytest-servers` pytest servers Jan 20, 2023 3 - Alpha pytest (>=6.2) + :pypi:`pytest-servers` pytest servers Feb 24, 2023 3 - Alpha pytest (>=6.2) :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A :pypi:`pytest-session2file` pytest-session2file (aka: pytest-session_to_file for v0.1.0 - v0.1.2) is a py.test plugin for capturing and saving to file the stdout of py.test. Jan 26, 2021 3 - Alpha pytest :pypi:`pytest-session-fixture-globalize` py.test plugin to make session fixtures behave as if written in conftest, even if it is written in some modules May 15, 2018 4 - Beta N/A @@ -1025,8 +1029,8 @@ This list contains 1212 plugins. :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Feb 16, 2023 N/A pytest (>5.4.0,<7.3) - :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 16, 2022 N/A N/A + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Feb 22, 2023 N/A pytest (>5.4.0,<7.3) + :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 02, 2023 N/A N/A :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Mar 13, 2018 3 - Alpha N/A @@ -1069,7 +1073,7 @@ This list contains 1212 plugins. :pypi:`pytest-tcpclient` A pytest plugin for testing TCP clients Nov 16, 2022 N/A pytest (<8,>=7.1.3) :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A - :pypi:`pytest-telegram-notifier` Telegram notification plugin for Pytest Feb 07, 2023 5 - Production/Stable N/A + :pypi:`pytest-telegram-notifier` Telegram notification plugin for Pytest Feb 27, 2023 5 - Production/Stable N/A :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) :pypi:`pytest-terra-fixt` Terraform and Terragrunt fixtures for pytest Sep 15, 2022 N/A pytest (==6.2.5) :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Sep 01, 2022 N/A pytest (>=6.0) @@ -1082,9 +1086,9 @@ This list contains 1212 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Dec 01, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Jan 25, 2023 4 - Beta pytest (<8,>=5) + :pypi:`pytest-testmon` selects tests affected by changed files and methods Feb 27, 2023 4 - Beta pytest (<8,>=5) :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) - :pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Jun 13, 2022 4 - Beta N/A + :pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Mar 03, 2023 4 - Beta pytest (<8,>=5) :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) @@ -1172,11 +1176,11 @@ This list contains 1212 plugins. :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest :pypi:`pytest-vcs` Sep 22, 2022 4 - Beta N/A :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest - :pypi:`pytest-ver` Pytest module with Verification Protocol, Verification Report and Trace Matrix Feb 05, 2023 2 - Pre-Alpha N/A + :pypi:`pytest-ver` Pytest module with Verification Protocol, Verification Report and Trace Matrix Mar 04, 2023 2 - Pre-Alpha N/A :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) :pypi:`pytest-virtualenv` Virtualenv fixture for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-vnc` VNC client for Pytest Jun 03, 2022 N/A pytest + :pypi:`pytest-vnc` VNC client for Pytest Feb 25, 2023 N/A pytest :pypi:`pytest-voluptuous` Pytest plugin for asserting data against voluptuous schema. Jun 09, 2020 N/A pytest :pypi:`pytest-vscodedebug` A pytest plugin to easily enable debugging tests within Visual Studio Code Dec 04, 2020 4 - Beta N/A :pypi:`pytest-vscode-pycharm-cls` A PyTest helper to enable start remote debugger on test start or failure or when pytest.set_trace is used. Feb 01, 2023 N/A pytest @@ -1185,7 +1189,7 @@ This list contains 1212 plugins. :pypi:`pytest-vw` pytest-vw makes your failing test cases succeed under CI tools scrutiny Oct 07, 2015 4 - Beta N/A :pypi:`pytest-vyper` Plugin for the vyper smart contract language. May 28, 2020 2 - Pre-Alpha N/A :pypi:`pytest-wa-e2e-plugin` Pytest plugin for testing whatsapp bots with end to end tests Feb 18, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-wake` Sep 28, 2022 N/A pytest + :pypi:`pytest-wake` Feb 27, 2023 N/A pytest :pypi:`pytest-watch` Local continuous test runner with pytest and watchdog. May 20, 2018 N/A N/A :pypi:`pytest-watcher` Continiously runs pytest on changes in \*.py files Dec 11, 2022 3 - Alpha N/A :pypi:`pytest-wdl` Pytest plugin for testing WDL workflows. Nov 17, 2020 5 - Production/Stable N/A @@ -1206,7 +1210,7 @@ This list contains 1212 plugins. :pypi:`pytest-xfaillist` Maintain a xfaillist in an additional file to avoid merge-conflicts. Sep 17, 2021 N/A pytest (>=6.2.2,<7.0.0) :pypi:`pytest-xfiles` Pytest fixtures providing data read from function, module or package related (x)files. Feb 27, 2018 N/A N/A :pypi:`pytest-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A - :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Feb 09, 2023 N/A pytest>=7.2.0 + :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Mar 01, 2023 N/A pytest>=7.2.0 :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Jan 05, 2023 4 - Beta pytest (>=2.8) :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A @@ -1221,13 +1225,12 @@ This list contains 1212 plugins. :pypi:`pytest-yapf` Run yapf Jul 06, 2017 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) :pypi:`pytest-yield` PyTest plugin to run tests concurrently, each \`yield\` switch context to other one Jan 23, 2019 N/A N/A - :pypi:`pytest-yls` Pytest plugin to test the YLS as a whole. Jan 10, 2023 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-yls` Pytest plugin to test the YLS as a whole. Feb 22, 2023 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A pytest>=5.0.0 :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Dec 12, 2022 5 - Production/Stable pytest (>=4.5.0) :pypi:`pytest-zest` Zesty additions to pytest. Nov 17, 2022 N/A N/A - :pypi:`pytest-zhongwen-wendang` PyTest 中文文档 Feb 13, 2023 4 - Beta N/A :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ @@ -1551,7 +1554,7 @@ This list contains 1212 plugins. A plugin to use approvaltests with pytest :pypi:`pytest-approvaltests-geo` - *last release*: Dec 21, 2022, + *last release*: Mar 04, 2023, *status*: 5 - Production/Stable, *requires*: pytest @@ -2139,7 +2142,7 @@ This list contains 1212 plugins. pytest plugin with mechanisms for caching across test runs :pypi:`pytest-cache-assert` - *last release*: Jan 10, 2023, + *last release*: Feb 26, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0.0) @@ -2202,7 +2205,7 @@ This list contains 1212 plugins. pytest plugin to capture all warnings and put them in one file of your choice :pypi:`pytest-cases` - *last release*: May 20, 2022, + *last release*: Feb 23, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -2685,7 +2688,7 @@ This list contains 1212 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Feb 07, 2023, + *last release*: Feb 28, 2023, *status*: N/A, *requires*: N/A @@ -2712,6 +2715,13 @@ This list contains 1212 plugins. Manages CrateDB instances during your integration tests + :pypi:`pytest-crayons` + *last release*: Feb 20, 2023, + *status*: N/A, + *requires*: pytest + + A pytest plugin for colorful print statements + :pypi:`pytest-create` *last release*: Feb 15, 2023, *status*: 1 - Planning, @@ -2881,11 +2891,11 @@ This list contains 1212 plugins. Fixture "data" and "case_data" for test from yaml file :pypi:`pytest-datafiles` - *last release*: May 01, 2022, + *last release*: Feb 24, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=3.6) - py.test plugin to create a 'tmpdir' containing predefined files/directories. + py.test plugin to create a 'tmp_path' containing predefined files/directories. :pypi:`pytest-datafixtures` *last release*: Dec 05, 2020, @@ -2972,7 +2982,7 @@ This list contains 1212 plugins. A pytest plugin for linting a dbt project's conventions :pypi:`pytest-dbt-core` - *last release*: Jul 22, 2022, + *last release*: Mar 01, 2023, *status*: N/A, *requires*: pytest (>=6.2.5) ; extra == 'test' @@ -3392,9 +3402,9 @@ This list contains 1212 plugins. Pytest fixtures for testing with docker registries. :pypi:`pytest-docker-service` - *last release*: Oct 23, 2022, + *last release*: Feb 22, 2023, *status*: 3 - Alpha, - *requires*: pytest + *requires*: pytest (>=7.1.3) pytest plugin to start docker container @@ -3532,7 +3542,7 @@ This list contains 1212 plugins. A pytest plugin to rerun tests dynamically based off of test outcome and output. :pypi:`pytest-dynamodb` - *last release*: Jun 03, 2021, + *last release*: Mar 03, 2023, *status*: 5 - Production/Stable, *requires*: pytest @@ -4435,7 +4445,7 @@ This list contains 1212 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Feb 01, 2023, + *last release*: Mar 03, 2023, *status*: N/A, *requires*: N/A @@ -4645,7 +4655,7 @@ This list contains 1212 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Feb 16, 2023, + *last release*: Mar 03, 2023, *status*: 3 - Alpha, *requires*: pytest (==7.2.1) @@ -4680,14 +4690,14 @@ This list contains 1212 plugins. Simplify working with Hoverfly from pytest :pypi:`pytest-hoverfly-wrapper` - *last release*: Feb 22, 2022, + *last release*: Feb 27, 2023, *status*: 5 - Production/Stable, - *requires*: N/A + *requires*: pytest (>=3.7.0) Integrates the Hoverfly HTTP proxy into Pytest :pypi:`pytest-hpfeeds` - *last release*: Aug 27, 2021, + *last release*: Feb 28, 2023, *status*: 4 - Beta, *requires*: pytest (>=6.2.4,<7.0.0) @@ -4925,7 +4935,7 @@ This list contains 1212 plugins. A pytest plugin for writing inline tests. :pypi:`pytest-inmanta` - *last release*: Feb 02, 2023, + *last release*: Feb 23, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -4939,7 +4949,7 @@ This list contains 1212 plugins. Inmanta tests package :pypi:`pytest-inmanta-lsm` - *last release*: Jan 30, 2023, + *last release*: Feb 21, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -5036,6 +5046,13 @@ This list contains 1212 plugins. THIS PROJECT IS ABANDONED + :pypi:`pytest-isolate` + *last release*: Feb 20, 2023, + *status*: 4 - Beta, + *requires*: pytest + + + :pypi:`pytest-isort` *last release*: Oct 31, 2022, *status*: 5 - Production/Stable, @@ -5260,20 +5277,6 @@ This list contains 1212 plugins. pytest krtech common library - :pypi:`pytest-kuaisu-rumen-zhinan` - *last release*: Feb 07, 2023, - *status*: 4 - Beta, - *requires*: N/A - - Pytest 快速入门指南 - - :pypi:`pytest-kuaisu-rumen-zhinan-jifan` - *last release*: Feb 11, 2023, - *status*: 4 - Beta, - *requires*: N/A - - Pytest 快速入门指南(机翻) - :pypi:`pytest-kubernetes` *last release*: Feb 16, 2023, *status*: N/A, @@ -5302,6 +5305,13 @@ This list contains 1212 plugins. + :pypi:`pytest-langchain` + *last release*: Feb 26, 2023, + *status*: N/A, + *requires*: pytest + + Pytest-style test runner for langchain agents + :pypi:`pytest-lark` *last release*: Nov 20, 2022, *status*: N/A, @@ -5527,7 +5537,7 @@ This list contains 1212 plugins. :pypi:`pytest-logikal` - *last release*: Feb 11, 2023, + *last release*: Feb 28, 2023, *status*: 5 - Production/Stable, *requires*: pytest (==7.2.1) @@ -5828,7 +5838,7 @@ This list contains 1212 plugins. An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. :pypi:`pytest-mock-resources` - *last release*: Jan 19, 2023, + *last release*: Mar 03, 2023, *status*: N/A, *requires*: pytest (>=1.0) @@ -6031,9 +6041,9 @@ This list contains 1212 plugins. Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. :pypi:`pytest-mypy-testing` - *last release*: May 30, 2022, + *last release*: Feb 25, 2023, *status*: N/A, - *requires*: pytest>=6,<8 + *requires*: pytest>=7,<8 Pytest plugin to check mypy output. @@ -6205,6 +6215,13 @@ This list contains 1212 plugins. A pytest plugin for generating NUnit3 test result XML output + :pypi:`pytest-oar` + *last release*: Feb 22, 2023, + *status*: N/A, + *requires*: pytest>=6.0.1 + + PyTest plugin for the OAR testing framework + :pypi:`pytest-object-getter` *last release*: Jul 31, 2022, *status*: 5 - Production/Stable, @@ -6241,7 +6258,7 @@ This list contains 1212 plugins. pytest plugin to test OpenERP modules :pypi:`pytest-ogsm-plugin` - *last release*: Feb 17, 2023, + *last release*: Feb 21, 2023, *status*: N/A, *requires*: N/A @@ -6352,6 +6369,13 @@ This list contains 1212 plugins. pytest-otel report OpenTelemetry traces about test executed + :pypi:`pytest-override-env-var` + *last release*: Feb 25, 2023, + *status*: N/A, + *requires*: N/A + + Pytest mark to override a value of an environment variable. + :pypi:`pytest-owner` *last release*: Apr 25, 2022, *status*: N/A, @@ -6633,9 +6657,9 @@ This list contains 1212 plugins. Pytest plugin for reading playbooks. :pypi:`pytest-playwright` - *last release*: Mar 16, 2022, + *last release*: Feb 28, 2023, *status*: N/A, - *requires*: pytest + *requires*: pytest (<8.0.0,>=6.2.4) A pytest wrapper with fixtures for Playwright to automate web browsers @@ -7017,6 +7041,13 @@ This list contains 1212 plugins. Pytest plugin for type checking code with Pyright + :pypi:`pytest-pyspec` + *last release*: Mar 01, 2023, + *status*: N/A, + *requires*: pytest (>=7.2.1,<8.0.0) + + A python test spec based on pytest + :pypi:`pytest-pytestrail` *last release*: Aug 27, 2020, *status*: 4 - Beta, @@ -7417,7 +7448,7 @@ This list contains 1212 plugins. pytest plugin for adding tests' parameters to junit report :pypi:`pytest-reportportal` - *last release*: Feb 17, 2023, + *last release*: Feb 20, 2023, *status*: N/A, *requires*: pytest (>=3.8.0) @@ -7494,11 +7525,11 @@ This list contains 1212 plugins. Pytest fixture for recording and replaying serial port traffic. :pypi:`pytest-resilient-circuits` - *last release*: Dec 12, 2022, + *last release*: Feb 28, 2023, *status*: N/A, - *requires*: N/A + *requires*: pytest (~=4.6) ; python_version == "2.7" - Resilient Circuits fixtures for PyTest. + Resilient Circuits fixtures for PyTest :pypi:`pytest-resource` *last release*: Nov 14, 2018, @@ -7669,7 +7700,7 @@ This list contains 1212 plugins. Coverage-based regression test selection (RTS) plugin for pytest :pypi:`pytest-ruff` - *last release*: Feb 10, 2023, + *last release*: Feb 27, 2023, *status*: 4 - Beta, *requires*: N/A @@ -7781,7 +7812,7 @@ This list contains 1212 plugins. :pypi:`pytest-sbase` - *last release*: Feb 18, 2023, + *last release*: Mar 04, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -7830,7 +7861,7 @@ This list contains 1212 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Feb 18, 2023, + *last release*: Mar 04, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -7879,7 +7910,7 @@ This list contains 1212 plugins. Automatically mocks resources from serverless.yml in pytest using moto. :pypi:`pytest-servers` - *last release*: Jan 20, 2023, + *last release*: Feb 24, 2023, *status*: 3 - Alpha, *requires*: pytest (>=6.2) @@ -8285,14 +8316,14 @@ This list contains 1212 plugins. :pypi:`pytest-splunk-addon` - *last release*: Feb 16, 2023, + *last release*: Feb 22, 2023, *status*: N/A, *requires*: pytest (>5.4.0,<7.3) A Dynamic test tool for Splunk Apps and Add-ons :pypi:`pytest-splunk-addon-ui-smartx` - *last release*: Mar 16, 2022, + *last release*: Mar 02, 2023, *status*: N/A, *requires*: N/A @@ -8593,7 +8624,7 @@ This list contains 1212 plugins. Pytest to Telegram reporting plugin :pypi:`pytest-telegram-notifier` - *last release*: Feb 07, 2023, + *last release*: Feb 27, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -8684,7 +8715,7 @@ This list contains 1212 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Jan 25, 2023, + *last release*: Feb 27, 2023, *status*: 4 - Beta, *requires*: pytest (<8,>=5) @@ -8698,9 +8729,9 @@ This list contains 1212 plugins. nOly selects tests affected by changed files and methods :pypi:`pytest-testmon-skip-libraries` - *last release*: Jun 13, 2022, + *last release*: Mar 03, 2023, *status*: 4 - Beta, - *requires*: N/A + *requires*: pytest (<8,>=5) selects tests affected by changed files and methods @@ -9314,7 +9345,7 @@ This list contains 1212 plugins. py.test fixture for creating a virtual environment :pypi:`pytest-ver` - *last release*: Feb 05, 2023, + *last release*: Mar 04, 2023, *status*: 2 - Pre-Alpha, *requires*: N/A @@ -9342,7 +9373,7 @@ This list contains 1212 plugins. Virtualenv fixture for py.test :pypi:`pytest-vnc` - *last release*: Jun 03, 2022, + *last release*: Feb 25, 2023, *status*: N/A, *requires*: pytest @@ -9405,7 +9436,7 @@ This list contains 1212 plugins. Pytest plugin for testing whatsapp bots with end to end tests :pypi:`pytest-wake` - *last release*: Sep 28, 2022, + *last release*: Feb 27, 2023, *status*: N/A, *requires*: pytest @@ -9552,7 +9583,7 @@ This list contains 1212 plugins. Extended logging for test and decorators :pypi:`pytest-xlsx` - *last release*: Feb 09, 2023, + *last release*: Mar 01, 2023, *status*: N/A, *requires*: pytest>=7.2.0 @@ -9657,7 +9688,7 @@ This list contains 1212 plugins. PyTest plugin to run tests concurrently, each \`yield\` switch context to other one :pypi:`pytest-yls` - *last release*: Jan 10, 2023, + *last release*: Feb 22, 2023, *status*: N/A, *requires*: pytest (>=7.1.2,<8.0.0) @@ -9698,13 +9729,6 @@ This list contains 1212 plugins. Zesty additions to pytest. - :pypi:`pytest-zhongwen-wendang` - *last release*: Feb 13, 2023, - *status*: 4 - Beta, - *requires*: N/A - - PyTest 中文文档 - :pypi:`pytest-zigzag` *last release*: Feb 27, 2019, *status*: 4 - Beta, From 5a61ec3d4a7495e65686b35617e3277ec44b6213 Mon Sep 17 00:00:00 2001 From: bluthej Date: Sun, 5 Mar 2023 16:42:05 +0100 Subject: [PATCH 530/549] Fix example in the documentation (#10782) --- changelog/10782.doc.rst | 1 + doc/en/explanation/goodpractices.rst | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelog/10782.doc.rst diff --git a/changelog/10782.doc.rst b/changelog/10782.doc.rst new file mode 100644 index 00000000000..c2bd4af8c31 --- /dev/null +++ b/changelog/10782.doc.rst @@ -0,0 +1 @@ +Fixed the minimal example in :ref:`goodpractices`: ``pip install -e .`` requires a ``version`` entry in ``pyproject.toml`` to run successfully. diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 98b4b56eb9f..7331a789600 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -24,8 +24,9 @@ The first few lines should look like this: [project] name = "PACKAGENAME" + version = "PACKAGEVERSION" -where ``PACKAGENAME`` is the name of your package. +where ``PACKAGENAME`` and ``PACKAGEVERSION`` are the name and version of your package respectively. You can then install your package in "editable" mode by running from the same directory: From a869141b3de68ea5bb3ad7b9d1935e94fc54b78b Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 8 Mar 2023 04:49:37 +0800 Subject: [PATCH 531/549] New option to allow a progress report even when capture=no (#10755) --- changelog/10755.feature.rst | 1 + doc/en/reference/reference.rst | 1 + src/_pytest/terminal.py | 14 ++++++++++---- testing/test_terminal.py | 18 ++++++++++++++++++ 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 changelog/10755.feature.rst diff --git a/changelog/10755.feature.rst b/changelog/10755.feature.rst new file mode 100644 index 00000000000..5fb5a97d4ac --- /dev/null +++ b/changelog/10755.feature.rst @@ -0,0 +1 @@ +:confval:`console_output_style` now supports ``progress-even-when-capture-no`` to force the use of the progress output even when capture is disabled. This is useful in large test suites where capture may have significant performance impact. diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index c882157eeb7..f92b443f3eb 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1220,6 +1220,7 @@ passed multiple times. The expected format is ``name=value``. For example:: * ``classic``: classic pytest output. * ``progress``: like classic pytest output, but with a progress indicator. + * ``progress-even-when-capture-no``: allows the use of the progress indicator even when ``capture=no``. * ``count``: like progress, but shows progress as the number of tests completed instead of a percent. The default is ``progress``, but you can fallback to ``classic`` if you prefer or diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 1b73da89bf4..323c118e44b 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -229,7 +229,8 @@ def pytest_addoption(parser: Parser) -> None: parser.addini( "console_output_style", help='Console output: "classic", or with additional progress information ' - '("progress" (percentage) | "count")', + '("progress" (percentage) | "count" | "progress-even-when-capture-no" (forces ' + "progress even when capture=no)", default="progress", ) @@ -346,14 +347,19 @@ def __init__(self, config: Config, file: Optional[TextIO] = None) -> None: def _determine_show_progress_info(self) -> "Literal['progress', 'count', False]": """Return whether we should display progress information based on the current config.""" - # do not show progress if we are not capturing output (#3038) - if self.config.getoption("capture", "no") == "no": + # do not show progress if we are not capturing output (#3038) unless explicitly + # overridden by progress-even-when-capture-no + if ( + self.config.getoption("capture", "no") == "no" + and self.config.getini("console_output_style") + != "progress-even-when-capture-no" + ): return False # do not show progress if we are showing fixture setup/teardown if self.config.getoption("setupshow", False): return False cfg: str = self.config.getini("console_output_style") - if cfg == "progress": + if cfg == "progress" or cfg == "progress-even-when-capture-no": return "progress" elif cfg == "count": return "count" diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 453f183236f..8a77e107d95 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -2213,6 +2213,24 @@ def test_capture_no(self, many_tests_files, pytester: Pytester) -> None: output = pytester.runpytest("--capture=no") output.stdout.no_fnmatch_line("*%]*") + def test_capture_no_progress_enabled( + self, many_tests_files, pytester: Pytester + ) -> None: + pytester.makeini( + """ + [pytest] + console_output_style = progress-even-when-capture-no + """ + ) + output = pytester.runpytest("-s") + output.stdout.re_match_lines( + [ + r"test_bar.py \.{10} \s+ \[ 50%\]", + r"test_foo.py \.{5} \s+ \[ 75%\]", + r"test_foobar.py \.{5} \s+ \[100%\]", + ] + ) + class TestProgressWithTeardown: """Ensure we show the correct percentages for tests that fail during teardown (#3088)""" From 6e478b094787f3d2bf2db3676d330c7a13ac6b98 Mon Sep 17 00:00:00 2001 From: Alessio Izzo Date: Fri, 10 Mar 2023 11:32:36 +0100 Subject: [PATCH 532/549] Fix walrus operator support in assertion rewriting (#10758) Closes #10743 --- AUTHORS | 1 + changelog/10743.bugfix.rst | 1 + src/_pytest/assertion/rewrite.py | 54 +++++++++- testing/test_assertrewrite.py | 171 +++++++++++++++++++++++++++++++ 4 files changed, 223 insertions(+), 4 deletions(-) create mode 100644 changelog/10743.bugfix.rst diff --git a/AUTHORS b/AUTHORS index 0395feceb60..448b71d3a8a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -12,6 +12,7 @@ Adam Uhlir Ahn Ki-Wook Akiomi Kamakura Alan Velasco +Alessio Izzo Alexander Johnson Alexander King Alexei Kozlenok diff --git a/changelog/10743.bugfix.rst b/changelog/10743.bugfix.rst new file mode 100644 index 00000000000..ad5c63e80ee --- /dev/null +++ b/changelog/10743.bugfix.rst @@ -0,0 +1 @@ +The assertion rewriting mechanism now works correctly when assertion expressions contain the walrus operator. diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py index 42664add432..8b182347052 100644 --- a/src/_pytest/assertion/rewrite.py +++ b/src/_pytest/assertion/rewrite.py @@ -44,9 +44,13 @@ if TYPE_CHECKING: from _pytest.assertion import AssertionState +if sys.version_info >= (3, 8): + namedExpr = ast.NamedExpr +else: + namedExpr = ast.Expr -assertstate_key = StashKey["AssertionState"]() +assertstate_key = StashKey["AssertionState"]() # pytest caches rewritten pycs in pycache dirs PYTEST_TAG = f"{sys.implementation.cache_tag}-pytest-{version}" @@ -635,8 +639,12 @@ class AssertionRewriter(ast.NodeVisitor): .push_format_context() and .pop_format_context() which allows to build another %-formatted string while already building one. - This state is reset on every new assert statement visited and used - by the other visitors. + :variables_overwrite: A dict filled with references to variables + that change value within an assert. This happens when a variable is + reassigned with the walrus operator + + This state, except the variables_overwrite, is reset on every new assert + statement visited and used by the other visitors. """ def __init__( @@ -652,6 +660,7 @@ def __init__( else: self.enable_assertion_pass_hook = False self.source = source + self.variables_overwrite: Dict[str, str] = {} def run(self, mod: ast.Module) -> None: """Find all assert statements in *mod* and rewrite them.""" @@ -666,7 +675,7 @@ def run(self, mod: ast.Module) -> None: if doc is not None and self.is_rewrite_disabled(doc): return pos = 0 - lineno = 1 + item = None for item in mod.body: if ( expect_docstring @@ -937,6 +946,18 @@ def visit_Assert(self, assert_: ast.Assert) -> List[ast.stmt]: ast.copy_location(node, assert_) return self.statements + def visit_NamedExpr(self, name: namedExpr) -> Tuple[namedExpr, str]: + # This method handles the 'walrus operator' repr of the target + # name if it's a local variable or _should_repr_global_name() + # thinks it's acceptable. + locs = ast.Call(self.builtin("locals"), [], []) + target_id = name.target.id # type: ignore[attr-defined] + inlocs = ast.Compare(ast.Str(target_id), [ast.In()], [locs]) + dorepr = self.helper("_should_repr_global_name", name) + test = ast.BoolOp(ast.Or(), [inlocs, dorepr]) + expr = ast.IfExp(test, self.display(name), ast.Str(target_id)) + return name, self.explanation_param(expr) + def visit_Name(self, name: ast.Name) -> Tuple[ast.Name, str]: # Display the repr of the name if it's a local variable or # _should_repr_global_name() thinks it's acceptable. @@ -963,6 +984,20 @@ def visit_BoolOp(self, boolop: ast.BoolOp) -> Tuple[ast.Name, str]: # cond is set in a prior loop iteration below self.expl_stmts.append(ast.If(cond, fail_inner, [])) # noqa self.expl_stmts = fail_inner + # Check if the left operand is a namedExpr and the value has already been visited + if ( + isinstance(v, ast.Compare) + and isinstance(v.left, namedExpr) + and v.left.target.id + in [ + ast_expr.id + for ast_expr in boolop.values[:i] + if hasattr(ast_expr, "id") + ] + ): + pytest_temp = self.variable() + self.variables_overwrite[v.left.target.id] = pytest_temp + v.left.target.id = pytest_temp self.push_format_context() res, expl = self.visit(v) body.append(ast.Assign([ast.Name(res_var, ast.Store())], res)) @@ -1038,6 +1073,9 @@ def visit_Attribute(self, attr: ast.Attribute) -> Tuple[ast.Name, str]: def visit_Compare(self, comp: ast.Compare) -> Tuple[ast.expr, str]: self.push_format_context() + # We first check if we have overwritten a variable in the previous assert + if isinstance(comp.left, ast.Name) and comp.left.id in self.variables_overwrite: + comp.left.id = self.variables_overwrite[comp.left.id] left_res, left_expl = self.visit(comp.left) if isinstance(comp.left, (ast.Compare, ast.BoolOp)): left_expl = f"({left_expl})" @@ -1049,6 +1087,13 @@ def visit_Compare(self, comp: ast.Compare) -> Tuple[ast.expr, str]: syms = [] results = [left_res] for i, op, next_operand in it: + if ( + isinstance(next_operand, namedExpr) + and isinstance(left_res, ast.Name) + and next_operand.target.id == left_res.id + ): + next_operand.target.id = self.variable() + self.variables_overwrite[left_res.id] = next_operand.target.id next_res, next_expl = self.visit(next_operand) if isinstance(next_operand, (ast.Compare, ast.BoolOp)): next_expl = f"({next_expl})" @@ -1072,6 +1117,7 @@ def visit_Compare(self, comp: ast.Compare) -> Tuple[ast.expr, str]: res: ast.expr = ast.BoolOp(ast.And(), load_names) else: res = load_names[0] + return res, self.explanation_param(self.pop_format_context(expl_call)) diff --git a/testing/test_assertrewrite.py b/testing/test_assertrewrite.py index 3c98392ed98..8d944140307 100644 --- a/testing/test_assertrewrite.py +++ b/testing/test_assertrewrite.py @@ -1265,6 +1265,177 @@ def test_simple_failure(): result.stdout.fnmatch_lines(["*E*assert (1 + 1) == 3"]) +@pytest.mark.skipif( + sys.version_info < (3, 8), reason="walrus operator not available in py<38" +) +class TestIssue10743: + def test_assertion_walrus_operator(self, pytester: Pytester) -> None: + pytester.makepyfile( + """ + def my_func(before, after): + return before == after + + def change_value(value): + return value.lower() + + def test_walrus_conversion(): + a = "Hello" + assert not my_func(a, a := change_value(a)) + assert a == "hello" + """ + ) + result = pytester.runpytest() + assert result.ret == 0 + + def test_assertion_walrus_operator_dont_rewrite(self, pytester: Pytester) -> None: + pytester.makepyfile( + """ + 'PYTEST_DONT_REWRITE' + def my_func(before, after): + return before == after + + def change_value(value): + return value.lower() + + def test_walrus_conversion_dont_rewrite(): + a = "Hello" + assert not my_func(a, a := change_value(a)) + assert a == "hello" + """ + ) + result = pytester.runpytest() + assert result.ret == 0 + + def test_assertion_inline_walrus_operator(self, pytester: Pytester) -> None: + pytester.makepyfile( + """ + def my_func(before, after): + return before == after + + def test_walrus_conversion_inline(): + a = "Hello" + assert not my_func(a, a := a.lower()) + assert a == "hello" + """ + ) + result = pytester.runpytest() + assert result.ret == 0 + + def test_assertion_inline_walrus_operator_reverse(self, pytester: Pytester) -> None: + pytester.makepyfile( + """ + def my_func(before, after): + return before == after + + def test_walrus_conversion_reverse(): + a = "Hello" + assert my_func(a := a.lower(), a) + assert a == 'hello' + """ + ) + result = pytester.runpytest() + assert result.ret == 0 + + def test_assertion_walrus_no_variable_name_conflict( + self, pytester: Pytester + ) -> None: + pytester.makepyfile( + """ + def test_walrus_conversion_no_conflict(): + a = "Hello" + assert a == (b := a.lower()) + """ + ) + result = pytester.runpytest() + assert result.ret == 1 + result.stdout.fnmatch_lines(["*AssertionError: assert 'Hello' == 'hello'"]) + + def test_assertion_walrus_operator_true_assertion_and_changes_variable_value( + self, pytester: Pytester + ) -> None: + pytester.makepyfile( + """ + def test_walrus_conversion_succeed(): + a = "Hello" + assert a != (a := a.lower()) + assert a == 'hello' + """ + ) + result = pytester.runpytest() + assert result.ret == 0 + + def test_assertion_walrus_operator_fail_assertion(self, pytester: Pytester) -> None: + pytester.makepyfile( + """ + def test_walrus_conversion_fails(): + a = "Hello" + assert a == (a := a.lower()) + """ + ) + result = pytester.runpytest() + assert result.ret == 1 + result.stdout.fnmatch_lines(["*AssertionError: assert 'Hello' == 'hello'"]) + + def test_assertion_walrus_operator_boolean_composite( + self, pytester: Pytester + ) -> None: + pytester.makepyfile( + """ + def test_walrus_operator_change_boolean_value(): + a = True + assert a and True and ((a := False) is False) and (a is False) and ((a := None) is None) + assert a is None + """ + ) + result = pytester.runpytest() + assert result.ret == 0 + + def test_assertion_walrus_operator_compare_boolean_fails( + self, pytester: Pytester + ) -> None: + pytester.makepyfile( + """ + def test_walrus_operator_change_boolean_value(): + a = True + assert not (a and ((a := False) is False)) + """ + ) + result = pytester.runpytest() + assert result.ret == 1 + result.stdout.fnmatch_lines(["*assert not (True and False is False)"]) + + def test_assertion_walrus_operator_boolean_none_fails( + self, pytester: Pytester + ) -> None: + pytester.makepyfile( + """ + def test_walrus_operator_change_boolean_value(): + a = True + assert not (a and ((a := None) is None)) + """ + ) + result = pytester.runpytest() + assert result.ret == 1 + result.stdout.fnmatch_lines(["*assert not (True and None is None)"]) + + def test_assertion_walrus_operator_value_changes_cleared_after_each_test( + self, pytester: Pytester + ) -> None: + pytester.makepyfile( + """ + def test_walrus_operator_change_value(): + a = True + assert (a := None) is None + + def test_walrus_operator_not_override_value(): + a = True + assert a is True + """ + ) + result = pytester.runpytest() + assert result.ret == 0 + + @pytest.mark.skipif( sys.maxsize <= (2**31 - 1), reason="Causes OverflowError on 32bit systems" ) From 723035be7f6abd339bba233ad05f9db41202a904 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 10 Mar 2023 21:47:03 +0100 Subject: [PATCH 533/549] doc: Remove done training (#10805) --- doc/en/index.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/en/index.rst b/doc/en/index.rst index c277cc30721..6f3115b19c2 100644 --- a/doc/en/index.rst +++ b/doc/en/index.rst @@ -1,10 +1,11 @@ :orphan: -.. sidebar:: Next Open Trainings +.. + .. sidebar:: Next Open Trainings - - `Professional Testing with Python `_, via `Python Academy `_, March 7th to 9th 2023 (3 day in-depth training), Remote + - `Professional Testing with Python `_, via `Python Academy `_, March 7th to 9th 2023 (3 day in-depth training), Remote - Also see :doc:`previous talks and blogposts `. + Also see :doc:`previous talks and blogposts `. .. _features: From 0ae04ae629e0576090346ddc91e7f1cbfb122205 Mon Sep 17 00:00:00 2001 From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com> Date: Sat, 11 Mar 2023 08:59:02 -0500 Subject: [PATCH 534/549] Include `pyproject.toml` in help section that lists out config files with ini-options (#10807) --- AUTHORS | 1 + doc/en/reference/reference.rst | 2 +- src/_pytest/helpconfig.py | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 448b71d3a8a..f72932b99c4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -332,6 +332,7 @@ Srinivas Reddy Thatiparthy Stefan Farmbauer Stefan Scherfke Stefan Zimmermann +Stefanie Molin Stefano Taschini Steffen Allner Stephan Obermann diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index f92b443f3eb..3e364b84f39 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1996,7 +1996,7 @@ All the command-line flags can be obtained by running ``pytest --help``:: Auto-indent multiline messages passed to the logging module. Accepts true|on, false|off or an integer. - [pytest] ini-options in the first pytest.ini|tox.ini|setup.cfg file found: + [pytest] ini-options in the first pytest.ini|tox.ini|setup.cfg|pyproject.toml file found: markers (linelist): Markers for test functions empty_parameter_set_mark (string): diff --git a/src/_pytest/helpconfig.py b/src/_pytest/helpconfig.py index 151bc6dff95..6b6718a7083 100644 --- a/src/_pytest/helpconfig.py +++ b/src/_pytest/helpconfig.py @@ -164,7 +164,8 @@ def showhelp(config: Config) -> None: tw.write(config._parser.optparser.format_help()) tw.line() tw.line( - "[pytest] ini-options in the first pytest.ini|tox.ini|setup.cfg file found:" + "[pytest] ini-options in the first " + "pytest.ini|tox.ini|setup.cfg|pyproject.toml file found:" ) tw.line() From 7af1e4e4edf706c261a246b3a060cf7b906f617b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 12 Mar 2023 13:04:50 -0300 Subject: [PATCH 535/549] [automated] Update plugin list (#10810) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 2556 +++++++++++++++--------------- 1 file changed, 1302 insertions(+), 1254 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 99e9447295f..5420202d243 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,1229 +11,1235 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1215 plugins. +This list contains 1221 plugins. .. only:: not latex - =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ - name summary last release status requires - =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ - :pypi:`pytest-abstracts` A contextmanager pytest fixture for handling multiple mock abstracts May 25, 2022 N/A N/A - :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Dec 21, 2022 N/A pytest (>=6,<8) - :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Oct 13, 2022 N/A pytest (>=5.4.0) - :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) - :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-ads-testplan` Azure DevOps Test Case reporting for pytest tests Sep 15, 2022 N/A N/A - :pypi:`pytest-agent` Service that exposes a REST API that can be used to interract remotely with Pytest. It is shipped with a dashboard that enables running tests in a more convenient way. Nov 25, 2021 N/A N/A - :pypi:`pytest-aggreport` pytest plugin for pytest-repeat that generate aggregate report of the same test cases with additional statistics details. Mar 07, 2021 4 - Beta pytest (>=6.2.2) - :pypi:`pytest-aio` Pytest plugin for testing async python code Feb 03, 2023 4 - Beta pytest - :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A - :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Jan 10, 2023 N/A pytest (>=7.2.0,<8.0.0) - :pypi:`pytest-aiomoto` pytest-aiomoto Nov 09, 2022 N/A pytest (>=7.0,<8.0) - :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) - :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A - :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Feb 03, 2023 N/A pytest (>=6.0) - :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest - :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) - :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) - :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Oct 21, 2022 N/A pytest - :pypi:`pytest-allure-dsl` pytest plugin to test case doc string dls instructions Oct 25, 2020 4 - Beta pytest - :pypi:`pytest-allure-intersection` Oct 27, 2022 N/A pytest (<5) - :pypi:`pytest-allure-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest - :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-android` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Feb 21, 2019 3 - Alpha pytest - :pypi:`pytest-anki` A pytest plugin for testing Anki add-ons Jul 31, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-annotate` pytest-annotate: Generate PyAnnotate annotations from your pytest tests. Jun 07, 2022 3 - Alpha pytest (<8.0.0,>=3.2.0) - :pypi:`pytest-ansible` Plugin for py.test to simplify calling ansible modules from tests or fixtures May 25, 2021 5 - Production/Stable N/A - :pypi:`pytest-ansible-playbook` Pytest fixture which runs given ansible playbook file. Mar 08, 2019 4 - Beta N/A - :pypi:`pytest-ansible-playbook-runner` Pytest fixture which runs given ansible playbook file. Dec 02, 2020 4 - Beta pytest (>=3.1.0) - :pypi:`pytest-ansible-units` A pytest plugin for running unit tests within an ansible collection Apr 14, 2022 N/A N/A - :pypi:`pytest-antilru` Bust functools.lru_cache when running pytest to avoid test pollution Jul 05, 2022 5 - Production/Stable pytest - :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest - :pypi:`pytest-anything` Pytest fixtures to assert anything and something Oct 13, 2022 N/A pytest - :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Dec 08, 2022 N/A pytest ; extra == 'test' - :pypi:`pytest-aoreporter` pytest report Jun 27, 2022 N/A N/A - :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 12, 2022 N/A pytest (>=7.1.1,<8.0.0) - :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A - :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A - :pypi:`pytest-appengine` AppEngine integration that works well with pytest-django Feb 27, 2017 N/A N/A - :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A - :pypi:`pytest-approvaltests` A plugin to use approvaltests with pytest May 08, 2022 4 - Beta pytest (>=7.0.1) - :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Mar 04, 2023 5 - Production/Stable pytest - :pypi:`pytest-archon` Rule your architecture like a real developer Jan 31, 2023 5 - Production/Stable pytest (>=7.2) - :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) - :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 4 - Beta pytest (>=4.6) - :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) - :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A - :pypi:`pytest-assertcount` Plugin to count actual number of asserts in pytest Oct 23, 2022 N/A pytest (>=5.0.0) - :pypi:`pytest-assertions` Pytest Assertions Apr 27, 2022 N/A N/A - :pypi:`pytest-assertutil` pytest-assertutil May 10, 2019 N/A N/A - :pypi:`pytest-assert-utils` Useful assertion utilities for use with pytest Apr 14, 2022 3 - Alpha N/A - :pypi:`pytest-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) - :pypi:`pytest-assurka` A pytest plugin for Assurka Studio Aug 04, 2022 N/A N/A - :pypi:`pytest-ast-back-to-python` A plugin for pytest devs to view how assertion rewriting recodes the AST Sep 29, 2019 4 - Beta N/A - :pypi:`pytest-asteroid` PyTest plugin for docker-based testing on database images Aug 15, 2022 N/A pytest (>=6.2.5,<8.0.0) - :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) - :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Sep 06, 2022 3 - Alpha pytest (>=4.6) - :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest - :pypi:`pytest-asyncio` Pytest support for asyncio Dec 08, 2022 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Feb 10, 2023 N/A N/A - :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) - :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) - :pypi:`pytest-async-sqlalchemy` Database testing fixtures using the SQLAlchemy asyncio API Oct 07, 2021 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-atomic` Skip rest of tests if previous test failed. Nov 24, 2018 4 - Beta N/A - :pypi:`pytest-attrib` pytest plugin to select tests based on attributes similar to the nose-attrib plugin May 24, 2016 4 - Beta N/A - :pypi:`pytest-austin` Austin plugin for pytest Oct 11, 2020 4 - Beta N/A - :pypi:`pytest-autocap` automatically capture test & fixture stdout/stderr to files May 15, 2022 N/A pytest (<7.2,>=7.1.2) - :pypi:`pytest-autochecklog` automatically check condition and log all the checks Apr 25, 2015 4 - Beta N/A - :pypi:`pytest-automation` pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. May 20, 2022 N/A pytest (>=7.0.0) - :pypi:`pytest-automock` Pytest plugin for automatical mocks creation Aug 04, 2022 N/A pytest ; extra == 'dev' - :pypi:`pytest-auto-parametrize` pytest plugin: avoid repeating arguments in parametrize Oct 02, 2016 3 - Alpha N/A - :pypi:`pytest-autotest` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Aug 25, 2021 N/A pytest - :pypi:`pytest-aviator` Aviator's Flakybot pytest plugin that automatically reruns flaky tests. Nov 04, 2022 4 - Beta pytest - :pypi:`pytest-avoidance` Makes pytest skip tests that don not need rerunning May 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-aws` pytest plugin for testing AWS resource configurations Oct 04, 2017 4 - Beta N/A - :pypi:`pytest-aws-config` Protect your AWS credentials in unit tests May 28, 2021 N/A N/A - :pypi:`pytest-axe` pytest plugin for axe-selenium-python Nov 12, 2018 N/A pytest (>=3.0.0) - :pypi:`pytest-azure` Pytest utilities and mocks for Azure Jan 18, 2023 3 - Alpha pytest - :pypi:`pytest-azure-devops` Simplifies using azure devops parallel strategy (https://docs.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner) with pytest. Jun 20, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Oct 20, 2022 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-bandit-xayon` A bandit plugin for pytest Oct 17, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) - :pypi:`pytest-bdd` BDD for pytest Nov 08, 2022 6 - Mature pytest (>=6.2.0) - :pypi:`pytest-bdd-html` pytest plugin to display BDD info in HTML test report Nov 22, 2022 3 - Alpha pytest (!=6.0.0,>=5.0) - :pypi:`pytest-bdd-ng` BDD for pytest Oct 06, 2022 4 - Beta pytest (>=5.0) - :pypi:`pytest-bdd-splinter` Common steps for pytest bdd and splinter integration Aug 12, 2019 5 - Production/Stable pytest (>=4.0.0) - :pypi:`pytest-bdd-web` A simple plugin to use with pytest Jan 02, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A - :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest - :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A - :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A - :pypi:`pytest-benchmark` A \`\`pytest\`\` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer. Oct 25, 2022 5 - Production/Stable pytest (>=3.8) - :pypi:`pytest-bg-process` Pytest plugin to initialize background process Jan 24, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-bigchaindb` A BigchainDB plugin for pytest. Jan 24, 2022 4 - Beta N/A - :pypi:`pytest-bigquery-mock` Provides a mock fixture for python bigquery client Dec 28, 2022 N/A pytest (>=5.0) - :pypi:`pytest-black` A pytest plugin to enable format checking with black Oct 05, 2020 4 - Beta N/A - :pypi:`pytest-black-multipy` Allow '--black' on older Pythons Jan 14, 2021 5 - Production/Stable pytest (!=3.7.3,>=3.5) ; extra == 'testing' - :pypi:`pytest-black-ng` A pytest plugin to enable format checking with black Oct 20, 2022 4 - Beta pytest (>=7.0.0) - :pypi:`pytest-blame` A pytest plugin helps developers to debug by providing useful commits history. May 04, 2019 N/A pytest (>=4.4.0) - :pypi:`pytest-blender` Blender Pytest plugin. Jan 04, 2023 N/A pytest ; extra == 'dev' - :pypi:`pytest-blink1` Pytest plugin to emit notifications via the Blink(1) RGB LED Jan 07, 2018 4 - Beta N/A - :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest - :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A - :pypi:`pytest-blue` A pytest plugin that adds a \`blue\` fixture for printing stuff in blue. Sep 05, 2022 N/A N/A - :pypi:`pytest-board` Local continuous test runner with pytest and watchdog. Jan 20, 2019 N/A N/A - :pypi:`pytest-boost-xml` Plugin for pytest to generate boost xml reports Nov 30, 2022 4 - Beta N/A - :pypi:`pytest-bootstrap` Mar 04, 2022 N/A N/A - :pypi:`pytest-bpdb` A py.test plug-in to enable drop to bpdb debugger on test failure. Jan 19, 2015 2 - Pre-Alpha N/A - :pypi:`pytest-bravado` Pytest-bravado automatically generates from OpenAPI specification client fixtures. Feb 15, 2022 N/A N/A - :pypi:`pytest-breakword` Use breakword with pytest Aug 04, 2021 N/A pytest (>=6.2.4,<7.0.0) - :pypi:`pytest-breed-adapter` A simple plugin to connect with breed-server Nov 07, 2018 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-briefcase` A pytest plugin for running tests on a Briefcase project. Jun 14, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-browser` A pytest plugin for console based browser test selection just after the collection phase Dec 10, 2016 3 - Alpha N/A - :pypi:`pytest-browsermob-proxy` BrowserMob proxy plugin for py.test. Jun 11, 2013 4 - Beta N/A - :pypi:`pytest-browserstack-local` \`\`py.test\`\` plugin to run \`\`BrowserStackLocal\`\` in background. Feb 09, 2018 N/A N/A - :pypi:`pytest-budosystems` Budo Systems is a martial arts school management system. This module is the Budo Systems Pytest Plugin. Feb 14, 2023 3 - Alpha pytest - :pypi:`pytest-bug` Pytest plugin for marking tests as a bug Jan 29, 2023 5 - Production/Stable pytest (>=6.2.0) - :pypi:`pytest-bugtong-tag` pytest-bugtong-tag is a plugin for pytest Jan 16, 2022 N/A N/A - :pypi:`pytest-bugzilla` py.test bugzilla integration plugin May 05, 2010 4 - Beta N/A - :pypi:`pytest-bugzilla-notifier` A plugin that allows you to execute create, update, and read information from BugZilla bugs Jun 15, 2018 4 - Beta pytest (>=2.9.2) - :pypi:`pytest-buildkite` Plugin for pytest that automatically publishes coverage and pytest report annotations to Buildkite. Jul 13, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-builtin-types` Nov 17, 2021 N/A pytest - :pypi:`pytest-bwrap` Run your tests in Bubblewrap sandboxes Oct 26, 2018 3 - Alpha N/A - :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A - :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Feb 26, 2023 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A - :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 17, 2022 N/A pytest - :pypi:`pytest-call-checker` Small pytest utility to easily create test doubles Oct 16, 2022 4 - Beta pytest (>=7.1.3,<8.0.0) - :pypi:`pytest-camel-collect` Enable CamelCase-aware pytest class collection Aug 02, 2020 N/A pytest (>=2.9) - :pypi:`pytest-canonical-data` A plugin which allows to compare results with canonical results, based on previous runs May 08, 2020 2 - Pre-Alpha pytest (>=3.5.0) - :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A - :pypi:`pytest-capture-deprecatedwarnings` pytest plugin to capture all deprecatedwarnings and put them in one file Apr 30, 2019 N/A N/A - :pypi:`pytest-capture-warnings` pytest plugin to capture all warnings and put them in one file of your choice May 03, 2022 N/A pytest - :pypi:`pytest-cases` Separate test code from test cases in pytest. Feb 23, 2023 5 - Production/Stable N/A - :pypi:`pytest-cassandra` Cassandra CCM Test Fixtures for pytest Nov 04, 2017 1 - Planning N/A - :pypi:`pytest-catchlog` py.test plugin to catch log messages. This is a fork of pytest-capturelog. Jan 24, 2016 4 - Beta pytest (>=2.6) - :pypi:`pytest-catch-server` Pytest plugin with server for catching HTTP requests. Dec 12, 2019 5 - Production/Stable N/A - :pypi:`pytest-celery` pytest-celery a shim pytest plugin to enable celery.contrib.pytest May 06, 2021 N/A N/A - :pypi:`pytest-chainmaker` pytest plugin for chainmaker Oct 15, 2021 N/A N/A - :pypi:`pytest-chalice` A set of py.test fixtures for AWS Chalice Jul 01, 2020 4 - Beta N/A - :pypi:`pytest-change-assert` 修改报错中文为英文 Oct 19, 2022 N/A N/A - :pypi:`pytest-change-demo` turn . into √,turn F into x Mar 02, 2022 N/A pytest - :pypi:`pytest-change-report` turn . into √,turn F into x Sep 14, 2020 N/A pytest - :pypi:`pytest-change-xds` turn . into √,turn F into x Apr 16, 2022 N/A pytest - :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) - :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Feb 13, 2023 5 - Production/Stable pytest - :pypi:`pytest-checkdocs` check the README when running tests Oct 09, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' - :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) - :pypi:`pytest-check-library` check your missing library Jul 17, 2022 N/A N/A - :pypi:`pytest-check-libs` check your missing library Jul 17, 2022 N/A N/A - :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest>=7.0 - :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest - :pypi:`pytest-check-requirements` A package to prevent Dependency Confusion attacks against Yandex. Feb 10, 2023 N/A N/A - :pypi:`pytest-chic-report` A pytest plugin to send a report and printing summary of tests. Jan 31, 2023 5 - Production/Stable N/A - :pypi:`pytest-chunks` Run only a chunk of your test suite Jul 05, 2022 N/A pytest (>=6.0.0) - :pypi:`pytest-circleci` py.test plugin for CircleCI May 03, 2019 N/A N/A - :pypi:`pytest-circleci-parallelized` Parallelize pytest across CircleCI workers. Oct 20, 2022 N/A N/A - :pypi:`pytest-circleci-parallelized-rjp` Parallelize pytest across CircleCI workers. Jun 21, 2022 N/A pytest - :pypi:`pytest-ckan` Backport of CKAN 2.9 pytest plugin and fixtures to CAKN 2.8 Apr 28, 2020 4 - Beta pytest - :pypi:`pytest-clarity` A plugin providing an alternative, colourful diff output for failing assertions. Jun 11, 2021 N/A N/A - :pypi:`pytest-cldf` Easy quality control for CLDF datasets using pytest Nov 07, 2022 N/A pytest (>=3.6) - :pypi:`pytest-click` Pytest plugin for Click Feb 11, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-cli-fixtures` Automatically register fixtures for custom CLI arguments Jul 28, 2022 N/A pytest (~=7.0) - :pypi:`pytest-clld` Jul 06, 2022 N/A pytest (>=3.6) - :pypi:`pytest-cloud` Distributed tests planner plugin for pytest testing framework. Oct 05, 2020 6 - Mature N/A - :pypi:`pytest-cloudflare-worker` pytest plugin for testing cloudflare workers Mar 30, 2021 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-cloudist` Distribute tests to cloud machines without fuss Sep 02, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-cmake` Provide CMake module for Pytest Jan 21, 2023 N/A pytest<8,>=4 - :pypi:`pytest-cmake-presets` Execute CMake Presets via pytest Dec 26, 2022 N/A pytest (>=7.2.0,<8.0.0) - :pypi:`pytest-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) - :pypi:`pytest-codecarbon` Pytest plugin for measuring carbon emissions Jun 15, 2022 N/A pytest - :pypi:`pytest-codecheckers` pytest plugin to add source code sanity checks (pep8 and friends) Feb 13, 2010 N/A N/A - :pypi:`pytest-codecov` Pytest plugin for uploading pytest-cov results to codecov.io Nov 29, 2022 4 - Beta pytest (>=4.6.0) - :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A - :pypi:`pytest-codeowners` Pytest plugin for selecting tests by GitHub CODEOWNERS. Mar 30, 2022 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-codestyle` pytest plugin to run pycodestyle Mar 23, 2020 3 - Alpha N/A - :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Dec 02, 2022 5 - Production/Stable pytest>=3.8 - :pypi:`pytest-collect-formatter` Formatter for pytest collect output Mar 29, 2021 5 - Production/Stable N/A - :pypi:`pytest-collect-formatter2` Formatter for pytest collect output May 31, 2021 5 - Production/Stable N/A - :pypi:`pytest-collector` Python package for collecting pytest. Aug 02, 2022 N/A pytest (>=7.0,<8.0) - :pypi:`pytest-colordots` Colorizes the progress indicators Oct 06, 2017 5 - Production/Stable N/A - :pypi:`pytest-commander` An interactive GUI test runner for PyTest Aug 17, 2021 N/A pytest (<7.0.0,>=6.2.4) - :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method May 15, 2022 N/A pytest (>=3.6,<8) - :pypi:`pytest-compare` pytest plugin for comparing call arguments. Feb 15, 2023 5 - Production/Stable pytest - :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-config` Base configurations and utilities for developing your Python project test suite with pytest. Nov 07, 2014 5 - Production/Stable N/A - :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Apr 17, 2022 N/A N/A - :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts Mar 18, 2022 4 - Beta N/A - :pypi:`pytest-consul` pytest plugin with fixtures for testing consul aware apps Nov 24, 2018 3 - Alpha pytest - :pypi:`pytest-container` Pytest fixtures for writing container based tests Feb 01, 2022 3 - Alpha pytest (>=3.10) - :pypi:`pytest-contextfixture` Define pytest fixtures as context managers. Mar 12, 2013 4 - Beta N/A - :pypi:`pytest-contexts` A plugin to run tests written with the Contexts framework using pytest May 19, 2021 4 - Beta N/A - :pypi:`pytest-cookies` The pytest plugin for your Cookiecutter templates. 🍪 May 24, 2021 5 - Production/Stable pytest (>=3.3.0) - :pypi:`pytest-couchdbkit` py.test extension for per-test couchdb databases using couchdbkit Apr 17, 2012 N/A N/A - :pypi:`pytest-count` count erros and send email Jan 12, 2018 4 - Beta N/A - :pypi:`pytest-cov` Pytest plugin for measuring coverage. Sep 28, 2022 5 - Production/Stable pytest (>=4.6) - :pypi:`pytest-cover` Pytest plugin for measuring coverage. Forked from \`pytest-cov\`. Aug 01, 2015 5 - Production/Stable N/A - :pypi:`pytest-coverage` Jun 17, 2015 N/A N/A - :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) - :pypi:`pytest-coveragemarkers` Using pytest markers to track functional coverage and filtering of tests Nov 29, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' - :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Jan 30, 2023 5 - Production/Stable pytest (>=7.0) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Feb 28, 2023 N/A N/A - :pypi:`pytest-cqase` Custom qase pytest plugin Aug 22, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A - :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) - :pypi:`pytest-crayons` A pytest plugin for colorful print statements Feb 20, 2023 N/A pytest - :pypi:`pytest-create` pytest-create Feb 15, 2023 1 - Planning N/A - :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest - :pypi:`pytest-crontab` add crontab task in crontab Dec 09, 2019 N/A N/A - :pypi:`pytest-csv` CSV output for pytest. Apr 22, 2021 N/A pytest (>=6.0) - :pypi:`pytest-csv-params` Pytest plugin for Test Case Parametrization with CSV files Aug 28, 2022 5 - Production/Stable pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-curio` Pytest support for curio. Oct 07, 2020 N/A N/A - :pypi:`pytest-curl-report` pytest plugin to generate curl command line report Dec 11, 2016 4 - Beta N/A - :pypi:`pytest-custom-concurrency` Custom grouping concurrence for pytest Feb 08, 2021 N/A N/A - :pypi:`pytest-custom-exit-code` Exit pytest test session with custom exit code in different scenarios Aug 07, 2019 4 - Beta pytest (>=4.0.2) - :pypi:`pytest-custom-nodeid` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 07, 2021 N/A N/A - :pypi:`pytest-custom-report` Configure the symbols displayed for test outcomes Jan 30, 2019 N/A pytest - :pypi:`pytest-custom-scheduling` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 01, 2021 N/A N/A - :pypi:`pytest-cython` A plugin for testing Cython extension modules Feb 16, 2023 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-cython-collect` Jun 17, 2022 N/A pytest - :pypi:`pytest-darker` A pytest plugin for checking of modified code using Darker Aug 16, 2020 N/A pytest (>=6.0.1) ; extra == 'test' - :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A - :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A - :pypi:`pytest-databricks` Pytest plugin for remote Databricks notebooks testing Jul 29, 2020 N/A pytest - :pypi:`pytest-datadir` pytest plugin for test data directories and files Oct 25, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Aug 16, 2022 5 - Production/Stable pytest (>=7.1) - :pypi:`pytest-datadir-ng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Dec 25, 2019 5 - Production/Stable pytest - :pypi:`pytest-datadir-nng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Nov 09, 2022 5 - Production/Stable pytest (>=7.0.0,<8.0.0) - :pypi:`pytest-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Jul 19, 2022 N/A pytest (>=7.0.1) - :pypi:`pytest-data-file` Fixture "data" and "case_data" for test from yaml file Dec 04, 2019 N/A N/A - :pypi:`pytest-datafiles` py.test plugin to create a 'tmp_path' containing predefined files/directories. Feb 24, 2023 5 - Production/Stable pytest (>=3.6) - :pypi:`pytest-datafixtures` Data fixtures for pytest made simple Dec 05, 2020 5 - Production/Stable N/A - :pypi:`pytest-data-from-files` pytest plugin to provide data from files loaded automatically Oct 13, 2021 4 - Beta pytest - :pypi:`pytest-dataplugin` A pytest plugin for managing an archive of test data. Sep 16, 2017 1 - Planning N/A - :pypi:`pytest-datarecorder` A py.test plugin recording and comparing test output. Jan 08, 2023 5 - Production/Stable pytest - :pypi:`pytest-dataset` Plugin for loading different datasets for pytest by prefix from json or yaml files Oct 10, 2022 5 - Production/Stable N/A - :pypi:`pytest-data-suites` Class-based pytest parametrization Jul 24, 2022 N/A pytest (>=6.0,<8.0) - :pypi:`pytest-datatest` A pytest plugin for test driven data-wrangling (this is the development version of datatest's pytest integration). Oct 15, 2020 4 - Beta pytest (>=3.3) - :pypi:`pytest-db` Session scope fixture "db" for mysql query or change Dec 04, 2019 N/A N/A - :pypi:`pytest-dbfixtures` Databases fixtures plugin for py.test. Dec 07, 2016 4 - Beta N/A - :pypi:`pytest-db-plugin` Nov 27, 2021 N/A pytest (>=5.0) - :pypi:`pytest-dbt-adapter` A pytest plugin for testing dbt adapter plugins Nov 24, 2021 N/A pytest (<7,>=6) - :pypi:`pytest-dbt-conventions` A pytest plugin for linting a dbt project's conventions Mar 02, 2022 N/A pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-dbt-core` Pytest extension for dbt. Mar 01, 2023 N/A pytest (>=6.2.5) ; extra == 'test' - :pypi:`pytest-dbus-notification` D-BUS notifications for pytest results. Mar 05, 2014 5 - Production/Stable N/A - :pypi:`pytest-dbx` Pytest plugin to run unit tests for dbx (Databricks CLI extensions) related code Nov 29, 2022 N/A pytest (>=7.1.3,<8.0.0) - :pypi:`pytest-deadfixtures` A simple plugin to list unused fixtures in pytest Jul 23, 2020 5 - Production/Stable N/A - :pypi:`pytest-deepcov` deepcov Mar 30, 2021 N/A N/A - :pypi:`pytest-defer` Aug 24, 2021 N/A N/A - :pypi:`pytest-demo-plugin` pytest示例插件 May 15, 2021 N/A N/A - :pypi:`pytest-dependency` Manage dependencies of tests Feb 14, 2020 4 - Beta N/A - :pypi:`pytest-depends` Tests that depend on other tests Apr 05, 2020 5 - Production/Stable pytest (>=3) - :pypi:`pytest-deprecate` Mark tests as testing a deprecated feature with a warning note. Jul 01, 2019 N/A N/A - :pypi:`pytest-describe` Describe-style plugin for pytest Nov 13, 2021 4 - Beta pytest (>=4.0.0) - :pypi:`pytest-describe-it` plugin for rich text descriptions Jul 19, 2019 4 - Beta pytest - :pypi:`pytest-devpi-server` DevPI server fixture for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-dhos` Common fixtures for pytest in DHOS services and libraries Sep 07, 2022 N/A N/A - :pypi:`pytest-diamond` pytest plugin for diamond Aug 31, 2015 4 - Beta N/A - :pypi:`pytest-dicom` pytest plugin to provide DICOM fixtures Dec 19, 2018 3 - Alpha pytest - :pypi:`pytest-dictsdiff` Jul 26, 2019 N/A N/A - :pypi:`pytest-diff` A simple plugin to use with pytest Mar 30, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-diffeo` A package to prevent Dependency Confusion attacks against Yandex. Feb 10, 2023 N/A N/A - :pypi:`pytest-diff-selector` Get tests affected by code changes (using git) Feb 24, 2022 4 - Beta pytest (>=6.2.2) ; extra == 'all' - :pypi:`pytest-difido` PyTest plugin for generating Difido reports Oct 23, 2022 4 - Beta pytest (>=4.0.0) - :pypi:`pytest-disable` pytest plugin to disable a test and skip it from testrun Sep 10, 2015 4 - Beta N/A - :pypi:`pytest-disable-plugin` Disable plugins per test Feb 28, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. Feb 05, 2023 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) - :pypi:`pytest-django` A Django plugin for pytest. Dec 07, 2021 5 - Production/Stable pytest (>=5.4.0) - :pypi:`pytest-django-ahead` A Django plugin for pytest. Oct 27, 2016 5 - Production/Stable pytest (>=2.9) - :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Nov 09, 2022 4 - Beta N/A - :pypi:`pytest-django-cache-xdist` A djangocachexdist plugin for pytest May 12, 2020 4 - Beta N/A - :pypi:`pytest-django-casperjs` Integrate CasperJS with your django tests as a pytest fixture. Mar 15, 2015 2 - Pre-Alpha N/A - :pypi:`pytest-django-dotenv` Pytest plugin used to setup environment variables with django-dotenv Nov 26, 2019 4 - Beta pytest (>=2.6.0) - :pypi:`pytest-django-factories` Factories for your Django models that can be used as Pytest fixtures. Nov 12, 2020 4 - Beta N/A - :pypi:`pytest-django-filefield` Replaces FileField.storage with something you can patch globally. May 09, 2022 5 - Production/Stable pytest >= 5.2 - :pypi:`pytest-django-gcir` A Django plugin for pytest. Mar 06, 2018 5 - Production/Stable N/A - :pypi:`pytest-django-haystack` Cleanup your Haystack indexes between tests Sep 03, 2017 5 - Production/Stable pytest (>=2.3.4) - :pypi:`pytest-django-ifactory` A model instance factory for pytest-django Feb 09, 2022 3 - Alpha N/A - :pypi:`pytest-django-lite` The bare minimum to integrate py.test with Django. Jan 30, 2014 N/A N/A - :pypi:`pytest-django-liveserver-ssl` Jan 20, 2022 3 - Alpha N/A - :pypi:`pytest-django-model` A Simple Way to Test your Django Models Feb 14, 2019 4 - Beta N/A - :pypi:`pytest-django-ordering` A pytest plugin for preserving the order in which Django runs tests. Jul 25, 2019 5 - Production/Stable pytest (>=2.3.0) - :pypi:`pytest-django-queries` Generate performance reports from your django database performance tests. Mar 01, 2021 N/A N/A - :pypi:`pytest-djangorestframework` A djangorestframework plugin for pytest Aug 11, 2019 4 - Beta N/A - :pypi:`pytest-django-rq` A pytest plugin to help writing unit test for django-rq Apr 13, 2020 4 - Beta N/A - :pypi:`pytest-django-sqlcounts` py.test plugin for reporting the number of SQLs executed per django testcase. Jun 16, 2015 4 - Beta N/A - :pypi:`pytest-django-testing-postgresql` Use a temporary PostgreSQL database with pytest-django Jan 31, 2022 4 - Beta N/A - :pypi:`pytest-doc` A documentation plugin for py.test. Jun 28, 2015 5 - Production/Stable N/A - :pypi:`pytest-docfiles` pytest plugin to test codeblocks in your documentation. Dec 22, 2021 4 - Beta pytest (>=3.7.0) - :pypi:`pytest-docgen` An RST Documentation Generator for pytest-based test suites Apr 17, 2020 N/A N/A - :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Sep 14, 2022 N/A pytest (<8.0,>=4.0) - :pypi:`pytest-docker-apache-fixtures` Pytest fixtures for testing with apache2 (httpd). Feb 16, 2022 4 - Beta pytest - :pypi:`pytest-docker-butla` Jun 16, 2019 3 - Alpha N/A - :pypi:`pytest-dockerc` Run, manage and stop Docker Compose project from Docker API Oct 09, 2020 5 - Production/Stable pytest (>=3.0) - :pypi:`pytest-docker-compose` Manages Docker containers during your integration tests Jan 26, 2021 5 - Production/Stable pytest (>=3.3) - :pypi:`pytest-docker-db` A plugin to use docker databases for pytests Mar 20, 2021 5 - Production/Stable pytest (>=3.1.1) - :pypi:`pytest-docker-fixtures` pytest docker fixtures Nov 17, 2022 3 - Alpha N/A - :pypi:`pytest-docker-git-fixtures` Pytest fixtures for testing with git scm. Feb 09, 2022 4 - Beta pytest - :pypi:`pytest-docker-haproxy-fixtures` Pytest fixtures for testing with haproxy. Feb 09, 2022 4 - Beta pytest - :pypi:`pytest-docker-pexpect` pytest plugin for writing functional tests with pexpect and docker Jan 14, 2019 N/A pytest - :pypi:`pytest-docker-postgresql` A simple plugin to use with pytest Sep 24, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-docker-py` Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. Nov 27, 2018 N/A pytest (==4.0.0) - :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Apr 08, 2022 4 - Beta pytest - :pypi:`pytest-docker-service` pytest plugin to start docker container Feb 22, 2023 3 - Alpha pytest (>=7.1.3) - :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 09, 2022 4 - Beta pytest - :pypi:`pytest-docker-tools` Docker integration tests for pytest Feb 17, 2022 4 - Beta pytest (>=6.0.1) - :pypi:`pytest-docs` Documentation tool for pytest Nov 11, 2018 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-docstyle` pytest plugin to run pydocstyle Mar 23, 2020 3 - Alpha N/A - :pypi:`pytest-doctest-custom` A py.test plugin for customizing string representations of doctest results. Jul 25, 2016 4 - Beta N/A - :pypi:`pytest-doctest-ellipsis-markers` Setup additional values for ELLIPSIS_MARKER for doctests Jan 12, 2018 4 - Beta N/A - :pypi:`pytest-doctest-import` A simple pytest plugin to import names and add them to the doctest namespace. Nov 13, 2018 4 - Beta pytest (>=3.3.0) - :pypi:`pytest-doctestplus` Pytest plugin with advanced doctest features. Sep 26, 2022 3 - Alpha pytest (>=4.6) - :pypi:`pytest-dolphin` Some extra stuff that we use ininternally Nov 30, 2016 4 - Beta pytest (==3.0.4) - :pypi:`pytest-doorstop` A pytest plugin for adding test results into doorstop items. Jun 09, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-dotenv` A py.test plugin that parses environment files before running tests Jun 16, 2020 4 - Beta pytest (>=5.0.0) - :pypi:`pytest-drf` A Django REST framework plugin for pytest. Jul 12, 2022 5 - Production/Stable pytest (>=3.7) - :pypi:`pytest-drivings` Tool to allow webdriver automation to be ran locally or remotely Jan 13, 2021 N/A N/A - :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection May 23, 2020 4 - Beta pytest (>=2.7) - :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest - :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A - :pypi:`pytest-duration-insights` Jun 25, 2021 N/A N/A - :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Apr 22, 2022 5 - Production/Stable pytest (>=4.6) - :pypi:`pytest-dynamicrerun` A pytest plugin to rerun tests dynamically based off of test outcome and output. Aug 15, 2020 4 - Beta N/A - :pypi:`pytest-dynamodb` DynamoDB fixtures for pytest Mar 03, 2023 5 - Production/Stable pytest - :pypi:`pytest-easy-addoption` pytest-easy-addoption: Easy way to work with pytest addoption Jan 22, 2020 N/A N/A - :pypi:`pytest-easy-api` Simple API testing with pytest Mar 26, 2018 N/A N/A - :pypi:`pytest-easyMPI` Package that supports mpi tests in pytest Oct 21, 2020 N/A N/A - :pypi:`pytest-easyread` pytest plugin that makes terminal printouts of the reports easier to read Nov 17, 2017 N/A N/A - :pypi:`pytest-easy-server` Pytest plugin for easy testing against servers May 01, 2021 4 - Beta pytest (<5.0.0,>=4.3.1) ; python_version < "3.5" - :pypi:`pytest-ebics-sandbox` A pytest plugin for testing against an EBICS sandbox server. Requires docker. Aug 15, 2022 N/A N/A - :pypi:`pytest-ec2` Pytest execution on EC2 instance Oct 22, 2019 3 - Alpha N/A - :pypi:`pytest-echo` pytest plugin with mechanisms for echoing environment variables, package version and generic attributes Jan 08, 2020 5 - Production/Stable N/A - :pypi:`pytest-ekstazi` Pytest plugin to select test using Ekstazi algorithm Sep 10, 2022 N/A pytest - :pypi:`pytest-elasticsearch` Elasticsearch fixtures and fixture factories for Pytest. Mar 01, 2022 5 - Production/Stable pytest (>=6.2.0) - :pypi:`pytest-elements` Tool to help automate user interfaces Jan 13, 2021 N/A pytest (>=5.4,<6.0) - :pypi:`pytest-eliot` An eliot plugin for pytest. Aug 31, 2022 1 - Planning pytest (>=5.4.0) - :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest - :pypi:`pytest-embedded` pytest embedded plugin Feb 06, 2023 N/A pytest (>=7.0) - :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Feb 06, 2023 N/A N/A - :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Feb 06, 2023 N/A N/A - :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Feb 06, 2023 N/A N/A - :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Feb 06, 2023 N/A N/A - :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Feb 06, 2023 N/A N/A - :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Feb 06, 2023 N/A N/A - :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Oct 15, 2022 N/A pytest (>=7.0,<8.0) - :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) - :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) - :pypi:`pytest-enabler` Enable installed pytest plugins Jan 27, 2023 5 - Production/Stable pytest (>=6) ; extra == 'testing' - :pypi:`pytest-encode` set your encoding and logger Nov 06, 2021 N/A N/A - :pypi:`pytest-encode-kane` set your encoding and logger Nov 16, 2021 N/A pytest - :pypi:`pytest-enhanced-reports` Enhanced test reports for pytest Dec 15, 2022 N/A N/A - :pypi:`pytest-enhancements` Improvements for pytest (rejected upstream) Oct 30, 2019 4 - Beta N/A - :pypi:`pytest-env` py.test plugin that allows you to add environment variables. Oct 23, 2022 5 - Production/Stable pytest>=7.1.3 - :pypi:`pytest-envfiles` A py.test plugin that parses environment files before running tests Oct 08, 2015 3 - Alpha N/A - :pypi:`pytest-env-info` Push information about the running pytest into envvars Nov 25, 2017 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-envraw` py.test plugin that allows you to add environment variables. Aug 27, 2020 4 - Beta pytest (>=2.6.0) - :pypi:`pytest-envvars` Pytest plugin to validate use of envvars on your tests Jun 13, 2020 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-env-yaml` Apr 02, 2019 N/A N/A - :pypi:`pytest-eradicate` pytest plugin to check for commented out code Sep 08, 2020 N/A pytest (>=2.4.2) - :pypi:`pytest-error-for-skips` Pytest plugin to treat skipped tests a test failure Dec 19, 2019 4 - Beta pytest (>=4.6) - :pypi:`pytest-eth` PyTest plugin for testing Smart Contracts for Ethereum Virtual Machine (EVM). Aug 14, 2020 1 - Planning N/A - :pypi:`pytest-ethereum` pytest-ethereum: Pytest library for ethereum projects. Jun 24, 2019 3 - Alpha pytest (==3.3.2); extra == 'dev' - :pypi:`pytest-eucalyptus` Pytest Plugin for BDD Jun 28, 2022 N/A pytest (>=4.2.0) - :pypi:`pytest-eventlet` Applies eventlet monkey-patch as a pytest plugin. Oct 04, 2021 N/A pytest ; extra == 'dev' - :pypi:`pytest-excel` pytest plugin for generating excel reports Jan 31, 2022 5 - Production/Stable N/A - :pypi:`pytest-exceptional` Better exceptions Mar 16, 2017 4 - Beta N/A - :pypi:`pytest-exception-script` Walk your code through exception script to check it's resiliency to failures. Aug 04, 2020 3 - Alpha pytest - :pypi:`pytest-executable` pytest plugin for testing executables Nov 05, 2022 N/A pytest (<8,>=4.3) - :pypi:`pytest-execution-timer` A timer for the phases of Pytest's execution. Dec 24, 2021 4 - Beta N/A - :pypi:`pytest-expect` py.test plugin to store test expectations and mark tests based on them Apr 21, 2016 4 - Beta N/A - :pypi:`pytest-expectdir` A pytest plugin to provide initial/expected directories, and check a test transforms the initial directory to the expected one Jan 24, 2023 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-expecter` Better testing with expecter and pytest. Sep 18, 2022 5 - Production/Stable N/A - :pypi:`pytest-expectr` This plugin is used to expect multiple assert using pytest framework. Oct 05, 2018 N/A pytest (>=2.4.2) - :pypi:`pytest-experiments` A pytest plugin to help developers of research-oriented software projects keep track of the results of their numerical experiments. Dec 13, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-explicit` A Pytest plugin to ignore certain marked tests by default Jun 15, 2021 5 - Production/Stable pytest - :pypi:`pytest-exploratory` Interactive console for pytest. Feb 21, 2022 N/A pytest (>=6.2) - :pypi:`pytest-extensions` A collection of helpers for pytest to ease testing Aug 17, 2022 4 - Beta pytest ; extra == 'testing' - :pypi:`pytest-external-blockers` a special outcome for tests that are blocked for external reasons Oct 05, 2021 N/A pytest - :pypi:`pytest-extra-durations` A pytest plugin to get durations on a per-function basis and per module basis. Apr 21, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-fabric` Provides test utilities to run fabric task tests by using docker containers Sep 12, 2018 5 - Production/Stable N/A - :pypi:`pytest-factor` A package to prevent Dependency Confusion attacks against Yandex. Feb 10, 2023 N/A N/A - :pypi:`pytest-factory` Use factories for test setup with py.test Sep 06, 2020 3 - Alpha pytest (>4.3) - :pypi:`pytest-factoryboy` Factory Boy support for pytest. Dec 01, 2022 6 - Mature pytest (>=5.0.0) - :pypi:`pytest-factoryboy-fixtures` Generates pytest fixtures that allow the use of type hinting Jun 25, 2020 N/A N/A - :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-failed-screen-record` Create a video of the screen when pytest fails Jan 05, 2023 4 - Beta pytest (>=7.1.2d,<8.0.0) - :pypi:`pytest-failed-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A - :pypi:`pytest-failed-to-verify` A pytest plugin that helps better distinguishing real test failures from setup flakiness. Aug 08, 2019 5 - Production/Stable pytest (>=4.1.0) - :pypi:`pytest-fail-slow` Fail tests that take too long to run Aug 13, 2022 4 - Beta pytest (>=6.0) - :pypi:`pytest-faker` Faker integration with the pytest framework. Dec 19, 2016 6 - Mature N/A - :pypi:`pytest-falcon` Pytest helpers for Falcon. Sep 07, 2016 4 - Beta N/A - :pypi:`pytest-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A - :pypi:`pytest-fantasy` Pytest plugin for Flask Fantasy Framework Mar 14, 2019 N/A N/A - :pypi:`pytest-fastapi` Dec 27, 2020 N/A N/A - :pypi:`pytest-fastapi-deps` A fixture which allows easy replacement of fastapi dependencies for testing Jul 20, 2022 5 - Production/Stable pytest - :pypi:`pytest-fastest` Use SCM and coverage to run only needed tests Mar 05, 2020 N/A N/A - :pypi:`pytest-fast-first` Pytest plugin that runs fast tests first Jan 19, 2023 3 - Alpha pytest - :pypi:`pytest-faulthandler` py.test plugin that activates the fault handler module for tests (dummy package) Jul 04, 2019 6 - Mature pytest (>=5.0) - :pypi:`pytest-fauxfactory` Integration of fauxfactory into pytest. Dec 06, 2017 5 - Production/Stable pytest (>=3.2) - :pypi:`pytest-figleaf` py.test figleaf coverage plugin Jan 18, 2010 5 - Production/Stable N/A - :pypi:`pytest-filecov` A pytest plugin to detect unused files Jun 27, 2021 4 - Beta pytest - :pypi:`pytest-filedata` easily load data from files Jan 17, 2019 4 - Beta N/A - :pypi:`pytest-filemarker` A pytest plugin that runs marked tests when files change. Dec 01, 2020 N/A pytest - :pypi:`pytest-filter-case` run test cases filter by mark Nov 05, 2020 N/A N/A - :pypi:`pytest-filter-subpackage` Pytest plugin for filtering based on sub-packages Dec 12, 2022 3 - Alpha pytest (>=3.0) - :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Apr 09, 2022 4 - Beta pytest (>=4.3.0) - :pypi:`pytest-finer-verdicts` A pytest plugin to treat non-assertion failures as test errors. Jun 18, 2020 N/A pytest (>=5.4.3) - :pypi:`pytest-firefox` pytest plugin to manipulate firefox Aug 08, 2017 3 - Alpha pytest (>=3.0.2) - :pypi:`pytest-fixture-classes` Fixtures as classes that work well with dependency injection, autocompletetion, type checkers, and language servers Jan 20, 2023 4 - Beta pytest - :pypi:`pytest-fixture-config` Fixture configuration utils for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-fixture-maker` Pytest plugin to load fixtures from YAML files Sep 21, 2021 N/A N/A - :pypi:`pytest-fixture-marker` A pytest plugin to add markers based on fixtures used. Oct 11, 2020 5 - Production/Stable N/A - :pypi:`pytest-fixture-order` pytest plugin to control fixture evaluation order May 16, 2022 5 - Production/Stable pytest (>=3.0) - :pypi:`pytest-fixture-ref` Lets users reference fixtures without name matching magic. Nov 17, 2022 4 - Beta N/A - :pypi:`pytest-fixture-rtttg` Warn or fail on fixture name clash Feb 23, 2022 N/A pytest (>=7.0.1,<8.0.0) - :pypi:`pytest-fixtures` Common fixtures for pytest May 01, 2019 5 - Production/Stable N/A - :pypi:`pytest-fixture-tools` Plugin for pytest which provides tools for fixtures Aug 18, 2020 6 - Mature pytest - :pypi:`pytest-fixture-typecheck` A pytest plugin to assert type annotations at runtime. Aug 24, 2021 N/A pytest - :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Mar 18, 2022 4 - Beta pytest (>=7.0) - :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. May 11, 2022 5 - Production/Stable pytest - :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Mar 01, 2022 5 - Production/Stable pytest (>=7.0) - :pypi:`pytest-flakefinder` Runs tests multiple times to expose flakiness. Oct 26, 2022 4 - Beta pytest (>=2.7.1) - :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) - :pypi:`pytest-flaptastic` Flaptastic py.test plugin Mar 17, 2019 N/A N/A - :pypi:`pytest-flask` A set of py.test fixtures to test Flask applications. Feb 27, 2021 5 - Production/Stable pytest (>=5.2) - :pypi:`pytest-flask-ligand` Pytest fixtures and helper functions to use for testing flask-ligand microservices. Feb 10, 2023 4 - Beta pytest (~=7.2) - :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) - :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) - :pypi:`pytest-flexreport` Feb 05, 2023 4 - Beta N/A - :pypi:`pytest-fluent` A pytest plugin in order to provide logs via fluentd Jul 12, 2022 4 - Beta pytest - :pypi:`pytest-flyte` Pytest fixtures for simplifying Flyte integration testing May 03, 2021 N/A pytest - :pypi:`pytest-focus` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest - :pypi:`pytest-forcefail` py.test plugin to make the test failing regardless of pytest.mark.xfail May 15, 2018 4 - Beta N/A - :pypi:`pytest-forward-compatability` A name to avoid typosquating pytest-foward-compatibility Sep 06, 2020 N/A N/A - :pypi:`pytest-forward-compatibility` A pytest plugin to shim pytest commandline options for fowards compatibility Sep 29, 2020 N/A N/A - :pypi:`pytest-freezegun` Wrap tests with fixtures in freeze_time Jul 19, 2020 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-freezer` Pytest plugin providing a fixture interface for spulec/freezegun Oct 20, 2022 N/A pytest>=3.6 - :pypi:`pytest-freeze-reqs` Check if requirement files are frozen Apr 29, 2021 N/A N/A - :pypi:`pytest-frozen-uuids` Deterministically frozen UUID's for your tests Apr 17, 2022 N/A pytest (>=3.0) - :pypi:`pytest-func-cov` Pytest plugin for measuring function coverage Apr 15, 2021 3 - Alpha pytest (>=5) - :pypi:`pytest-funparam` An alternative way to parametrize test cases. Dec 02, 2021 4 - Beta pytest >=4.6.0 - :pypi:`pytest-fxa` pytest plugin for Firefox Accounts Aug 28, 2018 5 - Production/Stable N/A - :pypi:`pytest-fxtest` Oct 27, 2020 N/A N/A - :pypi:`pytest-fzf` fzf-based test selector for pytest Aug 17, 2022 1 - Planning pytest (>=7.1.2) - :pypi:`pytest-gather-fixtures` set up asynchronous pytest fixtures concurrently Apr 12, 2022 N/A pytest (>=6.0.0) - :pypi:`pytest-gc` The garbage collector plugin for py.test Feb 01, 2018 N/A N/A - :pypi:`pytest-gcov` Uses gcov to measure test coverage of a C library Feb 01, 2018 3 - Alpha N/A - :pypi:`pytest-gevent` Ensure that gevent is properly patched when invoking pytest Feb 25, 2020 N/A pytest - :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) - :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest - :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Mar 03, 2023 N/A N/A - :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A - :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest - :pypi:`pytest-github` Plugin for py.test that associates tests with github issues using a marker. Mar 07, 2019 5 - Production/Stable N/A - :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Dec 19, 2022 N/A pytest (>=4.0.0) - :pypi:`pytest-github-report` Generate a GitHub report using pytest in GitHub Workflows Jun 03, 2022 4 - Beta N/A - :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A - :pypi:`pytest-git-selector` Utility to select tests that have had its dependencies modified (as identified by git diff) Nov 17, 2022 N/A N/A - :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Jul 22, 2022 4 - Beta pytest - :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest - :pypi:`pytest-golden` Plugin for pytest that offloads expected outputs to data files Jul 18, 2022 N/A pytest (>=6.1.2) - :pypi:`pytest-google-chat` Notify google chat channel for test results Mar 27, 2022 4 - Beta pytest - :pypi:`pytest-graphql-schema` Get graphql schema as fixture for pytest Oct 18, 2019 N/A N/A - :pypi:`pytest-greendots` Green progress dots Feb 08, 2014 3 - Alpha N/A - :pypi:`pytest-growl` Growl notifications for pytest results. Jan 13, 2014 5 - Production/Stable N/A - :pypi:`pytest-grpc` pytest plugin for grpc May 01, 2020 N/A pytest (>=3.6.0) - :pypi:`pytest-grunnur` Py.Test plugin for Grunnur-based packages. Feb 05, 2023 N/A N/A - :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest - :pypi:`pytest-harmony` Chain tests and data with pytest Jan 17, 2023 N/A pytest (>=7.2.1,<8.0.0) - :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Jun 10, 2022 5 - Production/Stable N/A - :pypi:`pytest-helm-chart` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jun 15, 2020 4 - Beta pytest (>=5.4.2,<6.0.0) - :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Oct 19, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-helper` Functions to help in using the pytest testing framework May 31, 2019 5 - Production/Stable N/A - :pypi:`pytest-helpers` pytest helpers May 17, 2020 N/A pytest - :pypi:`pytest-helpers-namespace` Pytest Helpers Namespace Plugin Dec 29, 2021 5 - Production/Stable pytest (>=6.0.0) - :pypi:`pytest-hidecaptured` Hide captured output May 04, 2018 4 - Beta pytest (>=2.8.5) - :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest - :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest - :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 03, 2023 3 - Alpha pytest (==7.2.1) - :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A - :pypi:`pytest-hot-test` A plugin that tracks test changes Dec 10, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jan 30, 2023 N/A pytest (>=5.0) - :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 27, 2023 5 - Production/Stable pytest (>=3.7.0) - :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Feb 28, 2023 4 - Beta pytest (>=6.2.4,<7.0.0) - :pypi:`pytest-html` pytest plugin for generating HTML reports Oct 25, 2022 5 - Production/Stable pytest (!=6.0.0,>=5.0) - :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-html-merger` Pytest HTML reports merging utility Apr 03, 2022 N/A N/A - :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Mar 04, 2022 5 - Production/Stable N/A - :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) - :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A - :pypi:`pytest-html-report-merger` Aug 31, 2022 N/A N/A - :pypi:`pytest-html-thread` pytest plugin for generating HTML reports Dec 29, 2020 5 - Production/Stable N/A - :pypi:`pytest-http` Fixture "http" for http requests Dec 05, 2019 N/A N/A - :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Mar 16, 2022 5 - Production/Stable pytest ; extra == 'test' - :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A - :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A - :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Sep 12, 2022 3 - Alpha N/A - :pypi:`pytest-httptesting` http_testing framework on top of pytest Dec 08, 2022 N/A pytest (>=7.2.0,<8.0.0) - :pypi:`pytest-httpx` Send responses to httpx. Jan 20, 2023 5 - Production/Stable pytest (<8.0,>=6.0) - :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Feb 16, 2023 N/A pytest (>=7.2.1) - :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A - :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest - :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A - :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Aug 05, 2022 4 - Beta pytest>=7.1 - :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Aug 09, 2022 4 - Beta N/A - :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A - :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Sep 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jul 25, 2022 N/A N/A - :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A - :pypi:`pytest-image-diff` Jan 29, 2023 3 - Alpha pytest - :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A - :pypi:`pytest-influxdb` Plugin for influxdb and pytest integration. Apr 20, 2021 N/A N/A - :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A - :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A - :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A - :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A - :pypi:`pytest-inline` A pytest plugin for writing inline tests. Feb 08, 2023 4 - Beta pytest (>=7.0.0) - :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Feb 23, 2023 5 - Production/Stable N/A - :pypi:`pytest-inmanta-extensions` Inmanta tests package Feb 09, 2023 5 - Production/Stable N/A - :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Feb 21, 2023 5 - Production/Stable N/A - :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Jun 16, 2022 4 - Beta N/A - :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A - :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Nov 02, 2022 N/A pytest (>=7.2.0,<8.0.0) - :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) - :pypi:`pytest-instrument` pytest plugin to instrument tests Apr 05, 2020 5 - Production/Stable pytest (>=5.1.0) - :pypi:`pytest-integration` Organizing pytests by integration or not Nov 17, 2022 N/A N/A - :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) - :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A - :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) - :pypi:`pytest-invenio` Pytest fixtures for Invenio. Oct 25, 2022 5 - Production/Stable pytest (<7.2.0,>=6) - :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Mar 20, 2013 2 - Pre-Alpha N/A - :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A - :pypi:`pytest-isolate` Feb 20, 2023 4 - Beta pytest - :pypi:`pytest-isort` py.test plugin to check import ordering using isort Oct 31, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. Aug 19, 2022 5 - Production/Stable N/A - :pypi:`pytest-it` Pytest plugin to display test reports as a plaintext spec, inspired by Rspec: https://github.com/mattduck/pytest-it. Jan 22, 2020 4 - Beta N/A - :pypi:`pytest-iterassert` Nicer list and iterable assertion messages for pytest May 11, 2020 3 - Alpha N/A - :pypi:`pytest-iters` A contextmanager pytest fixture for handling multiple mock iters May 24, 2022 N/A N/A - :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A - :pypi:`pytest-jelastic` Pytest plugin defining the necessary command-line options to pass to pytests testing a Jelastic environment. Nov 16, 2022 N/A pytest (>=7.2.0,<8.0.0) - :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) - :pypi:`pytest-jinja` A plugin to generate customizable jinja-based HTML reports in pytest Oct 04, 2022 3 - Alpha pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A - :pypi:`pytest-jira-xfail` Plugin skips (xfail) tests if unresolved Jira issue(s) linked Dec 01, 2022 N/A pytest (~=7.2.0) - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Feb 09, 2023 4 - Beta pytest - :pypi:`pytest-job-selection` A pytest plugin for load balancing test suites Jan 30, 2023 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest - :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) - :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A - :pypi:`pytest-json-fixtures` JSON output for the --fixtures flag Aug 09, 2022 4 - Beta pytest (>=7.1.0) - :pypi:`pytest-jsonlint` UNKNOWN Aug 04, 2016 N/A N/A - :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Mar 15, 2022 4 - Beta pytest (>=3.8.0) - :pypi:`pytest-jtr` pytest plugin supporting json test report output Nov 29, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-jupyter` A pytest plugin for testing Jupyter libraries and extensions. Dec 19, 2022 4 - Beta pytest - :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Oct 01, 2022 N/A pytest - :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest - :pypi:`pytest-kasima` Display horizontal lines above and below the captured standard output for easy viewing. Jan 26, 2023 5 - Production/Stable pytest (>=7.2.1,<8.0.0) - :pypi:`pytest-keep-together` Pytest plugin to customize test ordering by running all 'related' tests together Dec 07, 2022 5 - Production/Stable pytest - :pypi:`pytest-kexi` Apr 29, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Nov 30, 2022 5 - Production/Stable N/A - :pypi:`pytest-kivy` Kivy GUI tests fixtures using pytest Jul 06, 2021 4 - Beta pytest (>=3.6) - :pypi:`pytest-knows` A pytest plugin that can automaticly skip test case based on dependence info calculated by trace Aug 22, 2014 N/A N/A - :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A - :pypi:`pytest-koopmans` A plugin for testing the koopmans package Nov 21, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A - :pypi:`pytest-kubernetes` Feb 16, 2023 N/A pytest (>=7.2.1,<8.0.0) - :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) - :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. Aug 20, 2022 3 - Alpha pytest (>=3.6,<8) - :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A - :pypi:`pytest-langchain` Pytest-style test runner for langchain agents Feb 26, 2023 N/A pytest - :pypi:`pytest-lark` A package for enhancing pytest Nov 20, 2022 N/A N/A - :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 14, 2022 N/A pytest (>=4.2.0) - :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A - :pypi:`pytest-lazy-fixture` It helps to use fixtures in pytest.mark.parametrize Feb 01, 2020 4 - Beta pytest (>=3.2.5) - :pypi:`pytest-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest - :pypi:`pytest-leak-finder` Find the test that's leaking before the one that fails Feb 15, 2023 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-leaks` A pytest plugin to trace resource leaks. Nov 27, 2019 1 - Planning N/A - :pypi:`pytest-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest - :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest. Dec 22, 2018 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Jul 11, 2022 4 - Beta N/A - :pypi:`pytest-libnotify` Pytest plugin that shows notifications about the test run Apr 02, 2021 3 - Alpha pytest - :pypi:`pytest-ligo` Jan 16, 2020 4 - Beta N/A - :pypi:`pytest-lineno` A pytest plugin to show the line numbers of test functions Dec 04, 2020 N/A pytest - :pypi:`pytest-line-profiler` Profile code executed by pytest May 03, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-line-profiler-apn` Profile code executed by pytest Dec 05, 2022 N/A pytest (>=3.5.0) - :pypi:`pytest-lisa` Pytest plugin for organizing tests. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) - :pypi:`pytest-listener` A simple network listener May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-live` Live results for pytest Mar 08, 2020 N/A pytest - :pypi:`pytest-local-badge` Generate local badges (shields) reporting your test suite status. Jan 15, 2023 N/A pytest (>=6.1.0) - :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Oct 04, 2022 5 - Production/Stable pytest - :pypi:`pytest-localserver` pytest plugin to test server connections locally. Jan 30, 2023 4 - Beta N/A - :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Oct 17, 2022 4 - Beta pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-lockable` lockable resource plugin for pytest Jul 20, 2022 5 - Production/Stable pytest - :pypi:`pytest-locker` Used to lock object during testing. Essentially changing assertions from being hard coded to asserting that nothing changed Oct 29, 2021 N/A pytest (>=5.4) - :pypi:`pytest-log` print log Aug 15, 2021 N/A pytest (>=3.8) - :pypi:`pytest-logbook` py.test plugin to capture logbook log messages Nov 23, 2015 5 - Production/Stable pytest (>=2.8) - :pypi:`pytest-logdog` Pytest plugin to test logging Jun 15, 2021 1 - Planning pytest (>=6.2.0) - :pypi:`pytest-logfest` Pytest plugin providing three logger fixtures with basic or full writing to log files Jul 21, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-logger` Plugin configuring handlers for loggers from Python logging module. Jul 25, 2019 4 - Beta pytest (>=3.2) - :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A - :pypi:`pytest-logging-end-to-end-test-tool` Sep 23, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-logikal` Common testing environment Feb 28, 2023 5 - Production/Stable pytest (==7.2.1) - :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A - :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A - :pypi:`pytest-loop` pytest plugin for looping tests Jul 22, 2022 5 - Production/Stable pytest (>=6) - :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Jan 14, 2023 3 - Alpha pytest - :pypi:`pytest-manual-marker` pytest marker for marking manual tests Aug 04, 2022 3 - Alpha pytest>=7 - :pypi:`pytest-markdoctest` A pytest plugin to doctest your markdown files Jul 22, 2022 4 - Beta pytest (>=6) - :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) - :pypi:`pytest-markdown-docs` Run markdown code fences through pytest Sep 02, 2022 N/A N/A - :pypi:`pytest-marker-bugzilla` py.test bugzilla integration plugin, using markers Jan 09, 2020 N/A N/A - :pypi:`pytest-markers-presence` A simple plugin to detect missed pytest tags and markers" Feb 04, 2021 4 - Beta pytest (>=6.0) - :pypi:`pytest-markfiltration` UNKNOWN Nov 08, 2011 3 - Alpha N/A - :pypi:`pytest-mark-no-py3` pytest plugin and bowler codemod to help migrate tests to Python 3 May 17, 2019 N/A pytest - :pypi:`pytest-marks` UNKNOWN Nov 23, 2012 3 - Alpha N/A - :pypi:`pytest-matcher` Match test output against patterns stored in files Dec 10, 2021 5 - Production/Stable N/A - :pypi:`pytest-match-skip` Skip matching marks. Matches partial marks using wildcards. May 15, 2019 4 - Beta pytest (>=4.4.1) - :pypi:`pytest-mat-report` this is report Jan 20, 2021 N/A N/A - :pypi:`pytest-matrix` Provide tools for generating tests from combinations of fixtures. Jun 24, 2020 5 - Production/Stable pytest (>=5.4.3,<6.0.0) - :pypi:`pytest-maybe-raises` Pytest fixture for optional exception testing. May 27, 2022 N/A pytest ; extra == 'dev' - :pypi:`pytest-mccabe` pytest plugin to run the mccabe code complexity checker. Jul 22, 2020 3 - Alpha pytest (>=5.4.0) - :pypi:`pytest-md` Plugin for generating Markdown reports for pytest results Jul 11, 2019 3 - Alpha pytest (>=4.2.1) - :pypi:`pytest-md-report` A pytest plugin to make a test results report with Markdown table format. Aug 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) - :pypi:`pytest-memprof` Estimates memory consumption of test functions Mar 29, 2019 4 - Beta N/A - :pypi:`pytest-memray` A simple plugin to use with pytest Dec 02, 2022 N/A pytest>=7.2 - :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) - :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A - :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) - :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) - :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A - :pypi:`pytest-metadata` pytest plugin for test session metadata Oct 30, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) - :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest - :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) - :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) - :pypi:`pytest-mini` A plugin to test mp Feb 06, 2023 N/A pytest (>=7.2.0,<8.0.0) - :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-ml` Test your machine learning! May 04, 2019 4 - Beta N/A - :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) - :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Oct 05, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-mock-api` A mock API server with configurable routes and responses available as a fixture. Feb 13, 2019 1 - Planning pytest (>=4.0.0) - :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator May 16, 2022 5 - Production/Stable N/A - :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest - :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A - :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A - :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Mar 03, 2023 N/A pytest (>=1.0) - :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) - :pypi:`pytest-mocktcp` A pytest plugin for testing TCP clients Oct 11, 2022 N/A pytest - :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A - :pypi:`pytest-modifyjunit` Utility for adding additional properties to junit xml for IDM QE Jan 10, 2019 N/A N/A - :pypi:`pytest-modifyscope` pytest plugin to modify fixture scope Apr 12, 2020 N/A pytest - :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Mar 29, 2022 5 - Production/Stable pytest (>=7.0.0) - :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Jun 07, 2021 5 - Production/Stable pytest - :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures Dec 07, 2019 5 - Production/Stable pytest (>=2.5.2) - :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Oct 22, 2022 5 - Production/Stable pytest - :pypi:`pytest-monkeyplus` pytest's monkeypatch subclass with extra functionalities Sep 18, 2012 5 - Production/Stable N/A - :pypi:`pytest-monkeytype` pytest-monkeytype: Generate Monkeytype annotations from your pytest tests. Jul 29, 2020 4 - Beta N/A - :pypi:`pytest-moto` Fixtures for integration tests of AWS services,uses moto mocking library. Aug 28, 2015 1 - Planning N/A - :pypi:`pytest-motor` A pytest plugin for motor, the non-blocking MongoDB driver. Jul 21, 2021 3 - Alpha pytest - :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest - :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest - :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 23, 2022 4 - Beta pytest - :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Nov 15, 2022 4 - Beta pytest (>=6) - :pypi:`pytest-mqtt` pytest-mqtt supports testing systems based on MQTT Sep 20, 2022 4 - Beta pytest (<8) ; extra == 'test' - :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A - :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jan 17, 2023 N/A pytest - :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Dec 07, 2022 N/A N/A - :pypi:`pytest-multithreading-allure` pytest_multithreading_allure Nov 25, 2022 N/A N/A - :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) - :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Dec 18, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" - :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" - :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Oct 26, 2022 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A pytest>=6.0.0 - :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Feb 25, 2023 N/A pytest>=7,<8 - :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Feb 15, 2022 5 - Production/Stable pytest (>=6.2) - :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) - :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) - :pypi:`pytest-netdut` "Automated software testing for switches using pytest" Jan 11, 2023 N/A pytest (>=3.5.0) - :pypi:`pytest-network` A simple plugin to disable network on socket level. May 07, 2020 N/A N/A - :pypi:`pytest-network-endpoints` Network endpoints plugin for pytest Mar 06, 2022 N/A pytest - :pypi:`pytest-never-sleep` pytest plugin helps to avoid adding tests without mock \`time.sleep\` May 05, 2021 3 - Alpha pytest (>=3.5.1) - :pypi:`pytest-nginx` nginx fixture for pytest Aug 12, 2017 5 - Production/Stable N/A - :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A - :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest - :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) - :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Jan 09, 2023 N/A pytest (==6.2.5) - :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest - :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A - :pypi:`pytest-nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Jul 07, 2021 N/A N/A - :pypi:`pytest-nocustom` Run all tests without custom markers Jul 07, 2021 5 - Production/Stable N/A - :pypi:`pytest-nodev` Test-driven source code search for Python. Jul 21, 2016 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-nogarbage` Ensure a test produces no garbage Aug 29, 2021 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-notice` Send pytest execution result email Nov 05, 2020 N/A N/A - :pypi:`pytest-notification` A pytest plugin for sending a desktop notification and playing a sound upon completion of tests Jun 19, 2020 N/A pytest (>=4) - :pypi:`pytest-notifier` A pytest plugin to notify test result Jun 12, 2020 3 - Alpha pytest - :pypi:`pytest-notimplemented` Pytest markers for not implemented features and tests. Aug 27, 2019 N/A pytest (>=5.1,<6.0) - :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A - :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Oct 20, 2022 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-oar` PyTest plugin for the OAR testing framework Feb 22, 2023 N/A pytest>=6.0.1 - :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jul 31, 2022 5 - Production/Stable pytest - :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A - :pypi:`pytest-odoo` py.test plugin to run Odoo tests Nov 17, 2022 4 - Beta pytest (>=7.2.0) - :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A - :pypi:`pytest-oerp` pytest plugin to test OpenERP modules Feb 28, 2012 3 - Alpha N/A - :pypi:`pytest-ogsm-plugin` 针对特定项目定制化插件,优化了pytest报告展示方式,并添加了项目所需特定参数 Feb 21, 2023 N/A N/A - :pypi:`pytest-ok` The ultimate pytest output plugin Apr 01, 2019 4 - Beta N/A - :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jun 14, 2022 5 - Production/Stable pytest (<7.1); python_version <= "3.6" - :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A - :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) - :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry Nov 12, 2022 N/A pytest - :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Jun 02, 2022 5 - Production/Stable pytest (>=5.0) - :pypi:`pytest-operator` Fixtures for Operators Sep 28, 2022 N/A pytest - :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A - :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) - :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A - :pypi:`pytest-order` pytest plugin to run your tests in a specific order Jan 09, 2022 4 - Beta pytest (>=5.0) ; python_version < "3.10" - :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest - :pypi:`pytest-order-modify` 新增run_marker 来自定义用例的执行顺序 Nov 04, 2022 N/A N/A - :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A - :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Jan 18, 2023 N/A N/A - :pypi:`pytest-override-env-var` Pytest mark to override a value of an environment variable. Feb 25, 2023 N/A N/A - :pypi:`pytest-owner` Add owner mark for tests Apr 25, 2022 N/A N/A - :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A - :pypi:`pytest-pahrametahrize` Parametrize your tests with a Boston accent. Nov 24, 2021 4 - Beta pytest (>=6.0,<7.0) - :pypi:`pytest-parallel` a pytest plugin for parallel and concurrent testing Oct 10, 2021 3 - Alpha pytest (>=3.0.0) - :pypi:`pytest-parallel-39` a pytest plugin for parallel and concurrent testing Jul 12, 2021 3 - Alpha pytest (>=3.0.0) - :pypi:`pytest-parallelize-tests` pytest plugin that parallelizes test execution across multiple hosts Jan 27, 2023 4 - Beta N/A - :pypi:`pytest-param` pytest plugin to test all, first, last or random params Sep 11, 2016 4 - Beta pytest (>=2.6.0) - :pypi:`pytest-paramark` Configure pytest fixtures using a combination of"parametrize" and markers Jan 10, 2020 4 - Beta pytest (>=4.5.0) - :pypi:`pytest-parametrization` Simpler PyTest parametrization May 22, 2022 5 - Production/Stable N/A - :pypi:`pytest-parametrize-cases` A more user-friendly way to write parametrized tests. Mar 13, 2022 N/A pytest (>=6.1.2) - :pypi:`pytest-parametrized` Pytest decorator for parametrizing tests with default iterables. Sep 13, 2022 5 - Production/Stable pytest - :pypi:`pytest-parametrize-suite` A simple pytest extension for creating a named test suite. Jan 19, 2023 5 - Production/Stable pytest - :pypi:`pytest-parawtf` Finally spell paramete?ri[sz]e correctly Dec 03, 2018 4 - Beta pytest (>=3.6.0) - :pypi:`pytest-pass` Check out https://github.com/elilutsky/pytest-pass Dec 04, 2019 N/A N/A - :pypi:`pytest-passrunner` Pytest plugin providing the 'run_on_pass' marker Feb 10, 2021 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-paste-config` Allow setting the path to a paste config file Sep 18, 2013 3 - Alpha N/A - :pypi:`pytest-patches` A contextmanager pytest fixture for handling multiple mock patches Aug 30, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-pdb` pytest plugin which adds pdb helper commands related to pytest. Jul 31, 2018 N/A N/A - :pypi:`pytest-peach` pytest plugin for fuzzing with Peach API Security Apr 12, 2019 4 - Beta pytest (>=2.8.7) - :pypi:`pytest-pep257` py.test plugin for pep257 Jul 09, 2016 N/A N/A - :pypi:`pytest-pep8` pytest plugin to check PEP8 requirements Apr 27, 2014 N/A N/A - :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) - :pypi:`pytest-perf` pytest-perf Jun 23, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' - :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) - :pypi:`pytest-persistence` Pytest tool for persistent objects Jun 27, 2022 N/A N/A - :pypi:`pytest-pg` A tiny plugin for pytest which runs PostgreSQL in Docker Sep 19, 2022 5 - Production/Stable pytest (>=6.0.0) - :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Apr 15, 2022 4 - Beta pytest (>=5.4.3) - :pypi:`pytest-picked` Run the tests related to the changed files Dec 23, 2020 N/A pytest (>=3.5.0) - :pypi:`pytest-pigeonhole` Jun 25, 2018 5 - Production/Stable pytest (>=3.4) - :pypi:`pytest-pikachu` Show surprise when tests are passing Aug 05, 2021 5 - Production/Stable pytest - :pypi:`pytest-pilot` Slice in your test base thanks to powerful markers. Oct 09, 2020 5 - Production/Stable N/A - :pypi:`pytest-pingguo-pytest-plugin` pingguo test Oct 26, 2022 4 - Beta N/A - :pypi:`pytest-pings` 🦊 The pytest plugin for Firefox Telemetry 📊 Jun 29, 2019 3 - Alpha pytest (>=5.0.0) - :pypi:`pytest-pinned` A simple pytest plugin for pinning tests Sep 17, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-pinpoint` A pytest plugin which runs SBFL algorithms to detect faults. Sep 25, 2020 N/A pytest (>=4.4.0) - :pypi:`pytest-pipeline` Pytest plugin for functional testing of data analysispipelines Jan 24, 2017 3 - Alpha N/A - :pypi:`pytest-platform-markers` Markers for pytest to skip tests on specific platforms Sep 09, 2019 4 - Beta pytest (>=3.6.0) - :pypi:`pytest-play` pytest plugin that let you automate actions and assertions with test metrics reporting executing plain YAML files Jun 12, 2019 5 - Production/Stable N/A - :pypi:`pytest-playbook` Pytest plugin for reading playbooks. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) - :pypi:`pytest-playwright` A pytest wrapper with fixtures for Playwright to automate web browsers Feb 28, 2023 N/A pytest (<8.0.0,>=6.2.4) - :pypi:`pytest-playwrights` A pytest wrapper with fixtures for Playwright to automate web browsers Dec 02, 2021 N/A N/A - :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A - :pypi:`pytest-playwright-visual` A pytest fixture for visual testing with Playwright Apr 28, 2022 N/A N/A - :pypi:`pytest-plone` Pytest plugin to test Plone addons Jan 05, 2023 3 - Alpha pytest - :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Aug 17, 2020 5 - Production/Stable pytest - :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Dec 24, 2022 5 - Production/Stable pytest (>=6.0.1) - :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A - :pypi:`pytest-pointers` Pytest plugin to define functions you test with special marks for better navigation and reports Dec 26, 2022 N/A N/A - :pypi:`pytest-polarion-cfme` pytest plugin for collecting test cases and recording test results Nov 13, 2017 3 - Alpha N/A - :pypi:`pytest-polarion-collect` pytest plugin for collecting polarion test cases data Jun 18, 2020 3 - Alpha pytest - :pypi:`pytest-polecat` Provides Polecat pytest fixtures Aug 12, 2019 4 - Beta N/A - :pypi:`pytest-ponyorm` PonyORM in Pytest Oct 31, 2018 N/A pytest (>=3.1.1) - :pypi:`pytest-poo` Visualize your crappy tests Mar 25, 2021 5 - Production/Stable pytest (>=2.3.4) - :pypi:`pytest-poo-fail` Visualize your failed tests with poo Feb 12, 2015 5 - Production/Stable N/A - :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Aug 18, 2022 5 - Production/Stable pytest - :pypi:`pytest-portion` Select a portion of the collected tests Jan 28, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest - :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) - :pypi:`pytest-pot` A package for enhancing pytest Nov 20, 2022 N/A N/A - :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) - :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 27, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) - :pypi:`pytest-pretty` pytest plugin for printing summary data as I want it Feb 01, 2023 5 - Production/Stable pytest>=7 - :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 31, 2022 N/A pytest (>=3.4.1) - :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A - :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Dec 28, 2021 5 - Production/Stable pytest (>=6) - :pypi:`pytest-profiles` pytest plugin for configuration profiles Dec 09, 2021 4 - Beta pytest (>=3.7.0) - :pypi:`pytest-profiling` Profiling plugin for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-progress` pytest plugin for instant test progress status Jan 31, 2022 5 - Production/Stable N/A - :pypi:`pytest-prometheus` Report test pass / failures to a Prometheus PushGateway Oct 03, 2017 N/A N/A - :pypi:`pytest-prometheus-pushgateway` Pytest report plugin for Zulip Sep 27, 2022 5 - Production/Stable pytest - :pypi:`pytest-prosper` Test helpers for Prosper projects Sep 24, 2018 N/A N/A - :pypi:`pytest-pspec` A rspec format reporter for Python ptest Jun 02, 2020 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-psqlgraph` pytest plugin for testing applications that use psqlgraph Oct 19, 2021 4 - Beta pytest (>=6.0) - :pypi:`pytest-ptera` Use ptera probes in tests Mar 01, 2022 N/A pytest (>=6.2.4,<7.0.0) - :pypi:`pytest-pudb` Pytest PuDB debugger integration Oct 25, 2018 3 - Alpha pytest (>=2.0) - :pypi:`pytest-pumpkin-spice` A pytest plugin that makes your test reporting pumpkin-spiced Sep 18, 2022 4 - Beta N/A - :pypi:`pytest-purkinje` py.test plugin for purkinje test runner Oct 28, 2017 2 - Pre-Alpha N/A - :pypi:`pytest-pusher` pytest plugin for push report to minio Jan 06, 2023 5 - Production/Stable pytest (>=3.6) - :pypi:`pytest-py125` Dec 03, 2022 N/A N/A - :pypi:`pytest-pycharm` Plugin for py.test to enter PyCharm debugger on uncaught exceptions Aug 13, 2020 5 - Production/Stable pytest (>=2.3) - :pypi:`pytest-pycodestyle` pytest plugin to run pycodestyle Oct 28, 2022 3 - Alpha N/A - :pypi:`pytest-pydev` py.test plugin to connect to a remote debug server with PyDev or PyCharm. Nov 15, 2017 3 - Alpha N/A - :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Jan 05, 2023 3 - Alpha N/A - :pypi:`pytest-pylint` pytest plugin to check source code with pylint Sep 10, 2022 5 - Production/Stable pytest (>=5.4) - :pypi:`pytest-pymysql-autorecord` Record PyMySQL queries and mock with the stored data. Sep 02, 2022 N/A N/A - :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Jan 05, 2023 N/A pytest - :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A - :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) - :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-pyq` Pytest fixture "q" for pyq Mar 10, 2020 5 - Production/Stable N/A - :pypi:`pytest-pyramid` pytest_pyramid - provides fixtures for testing pyramid applications with pytest test suite Dec 13, 2022 5 - Production/Stable pytest - :pypi:`pytest-pyramid-server` Pyramid server fixture for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-pyright` Pytest plugin for type checking code with Pyright Nov 20, 2022 4 - Beta pytest (>=7.0.0) - :pypi:`pytest-pyspec` A python test spec based on pytest Mar 01, 2023 N/A pytest (>=7.2.1,<8.0.0) - :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.0) - :pypi:`pytest-pythonpath` pytest plugin for adding to the PYTHONPATH from command line or configs. Feb 10, 2022 5 - Production/Stable pytest (<7,>=2.5.2) - :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest - :pypi:`pytest-pyvista` Pytest-pyvista package Feb 07, 2023 4 - Beta pytest>=3.5.0 - :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) - :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Feb 14, 2023 4 - Beta pytest (>=6.2.0) - :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jun 26, 2022 5 - Production/Stable pytest (>=6.2.3) - :pypi:`pytest-qml` Run QML Tests with pytest Dec 02, 2020 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-qr` pytest plugin to generate test result QR codes Nov 25, 2021 4 - Beta N/A - :pypi:`pytest-qt` pytest support for PyQt and PySide applications Oct 25, 2022 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-qt-app` QT app fixture for py.test Dec 23, 2015 5 - Production/Stable N/A - :pypi:`pytest-quarantine` A plugin for pytest to manage expected test failures Nov 24, 2019 5 - Production/Stable pytest (>=4.6) - :pypi:`pytest-quickcheck` pytest plugin to generate random data inspired by QuickCheck Nov 05, 2022 4 - Beta pytest (>=4.0) - :pypi:`pytest-rabbitmq` RabbitMQ process and client fixtures for pytest Feb 11, 2022 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-race` Race conditions tester for pytest Jun 07, 2022 4 - Beta N/A - :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A - :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results May 02, 2022 N/A pytest (>=3.6) - :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Jun 29, 2022 5 - Production/Stable pytest - :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) - :pypi:`pytest-raisesregexp` Simple pytest plugin to look for regex in Exceptions Dec 18, 2015 N/A N/A - :pypi:`pytest-raisin` Plugin enabling the use of exception instances with pytest.raises Feb 06, 2022 N/A pytest - :pypi:`pytest-random` py.test plugin to randomize tests Apr 28, 2013 3 - Alpha N/A - :pypi:`pytest-randomly` Pytest plugin to randomly order tests and control random.seed. May 11, 2022 5 - Production/Stable pytest - :pypi:`pytest-randomness` Pytest plugin about random seed management May 30, 2019 3 - Alpha N/A - :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A - :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Dec 03, 2022 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-readme` Test your README.md file Sep 02, 2022 5 - Production/Stable N/A - :pypi:`pytest-reana` Pytest fixtures for REANA. Dec 13, 2022 3 - Alpha N/A - :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Feb 16, 2023 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A - :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) - :pypi:`pytest-redislite` Pytest plugin for testing code using Redis Apr 05, 2022 4 - Beta pytest - :pypi:`pytest-redmine` Pytest plugin for redmine Mar 19, 2018 1 - Planning N/A - :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A - :pypi:`pytest-regex-dependency` Management of Pytest dependencies via regex patterns Jun 12, 2022 N/A pytest - :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Jan 13, 2023 5 - Production/Stable pytest (>=6.2.0) - :pypi:`pytest-regtest` pytest plugin for regression tests Jul 08, 2022 N/A N/A - :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A - :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Dec 31, 2022 5 - Production/Stable pytest (>=7) - :pypi:`pytest-remfiles` Pytest plugin to create a temporary directory with remote files Jul 01, 2019 5 - Production/Stable N/A - :pypi:`pytest-remotedata` Pytest plugin for controlling remote data access. Dec 12, 2022 3 - Alpha pytest (>=4.6) - :pypi:`pytest-remote-response` Pytest plugin for capturing and mocking connection requests. Jun 05, 2022 4 - Beta pytest (>=4.6) - :pypi:`pytest-remove-stale-bytecode` py.test plugin to remove stale byte code files. Mar 04, 2020 4 - Beta pytest - :pypi:`pytest-reorder` Reorder tests depending on their paths and names. May 31, 2018 4 - Beta pytest - :pypi:`pytest-repeat` pytest plugin for repeating tests Oct 31, 2020 5 - Production/Stable pytest (>=3.6) - :pypi:`pytest-replay` Saves previous test runs and allow re-execute previous pytest runs to reproduce crashes or flaky tests Jun 09, 2021 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-repo-health` A pytest plugin to report on repository standards conformance Dec 16, 2021 3 - Alpha pytest - :pypi:`pytest-report` Creates json report that is compatible with atom.io's linter message format May 11, 2016 4 - Beta N/A - :pypi:`pytest-reporter` Generate Pytest reports with templates Jul 22, 2021 4 - Beta pytest - :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest Jun 08, 2021 4 - Beta N/A - :pypi:`pytest-reporter-html-dots` A basic HTML report for pytest using Jinja2 template engine. Jan 22, 2023 N/A N/A - :pypi:`pytest-reportinfra` Pytest plugin for reportinfra Aug 11, 2019 3 - Alpha N/A - :pypi:`pytest-reporting` A plugin to report summarized results in a table format Oct 25, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility Dec 11, 2020 3 - Alpha pytest (>=5.2) - :pypi:`pytest-report-me` A pytest plugin to generate report. Dec 31, 2020 N/A pytest - :pypi:`pytest-report-parameters` pytest plugin for adding tests' parameters to junit report Jun 18, 2020 3 - Alpha pytest (>=2.4.2) - :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Feb 20, 2023 N/A pytest (>=3.8.0) - :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) - :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-requestselapsed` collect and show http requests elapsed time Aug 14, 2022 N/A N/A - :pypi:`pytest-requests-futures` Pytest Plugin to Mock Requests Futures Jul 06, 2022 5 - Production/Stable pytest - :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Sep 20, 2022 5 - Production/Stable pytest (>=4.6) - :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) - :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Feb 17, 2023 5 - Production/Stable pytest (>=5.3) - :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-reserial` Pytest fixture for recording and replaying serial port traffic. Nov 29, 2022 4 - Beta pytest - :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest Feb 28, 2023 N/A pytest (~=4.6) ; python_version == "2.7" - :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A - :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-resource-usage` Pytest plugin for reporting running time and peak memory usage Nov 06, 2022 5 - Production/Stable pytest>=7.0.0 - :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A - :pypi:`pytest-responses` py.test integration for responses Oct 11, 2022 N/A pytest (>=2.5) - :pypi:`pytest-rest-api` Aug 08, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed May 11, 2022 5 - Production/Stable pytest - :pypi:`pytest-result-log` Write the execution result of the case to the log Feb 02, 2023 N/A pytest>=7.2.0 - :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A - :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Aug 16, 2022 N/A pytest (>=7.0.0) - :pypi:`pytest-reverse` Pytest plugin to reverse test order. May 11, 2022 5 - Production/Stable pytest - :pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0) - :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) - :pypi:`pytest-richtrace` Nov 05, 2022 N/A pytest (>=7.2.0,<8.0.0) - :pypi:`pytest-ringo` pytest plugin to test webapplications using the Ringo webframework Sep 27, 2017 3 - Alpha N/A - :pypi:`pytest-rmsis` Sycronise pytest results to Jira RMsis Aug 10, 2022 N/A pytest (>=5.3.5) - :pypi:`pytest-rng` Fixtures for seeding tests and making randomness reproducible Aug 08, 2019 5 - Production/Stable pytest - :pypi:`pytest-roast` pytest plugin for ROAST configuration override and fixtures Nov 09, 2022 5 - Production/Stable pytest - :pypi:`pytest-rocketchat` Pytest to Rocket.Chat reporting plugin Apr 18, 2021 5 - Production/Stable N/A - :pypi:`pytest-rotest` Pytest integration with rotest Sep 08, 2019 N/A pytest (>=3.5.0) - :pypi:`pytest-rpc` Extend py.test for RPC OpenStack testing. Feb 22, 2019 4 - Beta pytest (~=3.6) - :pypi:`pytest-rst` Test code from RST documents with pytest Jan 26, 2023 N/A N/A - :pypi:`pytest-rt` pytest data collector plugin for Testgr May 05, 2022 N/A N/A - :pypi:`pytest-rts` Coverage-based regression test selection (RTS) plugin for pytest May 17, 2021 N/A pytest - :pypi:`pytest-ruff` pytest plugin to check ruff requirements. Feb 27, 2023 4 - Beta N/A - :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest - :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A - :pypi:`pytest-runner` Invoke py.test as distutils command with dependency resolution Feb 25, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' - :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Nov 12, 2022 5 - Production/Stable pytest - :pypi:`pytest-runtime-types` Checks type annotations on runtime while running tests. Feb 09, 2023 N/A pytest - :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A pytest>=5.0.0 - :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Oct 31, 2022 3 - Alpha N/A - :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A - :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A - :pypi:`pytest-salt-factories` Pytest Salt Plugin Dec 15, 2022 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) - :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) - :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) - :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A - :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 04, 2023 5 - Production/Stable N/A - :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A - :pypi:`pytest-schedule` The job of test scheduling for humans. Jan 07, 2023 5 - Production/Stable N/A - :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A - :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) - :pypi:`pytest-selenium` pytest plugin for Selenium Sep 21, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 04, 2023 5 - Production/Stable N/A - :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A - :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A - :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A - :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Jan 05, 2023 N/A N/A - :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A - :pypi:`pytest-servers` pytest servers Feb 24, 2023 3 - Alpha pytest (>=6.2) - :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A - :pypi:`pytest-session2file` pytest-session2file (aka: pytest-session_to_file for v0.1.0 - v0.1.2) is a py.test plugin for capturing and saving to file the stdout of py.test. Jan 26, 2021 3 - Alpha pytest - :pypi:`pytest-session-fixture-globalize` py.test plugin to make session fixtures behave as if written in conftest, even if it is written in some modules May 15, 2018 4 - Beta N/A - :pypi:`pytest-session_to_file` pytest-session_to_file is a py.test plugin for capturing and saving to file the stdout of py.test. Oct 01, 2015 3 - Alpha N/A - :pypi:`pytest-setupinfo` Displaying setup info during pytest command run Jan 23, 2023 N/A N/A - :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A - :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest - :pypi:`pytest-share-hdf` Plugin to save test data in HDF files and retrieve them for comparison Sep 21, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-sharkreport` this is pytest report plugin. Jul 11, 2022 N/A pytest (>=3.5) - :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A - :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Sep 23, 2022 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest - :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Jan 16, 2023 5 - Production/Stable pytest (>=3.5.1) - :pypi:`pytest-shortcuts` Expand command-line shortcuts listed in pytest configuration Oct 29, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-shutil` A goodie-bag of unix shell and environment tools for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-simplehttpserver` Simple pytest fixture to spin up an HTTP server Jun 24, 2021 4 - Beta N/A - :pypi:`pytest-simple-plugin` Simple pytest plugin Nov 27, 2019 N/A N/A - :pypi:`pytest-simple-settings` simple-settings plugin for pytest Nov 17, 2020 4 - Beta pytest - :pypi:`pytest-single-file-logging` Allow for multiple processes to log to a single file May 05, 2016 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-skip-markers` Pytest Salt Plugin Dec 20, 2022 5 - Production/Stable pytest (>=7.1.0) - :pypi:`pytest-skipper` A plugin that selects only tests with changes in execution path Mar 26, 2017 3 - Alpha pytest (>=3.0.6) - :pypi:`pytest-skippy` Automatically skip tests that don't need to run! Jan 27, 2018 3 - Alpha pytest (>=2.3.4) - :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Feb 09, 2023 N/A pytest>=6.2.0 - :pypi:`pytest-slack` Pytest to Slack reporting plugin Dec 15, 2020 5 - Production/Stable N/A - :pypi:`pytest-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A - :pypi:`pytest-slowest-first` Sort tests by their last duration, slowest first Dec 11, 2022 4 - Beta N/A - :pypi:`pytest-slow-last` Run tests in order of execution time (faster tests first) Dec 10, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-smartcollect` A plugin for collecting tests that touch changed code Oct 04, 2018 N/A pytest (>=3.5.0) - :pypi:`pytest-smartcov` Smart coverage plugin for pytest. Sep 30, 2017 3 - Alpha N/A - :pypi:`pytest-smell` Automated bad smell detection tool for Pytest Jun 26, 2022 N/A N/A - :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest - :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) - :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A - :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Apr 23, 2022 4 - Beta pytest (>=3.0.0) - :pypi:`pytest-snmpserver` May 12, 2021 N/A N/A - :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Jan 05, 2022 4 - Beta pytest (>=6.2.0) - :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Feb 03, 2023 4 - Beta pytest (>=3.6.3) - :pypi:`pytest-sofaepione` Test the installation of SOFA and the SofaEpione plugin. Aug 17, 2022 N/A N/A - :pypi:`pytest-soft-assertions` May 05, 2020 3 - Alpha pytest - :pypi:`pytest-solidity` A PyTest library plugin for Solidity language. Jan 15, 2022 1 - Planning pytest (<7,>=6.0.1) ; extra == 'tests' - :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) - :pypi:`pytest-sorter` A simple plugin to first execute tests that historically failed more Apr 20, 2021 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Feb 14, 2023 2 - Pre-Alpha pytest - :pypi:`pytest-sourceorder` Test-ordering plugin for pytest Sep 01, 2021 4 - Beta pytest - :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. Feb 23, 2020 4 - Beta pytest - :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A - :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. May 04, 2021 N/A N/A - :pypi:`pytest-spec2md` Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. Jun 26, 2022 N/A pytest (>7.0) - :pypi:`pytest-speed` Modern benchmarking library for python with pytest integration. Jan 22, 2023 3 - Alpha pytest>=7 - :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Sep 06, 2022 4 - Beta pytest (>=7.0.0) - :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A - :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Sep 09, 2022 6 - Mature pytest (>=3.0.0) - :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Jun 11, 2022 6 - Mature pytest (<8.0,>=7.1.2) - :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Apr 22, 2022 4 - Beta pytest (>=5,<8) - :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) - :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) - :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A - :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Feb 22, 2023 N/A pytest (>5.4.0,<7.3) - :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 02, 2023 N/A N/A - :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) - :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A - :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Mar 13, 2018 3 - Alpha N/A - :pypi:`pytest-sqlalchemy-mock` pytest sqlalchemy plugin for mock Sep 25, 2022 3 - Alpha pytest (>=2.0) - :pypi:`pytest-sql-bigquery` Yet another SQL-testing framework for BigQuery provided by pytest plugin Dec 19, 2019 N/A pytest - :pypi:`pytest-sqlfluff` A pytest plugin to use sqlfluff to enable format checking of sql files. Dec 21, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-squadcast` Pytest report plugin for Squadcast Feb 22, 2022 5 - Production/Stable pytest - :pypi:`pytest-srcpaths` Add paths to sys.path Oct 15, 2021 N/A pytest>=6.2.0 - :pypi:`pytest-ssh` pytest plugin for ssh command run May 27, 2019 N/A pytest - :pypi:`pytest-start-from` Start pytest run from a given point Apr 11, 2016 N/A N/A - :pypi:`pytest-star-track-issue` A package to prevent Dependency Confusion attacks against Yandex. Feb 10, 2023 N/A N/A - :pypi:`pytest-statsd` pytest plugin for reporting to graphite Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) - :pypi:`pytest-stepfunctions` A small description May 08, 2021 4 - Beta pytest - :pypi:`pytest-steps` Create step-wise / incremental tests in pytest. Sep 23, 2021 5 - Production/Stable N/A - :pypi:`pytest-stepwise` Run a test suite one failing test at a time. Dec 01, 2015 4 - Beta N/A - :pypi:`pytest-stf` pytest plugin for openSTF Dec 04, 2022 N/A pytest (>=5.0) - :pypi:`pytest-stoq` A plugin to pytest stoq Feb 09, 2021 4 - Beta N/A - :pypi:`pytest-stress` A Pytest plugin that allows you to loop tests for a user defined amount of time. Dec 07, 2019 4 - Beta pytest (>=3.6.0) - :pypi:`pytest-structlog` Structured logging assertions Dec 18, 2022 N/A pytest - :pypi:`pytest-structmpd` provide structured temporary directory Oct 17, 2018 N/A N/A - :pypi:`pytest-stub` Stub packages, modules and attributes. Apr 28, 2020 5 - Production/Stable N/A - :pypi:`pytest-stubprocess` Provide stub implementations for subprocesses in Python tests Sep 17, 2018 3 - Alpha pytest (>=3.5.0) - :pypi:`pytest-study` A pytest plugin to organize long run tests (named studies) without interfering the regular tests Sep 26, 2017 3 - Alpha pytest (>=2.0) - :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Jan 28, 2023 5 - Production/Stable pytest (>=4.0.0) - :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Jul 16, 2022 N/A N/A - :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Feb 16, 2023 4 - Beta pytest (>=7.0) - :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A - :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Nov 05, 2022 3 - Alpha pytest (>=2.9) - :pypi:`pytest-svn` SVN repository fixture for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-symbols` pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. Nov 20, 2017 3 - Alpha N/A - :pypi:`pytest-system-statistics` Pytest plugin to track and report system usage statistics Feb 16, 2022 5 - Production/Stable pytest (>=6.0.0) - :pypi:`pytest-system-test-plugin` Pyst - Pytest System-Test Plugin Feb 03, 2022 N/A N/A - :pypi:`pytest-tagging` a pytest plugin to tag tests Oct 23, 2022 N/A pytest (>=7.1.3,<8.0.0) - :pypi:`pytest-takeltest` Fixtures for ansible, testinfra and molecule Feb 15, 2023 N/A N/A - :pypi:`pytest-talisker` Nov 28, 2021 N/A N/A - :pypi:`pytest-tap` Test Anything Protocol (TAP) reporting plugin for pytest Oct 27, 2021 5 - Production/Stable pytest (>=3.0) - :pypi:`pytest-tape` easy assertion with expected results saved to yaml files Mar 17, 2021 4 - Beta N/A - :pypi:`pytest-target` Pytest plugin for remote target orchestration. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) - :pypi:`pytest-tblineinfo` tblineinfo is a py.test plugin that insert the node id in the final py.test report when --tb=line option is used Dec 01, 2015 3 - Alpha pytest (>=2.0) - :pypi:`pytest-tcpclient` A pytest plugin for testing TCP clients Nov 16, 2022 N/A pytest (<8,>=7.1.3) - :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A - :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A - :pypi:`pytest-telegram-notifier` Telegram notification plugin for Pytest Feb 27, 2023 5 - Production/Stable N/A - :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-terra-fixt` Terraform and Terragrunt fixtures for pytest Sep 15, 2022 N/A pytest (==6.2.5) - :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Sep 01, 2022 N/A pytest (>=6.0) - :pypi:`pytest-terraform-fixture` generate terraform resources to use with pytest Nov 14, 2018 4 - Beta N/A - :pypi:`pytest-testbook` A plugin to run tests written in Jupyter notebook Dec 11, 2016 3 - Alpha N/A - :pypi:`pytest-testconfig` Test configuration plugin for pytest. Jan 11, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-testdirectory` A py.test plugin providing temporary directories in unit tests. Feb 21, 2022 5 - Production/Stable pytest - :pypi:`pytest-testdox` A testdox format reporter for pytest Apr 19, 2022 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-test-grouping` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Feb 01, 2023 5 - Production/Stable pytest (>=2.5) - :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A - :pypi:`pytest-testinfra` Test infrastructures Dec 01, 2022 5 - Production/Stable pytest (!=3.0.2) - :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Feb 27, 2023 4 - Beta pytest (<8,>=5) - :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) - :pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Mar 03, 2023 4 - Beta pytest (<8,>=5) - :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest - :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) - :pypi:`pytest-testrail2` A pytest plugin to upload results to TestRail. Feb 10, 2023 N/A pytest (<8.0,>=7.2.0) - :pypi:`pytest-testrail-api-client` TestRail Api Python Client Dec 14, 2021 N/A pytest - :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A - :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A - :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) - :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Aug 01, 2022 N/A pytest (>=6.2.5) - :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Aug 12, 2022 N/A N/A - :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest - :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A - :pypi:`pytest-testreport` Dec 01, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-testreport-new` Aug 15, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) - :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) - :pypi:`pytest-test-utils` Jul 14, 2022 N/A pytest (>=5) - :pypi:`pytest-tesults` Tesults plugin for pytest Dec 23, 2022 5 - Production/Stable pytest (>=3.5.0) - :pypi:`pytest-tezos` pytest-ligo Jan 16, 2020 4 - Beta N/A - :pypi:`pytest-th2-bdd` pytest_th2_bdd May 13, 2022 N/A N/A - :pypi:`pytest-thawgun` Pytest plugin for time travel May 26, 2020 3 - Alpha N/A - :pypi:`pytest-threadleak` Detects thread leaks Jul 03, 2022 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-tick` Ticking on tests Aug 31, 2021 5 - Production/Stable pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-timeit` A pytest plugin to time test function runs Oct 13, 2016 4 - Beta N/A - :pypi:`pytest-timeout` pytest plugin to abort hanging tests Jan 18, 2022 5 - Production/Stable pytest (>=5.0.0) - :pypi:`pytest-timeouts` Linux-only Pytest plugin to control durations of various test case execution phases Sep 21, 2019 5 - Production/Stable N/A - :pypi:`pytest-timer` A timer plugin for pytest Jun 02, 2021 N/A N/A - :pypi:`pytest-timestamper` Pytest plugin to add a timestamp prefix to the pytest output Jun 06, 2021 N/A N/A - :pypi:`pytest-timestamps` A simple plugin to view timestamps for each test Jan 16, 2022 N/A pytest (>=5.2) - :pypi:`pytest-tipsi-django` Nov 17, 2021 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-tipsi-testing` Better fixtures management. Various helpers Nov 04, 2020 4 - Beta pytest (>=3.3.0) - :pypi:`pytest-tldr` A pytest plugin that limits the output to just the things you need. Oct 26, 2022 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-tm4j-reporter` Cloud Jira Test Management (TM4J) PyTest reporter plugin Sep 01, 2020 N/A pytest - :pypi:`pytest-tmnet` A small example package Mar 01, 2022 N/A N/A - :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest - :pypi:`pytest-tmpfs` A pytest plugin that helps you on using a temporary filesystem for testing. Aug 29, 2022 N/A pytest - :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Aug 12, 2022 N/A N/A - :pypi:`pytest-tmux` A pytest plugin that enables tmux driven tests Feb 15, 2023 4 - Beta N/A - :pypi:`pytest-todo` A small plugin for the pytest testing framework, marking TODO comments as failure May 23, 2019 4 - Beta pytest - :pypi:`pytest-tomato` Mar 01, 2019 5 - Production/Stable N/A - :pypi:`pytest-toolbelt` This is just a collection of utilities for pytest, but don't really belong in pytest proper. Aug 12, 2019 3 - Alpha N/A - :pypi:`pytest-toolbox` Numerous useful plugins for pytest. Apr 07, 2018 N/A pytest (>=3.5.0) - :pypi:`pytest-tools` Pytest tools Oct 21, 2022 4 - Beta N/A - :pypi:`pytest-tornado` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Jun 17, 2020 5 - Production/Stable pytest (>=3.6) - :pypi:`pytest-tornado5` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Nov 16, 2018 5 - Production/Stable pytest (>=3.6) - :pypi:`pytest-tornado-yen3` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Oct 15, 2018 5 - Production/Stable N/A - :pypi:`pytest-tornasync` py.test plugin for testing Python 3.5+ Tornado code Jul 15, 2019 3 - Alpha pytest (>=3.0) - :pypi:`pytest-trace` Save OpenTelemetry spans generated during testing Jun 19, 2022 N/A pytest (>=4.6) - :pypi:`pytest-track` Feb 26, 2021 3 - Alpha pytest (>=3.0) - :pypi:`pytest-translations` Test your translation files. Nov 05, 2021 5 - Production/Stable N/A - :pypi:`pytest-travis-fold` Folds captured output sections in Travis CI build log Nov 29, 2017 4 - Beta pytest (>=2.6.0) - :pypi:`pytest-trello` Plugin for py.test that integrates trello using markers Nov 20, 2015 5 - Production/Stable N/A - :pypi:`pytest-trepan` Pytest plugin for trepan debugger. Jul 28, 2018 5 - Production/Stable N/A - :pypi:`pytest-trialtemp` py.test plugin for using the same _trial_temp working directory as trial Jun 08, 2015 N/A N/A - :pypi:`pytest-trio` Pytest plugin for trio Nov 01, 2022 N/A pytest (>=7.2.0) - :pypi:`pytest-trytond` Pytest plugin for the Tryton server framework Nov 04, 2022 4 - Beta pytest (>=5) - :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Apr 27, 2022 N/A pytest (>=5.0.0) - :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A - :pypi:`pytest-tui` Text User Interface (TUI) and HTML report for Pytest test runs Feb 01, 2023 4 - Beta pytest (>=6.2.5) - :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A - :pypi:`pytest-twisted` A twisted plugin for pytest. Oct 16, 2022 5 - Production/Stable pytest (>=2.3) - :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) - :pypi:`pytest-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A - :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Nov 04, 2022 4 - Beta N/A - :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) - :pypi:`pytest-ubersmith` Easily mock calls to ubersmith at the \`requests\` level. Apr 13, 2015 N/A N/A - :pypi:`pytest-ui` Text User Interface for running python tests Jul 05, 2021 4 - Beta pytest - :pypi:`pytest-ui-failed-screenshot` UI自动测试失败时自动截图,并将截图加入到测试报告中 Dec 06, 2022 N/A N/A - :pypi:`pytest-ui-failed-screenshot-allure` UI自动测试失败时自动截图,并将截图加入到Allure测试报告中 Dec 06, 2022 N/A N/A - :pypi:`pytest-unflakable` Unflakable plugin for PyTest Oct 26, 2022 4 - Beta pytest (>=6.2.0) - :pypi:`pytest-unhandled-exception-exit-code` Plugin for py.test set a different exit code on uncaught exceptions Jun 22, 2020 5 - Production/Stable pytest (>=2.3) - :pypi:`pytest-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) - :pypi:`pytest-unmarked` Run only unmarked tests Aug 27, 2019 5 - Production/Stable N/A - :pypi:`pytest-unordered` Test equality of unordered collections in pytest Nov 28, 2022 4 - Beta pytest (>=6.0.0) - :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Sep 27, 2022 4 - Beta N/A - :pypi:`pytest-upload-report` pytest-upload-report is a plugin for pytest that upload your test report for test results. Jun 18, 2021 5 - Production/Stable N/A - :pypi:`pytest-utils` Some helpers for pytest. Feb 02, 2023 4 - Beta pytest (>=7.0.0,<8.0.0) - :pypi:`pytest-vagrant` A py.test plugin providing access to vagrant. Sep 07, 2021 5 - Production/Stable pytest - :pypi:`pytest-valgrind` May 19, 2021 N/A N/A - :pypi:`pytest-variables` pytest plugin for providing variables to tests/fixtures Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) - :pypi:`pytest-variant` Variant support for Pytest Jun 06, 2022 N/A N/A - :pypi:`pytest-vcr` Plugin for managing VCR.py cassettes Apr 26, 2019 5 - Production/Stable pytest (>=3.6.0) - :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Jun 20, 2022 5 - Production/Stable pytest (>=6.2.2) - :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest - :pypi:`pytest-vcs` Sep 22, 2022 4 - Beta N/A - :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest - :pypi:`pytest-ver` Pytest module with Verification Protocol, Verification Report and Trace Matrix Mar 04, 2023 2 - Pre-Alpha N/A - :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) - :pypi:`pytest-virtualenv` Virtualenv fixture for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-vnc` VNC client for Pytest Feb 25, 2023 N/A pytest - :pypi:`pytest-voluptuous` Pytest plugin for asserting data against voluptuous schema. Jun 09, 2020 N/A pytest - :pypi:`pytest-vscodedebug` A pytest plugin to easily enable debugging tests within Visual Studio Code Dec 04, 2020 4 - Beta N/A - :pypi:`pytest-vscode-pycharm-cls` A PyTest helper to enable start remote debugger on test start or failure or when pytest.set_trace is used. Feb 01, 2023 N/A pytest - :pypi:`pytest-vts` pytest plugin for automatic recording of http stubbed tests Jun 05, 2019 N/A pytest (>=2.3) - :pypi:`pytest-vulture` A pytest plugin to checks dead code with vulture Oct 12, 2022 N/A pytest (>=7.0.0) - :pypi:`pytest-vw` pytest-vw makes your failing test cases succeed under CI tools scrutiny Oct 07, 2015 4 - Beta N/A - :pypi:`pytest-vyper` Plugin for the vyper smart contract language. May 28, 2020 2 - Pre-Alpha N/A - :pypi:`pytest-wa-e2e-plugin` Pytest plugin for testing whatsapp bots with end to end tests Feb 18, 2020 4 - Beta pytest (>=3.5.0) - :pypi:`pytest-wake` Feb 27, 2023 N/A pytest - :pypi:`pytest-watch` Local continuous test runner with pytest and watchdog. May 20, 2018 N/A N/A - :pypi:`pytest-watcher` Continiously runs pytest on changes in \*.py files Dec 11, 2022 3 - Alpha N/A - :pypi:`pytest-wdl` Pytest plugin for testing WDL workflows. Nov 17, 2020 5 - Production/Stable N/A - :pypi:`pytest-web3-data` Sep 15, 2022 4 - Beta pytest - :pypi:`pytest-webdriver` Selenium webdriver fixture for py.test May 28, 2019 5 - Production/Stable pytest - :pypi:`pytest-wetest` Welian API Automation test framework pytest plugin Nov 10, 2018 4 - Beta N/A - :pypi:`pytest-whirlwind` Testing Tornado. Jun 12, 2020 N/A N/A - :pypi:`pytest-wholenodeid` pytest addon for displaying the whole node id for failures Aug 26, 2015 4 - Beta pytest (>=2.0) - :pypi:`pytest-win32consoletitle` Pytest progress in console title (Win32 only) Aug 08, 2021 N/A N/A - :pypi:`pytest-winnotify` Windows tray notifications for py.test results. Apr 22, 2016 N/A N/A - :pypi:`pytest-wiremock` A pytest plugin for programmatically using wiremock in integration tests Mar 27, 2022 N/A pytest (>=7.1.1,<8.0.0) - :pypi:`pytest-with-docker` pytest with docker helpers. Nov 09, 2021 N/A pytest - :pypi:`pytest-workflow` A pytest plugin for configuring workflow/pipeline tests using YAML files Jan 13, 2023 5 - Production/Stable pytest (>=7.0.0) - :pypi:`pytest-xdist` pytest xdist plugin for distributed testing, most importantly across multiple CPUs Feb 07, 2023 5 - Production/Stable pytest (>=6.2.0) - :pypi:`pytest-xdist-debug-for-graingert` pytest xdist plugin for distributed testing and loop-on-failing modes Jul 24, 2019 5 - Production/Stable pytest (>=4.4.0) - :pypi:`pytest-xdist-forked` forked from pytest-xdist Feb 10, 2020 5 - Production/Stable pytest (>=4.4.0) - :pypi:`pytest-xdist-tracker` pytest plugin helps to reproduce failures for particular xdist node Nov 18, 2021 3 - Alpha pytest (>=3.5.1) - :pypi:`pytest-xfaillist` Maintain a xfaillist in an additional file to avoid merge-conflicts. Sep 17, 2021 N/A pytest (>=6.2.2,<7.0.0) - :pypi:`pytest-xfiles` Pytest fixtures providing data read from function, module or package related (x)files. Feb 27, 2018 N/A N/A - :pypi:`pytest-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A - :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Mar 01, 2023 N/A pytest>=7.2.0 - :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest - :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Jan 05, 2023 4 - Beta pytest (>=2.8) - :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A - :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) - :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) - :pypi:`pytest-xskynet` A package to prevent Dependency Confusion attacks against Yandex. Feb 10, 2023 N/A N/A - :pypi:`pytest-xvfb` A pytest plugin to run Xvfb for tests. Jun 09, 2020 4 - Beta pytest (>=2.8.1) - :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest - :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-yamlwsgi` Run tests against wsgi apps defined in yaml May 11, 2010 N/A N/A - :pypi:`pytest-yaml-yoyo` http/https API run by yaml Feb 17, 2023 N/A pytest (==7.2.0) - :pypi:`pytest-yapf` Run yapf Jul 06, 2017 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) - :pypi:`pytest-yield` PyTest plugin to run tests concurrently, each \`yield\` switch context to other one Jan 23, 2019 N/A N/A - :pypi:`pytest-yls` Pytest plugin to test the YLS as a whole. Feb 22, 2023 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A pytest>=5.0.0 - :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) - :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A - :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Dec 12, 2022 5 - Production/Stable pytest (>=4.5.0) - :pypi:`pytest-zest` Zesty additions to pytest. Nov 17, 2022 N/A N/A - :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) - :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest - =============================================== ============================================================================================================================================================================ ============== ===================== ================================================ + =============================================== ======================================================================================================================================================================================================== ============== ===================== ================================================ + name summary last release status requires + =============================================== ======================================================================================================================================================================================================== ============== ===================== ================================================ + :pypi:`pytest-abstracts` A contextmanager pytest fixture for handling multiple mock abstracts May 25, 2022 N/A N/A + :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Dec 21, 2022 N/A pytest (>=6,<8) + :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Oct 13, 2022 N/A pytest (>=5.4.0) + :pypi:`pytest-addons-test` 用于测试pytest的插件 Aug 02, 2021 N/A pytest (>=6.2.4,<7.0.0) + :pypi:`pytest-adf` Pytest plugin for writing Azure Data Factory integration tests May 10, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-adf-azure-identity` Pytest plugin for writing Azure Data Factory integration tests Mar 06, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-ads-testplan` Azure DevOps Test Case reporting for pytest tests Sep 15, 2022 N/A N/A + :pypi:`pytest-agent` Service that exposes a REST API that can be used to interract remotely with Pytest. It is shipped with a dashboard that enables running tests in a more convenient way. Nov 25, 2021 N/A N/A + :pypi:`pytest-aggreport` pytest plugin for pytest-repeat that generate aggregate report of the same test cases with additional statistics details. Mar 07, 2021 4 - Beta pytest (>=6.2.2) + :pypi:`pytest-aio` Pytest plugin for testing async python code Feb 03, 2023 4 - Beta pytest + :pypi:`pytest-aiofiles` pytest fixtures for writing aiofiles tests with pyfakefs May 14, 2017 5 - Production/Stable N/A + :pypi:`pytest-aiohttp` Pytest plugin for aiohttp support Feb 12, 2022 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-aiohttp-client` Pytest \`client\` fixture for the Aiohttp Jan 10, 2023 N/A pytest (>=7.2.0,<8.0.0) + :pypi:`pytest-aiomoto` pytest-aiomoto Nov 09, 2022 N/A pytest (>=7.0,<8.0) + :pypi:`pytest-aioresponses` py.test integration for aioresponses Jul 29, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-aioworkers` A plugin to test aioworkers project with pytest Dec 04, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-airflow` pytest support for airflow. Apr 03, 2019 3 - Alpha pytest (>=4.4.0) + :pypi:`pytest-airflow-utils` Nov 15, 2021 N/A N/A + :pypi:`pytest-alembic` A pytest plugin for verifying alembic migrations. Feb 03, 2023 N/A pytest (>=6.0) + :pypi:`pytest-allclose` Pytest fixture extending Numpy's allclose function Jul 30, 2019 5 - Production/Stable pytest + :pypi:`pytest-allure-adaptor` Plugin for py.test to generate allure xml reports Jan 10, 2018 N/A pytest (>=2.7.3) + :pypi:`pytest-allure-adaptor2` Plugin for py.test to generate allure xml reports Oct 14, 2020 N/A pytest (>=2.7.3) + :pypi:`pytest-allure-collection` pytest plugin to collect allure markers without running any tests Oct 21, 2022 N/A pytest + :pypi:`pytest-allure-dsl` pytest plugin to test case doc string dls instructions Oct 25, 2020 4 - Beta pytest + :pypi:`pytest-allure-intersection` Oct 27, 2022 N/A pytest (<5) + :pypi:`pytest-allure-spec-coverage` The pytest plugin aimed to display test coverage of the specs(requirements) in Allure Oct 26, 2021 N/A pytest + :pypi:`pytest-alphamoon` Static code checks used at Alphamoon Dec 30, 2021 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-android` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Feb 21, 2019 3 - Alpha pytest + :pypi:`pytest-anki` A pytest plugin for testing Anki add-ons Jul 31, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-annotate` pytest-annotate: Generate PyAnnotate annotations from your pytest tests. Jun 07, 2022 3 - Alpha pytest (<8.0.0,>=3.2.0) + :pypi:`pytest-ansible` Plugin for py.test to simplify calling ansible modules from tests or fixtures May 25, 2021 5 - Production/Stable N/A + :pypi:`pytest-ansible-playbook` Pytest fixture which runs given ansible playbook file. Mar 08, 2019 4 - Beta N/A + :pypi:`pytest-ansible-playbook-runner` Pytest fixture which runs given ansible playbook file. Dec 02, 2020 4 - Beta pytest (>=3.1.0) + :pypi:`pytest-ansible-units` A pytest plugin for running unit tests within an ansible collection Apr 14, 2022 N/A N/A + :pypi:`pytest-antilru` Bust functools.lru_cache when running pytest to avoid test pollution Jul 05, 2022 5 - Production/Stable pytest + :pypi:`pytest-anyio` The pytest anyio plugin is built into anyio. You don't need this package. Jun 29, 2021 N/A pytest + :pypi:`pytest-anything` Pytest fixtures to assert anything and something Oct 13, 2022 N/A pytest + :pypi:`pytest-aoc` Downloads puzzle inputs for Advent of Code and synthesizes PyTest fixtures Dec 08, 2022 N/A pytest ; extra == 'test' + :pypi:`pytest-aoreporter` pytest report Jun 27, 2022 N/A N/A + :pypi:`pytest-api` An ASGI middleware to populate OpenAPI Specification examples from pytest functions May 12, 2022 N/A pytest (>=7.1.1,<8.0.0) + :pypi:`pytest-api-soup` Validate multiple endpoints with unit testing using a single source of truth. Aug 27, 2022 N/A N/A + :pypi:`pytest-apistellar` apistellar plugin for pytest. Jun 18, 2019 N/A N/A + :pypi:`pytest-appengine` AppEngine integration that works well with pytest-django Feb 27, 2017 N/A N/A + :pypi:`pytest-appium` Pytest plugin for appium Dec 05, 2019 N/A N/A + :pypi:`pytest-approvaltests` A plugin to use approvaltests with pytest May 08, 2022 4 - Beta pytest (>=7.0.1) + :pypi:`pytest-approvaltests-geo` Extension for ApprovalTests.Python specific to geo data verification Mar 04, 2023 5 - Production/Stable pytest + :pypi:`pytest-archon` Rule your architecture like a real developer Jan 31, 2023 5 - Production/Stable pytest (>=7.2) + :pypi:`pytest-argus` pyest results colection plugin Jun 24, 2021 5 - Production/Stable pytest (>=6.2.4) + :pypi:`pytest-arraydiff` pytest plugin to help with comparing array output from tests Jan 13, 2022 4 - Beta pytest (>=4.6) + :pypi:`pytest-asgi-server` Convenient ASGI client/server fixtures for Pytest Dec 12, 2020 N/A pytest (>=5.4.1) + :pypi:`pytest-asptest` test Answer Set Programming programs Apr 28, 2018 4 - Beta N/A + :pypi:`pytest-assertcount` Plugin to count actual number of asserts in pytest Oct 23, 2022 N/A pytest (>=5.0.0) + :pypi:`pytest-assertions` Pytest Assertions Apr 27, 2022 N/A N/A + :pypi:`pytest-assertutil` pytest-assertutil May 10, 2019 N/A N/A + :pypi:`pytest-assert-utils` Useful assertion utilities for use with pytest Apr 14, 2022 3 - Alpha N/A + :pypi:`pytest-assume` A pytest plugin that allows multiple failures per test Jun 24, 2021 N/A pytest (>=2.7) + :pypi:`pytest-assurka` A pytest plugin for Assurka Studio Aug 04, 2022 N/A N/A + :pypi:`pytest-ast-back-to-python` A plugin for pytest devs to view how assertion rewriting recodes the AST Sep 29, 2019 4 - Beta N/A + :pypi:`pytest-asteroid` PyTest plugin for docker-based testing on database images Aug 15, 2022 N/A pytest (>=6.2.5,<8.0.0) + :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Sep 06, 2022 3 - Alpha pytest (>=4.6) + :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest + :pypi:`pytest-asyncio` Pytest support for asyncio Dec 08, 2022 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Feb 10, 2023 N/A N/A + :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) + :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) + :pypi:`pytest-async-sqlalchemy` Database testing fixtures using the SQLAlchemy asyncio API Oct 07, 2021 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-atomic` Skip rest of tests if previous test failed. Nov 24, 2018 4 - Beta N/A + :pypi:`pytest-attrib` pytest plugin to select tests based on attributes similar to the nose-attrib plugin May 24, 2016 4 - Beta N/A + :pypi:`pytest-austin` Austin plugin for pytest Oct 11, 2020 4 - Beta N/A + :pypi:`pytest-autocap` automatically capture test & fixture stdout/stderr to files May 15, 2022 N/A pytest (<7.2,>=7.1.2) + :pypi:`pytest-autochecklog` automatically check condition and log all the checks Apr 25, 2015 4 - Beta N/A + :pypi:`pytest-automation` pytest plugin for building a test suite, using YAML files to extend pytest parameterize functionality. May 20, 2022 N/A pytest (>=7.0.0) + :pypi:`pytest-automock` Pytest plugin for automatical mocks creation Aug 04, 2022 N/A pytest ; extra == 'dev' + :pypi:`pytest-auto-parametrize` pytest plugin: avoid repeating arguments in parametrize Oct 02, 2016 3 - Alpha N/A + :pypi:`pytest-autotest` This fixture provides a configured "driver" for Android Automated Testing, using uiautomator2. Aug 25, 2021 N/A pytest + :pypi:`pytest-aviator` Aviator's Flakybot pytest plugin that automatically reruns flaky tests. Nov 04, 2022 4 - Beta pytest + :pypi:`pytest-avoidance` Makes pytest skip tests that don not need rerunning May 23, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-aws` pytest plugin for testing AWS resource configurations Oct 04, 2017 4 - Beta N/A + :pypi:`pytest-aws-config` Protect your AWS credentials in unit tests May 28, 2021 N/A N/A + :pypi:`pytest-axe` pytest plugin for axe-selenium-python Nov 12, 2018 N/A pytest (>=3.0.0) + :pypi:`pytest-azure` Pytest utilities and mocks for Azure Jan 18, 2023 3 - Alpha pytest + :pypi:`pytest-azure-devops` Simplifies using azure devops parallel strategy (https://docs.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner) with pytest. Jun 20, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-azurepipelines` Formatting PyTest output for Azure Pipelines UI Oct 20, 2022 5 - Production/Stable pytest (>=5.0.0) + :pypi:`pytest-bandit` A bandit plugin for pytest Feb 23, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-bandit-xayon` A bandit plugin for pytest Oct 17, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-base-url` pytest plugin for URL based testing Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) + :pypi:`pytest-bdd` BDD for pytest Nov 08, 2022 6 - Mature pytest (>=6.2.0) + :pypi:`pytest-bdd-html` pytest plugin to display BDD info in HTML test report Nov 22, 2022 3 - Alpha pytest (!=6.0.0,>=5.0) + :pypi:`pytest-bdd-ng` BDD for pytest Oct 06, 2022 4 - Beta pytest (>=5.0) + :pypi:`pytest-bdd-splinter` Common steps for pytest bdd and splinter integration Aug 12, 2019 5 - Production/Stable pytest (>=4.0.0) + :pypi:`pytest-bdd-web` A simple plugin to use with pytest Jan 02, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-bdd-wrappers` Feb 11, 2020 2 - Pre-Alpha N/A + :pypi:`pytest-beakerlib` A pytest plugin that reports test results to the BeakerLib framework Mar 17, 2017 5 - Production/Stable pytest + :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A + :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A + :pypi:`pytest-benchmark` A \`\`pytest\`\` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer. Oct 25, 2022 5 - Production/Stable pytest (>=3.8) + :pypi:`pytest-bg-process` Pytest plugin to initialize background process Jan 24, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-bigchaindb` A BigchainDB plugin for pytest. Jan 24, 2022 4 - Beta N/A + :pypi:`pytest-bigquery-mock` Provides a mock fixture for python bigquery client Dec 28, 2022 N/A pytest (>=5.0) + :pypi:`pytest-black` A pytest plugin to enable format checking with black Oct 05, 2020 4 - Beta N/A + :pypi:`pytest-black-multipy` Allow '--black' on older Pythons Jan 14, 2021 5 - Production/Stable pytest (!=3.7.3,>=3.5) ; extra == 'testing' + :pypi:`pytest-black-ng` A pytest plugin to enable format checking with black Oct 20, 2022 4 - Beta pytest (>=7.0.0) + :pypi:`pytest-blame` A pytest plugin helps developers to debug by providing useful commits history. May 04, 2019 N/A pytest (>=4.4.0) + :pypi:`pytest-blender` Blender Pytest plugin. Jan 04, 2023 N/A pytest ; extra == 'dev' + :pypi:`pytest-blink1` Pytest plugin to emit notifications via the Blink(1) RGB LED Jan 07, 2018 4 - Beta N/A + :pypi:`pytest-blockage` Disable network requests during a test run. Dec 21, 2021 N/A pytest + :pypi:`pytest-blocker` pytest plugin to mark a test as blocker and skip all other tests Sep 07, 2015 4 - Beta N/A + :pypi:`pytest-blue` A pytest plugin that adds a \`blue\` fixture for printing stuff in blue. Sep 05, 2022 N/A N/A + :pypi:`pytest-board` Local continuous test runner with pytest and watchdog. Jan 20, 2019 N/A N/A + :pypi:`pytest-boost-xml` Plugin for pytest to generate boost xml reports Nov 30, 2022 4 - Beta N/A + :pypi:`pytest-bootstrap` Mar 04, 2022 N/A N/A + :pypi:`pytest-bpdb` A py.test plug-in to enable drop to bpdb debugger on test failure. Jan 19, 2015 2 - Pre-Alpha N/A + :pypi:`pytest-bravado` Pytest-bravado automatically generates from OpenAPI specification client fixtures. Feb 15, 2022 N/A N/A + :pypi:`pytest-breakword` Use breakword with pytest Aug 04, 2021 N/A pytest (>=6.2.4,<7.0.0) + :pypi:`pytest-breed-adapter` A simple plugin to connect with breed-server Nov 07, 2018 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-briefcase` A pytest plugin for running tests on a Briefcase project. Jun 14, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-browser` A pytest plugin for console based browser test selection just after the collection phase Dec 10, 2016 3 - Alpha N/A + :pypi:`pytest-browsermob-proxy` BrowserMob proxy plugin for py.test. Jun 11, 2013 4 - Beta N/A + :pypi:`pytest-browserstack-local` \`\`py.test\`\` plugin to run \`\`BrowserStackLocal\`\` in background. Feb 09, 2018 N/A N/A + :pypi:`pytest-budosystems` Budo Systems is a martial arts school management system. This module is the Budo Systems Pytest Plugin. Feb 14, 2023 3 - Alpha pytest + :pypi:`pytest-bug` Pytest plugin for marking tests as a bug Jan 29, 2023 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-bugtong-tag` pytest-bugtong-tag is a plugin for pytest Jan 16, 2022 N/A N/A + :pypi:`pytest-bugzilla` py.test bugzilla integration plugin May 05, 2010 4 - Beta N/A + :pypi:`pytest-bugzilla-notifier` A plugin that allows you to execute create, update, and read information from BugZilla bugs Jun 15, 2018 4 - Beta pytest (>=2.9.2) + :pypi:`pytest-buildkite` Plugin for pytest that automatically publishes coverage and pytest report annotations to Buildkite. Jul 13, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-builtin-types` Nov 17, 2021 N/A pytest + :pypi:`pytest-bwrap` Run your tests in Bubblewrap sandboxes Oct 26, 2018 3 - Alpha N/A + :pypi:`pytest-cache` pytest plugin with mechanisms for caching across test runs Jun 04, 2013 3 - Alpha N/A + :pypi:`pytest-cache-assert` Cache assertion data to simplify regression testing of complex serializable data Feb 26, 2023 5 - Production/Stable pytest (>=5.0.0) + :pypi:`pytest-cagoule` Pytest plugin to only run tests affected by changes Jan 01, 2020 3 - Alpha N/A + :pypi:`pytest-cairo` Pytest support for cairo-lang and starknet Apr 17, 2022 N/A pytest + :pypi:`pytest-call-checker` Small pytest utility to easily create test doubles Oct 16, 2022 4 - Beta pytest (>=7.1.3,<8.0.0) + :pypi:`pytest-camel-collect` Enable CamelCase-aware pytest class collection Aug 02, 2020 N/A pytest (>=2.9) + :pypi:`pytest-canonical-data` A plugin which allows to compare results with canonical results, based on previous runs May 08, 2020 2 - Pre-Alpha pytest (>=3.5.0) + :pypi:`pytest-caprng` A plugin that replays pRNG state on failure. May 02, 2018 4 - Beta N/A + :pypi:`pytest-capture-deprecatedwarnings` pytest plugin to capture all deprecatedwarnings and put them in one file Apr 30, 2019 N/A N/A + :pypi:`pytest-capture-warnings` pytest plugin to capture all warnings and put them in one file of your choice May 03, 2022 N/A pytest + :pypi:`pytest-cases` Separate test code from test cases in pytest. Feb 23, 2023 5 - Production/Stable N/A + :pypi:`pytest-cassandra` Cassandra CCM Test Fixtures for pytest Nov 04, 2017 1 - Planning N/A + :pypi:`pytest-catchlog` py.test plugin to catch log messages. This is a fork of pytest-capturelog. Jan 24, 2016 4 - Beta pytest (>=2.6) + :pypi:`pytest-catch-server` Pytest plugin with server for catching HTTP requests. Dec 12, 2019 5 - Production/Stable N/A + :pypi:`pytest-celery` pytest-celery a shim pytest plugin to enable celery.contrib.pytest May 06, 2021 N/A N/A + :pypi:`pytest-chainmaker` pytest plugin for chainmaker Oct 15, 2021 N/A N/A + :pypi:`pytest-chalice` A set of py.test fixtures for AWS Chalice Jul 01, 2020 4 - Beta N/A + :pypi:`pytest-change-assert` 修改报错中文为英文 Oct 19, 2022 N/A N/A + :pypi:`pytest-change-demo` turn . into √,turn F into x Mar 02, 2022 N/A pytest + :pypi:`pytest-change-report` turn . into √,turn F into x Sep 14, 2020 N/A pytest + :pypi:`pytest-change-xds` turn . into √,turn F into x Apr 16, 2022 N/A pytest + :pypi:`pytest-chdir` A pytest fixture for changing current working directory Jan 28, 2020 N/A pytest (>=5.0.0,<6.0.0) + :pypi:`pytest-check` A pytest plugin that allows multiple failures per test. Feb 13, 2023 5 - Production/Stable pytest + :pypi:`pytest-checkdocs` check the README when running tests Oct 09, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-checkipdb` plugin to check if there are ipdb debugs left Jul 22, 2020 5 - Production/Stable pytest (>=2.9.2) + :pypi:`pytest-check-library` check your missing library Jul 17, 2022 N/A N/A + :pypi:`pytest-check-libs` check your missing library Jul 17, 2022 N/A N/A + :pypi:`pytest-check-links` Check links in files Jul 29, 2020 N/A pytest>=7.0 + :pypi:`pytest-check-mk` pytest plugin to test Check_MK checks Nov 19, 2015 4 - Beta pytest + :pypi:`pytest-check-requirements` A package to prevent Dependency Confusion attacks against Yandex. Feb 10, 2023 N/A N/A + :pypi:`pytest-chic-report` A pytest plugin to send a report and printing summary of tests. Jan 31, 2023 5 - Production/Stable N/A + :pypi:`pytest-chunks` Run only a chunk of your test suite Jul 05, 2022 N/A pytest (>=6.0.0) + :pypi:`pytest-circleci` py.test plugin for CircleCI May 03, 2019 N/A N/A + :pypi:`pytest-circleci-parallelized` Parallelize pytest across CircleCI workers. Oct 20, 2022 N/A N/A + :pypi:`pytest-circleci-parallelized-rjp` Parallelize pytest across CircleCI workers. Jun 21, 2022 N/A pytest + :pypi:`pytest-ckan` Backport of CKAN 2.9 pytest plugin and fixtures to CAKN 2.8 Apr 28, 2020 4 - Beta pytest + :pypi:`pytest-clarity` A plugin providing an alternative, colourful diff output for failing assertions. Jun 11, 2021 N/A N/A + :pypi:`pytest-cldf` Easy quality control for CLDF datasets using pytest Nov 07, 2022 N/A pytest (>=3.6) + :pypi:`pytest-click` Pytest plugin for Click Feb 11, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-cli-fixtures` Automatically register fixtures for custom CLI arguments Jul 28, 2022 N/A pytest (~=7.0) + :pypi:`pytest-clld` Jul 06, 2022 N/A pytest (>=3.6) + :pypi:`pytest-cloud` Distributed tests planner plugin for pytest testing framework. Oct 05, 2020 6 - Mature N/A + :pypi:`pytest-cloudflare-worker` pytest plugin for testing cloudflare workers Mar 30, 2021 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-cloudist` Distribute tests to cloud machines without fuss Sep 02, 2022 4 - Beta pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-cmake` Provide CMake module for Pytest Jan 21, 2023 N/A pytest<8,>=4 + :pypi:`pytest-cmake-presets` Execute CMake Presets via pytest Dec 26, 2022 N/A pytest (>=7.2.0,<8.0.0) + :pypi:`pytest-cobra` PyTest plugin for testing Smart Contracts for Ethereum blockchain. Jun 29, 2019 3 - Alpha pytest (<4.0.0,>=3.7.1) + :pypi:`pytest-codecarbon` Pytest plugin for measuring carbon emissions Jun 15, 2022 N/A pytest + :pypi:`pytest-codecheckers` pytest plugin to add source code sanity checks (pep8 and friends) Feb 13, 2010 N/A N/A + :pypi:`pytest-codecov` Pytest plugin for uploading pytest-cov results to codecov.io Nov 29, 2022 4 - Beta pytest (>=4.6.0) + :pypi:`pytest-codegen` Automatically create pytest test signatures Aug 23, 2020 2 - Pre-Alpha N/A + :pypi:`pytest-codeowners` Pytest plugin for selecting tests by GitHub CODEOWNERS. Mar 30, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-codestyle` pytest plugin to run pycodestyle Mar 23, 2020 3 - Alpha N/A + :pypi:`pytest-codspeed` Pytest plugin to create CodSpeed benchmarks Dec 02, 2022 5 - Production/Stable pytest>=3.8 + :pypi:`pytest-collect-formatter` Formatter for pytest collect output Mar 29, 2021 5 - Production/Stable N/A + :pypi:`pytest-collect-formatter2` Formatter for pytest collect output May 31, 2021 5 - Production/Stable N/A + :pypi:`pytest-collector` Python package for collecting pytest. Aug 02, 2022 N/A pytest (>=7.0,<8.0) + :pypi:`pytest-colordots` Colorizes the progress indicators Oct 06, 2017 5 - Production/Stable N/A + :pypi:`pytest-commander` An interactive GUI test runner for PyTest Aug 17, 2021 N/A pytest (<7.0.0,>=6.2.4) + :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method May 15, 2022 N/A pytest (>=3.6,<8) + :pypi:`pytest-compare` pytest plugin for comparing call arguments. Feb 15, 2023 5 - Production/Stable pytest + :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-config` Base configurations and utilities for developing your Python project test suite with pytest. Nov 07, 2014 5 - Production/Stable N/A + :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Apr 17, 2022 N/A N/A + :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts Mar 18, 2022 4 - Beta N/A + :pypi:`pytest-consul` pytest plugin with fixtures for testing consul aware apps Nov 24, 2018 3 - Alpha pytest + :pypi:`pytest-container` Pytest fixtures for writing container based tests Feb 01, 2022 3 - Alpha pytest (>=3.10) + :pypi:`pytest-contextfixture` Define pytest fixtures as context managers. Mar 12, 2013 4 - Beta N/A + :pypi:`pytest-contexts` A plugin to run tests written with the Contexts framework using pytest May 19, 2021 4 - Beta N/A + :pypi:`pytest-cookies` The pytest plugin for your Cookiecutter templates. 🍪 May 24, 2021 5 - Production/Stable pytest (>=3.3.0) + :pypi:`pytest-couchdbkit` py.test extension for per-test couchdb databases using couchdbkit Apr 17, 2012 N/A N/A + :pypi:`pytest-count` count erros and send email Jan 12, 2018 4 - Beta N/A + :pypi:`pytest-cov` Pytest plugin for measuring coverage. Sep 28, 2022 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-cover` Pytest plugin for measuring coverage. Forked from \`pytest-cov\`. Aug 01, 2015 5 - Production/Stable N/A + :pypi:`pytest-coverage` Jun 17, 2015 N/A N/A + :pypi:`pytest-coverage-context` Coverage dynamic context support for PyTest, including sub-processes Jan 04, 2021 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-coveragemarkers` Using pytest markers to track functional coverage and filtering of tests Nov 29, 2022 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' + :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Jan 30, 2023 5 - Production/Stable pytest (>=7.0) + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Mar 11, 2023 N/A N/A + :pypi:`pytest-cqase` Custom qase pytest plugin Aug 22, 2022 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A + :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) + :pypi:`pytest-crayons` A pytest plugin for colorful print statements Feb 20, 2023 N/A pytest + :pypi:`pytest-create` pytest-create Feb 15, 2023 1 - Planning N/A + :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest + :pypi:`pytest-crontab` add crontab task in crontab Dec 09, 2019 N/A N/A + :pypi:`pytest-csv` CSV output for pytest. Apr 22, 2021 N/A pytest (>=6.0) + :pypi:`pytest-csv-params` Pytest plugin for Test Case Parametrization with CSV files Aug 28, 2022 5 - Production/Stable pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-curio` Pytest support for curio. Oct 07, 2020 N/A N/A + :pypi:`pytest-curl-report` pytest plugin to generate curl command line report Dec 11, 2016 4 - Beta N/A + :pypi:`pytest-custom-concurrency` Custom grouping concurrence for pytest Feb 08, 2021 N/A N/A + :pypi:`pytest-custom-exit-code` Exit pytest test session with custom exit code in different scenarios Aug 07, 2019 4 - Beta pytest (>=4.0.2) + :pypi:`pytest-custom-nodeid` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 07, 2021 N/A N/A + :pypi:`pytest-custom-report` Configure the symbols displayed for test outcomes Jan 30, 2019 N/A pytest + :pypi:`pytest-custom-scheduling` Custom grouping for pytest-xdist, rename test cases name and test cases nodeid, support allure report Mar 01, 2021 N/A N/A + :pypi:`pytest-cython` A plugin for testing Cython extension modules Feb 16, 2023 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-cython-collect` Jun 17, 2022 N/A pytest + :pypi:`pytest-darker` A pytest plugin for checking of modified code using Darker Aug 16, 2020 N/A pytest (>=6.0.1) ; extra == 'test' + :pypi:`pytest-dash` pytest fixtures to run dash applications. Mar 18, 2019 N/A N/A + :pypi:`pytest-data` Useful functions for managing data for pytest fixtures Nov 01, 2016 5 - Production/Stable N/A + :pypi:`pytest-databricks` Pytest plugin for remote Databricks notebooks testing Jul 29, 2020 N/A pytest + :pypi:`pytest-datadir` pytest plugin for test data directories and files Oct 25, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-datadir-mgr` Manager for test data: downloads, artifact caching, and a tmpdir context. Aug 16, 2022 5 - Production/Stable pytest (>=7.1) + :pypi:`pytest-datadir-ng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Dec 25, 2019 5 - Production/Stable pytest + :pypi:`pytest-datadir-nng` Fixtures for pytest allowing test functions/methods to easily retrieve test resources from the local filesystem. Nov 09, 2022 5 - Production/Stable pytest (>=7.0.0,<8.0.0) + :pypi:`pytest-data-extractor` A pytest plugin to extract relevant metadata about tests into an external file (currently only json support) Jul 19, 2022 N/A pytest (>=7.0.1) + :pypi:`pytest-data-file` Fixture "data" and "case_data" for test from yaml file Dec 04, 2019 N/A N/A + :pypi:`pytest-datafiles` py.test plugin to create a 'tmp_path' containing predefined files/directories. Feb 24, 2023 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-datafixtures` Data fixtures for pytest made simple Dec 05, 2020 5 - Production/Stable N/A + :pypi:`pytest-data-from-files` pytest plugin to provide data from files loaded automatically Oct 13, 2021 4 - Beta pytest + :pypi:`pytest-dataplugin` A pytest plugin for managing an archive of test data. Sep 16, 2017 1 - Planning N/A + :pypi:`pytest-datarecorder` A py.test plugin recording and comparing test output. Jan 08, 2023 5 - Production/Stable pytest + :pypi:`pytest-dataset` Plugin for loading different datasets for pytest by prefix from json or yaml files Oct 10, 2022 5 - Production/Stable N/A + :pypi:`pytest-data-suites` Class-based pytest parametrization Jul 24, 2022 N/A pytest (>=6.0,<8.0) + :pypi:`pytest-datatest` A pytest plugin for test driven data-wrangling (this is the development version of datatest's pytest integration). Oct 15, 2020 4 - Beta pytest (>=3.3) + :pypi:`pytest-db` Session scope fixture "db" for mysql query or change Dec 04, 2019 N/A N/A + :pypi:`pytest-dbfixtures` Databases fixtures plugin for py.test. Dec 07, 2016 4 - Beta N/A + :pypi:`pytest-db-plugin` Nov 27, 2021 N/A pytest (>=5.0) + :pypi:`pytest-dbt-adapter` A pytest plugin for testing dbt adapter plugins Nov 24, 2021 N/A pytest (<7,>=6) + :pypi:`pytest-dbt-conventions` A pytest plugin for linting a dbt project's conventions Mar 02, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-dbt-core` Pytest extension for dbt. Mar 01, 2023 N/A pytest (>=6.2.5) ; extra == 'test' + :pypi:`pytest-dbus-notification` D-BUS notifications for pytest results. Mar 05, 2014 5 - Production/Stable N/A + :pypi:`pytest-dbx` Pytest plugin to run unit tests for dbx (Databricks CLI extensions) related code Nov 29, 2022 N/A pytest (>=7.1.3,<8.0.0) + :pypi:`pytest-deadfixtures` A simple plugin to list unused fixtures in pytest Jul 23, 2020 5 - Production/Stable N/A + :pypi:`pytest-deepcov` deepcov Mar 30, 2021 N/A N/A + :pypi:`pytest-defer` Aug 24, 2021 N/A N/A + :pypi:`pytest-demo-plugin` pytest示例插件 May 15, 2021 N/A N/A + :pypi:`pytest-dependency` Manage dependencies of tests Feb 14, 2020 4 - Beta N/A + :pypi:`pytest-depends` Tests that depend on other tests Apr 05, 2020 5 - Production/Stable pytest (>=3) + :pypi:`pytest-deprecate` Mark tests as testing a deprecated feature with a warning note. Jul 01, 2019 N/A N/A + :pypi:`pytest-describe` Describe-style plugin for pytest Nov 13, 2021 4 - Beta pytest (>=4.0.0) + :pypi:`pytest-describe-it` plugin for rich text descriptions Jul 19, 2019 4 - Beta pytest + :pypi:`pytest-devpi-server` DevPI server fixture for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-dhos` Common fixtures for pytest in DHOS services and libraries Sep 07, 2022 N/A N/A + :pypi:`pytest-diamond` pytest plugin for diamond Aug 31, 2015 4 - Beta N/A + :pypi:`pytest-dicom` pytest plugin to provide DICOM fixtures Dec 19, 2018 3 - Alpha pytest + :pypi:`pytest-dictsdiff` Jul 26, 2019 N/A N/A + :pypi:`pytest-diff` A simple plugin to use with pytest Mar 30, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-diffeo` A package to prevent Dependency Confusion attacks against Yandex. Feb 10, 2023 N/A N/A + :pypi:`pytest-diff-selector` Get tests affected by code changes (using git) Feb 24, 2022 4 - Beta pytest (>=6.2.2) ; extra == 'all' + :pypi:`pytest-difido` PyTest plugin for generating Difido reports Oct 23, 2022 4 - Beta pytest (>=4.0.0) + :pypi:`pytest-disable` pytest plugin to disable a test and skip it from testrun Sep 10, 2015 4 - Beta N/A + :pypi:`pytest-disable-plugin` Disable plugins per test Feb 28, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. Feb 05, 2023 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) + :pypi:`pytest-django` A Django plugin for pytest. Dec 07, 2021 5 - Production/Stable pytest (>=5.4.0) + :pypi:`pytest-django-ahead` A Django plugin for pytest. Oct 27, 2016 5 - Production/Stable pytest (>=2.9) + :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Nov 09, 2022 4 - Beta N/A + :pypi:`pytest-django-cache-xdist` A djangocachexdist plugin for pytest May 12, 2020 4 - Beta N/A + :pypi:`pytest-django-casperjs` Integrate CasperJS with your django tests as a pytest fixture. Mar 15, 2015 2 - Pre-Alpha N/A + :pypi:`pytest-django-dotenv` Pytest plugin used to setup environment variables with django-dotenv Nov 26, 2019 4 - Beta pytest (>=2.6.0) + :pypi:`pytest-django-factories` Factories for your Django models that can be used as Pytest fixtures. Nov 12, 2020 4 - Beta N/A + :pypi:`pytest-django-filefield` Replaces FileField.storage with something you can patch globally. May 09, 2022 5 - Production/Stable pytest >= 5.2 + :pypi:`pytest-django-gcir` A Django plugin for pytest. Mar 06, 2018 5 - Production/Stable N/A + :pypi:`pytest-django-haystack` Cleanup your Haystack indexes between tests Sep 03, 2017 5 - Production/Stable pytest (>=2.3.4) + :pypi:`pytest-django-ifactory` A model instance factory for pytest-django Feb 09, 2022 3 - Alpha N/A + :pypi:`pytest-django-lite` The bare minimum to integrate py.test with Django. Jan 30, 2014 N/A N/A + :pypi:`pytest-django-liveserver-ssl` Jan 20, 2022 3 - Alpha N/A + :pypi:`pytest-django-model` A Simple Way to Test your Django Models Feb 14, 2019 4 - Beta N/A + :pypi:`pytest-django-ordering` A pytest plugin for preserving the order in which Django runs tests. Jul 25, 2019 5 - Production/Stable pytest (>=2.3.0) + :pypi:`pytest-django-queries` Generate performance reports from your django database performance tests. Mar 01, 2021 N/A N/A + :pypi:`pytest-djangorestframework` A djangorestframework plugin for pytest Aug 11, 2019 4 - Beta N/A + :pypi:`pytest-django-rq` A pytest plugin to help writing unit test for django-rq Apr 13, 2020 4 - Beta N/A + :pypi:`pytest-django-sqlcounts` py.test plugin for reporting the number of SQLs executed per django testcase. Jun 16, 2015 4 - Beta N/A + :pypi:`pytest-django-testing-postgresql` Use a temporary PostgreSQL database with pytest-django Jan 31, 2022 4 - Beta N/A + :pypi:`pytest-doc` A documentation plugin for py.test. Jun 28, 2015 5 - Production/Stable N/A + :pypi:`pytest-docfiles` pytest plugin to test codeblocks in your documentation. Dec 22, 2021 4 - Beta pytest (>=3.7.0) + :pypi:`pytest-docgen` An RST Documentation Generator for pytest-based test suites Apr 17, 2020 N/A N/A + :pypi:`pytest-docker` Simple pytest fixtures for Docker and docker-compose based tests Sep 14, 2022 N/A pytest (<8.0,>=4.0) + :pypi:`pytest-docker-apache-fixtures` Pytest fixtures for testing with apache2 (httpd). Feb 16, 2022 4 - Beta pytest + :pypi:`pytest-docker-butla` Jun 16, 2019 3 - Alpha N/A + :pypi:`pytest-dockerc` Run, manage and stop Docker Compose project from Docker API Oct 09, 2020 5 - Production/Stable pytest (>=3.0) + :pypi:`pytest-docker-compose` Manages Docker containers during your integration tests Jan 26, 2021 5 - Production/Stable pytest (>=3.3) + :pypi:`pytest-docker-db` A plugin to use docker databases for pytests Mar 20, 2021 5 - Production/Stable pytest (>=3.1.1) + :pypi:`pytest-docker-fixtures` pytest docker fixtures Nov 17, 2022 3 - Alpha N/A + :pypi:`pytest-docker-git-fixtures` Pytest fixtures for testing with git scm. Feb 09, 2022 4 - Beta pytest + :pypi:`pytest-docker-haproxy-fixtures` Pytest fixtures for testing with haproxy. Feb 09, 2022 4 - Beta pytest + :pypi:`pytest-docker-pexpect` pytest plugin for writing functional tests with pexpect and docker Jan 14, 2019 N/A pytest + :pypi:`pytest-docker-postgresql` A simple plugin to use with pytest Sep 24, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-docker-py` Easy to use, simple to extend, pytest plugin that minimally leverages docker-py. Nov 27, 2018 N/A pytest (==4.0.0) + :pypi:`pytest-docker-registry-fixtures` Pytest fixtures for testing with docker registries. Apr 08, 2022 4 - Beta pytest + :pypi:`pytest-docker-service` pytest plugin to start docker container Feb 22, 2023 3 - Alpha pytest (>=7.1.3) + :pypi:`pytest-docker-squid-fixtures` Pytest fixtures for testing with squid. Feb 09, 2022 4 - Beta pytest + :pypi:`pytest-docker-tools` Docker integration tests for pytest Feb 17, 2022 4 - Beta pytest (>=6.0.1) + :pypi:`pytest-docs` Documentation tool for pytest Nov 11, 2018 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-docstyle` pytest plugin to run pydocstyle Mar 23, 2020 3 - Alpha N/A + :pypi:`pytest-doctest-custom` A py.test plugin for customizing string representations of doctest results. Jul 25, 2016 4 - Beta N/A + :pypi:`pytest-doctest-ellipsis-markers` Setup additional values for ELLIPSIS_MARKER for doctests Jan 12, 2018 4 - Beta N/A + :pypi:`pytest-doctest-import` A simple pytest plugin to import names and add them to the doctest namespace. Nov 13, 2018 4 - Beta pytest (>=3.3.0) + :pypi:`pytest-doctestplus` Pytest plugin with advanced doctest features. Sep 26, 2022 3 - Alpha pytest (>=4.6) + :pypi:`pytest-dolphin` Some extra stuff that we use ininternally Nov 30, 2016 4 - Beta pytest (==3.0.4) + :pypi:`pytest-doorstop` A pytest plugin for adding test results into doorstop items. Jun 09, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-dotenv` A py.test plugin that parses environment files before running tests Jun 16, 2020 4 - Beta pytest (>=5.0.0) + :pypi:`pytest-drf` A Django REST framework plugin for pytest. Jul 12, 2022 5 - Production/Stable pytest (>=3.7) + :pypi:`pytest-drivings` Tool to allow webdriver automation to be ran locally or remotely Jan 13, 2021 N/A N/A + :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection May 23, 2020 4 - Beta pytest (>=2.7) + :pypi:`pytest-dummynet` A py.test plugin providing access to a dummynet. Dec 15, 2021 5 - Production/Stable pytest + :pypi:`pytest-dump2json` A pytest plugin for dumping test results to json. Jun 29, 2015 N/A N/A + :pypi:`pytest-duration-insights` Jun 25, 2021 N/A N/A + :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Apr 22, 2022 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-dynamicrerun` A pytest plugin to rerun tests dynamically based off of test outcome and output. Aug 15, 2020 4 - Beta N/A + :pypi:`pytest-dynamodb` DynamoDB fixtures for pytest Mar 03, 2023 5 - Production/Stable pytest + :pypi:`pytest-easy-addoption` pytest-easy-addoption: Easy way to work with pytest addoption Jan 22, 2020 N/A N/A + :pypi:`pytest-easy-api` Simple API testing with pytest Mar 26, 2018 N/A N/A + :pypi:`pytest-easyMPI` Package that supports mpi tests in pytest Oct 21, 2020 N/A N/A + :pypi:`pytest-easyread` pytest plugin that makes terminal printouts of the reports easier to read Nov 17, 2017 N/A N/A + :pypi:`pytest-easy-server` Pytest plugin for easy testing against servers May 01, 2021 4 - Beta pytest (<5.0.0,>=4.3.1) ; python_version < "3.5" + :pypi:`pytest-ebics-sandbox` A pytest plugin for testing against an EBICS sandbox server. Requires docker. Aug 15, 2022 N/A N/A + :pypi:`pytest-ec2` Pytest execution on EC2 instance Oct 22, 2019 3 - Alpha N/A + :pypi:`pytest-echo` pytest plugin with mechanisms for echoing environment variables, package version and generic attributes Jan 08, 2020 5 - Production/Stable N/A + :pypi:`pytest-ekstazi` Pytest plugin to select test using Ekstazi algorithm Sep 10, 2022 N/A pytest + :pypi:`pytest-elasticsearch` Elasticsearch fixtures and fixture factories for Pytest. Mar 01, 2022 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-elements` Tool to help automate user interfaces Jan 13, 2021 N/A pytest (>=5.4,<6.0) + :pypi:`pytest-eliot` An eliot plugin for pytest. Aug 31, 2022 1 - Planning pytest (>=5.4.0) + :pypi:`pytest-elk-reporter` A simple plugin to use with pytest Jan 24, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-email` Send execution result email Jul 08, 2020 N/A pytest + :pypi:`pytest-embedded` pytest embedded plugin Mar 10, 2023 N/A pytest (>=7.0) + :pypi:`pytest-embedded-arduino` pytest embedded plugin for Arduino projects Mar 10, 2023 N/A N/A + :pypi:`pytest-embedded-idf` pytest embedded plugin for esp-idf project Mar 10, 2023 N/A N/A + :pypi:`pytest-embedded-jtag` pytest embedded plugin for testing with jtag Mar 10, 2023 N/A N/A + :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Mar 10, 2023 N/A N/A + :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Mar 10, 2023 N/A N/A + :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Mar 10, 2023 N/A N/A + :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Oct 15, 2022 N/A pytest (>=7.0,<8.0) + :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) + :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) + :pypi:`pytest-enabler` Enable installed pytest plugins Jan 27, 2023 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-encode` set your encoding and logger Nov 06, 2021 N/A N/A + :pypi:`pytest-encode-kane` set your encoding and logger Nov 16, 2021 N/A pytest + :pypi:`pytest-enhanced-reports` Enhanced test reports for pytest Dec 15, 2022 N/A N/A + :pypi:`pytest-enhancements` Improvements for pytest (rejected upstream) Oct 30, 2019 4 - Beta N/A + :pypi:`pytest-env` py.test plugin that allows you to add environment variables. Oct 23, 2022 5 - Production/Stable pytest>=7.1.3 + :pypi:`pytest-envfiles` A py.test plugin that parses environment files before running tests Oct 08, 2015 3 - Alpha N/A + :pypi:`pytest-env-info` Push information about the running pytest into envvars Nov 25, 2017 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-envraw` py.test plugin that allows you to add environment variables. Aug 27, 2020 4 - Beta pytest (>=2.6.0) + :pypi:`pytest-envvars` Pytest plugin to validate use of envvars on your tests Jun 13, 2020 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-env-yaml` Apr 02, 2019 N/A N/A + :pypi:`pytest-eradicate` pytest plugin to check for commented out code Sep 08, 2020 N/A pytest (>=2.4.2) + :pypi:`pytest-error-for-skips` Pytest plugin to treat skipped tests a test failure Dec 19, 2019 4 - Beta pytest (>=4.6) + :pypi:`pytest-eth` PyTest plugin for testing Smart Contracts for Ethereum Virtual Machine (EVM). Aug 14, 2020 1 - Planning N/A + :pypi:`pytest-ethereum` pytest-ethereum: Pytest library for ethereum projects. Jun 24, 2019 3 - Alpha pytest (==3.3.2); extra == 'dev' + :pypi:`pytest-eucalyptus` Pytest Plugin for BDD Jun 28, 2022 N/A pytest (>=4.2.0) + :pypi:`pytest-eventlet` Applies eventlet monkey-patch as a pytest plugin. Oct 04, 2021 N/A pytest ; extra == 'dev' + :pypi:`pytest-excel` pytest plugin for generating excel reports Jan 31, 2022 5 - Production/Stable N/A + :pypi:`pytest-exceptional` Better exceptions Mar 16, 2017 4 - Beta N/A + :pypi:`pytest-exception-script` Walk your code through exception script to check it's resiliency to failures. Aug 04, 2020 3 - Alpha pytest + :pypi:`pytest-executable` pytest plugin for testing executables Nov 05, 2022 N/A pytest (<8,>=4.3) + :pypi:`pytest-execution-timer` A timer for the phases of Pytest's execution. Dec 24, 2021 4 - Beta N/A + :pypi:`pytest-expect` py.test plugin to store test expectations and mark tests based on them Apr 21, 2016 4 - Beta N/A + :pypi:`pytest-expectdir` A pytest plugin to provide initial/expected directories, and check a test transforms the initial directory to the expected one Mar 09, 2023 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-expecter` Better testing with expecter and pytest. Sep 18, 2022 5 - Production/Stable N/A + :pypi:`pytest-expectr` This plugin is used to expect multiple assert using pytest framework. Oct 05, 2018 N/A pytest (>=2.4.2) + :pypi:`pytest-experiments` A pytest plugin to help developers of research-oriented software projects keep track of the results of their numerical experiments. Dec 13, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-explicit` A Pytest plugin to ignore certain marked tests by default Jun 15, 2021 5 - Production/Stable pytest + :pypi:`pytest-exploratory` Interactive console for pytest. Feb 21, 2022 N/A pytest (>=6.2) + :pypi:`pytest-extensions` A collection of helpers for pytest to ease testing Aug 17, 2022 4 - Beta pytest ; extra == 'testing' + :pypi:`pytest-external-blockers` a special outcome for tests that are blocked for external reasons Oct 05, 2021 N/A pytest + :pypi:`pytest-extra-durations` A pytest plugin to get durations on a per-function basis and per module basis. Apr 21, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-extra-markers` Additional pytest markers to dynamically enable/disable tests viia CLI flags Mar 05, 2023 4 - Beta pytest + :pypi:`pytest-fabric` Provides test utilities to run fabric task tests by using docker containers Sep 12, 2018 5 - Production/Stable N/A + :pypi:`pytest-factor` A package to prevent Dependency Confusion attacks against Yandex. Feb 10, 2023 N/A N/A + :pypi:`pytest-factory` Use factories for test setup with py.test Sep 06, 2020 3 - Alpha pytest (>4.3) + :pypi:`pytest-factoryboy` Factory Boy support for pytest. Dec 01, 2022 6 - Mature pytest (>=5.0.0) + :pypi:`pytest-factoryboy-fixtures` Generates pytest fixtures that allow the use of type hinting Jun 25, 2020 N/A N/A + :pypi:`pytest-factoryboy-state` Simple factoryboy random state management Mar 22, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-failed-screen-record` Create a video of the screen when pytest fails Jan 05, 2023 4 - Beta pytest (>=7.1.2d,<8.0.0) + :pypi:`pytest-failed-screenshot` Test case fails,take a screenshot,save it,attach it to the allure Apr 21, 2021 N/A N/A + :pypi:`pytest-failed-to-verify` A pytest plugin that helps better distinguishing real test failures from setup flakiness. Aug 08, 2019 5 - Production/Stable pytest (>=4.1.0) + :pypi:`pytest-fail-slow` Fail tests that take too long to run Aug 13, 2022 4 - Beta pytest (>=6.0) + :pypi:`pytest-faker` Faker integration with the pytest framework. Dec 19, 2016 6 - Mature N/A + :pypi:`pytest-falcon` Pytest helpers for Falcon. Sep 07, 2016 4 - Beta N/A + :pypi:`pytest-falcon-client` Pytest \`client\` fixture for the Falcon Framework Mar 19, 2019 N/A N/A + :pypi:`pytest-fantasy` Pytest plugin for Flask Fantasy Framework Mar 14, 2019 N/A N/A + :pypi:`pytest-fastapi` Dec 27, 2020 N/A N/A + :pypi:`pytest-fastapi-deps` A fixture which allows easy replacement of fastapi dependencies for testing Jul 20, 2022 5 - Production/Stable pytest + :pypi:`pytest-fastest` Use SCM and coverage to run only needed tests Mar 05, 2020 N/A N/A + :pypi:`pytest-fast-first` Pytest plugin that runs fast tests first Jan 19, 2023 3 - Alpha pytest + :pypi:`pytest-faulthandler` py.test plugin that activates the fault handler module for tests (dummy package) Jul 04, 2019 6 - Mature pytest (>=5.0) + :pypi:`pytest-fauxfactory` Integration of fauxfactory into pytest. Dec 06, 2017 5 - Production/Stable pytest (>=3.2) + :pypi:`pytest-figleaf` py.test figleaf coverage plugin Jan 18, 2010 5 - Production/Stable N/A + :pypi:`pytest-filecov` A pytest plugin to detect unused files Jun 27, 2021 4 - Beta pytest + :pypi:`pytest-filedata` easily load data from files Jan 17, 2019 4 - Beta N/A + :pypi:`pytest-filemarker` A pytest plugin that runs marked tests when files change. Dec 01, 2020 N/A pytest + :pypi:`pytest-filter-case` run test cases filter by mark Nov 05, 2020 N/A N/A + :pypi:`pytest-filter-subpackage` Pytest plugin for filtering based on sub-packages Dec 12, 2022 3 - Alpha pytest (>=3.0) + :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Apr 09, 2022 4 - Beta pytest (>=4.3.0) + :pypi:`pytest-finer-verdicts` A pytest plugin to treat non-assertion failures as test errors. Jun 18, 2020 N/A pytest (>=5.4.3) + :pypi:`pytest-firefox` pytest plugin to manipulate firefox Aug 08, 2017 3 - Alpha pytest (>=3.0.2) + :pypi:`pytest-fixture-classes` Fixtures as classes that work well with dependency injection, autocompletetion, type checkers, and language servers Jan 20, 2023 4 - Beta pytest + :pypi:`pytest-fixture-config` Fixture configuration utils for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-fixture-maker` Pytest plugin to load fixtures from YAML files Sep 21, 2021 N/A N/A + :pypi:`pytest-fixture-marker` A pytest plugin to add markers based on fixtures used. Oct 11, 2020 5 - Production/Stable N/A + :pypi:`pytest-fixture-order` pytest plugin to control fixture evaluation order May 16, 2022 5 - Production/Stable pytest (>=3.0) + :pypi:`pytest-fixture-ref` Lets users reference fixtures without name matching magic. Nov 17, 2022 4 - Beta N/A + :pypi:`pytest-fixture-rtttg` Warn or fail on fixture name clash Feb 23, 2022 N/A pytest (>=7.0.1,<8.0.0) + :pypi:`pytest-fixtures` Common fixtures for pytest May 01, 2019 5 - Production/Stable N/A + :pypi:`pytest-fixture-tools` Plugin for pytest which provides tools for fixtures Aug 18, 2020 6 - Mature pytest + :pypi:`pytest-fixture-typecheck` A pytest plugin to assert type annotations at runtime. Aug 24, 2021 N/A pytest + :pypi:`pytest-flake8` pytest plugin to check FLAKE8 requirements Mar 18, 2022 4 - Beta pytest (>=7.0) + :pypi:`pytest-flake8-path` A pytest fixture for testing flake8 plugins. May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-flake8-v2` pytest plugin to check FLAKE8 requirements Mar 01, 2022 5 - Production/Stable pytest (>=7.0) + :pypi:`pytest-flakefinder` Runs tests multiple times to expose flakiness. Oct 26, 2022 4 - Beta pytest (>=2.7.1) + :pypi:`pytest-flakes` pytest plugin to check source code with pyflakes Dec 02, 2021 5 - Production/Stable pytest (>=5) + :pypi:`pytest-flaptastic` Flaptastic py.test plugin Mar 17, 2019 N/A N/A + :pypi:`pytest-flask` A set of py.test fixtures to test Flask applications. Feb 27, 2021 5 - Production/Stable pytest (>=5.2) + :pypi:`pytest-flask-ligand` Pytest fixtures and helper functions to use for testing flask-ligand microservices. Feb 10, 2023 4 - Beta pytest (~=7.2) + :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) + :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) + :pypi:`pytest-flexreport` Feb 05, 2023 4 - Beta N/A + :pypi:`pytest-fluent` A pytest plugin in order to provide logs via fluentd Jul 12, 2022 4 - Beta pytest + :pypi:`pytest-flyte` Pytest fixtures for simplifying Flyte integration testing May 03, 2021 N/A pytest + :pypi:`pytest-focus` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest + :pypi:`pytest-forbid` Mar 07, 2023 N/A pytest (>=7.2.2,<8.0.0) + :pypi:`pytest-forcefail` py.test plugin to make the test failing regardless of pytest.mark.xfail May 15, 2018 4 - Beta N/A + :pypi:`pytest-forward-compatability` A name to avoid typosquating pytest-foward-compatibility Sep 06, 2020 N/A N/A + :pypi:`pytest-forward-compatibility` A pytest plugin to shim pytest commandline options for fowards compatibility Sep 29, 2020 N/A N/A + :pypi:`pytest-freezegun` Wrap tests with fixtures in freeze_time Jul 19, 2020 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-freezer` Pytest plugin providing a fixture interface for spulec/freezegun Oct 20, 2022 N/A pytest>=3.6 + :pypi:`pytest-freeze-reqs` Check if requirement files are frozen Apr 29, 2021 N/A N/A + :pypi:`pytest-frozen-uuids` Deterministically frozen UUID's for your tests Apr 17, 2022 N/A pytest (>=3.0) + :pypi:`pytest-func-cov` Pytest plugin for measuring function coverage Apr 15, 2021 3 - Alpha pytest (>=5) + :pypi:`pytest-funparam` An alternative way to parametrize test cases. Dec 02, 2021 4 - Beta pytest >=4.6.0 + :pypi:`pytest-fxa` pytest plugin for Firefox Accounts Aug 28, 2018 5 - Production/Stable N/A + :pypi:`pytest-fxtest` Oct 27, 2020 N/A N/A + :pypi:`pytest-fzf` fzf-based test selector for pytest Aug 17, 2022 1 - Planning pytest (>=7.1.2) + :pypi:`pytest-gather-fixtures` set up asynchronous pytest fixtures concurrently Apr 12, 2022 N/A pytest (>=6.0.0) + :pypi:`pytest-gc` The garbage collector plugin for py.test Feb 01, 2018 N/A N/A + :pypi:`pytest-gcov` Uses gcov to measure test coverage of a C library Feb 01, 2018 3 - Alpha N/A + :pypi:`pytest-gevent` Ensure that gevent is properly patched when invoking pytest Feb 25, 2020 N/A pytest + :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) + :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest + :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Mar 08, 2023 N/A N/A + :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A + :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest + :pypi:`pytest-github` Plugin for py.test that associates tests with github issues using a marker. Mar 07, 2019 5 - Production/Stable N/A + :pypi:`pytest-github-actions-annotate-failures` pytest plugin to annotate failed tests with a workflow command for GitHub Actions Dec 19, 2022 N/A pytest (>=4.0.0) + :pypi:`pytest-github-report` Generate a GitHub report using pytest in GitHub Workflows Jun 03, 2022 4 - Beta N/A + :pypi:`pytest-gitignore` py.test plugin to ignore the same files as git Jul 17, 2015 4 - Beta N/A + :pypi:`pytest-gitlabci-parallelized` Parallelize pytest across GitLab CI workers. Mar 08, 2023 N/A N/A + :pypi:`pytest-git-selector` Utility to select tests that have had its dependencies modified (as identified by git diff) Nov 17, 2022 N/A N/A + :pypi:`pytest-glamor-allure` Extends allure-pytest functionality Jul 22, 2022 4 - Beta pytest + :pypi:`pytest-gnupg-fixtures` Pytest fixtures for testing with gnupg. Mar 04, 2021 4 - Beta pytest + :pypi:`pytest-golden` Plugin for pytest that offloads expected outputs to data files Jul 18, 2022 N/A pytest (>=6.1.2) + :pypi:`pytest-google-chat` Notify google chat channel for test results Mar 27, 2022 4 - Beta pytest + :pypi:`pytest-graphql-schema` Get graphql schema as fixture for pytest Oct 18, 2019 N/A N/A + :pypi:`pytest-greendots` Green progress dots Feb 08, 2014 3 - Alpha N/A + :pypi:`pytest-growl` Growl notifications for pytest results. Jan 13, 2014 5 - Production/Stable N/A + :pypi:`pytest-grpc` pytest plugin for grpc May 01, 2020 N/A pytest (>=3.6.0) + :pypi:`pytest-grunnur` Py.Test plugin for Grunnur-based packages. Feb 05, 2023 N/A N/A + :pypi:`pytest-hammertime` Display "🔨 " instead of "." for passed pytest tests. Jul 28, 2018 N/A pytest + :pypi:`pytest-harmony` Chain tests and data with pytest Jan 17, 2023 N/A pytest (>=7.2.1,<8.0.0) + :pypi:`pytest-harvest` Store data created during your pytest tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes. Jun 10, 2022 5 - Production/Stable N/A + :pypi:`pytest-helm-chart` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Jun 15, 2020 4 - Beta pytest (>=5.4.2,<6.0.0) + :pypi:`pytest-helm-charts` A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. Mar 08, 2023 4 - Beta pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-helper` Functions to help in using the pytest testing framework May 31, 2019 5 - Production/Stable N/A + :pypi:`pytest-helpers` pytest helpers May 17, 2020 N/A pytest + :pypi:`pytest-helpers-namespace` Pytest Helpers Namespace Plugin Dec 29, 2021 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-hidecaptured` Hide captured output May 04, 2018 4 - Beta pytest (>=2.8.5) + :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest + :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest + :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 10, 2023 3 - Alpha pytest (==7.2.1) + :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A + :pypi:`pytest-hot-test` A plugin that tracks test changes Dec 10, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-hoverfly` Simplify working with Hoverfly from pytest Jan 30, 2023 N/A pytest (>=5.0) + :pypi:`pytest-hoverfly-wrapper` Integrates the Hoverfly HTTP proxy into Pytest Feb 27, 2023 5 - Production/Stable pytest (>=3.7.0) + :pypi:`pytest-hpfeeds` Helpers for testing hpfeeds in your python project Feb 28, 2023 4 - Beta pytest (>=6.2.4,<7.0.0) + :pypi:`pytest-html` pytest plugin for generating HTML reports Mar 05, 2023 5 - Production/Stable pytest (!=6.0.0,>=5.0) + :pypi:`pytest-html-lee` optimized pytest plugin for generating HTML reports Jun 30, 2020 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-html-merger` Pytest HTML reports merging utility Apr 03, 2022 N/A N/A + :pypi:`pytest-html-object-storage` Pytest report plugin for send HTML report on object-storage Mar 04, 2022 5 - Production/Stable N/A + :pypi:`pytest-html-profiling` Pytest plugin for generating HTML reports with per-test profiling and optionally call graph visualizations. Based on pytest-html by Dave Hunt. Feb 11, 2020 5 - Production/Stable pytest (>=3.0) + :pypi:`pytest-html-reporter` Generates a static html report based on pytest framework Feb 13, 2022 N/A N/A + :pypi:`pytest-html-report-merger` Aug 31, 2022 N/A N/A + :pypi:`pytest-html-thread` pytest plugin for generating HTML reports Dec 29, 2020 5 - Production/Stable N/A + :pypi:`pytest-http` Fixture "http" for http requests Dec 05, 2019 N/A N/A + :pypi:`pytest-httpbin` Easily test your HTTP library against a local copy of httpbin Mar 16, 2022 5 - Production/Stable pytest ; extra == 'test' + :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A + :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A + :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Sep 12, 2022 3 - Alpha N/A + :pypi:`pytest-httptesting` http_testing framework on top of pytest Dec 08, 2022 N/A pytest (>=7.2.0,<8.0.0) + :pypi:`pytest-httpx` Send responses to httpx. Jan 20, 2023 5 - Production/Stable pytest (<8.0,>=6.0) + :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Feb 16, 2023 N/A pytest (>=7.2.1) + :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A + :pypi:`pytest-hylang` Pytest plugin to allow running tests written in hylang Mar 28, 2021 N/A pytest + :pypi:`pytest-hypo-25` help hypo module for pytest Jan 12, 2020 3 - Alpha N/A + :pypi:`pytest-ibutsu` A plugin to sent pytest results to an Ibutsu server Aug 05, 2022 4 - Beta pytest>=7.1 + :pypi:`pytest-icdiff` use icdiff for better error messages in pytest assertions Aug 09, 2022 4 - Beta N/A + :pypi:`pytest-idapro` A pytest plugin for idapython. Allows a pytest setup to run tests outside and inside IDA in an automated manner by runnig pytest inside IDA and by mocking idapython api Nov 03, 2018 N/A N/A + :pypi:`pytest-idem` A pytest plugin to help with testing idem projects Sep 07, 2022 5 - Production/Stable N/A + :pypi:`pytest-idempotent` Pytest plugin for testing function idempotence. Jul 25, 2022 N/A N/A + :pypi:`pytest-ignore-flaky` ignore failures from flaky tests (pytest plugin) Apr 23, 2021 5 - Production/Stable N/A + :pypi:`pytest-image-diff` Mar 09, 2023 3 - Alpha pytest + :pypi:`pytest-incremental` an incremental test runner (pytest plugin) Apr 24, 2021 5 - Production/Stable N/A + :pypi:`pytest-influxdb` Plugin for influxdb and pytest integration. Apr 20, 2021 N/A N/A + :pypi:`pytest-info-collector` pytest plugin to collect information from tests May 26, 2019 3 - Alpha N/A + :pypi:`pytest-informative-node` display more node ininformation. Apr 25, 2019 4 - Beta N/A + :pypi:`pytest-infrastructure` pytest stack validation prior to testing executing Apr 12, 2020 4 - Beta N/A + :pypi:`pytest-ini` Reuse pytest.ini to store env variables Apr 26, 2022 N/A N/A + :pypi:`pytest-inline` A pytest plugin for writing inline tests. Feb 08, 2023 4 - Beta pytest (>=7.0.0) + :pypi:`pytest-inmanta` A py.test plugin providing fixtures to simplify inmanta modules testing. Feb 23, 2023 5 - Production/Stable N/A + :pypi:`pytest-inmanta-extensions` Inmanta tests package Feb 09, 2023 5 - Production/Stable N/A + :pypi:`pytest-inmanta-lsm` Common fixtures for inmanta LSM related modules Feb 21, 2023 5 - Production/Stable N/A + :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Jun 16, 2022 4 - Beta N/A + :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A + :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Nov 02, 2022 N/A pytest (>=7.2.0,<8.0.0) + :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) + :pypi:`pytest-instrument` pytest plugin to instrument tests Apr 05, 2020 5 - Production/Stable pytest (>=5.1.0) + :pypi:`pytest-integration` Organizing pytests by integration or not Nov 17, 2022 N/A N/A + :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) + :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A + :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) + :pypi:`pytest-invenio` Pytest fixtures for Invenio. Oct 25, 2022 5 - Production/Stable pytest (<7.2.0,>=6) + :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Mar 20, 2013 2 - Pre-Alpha N/A + :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A + :pypi:`pytest-isolate` Feb 20, 2023 4 - Beta pytest + :pypi:`pytest-isort` py.test plugin to check import ordering using isort Oct 31, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-is-running` pytest plugin providing a function to check if pytest is running. Aug 19, 2022 5 - Production/Stable N/A + :pypi:`pytest-it` Pytest plugin to display test reports as a plaintext spec, inspired by Rspec: https://github.com/mattduck/pytest-it. Jan 22, 2020 4 - Beta N/A + :pypi:`pytest-iterassert` Nicer list and iterable assertion messages for pytest May 11, 2020 3 - Alpha N/A + :pypi:`pytest-iters` A contextmanager pytest fixture for handling multiple mock iters May 24, 2022 N/A N/A + :pypi:`pytest-jasmine` Run jasmine tests from your pytest test suite Nov 04, 2017 1 - Planning N/A + :pypi:`pytest-jelastic` Pytest plugin defining the necessary command-line options to pass to pytests testing a Jelastic environment. Nov 16, 2022 N/A pytest (>=7.2.0,<8.0.0) + :pypi:`pytest-jest` A custom jest-pytest oriented Pytest reporter May 22, 2018 4 - Beta pytest (>=3.3.2) + :pypi:`pytest-jinja` A plugin to generate customizable jinja-based HTML reports in pytest Oct 04, 2022 3 - Alpha pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A + :pypi:`pytest-jira-xfail` Plugin skips (xfail) tests if unresolved Jira issue(s) linked Dec 01, 2022 N/A pytest (~=7.2.0) + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Feb 09, 2023 4 - Beta pytest + :pypi:`pytest-job-selection` A pytest plugin for load balancing test suites Jan 30, 2023 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest + :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) + :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A + :pypi:`pytest-json-fixtures` JSON output for the --fixtures flag Aug 09, 2022 4 - Beta pytest (>=7.1.0) + :pypi:`pytest-jsonlint` UNKNOWN Aug 04, 2016 N/A N/A + :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Mar 15, 2022 4 - Beta pytest (>=3.8.0) + :pypi:`pytest-jtr` pytest plugin supporting json test report output Nov 29, 2022 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-jupyter` A pytest plugin for testing Jupyter libraries and extensions. Dec 19, 2022 4 - Beta pytest + :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Oct 01, 2022 N/A pytest + :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest + :pypi:`pytest-kasima` Display horizontal lines above and below the captured standard output for easy viewing. Jan 26, 2023 5 - Production/Stable pytest (>=7.2.1,<8.0.0) + :pypi:`pytest-keep-together` Pytest plugin to customize test ordering by running all 'related' tests together Dec 07, 2022 5 - Production/Stable pytest + :pypi:`pytest-kexi` Apr 29, 2022 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-kind` Kubernetes test support with KIND for pytest Nov 30, 2022 5 - Production/Stable N/A + :pypi:`pytest-kivy` Kivy GUI tests fixtures using pytest Jul 06, 2021 4 - Beta pytest (>=3.6) + :pypi:`pytest-knows` A pytest plugin that can automaticly skip test case based on dependence info calculated by trace Aug 22, 2014 N/A N/A + :pypi:`pytest-konira` Run Konira DSL tests with py.test Oct 09, 2011 N/A N/A + :pypi:`pytest-koopmans` A plugin for testing the koopmans package Nov 21, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-krtech-common` pytest krtech common library Nov 28, 2016 4 - Beta N/A + :pypi:`pytest-kubernetes` Feb 16, 2023 N/A pytest (>=7.2.1,<8.0.0) + :pypi:`pytest-kwparametrize` Alternate syntax for @pytest.mark.parametrize with test cases as dictionaries and default value fallbacks Jan 22, 2021 N/A pytest (>=6) + :pypi:`pytest-lambda` Define pytest fixtures with lambda functions. Aug 20, 2022 3 - Alpha pytest (>=3.6,<8) + :pypi:`pytest-lamp` Jan 06, 2017 3 - Alpha N/A + :pypi:`pytest-langchain` Pytest-style test runner for langchain agents Feb 26, 2023 N/A pytest + :pypi:`pytest-lark` A package for enhancing pytest Nov 20, 2022 N/A N/A + :pypi:`pytest-launchable` Launchable Pytest Plugin Jun 14, 2022 N/A pytest (>=4.2.0) + :pypi:`pytest-layab` Pytest fixtures for layab. Oct 05, 2020 5 - Production/Stable N/A + :pypi:`pytest-lazy-fixture` It helps to use fixtures in pytest.mark.parametrize Feb 01, 2020 4 - Beta pytest (>=3.2.5) + :pypi:`pytest-lazy-fixtures` Allows you to use fixtures in @pytest.mark.parametrize. Mar 11, 2023 N/A pytest (>=7.2.1,<8.0.0) + :pypi:`pytest-ldap` python-ldap fixtures for pytest Aug 18, 2020 N/A pytest + :pypi:`pytest-leak-finder` Find the test that's leaking before the one that fails Feb 15, 2023 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-leaks` A pytest plugin to trace resource leaks. Nov 27, 2019 1 - Planning N/A + :pypi:`pytest-level` Select tests of a given level or lower Oct 21, 2019 N/A pytest + :pypi:`pytest-libfaketime` A python-libfaketime plugin for pytest. Dec 22, 2018 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-libiio` A pytest plugin to manage interfacing with libiio contexts Jul 11, 2022 4 - Beta N/A + :pypi:`pytest-libnotify` Pytest plugin that shows notifications about the test run Apr 02, 2021 3 - Alpha pytest + :pypi:`pytest-ligo` Jan 16, 2020 4 - Beta N/A + :pypi:`pytest-lineno` A pytest plugin to show the line numbers of test functions Dec 04, 2020 N/A pytest + :pypi:`pytest-line-profiler` Profile code executed by pytest May 03, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-line-profiler-apn` Profile code executed by pytest Dec 05, 2022 N/A pytest (>=3.5.0) + :pypi:`pytest-lisa` Pytest plugin for organizing tests. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-listener` A simple network listener May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-litf` A pytest plugin that stream output in LITF format Jan 18, 2021 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-live` Live results for pytest Mar 08, 2020 N/A pytest + :pypi:`pytest-local-badge` Generate local badges (shields) reporting your test suite status. Jan 15, 2023 N/A pytest (>=6.1.0) + :pypi:`pytest-localftpserver` A PyTest plugin which provides an FTP fixture for your tests Oct 04, 2022 5 - Production/Stable pytest + :pypi:`pytest-localserver` pytest plugin to test server connections locally. Jan 30, 2023 4 - Beta N/A + :pypi:`pytest-localstack` Pytest plugin for AWS integration tests Oct 17, 2022 4 - Beta pytest (>=6.0.0,<7.0.0) + :pypi:`pytest-lockable` lockable resource plugin for pytest Jul 20, 2022 5 - Production/Stable pytest + :pypi:`pytest-locker` Used to lock object during testing. Essentially changing assertions from being hard coded to asserting that nothing changed Oct 29, 2021 N/A pytest (>=5.4) + :pypi:`pytest-log` print log Aug 15, 2021 N/A pytest (>=3.8) + :pypi:`pytest-logbook` py.test plugin to capture logbook log messages Nov 23, 2015 5 - Production/Stable pytest (>=2.8) + :pypi:`pytest-logdog` Pytest plugin to test logging Jun 15, 2021 1 - Planning pytest (>=6.2.0) + :pypi:`pytest-logfest` Pytest plugin providing three logger fixtures with basic or full writing to log files Jul 21, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-logger` Plugin configuring handlers for loggers from Python logging module. Jul 25, 2019 4 - Beta pytest (>=3.2) + :pypi:`pytest-logging` Configures logging and allows tweaking the log level with a py.test flag Nov 04, 2015 4 - Beta N/A + :pypi:`pytest-logging-end-to-end-test-tool` Sep 23, 2022 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-logikal` Common testing environment Mar 09, 2023 5 - Production/Stable pytest (==7.2.1) + :pypi:`pytest-log-report` Package for creating a pytest test run reprot Dec 26, 2019 N/A N/A + :pypi:`pytest-loguru` Pytest Loguru Apr 12, 2022 5 - Production/Stable N/A + :pypi:`pytest-loop` pytest plugin for looping tests Jul 22, 2022 5 - Production/Stable pytest (>=6) + :pypi:`pytest-lsp` Pytest plugin for end-to-end testing of language servers Jan 14, 2023 3 - Alpha pytest + :pypi:`pytest-manual-marker` pytest marker for marking manual tests Aug 04, 2022 3 - Alpha pytest>=7 + :pypi:`pytest-markdoctest` A pytest plugin to doctest your markdown files Jul 22, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-markdown` Test your markdown docs with pytest Jan 15, 2021 4 - Beta pytest (>=6.0.1,<7.0.0) + :pypi:`pytest-markdown-docs` Run markdown code fences through pytest Mar 09, 2023 N/A N/A + :pypi:`pytest-marker-bugzilla` py.test bugzilla integration plugin, using markers Jan 09, 2020 N/A N/A + :pypi:`pytest-markers-presence` A simple plugin to detect missed pytest tags and markers" Feb 04, 2021 4 - Beta pytest (>=6.0) + :pypi:`pytest-markfiltration` UNKNOWN Nov 08, 2011 3 - Alpha N/A + :pypi:`pytest-mark-no-py3` pytest plugin and bowler codemod to help migrate tests to Python 3 May 17, 2019 N/A pytest + :pypi:`pytest-marks` UNKNOWN Nov 23, 2012 3 - Alpha N/A + :pypi:`pytest-matcher` Match test output against patterns stored in files Dec 10, 2021 5 - Production/Stable N/A + :pypi:`pytest-match-skip` Skip matching marks. Matches partial marks using wildcards. May 15, 2019 4 - Beta pytest (>=4.4.1) + :pypi:`pytest-mat-report` this is report Jan 20, 2021 N/A N/A + :pypi:`pytest-matrix` Provide tools for generating tests from combinations of fixtures. Jun 24, 2020 5 - Production/Stable pytest (>=5.4.3,<6.0.0) + :pypi:`pytest-maybe-raises` Pytest fixture for optional exception testing. May 27, 2022 N/A pytest ; extra == 'dev' + :pypi:`pytest-mccabe` pytest plugin to run the mccabe code complexity checker. Jul 22, 2020 3 - Alpha pytest (>=5.4.0) + :pypi:`pytest-md` Plugin for generating Markdown reports for pytest results Jul 11, 2019 3 - Alpha pytest (>=4.2.1) + :pypi:`pytest-md-report` A pytest plugin to make a test results report with Markdown table format. Aug 06, 2022 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) + :pypi:`pytest-memprof` Estimates memory consumption of test functions Mar 29, 2019 4 - Beta N/A + :pypi:`pytest-memray` A simple plugin to use with pytest Dec 02, 2022 N/A pytest>=7.2 + :pypi:`pytest-menu` A pytest plugin for console based interactive test selection just after the collection phase Oct 04, 2017 3 - Alpha pytest (>=2.4.2) + :pypi:`pytest-mercurial` pytest plugin to write integration tests for projects using Mercurial Python internals Nov 21, 2020 1 - Planning N/A + :pypi:`pytest-mesh` pytest_mesh插件 Aug 05, 2022 N/A pytest (==7.1.2) + :pypi:`pytest-message` Pytest plugin for sending report message of marked tests execution Aug 04, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-messenger` Pytest to Slack reporting plugin Nov 24, 2022 5 - Production/Stable N/A + :pypi:`pytest-metadata` pytest plugin for test session metadata Oct 30, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) + :pypi:`pytest-metrics` Custom metrics report for pytest Apr 04, 2020 N/A pytest + :pypi:`pytest-mimesis` Mimesis integration with the pytest test runner Mar 21, 2020 5 - Production/Stable pytest (>=4.2) + :pypi:`pytest-minecraft` A pytest plugin for running tests against Minecraft releases Apr 06, 2022 N/A pytest (>=6.0.1) + :pypi:`pytest-mini` A plugin to test mp Feb 06, 2023 N/A pytest (>=7.2.0,<8.0.0) + :pypi:`pytest-missing-fixtures` Pytest plugin that creates missing fixtures Oct 14, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-ml` Test your machine learning! May 04, 2019 4 - Beta N/A + :pypi:`pytest-mocha` pytest plugin to display test execution output like a mochajs Apr 02, 2020 4 - Beta pytest (>=5.4.0) + :pypi:`pytest-mock` Thin-wrapper around the mock package for easier use with pytest Oct 05, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-mock-api` A mock API server with configurable routes and responses available as a fixture. Feb 13, 2019 1 - Planning pytest (>=4.0.0) + :pypi:`pytest-mock-generator` A pytest fixture wrapper for https://pypi.org/project/mock-generator May 16, 2022 5 - Production/Stable N/A + :pypi:`pytest-mock-helper` Help you mock HTTP call and generate mock code Jan 24, 2018 N/A pytest + :pypi:`pytest-mockito` Base fixtures for mockito Jul 11, 2018 4 - Beta N/A + :pypi:`pytest-mockredis` An in-memory mock of a Redis server that runs in a separate thread. This is to be used for unit-tests that require a Redis database. Jan 02, 2018 2 - Pre-Alpha N/A + :pypi:`pytest-mock-resources` A pytest plugin for easily instantiating reproducible mock resources. Mar 03, 2023 N/A pytest (>=1.0) + :pypi:`pytest-mock-server` Mock server plugin for pytest Jan 09, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-mockservers` A set of fixtures to test your requests to HTTP/UDP servers Mar 31, 2020 N/A pytest (>=4.3.0) + :pypi:`pytest-mocktcp` A pytest plugin for testing TCP clients Oct 11, 2022 N/A pytest + :pypi:`pytest-modified-env` Pytest plugin to fail a test if it leaves modified \`os.environ\` afterwards. Jan 29, 2022 4 - Beta N/A + :pypi:`pytest-modifyjunit` Utility for adding additional properties to junit xml for IDM QE Jan 10, 2019 N/A N/A + :pypi:`pytest-modifyscope` pytest plugin to modify fixture scope Apr 12, 2020 N/A pytest + :pypi:`pytest-molecule` PyTest Molecule Plugin :: discover and run molecule tests Mar 29, 2022 5 - Production/Stable pytest (>=7.0.0) + :pypi:`pytest-mongo` MongoDB process and client fixtures plugin for Pytest. Jun 07, 2021 5 - Production/Stable pytest + :pypi:`pytest-mongodb` pytest plugin for MongoDB fixtures Dec 07, 2019 5 - Production/Stable pytest (>=2.5.2) + :pypi:`pytest-monitor` Pytest plugin for analyzing resource usage. Oct 22, 2022 5 - Production/Stable pytest + :pypi:`pytest-monkeyplus` pytest's monkeypatch subclass with extra functionalities Sep 18, 2012 5 - Production/Stable N/A + :pypi:`pytest-monkeytype` pytest-monkeytype: Generate Monkeytype annotations from your pytest tests. Jul 29, 2020 4 - Beta N/A + :pypi:`pytest-moto` Fixtures for integration tests of AWS services,uses moto mocking library. Aug 28, 2015 1 - Planning N/A + :pypi:`pytest-motor` A pytest plugin for motor, the non-blocking MongoDB driver. Jul 21, 2021 3 - Alpha pytest + :pypi:`pytest-mp` A test batcher for multiprocessed Pytest runs May 23, 2018 4 - Beta pytest + :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest + :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 23, 2022 4 - Beta pytest + :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Nov 15, 2022 4 - Beta pytest (>=6) + :pypi:`pytest-mqtt` pytest-mqtt supports testing systems based on MQTT Sep 20, 2022 4 - Beta pytest (<8) ; extra == 'test' + :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A + :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jan 17, 2023 N/A pytest + :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Dec 07, 2022 N/A N/A + :pypi:`pytest-multithreading-allure` pytest_multithreading_allure Nov 25, 2022 N/A N/A + :pypi:`pytest-mutagen` Add the mutation testing feature to pytest Jul 24, 2020 N/A pytest (>=5.4) + :pypi:`pytest-mypy` Mypy static type checker plugin for Pytest Dec 18, 2022 4 - Beta pytest (>=6.2) ; python_version >= "3.10" + :pypi:`pytest-mypyd` Mypy static type checker plugin for Pytest Aug 20, 2019 4 - Beta pytest (<4.7,>=2.8) ; python_version < "3.5" + :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Oct 26, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A pytest>=6.0.0 + :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Feb 25, 2023 N/A pytest>=7,<8 + :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Mar 10, 2023 5 - Production/Stable pytest (>=6.2) + :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) + :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) + :pypi:`pytest-netdut` "Automated software testing for switches using pytest" Jan 11, 2023 N/A pytest (>=3.5.0) + :pypi:`pytest-network` A simple plugin to disable network on socket level. May 07, 2020 N/A N/A + :pypi:`pytest-network-endpoints` Network endpoints plugin for pytest Mar 06, 2022 N/A pytest + :pypi:`pytest-never-sleep` pytest plugin helps to avoid adding tests without mock \`time.sleep\` May 05, 2021 3 - Alpha pytest (>=3.5.1) + :pypi:`pytest-nginx` nginx fixture for pytest Aug 12, 2017 5 - Production/Stable N/A + :pypi:`pytest-nginx-iplweb` nginx fixture for pytest - iplweb temporary fork Mar 01, 2019 5 - Production/Stable N/A + :pypi:`pytest-ngrok` Jan 20, 2022 3 - Alpha pytest + :pypi:`pytest-ngsfixtures` pytest ngs fixtures Sep 06, 2019 2 - Pre-Alpha pytest (>=5.0.0) + :pypi:`pytest-nhsd-apim` Pytest plugin accessing NHSDigital's APIM proxies Mar 06, 2023 N/A pytest (==6.2.5) + :pypi:`pytest-nice` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest + :pypi:`pytest-nice-parametrize` A small snippet for nicer PyTest's Parametrize Apr 17, 2021 5 - Production/Stable N/A + :pypi:`pytest-nlcov` Pytest plugin to get the coverage of the new lines (based on git diff) only Jul 07, 2021 N/A N/A + :pypi:`pytest-nocustom` Run all tests without custom markers Jul 07, 2021 5 - Production/Stable N/A + :pypi:`pytest-nodev` Test-driven source code search for Python. Jul 21, 2016 4 - Beta pytest (>=2.8.1) + :pypi:`pytest-nogarbage` Ensure a test produces no garbage Aug 29, 2021 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-notice` Send pytest execution result email Nov 05, 2020 N/A N/A + :pypi:`pytest-notification` A pytest plugin for sending a desktop notification and playing a sound upon completion of tests Jun 19, 2020 N/A pytest (>=4) + :pypi:`pytest-notifier` A pytest plugin to notify test result Jun 12, 2020 3 - Alpha pytest + :pypi:`pytest-notimplemented` Pytest markers for not implemented features and tests. Aug 27, 2019 N/A pytest (>=5.1,<6.0) + :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A + :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Oct 20, 2022 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-oar` PyTest plugin for the OAR testing framework Feb 22, 2023 N/A pytest>=6.0.1 + :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jul 31, 2022 5 - Production/Stable pytest + :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A + :pypi:`pytest-odoo` py.test plugin to run Odoo tests Nov 17, 2022 4 - Beta pytest (>=7.2.0) + :pypi:`pytest-odoo-fixtures` Project description Jun 25, 2019 N/A N/A + :pypi:`pytest-oerp` pytest plugin to test OpenERP modules Feb 28, 2012 3 - Alpha N/A + :pypi:`pytest-offline` Mar 09, 2023 1 - Planning pytest (>=7.0.0,<8.0.0) + :pypi:`pytest-ogsm-plugin` 针对特定项目定制化插件,优化了pytest报告展示方式,并添加了项目所需特定参数 Mar 08, 2023 N/A N/A + :pypi:`pytest-ok` The ultimate pytest output plugin Apr 01, 2019 4 - Beta N/A + :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jun 14, 2022 5 - Production/Stable pytest (<7.1); python_version <= "3.6" + :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A + :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) + :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry Mar 10, 2023 N/A pytest + :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Jun 02, 2022 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-operator` Fixtures for Operators Sep 28, 2022 N/A pytest + :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A + :pypi:`pytest-optional-tests` Easy declaration of optional tests (i.e., that are not run by default) Jul 09, 2019 4 - Beta pytest (>=4.5.0) + :pypi:`pytest-orchestration` A pytest plugin for orchestrating tests Jul 18, 2019 N/A N/A + :pypi:`pytest-order` pytest plugin to run your tests in a specific order Mar 10, 2023 4 - Beta pytest (>=5.0) ; python_version < "3.10" + :pypi:`pytest-ordering` pytest plugin to run your tests in a specific order Nov 14, 2018 4 - Beta pytest + :pypi:`pytest-order-modify` 新增run_marker 来自定义用例的执行顺序 Nov 04, 2022 N/A N/A + :pypi:`pytest-osxnotify` OS X notifications for py.test results. May 15, 2015 N/A N/A + :pypi:`pytest-otel` pytest-otel report OpenTelemetry traces about test executed Jan 18, 2023 N/A N/A + :pypi:`pytest-override-env-var` Pytest mark to override a value of an environment variable. Feb 25, 2023 N/A N/A + :pypi:`pytest-owner` Add owner mark for tests Apr 25, 2022 N/A N/A + :pypi:`pytest-pact` A simple plugin to use with pytest Jan 07, 2019 4 - Beta N/A + :pypi:`pytest-pahrametahrize` Parametrize your tests with a Boston accent. Nov 24, 2021 4 - Beta pytest (>=6.0,<7.0) + :pypi:`pytest-parallel` a pytest plugin for parallel and concurrent testing Oct 10, 2021 3 - Alpha pytest (>=3.0.0) + :pypi:`pytest-parallel-39` a pytest plugin for parallel and concurrent testing Jul 12, 2021 3 - Alpha pytest (>=3.0.0) + :pypi:`pytest-parallelize-tests` pytest plugin that parallelizes test execution across multiple hosts Jan 27, 2023 4 - Beta N/A + :pypi:`pytest-param` pytest plugin to test all, first, last or random params Sep 11, 2016 4 - Beta pytest (>=2.6.0) + :pypi:`pytest-paramark` Configure pytest fixtures using a combination of"parametrize" and markers Jan 10, 2020 4 - Beta pytest (>=4.5.0) + :pypi:`pytest-parametrization` Simpler PyTest parametrization May 22, 2022 5 - Production/Stable N/A + :pypi:`pytest-parametrize-cases` A more user-friendly way to write parametrized tests. Mar 13, 2022 N/A pytest (>=6.1.2) + :pypi:`pytest-parametrized` Pytest decorator for parametrizing tests with default iterables. Sep 13, 2022 5 - Production/Stable pytest + :pypi:`pytest-parametrize-suite` A simple pytest extension for creating a named test suite. Jan 19, 2023 5 - Production/Stable pytest + :pypi:`pytest-parawtf` Finally spell paramete?ri[sz]e correctly Dec 03, 2018 4 - Beta pytest (>=3.6.0) + :pypi:`pytest-pass` Check out https://github.com/elilutsky/pytest-pass Dec 04, 2019 N/A N/A + :pypi:`pytest-passrunner` Pytest plugin providing the 'run_on_pass' marker Feb 10, 2021 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-paste-config` Allow setting the path to a paste config file Sep 18, 2013 3 - Alpha N/A + :pypi:`pytest-patches` A contextmanager pytest fixture for handling multiple mock patches Aug 30, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-pdb` pytest plugin which adds pdb helper commands related to pytest. Jul 31, 2018 N/A N/A + :pypi:`pytest-peach` pytest plugin for fuzzing with Peach API Security Apr 12, 2019 4 - Beta pytest (>=2.8.7) + :pypi:`pytest-pep257` py.test plugin for pep257 Jul 09, 2016 N/A N/A + :pypi:`pytest-pep8` pytest plugin to check PEP8 requirements Apr 27, 2014 N/A N/A + :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) + :pypi:`pytest-perf` pytest-perf Jun 23, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) + :pypi:`pytest-persistence` Pytest tool for persistent objects Jun 27, 2022 N/A N/A + :pypi:`pytest-pg` A tiny plugin for pytest which runs PostgreSQL in Docker Sep 19, 2022 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Apr 15, 2022 4 - Beta pytest (>=5.4.3) + :pypi:`pytest-picked` Run the tests related to the changed files Dec 23, 2020 N/A pytest (>=3.5.0) + :pypi:`pytest-pigeonhole` Jun 25, 2018 5 - Production/Stable pytest (>=3.4) + :pypi:`pytest-pikachu` Show surprise when tests are passing Aug 05, 2021 5 - Production/Stable pytest + :pypi:`pytest-pilot` Slice in your test base thanks to powerful markers. Oct 09, 2020 5 - Production/Stable N/A + :pypi:`pytest-pingguo-pytest-plugin` pingguo test Oct 26, 2022 4 - Beta N/A + :pypi:`pytest-pings` 🦊 The pytest plugin for Firefox Telemetry 📊 Jun 29, 2019 3 - Alpha pytest (>=5.0.0) + :pypi:`pytest-pinned` A simple pytest plugin for pinning tests Sep 17, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-pinpoint` A pytest plugin which runs SBFL algorithms to detect faults. Sep 25, 2020 N/A pytest (>=4.4.0) + :pypi:`pytest-pipeline` Pytest plugin for functional testing of data analysispipelines Jan 24, 2017 3 - Alpha N/A + :pypi:`pytest-platform-markers` Markers for pytest to skip tests on specific platforms Sep 09, 2019 4 - Beta pytest (>=3.6.0) + :pypi:`pytest-play` pytest plugin that let you automate actions and assertions with test metrics reporting executing plain YAML files Jun 12, 2019 5 - Production/Stable N/A + :pypi:`pytest-playbook` Pytest plugin for reading playbooks. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-playwright` A pytest wrapper with fixtures for Playwright to automate web browsers Mar 10, 2023 N/A pytest (<8.0.0,>=6.2.4) + :pypi:`pytest-playwrights` A pytest wrapper with fixtures for Playwright to automate web browsers Dec 02, 2021 N/A N/A + :pypi:`pytest-playwright-snapshot` A pytest wrapper for snapshot testing with playwright Aug 19, 2021 N/A N/A + :pypi:`pytest-playwright-visual` A pytest fixture for visual testing with Playwright Apr 28, 2022 N/A N/A + :pypi:`pytest-plone` Pytest plugin to test Plone addons Jan 05, 2023 3 - Alpha pytest + :pypi:`pytest-plt` Fixtures for quickly making Matplotlib plots in tests Aug 17, 2020 5 - Production/Stable pytest + :pypi:`pytest-plugin-helpers` A plugin to help developing and testing other plugins Nov 23, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-plus` PyTest Plus Plugin :: extends pytest functionality Dec 24, 2022 5 - Production/Stable pytest (>=6.0.1) + :pypi:`pytest-pmisc` Mar 21, 2019 5 - Production/Stable N/A + :pypi:`pytest-pointers` Pytest plugin to define functions you test with special marks for better navigation and reports Dec 26, 2022 N/A N/A + :pypi:`pytest-polarion-cfme` pytest plugin for collecting test cases and recording test results Nov 13, 2017 3 - Alpha N/A + :pypi:`pytest-polarion-collect` pytest plugin for collecting polarion test cases data Jun 18, 2020 3 - Alpha pytest + :pypi:`pytest-polecat` Provides Polecat pytest fixtures Aug 12, 2019 4 - Beta N/A + :pypi:`pytest-ponyorm` PonyORM in Pytest Oct 31, 2018 N/A pytest (>=3.1.1) + :pypi:`pytest-poo` Visualize your crappy tests Mar 25, 2021 5 - Production/Stable pytest (>=2.3.4) + :pypi:`pytest-poo-fail` Visualize your failed tests with poo Feb 12, 2015 5 - Production/Stable N/A + :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Aug 18, 2022 5 - Production/Stable pytest + :pypi:`pytest-portion` Select a portion of the collected tests Jan 28, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest + :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-pot` A package for enhancing pytest Nov 20, 2022 N/A N/A + :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) + :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 27, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) + :pypi:`pytest-pretty` pytest plugin for printing summary data as I want it Feb 01, 2023 5 - Production/Stable pytest>=7 + :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 31, 2022 N/A pytest (>=3.4.1) + :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A + :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Dec 28, 2021 5 - Production/Stable pytest (>=6) + :pypi:`pytest-profiles` pytest plugin for configuration profiles Dec 09, 2021 4 - Beta pytest (>=3.7.0) + :pypi:`pytest-profiling` Profiling plugin for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-progress` pytest plugin for instant test progress status Jan 31, 2022 5 - Production/Stable N/A + :pypi:`pytest-prometheus` Report test pass / failures to a Prometheus PushGateway Oct 03, 2017 N/A N/A + :pypi:`pytest-prometheus-pushgateway` Pytest report plugin for Zulip Sep 27, 2022 5 - Production/Stable pytest + :pypi:`pytest-prosper` Test helpers for Prosper projects Sep 24, 2018 N/A N/A + :pypi:`pytest-pspec` A rspec format reporter for Python ptest Jun 02, 2020 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-psqlgraph` pytest plugin for testing applications that use psqlgraph Oct 19, 2021 4 - Beta pytest (>=6.0) + :pypi:`pytest-ptera` Use ptera probes in tests Mar 01, 2022 N/A pytest (>=6.2.4,<7.0.0) + :pypi:`pytest-pudb` Pytest PuDB debugger integration Oct 25, 2018 3 - Alpha pytest (>=2.0) + :pypi:`pytest-pumpkin-spice` A pytest plugin that makes your test reporting pumpkin-spiced Sep 18, 2022 4 - Beta N/A + :pypi:`pytest-purkinje` py.test plugin for purkinje test runner Oct 28, 2017 2 - Pre-Alpha N/A + :pypi:`pytest-pusher` pytest plugin for push report to minio Jan 06, 2023 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-py125` Dec 03, 2022 N/A N/A + :pypi:`pytest-pycharm` Plugin for py.test to enter PyCharm debugger on uncaught exceptions Aug 13, 2020 5 - Production/Stable pytest (>=2.3) + :pypi:`pytest-pycodestyle` pytest plugin to run pycodestyle Oct 28, 2022 3 - Alpha N/A + :pypi:`pytest-pydev` py.test plugin to connect to a remote debug server with PyDev or PyCharm. Nov 15, 2017 3 - Alpha N/A + :pypi:`pytest-pydocstyle` pytest plugin to run pydocstyle Jan 05, 2023 3 - Alpha N/A + :pypi:`pytest-pylint` pytest plugin to check source code with pylint Sep 10, 2022 5 - Production/Stable pytest (>=5.4) + :pypi:`pytest-pymysql-autorecord` Record PyMySQL queries and mock with the stored data. Sep 02, 2022 N/A N/A + :pypi:`pytest-pyodide` "Pytest plugin for testing applications that use Pyodide" Jan 05, 2023 N/A pytest + :pypi:`pytest-pypi` Easily test your HTTP library against a local copy of pypi Mar 04, 2018 3 - Alpha N/A + :pypi:`pytest-pypom-navigation` Core engine for cookiecutter-qa and pytest-play packages Feb 18, 2019 4 - Beta pytest (>=3.0.7) + :pypi:`pytest-pyppeteer` A plugin to run pyppeteer in pytest Apr 28, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-pyq` Pytest fixture "q" for pyq Mar 10, 2020 5 - Production/Stable N/A + :pypi:`pytest-pyramid` pytest_pyramid - provides fixtures for testing pyramid applications with pytest test suite Dec 13, 2022 5 - Production/Stable pytest + :pypi:`pytest-pyramid-server` Pyramid server fixture for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-pyright` Pytest plugin for type checking code with Pyright Nov 20, 2022 4 - Beta pytest (>=7.0.0) + :pypi:`pytest-pyspec` A plugin that transforms the pytest output into a result similar to the RSpec. It enables the use of docstrings to display results and also enables the use of the prefixes "describe", "with" and "it". Mar 11, 2023 N/A pytest (>=7.2.1,<8.0.0) + :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.0) + :pypi:`pytest-pythonpath` pytest plugin for adding to the PYTHONPATH from command line or configs. Feb 10, 2022 5 - Production/Stable pytest (<7,>=2.5.2) + :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest + :pypi:`pytest-pyvista` Pytest-pyvista package Mar 07, 2023 4 - Beta pytest>=3.5.0 + :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) + :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Feb 14, 2023 4 - Beta pytest (>=6.2.0) + :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jun 26, 2022 5 - Production/Stable pytest (>=6.2.3) + :pypi:`pytest-qml` Run QML Tests with pytest Dec 02, 2020 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-qr` pytest plugin to generate test result QR codes Nov 25, 2021 4 - Beta N/A + :pypi:`pytest-qt` pytest support for PyQt and PySide applications Oct 25, 2022 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-qt-app` QT app fixture for py.test Dec 23, 2015 5 - Production/Stable N/A + :pypi:`pytest-quarantine` A plugin for pytest to manage expected test failures Nov 24, 2019 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-quickcheck` pytest plugin to generate random data inspired by QuickCheck Nov 05, 2022 4 - Beta pytest (>=4.0) + :pypi:`pytest-rabbitmq` RabbitMQ process and client fixtures for pytest Feb 11, 2022 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-race` Race conditions tester for pytest Jun 07, 2022 4 - Beta N/A + :pypi:`pytest-rage` pytest plugin to implement PEP712 Oct 21, 2011 3 - Alpha N/A + :pypi:`pytest-rail` pytest plugin for creating TestRail runs and adding results May 02, 2022 N/A pytest (>=3.6) + :pypi:`pytest-railflow-testrail-reporter` Generate json reports along with specified metadata defined in test markers. Jun 29, 2022 5 - Production/Stable pytest + :pypi:`pytest-raises` An implementation of pytest.raises as a pytest.mark fixture Apr 23, 2020 N/A pytest (>=3.2.2) + :pypi:`pytest-raisesregexp` Simple pytest plugin to look for regex in Exceptions Dec 18, 2015 N/A N/A + :pypi:`pytest-raisin` Plugin enabling the use of exception instances with pytest.raises Feb 06, 2022 N/A pytest + :pypi:`pytest-random` py.test plugin to randomize tests Apr 28, 2013 3 - Alpha N/A + :pypi:`pytest-randomly` Pytest plugin to randomly order tests and control random.seed. May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-randomness` Pytest plugin about random seed management May 30, 2019 3 - Alpha N/A + :pypi:`pytest-random-num` Randomise the order in which pytest tests are run with some control over the randomness Oct 19, 2020 5 - Production/Stable N/A + :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Dec 03, 2022 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-readme` Test your README.md file Sep 02, 2022 5 - Production/Stable N/A + :pypi:`pytest-reana` Pytest fixtures for REANA. Dec 13, 2022 3 - Alpha N/A + :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Feb 16, 2023 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A + :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-redislite` Pytest plugin for testing code using Redis Apr 05, 2022 4 - Beta pytest + :pypi:`pytest-redmine` Pytest plugin for redmine Mar 19, 2018 1 - Planning N/A + :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-reference-formatter` Conveniently run pytest with a dot-formatted test reference. Oct 01, 2019 4 - Beta N/A + :pypi:`pytest-regex-dependency` Management of Pytest dependencies via regex patterns Jun 12, 2022 N/A pytest + :pypi:`pytest-regressions` Easy to use fixtures to write regression tests. Jan 13, 2023 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-regtest` pytest plugin for regression tests Jul 08, 2022 N/A N/A + :pypi:`pytest-relative-order` a pytest plugin that sorts tests using "before" and "after" markers May 17, 2021 4 - Beta N/A + :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Dec 31, 2022 5 - Production/Stable pytest (>=7) + :pypi:`pytest-remfiles` Pytest plugin to create a temporary directory with remote files Jul 01, 2019 5 - Production/Stable N/A + :pypi:`pytest-remotedata` Pytest plugin for controlling remote data access. Dec 12, 2022 3 - Alpha pytest (>=4.6) + :pypi:`pytest-remote-response` Pytest plugin for capturing and mocking connection requests. Jun 05, 2022 4 - Beta pytest (>=4.6) + :pypi:`pytest-remove-stale-bytecode` py.test plugin to remove stale byte code files. Mar 04, 2020 4 - Beta pytest + :pypi:`pytest-reorder` Reorder tests depending on their paths and names. May 31, 2018 4 - Beta pytest + :pypi:`pytest-repeat` pytest plugin for repeating tests Oct 31, 2020 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-replay` Saves previous test runs and allow re-execute previous pytest runs to reproduce crashes or flaky tests Jun 09, 2021 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-repo-health` A pytest plugin to report on repository standards conformance Dec 16, 2021 3 - Alpha pytest + :pypi:`pytest-report` Creates json report that is compatible with atom.io's linter message format May 11, 2016 4 - Beta N/A + :pypi:`pytest-reporter` Generate Pytest reports with templates Jul 22, 2021 4 - Beta pytest + :pypi:`pytest-reporter-html1` A basic HTML report template for Pytest Jun 08, 2021 4 - Beta N/A + :pypi:`pytest-reporter-html-dots` A basic HTML report for pytest using Jinja2 template engine. Jan 22, 2023 N/A N/A + :pypi:`pytest-reportinfra` Pytest plugin for reportinfra Aug 11, 2019 3 - Alpha N/A + :pypi:`pytest-reporting` A plugin to report summarized results in a table format Oct 25, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility Mar 11, 2023 3 - Alpha pytest + :pypi:`pytest-report-me` A pytest plugin to generate report. Dec 31, 2020 N/A pytest + :pypi:`pytest-report-parameters` pytest plugin for adding tests' parameters to junit report Jun 18, 2020 3 - Alpha pytest (>=2.4.2) + :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Feb 20, 2023 N/A pytest (>=3.8.0) + :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) + :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-requestselapsed` collect and show http requests elapsed time Aug 14, 2022 N/A N/A + :pypi:`pytest-requests-futures` Pytest Plugin to Mock Requests Futures Jul 06, 2022 5 - Production/Stable pytest + :pypi:`pytest-requires` A pytest plugin to elegantly skip tests with optional requirements Dec 21, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-reraise` Make multi-threaded pytest test cases fail when they should Sep 20, 2022 5 - Production/Stable pytest (>=4.6) + :pypi:`pytest-rerun` Re-run only changed files in specified branch Jul 08, 2019 N/A pytest (>=3.6) + :pypi:`pytest-rerunfailures` pytest plugin to re-run tests to eliminate flaky failures Mar 09, 2023 5 - Production/Stable pytest (>=5.3) + :pypi:`pytest-rerunfailures-all-logs` pytest plugin to re-run tests to eliminate flaky failures Mar 07, 2022 5 - Production/Stable N/A + :pypi:`pytest-reserial` Pytest fixture for recording and replaying serial port traffic. Nov 29, 2022 4 - Beta pytest + :pypi:`pytest-resilient-circuits` Resilient Circuits fixtures for PyTest Feb 28, 2023 N/A pytest (~=4.6) ; python_version == "2.7" + :pypi:`pytest-resource` Load resource fixture plugin to use with pytest Nov 14, 2018 4 - Beta N/A + :pypi:`pytest-resource-path` Provides path for uniform access to test resources in isolated directory May 01, 2021 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-resource-usage` Pytest plugin for reporting running time and peak memory usage Nov 06, 2022 5 - Production/Stable pytest>=7.0.0 + :pypi:`pytest-responsemock` Simplified requests calls mocking for pytest Mar 10, 2022 5 - Production/Stable N/A + :pypi:`pytest-responses` py.test integration for responses Oct 11, 2022 N/A pytest (>=2.5) + :pypi:`pytest-rest-api` Aug 08, 2022 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-restrict` Pytest plugin to restrict the test types allowed May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-result-log` Write the execution result of the case to the log Feb 02, 2023 N/A pytest>=7.2.0 + :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A + :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Aug 16, 2022 N/A pytest (>=7.0.0) + :pypi:`pytest-reverse` Pytest plugin to reverse test order. May 11, 2022 5 - Production/Stable pytest + :pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0) + :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) + :pypi:`pytest-richtrace` Nov 05, 2022 N/A pytest (>=7.2.0,<8.0.0) + :pypi:`pytest-ringo` pytest plugin to test webapplications using the Ringo webframework Sep 27, 2017 3 - Alpha N/A + :pypi:`pytest-rmsis` Sycronise pytest results to Jira RMsis Aug 10, 2022 N/A pytest (>=5.3.5) + :pypi:`pytest-rng` Fixtures for seeding tests and making randomness reproducible Aug 08, 2019 5 - Production/Stable pytest + :pypi:`pytest-roast` pytest plugin for ROAST configuration override and fixtures Nov 09, 2022 5 - Production/Stable pytest + :pypi:`pytest-rocketchat` Pytest to Rocket.Chat reporting plugin Apr 18, 2021 5 - Production/Stable N/A + :pypi:`pytest-rotest` Pytest integration with rotest Sep 08, 2019 N/A pytest (>=3.5.0) + :pypi:`pytest-rpc` Extend py.test for RPC OpenStack testing. Feb 22, 2019 4 - Beta pytest (~=3.6) + :pypi:`pytest-rst` Test code from RST documents with pytest Jan 26, 2023 N/A N/A + :pypi:`pytest-rt` pytest data collector plugin for Testgr May 05, 2022 N/A N/A + :pypi:`pytest-rts` Coverage-based regression test selection (RTS) plugin for pytest May 17, 2021 N/A pytest + :pypi:`pytest-ruff` pytest plugin to check ruff requirements. Feb 27, 2023 4 - Beta N/A + :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest + :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A + :pypi:`pytest-runner` Invoke py.test as distutils command with dependency resolution Feb 25, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' + :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Nov 12, 2022 5 - Production/Stable pytest + :pypi:`pytest-runtime-types` Checks type annotations on runtime while running tests. Feb 09, 2023 N/A pytest + :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A pytest>=5.0.0 + :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Oct 31, 2022 3 - Alpha N/A + :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A + :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A + :pypi:`pytest-salt-factories` Pytest Salt Plugin Dec 15, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-salt-from-filenames` Simple PyTest Plugin For Salt's Test Suite Specifically Jan 29, 2019 4 - Beta pytest (>=4.1) + :pypi:`pytest-salt-runtests-bridge` Simple PyTest Plugin For Salt's Test Suite Specifically Dec 05, 2019 4 - Beta pytest (>=4.1) + :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) + :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A + :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 11, 2023 5 - Production/Stable N/A + :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A + :pypi:`pytest-schedule` The job of test scheduling for humans. Jan 07, 2023 5 - Production/Stable N/A + :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A + :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) + :pypi:`pytest-selenium` pytest plugin for Selenium Sep 21, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 11, 2023 5 - Production/Stable N/A + :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A + :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A + :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A + :pypi:`pytest-sentry` A pytest plugin to send testrun information to Sentry.io Jan 05, 2023 N/A N/A + :pypi:`pytest-server-fixtures` Extensible server fixures for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-serverless` Automatically mocks resources from serverless.yml in pytest using moto. May 09, 2022 4 - Beta N/A + :pypi:`pytest-servers` pytest servers Feb 24, 2023 3 - Alpha pytest (>=6.2) + :pypi:`pytest-services` Services plugin for pytest testing framework Oct 30, 2020 6 - Mature N/A + :pypi:`pytest-session2file` pytest-session2file (aka: pytest-session_to_file for v0.1.0 - v0.1.2) is a py.test plugin for capturing and saving to file the stdout of py.test. Jan 26, 2021 3 - Alpha pytest + :pypi:`pytest-session-fixture-globalize` py.test plugin to make session fixtures behave as if written in conftest, even if it is written in some modules May 15, 2018 4 - Beta N/A + :pypi:`pytest-session_to_file` pytest-session_to_file is a py.test plugin for capturing and saving to file the stdout of py.test. Oct 01, 2015 3 - Alpha N/A + :pypi:`pytest-setupinfo` Displaying setup info during pytest command run Jan 23, 2023 N/A N/A + :pypi:`pytest-sftpserver` py.test plugin to locally test sftp server connections. Sep 16, 2019 4 - Beta N/A + :pypi:`pytest-shard` Dec 11, 2020 4 - Beta pytest + :pypi:`pytest-share-hdf` Plugin to save test data in HDF files and retrieve them for comparison Sep 21, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-sharkreport` this is pytest report plugin. Jul 11, 2022 N/A pytest (>=3.5) + :pypi:`pytest-shell` A pytest plugin to help with testing shell scripts / black box commands Mar 27, 2022 N/A N/A + :pypi:`pytest-shell-utilities` Pytest plugin to simplify running shell commands against the system Sep 23, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-sheraf` Versatile ZODB abstraction layer - pytest fixtures Feb 11, 2020 N/A pytest + :pypi:`pytest-sherlock` pytest plugin help to find coupled tests Jan 16, 2023 5 - Production/Stable pytest (>=3.5.1) + :pypi:`pytest-shortcuts` Expand command-line shortcuts listed in pytest configuration Oct 29, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-shutil` A goodie-bag of unix shell and environment tools for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-simplehttpserver` Simple pytest fixture to spin up an HTTP server Jun 24, 2021 4 - Beta N/A + :pypi:`pytest-simple-plugin` Simple pytest plugin Nov 27, 2019 N/A N/A + :pypi:`pytest-simple-settings` simple-settings plugin for pytest Nov 17, 2020 4 - Beta pytest + :pypi:`pytest-single-file-logging` Allow for multiple processes to log to a single file May 05, 2016 4 - Beta pytest (>=2.8.1) + :pypi:`pytest-skip-markers` Pytest Salt Plugin Dec 20, 2022 5 - Production/Stable pytest (>=7.1.0) + :pypi:`pytest-skipper` A plugin that selects only tests with changes in execution path Mar 26, 2017 3 - Alpha pytest (>=3.0.6) + :pypi:`pytest-skippy` Automatically skip tests that don't need to run! Jan 27, 2018 3 - Alpha pytest (>=2.3.4) + :pypi:`pytest-skip-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Feb 09, 2023 N/A pytest>=6.2.0 + :pypi:`pytest-slack` Pytest to Slack reporting plugin Dec 15, 2020 5 - Production/Stable N/A + :pypi:`pytest-slow` A pytest plugin to skip \`@pytest.mark.slow\` tests by default. Sep 28, 2021 N/A N/A + :pypi:`pytest-slowest-first` Sort tests by their last duration, slowest first Dec 11, 2022 4 - Beta N/A + :pypi:`pytest-slow-last` Run tests in order of execution time (faster tests first) Dec 10, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-smartcollect` A plugin for collecting tests that touch changed code Oct 04, 2018 N/A pytest (>=3.5.0) + :pypi:`pytest-smartcov` Smart coverage plugin for pytest. Sep 30, 2017 3 - Alpha N/A + :pypi:`pytest-smell` Automated bad smell detection tool for Pytest Jun 26, 2022 N/A N/A + :pypi:`pytest-smtp` Send email with pytest execution result Feb 20, 2021 N/A pytest + :pypi:`pytest-snail` Plugin for adding a marker to slow running tests. 🐌 Nov 04, 2019 3 - Alpha pytest (>=5.0.1) + :pypi:`pytest-snapci` py.test plugin for Snap-CI Nov 12, 2015 N/A N/A + :pypi:`pytest-snapshot` A plugin for snapshot testing with pytest. Apr 23, 2022 4 - Beta pytest (>=3.0.0) + :pypi:`pytest-snmpserver` May 12, 2021 N/A N/A + :pypi:`pytest-snowflake-bdd` Setup test data and run tests on snowflake in BDD style! Jan 05, 2022 4 - Beta pytest (>=6.2.0) + :pypi:`pytest-socket` Pytest Plugin to disable socket calls during tests Feb 03, 2023 4 - Beta pytest (>=3.6.3) + :pypi:`pytest-sofaepione` Test the installation of SOFA and the SofaEpione plugin. Aug 17, 2022 N/A N/A + :pypi:`pytest-soft-assertions` May 05, 2020 3 - Alpha pytest + :pypi:`pytest-solidity` A PyTest library plugin for Solidity language. Jan 15, 2022 1 - Planning pytest (<7,>=6.0.1) ; extra == 'tests' + :pypi:`pytest-solr` Solr process and client fixtures for py.test. May 11, 2020 3 - Alpha pytest (>=3.0.0) + :pypi:`pytest-sorter` A simple plugin to first execute tests that historically failed more Apr 20, 2021 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-sosu` Unofficial PyTest plugin for Sauce Labs Feb 14, 2023 2 - Pre-Alpha pytest + :pypi:`pytest-sourceorder` Test-ordering plugin for pytest Sep 01, 2021 4 - Beta pytest + :pypi:`pytest-spark` pytest plugin to run the tests with support of pyspark. Feb 23, 2020 4 - Beta pytest + :pypi:`pytest-spawner` py.test plugin to spawn process and communicate with them. Jul 31, 2015 4 - Beta N/A + :pypi:`pytest-spec` Library pytest-spec is a pytest plugin to display test execution output like a SPECIFICATION. May 04, 2021 N/A N/A + :pypi:`pytest-spec2md` Library pytest-spec2md is a pytest plugin to create a markdown specification while running pytest. Jun 26, 2022 N/A pytest (>7.0) + :pypi:`pytest-speed` Modern benchmarking library for python with pytest integration. Jan 22, 2023 3 - Alpha pytest>=7 + :pypi:`pytest-sphinx` Doctest plugin for pytest with support for Sphinx-specific doctest-directives Sep 06, 2022 4 - Beta pytest (>=7.0.0) + :pypi:`pytest-spiratest` Exports unit tests as test runs in SpiraTest/Team/Plan Feb 08, 2022 N/A N/A + :pypi:`pytest-splinter` Splinter plugin for pytest testing framework Sep 09, 2022 6 - Mature pytest (>=3.0.0) + :pypi:`pytest-splinter4` Pytest plugin for the splinter automation library Jun 11, 2022 6 - Mature pytest (<8.0,>=7.1.2) + :pypi:`pytest-split` Pytest plugin which splits the test suite to equally sized sub suites based on test execution time. Apr 22, 2022 4 - Beta pytest (>=5,<8) + :pypi:`pytest-splitio` Split.io SDK integration for e2e tests Sep 22, 2020 N/A pytest (<7,>=5.0) + :pypi:`pytest-split-tests` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Forked from Mark Adams' original project pytest-test-groups. Jul 30, 2021 5 - Production/Stable pytest (>=2.5) + :pypi:`pytest-split-tests-tresorit` Feb 22, 2021 1 - Planning N/A + :pypi:`pytest-splunk-addon` A Dynamic test tool for Splunk Apps and Add-ons Feb 22, 2023 N/A pytest (>5.4.0,<7.3) + :pypi:`pytest-splunk-addon-ui-smartx` Library to support testing Splunk Add-on UX Mar 07, 2023 N/A N/A + :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) + :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A + :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Mar 13, 2018 3 - Alpha N/A + :pypi:`pytest-sqlalchemy-mock` pytest sqlalchemy plugin for mock Sep 25, 2022 3 - Alpha pytest (>=2.0) + :pypi:`pytest-sql-bigquery` Yet another SQL-testing framework for BigQuery provided by pytest plugin Dec 19, 2019 N/A pytest + :pypi:`pytest-sqlfluff` A pytest plugin to use sqlfluff to enable format checking of sql files. Dec 21, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-squadcast` Pytest report plugin for Squadcast Feb 22, 2022 5 - Production/Stable pytest + :pypi:`pytest-srcpaths` Add paths to sys.path Oct 15, 2021 N/A pytest>=6.2.0 + :pypi:`pytest-ssh` pytest plugin for ssh command run May 27, 2019 N/A pytest + :pypi:`pytest-start-from` Start pytest run from a given point Apr 11, 2016 N/A N/A + :pypi:`pytest-star-track-issue` A package to prevent Dependency Confusion attacks against Yandex. Feb 10, 2023 N/A N/A + :pypi:`pytest-statsd` pytest plugin for reporting to graphite Nov 30, 2018 5 - Production/Stable pytest (>=3.0.0) + :pypi:`pytest-stepfunctions` A small description May 08, 2021 4 - Beta pytest + :pypi:`pytest-steps` Create step-wise / incremental tests in pytest. Sep 23, 2021 5 - Production/Stable N/A + :pypi:`pytest-stepwise` Run a test suite one failing test at a time. Dec 01, 2015 4 - Beta N/A + :pypi:`pytest-stf` pytest plugin for openSTF Dec 04, 2022 N/A pytest (>=5.0) + :pypi:`pytest-stoq` A plugin to pytest stoq Feb 09, 2021 4 - Beta N/A + :pypi:`pytest-stress` A Pytest plugin that allows you to loop tests for a user defined amount of time. Dec 07, 2019 4 - Beta pytest (>=3.6.0) + :pypi:`pytest-structlog` Structured logging assertions Dec 18, 2022 N/A pytest + :pypi:`pytest-structmpd` provide structured temporary directory Oct 17, 2018 N/A N/A + :pypi:`pytest-stub` Stub packages, modules and attributes. Apr 28, 2020 5 - Production/Stable N/A + :pypi:`pytest-stubprocess` Provide stub implementations for subprocesses in Python tests Sep 17, 2018 3 - Alpha pytest (>=3.5.0) + :pypi:`pytest-study` A pytest plugin to organize long run tests (named studies) without interfering the regular tests Sep 26, 2017 3 - Alpha pytest (>=2.0) + :pypi:`pytest-subprocess` A plugin to fake subprocess for pytest Jan 28, 2023 5 - Production/Stable pytest (>=4.0.0) + :pypi:`pytest-subtesthack` A hack to explicitly set up and tear down fixtures. Jul 16, 2022 N/A N/A + :pypi:`pytest-subtests` unittest subTest() support and subtests fixture Feb 16, 2023 4 - Beta pytest (>=7.0) + :pypi:`pytest-subunit` pytest-subunit is a plugin for py.test which outputs testsresult in subunit format. Aug 29, 2017 N/A N/A + :pypi:`pytest-sugar` pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Nov 05, 2022 3 - Alpha pytest (>=2.9) + :pypi:`pytest-svn` SVN repository fixture for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-symbols` pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. Nov 20, 2017 3 - Alpha N/A + :pypi:`pytest-system-statistics` Pytest plugin to track and report system usage statistics Feb 16, 2022 5 - Production/Stable pytest (>=6.0.0) + :pypi:`pytest-system-test-plugin` Pyst - Pytest System-Test Plugin Feb 03, 2022 N/A N/A + :pypi:`pytest-tagging` a pytest plugin to tag tests Oct 23, 2022 N/A pytest (>=7.1.3,<8.0.0) + :pypi:`pytest-takeltest` Fixtures for ansible, testinfra and molecule Feb 15, 2023 N/A N/A + :pypi:`pytest-talisker` Nov 28, 2021 N/A N/A + :pypi:`pytest-tap` Test Anything Protocol (TAP) reporting plugin for pytest Oct 27, 2021 5 - Production/Stable pytest (>=3.0) + :pypi:`pytest-tape` easy assertion with expected results saved to yaml files Mar 17, 2021 4 - Beta N/A + :pypi:`pytest-target` Pytest plugin for remote target orchestration. Jan 21, 2021 3 - Alpha pytest (>=6.1.2,<7.0.0) + :pypi:`pytest-tblineinfo` tblineinfo is a py.test plugin that insert the node id in the final py.test report when --tb=line option is used Dec 01, 2015 3 - Alpha pytest (>=2.0) + :pypi:`pytest-tcpclient` A pytest plugin for testing TCP clients Nov 16, 2022 N/A pytest (<8,>=7.1.3) + :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A + :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A + :pypi:`pytest-telegram-notifier` Telegram notification plugin for Pytest Feb 27, 2023 5 - Production/Stable N/A + :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) + :pypi:`pytest-terra-fixt` Terraform and Terragrunt fixtures for pytest Sep 15, 2022 N/A pytest (==6.2.5) + :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Sep 01, 2022 N/A pytest (>=6.0) + :pypi:`pytest-terraform-fixture` generate terraform resources to use with pytest Nov 14, 2018 4 - Beta N/A + :pypi:`pytest-testbook` A plugin to run tests written in Jupyter notebook Dec 11, 2016 3 - Alpha N/A + :pypi:`pytest-testconfig` Test configuration plugin for pytest. Jan 11, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-testdirectory` A py.test plugin providing temporary directories in unit tests. Feb 21, 2022 5 - Production/Stable pytest + :pypi:`pytest-testdox` A testdox format reporter for pytest Apr 19, 2022 5 - Production/Stable pytest (>=4.6.0) + :pypi:`pytest-test-grouping` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Feb 01, 2023 5 - Production/Stable pytest (>=2.5) + :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A + :pypi:`pytest-testinfra` Test infrastructures Dec 01, 2022 5 - Production/Stable pytest (!=3.0.2) + :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) + :pypi:`pytest-testmon` selects tests affected by changed files and methods Feb 27, 2023 4 - Beta pytest (<8,>=5) + :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) + :pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Mar 03, 2023 4 - Beta pytest (<8,>=5) + :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-testpluggy` set your encoding Jan 07, 2022 N/A pytest + :pypi:`pytest-testrail` pytest plugin for creating TestRail runs and adding results Aug 27, 2020 N/A pytest (>=3.6) + :pypi:`pytest-testrail2` A pytest plugin to upload results to TestRail. Feb 10, 2023 N/A pytest (<8.0,>=7.2.0) + :pypi:`pytest-testrail-api-client` TestRail Api Python Client Dec 14, 2021 N/A pytest + :pypi:`pytest-testrail-appetize` pytest plugin for creating TestRail runs and adding results Sep 29, 2021 N/A N/A + :pypi:`pytest-testrail-client` pytest plugin for Testrail Sep 29, 2020 5 - Production/Stable N/A + :pypi:`pytest-testrail-e2e` pytest plugin for creating TestRail runs and adding results Oct 11, 2021 N/A pytest (>=3.6) + :pypi:`pytest-testrail-integrator` Pytest plugin for sending report to testrail system. Aug 01, 2022 N/A pytest (>=6.2.5) + :pypi:`pytest-testrail-ns` pytest plugin for creating TestRail runs and adding results Aug 12, 2022 N/A N/A + :pypi:`pytest-testrail-plugin` PyTest plugin for TestRail Apr 21, 2020 3 - Alpha pytest + :pypi:`pytest-testrail-reporter` Sep 10, 2018 N/A N/A + :pypi:`pytest-testreport` Dec 01, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-testreport-new` Aug 15, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-testslide` TestSlide fixture for pytest Jan 07, 2021 5 - Production/Stable pytest (~=6.2) + :pypi:`pytest-test-this` Plugin for py.test to run relevant tests, based on naively checking if a test contains a reference to the symbol you supply Sep 15, 2019 2 - Pre-Alpha pytest (>=2.3) + :pypi:`pytest-test-utils` Jul 14, 2022 N/A pytest (>=5) + :pypi:`pytest-tesults` Tesults plugin for pytest Dec 23, 2022 5 - Production/Stable pytest (>=3.5.0) + :pypi:`pytest-tezos` pytest-ligo Jan 16, 2020 4 - Beta N/A + :pypi:`pytest-th2-bdd` pytest_th2_bdd May 13, 2022 N/A N/A + :pypi:`pytest-thawgun` Pytest plugin for time travel May 26, 2020 3 - Alpha N/A + :pypi:`pytest-threadleak` Detects thread leaks Jul 03, 2022 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-tick` Ticking on tests Aug 31, 2021 5 - Production/Stable pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-timeit` A pytest plugin to time test function runs Oct 13, 2016 4 - Beta N/A + :pypi:`pytest-timeout` pytest plugin to abort hanging tests Jan 18, 2022 5 - Production/Stable pytest (>=5.0.0) + :pypi:`pytest-timeouts` Linux-only Pytest plugin to control durations of various test case execution phases Sep 21, 2019 5 - Production/Stable N/A + :pypi:`pytest-timer` A timer plugin for pytest Jun 02, 2021 N/A N/A + :pypi:`pytest-timestamper` Pytest plugin to add a timestamp prefix to the pytest output Jun 06, 2021 N/A N/A + :pypi:`pytest-timestamps` A simple plugin to view timestamps for each test Jan 16, 2022 N/A pytest (>=5.2) + :pypi:`pytest-tipsi-django` Nov 17, 2021 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-tipsi-testing` Better fixtures management. Various helpers Nov 04, 2020 4 - Beta pytest (>=3.3.0) + :pypi:`pytest-tldr` A pytest plugin that limits the output to just the things you need. Oct 26, 2022 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-tm4j-reporter` Cloud Jira Test Management (TM4J) PyTest reporter plugin Sep 01, 2020 N/A pytest + :pypi:`pytest-tmnet` A small example package Mar 01, 2022 N/A N/A + :pypi:`pytest-tmp-files` Utilities to create temporary file hierarchies in pytest. Apr 03, 2022 N/A pytest + :pypi:`pytest-tmpfs` A pytest plugin that helps you on using a temporary filesystem for testing. Aug 29, 2022 N/A pytest + :pypi:`pytest-tmreport` this is a vue-element ui report for pytest Aug 12, 2022 N/A N/A + :pypi:`pytest-tmux` A pytest plugin that enables tmux driven tests Feb 15, 2023 4 - Beta N/A + :pypi:`pytest-todo` A small plugin for the pytest testing framework, marking TODO comments as failure May 23, 2019 4 - Beta pytest + :pypi:`pytest-tomato` Mar 01, 2019 5 - Production/Stable N/A + :pypi:`pytest-toolbelt` This is just a collection of utilities for pytest, but don't really belong in pytest proper. Aug 12, 2019 3 - Alpha N/A + :pypi:`pytest-toolbox` Numerous useful plugins for pytest. Apr 07, 2018 N/A pytest (>=3.5.0) + :pypi:`pytest-tools` Pytest tools Oct 21, 2022 4 - Beta N/A + :pypi:`pytest-tornado` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Jun 17, 2020 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-tornado5` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Nov 16, 2018 5 - Production/Stable pytest (>=3.6) + :pypi:`pytest-tornado-yen3` A py.test plugin providing fixtures and markers to simplify testing of asynchronous tornado applications. Oct 15, 2018 5 - Production/Stable N/A + :pypi:`pytest-tornasync` py.test plugin for testing Python 3.5+ Tornado code Jul 15, 2019 3 - Alpha pytest (>=3.0) + :pypi:`pytest-trace` Save OpenTelemetry spans generated during testing Jun 19, 2022 N/A pytest (>=4.6) + :pypi:`pytest-track` Feb 26, 2021 3 - Alpha pytest (>=3.0) + :pypi:`pytest-translations` Test your translation files. Nov 05, 2021 5 - Production/Stable N/A + :pypi:`pytest-travis-fold` Folds captured output sections in Travis CI build log Nov 29, 2017 4 - Beta pytest (>=2.6.0) + :pypi:`pytest-trello` Plugin for py.test that integrates trello using markers Nov 20, 2015 5 - Production/Stable N/A + :pypi:`pytest-trepan` Pytest plugin for trepan debugger. Jul 28, 2018 5 - Production/Stable N/A + :pypi:`pytest-trialtemp` py.test plugin for using the same _trial_temp working directory as trial Jun 08, 2015 N/A N/A + :pypi:`pytest-trio` Pytest plugin for trio Nov 01, 2022 N/A pytest (>=7.2.0) + :pypi:`pytest-trytond` Pytest plugin for the Tryton server framework Nov 04, 2022 4 - Beta pytest (>=5) + :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Apr 27, 2022 N/A pytest (>=5.0.0) + :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A + :pypi:`pytest-tui` Text User Interface (TUI) and HTML report for Pytest test runs Feb 01, 2023 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tutorials` Mar 11, 2023 N/A N/A + :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A + :pypi:`pytest-twisted` A twisted plugin for pytest. Oct 16, 2022 5 - Production/Stable pytest (>=2.3) + :pypi:`pytest-typechecker` Run type checkers on specified test files Feb 04, 2022 N/A pytest (>=6.2.5,<7.0.0) + :pypi:`pytest-typhoon-config` A Typhoon HIL plugin that facilitates test parameter configuration at runtime Apr 07, 2022 5 - Production/Stable N/A + :pypi:`pytest-typhoon-xray` Typhoon HIL plugin for pytest Nov 04, 2022 4 - Beta N/A + :pypi:`pytest-tytest` Typhoon HIL plugin for pytest May 25, 2020 4 - Beta pytest (>=5.4.2) + :pypi:`pytest-ubersmith` Easily mock calls to ubersmith at the \`requests\` level. Apr 13, 2015 N/A N/A + :pypi:`pytest-ui` Text User Interface for running python tests Jul 05, 2021 4 - Beta pytest + :pypi:`pytest-ui-failed-screenshot` UI自动测试失败时自动截图,并将截图加入到测试报告中 Dec 06, 2022 N/A N/A + :pypi:`pytest-ui-failed-screenshot-allure` UI自动测试失败时自动截图,并将截图加入到Allure测试报告中 Dec 06, 2022 N/A N/A + :pypi:`pytest-unflakable` Unflakable plugin for PyTest Oct 26, 2022 4 - Beta pytest (>=6.2.0) + :pypi:`pytest-unhandled-exception-exit-code` Plugin for py.test set a different exit code on uncaught exceptions Jun 22, 2020 5 - Production/Stable pytest (>=2.3) + :pypi:`pytest-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) + :pypi:`pytest-unmarked` Run only unmarked tests Aug 27, 2019 5 - Production/Stable N/A + :pypi:`pytest-unordered` Test equality of unordered collections in pytest Nov 28, 2022 4 - Beta pytest (>=6.0.0) + :pypi:`pytest-unstable` Set a test as unstable to return 0 even if it failed Sep 27, 2022 4 - Beta N/A + :pypi:`pytest-upload-report` pytest-upload-report is a plugin for pytest that upload your test report for test results. Jun 18, 2021 5 - Production/Stable N/A + :pypi:`pytest-utils` Some helpers for pytest. Feb 02, 2023 4 - Beta pytest (>=7.0.0,<8.0.0) + :pypi:`pytest-vagrant` A py.test plugin providing access to vagrant. Sep 07, 2021 5 - Production/Stable pytest + :pypi:`pytest-valgrind` May 19, 2021 N/A N/A + :pypi:`pytest-variables` pytest plugin for providing variables to tests/fixtures Mar 27, 2022 5 - Production/Stable pytest (>=3.0.0,<8.0.0) + :pypi:`pytest-variant` Variant support for Pytest Jun 06, 2022 N/A N/A + :pypi:`pytest-vcr` Plugin for managing VCR.py cassettes Apr 26, 2019 5 - Production/Stable pytest (>=3.6.0) + :pypi:`pytest-vcr-delete-on-fail` A pytest plugin that automates vcrpy cassettes deletion on test failure. Jun 20, 2022 5 - Production/Stable pytest (>=6.2.2) + :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest + :pypi:`pytest-vcs` Sep 22, 2022 4 - Beta N/A + :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest + :pypi:`pytest-ver` Pytest module with Verification Protocol, Verification Report and Trace Matrix Mar 05, 2023 4 - Beta N/A + :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) + :pypi:`pytest-virtualenv` Virtualenv fixture for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-vnc` VNC client for Pytest Feb 25, 2023 N/A pytest + :pypi:`pytest-voluptuous` Pytest plugin for asserting data against voluptuous schema. Jun 09, 2020 N/A pytest + :pypi:`pytest-vscodedebug` A pytest plugin to easily enable debugging tests within Visual Studio Code Dec 04, 2020 4 - Beta N/A + :pypi:`pytest-vscode-pycharm-cls` A PyTest helper to enable start remote debugger on test start or failure or when pytest.set_trace is used. Feb 01, 2023 N/A pytest + :pypi:`pytest-vts` pytest plugin for automatic recording of http stubbed tests Jun 05, 2019 N/A pytest (>=2.3) + :pypi:`pytest-vulture` A pytest plugin to checks dead code with vulture Oct 12, 2022 N/A pytest (>=7.0.0) + :pypi:`pytest-vw` pytest-vw makes your failing test cases succeed under CI tools scrutiny Oct 07, 2015 4 - Beta N/A + :pypi:`pytest-vyper` Plugin for the vyper smart contract language. May 28, 2020 2 - Pre-Alpha N/A + :pypi:`pytest-wa-e2e-plugin` Pytest plugin for testing whatsapp bots with end to end tests Feb 18, 2020 4 - Beta pytest (>=3.5.0) + :pypi:`pytest-wake` Feb 27, 2023 N/A pytest + :pypi:`pytest-watch` Local continuous test runner with pytest and watchdog. May 20, 2018 N/A N/A + :pypi:`pytest-watcher` Continiously runs pytest on changes in \*.py files Dec 11, 2022 3 - Alpha N/A + :pypi:`pytest-wdl` Pytest plugin for testing WDL workflows. Nov 17, 2020 5 - Production/Stable N/A + :pypi:`pytest-web3-data` Sep 15, 2022 4 - Beta pytest + :pypi:`pytest-webdriver` Selenium webdriver fixture for py.test May 28, 2019 5 - Production/Stable pytest + :pypi:`pytest-wetest` Welian API Automation test framework pytest plugin Nov 10, 2018 4 - Beta N/A + :pypi:`pytest-whirlwind` Testing Tornado. Jun 12, 2020 N/A N/A + :pypi:`pytest-wholenodeid` pytest addon for displaying the whole node id for failures Aug 26, 2015 4 - Beta pytest (>=2.0) + :pypi:`pytest-win32consoletitle` Pytest progress in console title (Win32 only) Aug 08, 2021 N/A N/A + :pypi:`pytest-winnotify` Windows tray notifications for py.test results. Apr 22, 2016 N/A N/A + :pypi:`pytest-wiremock` A pytest plugin for programmatically using wiremock in integration tests Mar 27, 2022 N/A pytest (>=7.1.1,<8.0.0) + :pypi:`pytest-with-docker` pytest with docker helpers. Nov 09, 2021 N/A pytest + :pypi:`pytest-workflow` A pytest plugin for configuring workflow/pipeline tests using YAML files Jan 13, 2023 5 - Production/Stable pytest (>=7.0.0) + :pypi:`pytest-xdist` pytest xdist plugin for distributed testing, most importantly across multiple CPUs Feb 07, 2023 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-xdist-debug-for-graingert` pytest xdist plugin for distributed testing and loop-on-failing modes Jul 24, 2019 5 - Production/Stable pytest (>=4.4.0) + :pypi:`pytest-xdist-forked` forked from pytest-xdist Feb 10, 2020 5 - Production/Stable pytest (>=4.4.0) + :pypi:`pytest-xdist-tracker` pytest plugin helps to reproduce failures for particular xdist node Nov 18, 2021 3 - Alpha pytest (>=3.5.1) + :pypi:`pytest-xfaillist` Maintain a xfaillist in an additional file to avoid merge-conflicts. Sep 17, 2021 N/A pytest (>=6.2.2,<7.0.0) + :pypi:`pytest-xfiles` Pytest fixtures providing data read from function, module or package related (x)files. Feb 27, 2018 N/A N/A + :pypi:`pytest-xlog` Extended logging for test and decorators May 31, 2020 4 - Beta N/A + :pypi:`pytest-xlsx` pytest plugin for generating test cases by xlsx(excel) Mar 01, 2023 N/A pytest>=7.2.0 + :pypi:`pytest-xpara` An extended parametrizing plugin of pytest. Oct 30, 2017 3 - Alpha pytest + :pypi:`pytest-xprocess` A pytest plugin for managing processes across test runs. Jan 05, 2023 4 - Beta pytest (>=2.8) + :pypi:`pytest-xray` May 30, 2019 3 - Alpha N/A + :pypi:`pytest-xrayjira` Mar 17, 2020 3 - Alpha pytest (==4.3.1) + :pypi:`pytest-xray-server` May 03, 2022 3 - Alpha pytest (>=5.3.1) + :pypi:`pytest-xskynet` A package to prevent Dependency Confusion attacks against Yandex. Feb 10, 2023 N/A N/A + :pypi:`pytest-xvfb` A pytest plugin to run Xvfb for tests. Jun 09, 2020 4 - Beta pytest (>=2.8.1) + :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest + :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-yamlwsgi` Run tests against wsgi apps defined in yaml May 11, 2010 N/A N/A + :pypi:`pytest-yaml-yoyo` http/https API run by yaml Feb 17, 2023 N/A pytest (==7.2.0) + :pypi:`pytest-yapf` Run yapf Jul 06, 2017 4 - Beta pytest (>=3.1.1) + :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) + :pypi:`pytest-yield` PyTest plugin to run tests concurrently, each \`yield\` switch context to other one Jan 23, 2019 N/A N/A + :pypi:`pytest-yls` Pytest plugin to test the YLS as a whole. Mar 06, 2023 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A pytest>=5.0.0 + :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) + :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A + :pypi:`pytest-zebrunner` Pytest connector for Zebrunner reporting Dec 12, 2022 5 - Production/Stable pytest (>=4.5.0) + :pypi:`pytest-zest` Zesty additions to pytest. Nov 17, 2022 N/A N/A + :pypi:`pytest-zigzag` Extend py.test for RPC OpenStack testing. Feb 27, 2019 4 - Beta pytest (~=3.6) + :pypi:`pytest-zulip` Pytest report plugin for Zulip May 07, 2022 5 - Production/Stable pytest + =============================================== ======================================================================================================================================================================================================== ============== ===================== ================================================ .. only:: latex @@ -2688,7 +2694,7 @@ This list contains 1215 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Feb 28, 2023, + *last release*: Mar 11, 2023, *status*: N/A, *requires*: N/A @@ -3647,49 +3653,49 @@ This list contains 1215 plugins. Send execution result email :pypi:`pytest-embedded` - *last release*: Feb 06, 2023, + *last release*: Mar 10, 2023, *status*: N/A, *requires*: pytest (>=7.0) pytest embedded plugin :pypi:`pytest-embedded-arduino` - *last release*: Feb 06, 2023, + *last release*: Mar 10, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for Arduino projects :pypi:`pytest-embedded-idf` - *last release*: Feb 06, 2023, + *last release*: Mar 10, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for esp-idf project :pypi:`pytest-embedded-jtag` - *last release*: Feb 06, 2023, + *last release*: Mar 10, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for testing with jtag :pypi:`pytest-embedded-qemu` - *last release*: Feb 06, 2023, + *last release*: Mar 10, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for qemu, not target chip :pypi:`pytest-embedded-serial` - *last release*: Feb 06, 2023, + *last release*: Mar 10, 2023, *status*: N/A, *requires*: N/A pytest embedded plugin for testing serial ports :pypi:`pytest-embedded-serial-esp` - *last release*: Feb 06, 2023, + *last release*: Mar 10, 2023, *status*: N/A, *requires*: N/A @@ -3878,7 +3884,7 @@ This list contains 1215 plugins. py.test plugin to store test expectations and mark tests based on them :pypi:`pytest-expectdir` - *last release*: Jan 24, 2023, + *last release*: Mar 09, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) @@ -3940,6 +3946,13 @@ This list contains 1215 plugins. A pytest plugin to get durations on a per-function basis and per module basis. + :pypi:`pytest-extra-markers` + *last release*: Mar 05, 2023, + *status*: 4 - Beta, + *requires*: pytest + + Additional pytest markers to dynamically enable/disable tests viia CLI flags + :pypi:`pytest-fabric` *last release*: Sep 12, 2018, *status*: 5 - Production/Stable, @@ -4311,6 +4324,13 @@ This list contains 1215 plugins. A pytest plugin that alerts user of failed test cases with screen notifications + :pypi:`pytest-forbid` + *last release*: Mar 07, 2023, + *status*: N/A, + *requires*: pytest (>=7.2.2,<8.0.0) + + + :pypi:`pytest-forcefail` *last release*: May 15, 2018, *status*: 4 - Beta, @@ -4445,7 +4465,7 @@ This list contains 1215 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Mar 03, 2023, + *last release*: Mar 08, 2023, *status*: N/A, *requires*: N/A @@ -4500,6 +4520,13 @@ This list contains 1215 plugins. py.test plugin to ignore the same files as git + :pypi:`pytest-gitlabci-parallelized` + *last release*: Mar 08, 2023, + *status*: N/A, + *requires*: N/A + + Parallelize pytest across GitLab CI workers. + :pypi:`pytest-git-selector` *last release*: Nov 17, 2022, *status*: N/A, @@ -4599,7 +4626,7 @@ This list contains 1215 plugins. A plugin to provide different types and configs of Kubernetes clusters that can be used for testing. :pypi:`pytest-helm-charts` - *last release*: Oct 19, 2022, + *last release*: Mar 08, 2023, *status*: 4 - Beta, *requires*: pytest (>=7.1.2,<8.0.0) @@ -4655,7 +4682,7 @@ This list contains 1215 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Mar 03, 2023, + *last release*: Mar 10, 2023, *status*: 3 - Alpha, *requires*: pytest (==7.2.1) @@ -4704,7 +4731,7 @@ This list contains 1215 plugins. Helpers for testing hpfeeds in your python project :pypi:`pytest-html` - *last release*: Oct 25, 2022, + *last release*: Mar 05, 2023, *status*: 5 - Production/Stable, *requires*: pytest (!=6.0.0,>=5.0) @@ -4879,7 +4906,7 @@ This list contains 1215 plugins. ignore failures from flaky tests (pytest plugin) :pypi:`pytest-image-diff` - *last release*: Jan 29, 2023, + *last release*: Mar 09, 2023, *status*: 3 - Alpha, *requires*: pytest @@ -5340,6 +5367,13 @@ This list contains 1215 plugins. It helps to use fixtures in pytest.mark.parametrize + :pypi:`pytest-lazy-fixtures` + *last release*: Mar 11, 2023, + *status*: N/A, + *requires*: pytest (>=7.2.1,<8.0.0) + + Allows you to use fixtures in @pytest.mark.parametrize. + :pypi:`pytest-ldap` *last release*: Aug 18, 2020, *status*: N/A, @@ -5537,7 +5571,7 @@ This list contains 1215 plugins. :pypi:`pytest-logikal` - *last release*: Feb 28, 2023, + *last release*: Mar 09, 2023, *status*: 5 - Production/Stable, *requires*: pytest (==7.2.1) @@ -5593,7 +5627,7 @@ This list contains 1215 plugins. Test your markdown docs with pytest :pypi:`pytest-markdown-docs` - *last release*: Sep 02, 2022, + *last release*: Mar 09, 2023, *status*: N/A, *requires*: N/A @@ -6048,7 +6082,7 @@ This list contains 1215 plugins. Pytest plugin to check mypy output. :pypi:`pytest-mysql` - *last release*: Feb 15, 2022, + *last release*: Mar 10, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2) @@ -6125,7 +6159,7 @@ This list contains 1215 plugins. pytest ngs fixtures :pypi:`pytest-nhsd-apim` - *last release*: Jan 09, 2023, + *last release*: Mar 06, 2023, *status*: N/A, *requires*: pytest (==6.2.5) @@ -6257,8 +6291,15 @@ This list contains 1215 plugins. pytest plugin to test OpenERP modules + :pypi:`pytest-offline` + *last release*: Mar 09, 2023, + *status*: 1 - Planning, + *requires*: pytest (>=7.0.0,<8.0.0) + + + :pypi:`pytest-ogsm-plugin` - *last release*: Feb 21, 2023, + *last release*: Mar 08, 2023, *status*: N/A, *requires*: N/A @@ -6293,7 +6334,7 @@ This list contains 1215 plugins. Pytest plugin for detecting inadvertent open file handles :pypi:`pytest-opentelemetry` - *last release*: Nov 12, 2022, + *last release*: Mar 10, 2023, *status*: N/A, *requires*: pytest @@ -6335,7 +6376,7 @@ This list contains 1215 plugins. A pytest plugin for orchestrating tests :pypi:`pytest-order` - *last release*: Jan 09, 2022, + *last release*: Mar 10, 2023, *status*: 4 - Beta, *requires*: pytest (>=5.0) ; python_version < "3.10" @@ -6657,7 +6698,7 @@ This list contains 1215 plugins. Pytest plugin for reading playbooks. :pypi:`pytest-playwright` - *last release*: Feb 28, 2023, + *last release*: Mar 10, 2023, *status*: N/A, *requires*: pytest (<8.0.0,>=6.2.4) @@ -7042,11 +7083,11 @@ This list contains 1215 plugins. Pytest plugin for type checking code with Pyright :pypi:`pytest-pyspec` - *last release*: Mar 01, 2023, + *last release*: Mar 11, 2023, *status*: N/A, *requires*: pytest (>=7.2.1,<8.0.0) - A python test spec based on pytest + A plugin that transforms the pytest output into a result similar to the RSpec. It enables the use of docstrings to display results and also enables the use of the prefixes "describe", "with" and "it". :pypi:`pytest-pytestrail` *last release*: Aug 27, 2020, @@ -7070,7 +7111,7 @@ This list contains 1215 plugins. pytest plugin for a better developer experience when working with the PyTorch test suite :pypi:`pytest-pyvista` - *last release*: Feb 07, 2023, + *last release*: Mar 07, 2023, *status*: 4 - Beta, *requires*: pytest>=3.5.0 @@ -7427,9 +7468,9 @@ This list contains 1215 plugins. A plugin to report summarized results in a table format :pypi:`pytest-reportlog` - *last release*: Dec 11, 2020, + *last release*: Mar 11, 2023, *status*: 3 - Alpha, - *requires*: pytest (>=5.2) + *requires*: pytest Replacement for the --resultlog option, focused in simplicity and extensibility @@ -7504,7 +7545,7 @@ This list contains 1215 plugins. Re-run only changed files in specified branch :pypi:`pytest-rerunfailures` - *last release*: Feb 17, 2023, + *last release*: Mar 09, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=5.3) @@ -7812,7 +7853,7 @@ This list contains 1215 plugins. :pypi:`pytest-sbase` - *last release*: Mar 04, 2023, + *last release*: Mar 11, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -7861,7 +7902,7 @@ This list contains 1215 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Mar 04, 2023, + *last release*: Mar 11, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -8323,7 +8364,7 @@ This list contains 1215 plugins. A Dynamic test tool for Splunk Apps and Add-ons :pypi:`pytest-splunk-addon-ui-smartx` - *last release*: Mar 02, 2023, + *last release*: Mar 07, 2023, *status*: N/A, *requires*: N/A @@ -9155,6 +9196,13 @@ This list contains 1215 plugins. Text User Interface (TUI) and HTML report for Pytest test runs + :pypi:`pytest-tutorials` + *last release*: Mar 11, 2023, + *status*: N/A, + *requires*: N/A + + + :pypi:`pytest-twilio-conversations-client-mock` *last release*: Aug 02, 2022, *status*: N/A, @@ -9345,8 +9393,8 @@ This list contains 1215 plugins. py.test fixture for creating a virtual environment :pypi:`pytest-ver` - *last release*: Mar 04, 2023, - *status*: 2 - Pre-Alpha, + *last release*: Mar 05, 2023, + *status*: 4 - Beta, *requires*: N/A Pytest module with Verification Protocol, Verification Report and Trace Matrix @@ -9688,7 +9736,7 @@ This list contains 1215 plugins. PyTest plugin to run tests concurrently, each \`yield\` switch context to other one :pypi:`pytest-yls` - *last release*: Feb 22, 2023, + *last release*: Mar 06, 2023, *status*: N/A, *requires*: pytest (>=7.1.2,<8.0.0) From ab069247cd8b54f88ff8811174f99e4c6421e966 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 08:00:07 -0300 Subject: [PATCH 536/549] build(deps): Bump pytest-rerunfailures in /testing/plugins_integration (#10812) Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 11.1.1 to 11.1.2. - [Release notes](https://github.com/pytest-dev/pytest-rerunfailures/releases) - [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst) - [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/11.1.1...11.1.2) --- updated-dependencies: - dependency-name: pytest-rerunfailures dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index bf0e3017650..be9d3022def 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -7,7 +7,7 @@ pytest-django==4.5.2 pytest-flakes==4.0.5 pytest-html==3.2.0 pytest-mock==3.10.0 -pytest-rerunfailures==11.1.1 +pytest-rerunfailures==11.1.2 pytest-sugar==0.9.5 pytest-trio==0.7.0 pytest-twisted==1.14.0 From eada68b2b3ac4814319f79f4bb72ec42809f0e07 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 08:17:13 -0300 Subject: [PATCH 537/549] [pre-commit.ci] pre-commit autoupdate (#10814) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/PyCQA/autoflake: v2.0.1 → v2.0.2](https://github.com/PyCQA/autoflake/compare/v2.0.1...v2.0.2) - [github.com/pre-commit/mirrors-mypy: v1.0.1 → v1.1.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.0.1...v1.1.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bfc1d893b9a..8826b00fe3e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,7 @@ repos: exclude: _pytest/(debugging|hookspec).py language_version: python3 - repo: https://github.com/PyCQA/autoflake - rev: v2.0.1 + rev: v2.0.2 hooks: - id: autoflake name: autoflake @@ -58,7 +58,7 @@ repos: hooks: - id: python-use-type-annotations - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.0.1 + rev: v1.1.1 hooks: - id: mypy files: ^(src/|testing/) From 431ec6d34ef99d80f90b330876ed6231144a3ce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Hofst=C3=A4tter?= Date: Wed, 15 Mar 2023 12:10:25 +0100 Subject: [PATCH 538/549] Correctly handle tracebackhide for chained exceptions (#10772) --- AUTHORS | 1 + changelog/1904.bugfix.rst | 1 + src/_pytest/_code/code.py | 27 +++++++++++++++++---------- src/_pytest/reports.py | 4 ++++ testing/code/test_excinfo.py | 6 ++---- testing/test_tracebackhide.py | 25 +++++++++++++++++++++++++ 6 files changed, 50 insertions(+), 14 deletions(-) create mode 100644 changelog/1904.bugfix.rst create mode 100644 testing/test_tracebackhide.py diff --git a/AUTHORS b/AUTHORS index f72932b99c4..05823646188 100644 --- a/AUTHORS +++ b/AUTHORS @@ -128,6 +128,7 @@ Erik M. Bray Evan Kepner Fabien Zarifian Fabio Zadrozny +Felix Hofstätter Felix Nieuwenhuizen Feng Ma Florian Bruhin diff --git a/changelog/1904.bugfix.rst b/changelog/1904.bugfix.rst new file mode 100644 index 00000000000..dc8e0f34217 --- /dev/null +++ b/changelog/1904.bugfix.rst @@ -0,0 +1 @@ +Correctly handle ``__tracebackhide__`` for chained exceptions. diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index 44ce8fac91a..e375fb70c44 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -411,13 +411,13 @@ def filter( """ return Traceback(filter(fn, self), self._excinfo) - def getcrashentry(self) -> TracebackEntry: + def getcrashentry(self) -> Optional[TracebackEntry]: """Return last non-hidden traceback entry that lead to the exception of a traceback.""" for i in range(-1, -len(self) - 1, -1): entry = self[i] if not entry.ishidden(): return entry - return self[-1] + return None def recursionindex(self) -> Optional[int]: """Return the index of the frame/TracebackEntry where recursion originates if @@ -602,11 +602,13 @@ def errisinstance( """ return isinstance(self.value, exc) - def _getreprcrash(self) -> "ReprFileLocation": + def _getreprcrash(self) -> Optional["ReprFileLocation"]: exconly = self.exconly(tryshort=True) entry = self.traceback.getcrashentry() - path, lineno = entry.frame.code.raw.co_filename, entry.lineno - return ReprFileLocation(path, lineno + 1, exconly) + if entry: + path, lineno = entry.frame.code.raw.co_filename, entry.lineno + return ReprFileLocation(path, lineno + 1, exconly) + return None def getrepr( self, @@ -942,9 +944,14 @@ def repr_excinfo( ) else: reprtraceback = self.repr_traceback(excinfo_) - reprcrash: Optional[ReprFileLocation] = ( - excinfo_._getreprcrash() if self.style != "value" else None - ) + + # will be None if all traceback entries are hidden + reprcrash: Optional[ReprFileLocation] = excinfo_._getreprcrash() + if reprcrash: + if self.style == "value": + repr_chain += [(reprtraceback, None, descr)] + else: + repr_chain += [(reprtraceback, reprcrash, descr)] else: # Fallback to native repr if the exception doesn't have a traceback: # ExceptionInfo objects require a full traceback to work. @@ -952,8 +959,8 @@ def repr_excinfo( traceback.format_exception(type(e), e, None) ) reprcrash = None + repr_chain += [(reprtraceback, reprcrash, descr)] - repr_chain += [(reprtraceback, reprcrash, descr)] if e.__cause__ is not None and self.chain: e = e.__cause__ excinfo_ = ( @@ -1044,7 +1051,7 @@ def toterminal(self, tw: TerminalWriter) -> None: @dataclasses.dataclass(eq=False) class ReprExceptionInfo(ExceptionRepr): reprtraceback: "ReprTraceback" - reprcrash: "ReprFileLocation" + reprcrash: Optional["ReprFileLocation"] def toterminal(self, tw: TerminalWriter) -> None: self.reprtraceback.toterminal(tw) diff --git a/src/_pytest/reports.py b/src/_pytest/reports.py index 2e36514eae5..c0a76f92b59 100644 --- a/src/_pytest/reports.py +++ b/src/_pytest/reports.py @@ -347,6 +347,10 @@ def from_item_and_call(cls, item: Item, call: "CallInfo[None]") -> "TestReport": elif isinstance(excinfo.value, skip.Exception): outcome = "skipped" r = excinfo._getreprcrash() + if r is None: + raise ValueError( + "There should always be a traceback entry for skipping a test." + ) if excinfo.value._use_item_location: path, line = item.reportinfo()[:2] assert line is not None diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index e428b9c5ca9..3607501a84e 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -294,6 +294,7 @@ def f(): excinfo = pytest.raises(ValueError, f) tb = excinfo.traceback entry = tb.getcrashentry() + assert entry is not None co = _pytest._code.Code.from_function(h) assert entry.frame.code.path == co.path assert entry.lineno == co.firstlineno + 1 @@ -311,10 +312,7 @@ def f(): excinfo = pytest.raises(ValueError, f) tb = excinfo.traceback entry = tb.getcrashentry() - co = _pytest._code.Code.from_function(g) - assert entry.frame.code.path == co.path - assert entry.lineno == co.firstlineno + 2 - assert entry.frame.code.name == "g" + assert entry is None def test_excinfo_exconly(): diff --git a/testing/test_tracebackhide.py b/testing/test_tracebackhide.py new file mode 100644 index 00000000000..88f9c4fc00e --- /dev/null +++ b/testing/test_tracebackhide.py @@ -0,0 +1,25 @@ +def test_tbh_chained(testdir): + """Ensure chained exceptions whose frames contain "__tracebackhide__" are not shown (#1904).""" + p = testdir.makepyfile( + """ + import pytest + + def f1(): + __tracebackhide__ = True + try: + return f1.meh + except AttributeError: + pytest.fail("fail") + + @pytest.fixture + def fix(): + f1() + + + def test(fix): + pass + """ + ) + result = testdir.runpytest(str(p)) + assert "'function' object has no attribute 'meh'" not in result.stdout.str() + assert result.ret == 1 From 407b330fe10a2290389c61b6ecf3bb2c7714f465 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sun, 12 Feb 2023 09:46:07 +0100 Subject: [PATCH 539/549] split up report header lines i found it painful to read crammed in a single line thus rootdir, config file and testpaths now have own lines --- changelog/10727.improvement.rst | 1 + src/_pytest/terminal.py | 8 +++----- testing/test_config.py | 2 +- testing/test_terminal.py | 12 ++++++------ 4 files changed, 11 insertions(+), 12 deletions(-) create mode 100644 changelog/10727.improvement.rst diff --git a/changelog/10727.improvement.rst b/changelog/10727.improvement.rst new file mode 100644 index 00000000000..92cb8cc33a6 --- /dev/null +++ b/changelog/10727.improvement.rst @@ -0,0 +1 @@ +Split the report header for ``rootdir``, ``config file`` and ``testpaths`` so each has its own line. diff --git a/src/_pytest/terminal.py b/src/_pytest/terminal.py index 323c118e44b..dfc0fa98e18 100644 --- a/src/_pytest/terminal.py +++ b/src/_pytest/terminal.py @@ -739,16 +739,14 @@ def _write_report_lines_from_hooks( self.write_line(line) def pytest_report_header(self, config: Config) -> List[str]: - line = "rootdir: %s" % config.rootpath + result = [f"rootdir: {config.rootpath}"] if config.inipath: - line += ", configfile: " + bestrelpath(config.rootpath, config.inipath) + result.append("configfile: " + bestrelpath(config.rootpath, config.inipath)) if config.args_source == Config.ArgsSource.TESTPATHS: testpaths: List[str] = config.getini("testpaths") - line += ", testpaths: {}".format(", ".join(testpaths)) - - result = [line] + result.append("testpaths: {}".format(", ".join(testpaths))) plugininfo = config.pluginmanager.list_plugin_distinfo() if plugininfo: diff --git a/testing/test_config.py b/testing/test_config.py index 35e2a601ca4..6754cd15bf4 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -74,7 +74,7 @@ def test_setupcfg_uses_toolpytest_with_pytest(self, pytester: Pytester) -> None: % p1.name, ) result = pytester.runpytest() - result.stdout.fnmatch_lines(["*, configfile: setup.cfg, *", "* 1 passed in *"]) + result.stdout.fnmatch_lines(["configfile: setup.cfg", "* 1 passed in *"]) assert result.ret == 0 def test_append_parse_args( diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 8a77e107d95..fe325b72d29 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -909,7 +909,7 @@ def test_header(self, pytester: Pytester) -> None: # with configfile pytester.makeini("""[pytest]""") result = pytester.runpytest() - result.stdout.fnmatch_lines(["rootdir: *test_header0, configfile: tox.ini"]) + result.stdout.fnmatch_lines(["rootdir: *test_header0", "configfile: tox.ini"]) # with testpaths option, and not passing anything in the command-line pytester.makeini( @@ -920,12 +920,12 @@ def test_header(self, pytester: Pytester) -> None: ) result = pytester.runpytest() result.stdout.fnmatch_lines( - ["rootdir: *test_header0, configfile: tox.ini, testpaths: tests, gui"] + ["rootdir: *test_header0", "configfile: tox.ini", "testpaths: tests, gui"] ) # with testpaths option, passing directory in command-line: do not show testpaths then result = pytester.runpytest("tests") - result.stdout.fnmatch_lines(["rootdir: *test_header0, configfile: tox.ini"]) + result.stdout.fnmatch_lines(["rootdir: *test_header0", "configfile: tox.ini"]) def test_header_absolute_testpath( self, pytester: Pytester, monkeypatch: MonkeyPatch @@ -944,9 +944,9 @@ def test_header_absolute_testpath( result = pytester.runpytest() result.stdout.fnmatch_lines( [ - "rootdir: *absolute_testpath0, configfile: pyproject.toml, testpaths: {}".format( - tests - ) + "rootdir: *absolute_testpath0", + "configfile: pyproject.toml", + f"testpaths: {tests}", ] ) From ba969d2ae749d7b284cf14d15e56a08162fb2b32 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Fri, 17 Mar 2023 09:32:08 +0100 Subject: [PATCH 540/549] run regendoc --- doc/en/builtin.rst | 60 +++++++------ doc/en/example/parametrize.rst | 8 +- doc/en/example/pythoncollection.rst | 9 +- doc/en/example/reportingdemo.rst | 135 ++++++++++++++-------------- doc/en/example/simple.rst | 44 +-------- doc/en/getting-started.rst | 2 +- doc/en/how-to/output.rst | 6 +- doc/en/how-to/writing_plugins.rst | 3 +- doc/en/reference/reference.rst | 14 ++- 9 files changed, 128 insertions(+), 153 deletions(-) diff --git a/doc/en/builtin.rst b/doc/en/builtin.rst index 453be4ad320..7e9b51d002d 100644 --- a/doc/en/builtin.rst +++ b/doc/en/builtin.rst @@ -22,7 +22,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a cachedir: .pytest_cache rootdir: /home/sweet/project collected 0 items - cache -- .../_pytest/cacheprovider.py:509 + cache -- .../_pytest/cacheprovider.py:510 Return a cache object that can persist state between testing sessions. cache.get(key, default) @@ -33,25 +33,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a Values can be any object handled by the json stdlib module. - capsys -- .../_pytest/capture.py:905 - Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``. - - The captured output is made available via ``capsys.readouterr()`` method - calls, which return a ``(out, err)`` namedtuple. - ``out`` and ``err`` will be ``text`` objects. - - Returns an instance of :class:`CaptureFixture[str] `. - - Example: - - .. code-block:: python - - def test_output(capsys): - print("hello") - captured = capsys.readouterr() - assert captured.out == "hello\n" - - capsysbinary -- .../_pytest/capture.py:933 + capsysbinary -- .../_pytest/capture.py:1001 Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``. The captured output is made available via ``capsysbinary.readouterr()`` @@ -69,7 +51,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a captured = capsysbinary.readouterr() assert captured.out == b"hello\n" - capfd -- .../_pytest/capture.py:961 + capfd -- .../_pytest/capture.py:1029 Enable text capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method @@ -87,7 +69,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a captured = capfd.readouterr() assert captured.out == "hello\n" - capfdbinary -- .../_pytest/capture.py:989 + capfdbinary -- .../_pytest/capture.py:1057 Enable bytes capturing of writes to file descriptors ``1`` and ``2``. The captured output is made available via ``capfd.readouterr()`` method @@ -105,7 +87,25 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a captured = capfdbinary.readouterr() assert captured.out == b"hello\n" - doctest_namespace [session scope] -- .../_pytest/doctest.py:738 + capsys -- .../_pytest/capture.py:973 + Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``. + + The captured output is made available via ``capsys.readouterr()`` method + calls, which return a ``(out, err)`` namedtuple. + ``out`` and ``err`` will be ``text`` objects. + + Returns an instance of :class:`CaptureFixture[str] `. + + Example: + + .. code-block:: python + + def test_output(capsys): + print("hello") + captured = capsys.readouterr() + assert captured.out == "hello\n" + + doctest_namespace [session scope] -- .../_pytest/doctest.py:737 Fixture that returns a :py:class:`dict` that will be injected into the namespace of doctests. @@ -119,7 +119,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a For more details: :ref:`doctest_namespace`. - pytestconfig [session scope] -- .../_pytest/fixtures.py:1356 + pytestconfig [session scope] -- .../_pytest/fixtures.py:1360 Session-scoped fixture that returns the session's :class:`pytest.Config` object. @@ -196,7 +196,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a .. _legacy_path: https://py.readthedocs.io/en/latest/path.html - caplog -- .../_pytest/logging.py:491 + caplog -- .../_pytest/logging.py:498 Access and control log capturing. Captured logs are available through the following properties/methods:: @@ -237,17 +237,19 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a See https://docs.pytest.org/en/latest/how-to/capture-warnings.html for information on warning categories. - tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:188 + tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:245 Return a :class:`pytest.TempPathFactory` instance for the test session. - tmp_path -- .../_pytest/tmpdir.py:203 + tmp_path -- .../_pytest/tmpdir.py:260 Return a temporary directory path object which is unique to each test function invocation, created as a sub directory of the base temporary directory. By default, a new base temporary directory is created each test session, - and old bases are removed after 3 sessions, to aid in debugging. If - ``--basetemp`` is used then it is cleared each session. See :ref:`base + and old bases are removed after 3 sessions, to aid in debugging. + This behavior can be configured with :confval:`tmp_path_retention_count` and + :confval:`tmp_path_retention_policy`. + If ``--basetemp`` is used then it is cleared each session. See :ref:`base temporary directory`. The returned object is a :class:`pathlib.Path` object. diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index df2859b14e0..1b25dfaf72a 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -502,12 +502,8 @@ Running it results in some skips if we don't have all the python interpreters in .. code-block:: pytest . $ pytest -rs -q multipython.py - sssssssssssssssssssssssssss [100%] - ========================= short test summary info ========================== - SKIPPED [9] multipython.py:69: 'python3.5' not found - SKIPPED [9] multipython.py:69: 'python3.6' not found - SKIPPED [9] multipython.py:69: 'python3.7' not found - 27 skipped in 0.12s + ........................... [100%] + 27 passed in 0.12s Indirect parametrization of optional implementations/imports -------------------------------------------------------------------- diff --git a/doc/en/example/pythoncollection.rst b/doc/en/example/pythoncollection.rst index b9c2386ac51..2451e3cab49 100644 --- a/doc/en/example/pythoncollection.rst +++ b/doc/en/example/pythoncollection.rst @@ -148,7 +148,8 @@ The test collection would look like this: $ pytest --collect-only =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y - rootdir: /home/sweet/project, configfile: pytest.ini + rootdir: /home/sweet/project + configfile: pytest.ini collected 2 items @@ -209,7 +210,8 @@ You can always peek at the collection tree without running tests like this: . $ pytest --collect-only pythoncollection.py =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y - rootdir: /home/sweet/project, configfile: pytest.ini + rootdir: /home/sweet/project + configfile: pytest.ini collected 3 items @@ -290,7 +292,8 @@ file will be left out: $ pytest --collect-only =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y - rootdir: /home/sweet/project, configfile: pytest.ini + rootdir: /home/sweet/project + configfile: pytest.ini collected 0 items ======================= no tests collected in 0.12s ======================== diff --git a/doc/en/example/reportingdemo.rst b/doc/en/example/reportingdemo.rst index 4c1ae1c05af..20dc0a019f2 100644 --- a/doc/en/example/reportingdemo.rst +++ b/doc/en/example/reportingdemo.rst @@ -70,12 +70,12 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert not f() E assert not 42 - E + where 42 = .f at 0xdeadbeef0006>() + E + where 42 = .f at 0xdeadbeef0002>() failure_demo.py:39: AssertionError _________________ TestSpecialisedExplanations.test_eq_text _________________ - self = + self = def test_eq_text(self): > assert "spam" == "eggs" @@ -86,7 +86,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:44: AssertionError _____________ TestSpecialisedExplanations.test_eq_similar_text _____________ - self = + self = def test_eq_similar_text(self): > assert "foo 1 bar" == "foo 2 bar" @@ -99,7 +99,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:47: AssertionError ____________ TestSpecialisedExplanations.test_eq_multiline_text ____________ - self = + self = def test_eq_multiline_text(self): > assert "foo\nspam\nbar" == "foo\neggs\nbar" @@ -112,7 +112,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:50: AssertionError ______________ TestSpecialisedExplanations.test_eq_long_text _______________ - self = + self = def test_eq_long_text(self): a = "1" * 100 + "a" + "2" * 100 @@ -129,7 +129,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:55: AssertionError _________ TestSpecialisedExplanations.test_eq_long_text_multiline __________ - self = + self = def test_eq_long_text_multiline(self): a = "1\n" * 100 + "a" + "2\n" * 100 @@ -144,12 +144,12 @@ Here is a nice run of several failures and how ``pytest`` presents things: E 1 E 1... E - E ...Full output truncated (7 lines hidden), use '-vv' to show + E ...Full output truncated (6 lines hidden), use '-vv' to show failure_demo.py:60: AssertionError _________________ TestSpecialisedExplanations.test_eq_list _________________ - self = + self = def test_eq_list(self): > assert [0, 1, 2] == [0, 1, 3] @@ -160,7 +160,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:63: AssertionError ______________ TestSpecialisedExplanations.test_eq_list_long _______________ - self = + self = def test_eq_list_long(self): a = [0] * 100 + [1] + [3] * 100 @@ -173,7 +173,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:68: AssertionError _________________ TestSpecialisedExplanations.test_eq_dict _________________ - self = + self = def test_eq_dict(self): > assert {"a": 0, "b": 1, "c": 0} == {"a": 0, "b": 2, "d": 0} @@ -184,32 +184,30 @@ Here is a nice run of several failures and how ``pytest`` presents things: E Left contains 1 more item: E {'c': 0} E Right contains 1 more item: - E {'d': 0}... - E - E ...Full output truncated (2 lines hidden), use '-vv' to show + E {'d': 0} + E Use -v to get more diff failure_demo.py:71: AssertionError _________________ TestSpecialisedExplanations.test_eq_set __________________ - self = + self = def test_eq_set(self): > assert {0, 10, 11, 12} == {0, 20, 21} - E AssertionError: assert {0, 10, 11, 12} == {0, 20, 21} + E assert {0, 10, 11, 12} == {0, 20, 21} E Extra items in the left set: E 10 E 11 E 12 E Extra items in the right set: E 20 - E 21... - E - E ...Full output truncated (2 lines hidden), use '-vv' to show + E 21 + E Use -v to get more diff failure_demo.py:74: AssertionError _____________ TestSpecialisedExplanations.test_eq_longer_list ______________ - self = + self = def test_eq_longer_list(self): > assert [1, 2] == [1, 2, 3] @@ -220,7 +218,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:77: AssertionError _________________ TestSpecialisedExplanations.test_in_list _________________ - self = + self = def test_in_list(self): > assert 1 in [0, 2, 3, 4, 5] @@ -229,7 +227,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:80: AssertionError __________ TestSpecialisedExplanations.test_not_in_text_multiline __________ - self = + self = def test_not_in_text_multiline(self): text = "some multiline\ntext\nwhich\nincludes foo\nand a\ntail" @@ -241,14 +239,13 @@ Here is a nice run of several failures and how ``pytest`` presents things: E which E includes foo E ? +++ - E and a... - E - E ...Full output truncated (2 lines hidden), use '-vv' to show + E and a + E tail failure_demo.py:84: AssertionError ___________ TestSpecialisedExplanations.test_not_in_text_single ____________ - self = + self = def test_not_in_text_single(self): text = "single foo line" @@ -261,7 +258,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:88: AssertionError _________ TestSpecialisedExplanations.test_not_in_text_single_long _________ - self = + self = def test_not_in_text_single_long(self): text = "head " * 50 + "foo " + "tail " * 20 @@ -274,7 +271,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:92: AssertionError ______ TestSpecialisedExplanations.test_not_in_text_single_long_term _______ - self = + self = def test_not_in_text_single_long_term(self): text = "head " * 50 + "f" * 70 + "tail " * 20 @@ -287,7 +284,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:96: AssertionError ______________ TestSpecialisedExplanations.test_eq_dataclass _______________ - self = + self = def test_eq_dataclass(self): from dataclasses import dataclass @@ -307,14 +304,14 @@ Here is a nice run of several failures and how ``pytest`` presents things: E ['b'] E E Drill down into differing attribute b: - E b: 'b' != 'c'... - E - E ...Full output truncated (3 lines hidden), use '-vv' to show + E b: 'b' != 'c' + E - c + E + b failure_demo.py:108: AssertionError ________________ TestSpecialisedExplanations.test_eq_attrs _________________ - self = + self = def test_eq_attrs(self): import attr @@ -334,9 +331,9 @@ Here is a nice run of several failures and how ``pytest`` presents things: E ['b'] E E Drill down into differing attribute b: - E b: 'b' != 'c'... - E - E ...Full output truncated (3 lines hidden), use '-vv' to show + E b: 'b' != 'c' + E - c + E + b failure_demo.py:120: AssertionError ______________________________ test_attribute ______________________________ @@ -348,7 +345,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: i = Foo() > assert i.b == 2 E assert 1 == 2 - E + where 1 = .Foo object at 0xdeadbeef0018>.b + E + where 1 = .Foo object at 0xdeadbeef0017>.b failure_demo.py:128: AssertionError _________________________ test_attribute_instance __________________________ @@ -359,8 +356,8 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert Foo().b == 2 E AssertionError: assert 1 == 2 - E + where 1 = .Foo object at 0xdeadbeef0019>.b - E + where .Foo object at 0xdeadbeef0019> = .Foo'>() + E + where 1 = .Foo object at 0xdeadbeef0018>.b + E + where .Foo object at 0xdeadbeef0018> = .Foo'>() failure_demo.py:135: AssertionError __________________________ test_attribute_failure __________________________ @@ -378,7 +375,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:146: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - self = .Foo object at 0xdeadbeef001a> + self = .Foo object at 0xdeadbeef0019> def _get_b(self): > raise Exception("Failed to get attrib") @@ -396,15 +393,15 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert Foo().b == Bar().b E AssertionError: assert 1 == 2 - E + where 1 = .Foo object at 0xdeadbeef001b>.b - E + where .Foo object at 0xdeadbeef001b> = .Foo'>() - E + and 2 = .Bar object at 0xdeadbeef001c>.b - E + where .Bar object at 0xdeadbeef001c> = .Bar'>() + E + where 1 = .Foo object at 0xdeadbeef001a>.b + E + where .Foo object at 0xdeadbeef001a> = .Foo'>() + E + and 2 = .Bar object at 0xdeadbeef001b>.b + E + where .Bar object at 0xdeadbeef001b> = .Bar'>() failure_demo.py:156: AssertionError __________________________ TestRaises.test_raises __________________________ - self = + self = def test_raises(self): s = "qwe" @@ -414,7 +411,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:166: ValueError ______________________ TestRaises.test_raises_doesnt _______________________ - self = + self = def test_raises_doesnt(self): > raises(OSError, int, "3") @@ -423,7 +420,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:169: Failed __________________________ TestRaises.test_raise ___________________________ - self = + self = def test_raise(self): > raise ValueError("demo error") @@ -432,7 +429,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:172: ValueError ________________________ TestRaises.test_tupleerror ________________________ - self = + self = def test_tupleerror(self): > a, b = [1] # NOQA @@ -441,7 +438,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:175: ValueError ______ TestRaises.test_reinterpret_fails_with_print_for_the_fun_of_it ______ - self = + self = def test_reinterpret_fails_with_print_for_the_fun_of_it(self): items = [1, 2, 3] @@ -454,7 +451,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: items is [1, 2, 3] ________________________ TestRaises.test_some_error ________________________ - self = + self = def test_some_error(self): > if namenotexi: # NOQA @@ -485,7 +482,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: abc-123:2: AssertionError ____________________ TestMoreErrors.test_complex_error _____________________ - self = + self = def test_complex_error(self): def f(): @@ -511,7 +508,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:6: AssertionError ___________________ TestMoreErrors.test_z1_unpack_error ____________________ - self = + self = def test_z1_unpack_error(self): items = [] @@ -521,7 +518,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:217: ValueError ____________________ TestMoreErrors.test_z2_type_error _____________________ - self = + self = def test_z2_type_error(self): items = 3 @@ -531,20 +528,20 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:221: TypeError ______________________ TestMoreErrors.test_startswith ______________________ - self = + self = def test_startswith(self): s = "123" g = "456" > assert s.startswith(g) E AssertionError: assert False - E + where False = ('456') - E + where = '123'.startswith + E + where False = ('456') + E + where = '123'.startswith failure_demo.py:226: AssertionError __________________ TestMoreErrors.test_startswith_nested ___________________ - self = + self = def test_startswith_nested(self): def f(): @@ -555,15 +552,15 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert f().startswith(g()) E AssertionError: assert False - E + where False = ('456') - E + where = '123'.startswith - E + where '123' = .f at 0xdeadbeef0029>() - E + and '456' = .g at 0xdeadbeef002a>() + E + where False = ('456') + E + where = '123'.startswith + E + where '123' = .f at 0xdeadbeef0028>() + E + and '456' = .g at 0xdeadbeef0029>() failure_demo.py:235: AssertionError _____________________ TestMoreErrors.test_global_func ______________________ - self = + self = def test_global_func(self): > assert isinstance(globf(42), float) @@ -574,18 +571,18 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:238: AssertionError _______________________ TestMoreErrors.test_instance _______________________ - self = + self = def test_instance(self): self.x = 6 * 7 > assert self.x != 42 E assert 42 != 42 - E + where 42 = .x + E + where 42 = .x failure_demo.py:242: AssertionError _______________________ TestMoreErrors.test_compare ________________________ - self = + self = def test_compare(self): > assert globf(10) < 5 @@ -595,7 +592,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:245: AssertionError _____________________ TestMoreErrors.test_try_finally ______________________ - self = + self = def test_try_finally(self): x = 1 @@ -606,7 +603,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:250: AssertionError ___________________ TestCustomAssertMsg.test_single_line ___________________ - self = + self = def test_single_line(self): class A: @@ -621,7 +618,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:261: AssertionError ____________________ TestCustomAssertMsg.test_multiline ____________________ - self = + self = def test_multiline(self): class A: @@ -640,7 +637,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:268: AssertionError ___________________ TestCustomAssertMsg.test_custom_repr ___________________ - self = + self = def test_custom_repr(self): class JSON: @@ -673,7 +670,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_list - asser... FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_list_long - ... FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_dict - Asser... - FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_set - Assert... + FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_set - assert... FAILED failure_demo.py::TestSpecialisedExplanations::test_eq_longer_list FAILED failure_demo.py::TestSpecialisedExplanations::test_in_list - asser... FAILED failure_demo.py::TestSpecialisedExplanations::test_not_in_text_multiline diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index a528e50ef6e..d07585b97fa 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -951,46 +951,10 @@ and run it: .. code-block:: pytest $ pytest -s test_module.py - =========================== test session starts ============================ - platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y - rootdir: /home/sweet/project - collected 3 items - - test_module.py Esetting up a test failed! test_module.py::test_setup_fails - Fexecuting test failed test_module.py::test_call_fails - F - - ================================== ERRORS ================================== - ____________________ ERROR at setup of test_setup_fails ____________________ - - @pytest.fixture - def other(): - > assert 0 - E assert 0 - - test_module.py:7: AssertionError - ================================= FAILURES ================================= - _____________________________ test_call_fails ______________________________ - - something = None - - def test_call_fails(something): - > assert 0 - E assert 0 - - test_module.py:15: AssertionError - ________________________________ test_fail2 ________________________________ - - def test_fail2(): - > assert 0 - E assert 0 - - test_module.py:19: AssertionError - ========================= short test summary info ========================== - FAILED test_module.py::test_call_fails - assert 0 - FAILED test_module.py::test_fail2 - assert 0 - ERROR test_module.py::test_setup_fails - assert 0 - ======================== 2 failed, 1 error in 0.12s ======================== + ImportError while loading conftest '/home/sweet/project/conftest.py'. + conftest.py:4: in + phase_report_key = StashKey[Dict[str, CollectReport]]() + E NameError: name 'StashKey' is not defined You'll see that the fixture finalizers could use the precise reporting information. diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index b36c2e3ccae..ccb56779d5a 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -22,7 +22,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 7.2.2 + pytest 7.2.0.dev533+gd08c8e337 .. _`simpletest`: diff --git a/doc/en/how-to/output.rst b/doc/en/how-to/output.rst index 7d900ce3fdb..e8e9af0c70b 100644 --- a/doc/en/how-to/output.rst +++ b/doc/en/how-to/output.rst @@ -167,9 +167,9 @@ Now we can increase pytest's verbosity: E Right contains 4 more items: E {'10': 10, '20': 20, '30': 30, '40': 40} E Full diff: - E - {'0': 0, '10': 10, '20': 20, '30': 30, '40': 40}... - E - E ...Full output truncated (3 lines hidden), use '-vv' to show + E - {'0': 0, '10': 10, '20': 20, '30': 30, '40': 40} + E ? - - - - - - - - + E + {'0': 0, '1': 1, '2': 2, '3': 3, '4': 4} test_verbosity_example.py:14: AssertionError ___________________________ test_long_text_fail ____________________________ diff --git a/doc/en/how-to/writing_plugins.rst b/doc/en/how-to/writing_plugins.rst index 4eee1b2e120..6f321110718 100644 --- a/doc/en/how-to/writing_plugins.rst +++ b/doc/en/how-to/writing_plugins.rst @@ -449,7 +449,8 @@ in our ``pytest.ini`` to tell pytest where to look for example files. $ pytest =========================== test session starts ============================ platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y - rootdir: /home/sweet/project, configfile: pytest.ini + rootdir: /home/sweet/project + configfile: pytest.ini collected 2 items test_example.py .. [100%] diff --git a/doc/en/reference/reference.rst b/doc/en/reference/reference.rst index 3e364b84f39..963e666ade3 100644 --- a/doc/en/reference/reference.rst +++ b/doc/en/reference/reference.rst @@ -1995,6 +1995,9 @@ All the command-line flags can be obtained by running ``pytest --help``:: --log-auto-indent=LOG_AUTO_INDENT Auto-indent multiline messages passed to the logging module. Accepts true|on, false|off or an integer. + --log-disable=LOGGER_DISABLE + Disable a logger by name. Can be passed multipe + times. [pytest] ini-options in the first pytest.ini|tox.ini|setup.cfg|pyproject.toml file found: @@ -2024,9 +2027,18 @@ All the command-line flags can be obtained by running ``pytest --help``:: console_output_style (string): Console output: "classic", or with additional progress information ("progress" (percentage) | - "count") + "count" | "progress-even-when-capture-no" (forces + progress even when capture=no) xfail_strict (bool): Default for the strict parameter of xfail markers when not given explicitly (default: False) + tmp_path_retention_count (string): + How many sessions should we keep the `tmp_path` + directories, according to + `tmp_path_retention_policy`. + tmp_path_retention_policy (string): + Controls which directories created by the `tmp_path` + fixture are kept around, based on test outcome. + (all/failed/none) enable_assertion_pass_hook (bool): Enables the pytest_assertion_pass hook. Make sure to delete any previously generated pyc cache files. From 54864f0c9b44dead80a0f4d6601a2da1e0203a19 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Fri, 17 Mar 2023 21:56:41 +0100 Subject: [PATCH 541/549] bugfix: fix imports for simple example --- doc/en/example/simple.rst | 47 ++++++++++++++++++++++++++++++++++---- doc/en/getting-started.rst | 2 +- 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index d07585b97fa..fa3e68ce94a 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -892,8 +892,9 @@ here is a little example implemented via a local plugin: .. code-block:: python # content of conftest.py - + from typing import Dict import pytest + from pytest import StashKey, CollectReport phase_report_key = StashKey[Dict[str, CollectReport]]() @@ -951,10 +952,46 @@ and run it: .. code-block:: pytest $ pytest -s test_module.py - ImportError while loading conftest '/home/sweet/project/conftest.py'. - conftest.py:4: in - phase_report_key = StashKey[Dict[str, CollectReport]]() - E NameError: name 'StashKey' is not defined + =========================== test session starts ============================ + platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y + rootdir: /home/sweet/project + collected 3 items + + test_module.py Esetting up a test failed or skipped test_module.py::test_setup_fails + Fexecuting test failed or skipped test_module.py::test_call_fails + F + + ================================== ERRORS ================================== + ____________________ ERROR at setup of test_setup_fails ____________________ + + @pytest.fixture + def other(): + > assert 0 + E assert 0 + + test_module.py:7: AssertionError + ================================= FAILURES ================================= + _____________________________ test_call_fails ______________________________ + + something = None + + def test_call_fails(something): + > assert 0 + E assert 0 + + test_module.py:15: AssertionError + ________________________________ test_fail2 ________________________________ + + def test_fail2(): + > assert 0 + E assert 0 + + test_module.py:19: AssertionError + ========================= short test summary info ========================== + FAILED test_module.py::test_call_fails - assert 0 + FAILED test_module.py::test_fail2 - assert 0 + ERROR test_module.py::test_setup_fails - assert 0 + ======================== 2 failed, 1 error in 0.12s ======================== You'll see that the fixture finalizers could use the precise reporting information. diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index ccb56779d5a..89bc1aa02ee 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -22,7 +22,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 7.2.0.dev533+gd08c8e337 + pytest 7.2.0.dev534+ga2c84caaa.d20230317 .. _`simpletest`: From 549cc512f7aca5da453d22b0663ae4dbbc0d611e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Mar 2023 11:40:06 -0300 Subject: [PATCH 542/549] build(deps): Bump pytest-asyncio in /testing/plugins_integration (#10827) Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.20.2 to 0.21.0. - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.20.2...v0.21.0) --- updated-dependencies: - dependency-name: pytest-asyncio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- testing/plugins_integration/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/plugins_integration/requirements.txt b/testing/plugins_integration/requirements.txt index be9d3022def..3a6765f65ce 100644 --- a/testing/plugins_integration/requirements.txt +++ b/testing/plugins_integration/requirements.txt @@ -1,6 +1,6 @@ anyio[curio,trio]==3.6.2 django==4.1.7 -pytest-asyncio==0.20.2 +pytest-asyncio==0.21.0 pytest-bdd==6.1.1 pytest-cov==4.0.0 pytest-django==4.5.2 From 839b90db457eacd7a0c541c8a64d0dfe3447a33c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Mar 2023 11:40:34 -0300 Subject: [PATCH 543/549] build(deps): Bump peter-evans/create-pull-request from 4.2.3 to 4.2.4 (#10828) Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 4.2.3 to 4.2.4. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/2b011faafdcbc9ceb11414d64d0573f37c774b04...38e0b6e68b4c852a5500a94740f0e535e0d7ba54) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/update-plugin-list.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-plugin-list.yml b/.github/workflows/update-plugin-list.yml index 56aa631ec74..d434e6dfc69 100644 --- a/.github/workflows/update-plugin-list.yml +++ b/.github/workflows/update-plugin-list.yml @@ -38,7 +38,7 @@ jobs: run: python scripts/update-plugin-list.py - name: Create Pull Request - uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 + uses: peter-evans/create-pull-request@38e0b6e68b4c852a5500a94740f0e535e0d7ba54 with: commit-message: '[automated] Update plugin list' author: 'pytest bot ' From 172c832cbdbfa407087ed6a895a298b48984da2a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Mar 2023 11:41:07 -0300 Subject: [PATCH 544/549] [automated] Update plugin list (#10823) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 128 ++++++++++++++++++------------- 1 file changed, 76 insertions(+), 52 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 5420202d243..06488c2b37a 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1221 plugins. +This list contains 1224 plugins. .. only:: not latex @@ -115,6 +115,7 @@ This list contains 1221 plugins. :pypi:`pytest-beds` Fixtures for testing Google Appengine (GAE) apps Jun 07, 2016 4 - Beta N/A :pypi:`pytest-bench` Benchmark utility that plugs into pytest. Jul 21, 2014 3 - Alpha N/A :pypi:`pytest-benchmark` A \`\`pytest\`\` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer. Oct 25, 2022 5 - Production/Stable pytest (>=3.8) + :pypi:`pytest-better-datadir` A small example package Mar 13, 2023 N/A N/A :pypi:`pytest-bg-process` Pytest plugin to initialize background process Jan 24, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-bigchaindb` A BigchainDB plugin for pytest. Jan 24, 2022 4 - Beta N/A :pypi:`pytest-bigquery-mock` Provides a mock fixture for python bigquery client Dec 28, 2022 N/A pytest (>=5.0) @@ -206,7 +207,7 @@ This list contains 1221 plugins. :pypi:`pytest-colordots` Colorizes the progress indicators Oct 06, 2017 5 - Production/Stable N/A :pypi:`pytest-commander` An interactive GUI test runner for PyTest Aug 17, 2021 N/A pytest (<7.0.0,>=6.2.4) :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method May 15, 2022 N/A pytest (>=3.6,<8) - :pypi:`pytest-compare` pytest plugin for comparing call arguments. Feb 15, 2023 5 - Production/Stable pytest + :pypi:`pytest-compare` pytest plugin for comparing call arguments. Mar 16, 2023 5 - Production/Stable N/A :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-config` Base configurations and utilities for developing your Python project test suite with pytest. Nov 07, 2014 5 - Production/Stable N/A :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Apr 17, 2022 N/A N/A @@ -225,11 +226,11 @@ This list contains 1221 plugins. :pypi:`pytest-coveragemarkers` Using pytest markers to track functional coverage and filtering of tests Nov 29, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Jan 30, 2023 5 - Production/Stable pytest (>=7.0) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Mar 11, 2023 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Mar 16, 2023 N/A N/A :pypi:`pytest-cqase` Custom qase pytest plugin Aug 22, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) - :pypi:`pytest-crayons` A pytest plugin for colorful print statements Feb 20, 2023 N/A pytest + :pypi:`pytest-crayons` A pytest plugin for colorful print statements Mar 18, 2023 N/A pytest :pypi:`pytest-create` pytest-create Feb 15, 2023 1 - Planning N/A :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest :pypi:`pytest-crontab` add crontab task in crontab Dec 09, 2019 N/A N/A @@ -293,7 +294,7 @@ This list contains 1221 plugins. :pypi:`pytest-discord` A pytest plugin to notify test results to a Discord channel. Feb 05, 2023 4 - Beta pytest (!=6.0.0,<8,>=3.3.2) :pypi:`pytest-django` A Django plugin for pytest. Dec 07, 2021 5 - Production/Stable pytest (>=5.4.0) :pypi:`pytest-django-ahead` A Django plugin for pytest. Oct 27, 2016 5 - Production/Stable pytest (>=2.9) - :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Nov 09, 2022 4 - Beta N/A + :pypi:`pytest-djangoapp` Nice pytest plugin to help you with Django pluggable application testing. Mar 18, 2023 4 - Beta pytest :pypi:`pytest-django-cache-xdist` A djangocachexdist plugin for pytest May 12, 2020 4 - Beta N/A :pypi:`pytest-django-casperjs` Integrate CasperJS with your django tests as a pytest fixture. Mar 15, 2015 2 - Pre-Alpha N/A :pypi:`pytest-django-dotenv` Pytest plugin used to setup environment variables with django-dotenv Nov 26, 2019 4 - Beta pytest (>=2.6.0) @@ -369,7 +370,7 @@ This list contains 1221 plugins. :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Mar 10, 2023 N/A N/A :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Mar 10, 2023 N/A N/A :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Mar 10, 2023 N/A N/A - :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Oct 15, 2022 N/A pytest (>=7.0,<8.0) + :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Mar 12, 2023 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Jan 27, 2023 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -395,7 +396,7 @@ This list contains 1221 plugins. :pypi:`pytest-executable` pytest plugin for testing executables Nov 05, 2022 N/A pytest (<8,>=4.3) :pypi:`pytest-execution-timer` A timer for the phases of Pytest's execution. Dec 24, 2021 4 - Beta N/A :pypi:`pytest-expect` py.test plugin to store test expectations and mark tests based on them Apr 21, 2016 4 - Beta N/A - :pypi:`pytest-expectdir` A pytest plugin to provide initial/expected directories, and check a test transforms the initial directory to the expected one Mar 09, 2023 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-expectdir` A pytest plugin to provide initial/expected directories, and check a test transforms the initial directory to the expected one Mar 12, 2023 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-expecter` Better testing with expecter and pytest. Sep 18, 2022 5 - Production/Stable N/A :pypi:`pytest-expectr` This plugin is used to expect multiple assert using pytest framework. Oct 05, 2018 N/A pytest (>=2.4.2) :pypi:`pytest-experiments` A pytest plugin to help developers of research-oriented software projects keep track of the results of their numerical experiments. Dec 13, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) @@ -478,7 +479,7 @@ This list contains 1221 plugins. :pypi:`pytest-gherkin` A flexible framework for executing BDD gherkin tests Jul 27, 2019 3 - Alpha pytest (>=5.0.0) :pypi:`pytest-gh-log-group` pytest plugin for gh actions Jan 11, 2022 3 - Alpha pytest :pypi:`pytest-ghostinspector` For finding/executing Ghost Inspector tests May 17, 2016 3 - Alpha N/A - :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Mar 08, 2023 N/A N/A + :pypi:`pytest-girder` A set of pytest fixtures for testing Girder applications. Mar 15, 2023 N/A N/A :pypi:`pytest-git` Git repository fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-gitcov` Pytest plugin for reporting on coverage of the last git commit. Jan 11, 2020 2 - Pre-Alpha N/A :pypi:`pytest-git-fixtures` Pytest fixtures for testing with git. Mar 11, 2021 4 - Beta pytest @@ -509,7 +510,7 @@ This list contains 1221 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 10, 2023 3 - Alpha pytest (==7.2.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 17, 2023 3 - Alpha pytest (==7.2.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-test` A plugin that tracks test changes Dec 10, 2022 4 - Beta pytest (>=3.5.0) @@ -529,7 +530,7 @@ This list contains 1221 plugins. :pypi:`pytest-http-mocker` Pytest plugin for http mocking (via https://github.com/vilus/mocker) Oct 20, 2019 N/A N/A :pypi:`pytest-httpretty` A thin wrapper of HTTPretty for pytest Feb 16, 2014 3 - Alpha N/A :pypi:`pytest-httpserver` pytest-httpserver is a httpserver for pytest Sep 12, 2022 3 - Alpha N/A - :pypi:`pytest-httptesting` http_testing framework on top of pytest Dec 08, 2022 N/A pytest (>=7.2.0,<8.0.0) + :pypi:`pytest-httptesting` http_testing framework on top of pytest Mar 15, 2023 N/A pytest (>=7.2.0,<8.0.0) :pypi:`pytest-httpx` Send responses to httpx. Jan 20, 2023 5 - Production/Stable pytest (<8.0,>=6.0) :pypi:`pytest-httpx-blockage` Disable httpx requests during a test run Feb 16, 2023 N/A pytest (>=7.2.1) :pypi:`pytest-hue` Visualise PyTest status via your Phillips Hue lights May 09, 2019 N/A N/A @@ -577,12 +578,12 @@ This list contains 1221 plugins. :pypi:`pytest-jinja` A plugin to generate customizable jinja-based HTML reports in pytest Oct 04, 2022 3 - Alpha pytest (>=6.2.5,<7.0.0) :pypi:`pytest-jira` py.test JIRA integration plugin, using markers Apr 07, 2022 3 - Alpha N/A :pypi:`pytest-jira-xfail` Plugin skips (xfail) tests if unresolved Jira issue(s) linked Dec 01, 2022 N/A pytest (~=7.2.0) - :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Feb 09, 2023 4 - Beta pytest + :pypi:`pytest-jira-xray` pytest plugin to integrate tests with JIRA XRAY Mar 13, 2023 4 - Beta pytest :pypi:`pytest-job-selection` A pytest plugin for load balancing test suites Jan 30, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-jobserver` Limit parallel tests with posix jobserver. May 15, 2019 5 - Production/Stable pytest :pypi:`pytest-joke` Test failures are better served with humor. Oct 08, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-json` Generate JSON test reports Jan 18, 2016 4 - Beta N/A - :pypi:`pytest-json-fixtures` JSON output for the --fixtures flag Aug 09, 2022 4 - Beta pytest (>=7.1.0) + :pypi:`pytest-json-fixtures` JSON output for the --fixtures flag Mar 14, 2023 4 - Beta N/A :pypi:`pytest-jsonlint` UNKNOWN Aug 04, 2016 N/A N/A :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Mar 15, 2022 4 - Beta pytest (>=3.8.0) :pypi:`pytest-jtr` pytest plugin supporting json test report output Nov 29, 2022 N/A pytest (>=7.1.2,<8.0.0) @@ -698,7 +699,7 @@ This list contains 1221 plugins. :pypi:`pytest-mpi` pytest plugin to collect information from tests Jan 08, 2022 3 - Alpha pytest :pypi:`pytest-mpl` pytest plugin to help with testing figures output from Matplotlib Jul 23, 2022 4 - Beta pytest :pypi:`pytest-mproc` low-startup-overhead, scalable, distributed-testing pytest plugin Nov 15, 2022 4 - Beta pytest (>=6) - :pypi:`pytest-mqtt` pytest-mqtt supports testing systems based on MQTT Sep 20, 2022 4 - Beta pytest (<8) ; extra == 'test' + :pypi:`pytest-mqtt` pytest-mqtt supports testing systems based on MQTT Mar 15, 2023 4 - Beta pytest (<8) ; extra == 'test' :pypi:`pytest-multihost` Utility for writing multi-host tests for pytest Apr 07, 2020 4 - Beta N/A :pypi:`pytest-multilog` Multi-process logs handling and other helpers for pytest Jan 17, 2023 N/A pytest :pypi:`pytest-multithreading` a pytest plugin for th and concurrent testing Dec 07, 2022 N/A N/A @@ -709,7 +710,7 @@ This list contains 1221 plugins. :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Oct 26, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A pytest>=6.0.0 :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Feb 25, 2023 N/A pytest>=7,<8 - :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Mar 10, 2023 5 - Production/Stable pytest (>=6.2) + :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Mar 13, 2023 5 - Production/Stable pytest (>=6.2) :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) :pypi:`pytest-netdut` "Automated software testing for switches using pytest" Jan 11, 2023 N/A pytest (>=3.5.0) @@ -745,7 +746,7 @@ This list contains 1221 plugins. :pypi:`pytest-only` Use @pytest.mark.only to run a single test Jun 14, 2022 5 - Production/Stable pytest (<7.1); python_version <= "3.6" :pypi:`pytest-oot` Run object-oriented tests in a simple format Sep 18, 2016 4 - Beta N/A :pypi:`pytest-openfiles` Pytest plugin for detecting inadvertent open file handles Apr 16, 2020 3 - Alpha pytest (>=4.6) - :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry Mar 10, 2023 N/A pytest + :pypi:`pytest-opentelemetry` A pytest plugin for instrumenting test runs via OpenTelemetry Mar 15, 2023 N/A pytest :pypi:`pytest-opentmi` pytest plugin for publish results to opentmi Jun 02, 2022 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-operator` Fixtures for Operators Sep 28, 2022 N/A pytest :pypi:`pytest-optional` include/exclude values of fixtures in pytest Oct 07, 2015 N/A N/A @@ -813,7 +814,7 @@ This list contains 1221 plugins. :pypi:`pytest-ponyorm` PonyORM in Pytest Oct 31, 2018 N/A pytest (>=3.1.1) :pypi:`pytest-poo` Visualize your crappy tests Mar 25, 2021 5 - Production/Stable pytest (>=2.3.4) :pypi:`pytest-poo-fail` Visualize your failed tests with poo Feb 12, 2015 5 - Production/Stable N/A - :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Aug 18, 2022 5 - Production/Stable pytest + :pypi:`pytest-pop` A pytest plugin to help with testing pop projects Mar 16, 2023 5 - Production/Stable pytest :pypi:`pytest-portion` Select a portion of the collected tests Jan 28, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-postgres` Run PostgreSQL in Docker container in Pytest. Mar 22, 2020 N/A pytest :pypi:`pytest-postgresql` Postgresql fixtures and fixture factories for Pytest. Mar 11, 2022 5 - Production/Stable pytest (>=6.2.0) @@ -852,7 +853,7 @@ This list contains 1221 plugins. :pypi:`pytest-pyramid` pytest_pyramid - provides fixtures for testing pyramid applications with pytest test suite Dec 13, 2022 5 - Production/Stable pytest :pypi:`pytest-pyramid-server` Pyramid server fixture for py.test May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-pyright` Pytest plugin for type checking code with Pyright Nov 20, 2022 4 - Beta pytest (>=7.0.0) - :pypi:`pytest-pyspec` A plugin that transforms the pytest output into a result similar to the RSpec. It enables the use of docstrings to display results and also enables the use of the prefixes "describe", "with" and "it". Mar 11, 2023 N/A pytest (>=7.2.1,<8.0.0) + :pypi:`pytest-pyspec` A plugin that transforms the pytest output into a result similar to the RSpec. It enables the use of docstrings to display results and also enables the use of the prefixes "describe", "with" and "it". Mar 12, 2023 5 - Production/Stable pytest (>=7.2.1,<8.0.0) :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.0) :pypi:`pytest-pythonpath` pytest plugin for adding to the PYTHONPATH from command line or configs. Feb 10, 2022 5 - Production/Stable pytest (<7,>=2.5.2) :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest @@ -881,6 +882,7 @@ This list contains 1221 plugins. :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Dec 03, 2022 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-readme` Test your README.md file Sep 02, 2022 5 - Production/Stable N/A :pypi:`pytest-reana` Pytest fixtures for REANA. Dec 13, 2022 3 - Alpha N/A + :pypi:`pytest-recorder` Pytest plugin, meant to facilitate unit tests writing for tools consumming Web APIs. Mar 15, 2023 N/A N/A :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Feb 16, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) @@ -962,14 +964,14 @@ This list contains 1221 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 11, 2023 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 17, 2023 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schedule` The job of test scheduling for humans. Jan 07, 2023 5 - Production/Stable N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 21, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 11, 2023 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 17, 2023 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -1039,7 +1041,7 @@ This list contains 1221 plugins. :pypi:`pytest-splunk-env` pytest fixtures for interaction with Splunk Enterprise and Splunk Cloud Oct 22, 2020 N/A pytest (>=6.1.1,<7.0.0) :pypi:`pytest-sqitch` sqitch for pytest Apr 06, 2020 4 - Beta N/A :pypi:`pytest-sqlalchemy` pytest plugin with sqlalchemy related fixtures Mar 13, 2018 3 - Alpha N/A - :pypi:`pytest-sqlalchemy-mock` pytest sqlalchemy plugin for mock Sep 25, 2022 3 - Alpha pytest (>=2.0) + :pypi:`pytest-sqlalchemy-mock` pytest sqlalchemy plugin for mock Mar 15, 2023 3 - Alpha pytest (>=2.0) :pypi:`pytest-sql-bigquery` Yet another SQL-testing framework for BigQuery provided by pytest plugin Dec 19, 2019 N/A pytest :pypi:`pytest-sqlfluff` A pytest plugin to use sqlfluff to enable format checking of sql files. Dec 21, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-squadcast` Pytest report plugin for Squadcast Feb 22, 2022 5 - Production/Stable pytest @@ -1078,7 +1080,7 @@ This list contains 1221 plugins. :pypi:`pytest-tcpclient` A pytest plugin for testing TCP clients Nov 16, 2022 N/A pytest (<8,>=7.1.3) :pypi:`pytest-teamcity-logblock` py.test plugin to introduce block structure in teamcity build log, if output is not captured May 15, 2018 4 - Beta N/A :pypi:`pytest-telegram` Pytest to Telegram reporting plugin Dec 10, 2020 5 - Production/Stable N/A - :pypi:`pytest-telegram-notifier` Telegram notification plugin for Pytest Feb 27, 2023 5 - Production/Stable N/A + :pypi:`pytest-telegram-notifier` Telegram notification plugin for Pytest Mar 17, 2023 5 - Production/Stable N/A :pypi:`pytest-tempdir` Predictable and repeatable tempdir support. Oct 11, 2019 4 - Beta pytest (>=2.8.1) :pypi:`pytest-terra-fixt` Terraform and Terragrunt fixtures for pytest Sep 15, 2022 N/A pytest (==6.2.5) :pypi:`pytest-terraform` A pytest plugin for using terraform fixtures Sep 01, 2022 N/A pytest (>=6.0) @@ -1091,7 +1093,7 @@ This list contains 1221 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Dec 01, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Feb 27, 2023 4 - Beta pytest (<8,>=5) + :pypi:`pytest-testmon` selects tests affected by changed files and methods Mar 18, 2023 4 - Beta pytest (<8,>=5) :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) :pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Mar 03, 2023 4 - Beta pytest (<8,>=5) :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) @@ -1209,7 +1211,7 @@ This list contains 1221 plugins. :pypi:`pytest-wiremock` A pytest plugin for programmatically using wiremock in integration tests Mar 27, 2022 N/A pytest (>=7.1.1,<8.0.0) :pypi:`pytest-with-docker` pytest with docker helpers. Nov 09, 2021 N/A pytest :pypi:`pytest-workflow` A pytest plugin for configuring workflow/pipeline tests using YAML files Jan 13, 2023 5 - Production/Stable pytest (>=7.0.0) - :pypi:`pytest-xdist` pytest xdist plugin for distributed testing, most importantly across multiple CPUs Feb 07, 2023 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-xdist` pytest xdist plugin for distributed testing, most importantly across multiple CPUs Mar 12, 2023 5 - Production/Stable pytest (>=6.2.0) :pypi:`pytest-xdist-debug-for-graingert` pytest xdist plugin for distributed testing and loop-on-failing modes Jul 24, 2019 5 - Production/Stable pytest (>=4.4.0) :pypi:`pytest-xdist-forked` forked from pytest-xdist Feb 10, 2020 5 - Production/Stable pytest (>=4.4.0) :pypi:`pytest-xdist-tracker` pytest plugin helps to reproduce failures for particular xdist node Nov 18, 2021 3 - Alpha pytest (>=3.5.1) @@ -1225,9 +1227,10 @@ This list contains 1221 plugins. :pypi:`pytest-xskynet` A package to prevent Dependency Confusion attacks against Yandex. Feb 10, 2023 N/A N/A :pypi:`pytest-xvfb` A pytest plugin to run Xvfb for tests. Jun 09, 2020 4 - Beta pytest (>=2.8.1) :pypi:`pytest-yaml` This plugin is used to load yaml output to your test using pytest framework. Oct 05, 2018 N/A pytest + :pypi:`pytest-yaml-sanmu` pytest plugin for generating test cases by yaml Mar 17, 2023 N/A pytest>=7.2.0 :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yamlwsgi` Run tests against wsgi apps defined in yaml May 11, 2010 N/A N/A - :pypi:`pytest-yaml-yoyo` http/https API run by yaml Feb 17, 2023 N/A pytest (==7.2.0) + :pypi:`pytest-yaml-yoyo` http/https API run by yaml Mar 17, 2023 N/A pytest (>=7.2.0) :pypi:`pytest-yapf` Run yapf Jul 06, 2017 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) :pypi:`pytest-yield` PyTest plugin to run tests concurrently, each \`yield\` switch context to other one Jan 23, 2019 N/A N/A @@ -1923,6 +1926,13 @@ This list contains 1221 plugins. A \`\`pytest\`\` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer. + :pypi:`pytest-better-datadir` + *last release*: Mar 13, 2023, + *status*: N/A, + *requires*: N/A + + A small example package + :pypi:`pytest-bg-process` *last release*: Jan 24, 2022, *status*: 4 - Beta, @@ -2561,9 +2571,9 @@ This list contains 1221 plugins. pytest framework for testing different aspects of a common method :pypi:`pytest-compare` - *last release*: Feb 15, 2023, + *last release*: Mar 16, 2023, *status*: 5 - Production/Stable, - *requires*: pytest + *requires*: N/A pytest plugin for comparing call arguments. @@ -2694,7 +2704,7 @@ This list contains 1221 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Mar 11, 2023, + *last release*: Mar 16, 2023, *status*: N/A, *requires*: N/A @@ -2722,7 +2732,7 @@ This list contains 1221 plugins. Manages CrateDB instances during your integration tests :pypi:`pytest-crayons` - *last release*: Feb 20, 2023, + *last release*: Mar 18, 2023, *status*: N/A, *requires*: pytest @@ -3170,9 +3180,9 @@ This list contains 1221 plugins. A Django plugin for pytest. :pypi:`pytest-djangoapp` - *last release*: Nov 09, 2022, + *last release*: Mar 18, 2023, *status*: 4 - Beta, - *requires*: N/A + *requires*: pytest Nice pytest plugin to help you with Django pluggable application testing. @@ -3702,7 +3712,7 @@ This list contains 1221 plugins. pytest embedded plugin for testing espressif boards via serial ports :pypi:`pytest-embrace` - *last release*: Oct 15, 2022, + *last release*: Mar 12, 2023, *status*: N/A, *requires*: pytest (>=7.0,<8.0) @@ -3884,7 +3894,7 @@ This list contains 1221 plugins. py.test plugin to store test expectations and mark tests based on them :pypi:`pytest-expectdir` - *last release*: Mar 09, 2023, + *last release*: Mar 12, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) @@ -4465,7 +4475,7 @@ This list contains 1221 plugins. For finding/executing Ghost Inspector tests :pypi:`pytest-girder` - *last release*: Mar 08, 2023, + *last release*: Mar 15, 2023, *status*: N/A, *requires*: N/A @@ -4682,7 +4692,7 @@ This list contains 1221 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Mar 10, 2023, + *last release*: Mar 17, 2023, *status*: 3 - Alpha, *requires*: pytest (==7.2.1) @@ -4822,7 +4832,7 @@ This list contains 1221 plugins. pytest-httpserver is a httpserver for pytest :pypi:`pytest-httptesting` - *last release*: Dec 08, 2022, + *last release*: Mar 15, 2023, *status*: N/A, *requires*: pytest (>=7.2.0,<8.0.0) @@ -5158,7 +5168,7 @@ This list contains 1221 plugins. Plugin skips (xfail) tests if unresolved Jira issue(s) linked :pypi:`pytest-jira-xray` - *last release*: Feb 09, 2023, + *last release*: Mar 13, 2023, *status*: 4 - Beta, *requires*: pytest @@ -5193,9 +5203,9 @@ This list contains 1221 plugins. Generate JSON test reports :pypi:`pytest-json-fixtures` - *last release*: Aug 09, 2022, + *last release*: Mar 14, 2023, *status*: 4 - Beta, - *requires*: pytest (>=7.1.0) + *requires*: N/A JSON output for the --fixtures flag @@ -6005,7 +6015,7 @@ This list contains 1221 plugins. low-startup-overhead, scalable, distributed-testing pytest plugin :pypi:`pytest-mqtt` - *last release*: Sep 20, 2022, + *last release*: Mar 15, 2023, *status*: 4 - Beta, *requires*: pytest (<8) ; extra == 'test' @@ -6082,7 +6092,7 @@ This list contains 1221 plugins. Pytest plugin to check mypy output. :pypi:`pytest-mysql` - *last release*: Mar 10, 2023, + *last release*: Mar 13, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2) @@ -6334,7 +6344,7 @@ This list contains 1221 plugins. Pytest plugin for detecting inadvertent open file handles :pypi:`pytest-opentelemetry` - *last release*: Mar 10, 2023, + *last release*: Mar 15, 2023, *status*: N/A, *requires*: pytest @@ -6810,7 +6820,7 @@ This list contains 1221 plugins. Visualize your failed tests with poo :pypi:`pytest-pop` - *last release*: Aug 18, 2022, + *last release*: Mar 16, 2023, *status*: 5 - Production/Stable, *requires*: pytest @@ -7083,8 +7093,8 @@ This list contains 1221 plugins. Pytest plugin for type checking code with Pyright :pypi:`pytest-pyspec` - *last release*: Mar 11, 2023, - *status*: N/A, + *last release*: Mar 12, 2023, + *status*: 5 - Production/Stable, *requires*: pytest (>=7.2.1,<8.0.0) A plugin that transforms the pytest output into a result similar to the RSpec. It enables the use of docstrings to display results and also enables the use of the prefixes "describe", "with" and "it". @@ -7285,6 +7295,13 @@ This list contains 1221 plugins. Pytest fixtures for REANA. + :pypi:`pytest-recorder` + *last release*: Mar 15, 2023, + *status*: N/A, + *requires*: N/A + + Pytest plugin, meant to facilitate unit tests writing for tools consumming Web APIs. + :pypi:`pytest-recording` *last release*: Feb 16, 2023, *status*: 4 - Beta, @@ -7853,7 +7870,7 @@ This list contains 1221 plugins. :pypi:`pytest-sbase` - *last release*: Mar 11, 2023, + *last release*: Mar 17, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -7902,7 +7919,7 @@ This list contains 1221 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Mar 11, 2023, + *last release*: Mar 17, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -8392,7 +8409,7 @@ This list contains 1221 plugins. pytest plugin with sqlalchemy related fixtures :pypi:`pytest-sqlalchemy-mock` - *last release*: Sep 25, 2022, + *last release*: Mar 15, 2023, *status*: 3 - Alpha, *requires*: pytest (>=2.0) @@ -8665,7 +8682,7 @@ This list contains 1221 plugins. Pytest to Telegram reporting plugin :pypi:`pytest-telegram-notifier` - *last release*: Feb 27, 2023, + *last release*: Mar 17, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -8756,7 +8773,7 @@ This list contains 1221 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Feb 27, 2023, + *last release*: Mar 18, 2023, *status*: 4 - Beta, *requires*: pytest (<8,>=5) @@ -9582,7 +9599,7 @@ This list contains 1221 plugins. A pytest plugin for configuring workflow/pipeline tests using YAML files :pypi:`pytest-xdist` - *last release*: Feb 07, 2023, + *last release*: Mar 12, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2.0) @@ -9693,6 +9710,13 @@ This list contains 1221 plugins. This plugin is used to load yaml output to your test using pytest framework. + :pypi:`pytest-yaml-sanmu` + *last release*: Mar 17, 2023, + *status*: N/A, + *requires*: pytest>=7.2.0 + + pytest plugin for generating test cases by yaml + :pypi:`pytest-yamltree` *last release*: Mar 02, 2020, *status*: 4 - Beta, @@ -9708,9 +9732,9 @@ This list contains 1221 plugins. Run tests against wsgi apps defined in yaml :pypi:`pytest-yaml-yoyo` - *last release*: Feb 17, 2023, + *last release*: Mar 17, 2023, *status*: N/A, - *requires*: pytest (==7.2.0) + *requires*: pytest (>=7.2.0) http/https API run by yaml From a3b39069bc44774206c7bd682e0ca253d5f74efc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 26 Mar 2023 08:32:13 -0300 Subject: [PATCH 545/549] [automated] Update plugin list (#10838) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 124 ++++++++++++++++++------------- 1 file changed, 74 insertions(+), 50 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 06488c2b37a..cb696af1208 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,7 +11,7 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1224 plugins. +This list contains 1227 plugins. .. only:: not latex @@ -80,7 +80,7 @@ This list contains 1224 plugins. :pypi:`pytest-astropy` Meta-package containing dependencies for testing Apr 12, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-astropy-header` pytest plugin to add diagnostic information to the header of the test output Sep 06, 2022 3 - Alpha pytest (>=4.6) :pypi:`pytest-ast-transformer` May 04, 2019 3 - Alpha pytest - :pypi:`pytest-asyncio` Pytest support for asyncio Dec 08, 2022 4 - Beta pytest (>=6.1.0) + :pypi:`pytest-asyncio` Pytest support for asyncio Mar 19, 2023 4 - Beta pytest (>=7.0.0) :pypi:`pytest-asyncio-cooperative` Run all your asynchronous tests cooperatively. Feb 10, 2023 N/A N/A :pypi:`pytest-asyncio-network-simulator` pytest-asyncio-network-simulator: Plugin for pytest for simulator the network in tests Jul 31, 2018 3 - Alpha pytest (<3.7.0,>=3.3.2) :pypi:`pytest-async-mongodb` pytest plugin for async MongoDB Oct 18, 2017 5 - Production/Stable pytest (>=2.5.2) @@ -213,10 +213,10 @@ This list contains 1224 plugins. :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Apr 17, 2022 N/A N/A :pypi:`pytest-console-scripts` Pytest plugin for testing console scripts Mar 18, 2022 4 - Beta N/A :pypi:`pytest-consul` pytest plugin with fixtures for testing consul aware apps Nov 24, 2018 3 - Alpha pytest - :pypi:`pytest-container` Pytest fixtures for writing container based tests Feb 01, 2022 3 - Alpha pytest (>=3.10) + :pypi:`pytest-container` Pytest fixtures for writing container based tests Mar 21, 2023 4 - Beta pytest (>=3.10) :pypi:`pytest-contextfixture` Define pytest fixtures as context managers. Mar 12, 2013 4 - Beta N/A :pypi:`pytest-contexts` A plugin to run tests written with the Contexts framework using pytest May 19, 2021 4 - Beta N/A - :pypi:`pytest-cookies` The pytest plugin for your Cookiecutter templates. 🍪 May 24, 2021 5 - Production/Stable pytest (>=3.3.0) + :pypi:`pytest-cookies` The pytest plugin for your Cookiecutter templates. 🍪 Mar 22, 2023 5 - Production/Stable pytest (>=3.9.0) :pypi:`pytest-couchdbkit` py.test extension for per-test couchdb databases using couchdbkit Apr 17, 2012 N/A N/A :pypi:`pytest-count` count erros and send email Jan 12, 2018 4 - Beta N/A :pypi:`pytest-cov` Pytest plugin for measuring coverage. Sep 28, 2022 5 - Production/Stable pytest (>=4.6) @@ -226,11 +226,11 @@ This list contains 1224 plugins. :pypi:`pytest-coveragemarkers` Using pytest markers to track functional coverage and filtering of tests Nov 29, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cov-exclude` Pytest plugin for excluding tests based on coverage data Apr 29, 2016 4 - Beta pytest (>=2.8.0,<2.9.0); extra == 'dev' :pypi:`pytest-cpp` Use pytest's runner to discover and execute C++ tests Jan 30, 2023 5 - Production/Stable pytest (>=7.0) - :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Mar 16, 2023 N/A N/A + :pypi:`pytest-cppython` A pytest plugin that imports CPPython testing types Mar 20, 2023 N/A N/A :pypi:`pytest-cqase` Custom qase pytest plugin Aug 22, 2022 N/A pytest (>=7.1.2,<8.0.0) :pypi:`pytest-cram` Run cram tests with pytest. Aug 08, 2020 N/A N/A :pypi:`pytest-crate` Manages CrateDB instances during your integration tests May 28, 2019 3 - Alpha pytest (>=4.0) - :pypi:`pytest-crayons` A pytest plugin for colorful print statements Mar 18, 2023 N/A pytest + :pypi:`pytest-crayons` A pytest plugin for colorful print statements Mar 19, 2023 N/A pytest :pypi:`pytest-create` pytest-create Feb 15, 2023 1 - Planning N/A :pypi:`pytest-cricri` A Cricri plugin for pytest. Jan 27, 2018 N/A pytest :pypi:`pytest-crontab` add crontab task in crontab Dec 09, 2019 N/A N/A @@ -321,7 +321,7 @@ This list contains 1224 plugins. :pypi:`pytest-dockerc` Run, manage and stop Docker Compose project from Docker API Oct 09, 2020 5 - Production/Stable pytest (>=3.0) :pypi:`pytest-docker-compose` Manages Docker containers during your integration tests Jan 26, 2021 5 - Production/Stable pytest (>=3.3) :pypi:`pytest-docker-db` A plugin to use docker databases for pytests Mar 20, 2021 5 - Production/Stable pytest (>=3.1.1) - :pypi:`pytest-docker-fixtures` pytest docker fixtures Nov 17, 2022 3 - Alpha N/A + :pypi:`pytest-docker-fixtures` pytest docker fixtures Mar 24, 2023 3 - Alpha pytest :pypi:`pytest-docker-git-fixtures` Pytest fixtures for testing with git scm. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-haproxy-fixtures` Pytest fixtures for testing with haproxy. Feb 09, 2022 4 - Beta pytest :pypi:`pytest-docker-pexpect` pytest plugin for writing functional tests with pexpect and docker Jan 14, 2019 N/A pytest @@ -340,6 +340,7 @@ This list contains 1224 plugins. :pypi:`pytest-dolphin` Some extra stuff that we use ininternally Nov 30, 2016 4 - Beta pytest (==3.0.4) :pypi:`pytest-doorstop` A pytest plugin for adding test results into doorstop items. Jun 09, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-dotenv` A py.test plugin that parses environment files before running tests Jun 16, 2020 4 - Beta pytest (>=5.0.0) + :pypi:`pytest-draw` Pytest plugin for randomly selecting a specific number of tests Mar 21, 2023 3 - Alpha pytest :pypi:`pytest-drf` A Django REST framework plugin for pytest. Jul 12, 2022 5 - Production/Stable pytest (>=3.7) :pypi:`pytest-drivings` Tool to allow webdriver automation to be ran locally or remotely Jan 13, 2021 N/A N/A :pypi:`pytest-drop-dup-tests` A Pytest plugin to drop duplicated tests during collection May 23, 2020 4 - Beta pytest (>=2.7) @@ -370,7 +371,7 @@ This list contains 1224 plugins. :pypi:`pytest-embedded-qemu` pytest embedded plugin for qemu, not target chip Mar 10, 2023 N/A N/A :pypi:`pytest-embedded-serial` pytest embedded plugin for testing serial ports Mar 10, 2023 N/A N/A :pypi:`pytest-embedded-serial-esp` pytest embedded plugin for testing espressif boards via serial ports Mar 10, 2023 N/A N/A - :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Mar 12, 2023 N/A pytest (>=7.0,<8.0) + :pypi:`pytest-embrace` 💝 Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate. Mar 25, 2023 N/A pytest (>=7.0,<8.0) :pypi:`pytest-emoji` A pytest plugin that adds emojis to your test result report Feb 19, 2019 4 - Beta pytest (>=4.2.1) :pypi:`pytest-emoji-output` Pytest plugin to represent test output with emoji support Apr 12, 2022 4 - Beta pytest (==7.0.1) :pypi:`pytest-enabler` Enable installed pytest plugins Jan 27, 2023 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -390,13 +391,14 @@ This list contains 1224 plugins. :pypi:`pytest-ethereum` pytest-ethereum: Pytest library for ethereum projects. Jun 24, 2019 3 - Alpha pytest (==3.3.2); extra == 'dev' :pypi:`pytest-eucalyptus` Pytest Plugin for BDD Jun 28, 2022 N/A pytest (>=4.2.0) :pypi:`pytest-eventlet` Applies eventlet monkey-patch as a pytest plugin. Oct 04, 2021 N/A pytest ; extra == 'dev' + :pypi:`pytest-examples` Pytest plugin for testing examples in docstrings and markdown files. Mar 25, 2023 4 - Beta pytest>=7 :pypi:`pytest-excel` pytest plugin for generating excel reports Jan 31, 2022 5 - Production/Stable N/A :pypi:`pytest-exceptional` Better exceptions Mar 16, 2017 4 - Beta N/A :pypi:`pytest-exception-script` Walk your code through exception script to check it's resiliency to failures. Aug 04, 2020 3 - Alpha pytest - :pypi:`pytest-executable` pytest plugin for testing executables Nov 05, 2022 N/A pytest (<8,>=4.3) + :pypi:`pytest-executable` pytest plugin for testing executables Mar 25, 2023 N/A pytest (<8,>=4.3) :pypi:`pytest-execution-timer` A timer for the phases of Pytest's execution. Dec 24, 2021 4 - Beta N/A :pypi:`pytest-expect` py.test plugin to store test expectations and mark tests based on them Apr 21, 2016 4 - Beta N/A - :pypi:`pytest-expectdir` A pytest plugin to provide initial/expected directories, and check a test transforms the initial directory to the expected one Mar 12, 2023 5 - Production/Stable pytest (>=5.0) + :pypi:`pytest-expectdir` A pytest plugin to provide initial/expected directories, and check a test transforms the initial directory to the expected one Mar 19, 2023 5 - Production/Stable pytest (>=5.0) :pypi:`pytest-expecter` Better testing with expecter and pytest. Sep 18, 2022 5 - Production/Stable N/A :pypi:`pytest-expectr` This plugin is used to expect multiple assert using pytest framework. Oct 05, 2018 N/A pytest (>=2.4.2) :pypi:`pytest-experiments` A pytest plugin to help developers of research-oriented software projects keep track of the results of their numerical experiments. Dec 13, 2021 4 - Beta pytest (>=6.2.5,<7.0.0) @@ -430,6 +432,7 @@ This list contains 1224 plugins. :pypi:`pytest-filecov` A pytest plugin to detect unused files Jun 27, 2021 4 - Beta pytest :pypi:`pytest-filedata` easily load data from files Jan 17, 2019 4 - Beta N/A :pypi:`pytest-filemarker` A pytest plugin that runs marked tests when files change. Dec 01, 2020 N/A pytest + :pypi:`pytest-file-watcher` Pytest-File-Watcher is a CLI tool that watches for changes in your code and runs pytest on the changed files. Mar 23, 2023 N/A pytest :pypi:`pytest-filter-case` run test cases filter by mark Nov 05, 2020 N/A N/A :pypi:`pytest-filter-subpackage` Pytest plugin for filtering based on sub-packages Dec 12, 2022 3 - Alpha pytest (>=3.0) :pypi:`pytest-find-dependencies` A pytest plugin to find dependencies between tests Apr 09, 2022 4 - Beta pytest (>=4.3.0) @@ -510,7 +513,7 @@ This list contains 1224 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 17, 2023 3 - Alpha pytest (==7.2.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 23, 2023 3 - Alpha pytest (==7.2.1) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-test` A plugin that tracks test changes Dec 10, 2022 4 - Beta pytest (>=3.5.0) @@ -562,7 +565,7 @@ This list contains 1224 plugins. :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) :pypi:`pytest-interactive` A pytest plugin for console based interactive test selection just after the collection phase Nov 30, 2017 3 - Alpha N/A :pypi:`pytest-intercept-remote` Pytest plugin for intercepting outgoing connection requests during pytest run. May 24, 2021 4 - Beta pytest (>=4.6) - :pypi:`pytest-invenio` Pytest fixtures for Invenio. Oct 25, 2022 5 - Production/Stable pytest (<7.2.0,>=6) + :pypi:`pytest-invenio` Pytest fixtures for Invenio. Mar 24, 2023 5 - Production/Stable pytest (<7.2.0,>=6) :pypi:`pytest-involve` Run tests covering a specific file or changeset Feb 02, 2020 4 - Beta pytest (>=3.5.0) :pypi:`pytest-ipdb` A py.test plug-in to enable drop to ipdb debugger on test failure. Mar 20, 2013 2 - Pre-Alpha N/A :pypi:`pytest-ipynb` THIS PROJECT IS ABANDONED Jan 29, 2019 3 - Alpha N/A @@ -821,7 +824,7 @@ This list contains 1224 plugins. :pypi:`pytest-pot` A package for enhancing pytest Nov 20, 2022 N/A N/A :pypi:`pytest-power` pytest plugin with powerful fixtures Dec 31, 2020 N/A pytest (>=5.4) :pypi:`pytest-prefer-nested-dup-tests` A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. Apr 27, 2022 4 - Beta pytest (>=7.1.1,<8.0.0) - :pypi:`pytest-pretty` pytest plugin for printing summary data as I want it Feb 01, 2023 5 - Production/Stable pytest>=7 + :pypi:`pytest-pretty` pytest plugin for printing summary data as I want it Mar 22, 2023 5 - Production/Stable pytest>=7 :pypi:`pytest-pretty-terminal` pytest plugin for generating prettier terminal output Jan 31, 2022 N/A pytest (>=3.4.1) :pypi:`pytest-pride` Minitest-style test colors Apr 02, 2016 3 - Alpha N/A :pypi:`pytest-print` pytest-print adds the printer fixture you can use to print messages to the user (directly to the pytest runner, not stdout) Dec 28, 2021 5 - Production/Stable pytest (>=6) @@ -857,7 +860,7 @@ This list contains 1224 plugins. :pypi:`pytest-pytestrail` Pytest plugin for interaction with TestRail Aug 27, 2020 4 - Beta pytest (>=3.8.0) :pypi:`pytest-pythonpath` pytest plugin for adding to the PYTHONPATH from command line or configs. Feb 10, 2022 5 - Production/Stable pytest (<7,>=2.5.2) :pypi:`pytest-pytorch` pytest plugin for a better developer experience when working with the PyTorch test suite May 25, 2021 4 - Beta pytest - :pypi:`pytest-pyvista` Pytest-pyvista package Mar 07, 2023 4 - Beta pytest>=3.5.0 + :pypi:`pytest-pyvista` Pytest-pyvista package Mar 19, 2023 4 - Beta pytest>=3.5.0 :pypi:`pytest-qasync` Pytest support for qasync. Jul 12, 2021 4 - Beta pytest (>=5.4.0) :pypi:`pytest-qatouch` Pytest plugin for uploading test results to your QA Touch Testrun. Feb 14, 2023 4 - Beta pytest (>=6.2.0) :pypi:`pytest-qgis` A pytest plugin for testing QGIS python plugins Jun 26, 2022 5 - Production/Stable pytest (>=6.2.3) @@ -882,10 +885,10 @@ This list contains 1224 plugins. :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Dec 03, 2022 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-readme` Test your README.md file Sep 02, 2022 5 - Production/Stable N/A :pypi:`pytest-reana` Pytest fixtures for REANA. Dec 13, 2022 3 - Alpha N/A - :pypi:`pytest-recorder` Pytest plugin, meant to facilitate unit tests writing for tools consumming Web APIs. Mar 15, 2023 N/A N/A + :pypi:`pytest-recorder` Pytest plugin, meant to facilitate unit tests writing for tools consumming Web APIs. Mar 23, 2023 N/A N/A :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Feb 16, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A - :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Feb 10, 2022 5 - Production/Stable pytest (>=6.2.0) + :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Mar 24, 2023 5 - Production/Stable pytest (>=6.2) :pypi:`pytest-redislite` Pytest plugin for testing code using Redis Apr 05, 2022 4 - Beta pytest :pypi:`pytest-redmine` Pytest plugin for redmine Mar 19, 2018 1 - Planning N/A :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) @@ -948,7 +951,7 @@ This list contains 1224 plugins. :pypi:`pytest-rst` Test code from RST documents with pytest Jan 26, 2023 N/A N/A :pypi:`pytest-rt` pytest data collector plugin for Testgr May 05, 2022 N/A N/A :pypi:`pytest-rts` Coverage-based regression test selection (RTS) plugin for pytest May 17, 2021 N/A pytest - :pypi:`pytest-ruff` pytest plugin to check ruff requirements. Feb 27, 2023 4 - Beta N/A + :pypi:`pytest-ruff` pytest plugin to check ruff requirements. Mar 22, 2023 4 - Beta N/A :pypi:`pytest-run-changed` Pytest plugin that runs changed tests only Apr 02, 2021 3 - Alpha pytest :pypi:`pytest-runfailed` implement a --failed option for pytest Mar 24, 2016 N/A N/A :pypi:`pytest-runner` Invoke py.test as distutils command with dependency resolution Feb 25, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' @@ -964,14 +967,14 @@ This list contains 1224 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 17, 2023 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 25, 2023 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schedule` The job of test scheduling for humans. Jan 07, 2023 5 - Production/Stable N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 21, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 17, 2023 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 25, 2023 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -1093,7 +1096,7 @@ This list contains 1224 plugins. :pypi:`pytest-test-groups` A Pytest plugin for running a subset of your tests by splitting them in to equally sized groups. Oct 25, 2016 5 - Production/Stable N/A :pypi:`pytest-testinfra` Test infrastructures Dec 01, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) - :pypi:`pytest-testmon` selects tests affected by changed files and methods Mar 18, 2023 4 - Beta pytest (<8,>=5) + :pypi:`pytest-testmon` selects tests affected by changed files and methods Mar 25, 2023 4 - Beta pytest (<8,>=5) :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) :pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Mar 03, 2023 4 - Beta pytest (<8,>=5) :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) @@ -1167,7 +1170,7 @@ This list contains 1224 plugins. :pypi:`pytest-ui` Text User Interface for running python tests Jul 05, 2021 4 - Beta pytest :pypi:`pytest-ui-failed-screenshot` UI自动测试失败时自动截图,并将截图加入到测试报告中 Dec 06, 2022 N/A N/A :pypi:`pytest-ui-failed-screenshot-allure` UI自动测试失败时自动截图,并将截图加入到Allure测试报告中 Dec 06, 2022 N/A N/A - :pypi:`pytest-unflakable` Unflakable plugin for PyTest Oct 26, 2022 4 - Beta pytest (>=6.2.0) + :pypi:`pytest-unflakable` Unflakable plugin for PyTest Mar 24, 2023 4 - Beta pytest (>=6.2.0) :pypi:`pytest-unhandled-exception-exit-code` Plugin for py.test set a different exit code on uncaught exceptions Jun 22, 2020 5 - Production/Stable pytest (>=2.3) :pypi:`pytest-unittest-filter` A pytest plugin for filtering unittest-based test classes Jan 12, 2019 4 - Beta pytest (>=3.1.0) :pypi:`pytest-unmarked` Run only unmarked tests Aug 27, 2019 5 - Production/Stable N/A @@ -1184,7 +1187,7 @@ This list contains 1224 plugins. :pypi:`pytest-vcrpandas` Test from HTTP interactions to dataframe processed. Jan 12, 2019 4 - Beta pytest :pypi:`pytest-vcs` Sep 22, 2022 4 - Beta N/A :pypi:`pytest-venv` py.test fixture for creating a virtual environment Aug 04, 2020 4 - Beta pytest - :pypi:`pytest-ver` Pytest module with Verification Protocol, Verification Report and Trace Matrix Mar 05, 2023 4 - Beta N/A + :pypi:`pytest-ver` Pytest module with Verification Protocol, Verification Report and Trace Matrix Mar 22, 2023 4 - Beta N/A :pypi:`pytest-verbose-parametrize` More descriptive output for parametrized py.test tests May 28, 2019 5 - Production/Stable pytest :pypi:`pytest-vimqf` A simple pytest plugin that will shrink pytest output when specified, to fit vim quickfix window. Feb 08, 2021 4 - Beta pytest (>=6.2.2,<7.0.0) :pypi:`pytest-virtualenv` Virtualenv fixture for py.test May 28, 2019 5 - Production/Stable pytest @@ -1230,7 +1233,7 @@ This list contains 1224 plugins. :pypi:`pytest-yaml-sanmu` pytest plugin for generating test cases by yaml Mar 17, 2023 N/A pytest>=7.2.0 :pypi:`pytest-yamltree` Create or check file/directory trees described by YAML Mar 02, 2020 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yamlwsgi` Run tests against wsgi apps defined in yaml May 11, 2010 N/A N/A - :pypi:`pytest-yaml-yoyo` http/https API run by yaml Mar 17, 2023 N/A pytest (>=7.2.0) + :pypi:`pytest-yaml-yoyo` http/https API run by yaml Mar 21, 2023 N/A pytest (>=7.2.0) :pypi:`pytest-yapf` Run yapf Jul 06, 2017 4 - Beta pytest (>=3.1.1) :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) :pypi:`pytest-yield` PyTest plugin to run tests concurrently, each \`yield\` switch context to other one Jan 23, 2019 N/A N/A @@ -1682,9 +1685,9 @@ This list contains 1224 plugins. :pypi:`pytest-asyncio` - *last release*: Dec 08, 2022, + *last release*: Mar 19, 2023, *status*: 4 - Beta, - *requires*: pytest (>=6.1.0) + *requires*: pytest (>=7.0.0) Pytest support for asyncio @@ -2613,8 +2616,8 @@ This list contains 1224 plugins. pytest plugin with fixtures for testing consul aware apps :pypi:`pytest-container` - *last release*: Feb 01, 2022, - *status*: 3 - Alpha, + *last release*: Mar 21, 2023, + *status*: 4 - Beta, *requires*: pytest (>=3.10) Pytest fixtures for writing container based tests @@ -2634,9 +2637,9 @@ This list contains 1224 plugins. A plugin to run tests written with the Contexts framework using pytest :pypi:`pytest-cookies` - *last release*: May 24, 2021, + *last release*: Mar 22, 2023, *status*: 5 - Production/Stable, - *requires*: pytest (>=3.3.0) + *requires*: pytest (>=3.9.0) The pytest plugin for your Cookiecutter templates. 🍪 @@ -2704,7 +2707,7 @@ This list contains 1224 plugins. Use pytest's runner to discover and execute C++ tests :pypi:`pytest-cppython` - *last release*: Mar 16, 2023, + *last release*: Mar 20, 2023, *status*: N/A, *requires*: N/A @@ -2732,7 +2735,7 @@ This list contains 1224 plugins. Manages CrateDB instances during your integration tests :pypi:`pytest-crayons` - *last release*: Mar 18, 2023, + *last release*: Mar 19, 2023, *status*: N/A, *requires*: pytest @@ -3369,9 +3372,9 @@ This list contains 1224 plugins. A plugin to use docker databases for pytests :pypi:`pytest-docker-fixtures` - *last release*: Nov 17, 2022, + *last release*: Mar 24, 2023, *status*: 3 - Alpha, - *requires*: N/A + *requires*: pytest pytest docker fixtures @@ -3501,6 +3504,13 @@ This list contains 1224 plugins. A py.test plugin that parses environment files before running tests + :pypi:`pytest-draw` + *last release*: Mar 21, 2023, + *status*: 3 - Alpha, + *requires*: pytest + + Pytest plugin for randomly selecting a specific number of tests + :pypi:`pytest-drf` *last release*: Jul 12, 2022, *status*: 5 - Production/Stable, @@ -3712,7 +3722,7 @@ This list contains 1224 plugins. pytest embedded plugin for testing espressif boards via serial ports :pypi:`pytest-embrace` - *last release*: Mar 12, 2023, + *last release*: Mar 25, 2023, *status*: N/A, *requires*: pytest (>=7.0,<8.0) @@ -3851,6 +3861,13 @@ This list contains 1224 plugins. Applies eventlet monkey-patch as a pytest plugin. + :pypi:`pytest-examples` + *last release*: Mar 25, 2023, + *status*: 4 - Beta, + *requires*: pytest>=7 + + Pytest plugin for testing examples in docstrings and markdown files. + :pypi:`pytest-excel` *last release*: Jan 31, 2022, *status*: 5 - Production/Stable, @@ -3873,7 +3890,7 @@ This list contains 1224 plugins. Walk your code through exception script to check it's resiliency to failures. :pypi:`pytest-executable` - *last release*: Nov 05, 2022, + *last release*: Mar 25, 2023, *status*: N/A, *requires*: pytest (<8,>=4.3) @@ -3894,7 +3911,7 @@ This list contains 1224 plugins. py.test plugin to store test expectations and mark tests based on them :pypi:`pytest-expectdir` - *last release*: Mar 12, 2023, + *last release*: Mar 19, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=5.0) @@ -4131,6 +4148,13 @@ This list contains 1224 plugins. A pytest plugin that runs marked tests when files change. + :pypi:`pytest-file-watcher` + *last release*: Mar 23, 2023, + *status*: N/A, + *requires*: pytest + + Pytest-File-Watcher is a CLI tool that watches for changes in your code and runs pytest on the changed files. + :pypi:`pytest-filter-case` *last release*: Nov 05, 2020, *status*: N/A, @@ -4692,7 +4716,7 @@ This list contains 1224 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Mar 17, 2023, + *last release*: Mar 23, 2023, *status*: 3 - Alpha, *requires*: pytest (==7.2.1) @@ -5056,7 +5080,7 @@ This list contains 1224 plugins. Pytest plugin for intercepting outgoing connection requests during pytest run. :pypi:`pytest-invenio` - *last release*: Oct 25, 2022, + *last release*: Mar 24, 2023, *status*: 5 - Production/Stable, *requires*: pytest (<7.2.0,>=6) @@ -6869,7 +6893,7 @@ This list contains 1224 plugins. A Pytest plugin to drop duplicated tests during collection, but will prefer keeping nested packages. :pypi:`pytest-pretty` - *last release*: Feb 01, 2023, + *last release*: Mar 22, 2023, *status*: 5 - Production/Stable, *requires*: pytest>=7 @@ -7121,7 +7145,7 @@ This list contains 1224 plugins. pytest plugin for a better developer experience when working with the PyTorch test suite :pypi:`pytest-pyvista` - *last release*: Mar 07, 2023, + *last release*: Mar 19, 2023, *status*: 4 - Beta, *requires*: pytest>=3.5.0 @@ -7296,7 +7320,7 @@ This list contains 1224 plugins. Pytest fixtures for REANA. :pypi:`pytest-recorder` - *last release*: Mar 15, 2023, + *last release*: Mar 23, 2023, *status*: N/A, *requires*: N/A @@ -7317,9 +7341,9 @@ This list contains 1224 plugins. Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal :pypi:`pytest-redis` - *last release*: Feb 10, 2022, + *last release*: Mar 24, 2023, *status*: 5 - Production/Stable, - *requires*: pytest (>=6.2.0) + *requires*: pytest (>=6.2) Redis fixtures and fixture factories for Pytest. @@ -7758,7 +7782,7 @@ This list contains 1224 plugins. Coverage-based regression test selection (RTS) plugin for pytest :pypi:`pytest-ruff` - *last release*: Feb 27, 2023, + *last release*: Mar 22, 2023, *status*: 4 - Beta, *requires*: N/A @@ -7870,7 +7894,7 @@ This list contains 1224 plugins. :pypi:`pytest-sbase` - *last release*: Mar 17, 2023, + *last release*: Mar 25, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -7919,7 +7943,7 @@ This list contains 1224 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Mar 17, 2023, + *last release*: Mar 25, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -8773,7 +8797,7 @@ This list contains 1224 plugins. pytest reporting plugin for testlink :pypi:`pytest-testmon` - *last release*: Mar 18, 2023, + *last release*: Mar 25, 2023, *status*: 4 - Beta, *requires*: pytest (<8,>=5) @@ -9291,7 +9315,7 @@ This list contains 1224 plugins. UI自动测试失败时自动截图,并将截图加入到Allure测试报告中 :pypi:`pytest-unflakable` - *last release*: Oct 26, 2022, + *last release*: Mar 24, 2023, *status*: 4 - Beta, *requires*: pytest (>=6.2.0) @@ -9410,7 +9434,7 @@ This list contains 1224 plugins. py.test fixture for creating a virtual environment :pypi:`pytest-ver` - *last release*: Mar 05, 2023, + *last release*: Mar 22, 2023, *status*: 4 - Beta, *requires*: N/A @@ -9732,7 +9756,7 @@ This list contains 1224 plugins. Run tests against wsgi apps defined in yaml :pypi:`pytest-yaml-yoyo` - *last release*: Mar 17, 2023, + *last release*: Mar 21, 2023, *status*: N/A, *requires*: pytest (>=7.2.0) From 2a39ed3461e44d4801316783308d8d9595422c83 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 4 Apr 2023 06:34:42 +0000 Subject: [PATCH 546/549] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.1.0 → 23.3.0](https://github.com/psf/black/compare/23.1.0...23.3.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8826b00fe3e..d672875962f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ default_language_version: python: "3.10" repos: - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 23.3.0 hooks: - id: black args: [--safe, --quiet] From 31d0b51039fc295dfb14bfc5d2baddebe11bb746 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 4 Apr 2023 13:17:43 -0300 Subject: [PATCH 547/549] [automated] Update plugin list (#10857) Co-authored-by: pytest bot --- doc/en/reference/plugin_list.rst | 130 +++++++++++++++++++------------ 1 file changed, 81 insertions(+), 49 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index cb696af1208..d558ccf5707 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,13 +11,14 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1227 plugins. +This list contains 1231 plugins. .. only:: not latex =============================================== ======================================================================================================================================================================================================== ============== ===================== ================================================ name summary last release status requires =============================================== ======================================================================================================================================================================================================== ============== ===================== ================================================ + :pypi:`pytest-abq` Pytest integration for the ABQ universal test runner. Mar 27, 2023 N/A N/A :pypi:`pytest-abstracts` A contextmanager pytest fixture for handling multiple mock abstracts May 25, 2022 N/A N/A :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Dec 21, 2022 N/A pytest (>=6,<8) :pypi:`pytest-adaptavist` pytest plugin for generating test execution results within Jira Test Management (tm4j) Oct 13, 2022 N/A pytest (>=5.4.0) @@ -207,7 +208,7 @@ This list contains 1227 plugins. :pypi:`pytest-colordots` Colorizes the progress indicators Oct 06, 2017 5 - Production/Stable N/A :pypi:`pytest-commander` An interactive GUI test runner for PyTest Aug 17, 2021 N/A pytest (<7.0.0,>=6.2.4) :pypi:`pytest-common-subject` pytest framework for testing different aspects of a common method May 15, 2022 N/A pytest (>=3.6,<8) - :pypi:`pytest-compare` pytest plugin for comparing call arguments. Mar 16, 2023 5 - Production/Stable N/A + :pypi:`pytest-compare` pytest plugin for comparing call arguments. Mar 30, 2023 5 - Production/Stable N/A :pypi:`pytest-concurrent` Concurrently execute test cases with multithread, multiprocess and gevent Jan 12, 2019 4 - Beta pytest (>=3.1.1) :pypi:`pytest-config` Base configurations and utilities for developing your Python project test suite with pytest. Nov 07, 2014 5 - Production/Stable N/A :pypi:`pytest-confluence-report` Package stands for pytest plugin to upload results into Confluence page. Apr 17, 2022 N/A N/A @@ -349,7 +350,7 @@ This list contains 1227 plugins. :pypi:`pytest-duration-insights` Jun 25, 2021 N/A N/A :pypi:`pytest-durations` Pytest plugin reporting fixtures and test functions execution time. Apr 22, 2022 5 - Production/Stable pytest (>=4.6) :pypi:`pytest-dynamicrerun` A pytest plugin to rerun tests dynamically based off of test outcome and output. Aug 15, 2020 4 - Beta N/A - :pypi:`pytest-dynamodb` DynamoDB fixtures for pytest Mar 03, 2023 5 - Production/Stable pytest + :pypi:`pytest-dynamodb` DynamoDB fixtures for pytest Mar 27, 2023 5 - Production/Stable pytest :pypi:`pytest-easy-addoption` pytest-easy-addoption: Easy way to work with pytest addoption Jan 22, 2020 N/A N/A :pypi:`pytest-easy-api` Simple API testing with pytest Mar 26, 2018 N/A N/A :pypi:`pytest-easyMPI` Package that supports mpi tests in pytest Oct 21, 2020 N/A N/A @@ -391,7 +392,7 @@ This list contains 1227 plugins. :pypi:`pytest-ethereum` pytest-ethereum: Pytest library for ethereum projects. Jun 24, 2019 3 - Alpha pytest (==3.3.2); extra == 'dev' :pypi:`pytest-eucalyptus` Pytest Plugin for BDD Jun 28, 2022 N/A pytest (>=4.2.0) :pypi:`pytest-eventlet` Applies eventlet monkey-patch as a pytest plugin. Oct 04, 2021 N/A pytest ; extra == 'dev' - :pypi:`pytest-examples` Pytest plugin for testing examples in docstrings and markdown files. Mar 25, 2023 4 - Beta pytest>=7 + :pypi:`pytest-examples` Pytest plugin for testing examples in docstrings and markdown files. Mar 26, 2023 4 - Beta pytest>=7 :pypi:`pytest-excel` pytest plugin for generating excel reports Jan 31, 2022 5 - Production/Stable N/A :pypi:`pytest-exceptional` Better exceptions Mar 16, 2017 4 - Beta N/A :pypi:`pytest-exception-script` Walk your code through exception script to check it's resiliency to failures. Aug 04, 2020 3 - Alpha pytest @@ -458,7 +459,7 @@ This list contains 1227 plugins. :pypi:`pytest-flask-ligand` Pytest fixtures and helper functions to use for testing flask-ligand microservices. Feb 10, 2023 4 - Beta pytest (~=7.2) :pypi:`pytest-flask-sqlalchemy` A pytest plugin for preserving test isolation in Flask-SQlAlchemy using database transactions. Apr 30, 2022 4 - Beta pytest (>=3.2.1) :pypi:`pytest-flask-sqlalchemy-transactions` Run tests in transactions using pytest, Flask, and SQLalchemy. Aug 02, 2018 4 - Beta pytest (>=3.2.1) - :pypi:`pytest-flexreport` Feb 05, 2023 4 - Beta N/A + :pypi:`pytest-flexreport` Apr 01, 2023 4 - Beta pytest :pypi:`pytest-fluent` A pytest plugin in order to provide logs via fluentd Jul 12, 2022 4 - Beta pytest :pypi:`pytest-flyte` Pytest fixtures for simplifying Flyte integration testing May 03, 2021 N/A pytest :pypi:`pytest-focus` A pytest plugin that alerts user of failed test cases with screen notifications May 04, 2019 4 - Beta pytest @@ -513,7 +514,7 @@ This list contains 1227 plugins. :pypi:`pytest-historic` Custom report to display pytest historical execution records Apr 08, 2020 N/A pytest :pypi:`pytest-historic-hook` Custom listener to store execution results into MYSQL DB, which is used for pytest-historic report Apr 08, 2020 N/A pytest :pypi:`pytest-homeassistant` A pytest plugin for use with homeassistant custom components. Aug 12, 2020 4 - Beta N/A - :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Mar 23, 2023 3 - Alpha pytest (==7.2.1) + :pypi:`pytest-homeassistant-custom-component` Experimental package to automatically extract test plugins for Home Assistant custom components Apr 01, 2023 3 - Alpha pytest (==7.2.2) :pypi:`pytest-honey` A simple plugin to use with pytest Jan 07, 2022 4 - Beta pytest (>=3.5.0) :pypi:`pytest-honors` Report on tests that honor constraints, and guard against regressions Mar 06, 2020 4 - Beta N/A :pypi:`pytest-hot-test` A plugin that tracks test changes Dec 10, 2022 4 - Beta pytest (>=3.5.0) @@ -559,7 +560,7 @@ This list contains 1227 plugins. :pypi:`pytest-inmanta-yang` Common fixtures used in inmanta yang related modules Jun 16, 2022 4 - Beta N/A :pypi:`pytest-Inomaly` A simple image diff plugin for pytest Feb 13, 2018 4 - Beta N/A :pypi:`pytest-insta` A practical snapshot testing plugin for pytest Nov 02, 2022 N/A pytest (>=7.2.0,<8.0.0) - :pypi:`pytest-instafail` pytest plugin to show failures instantly Jun 14, 2020 4 - Beta pytest (>=2.9) + :pypi:`pytest-instafail` pytest plugin to show failures instantly Mar 31, 2023 4 - Beta pytest (>=5) :pypi:`pytest-instrument` pytest plugin to instrument tests Apr 05, 2020 5 - Production/Stable pytest (>=5.1.0) :pypi:`pytest-integration` Organizing pytests by integration or not Nov 17, 2022 N/A N/A :pypi:`pytest-integration-mark` Automatic integration test marking and excluding plugin for pytest Jul 19, 2021 N/A pytest (>=5.2,<7.0) @@ -590,7 +591,7 @@ This list contains 1227 plugins. :pypi:`pytest-jsonlint` UNKNOWN Aug 04, 2016 N/A N/A :pypi:`pytest-json-report` A pytest plugin to report test results as JSON files Mar 15, 2022 4 - Beta pytest (>=3.8.0) :pypi:`pytest-jtr` pytest plugin supporting json test report output Nov 29, 2022 N/A pytest (>=7.1.2,<8.0.0) - :pypi:`pytest-jupyter` A pytest plugin for testing Jupyter libraries and extensions. Dec 19, 2022 4 - Beta pytest + :pypi:`pytest-jupyter` A pytest plugin for testing Jupyter libraries and extensions. Mar 30, 2023 4 - Beta pytest :pypi:`pytest-kafka` Zookeeper, Kafka server, and Kafka consumer fixtures for Pytest Oct 01, 2022 N/A pytest :pypi:`pytest-kafkavents` A plugin to send pytest events to Kafka Sep 08, 2021 4 - Beta pytest :pypi:`pytest-kasima` Display horizontal lines above and below the captured standard output for easy viewing. Jan 26, 2023 5 - Production/Stable pytest (>=7.2.1,<8.0.0) @@ -713,7 +714,7 @@ This list contains 1227 plugins. :pypi:`pytest-mypy-plugins` pytest plugin for writing tests for mypy plugins Oct 26, 2022 4 - Beta pytest (>=6.0.0) :pypi:`pytest-mypy-plugins-shim` Substitute for "pytest-mypy-plugins" for Python implementations which aren't supported by mypy. Apr 12, 2021 N/A pytest>=6.0.0 :pypi:`pytest-mypy-testing` Pytest plugin to check mypy output. Feb 25, 2023 N/A pytest>=7,<8 - :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Mar 13, 2023 5 - Production/Stable pytest (>=6.2) + :pypi:`pytest-mysql` MySQL process and client fixtures for pytest Mar 27, 2023 5 - Production/Stable pytest (>=6.2) :pypi:`pytest-needle` pytest plugin for visual testing websites using selenium Dec 10, 2018 4 - Beta pytest (<5.0.0,>=3.0.0) :pypi:`pytest-neo` pytest-neo is a plugin for pytest that shows tests like screen of Matrix. Jan 08, 2022 3 - Alpha pytest (>=6.2.0) :pypi:`pytest-netdut` "Automated software testing for switches using pytest" Jan 11, 2023 N/A pytest (>=3.5.0) @@ -737,7 +738,7 @@ This list contains 1227 plugins. :pypi:`pytest-notimplemented` Pytest markers for not implemented features and tests. Aug 27, 2019 N/A pytest (>=5.1,<6.0) :pypi:`pytest-notion` A PyTest Reporter to send test runs to Notion.so Aug 07, 2019 N/A N/A :pypi:`pytest-nunit` A pytest plugin for generating NUnit3 test result XML output Oct 20, 2022 5 - Production/Stable pytest (>=4.6.0) - :pypi:`pytest-oar` PyTest plugin for the OAR testing framework Feb 22, 2023 N/A pytest>=6.0.1 + :pypi:`pytest-oar` PyTest plugin for the OAR testing framework Mar 31, 2023 N/A pytest>=6.0.1 :pypi:`pytest-object-getter` Import any object from a 3rd party module while mocking its namespace on demand. Jul 31, 2022 5 - Production/Stable pytest :pypi:`pytest-ochrus` pytest results data-base and HTML reporter Feb 21, 2018 4 - Beta N/A :pypi:`pytest-odoo` py.test plugin to run Odoo tests Nov 17, 2022 4 - Beta pytest (>=7.2.0) @@ -785,7 +786,7 @@ This list contains 1227 plugins. :pypi:`pytest-percent` Change the exit code of pytest test sessions when a required percent of tests pass. May 21, 2020 N/A pytest (>=5.2.0) :pypi:`pytest-perf` pytest-perf Jun 23, 2022 5 - Production/Stable pytest (>=6) ; extra == 'testing' :pypi:`pytest-performance` A simple plugin to ensure the execution of critical sections of code has not been impacted Sep 11, 2020 5 - Production/Stable pytest (>=3.7.0) - :pypi:`pytest-persistence` Pytest tool for persistent objects Jun 27, 2022 N/A N/A + :pypi:`pytest-persistence` Pytest tool for persistent objects Mar 28, 2023 N/A N/A :pypi:`pytest-pg` A tiny plugin for pytest which runs PostgreSQL in Docker Sep 19, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-pgsql` Pytest plugins and helpers for tests using a Postgres database. May 13, 2020 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-phmdoctest` pytest plugin to test Python examples in Markdown using phmdoctest. Apr 15, 2022 4 - Beta pytest (>=5.4.3) @@ -885,10 +886,10 @@ This list contains 1227 plugins. :pypi:`pytest-random-order` Randomise the order in which pytest tests are run with some control over the randomness Dec 03, 2022 5 - Production/Stable pytest (>=3.0.0) :pypi:`pytest-readme` Test your README.md file Sep 02, 2022 5 - Production/Stable N/A :pypi:`pytest-reana` Pytest fixtures for REANA. Dec 13, 2022 3 - Alpha N/A - :pypi:`pytest-recorder` Pytest plugin, meant to facilitate unit tests writing for tools consumming Web APIs. Mar 23, 2023 N/A N/A + :pypi:`pytest-recorder` Pytest plugin, meant to facilitate unit tests writing for tools consumming Web APIs. Mar 30, 2023 N/A N/A :pypi:`pytest-recording` A pytest plugin that allows you recording of network interactions via VCR.py Feb 16, 2023 4 - Beta pytest (>=3.5.0) :pypi:`pytest-recordings` Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal Aug 13, 2020 N/A N/A - :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Mar 24, 2023 5 - Production/Stable pytest (>=6.2) + :pypi:`pytest-redis` Redis fixtures and fixture factories for Pytest. Mar 27, 2023 5 - Production/Stable pytest (>=6.2) :pypi:`pytest-redislite` Pytest plugin for testing code using Redis Apr 05, 2022 4 - Beta pytest :pypi:`pytest-redmine` Pytest plugin for redmine Mar 19, 2018 1 - Planning N/A :pypi:`pytest-ref` A plugin to store reference files to ease regression testing Nov 23, 2019 4 - Beta pytest (>=3.5.0) @@ -900,7 +901,7 @@ This list contains 1227 plugins. :pypi:`pytest-relaxed` Relaxed test discovery/organization for pytest Dec 31, 2022 5 - Production/Stable pytest (>=7) :pypi:`pytest-remfiles` Pytest plugin to create a temporary directory with remote files Jul 01, 2019 5 - Production/Stable N/A :pypi:`pytest-remotedata` Pytest plugin for controlling remote data access. Dec 12, 2022 3 - Alpha pytest (>=4.6) - :pypi:`pytest-remote-response` Pytest plugin for capturing and mocking connection requests. Jun 05, 2022 4 - Beta pytest (>=4.6) + :pypi:`pytest-remote-response` Pytest plugin for capturing and mocking connection requests. Mar 27, 2023 4 - Beta pytest (>=4.6) :pypi:`pytest-remove-stale-bytecode` py.test plugin to remove stale byte code files. Mar 04, 2020 4 - Beta pytest :pypi:`pytest-reorder` Reorder tests depending on their paths and names. May 31, 2018 4 - Beta pytest :pypi:`pytest-repeat` pytest plugin for repeating tests Oct 31, 2020 5 - Production/Stable pytest (>=3.6) @@ -915,7 +916,7 @@ This list contains 1227 plugins. :pypi:`pytest-reportlog` Replacement for the --resultlog option, focused in simplicity and extensibility Mar 11, 2023 3 - Alpha pytest :pypi:`pytest-report-me` A pytest plugin to generate report. Dec 31, 2020 N/A pytest :pypi:`pytest-report-parameters` pytest plugin for adding tests' parameters to junit report Jun 18, 2020 3 - Alpha pytest (>=2.4.2) - :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Feb 20, 2023 N/A pytest (>=3.8.0) + :pypi:`pytest-reportportal` Agent for Reporting results of tests to the Report Portal Mar 28, 2023 N/A pytest (>=3.8.0) :pypi:`pytest-reqs` pytest plugin to check pinned requirements May 12, 2019 N/A pytest (>=2.4.2) :pypi:`pytest-requests` A simple plugin to use with pytest Jun 24, 2019 4 - Beta pytest (>=3.5.0) :pypi:`pytest-requestselapsed` collect and show http requests elapsed time Aug 14, 2022 N/A N/A @@ -937,6 +938,7 @@ This list contains 1227 plugins. :pypi:`pytest-result-log` Write the execution result of the case to the log Feb 02, 2023 N/A pytest>=7.2.0 :pypi:`pytest-rethinkdb` A RethinkDB plugin for pytest. Jul 24, 2016 4 - Beta N/A :pypi:`pytest-retry` Adds the ability to retry flaky tests in CI environments Aug 16, 2022 N/A pytest (>=7.0.0) + :pypi:`pytest-retry-class` A pytest plugin to rerun entire class on failure Mar 25, 2023 N/A pytest (>=5.3) :pypi:`pytest-reverse` Pytest plugin to reverse test order. May 11, 2022 5 - Production/Stable pytest :pypi:`pytest-rich` Leverage rich for richer test session output Mar 03, 2022 4 - Beta pytest (>=7.0) :pypi:`pytest-rich-reporter` A pytest plugin using Rich for beautiful test result formatting. Feb 17, 2022 1 - Planning pytest (>=5.0.0) @@ -958,6 +960,7 @@ This list contains 1227 plugins. :pypi:`pytest-run-subprocess` Pytest Plugin for running and testing subprocesses. Nov 12, 2022 5 - Production/Stable pytest :pypi:`pytest-runtime-types` Checks type annotations on runtime while running tests. Feb 09, 2023 N/A pytest :pypi:`pytest-runtime-xfail` Call runtime_xfail() to mark running test as xfail. Aug 26, 2021 N/A pytest>=5.0.0 + :pypi:`pytest-ry-demo1` 测试 Mar 26, 2023 N/A N/A :pypi:`pytest-saccharin` pytest-saccharin is a updated fork of pytest-sugar, a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly). Oct 31, 2022 3 - Alpha N/A :pypi:`pytest-salt` Pytest Salt Plugin Jan 27, 2020 4 - Beta N/A :pypi:`pytest-salt-containers` A Pytest plugin that builds and creates docker containers Nov 09, 2016 4 - Beta N/A @@ -967,14 +970,14 @@ This list contains 1227 plugins. :pypi:`pytest-sanic` a pytest plugin for Sanic Oct 25, 2021 N/A pytest (>=5.2) :pypi:`pytest-sanity` Dec 07, 2020 N/A N/A :pypi:`pytest-sa-pg` May 14, 2019 N/A N/A - :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 25, 2023 5 - Production/Stable N/A + :pypi:`pytest-sbase` A complete web automation framework for end-to-end testing. Mar 28, 2023 5 - Production/Stable N/A :pypi:`pytest-scenario` pytest plugin for test scenarios Feb 06, 2017 3 - Alpha N/A :pypi:`pytest-schedule` The job of test scheduling for humans. Jan 07, 2023 5 - Production/Stable N/A :pypi:`pytest-schema` 👍 Validate return values against a schema-like object in testing Mar 14, 2022 5 - Production/Stable pytest (>=3.5.0) :pypi:`pytest-securestore` An encrypted password store for use within pytest cases Nov 08, 2021 4 - Beta N/A :pypi:`pytest-select` A pytest plugin which allows to (de-)select tests from a file. Jan 18, 2019 3 - Alpha pytest (>=3.0) :pypi:`pytest-selenium` pytest plugin for Selenium Sep 21, 2022 5 - Production/Stable pytest (>=6.0.0,<7.0.0) - :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 25, 2023 5 - Production/Stable N/A + :pypi:`pytest-seleniumbase` A complete web automation framework for end-to-end testing. Mar 28, 2023 5 - Production/Stable N/A :pypi:`pytest-selenium-enhancer` pytest plugin for Selenium Apr 29, 2022 5 - Production/Stable N/A :pypi:`pytest-selenium-pdiff` A pytest package implementing perceptualdiff for Selenium tests. Apr 06, 2017 2 - Pre-Alpha N/A :pypi:`pytest-send-email` Send pytest execution result email Dec 04, 2019 N/A N/A @@ -1073,7 +1076,7 @@ This list contains 1227 plugins. :pypi:`pytest-symbols` pytest-symbols is a pytest plugin that adds support for passing test environment symbols into pytest tests. Nov 20, 2017 3 - Alpha N/A :pypi:`pytest-system-statistics` Pytest plugin to track and report system usage statistics Feb 16, 2022 5 - Production/Stable pytest (>=6.0.0) :pypi:`pytest-system-test-plugin` Pyst - Pytest System-Test Plugin Feb 03, 2022 N/A N/A - :pypi:`pytest-tagging` a pytest plugin to tag tests Oct 23, 2022 N/A pytest (>=7.1.3,<8.0.0) + :pypi:`pytest-tagging` a pytest plugin to tag tests Apr 01, 2023 N/A pytest (>=7.1.3,<8.0.0) :pypi:`pytest-takeltest` Fixtures for ansible, testinfra and molecule Feb 15, 2023 N/A N/A :pypi:`pytest-talisker` Nov 28, 2021 N/A N/A :pypi:`pytest-tap` Test Anything Protocol (TAP) reporting plugin for pytest Oct 27, 2021 5 - Production/Stable pytest (>=3.0) @@ -1097,6 +1100,7 @@ This list contains 1227 plugins. :pypi:`pytest-testinfra` Test infrastructures Dec 01, 2022 5 - Production/Stable pytest (!=3.0.2) :pypi:`pytest-testlink-adaptor` pytest reporting plugin for testlink Dec 20, 2018 4 - Beta pytest (>=2.6) :pypi:`pytest-testmon` selects tests affected by changed files and methods Mar 25, 2023 4 - Beta pytest (<8,>=5) + :pypi:`pytest-testmon-dev` selects tests affected by changed files and methods Mar 30, 2023 4 - Beta pytest (<8,>=5) :pypi:`pytest-testmon-oc` nOly selects tests affected by changed files and methods Jun 01, 2022 4 - Beta pytest (<8,>=5) :pypi:`pytest-testmon-skip-libraries` selects tests affected by changed files and methods Mar 03, 2023 4 - Beta pytest (<8,>=5) :pypi:`pytest-testobject` Plugin to use TestObject Suites with Pytest Sep 24, 2019 4 - Beta pytest (>=3.1.1) @@ -1127,7 +1131,7 @@ This list contains 1227 plugins. :pypi:`pytest-timeouts` Linux-only Pytest plugin to control durations of various test case execution phases Sep 21, 2019 5 - Production/Stable N/A :pypi:`pytest-timer` A timer plugin for pytest Jun 02, 2021 N/A N/A :pypi:`pytest-timestamper` Pytest plugin to add a timestamp prefix to the pytest output Jun 06, 2021 N/A N/A - :pypi:`pytest-timestamps` A simple plugin to view timestamps for each test Jan 16, 2022 N/A pytest (>=5.2) + :pypi:`pytest-timestamps` A simple plugin to view timestamps for each test Apr 01, 2023 N/A pytest (>=5.2) :pypi:`pytest-tipsi-django` Nov 17, 2021 4 - Beta pytest (>=6.0.0) :pypi:`pytest-tipsi-testing` Better fixtures management. Various helpers Nov 04, 2020 4 - Beta pytest (>=3.3.0) :pypi:`pytest-tldr` A pytest plugin that limits the output to just the things you need. Oct 26, 2022 4 - Beta pytest (>=3.5.0) @@ -1158,7 +1162,7 @@ This list contains 1227 plugins. :pypi:`pytest-tspwplib` A simple plugin to use with tspwplib Jan 08, 2021 4 - Beta pytest (>=3.5.0) :pypi:`pytest-tst` Customize pytest options, output and exit code to make it compatible with tst Apr 27, 2022 N/A pytest (>=5.0.0) :pypi:`pytest-tstcls` Test Class Base Mar 23, 2020 5 - Production/Stable N/A - :pypi:`pytest-tui` Text User Interface (TUI) and HTML report for Pytest test runs Feb 01, 2023 4 - Beta pytest (>=6.2.5) + :pypi:`pytest-tui` Text User Interface (TUI) and HTML report for Pytest test runs Mar 30, 2023 4 - Beta N/A :pypi:`pytest-tutorials` Mar 11, 2023 N/A N/A :pypi:`pytest-twilio-conversations-client-mock` Aug 02, 2022 N/A N/A :pypi:`pytest-twisted` A twisted plugin for pytest. Oct 16, 2022 5 - Production/Stable pytest (>=2.3) @@ -1235,9 +1239,9 @@ This list contains 1227 plugins. :pypi:`pytest-yamlwsgi` Run tests against wsgi apps defined in yaml May 11, 2010 N/A N/A :pypi:`pytest-yaml-yoyo` http/https API run by yaml Mar 21, 2023 N/A pytest (>=7.2.0) :pypi:`pytest-yapf` Run yapf Jul 06, 2017 4 - Beta pytest (>=3.1.1) - :pypi:`pytest-yapf3` Validate your Python file format with yapf Aug 03, 2020 5 - Production/Stable pytest (>=5.4) + :pypi:`pytest-yapf3` Validate your Python file format with yapf Mar 29, 2023 5 - Production/Stable pytest (>=7) :pypi:`pytest-yield` PyTest plugin to run tests concurrently, each \`yield\` switch context to other one Jan 23, 2019 N/A N/A - :pypi:`pytest-yls` Pytest plugin to test the YLS as a whole. Mar 06, 2023 N/A pytest (>=7.1.2,<8.0.0) + :pypi:`pytest-yls` Pytest plugin to test the YLS as a whole. Mar 29, 2023 N/A pytest (>=7.2.2,<8.0.0) :pypi:`pytest-yuk` Display tests you are uneasy with, using 🤢/🤮 for pass/fail of tests marked with yuk. Mar 26, 2021 N/A pytest>=5.0.0 :pypi:`pytest-zafira` A Zafira plugin for pytest Sep 18, 2019 5 - Production/Stable pytest (==4.1.1) :pypi:`pytest-zap` OWASP ZAP plugin for py.test. May 12, 2014 4 - Beta N/A @@ -1250,6 +1254,13 @@ This list contains 1227 plugins. .. only:: latex + :pypi:`pytest-abq` + *last release*: Mar 27, 2023, + *status*: N/A, + *requires*: N/A + + Pytest integration for the ABQ universal test runner. + :pypi:`pytest-abstracts` *last release*: May 25, 2022, *status*: N/A, @@ -2574,7 +2585,7 @@ This list contains 1227 plugins. pytest framework for testing different aspects of a common method :pypi:`pytest-compare` - *last release*: Mar 16, 2023, + *last release*: Mar 30, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -3568,7 +3579,7 @@ This list contains 1227 plugins. A pytest plugin to rerun tests dynamically based off of test outcome and output. :pypi:`pytest-dynamodb` - *last release*: Mar 03, 2023, + *last release*: Mar 27, 2023, *status*: 5 - Production/Stable, *requires*: pytest @@ -3862,7 +3873,7 @@ This list contains 1227 plugins. Applies eventlet monkey-patch as a pytest plugin. :pypi:`pytest-examples` - *last release*: Mar 25, 2023, + *last release*: Mar 26, 2023, *status*: 4 - Beta, *requires*: pytest>=7 @@ -4331,9 +4342,9 @@ This list contains 1227 plugins. Run tests in transactions using pytest, Flask, and SQLalchemy. :pypi:`pytest-flexreport` - *last release*: Feb 05, 2023, + *last release*: Apr 01, 2023, *status*: 4 - Beta, - *requires*: N/A + *requires*: pytest @@ -4716,9 +4727,9 @@ This list contains 1227 plugins. A pytest plugin for use with homeassistant custom components. :pypi:`pytest-homeassistant-custom-component` - *last release*: Mar 23, 2023, + *last release*: Apr 01, 2023, *status*: 3 - Alpha, - *requires*: pytest (==7.2.1) + *requires*: pytest (==7.2.2) Experimental package to automatically extract test plugins for Home Assistant custom components @@ -5038,9 +5049,9 @@ This list contains 1227 plugins. A practical snapshot testing plugin for pytest :pypi:`pytest-instafail` - *last release*: Jun 14, 2020, + *last release*: Mar 31, 2023, *status*: 4 - Beta, - *requires*: pytest (>=2.9) + *requires*: pytest (>=5) pytest plugin to show failures instantly @@ -5255,7 +5266,7 @@ This list contains 1227 plugins. pytest plugin supporting json test report output :pypi:`pytest-jupyter` - *last release*: Dec 19, 2022, + *last release*: Mar 30, 2023, *status*: 4 - Beta, *requires*: pytest @@ -6116,7 +6127,7 @@ This list contains 1227 plugins. Pytest plugin to check mypy output. :pypi:`pytest-mysql` - *last release*: Mar 13, 2023, + *last release*: Mar 27, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2) @@ -6284,7 +6295,7 @@ This list contains 1227 plugins. A pytest plugin for generating NUnit3 test result XML output :pypi:`pytest-oar` - *last release*: Feb 22, 2023, + *last release*: Mar 31, 2023, *status*: N/A, *requires*: pytest>=6.0.1 @@ -6620,7 +6631,7 @@ This list contains 1227 plugins. A simple plugin to ensure the execution of critical sections of code has not been impacted :pypi:`pytest-persistence` - *last release*: Jun 27, 2022, + *last release*: Mar 28, 2023, *status*: N/A, *requires*: N/A @@ -7320,7 +7331,7 @@ This list contains 1227 plugins. Pytest fixtures for REANA. :pypi:`pytest-recorder` - *last release*: Mar 23, 2023, + *last release*: Mar 30, 2023, *status*: N/A, *requires*: N/A @@ -7341,7 +7352,7 @@ This list contains 1227 plugins. Provides pytest plugins for reporting request/response traffic, screenshots, and more to ReportPortal :pypi:`pytest-redis` - *last release*: Mar 24, 2023, + *last release*: Mar 27, 2023, *status*: 5 - Production/Stable, *requires*: pytest (>=6.2) @@ -7425,7 +7436,7 @@ This list contains 1227 plugins. Pytest plugin for controlling remote data access. :pypi:`pytest-remote-response` - *last release*: Jun 05, 2022, + *last release*: Mar 27, 2023, *status*: 4 - Beta, *requires*: pytest (>=4.6) @@ -7530,7 +7541,7 @@ This list contains 1227 plugins. pytest plugin for adding tests' parameters to junit report :pypi:`pytest-reportportal` - *last release*: Feb 20, 2023, + *last release*: Mar 28, 2023, *status*: N/A, *requires*: pytest (>=3.8.0) @@ -7683,6 +7694,13 @@ This list contains 1227 plugins. Adds the ability to retry flaky tests in CI environments + :pypi:`pytest-retry-class` + *last release*: Mar 25, 2023, + *status*: N/A, + *requires*: pytest (>=5.3) + + A pytest plugin to rerun entire class on failure + :pypi:`pytest-reverse` *last release*: May 11, 2022, *status*: 5 - Production/Stable, @@ -7830,6 +7848,13 @@ This list contains 1227 plugins. Call runtime_xfail() to mark running test as xfail. + :pypi:`pytest-ry-demo1` + *last release*: Mar 26, 2023, + *status*: N/A, + *requires*: N/A + + 测试 + :pypi:`pytest-saccharin` *last release*: Oct 31, 2022, *status*: 3 - Alpha, @@ -7894,7 +7919,7 @@ This list contains 1227 plugins. :pypi:`pytest-sbase` - *last release*: Mar 25, 2023, + *last release*: Mar 28, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -7943,7 +7968,7 @@ This list contains 1227 plugins. pytest plugin for Selenium :pypi:`pytest-seleniumbase` - *last release*: Mar 25, 2023, + *last release*: Mar 28, 2023, *status*: 5 - Production/Stable, *requires*: N/A @@ -8636,7 +8661,7 @@ This list contains 1227 plugins. Pyst - Pytest System-Test Plugin :pypi:`pytest-tagging` - *last release*: Oct 23, 2022, + *last release*: Apr 01, 2023, *status*: N/A, *requires*: pytest (>=7.1.3,<8.0.0) @@ -8803,6 +8828,13 @@ This list contains 1227 plugins. selects tests affected by changed files and methods + :pypi:`pytest-testmon-dev` + *last release*: Mar 30, 2023, + *status*: 4 - Beta, + *requires*: pytest (<8,>=5) + + selects tests affected by changed files and methods + :pypi:`pytest-testmon-oc` *last release*: Jun 01, 2022, *status*: 4 - Beta, @@ -9014,7 +9046,7 @@ This list contains 1227 plugins. Pytest plugin to add a timestamp prefix to the pytest output :pypi:`pytest-timestamps` - *last release*: Jan 16, 2022, + *last release*: Apr 01, 2023, *status*: N/A, *requires*: pytest (>=5.2) @@ -9231,9 +9263,9 @@ This list contains 1227 plugins. Test Class Base :pypi:`pytest-tui` - *last release*: Feb 01, 2023, + *last release*: Mar 30, 2023, *status*: 4 - Beta, - *requires*: pytest (>=6.2.5) + *requires*: N/A Text User Interface (TUI) and HTML report for Pytest test runs @@ -9770,9 +9802,9 @@ This list contains 1227 plugins. Run yapf :pypi:`pytest-yapf3` - *last release*: Aug 03, 2020, + *last release*: Mar 29, 2023, *status*: 5 - Production/Stable, - *requires*: pytest (>=5.4) + *requires*: pytest (>=7) Validate your Python file format with yapf @@ -9784,9 +9816,9 @@ This list contains 1227 plugins. PyTest plugin to run tests concurrently, each \`yield\` switch context to other one :pypi:`pytest-yls` - *last release*: Mar 06, 2023, + *last release*: Mar 29, 2023, *status*: N/A, - *requires*: pytest (>=7.1.2,<8.0.0) + *requires*: pytest (>=7.2.2,<8.0.0) Pytest plugin to test the YLS as a whole. From 3683722bcbc0facc8fe695c7ece286f26fc6234f Mon Sep 17 00:00:00 2001 From: Kodi Arfer Date: Wed, 5 Apr 2023 21:48:24 -0400 Subject: [PATCH 548/549] FormattedExcinfo.get_source: avoid crash when line number is out-of-bounds/negative pytest could crash given pathological AST position attributes, which shouldn't happen when testing real Python code, but could happen when testing AST produced by e.g. Hylang. Another example of the failure is in the nightly CI for the JAX project: https://github.com/google/jax/actions/runs/4607513902/jobs/8142126075 Co-authored-by: Bruno Oliveira Co-authored-by: Jake VanderPlas --- AUTHORS | 1 + changelog/10840.improvement.rst | 1 + src/_pytest/_code/code.py | 8 +++++--- testing/code/test_excinfo.py | 18 ++++++++++++++++++ 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 changelog/10840.improvement.rst diff --git a/AUTHORS b/AUTHORS index 05823646188..1aa5265e62e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -163,6 +163,7 @@ Ionuț Turturică Itxaso Aizpurua Iwan Briquemont Jaap Broekhuizen +Jake VanderPlas Jakob van Santen Jakub Mitoraj James Bourbeau diff --git a/changelog/10840.improvement.rst b/changelog/10840.improvement.rst new file mode 100644 index 00000000000..17be0d07b06 --- /dev/null +++ b/changelog/10840.improvement.rst @@ -0,0 +1 @@ +pytest should no longer crash on AST with pathological position attributes, for example testing AST produced by `Hylang __`. diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index e375fb70c44..032b83beb02 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -743,11 +743,13 @@ def get_source( ) -> List[str]: """Return formatted and marked up source lines.""" lines = [] - if source is None or line_index >= len(source.lines): + if source is not None and line_index < 0: + line_index += len(source) + if source is None or line_index >= len(source.lines) or line_index < 0: + # `line_index` could still be outside `range(len(source.lines))` if + # we're processing AST with pathological position attributes. source = Source("???") line_index = 0 - if line_index < 0: - line_index += len(source) space_prefix = " " if short: lines.append(space_prefix + source.lines[line_index].strip()) diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py index 3607501a84e..918c972762b 100644 --- a/testing/code/test_excinfo.py +++ b/testing/code/test_excinfo.py @@ -461,6 +461,24 @@ def f(x): assert lines[0] == "| def f(x):" assert lines[1] == " pass" + def test_repr_source_out_of_bounds(self): + pr = FormattedExcinfo() + source = _pytest._code.Source( + """\ + def f(x): + pass + """ + ).strip() + pr.flow_marker = "|" # type: ignore[misc] + + lines = pr.get_source(source, 100) + assert len(lines) == 1 + assert lines[0] == "| ???" + + lines = pr.get_source(source, -100) + assert len(lines) == 1 + assert lines[0] == "| ???" + def test_repr_source_excinfo(self) -> None: """Check if indentation is right.""" try: From ef982aaf2bce28d6b27e24756a4d29377a593a1d Mon Sep 17 00:00:00 2001 From: pytest bot Date: Sat, 8 Apr 2023 21:19:52 +0000 Subject: [PATCH 549/549] Prepare release version 7.3.0 --- changelog/10226.improvement.rst | 1 - changelog/10525.feature.rst | 1 - changelog/10658.improvement.rst | 3 - changelog/10669.trivial.rst | 1 - changelog/10710.improvement.rst | 1 - changelog/10727.improvement.rst | 1 - changelog/10743.bugfix.rst | 1 - changelog/10755.feature.rst | 1 - changelog/10765.bugfix.rst | 1 - changelog/10782.doc.rst | 1 - changelog/10840.improvement.rst | 1 - changelog/1904.bugfix.rst | 1 - changelog/6267.improvement.rst | 2 - changelog/7431.feature.rst | 1 - changelog/8141.feature.rst | 1 - doc/en/announce/index.rst | 1 + doc/en/announce/release-7.3.0.rst | 130 ++++++++++++++++++++++++++++++ doc/en/changelog.rst | 70 ++++++++++++++++ doc/en/example/parametrize.rst | 8 +- doc/en/example/reportingdemo.rst | 102 +++++++++++------------ doc/en/getting-started.rst | 2 +- 21 files changed, 259 insertions(+), 72 deletions(-) delete mode 100644 changelog/10226.improvement.rst delete mode 100644 changelog/10525.feature.rst delete mode 100644 changelog/10658.improvement.rst delete mode 100644 changelog/10669.trivial.rst delete mode 100644 changelog/10710.improvement.rst delete mode 100644 changelog/10727.improvement.rst delete mode 100644 changelog/10743.bugfix.rst delete mode 100644 changelog/10755.feature.rst delete mode 100644 changelog/10765.bugfix.rst delete mode 100644 changelog/10782.doc.rst delete mode 100644 changelog/10840.improvement.rst delete mode 100644 changelog/1904.bugfix.rst delete mode 100644 changelog/6267.improvement.rst delete mode 100644 changelog/7431.feature.rst delete mode 100644 changelog/8141.feature.rst create mode 100644 doc/en/announce/release-7.3.0.rst diff --git a/changelog/10226.improvement.rst b/changelog/10226.improvement.rst deleted file mode 100644 index f1506eaf79e..00000000000 --- a/changelog/10226.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -If multiple errors are raised in teardown, we now re-raise an ``ExceptionGroup`` of them instead of discarding all but the last. diff --git a/changelog/10525.feature.rst b/changelog/10525.feature.rst deleted file mode 100644 index 15652b0246d..00000000000 --- a/changelog/10525.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Test methods decorated with ``@classmethod`` can now be discovered as tests, following the same rules as normal methods. This fills the gap that static methods were discoverable as tests but not class methods. diff --git a/changelog/10658.improvement.rst b/changelog/10658.improvement.rst deleted file mode 100644 index 54e5ae84f24..00000000000 --- a/changelog/10658.improvement.rst +++ /dev/null @@ -1,3 +0,0 @@ -Allow ``-p`` arguments to include spaces (eg: ``-p no:logging`` instead of -``-pno:logging``). Mostly useful in the ``addopts`` section of the configuration -file. diff --git a/changelog/10669.trivial.rst b/changelog/10669.trivial.rst deleted file mode 100644 index 6cebe12ec26..00000000000 --- a/changelog/10669.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -pytest no longer depends on the `attrs` package (don't worry, nice diffs for attrs classes are still supported). diff --git a/changelog/10710.improvement.rst b/changelog/10710.improvement.rst deleted file mode 100644 index a893eec0257..00000000000 --- a/changelog/10710.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Added ``start`` and ``stop`` timestamps to ``TestReport`` objects. diff --git a/changelog/10727.improvement.rst b/changelog/10727.improvement.rst deleted file mode 100644 index 92cb8cc33a6..00000000000 --- a/changelog/10727.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -Split the report header for ``rootdir``, ``config file`` and ``testpaths`` so each has its own line. diff --git a/changelog/10743.bugfix.rst b/changelog/10743.bugfix.rst deleted file mode 100644 index ad5c63e80ee..00000000000 --- a/changelog/10743.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -The assertion rewriting mechanism now works correctly when assertion expressions contain the walrus operator. diff --git a/changelog/10755.feature.rst b/changelog/10755.feature.rst deleted file mode 100644 index 5fb5a97d4ac..00000000000 --- a/changelog/10755.feature.rst +++ /dev/null @@ -1 +0,0 @@ -:confval:`console_output_style` now supports ``progress-even-when-capture-no`` to force the use of the progress output even when capture is disabled. This is useful in large test suites where capture may have significant performance impact. diff --git a/changelog/10765.bugfix.rst b/changelog/10765.bugfix.rst deleted file mode 100644 index 89391f1f0cd..00000000000 --- a/changelog/10765.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed :fixture:`tmp_path` fixture always raising :class:`OSError` on ``emscripten`` platform due to missing :func:`os.getuid`. diff --git a/changelog/10782.doc.rst b/changelog/10782.doc.rst deleted file mode 100644 index c2bd4af8c31..00000000000 --- a/changelog/10782.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed the minimal example in :ref:`goodpractices`: ``pip install -e .`` requires a ``version`` entry in ``pyproject.toml`` to run successfully. diff --git a/changelog/10840.improvement.rst b/changelog/10840.improvement.rst deleted file mode 100644 index 17be0d07b06..00000000000 --- a/changelog/10840.improvement.rst +++ /dev/null @@ -1 +0,0 @@ -pytest should no longer crash on AST with pathological position attributes, for example testing AST produced by `Hylang __`. diff --git a/changelog/1904.bugfix.rst b/changelog/1904.bugfix.rst deleted file mode 100644 index dc8e0f34217..00000000000 --- a/changelog/1904.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Correctly handle ``__tracebackhide__`` for chained exceptions. diff --git a/changelog/6267.improvement.rst b/changelog/6267.improvement.rst deleted file mode 100644 index ed551cecc33..00000000000 --- a/changelog/6267.improvement.rst +++ /dev/null @@ -1,2 +0,0 @@ -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. diff --git a/changelog/7431.feature.rst b/changelog/7431.feature.rst deleted file mode 100644 index 24a64a2ae37..00000000000 --- a/changelog/7431.feature.rst +++ /dev/null @@ -1 +0,0 @@ -``--log-disable`` CLI option added to disable individual loggers. diff --git a/changelog/8141.feature.rst b/changelog/8141.feature.rst deleted file mode 100644 index b589ed2e98b..00000000000 --- a/changelog/8141.feature.rst +++ /dev/null @@ -1 +0,0 @@ -Added :confval:`tmp_path_retention_count` and :confval:`tmp_path_retention_policy` configuration options to control how directories created by the :fixture:`tmp_path` fixture are kept. diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst index fa57ca5c8af..96db2e248a7 100644 --- a/doc/en/announce/index.rst +++ b/doc/en/announce/index.rst @@ -6,6 +6,7 @@ Release announcements :maxdepth: 2 + release-7.3.0 release-7.2.2 release-7.2.1 release-7.2.0 diff --git a/doc/en/announce/release-7.3.0.rst b/doc/en/announce/release-7.3.0.rst new file mode 100644 index 00000000000..33258dabade --- /dev/null +++ b/doc/en/announce/release-7.3.0.rst @@ -0,0 +1,130 @@ +pytest-7.3.0 +======================================= + +The pytest team is proud to announce the 7.3.0 release! + +This release contains new features, improvements, and bug fixes, +the full list of changes is available in the changelog: + + https://docs.pytest.org/en/stable/changelog.html + +For complete documentation, please visit: + + https://docs.pytest.org/en/stable/ + +As usual, you can upgrade from PyPI via: + + pip install -U pytest + +Thanks to all of the contributors to this release: + +* Aaron Berdy +* Adam Turner +* Albert Villanova del Moral +* Alessio Izzo +* Alex Hadley +* Alice Purcell +* Anthony Sottile +* Anton Yakutovich +* Ashish Kurmi +* Babak Keyvani +* Billy +* Brandon Chinn +* Bruno Oliveira +* Cal Jacobson +* Chanvin Xiao +* Cheuk Ting Ho +* Chris Wheeler +* Daniel Garcia Moreno +* Daniel Scheffler +* Daniel Valenzuela +* EmptyRabbit +* Ezio Melotti +* Felix Hofstätter +* Florian Best +* Florian Bruhin +* Fredrik Berndtsson +* Gabriel Landau +* Garvit Shubham +* Gergely Kalmár +* HTRafal +* Hugo van Kemenade +* Ilya Konstantinov +* Itxaso Aizpurua +* James Gerity +* Jay +* John Litborn +* Jon Parise +* Jouke Witteveen +* Kadino +* Kevin C +* Kian Eliasi +* Klaus Rettinghaus +* Kodi Arfer +* Mahesh Vashishtha +* Manuel Jacob +* Marko Pacak +* MatthewFlamm +* Miro Hrončok +* Nate Meyvis +* Neil Girdhar +* Nhieuvu1802 +* Nipunn Koorapati +* Ofek Lev +* Paul Kehrer +* Paul Müller +* Paul Reece +* Pax +* Pete Baughman +* Peyman Salehi +* Philipp A +* Pierre Sassoulas +* Prerak Patel +* Ramsey +* Ran Benita +* Robert O'Shea +* Ronny Pfannschmidt +* Rowin +* Ruth Comer +* Samuel Colvin +* Samuel Gaist +* Sandro Tosi +* Santiago Castro +* Shantanu +* Simon K +* Stefanie Molin +* Stephen Rosen +* Sviatoslav Sydorenko +* Tatiana Ovary +* Teejay +* Thierry Moisan +* Thomas Grainger +* Tim Hoffmann +* Tobias Diez +* Tony Narlock +* Vivaan Verma +* Wolfremium +* Yannick PÉROUX +* Yusuke Kadowaki +* Zac Hatfield-Dodds +* Zach OBrien +* aizpurua23a +* bitzge +* bluthej +* gresm +* holesch +* itxasos23 +* johnkangw +* q0w +* rdb +* s-padmanaban +* skhomuti +* sommersoft +* vin01 +* wim glenn +* wodny +* zx.qiu + + +Happy testing, +The pytest Development Team diff --git a/doc/en/changelog.rst b/doc/en/changelog.rst index 020e6289e48..4fc959c6b19 100644 --- a/doc/en/changelog.rst +++ b/doc/en/changelog.rst @@ -28,6 +28,76 @@ with advance notice in the **Deprecations** section of releases. .. towncrier release notes start +pytest 7.3.0 (2023-04-08) +========================= + +Features +-------- + +- `#10525 `_: Test methods decorated with ``@classmethod`` can now be discovered as tests, following the same rules as normal methods. This fills the gap that static methods were discoverable as tests but not class methods. + + +- `#10755 `_: :confval:`console_output_style` now supports ``progress-even-when-capture-no`` to force the use of the progress output even when capture is disabled. This is useful in large test suites where capture may have significant performance impact. + + +- `#7431 `_: ``--log-disable`` CLI option added to disable individual loggers. + + +- `#8141 `_: Added :confval:`tmp_path_retention_count` and :confval:`tmp_path_retention_policy` configuration options to control how directories created by the :fixture:`tmp_path` fixture are kept. + + + +Improvements +------------ + +- `#10226 `_: If multiple errors are raised in teardown, we now re-raise an ``ExceptionGroup`` of them instead of discarding all but the last. + + +- `#10658 `_: Allow ``-p`` arguments to include spaces (eg: ``-p no:logging`` instead of + ``-pno:logging``). Mostly useful in the ``addopts`` section of the configuration + file. + + +- `#10710 `_: Added ``start`` and ``stop`` timestamps to ``TestReport`` objects. + + +- `#10727 `_: Split the report header for ``rootdir``, ``config file`` and ``testpaths`` so each has its own line. + + +- `#10840 `_: pytest should no longer crash on AST with pathological position attributes, for example testing AST produced by `Hylang __`. + + +- `#6267 `_: 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. + + + +Bug Fixes +--------- + +- `#10743 `_: The assertion rewriting mechanism now works correctly when assertion expressions contain the walrus operator. + + +- `#10765 `_: Fixed :fixture:`tmp_path` fixture always raising :class:`OSError` on ``emscripten`` platform due to missing :func:`os.getuid`. + + +- `#1904 `_: Correctly handle ``__tracebackhide__`` for chained exceptions. + + + +Improved Documentation +---------------------- + +- `#10782 `_: Fixed the minimal example in :ref:`goodpractices`: ``pip install -e .`` requires a ``version`` entry in ``pyproject.toml`` to run successfully. + + + +Trivial/Internal Changes +------------------------ + +- `#10669 `_: pytest no longer depends on the `attrs` package (don't worry, nice diffs for attrs classes are still supported). + + pytest 7.2.2 (2023-03-03) ========================= diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst index 1b25dfaf72a..df2859b14e0 100644 --- a/doc/en/example/parametrize.rst +++ b/doc/en/example/parametrize.rst @@ -502,8 +502,12 @@ Running it results in some skips if we don't have all the python interpreters in .. code-block:: pytest . $ pytest -rs -q multipython.py - ........................... [100%] - 27 passed in 0.12s + sssssssssssssssssssssssssss [100%] + ========================= short test summary info ========================== + SKIPPED [9] multipython.py:69: 'python3.5' not found + SKIPPED [9] multipython.py:69: 'python3.6' not found + SKIPPED [9] multipython.py:69: 'python3.7' not found + 27 skipped in 0.12s Indirect parametrization of optional implementations/imports -------------------------------------------------------------------- diff --git a/doc/en/example/reportingdemo.rst b/doc/en/example/reportingdemo.rst index 20dc0a019f2..cb59c4b42e1 100644 --- a/doc/en/example/reportingdemo.rst +++ b/doc/en/example/reportingdemo.rst @@ -70,12 +70,12 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert not f() E assert not 42 - E + where 42 = .f at 0xdeadbeef0002>() + E + where 42 = .f at 0xdeadbeef0006>() failure_demo.py:39: AssertionError _________________ TestSpecialisedExplanations.test_eq_text _________________ - self = + self = def test_eq_text(self): > assert "spam" == "eggs" @@ -86,7 +86,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:44: AssertionError _____________ TestSpecialisedExplanations.test_eq_similar_text _____________ - self = + self = def test_eq_similar_text(self): > assert "foo 1 bar" == "foo 2 bar" @@ -99,7 +99,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:47: AssertionError ____________ TestSpecialisedExplanations.test_eq_multiline_text ____________ - self = + self = def test_eq_multiline_text(self): > assert "foo\nspam\nbar" == "foo\neggs\nbar" @@ -112,7 +112,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:50: AssertionError ______________ TestSpecialisedExplanations.test_eq_long_text _______________ - self = + self = def test_eq_long_text(self): a = "1" * 100 + "a" + "2" * 100 @@ -129,7 +129,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:55: AssertionError _________ TestSpecialisedExplanations.test_eq_long_text_multiline __________ - self = + self = def test_eq_long_text_multiline(self): a = "1\n" * 100 + "a" + "2\n" * 100 @@ -149,7 +149,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:60: AssertionError _________________ TestSpecialisedExplanations.test_eq_list _________________ - self = + self = def test_eq_list(self): > assert [0, 1, 2] == [0, 1, 3] @@ -160,7 +160,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:63: AssertionError ______________ TestSpecialisedExplanations.test_eq_list_long _______________ - self = + self = def test_eq_list_long(self): a = [0] * 100 + [1] + [3] * 100 @@ -173,7 +173,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:68: AssertionError _________________ TestSpecialisedExplanations.test_eq_dict _________________ - self = + self = def test_eq_dict(self): > assert {"a": 0, "b": 1, "c": 0} == {"a": 0, "b": 2, "d": 0} @@ -190,7 +190,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:71: AssertionError _________________ TestSpecialisedExplanations.test_eq_set __________________ - self = + self = def test_eq_set(self): > assert {0, 10, 11, 12} == {0, 20, 21} @@ -207,7 +207,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:74: AssertionError _____________ TestSpecialisedExplanations.test_eq_longer_list ______________ - self = + self = def test_eq_longer_list(self): > assert [1, 2] == [1, 2, 3] @@ -218,7 +218,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:77: AssertionError _________________ TestSpecialisedExplanations.test_in_list _________________ - self = + self = def test_in_list(self): > assert 1 in [0, 2, 3, 4, 5] @@ -227,7 +227,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:80: AssertionError __________ TestSpecialisedExplanations.test_not_in_text_multiline __________ - self = + self = def test_not_in_text_multiline(self): text = "some multiline\ntext\nwhich\nincludes foo\nand a\ntail" @@ -245,7 +245,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:84: AssertionError ___________ TestSpecialisedExplanations.test_not_in_text_single ____________ - self = + self = def test_not_in_text_single(self): text = "single foo line" @@ -258,7 +258,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:88: AssertionError _________ TestSpecialisedExplanations.test_not_in_text_single_long _________ - self = + self = def test_not_in_text_single_long(self): text = "head " * 50 + "foo " + "tail " * 20 @@ -271,7 +271,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:92: AssertionError ______ TestSpecialisedExplanations.test_not_in_text_single_long_term _______ - self = + self = def test_not_in_text_single_long_term(self): text = "head " * 50 + "f" * 70 + "tail " * 20 @@ -284,7 +284,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:96: AssertionError ______________ TestSpecialisedExplanations.test_eq_dataclass _______________ - self = + self = def test_eq_dataclass(self): from dataclasses import dataclass @@ -311,7 +311,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:108: AssertionError ________________ TestSpecialisedExplanations.test_eq_attrs _________________ - self = + self = def test_eq_attrs(self): import attr @@ -345,7 +345,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: i = Foo() > assert i.b == 2 E assert 1 == 2 - E + where 1 = .Foo object at 0xdeadbeef0017>.b + E + where 1 = .Foo object at 0xdeadbeef0018>.b failure_demo.py:128: AssertionError _________________________ test_attribute_instance __________________________ @@ -356,8 +356,8 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert Foo().b == 2 E AssertionError: assert 1 == 2 - E + where 1 = .Foo object at 0xdeadbeef0018>.b - E + where .Foo object at 0xdeadbeef0018> = .Foo'>() + E + where 1 = .Foo object at 0xdeadbeef0019>.b + E + where .Foo object at 0xdeadbeef0019> = .Foo'>() failure_demo.py:135: AssertionError __________________________ test_attribute_failure __________________________ @@ -375,7 +375,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:146: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - self = .Foo object at 0xdeadbeef0019> + self = .Foo object at 0xdeadbeef001a> def _get_b(self): > raise Exception("Failed to get attrib") @@ -393,15 +393,15 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert Foo().b == Bar().b E AssertionError: assert 1 == 2 - E + where 1 = .Foo object at 0xdeadbeef001a>.b - E + where .Foo object at 0xdeadbeef001a> = .Foo'>() - E + and 2 = .Bar object at 0xdeadbeef001b>.b - E + where .Bar object at 0xdeadbeef001b> = .Bar'>() + E + where 1 = .Foo object at 0xdeadbeef001b>.b + E + where .Foo object at 0xdeadbeef001b> = .Foo'>() + E + and 2 = .Bar object at 0xdeadbeef001c>.b + E + where .Bar object at 0xdeadbeef001c> = .Bar'>() failure_demo.py:156: AssertionError __________________________ TestRaises.test_raises __________________________ - self = + self = def test_raises(self): s = "qwe" @@ -411,7 +411,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:166: ValueError ______________________ TestRaises.test_raises_doesnt _______________________ - self = + self = def test_raises_doesnt(self): > raises(OSError, int, "3") @@ -420,7 +420,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:169: Failed __________________________ TestRaises.test_raise ___________________________ - self = + self = def test_raise(self): > raise ValueError("demo error") @@ -429,7 +429,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:172: ValueError ________________________ TestRaises.test_tupleerror ________________________ - self = + self = def test_tupleerror(self): > a, b = [1] # NOQA @@ -438,7 +438,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:175: ValueError ______ TestRaises.test_reinterpret_fails_with_print_for_the_fun_of_it ______ - self = + self = def test_reinterpret_fails_with_print_for_the_fun_of_it(self): items = [1, 2, 3] @@ -451,7 +451,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: items is [1, 2, 3] ________________________ TestRaises.test_some_error ________________________ - self = + self = def test_some_error(self): > if namenotexi: # NOQA @@ -482,7 +482,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: abc-123:2: AssertionError ____________________ TestMoreErrors.test_complex_error _____________________ - self = + self = def test_complex_error(self): def f(): @@ -508,7 +508,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:6: AssertionError ___________________ TestMoreErrors.test_z1_unpack_error ____________________ - self = + self = def test_z1_unpack_error(self): items = [] @@ -518,7 +518,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:217: ValueError ____________________ TestMoreErrors.test_z2_type_error _____________________ - self = + self = def test_z2_type_error(self): items = 3 @@ -528,20 +528,20 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:221: TypeError ______________________ TestMoreErrors.test_startswith ______________________ - self = + self = def test_startswith(self): s = "123" g = "456" > assert s.startswith(g) E AssertionError: assert False - E + where False = ('456') - E + where = '123'.startswith + E + where False = ('456') + E + where = '123'.startswith failure_demo.py:226: AssertionError __________________ TestMoreErrors.test_startswith_nested ___________________ - self = + self = def test_startswith_nested(self): def f(): @@ -552,15 +552,15 @@ Here is a nice run of several failures and how ``pytest`` presents things: > assert f().startswith(g()) E AssertionError: assert False - E + where False = ('456') - E + where = '123'.startswith - E + where '123' = .f at 0xdeadbeef0028>() - E + and '456' = .g at 0xdeadbeef0029>() + E + where False = ('456') + E + where = '123'.startswith + E + where '123' = .f at 0xdeadbeef0029>() + E + and '456' = .g at 0xdeadbeef002a>() failure_demo.py:235: AssertionError _____________________ TestMoreErrors.test_global_func ______________________ - self = + self = def test_global_func(self): > assert isinstance(globf(42), float) @@ -571,18 +571,18 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:238: AssertionError _______________________ TestMoreErrors.test_instance _______________________ - self = + self = def test_instance(self): self.x = 6 * 7 > assert self.x != 42 E assert 42 != 42 - E + where 42 = .x + E + where 42 = .x failure_demo.py:242: AssertionError _______________________ TestMoreErrors.test_compare ________________________ - self = + self = def test_compare(self): > assert globf(10) < 5 @@ -592,7 +592,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:245: AssertionError _____________________ TestMoreErrors.test_try_finally ______________________ - self = + self = def test_try_finally(self): x = 1 @@ -603,7 +603,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:250: AssertionError ___________________ TestCustomAssertMsg.test_single_line ___________________ - self = + self = def test_single_line(self): class A: @@ -618,7 +618,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:261: AssertionError ____________________ TestCustomAssertMsg.test_multiline ____________________ - self = + self = def test_multiline(self): class A: @@ -637,7 +637,7 @@ Here is a nice run of several failures and how ``pytest`` presents things: failure_demo.py:268: AssertionError ___________________ TestCustomAssertMsg.test_custom_repr ___________________ - self = + self = def test_custom_repr(self): class JSON: diff --git a/doc/en/getting-started.rst b/doc/en/getting-started.rst index 89bc1aa02ee..8c9c4e75adf 100644 --- a/doc/en/getting-started.rst +++ b/doc/en/getting-started.rst @@ -22,7 +22,7 @@ Install ``pytest`` .. code-block:: bash $ pytest --version - pytest 7.2.0.dev534+ga2c84caaa.d20230317 + pytest 7.3.0 .. _`simpletest`: