Merge pull request #9042 from nicoddemus/backport-9040

This commit is contained in:
Bruno Oliveira 2021-08-27 09:04:50 -03:00 committed by GitHub
commit d74baf4a52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 28 additions and 35 deletions

View File

@ -3,7 +3,7 @@ name: main
on: on:
push: push:
branches: branches:
- master - main
- "[0-9]+.[0-9]+.x" - "[0-9]+.[0-9]+.x"
tags: tags:
- "[0-9]+.[0-9]+.[0-9]+" - "[0-9]+.[0-9]+.[0-9]+"
@ -11,7 +11,7 @@ on:
pull_request: pull_request:
branches: branches:
- master - main
- "[0-9]+.[0-9]+.x" - "[0-9]+.[0-9]+.x"
# Set permissions at the job level. # Set permissions at the job level.
@ -64,7 +64,7 @@ jobs:
- name: "windows-py37-pluggy" - name: "windows-py37-pluggy"
python: "3.7" python: "3.7"
os: windows-latest os: windows-latest
tox_env: "py37-pluggymaster-xdist" tox_env: "py37-pluggymain-xdist"
- name: "windows-py38" - name: "windows-py38"
python: "3.8" python: "3.8"
os: windows-latest os: windows-latest
@ -91,7 +91,7 @@ jobs:
- name: "ubuntu-py37-pluggy" - name: "ubuntu-py37-pluggy"
python: "3.7" python: "3.7"
os: ubuntu-latest os: ubuntu-latest
tox_env: "py37-pluggymaster-xdist" tox_env: "py37-pluggymain-xdist"
- name: "ubuntu-py37-freeze" - name: "ubuntu-py37-freeze"
python: "3.7" python: "3.7"
os: ubuntu-latest os: ubuntu-latest

View File

@ -236,7 +236,7 @@ Here is a simple overview, with pytest-specific bits:
$ cd pytest $ cd pytest
# now, create your own branch off "master": # 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 Given we have "major.minor.micro" version numbers, bug fixes will usually
be released in micro releases whereas features will be released in 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 compare: your-branch-name
base-fork: pytest-dev/pytest base-fork: pytest-dev/pytest
base: master base: main
Writing Tests Writing Tests

View File

@ -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/ :target: https://docs.pytest.org/en/stable/
:align: center :align: center
:alt: pytest :alt: pytest
@ -15,7 +15,7 @@
.. image:: https://img.shields.io/pypi/pyversions/pytest.svg .. image:: https://img.shields.io/pypi/pyversions/pytest.svg
:target: https://pypi.org/project/pytest/ :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 :target: https://codecov.io/gh/pytest-dev/pytest
:alt: Code coverage Status :alt: Code coverage Status
@ -25,6 +25,10 @@
.. image:: https://github.com/pytest-dev/pytest/workflows/main/badge.svg .. image:: https://github.com/pytest-dev/pytest/workflows/main/badge.svg
:target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Amain :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 .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black :target: https://github.com/psf/black
@ -149,8 +153,8 @@ Tidelift will coordinate the fix and disclosure.
License 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. 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

View File

@ -4,4 +4,4 @@ Development Guide
The contributing guidelines are to be found :ref:`here <contributing>`. The contributing guidelines are to be found :ref:`here <contributing>`.
The release procedure for pytest is documented on The release procedure for pytest is documented on
`GitHub <https://github.com/pytest-dev/pytest/blob/master/RELEASING.rst>`_. `GitHub <https://github.com/pytest-dev/pytest/blob/main/RELEASING.rst>`_.

View File

@ -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 hook which are often used to setup global resources. This suffers from
several problems: 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 that are never needed because it only co-ordinates the test run
activities of the worker processes. activities of the worker processes.

View File

@ -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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
.. _`MIT`: https://github.com/pytest-dev/pytest/blob/master/LICENSE .. _`MIT`: https://github.com/pytest-dev/pytest/blob/main/LICENSE

View File

@ -920,11 +920,8 @@ TestReport
_Result _Result
~~~~~~~ ~~~~~~~
Result used within :ref:`hook wrappers <hookwrapper>`. Result object used within :ref:`hook wrappers <hookwrapper>`, see :py:class:`_Result in the pluggy documentation <pluggy._callers._Result>` for more information.
.. autoclass:: pluggy.callers._Result
.. automethod:: pluggy.callers._Result.get_result
.. automethod:: pluggy.callers._Result.force_result
Global Variables Global Variables
---------------- ----------------

View File

@ -1,4 +1,5 @@
pallets-sphinx-themes pallets-sphinx-themes
pluggy>=1.0
pygments-pytest>=1.1.0 pygments-pytest>=1.1.0
sphinx-removed-in>=0.2.0 sphinx-removed-in>=0.2.0
sphinx>=3.1,<4 sphinx>=3.1,<4

View File

@ -45,7 +45,7 @@ install_requires =
attrs>=19.2.0 attrs>=19.2.0
iniconfig iniconfig
packaging packaging
pluggy>=0.12,<1.0.0a1 pluggy>=0.12,<2.0
py>=1.8.2 py>=1.8.2
toml toml
atomicwrites>=1.0;sys_platform=="win32" atomicwrites>=1.0;sys_platform=="win32"

View File

@ -448,9 +448,6 @@ class TestMetafunc:
enum = pytest.importorskip("enum") enum = pytest.importorskip("enum")
e = enum.Enum("Foo", "one, two") 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)])
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: def test_idmaker_idfn(self) -> None:

View File

@ -1780,7 +1780,7 @@ def test_invocation_args(pytester: Pytester) -> None:
) )
def test_config_blocked_default_plugins(pytester: Pytester, plugin: str) -> None: def test_config_blocked_default_plugins(pytester: Pytester, plugin: str) -> None:
if plugin == "debugging": 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 # https://github.com/pytest-dev/pytest-xdist/pull/422
try: try:
import xdist # noqa: F401 import xdist # noqa: F401

View File

@ -741,14 +741,8 @@ def test_run_result_repr() -> None:
# known exit code # known exit code
r = pytester.RunResult(1, outlines, errlines, duration=0.5) r = pytester.RunResult(1, outlines, errlines, duration=0.5)
if sys.version_info[:2] >= (3, 10): assert (
assert repr(r) == ( repr(r) == "<RunResult ret=ExitCode.TESTS_FAILED len(stdout.lines)=3"
"<RunResult ret=TESTS_FAILED len(stdout.lines)=3"
" len(stderr.lines)=4 duration=0.50s>"
)
else:
assert repr(r) == (
"<RunResult ret=ExitCode.TESTS_FAILED len(stdout.lines)=3"
" len(stderr.lines)=4 duration=0.50s>" " len(stderr.lines)=4 duration=0.50s>"
) )

View File

@ -11,7 +11,7 @@ envlist =
py39 py39
py310 py310
pypy3 pypy3
py37-{pexpect,xdist,unittestextras,numpy,pluggymaster} py37-{pexpect,xdist,unittestextras,numpy,pluggymain}
doctesting doctesting
plugins plugins
py37-freeze py37-freeze
@ -47,7 +47,7 @@ deps =
doctesting: PyYAML doctesting: PyYAML
numpy: numpy>=1.19.4 numpy: numpy>=1.19.4
pexpect: pexpect>=4.8.0 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 pygments>=2.7.2
unittestextras: twisted unittestextras: twisted
unittestextras: asynctest unittestextras: asynctest