Skip to content

Commit 0bf9628

Browse files
authored
Merge master into features (#6537)
Merge master into features
2 parents 2f0d0fb + 93b74d2 commit 0bf9628

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+641
-548
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,18 @@ jobs:
140140
run: "tox -e ${{ matrix.tox_env }}"
141141

142142
- name: Prepare coverage token
143-
if: success() && !matrix.skip_coverage && ( github.repository == 'pytest-dev/pytest' || github.event_name == 'pull_request' )
143+
if: (!matrix.skip_coverage && ( github.repository == 'pytest-dev/pytest' || github.event_name == 'pull_request' ))
144144
run: |
145145
python scripts/append_codecov_token.py
146146
147147
- name: Combine coverage
148-
if: success() && !matrix.skip_coverage
148+
if: (!matrix.skip_coverage)
149149
run: |
150150
python -m coverage combine
151151
python -m coverage xml
152152
153153
- name: Codecov upload
154-
if: success() && !matrix.skip_coverage
154+
if: (!matrix.skip_coverage)
155155
uses: codecov/codecov-action@v1
156156
with:
157157
token: ${{ secrets.codecov }}

AUTHORS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ Charles Cloud
5555
Charles Machalow
5656
Charnjit SiNGH (CCSJ)
5757
Chris Lamb
58-
Chris NeJame
5958
Christian Boelsen
6059
Christian Fetzer
6160
Christian Neumüller

changelog/2780.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/5971.bugfix.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

changelog/6350.trivial.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/6436.bugfix.rst

Lines changed: 0 additions & 3 deletions
This file was deleted.

changelog/6532.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

doc/en/announce/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Release announcements
66
:maxdepth: 2
77

88

9+
release-5.3.4
10+
release-5.3.3
911
release-5.3.2
1012
release-5.3.1
1113
release-5.3.0

doc/en/announce/release-5.3.3.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
pytest-5.3.3
2+
=======================================
3+
4+
pytest 5.3.3 has just been released to PyPI.
5+
6+
This is a bug-fix release, being a drop-in replacement. To upgrade::
7+
8+
pip install --upgrade pytest
9+
10+
The full changelog is available at https://docs.pytest.org/en/latest/changelog.html.
11+
12+
Thanks to all who contributed to this release, among them:
13+
14+
* Adam Johnson
15+
* Alexandre Mulatinho
16+
* Anthony Sottile
17+
* Bruno Oliveira
18+
* Chris NeJame
19+
* Daniel Hahler
20+
* Hugo van Kemenade
21+
* Marcelo Duarte Trevisani
22+
* PaulC
23+
* Ran Benita
24+
* Ryan Barner
25+
* Seth Junot
26+
* marc
27+
28+
29+
Happy testing,
30+
The pytest Development Team

doc/en/announce/release-5.3.4.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
pytest-5.3.4
2+
=======================================
3+
4+
pytest 5.3.4 has just been released to PyPI.
5+
6+
This is a bug-fix release, being a drop-in replacement. To upgrade::
7+
8+
pip install --upgrade pytest
9+
10+
The full changelog is available at https://docs.pytest.org/en/latest/changelog.html.
11+
12+
Thanks to all who contributed to this release, among them:
13+
14+
* Bruno Oliveira
15+
* Daniel Hahler
16+
* Ran Benita
17+
18+
19+
Happy testing,
20+
The pytest Development Team

doc/en/changelog.rst

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,44 @@ with advance notice in the **Deprecations** section of releases.
2828

2929
.. towncrier release notes start
3030
31+
pytest 5.3.4 (2020-01-20)
32+
=========================
33+
34+
Bug Fixes
35+
---------
36+
37+
- `#6496 <https://github.com/pytest-dev/pytest/issues/6496>`_: Revert `#6436 <https://github.com/pytest-dev/pytest/issues/6436>`__: unfortunately this change has caused a number of regressions in many suites,
38+
so the team decided to revert this change and make a new release while we continue to look for a solution.
39+
40+
41+
pytest 5.3.3 (2020-01-16)
42+
=========================
43+
44+
Bug Fixes
45+
---------
46+
47+
- `#2780 <https://github.com/pytest-dev/pytest/issues/2780>`_: Captured output during teardown is shown with ``-rP``.
48+
49+
50+
- `#5971 <https://github.com/pytest-dev/pytest/issues/5971>`_: Fix a ``pytest-xdist`` crash when dealing with exceptions raised in subprocesses created by the
51+
``multiprocessing`` module.
52+
53+
54+
- `#6436 <https://github.com/pytest-dev/pytest/issues/6436>`_: :class:`FixtureDef <_pytest.fixtures.FixtureDef>` objects now properly register their finalizers with autouse and
55+
parameterized fixtures that execute before them in the fixture stack so they are torn
56+
down at the right times, and in the right order.
57+
58+
59+
- `#6532 <https://github.com/pytest-dev/pytest/issues/6532>`_: Fix parsing of outcomes containing multiple errors with ``testdir`` results (regression in 5.3.0).
60+
61+
62+
63+
Trivial/Internal Changes
64+
------------------------
65+
66+
- `#6350 <https://github.com/pytest-dev/pytest/issues/6350>`_: Optimized automatic renaming of test parameter IDs.
67+
68+
3169
pytest 5.3.2 (2019-12-13)
3270
=========================
3371

@@ -4842,7 +4880,7 @@ time or change existing behaviors in order to make them less surprising/more use
48424880
* Updated docstrings with a more uniform style.
48434881

48444882
* Add stderr write for ``pytest.exit(msg)`` during startup. Previously the message was never shown.
4845-
Thanks `@BeyondEvil`_ for reporting `#1210`_. Thanks to `@jgsonesen`_ and
4883+
Thanks `@BeyondEvil`_ for reporting `#1210`_. Thanks to @jgsonesen and
48464884
`@tomviner`_ for the PR.
48474885

48484886
* No longer display the incorrect test deselection reason (`#1372`_).
@@ -4974,7 +5012,6 @@ time or change existing behaviors in order to make them less surprising/more use
49745012
.. _@gprasad84: https://github.com/gprasad84
49755013
.. _@graingert: https://github.com/graingert
49765014
.. _@hartym: https://github.com/hartym
4977-
.. _@jgsonesen: https://github.com/jgsonesen
49785015
.. _@kalekundert: https://github.com/kalekundert
49795016
.. _@kvas-it: https://github.com/kvas-it
49805017
.. _@marscher: https://github.com/marscher

doc/en/customize.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ which were registered by installed plugins.
2020
Initialization: determining rootdir and inifile
2121
-----------------------------------------------
2222

23-
24-
2523
pytest determines a ``rootdir`` for each test run which depends on
2624
the command line arguments (specified test files, paths) and on
2725
the existence of *ini-files*. The determined ``rootdir`` and *ini-file* are
@@ -30,17 +28,17 @@ printed as part of the pytest header during startup.
3028
Here's a summary what ``pytest`` uses ``rootdir`` for:
3129

3230
* Construct *nodeids* during collection; each test is assigned
33-
a unique *nodeid* which is rooted at the ``rootdir`` and takes in account full path,
34-
class name, function name and parametrization (if any).
31+
a unique *nodeid* which is rooted at the ``rootdir`` and takes into account
32+
the full path, class name, function name and parametrization (if any).
3533

3634
* Is used by plugins as a stable location to store project/test run specific information;
3735
for example, the internal :ref:`cache <cache>` plugin creates a ``.pytest_cache`` subdirectory
3836
in ``rootdir`` to store its cross-test run state.
3937

40-
Important to emphasize that ``rootdir`` is **NOT** used to modify ``sys.path``/``PYTHONPATH`` or
38+
``rootdir`` is **NOT** used to modify ``sys.path``/``PYTHONPATH`` or
4139
influence how modules are imported. See :ref:`pythonpath` for more details.
4240

43-
``--rootdir=path`` command-line option can be used to force a specific directory.
41+
The ``--rootdir=path`` command-line option can be used to force a specific directory.
4442
The directory passed may contain environment variables when it is used in conjunction
4543
with ``addopts`` in a ``pytest.ini`` file.
4644

doc/en/example/simple.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ Now we can profile which test functions execute the slowest:
443443
========================= slowest 3 test durations =========================
444444
0.30s call test_some_are_slow.py::test_funcslow2
445445
0.20s call test_some_are_slow.py::test_funcslow1
446-
0.10s call test_some_are_slow.py::test_funcfast
446+
0.11s call test_some_are_slow.py::test_funcfast
447447
============================ 3 passed in 0.12s =============================
448448
449449
incremental testing - test steps

scripts/release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def pre_release(version, *, skip_check_links):
100100
print()
101101
print(f"{Fore.CYAN}[generate.pre_release] {Fore.GREEN}All done!")
102102
print()
103-
print(f"Please push your branch and open a PR.")
103+
print("Please push your branch and open a PR.")
104104

105105

106106
def changelog(version, write_out=False):

src/_pytest/_code/code.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
from _pytest._code import Source
4343

44-
_TracebackStyle = Literal["long", "short", "no", "native"]
44+
_TracebackStyle = Literal["long", "short", "line", "no", "native"]
4545

4646

4747
class Code:
@@ -67,9 +67,10 @@ def __ne__(self, other):
6767
return not self == other
6868

6969
@property
70-
def path(self):
71-
""" return a path object pointing to source code (note that it
72-
might not point to an actually existing file). """
70+
def path(self) -> Union[py.path.local, str]:
71+
""" return a path object pointing to source code (or a str in case
72+
of OSError / non-existing file).
73+
"""
7374
try:
7475
p = py.path.local(self.raw.co_filename)
7576
# maybe don't try this checking
@@ -335,7 +336,7 @@ def cut(
335336
(path is None or codepath == path)
336337
and (
337338
excludepath is None
338-
or not hasattr(codepath, "relto")
339+
or not isinstance(codepath, py.path.local)
339340
or not codepath.relto(excludepath)
340341
)
341342
and (lineno is None or x.lineno == lineno)
@@ -919,7 +920,7 @@ def __str__(self) -> str:
919920
def __repr__(self) -> str:
920921
return "<{} instance at {:0x}>".format(self.__class__, id(self))
921922

922-
def toterminal(self, tw) -> None:
923+
def toterminal(self, tw: py.io.TerminalWriter) -> None:
923924
raise NotImplementedError()
924925

925926

@@ -930,7 +931,7 @@ def __init__(self) -> None:
930931
def addsection(self, name: str, content: str, sep: str = "-") -> None:
931932
self.sections.append((name, content, sep))
932933

933-
def toterminal(self, tw) -> None:
934+
def toterminal(self, tw: py.io.TerminalWriter) -> None:
934935
for name, content, sep in self.sections:
935936
tw.sep(sep, name)
936937
tw.line(content)
@@ -950,7 +951,7 @@ def __init__(
950951
self.reprtraceback = chain[-1][0]
951952
self.reprcrash = chain[-1][1]
952953

953-
def toterminal(self, tw) -> None:
954+
def toterminal(self, tw: py.io.TerminalWriter) -> None:
954955
for element in self.chain:
955956
element[0].toterminal(tw)
956957
if element[2] is not None:
@@ -967,7 +968,7 @@ def __init__(
967968
self.reprtraceback = reprtraceback
968969
self.reprcrash = reprcrash
969970

970-
def toterminal(self, tw) -> None:
971+
def toterminal(self, tw: py.io.TerminalWriter) -> None:
971972
self.reprtraceback.toterminal(tw)
972973
super().toterminal(tw)
973974

@@ -985,7 +986,7 @@ def __init__(
985986
self.extraline = extraline
986987
self.style = style
987988

988-
def toterminal(self, tw) -> None:
989+
def toterminal(self, tw: py.io.TerminalWriter) -> None:
989990
# the entries might have different styles
990991
for i, entry in enumerate(self.reprentries):
991992
if entry.style == "long":
@@ -1017,7 +1018,7 @@ class ReprEntryNative(TerminalRepr):
10171018
def __init__(self, tblines: Sequence[str]) -> None:
10181019
self.lines = tblines
10191020

1020-
def toterminal(self, tw) -> None:
1021+
def toterminal(self, tw: py.io.TerminalWriter) -> None:
10211022
tw.write("".join(self.lines))
10221023

10231024

@@ -1036,7 +1037,7 @@ def __init__(
10361037
self.reprfileloc = filelocrepr
10371038
self.style = style
10381039

1039-
def toterminal(self, tw) -> None:
1040+
def toterminal(self, tw: py.io.TerminalWriter) -> None:
10401041
if self.style == "short":
10411042
assert self.reprfileloc is not None
10421043
self.reprfileloc.toterminal(tw)
@@ -1071,7 +1072,7 @@ def __init__(self, path, lineno: int, message: str) -> None:
10711072
self.lineno = lineno
10721073
self.message = message
10731074

1074-
def toterminal(self, tw) -> None:
1075+
def toterminal(self, tw: py.io.TerminalWriter) -> None:
10751076
# filename and lineno output for each entry,
10761077
# using an output format that most editors understand
10771078
msg = self.message
@@ -1086,7 +1087,7 @@ class ReprLocals(TerminalRepr):
10861087
def __init__(self, lines: Sequence[str]) -> None:
10871088
self.lines = lines
10881089

1089-
def toterminal(self, tw, indent="") -> None:
1090+
def toterminal(self, tw: py.io.TerminalWriter, indent="") -> None:
10901091
for line in self.lines:
10911092
tw.line(indent + line)
10921093

@@ -1095,7 +1096,7 @@ class ReprFuncArgs(TerminalRepr):
10951096
def __init__(self, args: Sequence[Tuple[str, object]]) -> None:
10961097
self.args = args
10971098

1098-
def toterminal(self, tw) -> None:
1099+
def toterminal(self, tw: py.io.TerminalWriter) -> None:
10991100
if self.args:
11001101
linesofar = ""
11011102
for name, value in self.args:

0 commit comments

Comments
 (0)