Skip to content

Commit 2369bed

Browse files
Merge pull request #10727 from RonnyPfannschmidt/ronny/split-report-header
split up report header lines for config, rootdir and testpaths
2 parents 431ec6d + 54864f0 commit 2369bed

13 files changed

+139
-128
lines changed

changelog/10727.improvement.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Split the report header for ``rootdir``, ``config file`` and ``testpaths`` so each has its own line.

doc/en/builtin.rst

+31-29
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
2222
cachedir: .pytest_cache
2323
rootdir: /home/sweet/project
2424
collected 0 items
25-
cache -- .../_pytest/cacheprovider.py:509
25+
cache -- .../_pytest/cacheprovider.py:510
2626
Return a cache object that can persist state between testing sessions.
2727
2828
cache.get(key, default)
@@ -33,25 +33,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
3333
3434
Values can be any object handled by the json stdlib module.
3535
36-
capsys -- .../_pytest/capture.py:905
37-
Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``.
38-
39-
The captured output is made available via ``capsys.readouterr()`` method
40-
calls, which return a ``(out, err)`` namedtuple.
41-
``out`` and ``err`` will be ``text`` objects.
42-
43-
Returns an instance of :class:`CaptureFixture[str] <pytest.CaptureFixture>`.
44-
45-
Example:
46-
47-
.. code-block:: python
48-
49-
def test_output(capsys):
50-
print("hello")
51-
captured = capsys.readouterr()
52-
assert captured.out == "hello\n"
53-
54-
capsysbinary -- .../_pytest/capture.py:933
36+
capsysbinary -- .../_pytest/capture.py:1001
5537
Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``.
5638
5739
The captured output is made available via ``capsysbinary.readouterr()``
@@ -69,7 +51,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
6951
captured = capsysbinary.readouterr()
7052
assert captured.out == b"hello\n"
7153
72-
capfd -- .../_pytest/capture.py:961
54+
capfd -- .../_pytest/capture.py:1029
7355
Enable text capturing of writes to file descriptors ``1`` and ``2``.
7456
7557
The captured output is made available via ``capfd.readouterr()`` method
@@ -87,7 +69,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
8769
captured = capfd.readouterr()
8870
assert captured.out == "hello\n"
8971
90-
capfdbinary -- .../_pytest/capture.py:989
72+
capfdbinary -- .../_pytest/capture.py:1057
9173
Enable bytes capturing of writes to file descriptors ``1`` and ``2``.
9274
9375
The captured output is made available via ``capfd.readouterr()`` method
@@ -105,7 +87,25 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
10587
captured = capfdbinary.readouterr()
10688
assert captured.out == b"hello\n"
10789
108-
doctest_namespace [session scope] -- .../_pytest/doctest.py:738
90+
capsys -- .../_pytest/capture.py:973
91+
Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``.
92+
93+
The captured output is made available via ``capsys.readouterr()`` method
94+
calls, which return a ``(out, err)`` namedtuple.
95+
``out`` and ``err`` will be ``text`` objects.
96+
97+
Returns an instance of :class:`CaptureFixture[str] <pytest.CaptureFixture>`.
98+
99+
Example:
100+
101+
.. code-block:: python
102+
103+
def test_output(capsys):
104+
print("hello")
105+
captured = capsys.readouterr()
106+
assert captured.out == "hello\n"
107+
108+
doctest_namespace [session scope] -- .../_pytest/doctest.py:737
109109
Fixture that returns a :py:class:`dict` that will be injected into the
110110
namespace of doctests.
111111
@@ -119,7 +119,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
119119
120120
For more details: :ref:`doctest_namespace`.
121121
122-
pytestconfig [session scope] -- .../_pytest/fixtures.py:1356
122+
pytestconfig [session scope] -- .../_pytest/fixtures.py:1360
123123
Session-scoped fixture that returns the session's :class:`pytest.Config`
124124
object.
125125
@@ -196,7 +196,7 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
196196
197197
.. _legacy_path: https://py.readthedocs.io/en/latest/path.html
198198
199-
caplog -- .../_pytest/logging.py:491
199+
caplog -- .../_pytest/logging.py:498
200200
Access and control log capturing.
201201
202202
Captured logs are available through the following properties/methods::
@@ -237,17 +237,19 @@ For information about fixtures, see :ref:`fixtures`. To see a complete list of a
237237
See https://docs.pytest.org/en/latest/how-to/capture-warnings.html for information
238238
on warning categories.
239239
240-
tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:188
240+
tmp_path_factory [session scope] -- .../_pytest/tmpdir.py:245
241241
Return a :class:`pytest.TempPathFactory` instance for the test session.
242242
243-
tmp_path -- .../_pytest/tmpdir.py:203
243+
tmp_path -- .../_pytest/tmpdir.py:260
244244
Return a temporary directory path object which is unique to each test
245245
function invocation, created as a sub directory of the base temporary
246246
directory.
247247
248248
By default, a new base temporary directory is created each test session,
249-
and old bases are removed after 3 sessions, to aid in debugging. If
250-
``--basetemp`` is used then it is cleared each session. See :ref:`base
249+
and old bases are removed after 3 sessions, to aid in debugging.
250+
This behavior can be configured with :confval:`tmp_path_retention_count` and
251+
:confval:`tmp_path_retention_policy`.
252+
If ``--basetemp`` is used then it is cleared each session. See :ref:`base
251253
temporary directory`.
252254
253255
The returned object is a :class:`pathlib.Path` object.

doc/en/example/parametrize.rst

+2-6
Original file line numberDiff line numberDiff line change
@@ -502,12 +502,8 @@ Running it results in some skips if we don't have all the python interpreters in
502502
.. code-block:: pytest
503503
504504
. $ pytest -rs -q multipython.py
505-
sssssssssssssssssssssssssss [100%]
506-
========================= short test summary info ==========================
507-
SKIPPED [9] multipython.py:69: 'python3.5' not found
508-
SKIPPED [9] multipython.py:69: 'python3.6' not found
509-
SKIPPED [9] multipython.py:69: 'python3.7' not found
510-
27 skipped in 0.12s
505+
........................... [100%]
506+
27 passed in 0.12s
511507
512508
Indirect parametrization of optional implementations/imports
513509
--------------------------------------------------------------------

doc/en/example/pythoncollection.rst

+6-3
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ The test collection would look like this:
148148
$ pytest --collect-only
149149
=========================== test session starts ============================
150150
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
151-
rootdir: /home/sweet/project, configfile: pytest.ini
151+
rootdir: /home/sweet/project
152+
configfile: pytest.ini
152153
collected 2 items
153154
154155
<Module check_myapp.py>
@@ -209,7 +210,8 @@ You can always peek at the collection tree without running tests like this:
209210
. $ pytest --collect-only pythoncollection.py
210211
=========================== test session starts ============================
211212
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
212-
rootdir: /home/sweet/project, configfile: pytest.ini
213+
rootdir: /home/sweet/project
214+
configfile: pytest.ini
213215
collected 3 items
214216
215217
<Module CWD/pythoncollection.py>
@@ -290,7 +292,8 @@ file will be left out:
290292
$ pytest --collect-only
291293
=========================== test session starts ============================
292294
platform linux -- Python 3.x.y, pytest-7.x.y, pluggy-1.x.y
293-
rootdir: /home/sweet/project, configfile: pytest.ini
295+
rootdir: /home/sweet/project
296+
configfile: pytest.ini
294297
collected 0 items
295298
296299
======================= no tests collected in 0.12s ========================

0 commit comments

Comments
 (0)