Skip to content

Merge the features branch to master, before deleting features #6642

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

Closed
wants to merge 128 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
04f27d4
unittest: do not use TestCase.debug() with `--pdb`
blueyed Oct 18, 2019
f7b1de7
No need to call tearDown on expected failures
nicoddemus Nov 12, 2019
5936965
Bring back explicit tear down
nicoddemus Nov 12, 2019
426a4cd
_idval: remove trailing newline from exception
blueyed Nov 18, 2019
51f9cd0
argparsing: remove "map_long_option" Action attribute support
bluetech Nov 20, 2019
c0b1a39
minor: move internal _pformat_dispatch function
blueyed Nov 20, 2019
ccb3ef3
testing/python/metafunc.py: import _idval once
blueyed Nov 20, 2019
f1224a0
Merge pull request #6243 from blueyed/move-_pformat_dispatch
blueyed Nov 20, 2019
98c899c
Merge pull request #6245 from blueyed/tests-_idval
blueyed Nov 20, 2019
2c941b5
parametrized: ids: support generator/iterator
blueyed Nov 12, 2019
dac16cd
Add type annotations to _pytest.config.argparsing and corresponding C…
bluetech Nov 17, 2019
2d449e9
Respect --fulltrace with collection errors
blueyed Nov 20, 2019
6b75a77
Merge pull request #6247 from blueyed/collecterror-fulltrace
blueyed Nov 20, 2019
ed012c8
Merge pull request #6174 from blueyed/ids-iter
blueyed Nov 20, 2019
5820c5c
Merge pull request #6241 from bluetech/type-annotations-9
bluetech Nov 21, 2019
df0c652
Merge master into features
blueyed Nov 21, 2019
2fa0518
Merge pull request #6259 from blueyed/merge-master-into-features
blueyed Nov 21, 2019
a02310a
Add stacklevel tests for warnings, 'location' to pytest_warning_captured
Nov 22, 2019
b0ebcfb
pytester: remove special handling of env during inner runs
blueyed Nov 18, 2019
a4408eb
Merge pull request #6219 from blueyed/testdir-use-monkeypatch
blueyed Nov 22, 2019
886b8d2
Merge pull request #5984 from phloose/acceptance-tests_pytest-dev/pyt…
nicoddemus Nov 22, 2019
c99c7d0
deprecate direct node construction and introduce Node.from_parent
RonnyPfannschmidt Oct 16, 2019
15ffe63
update doc examples **untested**
RonnyPfannschmidt Nov 23, 2019
a3c8246
Node from parent (#5975)
nicoddemus Nov 23, 2019
d7d5cf4
Merge pull request #6215 from blueyed/cleanup-exc
blueyed Nov 24, 2019
bc72825
typing: minor improvements
blueyed Nov 24, 2019
47ae1fb
Merge pull request #6271 from blueyed/typing
blueyed Nov 25, 2019
a1219ab
pytester: use no colors with inline runs by default
blueyed Nov 2, 2019
b6b0bc0
Merge pull request #6164 from blueyed/pytester-no-color
blueyed Nov 26, 2019
8feeb09
fixes #5065
RonnyPfannschmidt Nov 27, 2019
da091b8
rename test_pdb to test_debugging (#6282)
nicoddemus Nov 27, 2019
16ff9f5
Update mypy 0.740 -> 0.750
bluetech Dec 2, 2019
c9ec724
Merge pull request #6307 from bluetech/mypy-750
bluetech Dec 3, 2019
41b7b10
Merge branch 'features' into unittest-debug
nicoddemus Dec 3, 2019
59f95b7
Merge remote-tracking branch 'upstream/master' into mm
nicoddemus Dec 3, 2019
1c4a672
unittest: do not use TestCase.debug() with `--pdb` (#5996)
nicoddemus Dec 3, 2019
985ac09
Merge master into features (#6312)
nicoddemus Dec 3, 2019
e24b6b0
Change -k EXPRESSION matching to be case-insensitive
cb109 Dec 5, 2019
ac5929e
Update docs about case-insensitive expression matching
cb109 Dec 5, 2019
24d4882
Update authors file and sort the list
cb109 Dec 5, 2019
5a7de2c
Add changelog file for PR 6316
cb109 Dec 5, 2019
623b398
Update doc/en/example/markers.rst
cb109 Dec 5, 2019
a326fa2
Add a failing test to ensure not everything matches by accident
cb109 Dec 5, 2019
3a0f436
Iterate a generator expression instead of a temporary list
cb109 Dec 6, 2019
c6ed69a
Replace 'removal' by 'breaking' changelog category
nicoddemus Dec 6, 2019
3812985
update backward compatibility policy to allow for breakage
RonnyPfannschmidt Dec 1, 2019
30f2729
Merge pull request #6298 from RonnyPfannschmidt/deprecation-breakage
RonnyPfannschmidt Dec 7, 2019
e13ad22
Include new --capture-mode=tee-sys option
Dec 3, 2019
1ef29ab
#4597: tee-stdio capture method (#6315)
nicoddemus Dec 9, 2019
0711060
Change 4639 from feature to improvement
nicoddemus Dec 9, 2019
b29ae03
Merge pull request #6329 from nicoddemus/4639-improv
asottile Dec 11, 2019
cbb2f95
Merge pull request #6316 from cb109/make-keyword-expression-matching-…
nicoddemus Dec 12, 2019
59067ad
Make -r letters "f" and "F" aliases
nicoddemus Dec 12, 2019
fa51a26
Make -r letters "s" and "S" aliases
nicoddemus Dec 12, 2019
9b74bf1
Add CHANGELOG entry for #6334
nicoddemus Dec 12, 2019
226f0c4
fix #5686, mktemp now fails given absolute and non-normalized paths.
gftea Dec 6, 2019
ecd1e43
Make 'S' and 'F' aliases to 's' and 'f' respectively (#6337)
nicoddemus Dec 13, 2019
853889e
Merge remote-tracking branch 'upstream/master' into mm
nicoddemus Dec 14, 2019
afbaee7
Deprecate --no-print-logs option
vinaycalastry Dec 11, 2019
c487cf9
Deprecate no print logs (#6333)
nicoddemus Dec 16, 2019
75493f7
Merge master into features (#6346)
nicoddemus Dec 17, 2019
ed57b8e
invocation in last section 'pythonpath.rst' title swapped
sathoune Dec 19, 2019
a9608d5
Switch the order of the commands back and update the text
nicoddemus Dec 26, 2019
466bbbf
invocation in last section 'pythonpath.rst' title swapped (#6357)
nicoddemus Dec 26, 2019
a5224f7
Revert black formatting of essential_plugins
blueyed Dec 30, 2019
8656c1a
Merge pull request #6381 from blueyed/fix-revert-formatting
blueyed Jan 1, 2020
4848bbd
Update mypy 0.750 -> 0.761
bluetech Jan 1, 2020
0375c1b
Merge pull request #6388 from bluetech/mypy-761
bluetech Jan 1, 2020
c627ac4
Remove unused _pytest.code.Source.isparseable function
nicoddemus Jan 5, 2020
0fa3596
Remove unused _pytest.code.Source.isparseable function (#6405)
nicoddemus Jan 5, 2020
12f74a2
Revert "Remove unused _pytest.code.Source.isparseable function"
nicoddemus Jan 5, 2020
91a96ec
Remove usage of parser module, deprecated in Python 3.9
nicoddemus Jan 5, 2020
e8c8559
Remove usage of parser module (deprecated in Python 3.9) (#6407)
nicoddemus Jan 6, 2020
2d2c67d
cacheprovider: pytest_collection_modifyitems: copy items
blueyed Jan 6, 2020
9f1ade9
Merge pull request #6411 from blueyed/cacheprovider-copy-items
blueyed Jan 9, 2020
13baab7
terminal: use "yellow" with any "xpassed" tests
blueyed Jan 9, 2020
fa645a7
Improve docstrings for mktemp
nicoddemus Jan 9, 2020
5b295ec
Merge remote-tracking branch 'upstream/features' into gftea/features
nicoddemus Jan 9, 2020
29db2da
tmpdir_factory.mktemp now fails given absolute and non-normaliz… (#6323)
nicoddemus Jan 9, 2020
1e28cb8
Merge pull request #6425 from blueyed/xfail-yellow
blueyed Jan 9, 2020
1356d20
Merge master into features
blueyed Jan 10, 2020
2d488f7
Merge pull request #6432 from blueyed/merge-master-into-features
blueyed Jan 10, 2020
e9d9f71
Merge remote-tracking branch 'upstream/master' into mm
nicoddemus Jan 14, 2020
21d189e
Enable GitHub actions for 'features'
nicoddemus Jan 14, 2020
fd1691a
Make --showlocals work together with --tb=short
pv Dec 30, 2019
b9c136b
Use a dummy RemoteTraceback for test in Python 3.5 Windows
nicoddemus Jan 14, 2020
f2659f7
Merge master into features (#6458)
nicoddemus Jan 14, 2020
8ba0b7b
fix #6341 - disallow session/config in Node.from_parent
RonnyPfannschmidt Dec 31, 2019
ab6406b
Update junit_logging with no,log,system-out,system-err,out-err,all
Jan 16, 2020
9298f7e
Improve CHANGELOG and docs for junit_logging
nicoddemus Jan 16, 2020
3789bb5
junit_logging options (follow up to #6469) (#6473)
nicoddemus Jan 16, 2020
83813bf
Merge master into features
blueyed Jan 16, 2020
5f4cd53
Use _pytest.compat.TYPE_CHECKING
blueyed Jan 16, 2020
a4f5b8a
Merge pull request #6478 from blueyed/merge-master-into-features
blueyed Jan 16, 2020
1667cf3
Merge pull request #6384 from pv/showlocals-short
blueyed Jan 16, 2020
7a62692
[features] tests: fix test_crash_on_closing_tmpfile_py27
blueyed Jan 18, 2020
d0811c1
Merge pull request #6502 from blueyed/fix-ci-features
blueyed Jan 18, 2020
40d0031
Drop deploy from Travis in favor of GitHub actions
nicoddemus Jan 16, 2020
89f92a4
ci: Travis: remove non-coverage jobs
blueyed Jan 18, 2020
2f0d0fb
Merge pull request #6503 from blueyed/ci-travis-features
blueyed Jan 18, 2020
7b1e3d1
Clear collection caches after collection is done
nicoddemus Jan 17, 2020
93b74d2
Merge remote-tracking branch 'upstream/master' into mm
nicoddemus Jan 22, 2020
0bf9628
Merge master into features (#6537)
nicoddemus Jan 22, 2020
aca1723
Merge master into features
blueyed Jan 22, 2020
72d06e6
Merge pull request #6539 from blueyed/merge-master-into-features
blueyed Jan 22, 2020
e17f5fa
Clear node collection cache after collection is done (#6491)
nicoddemus Jan 22, 2020
09bdbff
Merge master into features
blueyed Jan 24, 2020
498884a
Merge pull request #6563 from blueyed/merge-master-into-features
blueyed Jan 24, 2020
dd5c2b2
Refactor Session._initialparts to have a more explicit type
bluetech Jan 23, 2020
a76bc64
Merge pull request #6547 from bluetech/session-initialparts
bluetech Jan 25, 2020
f396733
Split Session._collection_node_cache to 3 mutually exclusive parts
bluetech Jan 24, 2020
c51173d
Merge master into features
blueyed Jan 25, 2020
2e8f7ef
Merge pull request #6569 from blueyed/merge-master-into-features
blueyed Jan 25, 2020
30922ee
Merge master into features
blueyed Jan 28, 2020
1586653
Merge pull request #6594 from blueyed/merge-master-into-features
blueyed Jan 28, 2020
e440b43
Merge pull request #6555 from bluetech/nodes-cache-split
bluetech Jan 28, 2020
abd5fc8
Fix node ids which contain a parametrized empty-string variable
asottile Jan 28, 2020
ddaa5d8
terminal: default to `fE` with `-r` (reportchars)
blueyed Jan 21, 2020
3ccf2a5
Merge pull request #6524 from blueyed/reportchars-default
blueyed Jan 29, 2020
55e5817
Merge master into features
blueyed Jan 29, 2020
06a7fef
Merge pull request #6616 from blueyed/merge-master-into-features
blueyed Jan 29, 2020
595d62b
Merge pull request #6607 from asottile/empty_string_parametrize_nodeid
asottile Jan 29, 2020
64ab68f
Fix 6341 disallow session config in fromparent (#6387)
nicoddemus Jan 29, 2020
b5b6e05
Merge master into features
blueyed Jan 30, 2020
4de8e68
Merge pull request #6625 from blueyed/merge-master-into-features
blueyed Jan 30, 2020
a435faa
Merge branch 'master' into master-to-features
bluetech Jan 31, 2020
4038d6c
Merge pull request #6640 from bluetech/master-to-features
bluetech Jan 31, 2020
21b1c1b
Merge branch 'features' into master
bluetech Jan 31, 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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ repos:
- id: changelogs-rst
name: changelog filenames
language: fail
entry: 'changelog files must be named ####.(feature|bugfix|doc|deprecation|removal|vendor|trivial).rst'
exclude: changelog/(\d+\.(feature|improvement|bugfix|doc|deprecation|removal|vendor|trivial).rst|README.rst|_template.rst)
entry: 'changelog files must be named ####.(breaking|bugfix|deprecation|doc|feature|improvement|trivial|vendor).rst'
exclude: changelog/(\d+\.(breaking|bugfix|deprecation|doc|feature|improvement|trivial|vendor).rst|README.rst|_template.rst)
files: ^changelog/
- id: py-deprecated
name: py library is deprecated
Expand Down
9 changes: 7 additions & 2 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,21 @@ Carl Friedrich Bolz
Carlos Jenkins
Ceridwen
Charles Cloud
Charles Machalow
Charnjit SiNGH (CCSJ)
Chris Lamb
Christian Boelsen
Christian Fetzer
Christian Neumüller
Christian Theunert
Christian Tismer
Christopher Gilling
Christoph Buelter
Christopher Dignam
Christopher Gilling
Claudio Madotto
CrazyMerlyn
Cyrus Maden
Damian Skrzypczak
Dhiren Serai
Daniel Grana
Daniel Hahler
Daniel Nuri
Expand All @@ -80,6 +81,7 @@ David Szotten
David Vierra
Daw-Ran Liou
Denis Kirisov
Dhiren Serai
Diego Russo
Dmitry Dygalo
Dmitry Pribysh
Expand Down Expand Up @@ -121,6 +123,7 @@ Ilya Konstantinov
Ionuț Turturică
Iwan Briquemont
Jaap Broekhuizen
Jakub Mitoraj
Jan Balster
Janne Vanhala
Jason R. Coombs
Expand Down Expand Up @@ -207,8 +210,10 @@ Omer Hadari
Ondřej Súkup
Oscar Benjamin
Patrick Hayes
Pauli Virtanen
Paweł Adamczak
Pedro Algarvio
Philipp Loose
Pieter Mulder
Piotr Banaszkiewicz
Pulkit Goyal
Expand Down
1 change: 1 addition & 0 deletions changelog/1857.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``pytest.mark.parametrize`` accepts integers for ``ids`` again, converting it to strings.
5 changes: 5 additions & 0 deletions changelog/3238.deprecation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Option ``--no-print-logs`` is deprecated and meant to be removed in a future release. If you use ``--no-print-logs``, please try out ``--show-capture`` and
provide feedback.

``--show-capture`` command-line option was added in ``pytest 3.5.0`` and allows to specify how to
display captured output when tests fail: ``no``, ``stdout``, ``stderr``, ``log`` or ``all`` (the default).
1 change: 1 addition & 0 deletions changelog/3823.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``--trace`` now works with unittests.
1 change: 1 addition & 0 deletions changelog/4445.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed some warning reports produced by pytest to point to the correct location of the warning in the user's code.
1 change: 1 addition & 0 deletions changelog/449.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use "yellow" main color with any XPASSED tests.
1 change: 1 addition & 0 deletions changelog/4597.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
New :ref:`--capture=tee-sys <capture-method>` option to allow both live printing and capturing of test output.
4 changes: 4 additions & 0 deletions changelog/4639.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Revert "A warning is now issued when assertions are made for ``None``".

The warning proved to be less useful than initially expected and had quite a
few false positive cases.
1 change: 1 addition & 0 deletions changelog/5686.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``tmpdir_factory.mktemp`` now fails when given absolute and non-normalized paths.
1 change: 1 addition & 0 deletions changelog/5928.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Report ``PytestUnknownMarkWarning`` at the level of the user's code, not ``pytest``'s.
10 changes: 10 additions & 0 deletions changelog/5975.deprecation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Deprecate using direct constructors for ``Nodes``.

Instead they are new constructed via ``Node.from_parent``.

This transitional mechanism enables us to detangle the very intensely
entangled ``Node`` relationships by enforcing more controlled creation/configruation patterns.

As part of that session/config are already disallowed parameters and as we work on the details we might need disallow a few more as well.

Subclasses are expected to use `super().from_parent` if they intend to expand the creation of `Nodes`.
1 change: 1 addition & 0 deletions changelog/5984.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The ``pytest_warning_captured`` hook now receives a ``location`` parameter with the code location that generated the warning.
1 change: 1 addition & 0 deletions changelog/5991.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix interaction with ``--pdb`` and unittests: do not use unittest's ``TestCase.debug()``.
1 change: 1 addition & 0 deletions changelog/6213.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytester: the ``testdir`` fixture respects environment settings from the ``monkeypatch`` fixture for inner runs.
1 change: 1 addition & 0 deletions changelog/6247.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``--fulltrace`` is honored with collection errors.
1 change: 1 addition & 0 deletions changelog/6316.breaking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Matching of ``-k EXPRESSION`` to test names is now case-insensitive.
3 changes: 3 additions & 0 deletions changelog/6334.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fix summary entries appearing twice when ``f/F`` and ``s/S`` report chars were used at the same time in the ``-r`` command-line option (for example ``-rFf``).

The upper case variants were never documented and the preferred form should be the lower case.
1 change: 1 addition & 0 deletions changelog/6384.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make `--showlocals` work also with `--tb=short`.
1 change: 1 addition & 0 deletions changelog/6404.trivial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove usage of ``parser`` module, deprecated in Python 3.9.
1 change: 1 addition & 0 deletions changelog/6454.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`--disable-warnings` is honored with `-ra` and `-rA`.
1 change: 1 addition & 0 deletions changelog/6454.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Changed default for `-r` to `fE`, which displays failures and errors in the :ref:`short test summary <pytest.detailed_failed_tests_usage>`. `-rN` can be used to disable it (the old behavior).
1 change: 1 addition & 0 deletions changelog/6469.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
New options have been added to the :confval:`junit_logging` option: ``log``, ``out-err``, and ``all``.
1 change: 1 addition & 0 deletions changelog/6597.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix node ids which contain a parametrized empty-string variable.
1 change: 1 addition & 0 deletions changelog/759.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``pytest.mark.parametrize`` supports iterators and generators for ``ids``.
2 changes: 1 addition & 1 deletion changelog/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Each file should be named like ``<ISSUE>.<TYPE>.rst``, where
* ``bugfix``: fixes a bug.
* ``doc``: documentation improvement, like rewording an entire session or adding missing docs.
* ``deprecation``: feature deprecation.
* ``removal``: feature removal.
* ``breaking``: a change which may break existing suites, such as feature removal or behavior change.
* ``vendor``: changes in packages vendored in pytest.
* ``trivial``: fixing a small typo or internal change that might be noteworthy.

Expand Down
58 changes: 58 additions & 0 deletions doc/en/backwards-compatibility.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,61 @@
Backwards Compatibility Policy
==============================

.. versionadded: 6.0
pytest is actively evolving and is a project that has been decades in the making,
we keep learning about new and better structures to express different details about testing.

While we implement those modifications we try to ensure an easy transition and don't want to impose unnecessary churn on our users and community/plugin authors.

As of now, pytest considers multipe types of backward compatibility transitions:

a) trivial: APIs which trivially translate to the new mechanism,
and do not cause problematic changes.

We try to support those indefinitely while encouraging users to switch to newer/better mechanisms through documentation.

b) transitional: the old and new API don't conflict
and we can help users transition by using warnings, while supporting both for a prolonged time.

We will only start the removal of deprecated functionality in major releases (e.g. if we deprecate something in 3.0 we will start to remove it in 4.0), and keep it around for at least two minor releases (e.g. if we deprecate something in 3.9 and 4.0 is the next release, we start to remove it in 5.0, not in 4.0).

When the deprecation expires (e.g. 4.0 is released), we won't remove the deprecated functionality immediately, but will use the standard warning filters to turn them into **errors** by default. This approach makes it explicit that removal is imminent, and still gives you time to turn the deprecated feature into a warning instead of an error so it can be dealt with in your own time. In the next minor release (e.g. 4.1), the feature will be effectively removed.


c) true breakage: should only to be considered when normal transition is unreasonably unsustainable and would offset important development/features by years.
In addition, they should be limited to APIs where the number of actual users is very small (for example only impacting some plugins), and can be coordinated with the community in advance.

Examples for such upcoming changes:

* removal of ``pytest_runtest_protocol/nextitem`` - `#895`_
* rearranging of the node tree to include ``FunctionDefinition``
* rearranging of ``SetupState`` `#895`_

True breakages must be announced first in an issue containing:

* Detailed description of the change
* Rationale
* Expected impact on users and plugin authors (example in `#895`_)

After there's no hard *-1* on the issue it should be followed up by an initial proof-of-concept Pull Request.

This POC serves as both a coordination point to assess impact and potential inspriation to come up with a transitional solution after all.

After a reasonable amount of time the PR can be merged to base a new major release.

For the PR to mature from POC to acceptance, it must contain:
* Setup of deprecation errors/warnings that help users fix and port their code. If it is possible to introduce a deprecation period under the current series, before the true breakage, it should be introduced in a separate PR and be part of the current release stream.
* Detailed description of the rationale and examples on how to port code in ``doc/en/deprecations.rst``.


History
=========


Focus primary on smooth transition - stance (pre 6.0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Keeping backwards compatibility has a very high priority in the pytest project. Although we have deprecated functionality over the years, most of it is still supported. All deprecations in pytest were done because simpler or more efficient ways of accomplishing the same tasks have emerged, making the old way of doing things unnecessary.

With the pytest 3.0 release we introduced a clear communication scheme for when we will actually remove the old busted joint and politely ask you to use the new hotness instead, while giving you enough time to adjust your tests or raise concerns if there are valid reasons to keep deprecated functionality around.
Expand All @@ -20,3 +75,6 @@ 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 <https://github.com/pytest-dev/pytest/issues?q=label%3A%22type%3A+deprecation%22>`_ and `removal <https://github.com/pytest-dev/pytest/labels/type%3A%20removal>`_ labels on GitHub.


.. _`#895`: https://github.com/pytest-dev/pytest/issues/895
19 changes: 14 additions & 5 deletions doc/en/capture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,36 @@ file descriptors. This allows to capture output from simple
print statements as well as output from a subprocess started by
a test.

.. _capture-method:

Setting capturing methods or disabling capturing
-------------------------------------------------

There are two ways in which ``pytest`` can perform capturing:
There are three ways in which ``pytest`` can perform capturing:

* file descriptor (FD) level capturing (default): All writes going to the
* ``fd`` (file descriptor) level capturing (default): All writes going to the
operating system file descriptors 1 and 2 will be captured.

* ``sys`` level capturing: Only writes to Python files ``sys.stdout``
and ``sys.stderr`` will be captured. No capturing of writes to
filedescriptors is performed.

* ``tee-sys`` capturing: Python writes to ``sys.stdout`` and ``sys.stderr``
will be captured, however the writes will also be passed-through to
the actual ``sys.stdout`` and ``sys.stderr``. This allows output to be
'live printed' and captured for plugin use, such as junitxml (new in pytest 5.4).

.. _`disable capturing`:

You can influence output capturing mechanisms from the command line:

.. code-block:: bash

pytest -s # disable all capturing
pytest --capture=sys # replace sys.stdout/stderr with in-mem files
pytest --capture=fd # also point filedescriptors 1 and 2 to temp file
pytest -s # disable all capturing
pytest --capture=sys # replace sys.stdout/stderr with in-mem files
pytest --capture=fd # also point filedescriptors 1 and 2 to temp file
pytest --capture=tee-sys # combines 'sys' and '-s', capturing sys.stdout/stderr
# and passing it along to the actual sys.stdout/stderr

.. _printdebugging:

Expand Down
24 changes: 24 additions & 0 deletions doc/en/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,30 @@ Below is a complete list of all pytest features which are considered deprecated.
:class:`_pytest.warning_types.PytestWarning` or subclasses, which can be filtered using
:ref:`standard warning filters <warnings>`.


``--no-print-logs`` command-line option
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. deprecated:: 5.4


Option ``--no-print-logs`` is deprecated and meant to be removed in a future release. If you use ``--no-print-logs``, please try out ``--show-capture`` and
provide feedback.

``--show-capture`` command-line option was added in ``pytest 3.5.0` and allows to specify how to
display captured output when tests fail: ``no``, ``stdout``, ``stderr``, ``log`` or ``all`` (the default).



Node Construction changed to ``Node.from_parent``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. deprecated:: 5.3

The construction of nodes new should use the named constructor ``from_parent``.
This limitation in api surface intends to enable better/simpler refactoring of the collection tree.


``junit_family`` default value change to "xunit2"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
4 changes: 4 additions & 0 deletions doc/en/example/markers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ which implements a substring match on the test names instead of the
exact match on markers that ``-m`` provides. This makes it easy to
select tests based on their names:

.. versionadded: 5.4

The expression matching is now case-insensitive.

.. code-block:: pytest

$ pytest -v -k http # running with the above defined example module
Expand Down
4 changes: 2 additions & 2 deletions doc/en/example/nonpython/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

def pytest_collect_file(parent, path):
if path.ext == ".yaml" and path.basename.startswith("test"):
return YamlFile(path, parent)
return YamlFile.from_parent(parent, fspath=path)


class YamlFile(pytest.File):
Expand All @@ -13,7 +13,7 @@ def collect(self):

raw = yaml.safe_load(self.fspath.open())
for name, spec in sorted(raw.items()):
yield YamlItem(name, self, spec)
yield YamlItem.from_parent(self, name=name, spec=spec)


class YamlItem(pytest.Item):
Expand Down
6 changes: 4 additions & 2 deletions doc/en/pythonpath.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ This is also discussed in details in :ref:`test discovery`.
Invoking ``pytest`` versus ``python -m pytest``
-----------------------------------------------

Running pytest with ``python -m pytest [...]`` instead of ``pytest [...]`` yields nearly
equivalent behaviour, except that the former call will add the current directory to ``sys.path``.
Running pytest with ``pytest [...]`` instead of ``python -m pytest [...]`` yields nearly
equivalent behaviour, except that the latter will add the current directory to ``sys.path``, which
is standard ``python`` behavior.

See also :ref:`cmdline`.
12 changes: 10 additions & 2 deletions doc/en/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1164,9 +1164,17 @@ passed multiple times. The expected format is ``name=value``. For example::
.. confval:: junit_logging

.. versionadded:: 3.5
.. versionchanged:: 5.4
``log``, ``all``, ``out-err`` options added.

Configures if stdout/stderr should be written to the JUnit XML file. Valid values are
``system-out``, ``system-err``, and ``no`` (the default).
Configures if captured output should be written to the JUnit XML file. Valid values are:

* ``log``: write only ``logging`` captured output.
* ``system-out``: write captured ``stdout`` contents.
* ``system-err``: write captured ``stderr`` contents.
* ``out-err``: write both captured ``stdout`` and ``stderr`` contents.
* ``all``: write captured ``logging``, ``stdout`` and ``stderr`` contents.
* ``no`` (the default): no captured output is written.

.. code-block:: ini

Expand Down
11 changes: 0 additions & 11 deletions doc/en/unittest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -238,17 +238,6 @@ was executed ahead of the ``test_method``.

.. _pdb-unittest-note:

.. note::

Running tests from ``unittest.TestCase`` subclasses with ``--pdb`` will
disable tearDown and cleanup methods for the case that an Exception
occurs. This allows proper post mortem debugging for all applications
which have significant logic in their tearDown machinery. However,
supporting this feature has the following side effect: If people
overwrite ``unittest.TestCase`` ``__call__`` or ``run``, they need to
to overwrite ``debug`` in the same way (this is also true for standard
unittest).

.. note::

Due to architectural differences between the two frameworks, setup and
Expand Down
12 changes: 8 additions & 4 deletions doc/en/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ Pytest supports several ways to run and select tests from the command-line.

pytest -k "MyClass and not method"

This will run tests which contain names that match the given *string expression*, which can
include Python operators that use filenames, class names and function names as variables.
This will run tests which contain names that match the given *string expression* (case-insensitive),
which can include Python operators that use filenames, class names and function names as variables.
The example above will run ``TestMyClass.test_something`` but not ``TestMyClass.test_method_simple``.

.. _nodeids:
Expand Down Expand Up @@ -169,11 +169,11 @@ option you make sure a trace is shown.
Detailed summary report
-----------------------



The ``-r`` flag can be used to display a "short test summary info" at the end of the test session,
making it easy in large test suites to get a clear picture of all failures, skips, xfails, etc.

It defaults to ``fE`` to list failures and errors.

Example:

.. code-block:: python
Expand Down Expand Up @@ -261,8 +261,12 @@ Here is the full list of available characters that can be used:
- ``X`` - xpassed
- ``p`` - passed
- ``P`` - passed with output

Special characters for (de)selection of groups:

- ``a`` - all except ``pP``
- ``A`` - all
- ``N`` - none, this can be used to display nothing (since ``fE`` is the default)

More than one character can be used, so for example to only see failed and skipped tests, you can execute:

Expand Down
Loading