Skip to content

Merge master into features #6537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 66 commits into from
Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
a136111
tests: test_xfail_handling: use sys.dont_write_bytecode
blueyed Jan 11, 2020
bebfd28
doc: revisit section about rootdir
blueyed Jan 15, 2020
118cb3d
Fix test_config: wrong assertions, lint, unused fixtures
blueyed Jan 16, 2020
7a0d1b3
Use a dummy RemoteTraceback for test in Python 3.5 Windows
nicoddemus Jan 14, 2020
d36c712
Merge pull request #6479 from blueyed/tests-fix-master
blueyed Jan 16, 2020
5049e25
tests: cleanup unused fixtures
blueyed Jan 16, 2020
f0fdafe
Merge pull request #6477 from blueyed/tests-cleanup-unused-fixtures
blueyed Jan 16, 2020
5b0e255
Merge pull request #6465 from blueyed/doc-rootdir
blueyed Jan 16, 2020
d1d7e5d
Drop deploy from Travis in favor of GitHub actions
nicoddemus Jan 16, 2020
4806878
Drop deploy from Travis in favor of GitHub actions (#6480)
nicoddemus Jan 16, 2020
aa05334
Remove broken link for user @jgsonesen
nicoddemus Jan 16, 2020
56dc301
Preparing release version 5.3.3
nicoddemus Jan 16, 2020
2cfee58
scripts/release.py: lint: fix F999
blueyed Jan 17, 2020
3694415
pytester: typing for `spawn`/`spawn_pytest`
blueyed Jan 10, 2020
19f66cb
Merge pull request #6434 from blueyed/pytester-typing-spawn
blueyed Jan 17, 2020
dcb94d8
Merge pull request #6485 from blueyed/lint-fix-f999
blueyed Jan 17, 2020
e16cb2f
Merge pull request #6444 from blueyed/fix-test_xfail_handling
blueyed Jan 17, 2020
2cce026
Merge pull request #6476 from blueyed/fix-test_config
blueyed Jan 17, 2020
4a42dee
typing: Node.reportinfo: might return py.path.local via fspath
blueyed Jan 17, 2020
544b4a1
Fix Hugo van Kemenade name in release announcement
nicoddemus Jan 17, 2020
e211d6f
Merge pull request #6488 from blueyed/typing-fix-reportinfo
blueyed Jan 17, 2020
e1298fa
Merge pull request #6481 from nicoddemus/release-5.3.3
nicoddemus Jan 17, 2020
cc7f294
Revert "fixtures register finalizers with all fixtures before them in…
nicoddemus Jan 17, 2020
4f0eec2
tests: fix test_crash_on_closing_tmpfile_py27
blueyed Jan 18, 2020
d4d04e7
test_terminal: improve color handling
blueyed Jan 18, 2020
1971033
Merge pull request #6499 from blueyed/fix-ci
blueyed Jan 18, 2020
a7292a0
ci: Travis: remove non-coverage jobs
blueyed Jan 18, 2020
59bc6ef
Merge pull request #6498 from blueyed/test_terminal_colors
blueyed Jan 18, 2020
ac41f36
Merge pull request #6500 from blueyed/ci-travis
blueyed Jan 18, 2020
38fc208
tests: terminal: harden/improve test_color_yes
blueyed Jan 18, 2020
e98176c
Merge pull request #6501 from blueyed/test_color_yes
blueyed Jan 18, 2020
61f985f
tests: test_excinfo: remove unused pytest_version_info
blueyed Jan 19, 2020
956389f
Session._fixturemanager
blueyed Jan 17, 2020
4e0dbe9
Node.name: str
blueyed Jan 17, 2020
5c445b0
typing: py.io.TerminalWriter for tw arguments
blueyed Jan 19, 2020
4b974b0
Merge pull request #6507 from blueyed/fix-test_excinfo
blueyed Jan 19, 2020
09e9a01
typing: fix _TracebackStyle: add "line"
blueyed Jan 17, 2020
1a75a3c
Merge pull request #6482 from blueyed/fix-_TracebackStyle
blueyed Jan 19, 2020
aaae43e
typing: fix some "incompatible types in assignment" with py
blueyed Jan 19, 2020
32b62f7
Merge pull request #6509 from blueyed/typing-minor
blueyed Jan 19, 2020
d347a30
Merge pull request #6510 from blueyed/typing-fixes
blueyed Jan 19, 2020
930a158
Fix type errors after adding types to the `py` dependency
bluetech Jan 18, 2020
4fb9cc3
Merge pull request #6511 from bluetech/py-typed-fixes
bluetech Jan 19, 2020
3e6f0f3
Cleanup unhelpful alias _AST_FLAG
bluetech Nov 25, 2019
0c247be
Add a few missing type annotations in _pytest._code
bluetech Nov 25, 2019
0b60315
Fix check_untyped_defs errors in test_pytester
bluetech Dec 3, 2019
3d2680b
Fix type of pytest.warns, and fix check_untyped_defs in test_recwarn
bluetech Dec 3, 2019
3392be3
Fix check_untyped_defs in test_runner
bluetech Dec 3, 2019
44eb1f5
Merge pull request #6311 from bluetech/type-annotations-10
bluetech Jan 19, 2020
2406076
tox: add mypy-diff testenv
blueyed Jan 17, 2020
f9bed82
Merge pull request #6515 from blueyed/tox-mypy-diff
blueyed Jan 20, 2020
0dc82e8
Add CHANGELOG entry for #6496
nicoddemus Jan 20, 2020
cdaa9c0
Revert "fixtures register finalizers with all fixtures before t… (#6496)
nicoddemus Jan 20, 2020
6a26ac4
Preparing release version 5.3.4
nicoddemus Jan 20, 2020
ddfa41b
Preparing release version 5.3.4 (#6516)
nicoddemus Jan 20, 2020
fb99b5c
Revert "Fix type errors after adding types to the `py` dependency"
bluetech Jan 20, 2020
a52f791
Merge pull request #6518 from bluetech/fix-py-typed-fixes-regression
bluetech Jan 20, 2020
7ee27fe
doc: fix Code.path: might return str
blueyed Jan 21, 2020
2f00b04
Merge pull request #6526 from blueyed/typing-code-path
blueyed Jan 21, 2020
9869a3d
ci: GHA: remove unnecessary check for `success()`
blueyed Jan 21, 2020
8f5fd53
--cache-clear: add test for keeping non-supporting files
blueyed Dec 3, 2019
1cd4baf
Merge pull request #6531 from blueyed/ci-gha-success
blueyed Jan 21, 2020
0f78ef8
Merge pull request #6532 from blueyed/harden-test
blueyed Jan 22, 2020
ef294fc
tox: move doctesting into main testenv
blueyed Jan 22, 2020
8c4dfca
Merge pull request #6535 from blueyed/tox-doctesting
blueyed Jan 22, 2020
93b74d2
Merge remote-tracking branch 'upstream/master' into mm
nicoddemus Jan 22, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,18 @@ jobs:
run: "tox -e ${{ matrix.tox_env }}"

- name: Prepare coverage token
if: success() && !matrix.skip_coverage && ( github.repository == 'pytest-dev/pytest' || github.event_name == 'pull_request' )
if: (!matrix.skip_coverage && ( github.repository == 'pytest-dev/pytest' || github.event_name == 'pull_request' ))
run: |
python scripts/append_codecov_token.py

- name: Combine coverage
if: success() && !matrix.skip_coverage
if: (!matrix.skip_coverage)
run: |
python -m coverage combine
python -m coverage xml

- name: Codecov upload
if: success() && !matrix.skip_coverage
if: (!matrix.skip_coverage)
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.codecov }}
Expand Down
1 change: 0 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ Charles Cloud
Charles Machalow
Charnjit SiNGH (CCSJ)
Chris Lamb
Chris NeJame
Christian Boelsen
Christian Fetzer
Christian Neumüller
Expand Down
1 change: 0 additions & 1 deletion changelog/2780.bugfix.rst

