From 44d3282bb7c36e1979579e254f7120d7f8aa0f00 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 26 Aug 2021 10:14:27 -0300 Subject: [PATCH 1/3] Merge pull request #9040 from nicoddemus/bump-pluggy --- doc/en/reference.rst | 5 +---- doc/en/requirements.txt | 1 + setup.cfg | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/en/reference.rst b/doc/en/reference.rst index 8aa95ca6448..d92a45711c2 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -920,11 +920,8 @@ TestReport _Result ~~~~~~~ -Result used within :ref:`hook wrappers `. +Result object used within :ref:`hook wrappers `, see :py:class:`_Result in the pluggy documentation ` for more information. -.. autoclass:: pluggy.callers._Result -.. automethod:: pluggy.callers._Result.get_result -.. automethod:: pluggy.callers._Result.force_result Global Variables ---------------- diff --git a/doc/en/requirements.txt b/doc/en/requirements.txt index fa37acfb447..ea2b428e3e3 100644 --- a/doc/en/requirements.txt +++ b/doc/en/requirements.txt @@ -1,4 +1,5 @@ pallets-sphinx-themes +pluggy>=1.0 pygments-pytest>=1.1.0 sphinx-removed-in>=0.2.0 sphinx>=3.1,<4 diff --git a/setup.cfg b/setup.cfg index f404d3560ed..dc546c8b1b3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,7 +45,7 @@ install_requires = attrs>=19.2.0 iniconfig packaging - pluggy>=0.12,<1.0.0a1 + pluggy>=0.12,<2.0 py>=1.8.2 toml atomicwrites>=1.0;sys_platform=="win32" From 69212d15fa597e058238a6a30d4299c5b4ea68a2 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 9 Mar 2021 22:54:01 +0100 Subject: [PATCH 2/3] Merge pull request #8425 from RonnyPfannschmidt/main-fixes reconfigure everything for main --- .github/workflows/main.yml | 8 ++++---- CONTRIBUTING.rst | 4 ++-- README.rst | 12 ++++++++---- doc/en/development_guide.rst | 2 +- doc/en/funcarg_compare.rst | 2 +- doc/en/license.rst | 2 +- testing/test_config.py | 2 +- tox.ini | 4 ++-- 8 files changed, 20 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b2c4c69a83a..5a943535787 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: main on: push: branches: - - master + - main - "[0-9]+.[0-9]+.x" tags: - "[0-9]+.[0-9]+.[0-9]+" @@ -11,7 +11,7 @@ on: pull_request: branches: - - master + - main - "[0-9]+.[0-9]+.x" # Set permissions at the job level. @@ -64,7 +64,7 @@ jobs: - name: "windows-py37-pluggy" python: "3.7" os: windows-latest - tox_env: "py37-pluggymaster-xdist" + tox_env: "py37-pluggymain-xdist" - name: "windows-py38" python: "3.8" os: windows-latest @@ -91,7 +91,7 @@ jobs: - name: "ubuntu-py37-pluggy" python: "3.7" os: ubuntu-latest - tox_env: "py37-pluggymaster-xdist" + tox_env: "py37-pluggymain-xdist" - name: "ubuntu-py37-freeze" python: "3.7" os: ubuntu-latest diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 2669cb19509..b2f6785d24e 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -236,7 +236,7 @@ Here is a simple overview, with pytest-specific bits: $ cd pytest # now, create your own branch off "master": - $ git checkout -b your-bugfix-branch-name master + $ git checkout -b your-bugfix-branch-name main Given we have "major.minor.micro" version numbers, bug fixes will usually be released in micro releases whereas features will be released in @@ -318,7 +318,7 @@ Here is a simple overview, with pytest-specific bits: compare: your-branch-name base-fork: pytest-dev/pytest - base: master + base: main Writing Tests diff --git a/README.rst b/README.rst index 398d6451c58..a6ba517c66a 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -.. image:: https://docs.pytest.org/en/stable/_static/pytest1.png +.. image:: https://github.com/pytest-dev/pytest/raw/main/doc/en/img/pytest_logo_curves.svg :target: https://docs.pytest.org/en/stable/ :align: center :alt: pytest @@ -15,7 +15,7 @@ .. image:: https://img.shields.io/pypi/pyversions/pytest.svg :target: https://pypi.org/project/pytest/ -.. image:: https://codecov.io/gh/pytest-dev/pytest/branch/master/graph/badge.svg +.. image:: https://codecov.io/gh/pytest-dev/pytest/branch/main/graph/badge.svg :target: https://codecov.io/gh/pytest-dev/pytest :alt: Code coverage Status @@ -25,6 +25,10 @@ .. image:: https://github.com/pytest-dev/pytest/workflows/main/badge.svg :target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Amain +.. image:: https://results.pre-commit.ci/badge/github/pytest-dev/pytest/main.svg + :target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest/master + :alt: pre-commit.ci status + .. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black @@ -149,8 +153,8 @@ Tidelift will coordinate the fix and disclosure. License ------- -Copyright Holger Krekel and others, 2004-2020. +Copyright Holger Krekel and others, 2004-2021. Distributed under the terms of the `MIT`_ license, pytest is free and open source software. -.. _`MIT`: https://github.com/pytest-dev/pytest/blob/master/LICENSE +.. _`MIT`: https://github.com/pytest-dev/pytest/blob/main/LICENSE diff --git a/doc/en/development_guide.rst b/doc/en/development_guide.rst index 77076d4834e..3ee0ebbc239 100644 --- a/doc/en/development_guide.rst +++ b/doc/en/development_guide.rst @@ -4,4 +4,4 @@ Development Guide The contributing guidelines are to be found :ref:`here `. The release procedure for pytest is documented on -`GitHub `_. +`GitHub `_. diff --git a/doc/en/funcarg_compare.rst b/doc/en/funcarg_compare.rst index 0c4913edff8..f8af27a1ebf 100644 --- a/doc/en/funcarg_compare.rst +++ b/doc/en/funcarg_compare.rst @@ -168,7 +168,7 @@ pytest for a long time offered a pytest_configure and a pytest_sessionstart hook which are often used to setup global resources. This suffers from several problems: -1. in distributed testing the master process would setup test resources +1. in distributed testing the managing process would setup test resources that are never needed because it only co-ordinates the test run activities of the worker processes. diff --git a/doc/en/license.rst b/doc/en/license.rst index c6c10bbf358..13765be1595 100644 --- a/doc/en/license.rst +++ b/doc/en/license.rst @@ -29,4 +29,4 @@ Distributed under the terms of the `MIT`_ license, pytest is free and open sourc OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -.. _`MIT`: https://github.com/pytest-dev/pytest/blob/master/LICENSE +.. _`MIT`: https://github.com/pytest-dev/pytest/blob/main/LICENSE diff --git a/testing/test_config.py b/testing/test_config.py index 881023a937f..06cec91134f 100644 --- a/testing/test_config.py +++ b/testing/test_config.py @@ -1780,7 +1780,7 @@ class DummyPlugin: ) def test_config_blocked_default_plugins(pytester: Pytester, plugin: str) -> None: if plugin == "debugging": - # Fixed in xdist master (after 1.27.0). + # Fixed in xdist (after 1.27.0). # https://github.com/pytest-dev/pytest-xdist/pull/422 try: import xdist # noqa: F401 diff --git a/tox.ini b/tox.ini index 1413feb229d..db099cbfd58 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ envlist = py39 py310 pypy3 - py37-{pexpect,xdist,unittestextras,numpy,pluggymaster} + py37-{pexpect,xdist,unittestextras,numpy,pluggymain} doctesting plugins py37-freeze @@ -47,7 +47,7 @@ deps = doctesting: PyYAML numpy: numpy>=1.19.4 pexpect: pexpect>=4.8.0 - pluggymaster: git+https://github.com/pytest-dev/pluggy.git@master + pluggymain: pluggy @ git+https://github.com/pytest-dev/pluggy.git pygments>=2.7.2 unittestextras: twisted unittestextras: asynctest From d9b8f7cf0adf66becce7eb2a0d11e3d96e6d740b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 12 Jul 2021 16:32:27 +0200 Subject: [PATCH 3/3] Backport #8896 --- testing/python/metafunc.py | 5 +---- testing/test_pytester.py | 14 ++++---------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py index 21ab2267e2f..676f1d988bc 100644 --- a/testing/python/metafunc.py +++ b/testing/python/metafunc.py @@ -448,10 +448,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)]) - if sys.version_info[:2] >= (3, 10): - assert result == ["one-two"] - else: - assert result == ["Foo.one-Foo.two"] + assert result == ["Foo.one-Foo.two"] def test_idmaker_idfn(self) -> None: """#351""" diff --git a/testing/test_pytester.py b/testing/test_pytester.py index 4234cdf6ead..f2e8dd5a36a 100644 --- a/testing/test_pytester.py +++ b/testing/test_pytester.py @@ -741,16 +741,10 @@ def test_run_result_repr() -> None: # known exit code r = pytester.RunResult(1, outlines, errlines, duration=0.5) - if sys.version_info[:2] >= (3, 10): - assert repr(r) == ( - "" - ) - else: - assert repr(r) == ( - "" - ) + assert ( + repr(r) == "" + ) # unknown exit code: just the number r = pytester.RunResult(99, outlines, errlines, duration=0.5)