This file was deleted.

2 changes: 0 additions & 2 deletions changelog/5971.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/6350.trivial.rst

This file was deleted.

3 changes: 0 additions & 3 deletions changelog/6436.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/6532.bugfix.rst

This file was deleted.

2 changes: 2 additions & 0 deletions doc/en/announce/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Release announcements
:maxdepth: 2


release-5.3.4
release-5.3.3
release-5.3.2
release-5.3.1
release-5.3.0
Expand Down
30 changes: 30 additions & 0 deletions doc/en/announce/release-5.3.3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
pytest-5.3.3
=======================================

pytest 5.3.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/latest/changelog.html.

Thanks to all who contributed to this release, among them:

* Adam Johnson
* Alexandre Mulatinho
* Anthony Sottile
* Bruno Oliveira
* Chris NeJame
* Daniel Hahler
* Hugo van Kemenade
* Marcelo Duarte Trevisani
* PaulC
* Ran Benita
* Ryan Barner
* Seth Junot
* marc


Happy testing,
The pytest Development Team
20 changes: 20 additions & 0 deletions doc/en/announce/release-5.3.4.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
pytest-5.3.4
=======================================

pytest 5.3.4 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/latest/changelog.html.

Thanks to all who contributed to this release, among them:

* Bruno Oliveira
* Daniel Hahler
* Ran Benita


Happy testing,
The pytest Development Team
41 changes: 39 additions & 2 deletions doc/en/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,44 @@ with advance notice in the **Deprecations** section of releases.

.. towncrier release notes start

pytest 5.3.4 (2020-01-20)
=========================

Bug Fixes
---------

- `#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,
so the team decided to revert this change and make a new release while we continue to look for a solution.


pytest 5.3.3 (2020-01-16)
=========================

Bug Fixes
---------

- `#2780 <https://github.com/pytest-dev/pytest/issues/2780>`_: Captured output during teardown is shown with ``-rP``.


- `#5971 <https://github.com/pytest-dev/pytest/issues/5971>`_: Fix a ``pytest-xdist`` crash when dealing with exceptions raised in subprocesses created by the
``multiprocessing`` module.


- `#6436 <https://github.com/pytest-dev/pytest/issues/6436>`_: :class:`FixtureDef <_pytest.fixtures.FixtureDef>` objects now properly register their finalizers with autouse and
parameterized fixtures that execute before them in the fixture stack so they are torn
down at the right times, and in the right order.


- `#6532 <https://github.com/pytest-dev/pytest/issues/6532>`_: Fix parsing of outcomes containing multiple errors with ``testdir`` results (regression in 5.3.0).



Trivial/Internal Changes
------------------------

- `#6350 <https://github.com/pytest-dev/pytest/issues/6350>`_: Optimized automatic renaming of test parameter IDs.


pytest 5.3.2 (2019-12-13)
=========================

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

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

* No longer display the incorrect test deselection reason (`#1372`_).
Expand Down Expand Up @@ -4974,7 +5012,6 @@ time or change existing behaviors in order to make them less surprising/more use
.. _@gprasad84: https://github.com/gprasad84
.. _@graingert: https://github.com/graingert
.. _@hartym: https://github.com/hartym
.. _@jgsonesen: https://github.com/jgsonesen
.. _@kalekundert: https://github.com/kalekundert
.. _@kvas-it: https://github.com/kvas-it
.. _@marscher: https://github.com/marscher
Expand Down
10 changes: 4 additions & 6 deletions doc/en/customize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ which were registered by installed plugins.
Initialization: determining rootdir and inifile
-----------------------------------------------



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

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

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion doc/en/example/simple.rst
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ Now we can profile which test functions execute the slowest:
========================= slowest 3 test durations =========================
0.30s call test_some_are_slow.py::test_funcslow2
0.20s call test_some_are_slow.py::test_funcslow1
0.10s call test_some_are_slow.py::test_funcfast
0.11s call test_some_are_slow.py::test_funcfast
============================ 3 passed in 0.12s =============================

incremental testing - test steps
Expand Down
2 changes: 1 addition & 1 deletion scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def pre_release(version, *, skip_check_links):
print()
print(f"{Fore.CYAN}[generate.pre_release] {Fore.GREEN}All done!")
print()
print(f"Please push your branch and open a PR.")
print("Please push your branch and open a PR.")


def changelog(version, write_out=False):
Expand Down
31 changes: 16 additions & 15 deletions src/_pytest/_code/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

from _pytest._code import Source

_TracebackStyle = Literal["long", "short", "no", "native"]
_TracebackStyle = Literal["long", "short", "line", "no", "native"]


class Code:
Expand All @@ -67,9 +67,10 @@ def __ne__(self, other):
return not self == other

@property
def path(self):
""" return a path object pointing to source code (note that it
might not point to an actually existing file). """
def path(self) -> Union[py.path.local, str]:
""" return a path object pointing to source code (or a str in case
of OSError / non-existing file).
"""
try:
p = py.path.local(self.raw.co_filename)
# maybe don't try this checking
Expand Down Expand Up @@ -335,7 +336,7 @@ def cut(
(path is None or codepath == path)
and (
excludepath is None
or not hasattr(codepath, "relto")
or not isinstance(codepath, py.path.local)
or not codepath.relto(excludepath)
)
and (lineno is None or x.lineno == lineno)
Expand Down Expand Up @@ -919,7 +920,7 @@ def __str__(self) -> str:
def __repr__(self) -> str:
return "<{} instance at {:0x}>".format(self.__class__, id(self))

def toterminal(self, tw) -> None:
def toterminal(self, tw: py.io.TerminalWriter) -> None:
raise NotImplementedError()


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

def toterminal(self, tw) -> None:
def toterminal(self, tw: py.io.TerminalWriter) -> None:
for name, content, sep in self.sections:
tw.sep(sep, name)
tw.line(content)
Expand All @@ -950,7 +951,7 @@ def __init__(
self.reprtraceback = chain[-1][0]
self.reprcrash = chain[-1][1]

def toterminal(self, tw) -> None:
def toterminal(self, tw: py.io.TerminalWriter) -> None:
for element in self.chain:
element[0].toterminal(tw)
if element[2] is not None:
Expand All @@ -967,7 +968,7 @@ def __init__(
self.reprtraceback = reprtraceback
self.reprcrash = reprcrash

def toterminal(self, tw) -> None:
def toterminal(self, tw: py.io.TerminalWriter) -> None:
self.reprtraceback.toterminal(tw)
super().toterminal(tw)

Expand All @@ -985,7 +986,7 @@ def __init__(
self.extraline = extraline
self.style = style

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

def toterminal(self, tw) -> None:
def toterminal(self, tw: py.io.TerminalWriter) -> None:
tw.write("".join(self.lines))


Expand All @@ -1036,7 +1037,7 @@ def __init__(
self.reprfileloc = filelocrepr
self.style = style

def toterminal(self, tw) -> None:
def toterminal(self, tw: py.io.TerminalWriter) -> None:
if self.style == "short":
assert self.reprfileloc is not None
self.reprfileloc.toterminal(tw)
Expand Down Expand Up @@ -1071,7 +1072,7 @@ def __init__(self, path, lineno: int, message: str) -> None:
self.lineno = lineno
self.message = message

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

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

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

def toterminal(self, tw) -> None:
def toterminal(self, tw: py.io.TerminalWriter) -> None:
if self.args:
linesofar = ""
for name, value in self.args:
Expand Down
Loading