Skip to content

Commit 77e3452

Browse files
authored
Merge pull request #10225 from nicoddemus/sort-fixtures-docs
2 parents abf4941 + 8321009 commit 77e3452

File tree

1 file changed

+92
-90
lines changed

1 file changed

+92
-90
lines changed

doc/en/reference/reference.rst

Lines changed: 92 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -333,50 +333,6 @@ For more details, consult the full :ref:`fixtures docs <fixture>`.
333333
:decorator:
334334

335335

336-
.. fixture:: cache
337-
338-
config.cache
339-
~~~~~~~~~~~~
340-
341-
**Tutorial**: :ref:`cache`
342-
343-
The ``config.cache`` object allows other plugins and fixtures
344-
to store and retrieve values across test runs. To access it from fixtures
345-
request ``pytestconfig`` into your fixture and get it with ``pytestconfig.cache``.
346-
347-
Under the hood, the cache plugin uses the simple
348-
``dumps``/``loads`` API of the :py:mod:`json` stdlib module.
349-
350-
``config.cache`` is an instance of :class:`pytest.Cache`:
351-
352-
.. autoclass:: pytest.Cache()
353-
:members:
354-
355-
356-
.. fixture:: capsys
357-
358-
capsys
359-
~~~~~~
360-
361-
**Tutorial**: :ref:`captures`
362-
363-
.. autofunction:: _pytest.capture.capsys()
364-
:no-auto-options:
365-
366-
.. autoclass:: pytest.CaptureFixture()
367-
:members:
368-
369-
370-
.. fixture:: capsysbinary
371-
372-
capsysbinary
373-
~~~~~~~~~~~~
374-
375-
**Tutorial**: :ref:`captures`
376-
377-
.. autofunction:: _pytest.capture.capsysbinary()
378-
:no-auto-options:
379-
380336
.. fixture:: capfd
381337

382338
capfd
@@ -387,6 +343,7 @@ capfd
387343
.. autofunction:: _pytest.capture.capfd()
388344
:no-auto-options:
389345

346+
390347
.. fixture:: capfdbinary
391348

392349
capfdbinary
@@ -398,71 +355,74 @@ capfdbinary
398355
:no-auto-options:
399356

400357

401-
.. fixture:: doctest_namespace
402-
403-
doctest_namespace
404-
~~~~~~~~~~~~~~~~~
405-
406-
**Tutorial**: :ref:`doctest`
358+
.. fixture:: caplog
407359

408-
.. autofunction:: _pytest.doctest.doctest_namespace()
360+
caplog
361+
~~~~~~
409362

363+
**Tutorial**: :ref:`logging`
410364

411-
.. fixture:: request
365+
.. autofunction:: _pytest.logging.caplog()
366+
:no-auto-options:
412367

413-
request
414-
~~~~~~~
368+
Returns a :class:`pytest.LogCaptureFixture` instance.
415369

416-
**Example**: :ref:`request example`
370+
.. autoclass:: pytest.LogCaptureFixture()
371+
:members:
417372

418-
The ``request`` fixture is a special fixture providing information of the requesting test function.
419373

420-
.. autoclass:: pytest.FixtureRequest()
421-
:members:
374+
.. fixture:: capsys
422375

376+
capsys
377+
~~~~~~
423378

424-
.. fixture:: pytestconfig
379+
**Tutorial**: :ref:`captures`
425380

426-
pytestconfig
427-
~~~~~~~~~~~~
381+
.. autofunction:: _pytest.capture.capsys()
382+
:no-auto-options:
428383

429-
.. autofunction:: _pytest.fixtures.pytestconfig()
384+
.. autoclass:: pytest.CaptureFixture()
385+
:members:
430386

387+
.. fixture:: capsysbinary
431388

432-
.. fixture:: record_property
389+
capsysbinary
390+
~~~~~~~~~~~~
433391

434-
record_property
435-
~~~~~~~~~~~~~~~~~~~
392+
**Tutorial**: :ref:`captures`
436393

437-
**Tutorial**: :ref:`record_property example`
394+
.. autofunction:: _pytest.capture.capsysbinary()
395+
:no-auto-options:
438396

439-
.. autofunction:: _pytest.junitxml.record_property()
440397

398+
.. fixture:: cache
441399

442-
.. fixture:: record_testsuite_property
400+
config.cache
401+
~~~~~~~~~~~~
443402

444-
record_testsuite_property
445-
~~~~~~~~~~~~~~~~~~~~~~~~~
403+
**Tutorial**: :ref:`cache`
446404

447-
**Tutorial**: :ref:`record_testsuite_property example`
405+
The ``config.cache`` object allows other plugins and fixtures
406+
to store and retrieve values across test runs. To access it from fixtures
407+
request ``pytestconfig`` into your fixture and get it with ``pytestconfig.cache``.
448408

449-
.. autofunction:: _pytest.junitxml.record_testsuite_property()
409+
Under the hood, the cache plugin uses the simple
410+
``dumps``/``loads`` API of the :py:mod:`json` stdlib module.
450411

412+
``config.cache`` is an instance of :class:`pytest.Cache`:
451413

452-
.. fixture:: caplog
414+
.. autoclass:: pytest.Cache()
415+
:members:
453416

454-
caplog
455-
~~~~~~
456417

457-
**Tutorial**: :ref:`logging`
418+
.. fixture:: doctest_namespace
458419

459-
.. autofunction:: _pytest.logging.caplog()
460-
:no-auto-options:
420+
doctest_namespace
421+
~~~~~~~~~~~~~~~~~
461422

462-
Returns a :class:`pytest.LogCaptureFixture` instance.
423+
**Tutorial**: :ref:`doctest`
463424

464-
.. autoclass:: pytest.LogCaptureFixture()
465-
:members:
425+
.. autofunction:: _pytest.doctest.doctest_namespace()
466426

467427

468428
.. fixture:: monkeypatch
@@ -481,6 +441,14 @@ monkeypatch
481441
:members:
482442

483443

444+
.. fixture:: pytestconfig
445+
446+
pytestconfig
447+
~~~~~~~~~~~~
448+
449+
.. autofunction:: _pytest.fixtures.pytestconfig()
450+
451+
484452
.. fixture:: pytester
485453

486454
pytester
@@ -517,19 +485,25 @@ To use it, include in your topmost ``conftest.py`` file:
517485
.. autoclass:: pytest.RecordedHookCall()
518486
:members:
519487

520-
.. fixture:: testdir
521488

522-
testdir
523-
~~~~~~~
489+
.. fixture:: record_property
524490

525-
Identical to :fixture:`pytester`, but provides an instance whose methods return
526-
legacy ``py.path.local`` objects instead when applicable.
491+
record_property
492+
~~~~~~~~~~~~~~~~~~~
527493

528-
New code should avoid using :fixture:`testdir` in favor of :fixture:`pytester`.
494+
**Tutorial**: :ref:`record_property example`
529495

530-
.. autoclass:: pytest.Testdir()
531-
:members:
532-
:noindex: TimeoutExpired
496+
.. autofunction:: _pytest.junitxml.record_property()
497+
498+
499+
.. fixture:: record_testsuite_property
500+
501+
record_testsuite_property
502+
~~~~~~~~~~~~~~~~~~~~~~~~~
503+
504+
**Tutorial**: :ref:`record_testsuite_property example`
505+
506+
.. autofunction:: _pytest.junitxml.record_testsuite_property()
533507

534508

535509
.. fixture:: recwarn
@@ -546,6 +520,34 @@ recwarn
546520
:members:
547521

548522

523+
.. fixture:: request
524+
525+
request
526+
~~~~~~~
527+
528+
**Example**: :ref:`request example`
529+
530+
The ``request`` fixture is a special fixture providing information of the requesting test function.
531+
532+
.. autoclass:: pytest.FixtureRequest()
533+
:members:
534+
535+
536+
.. fixture:: testdir
537+
538+
testdir
539+
~~~~~~~
540+
541+
Identical to :fixture:`pytester`, but provides an instance whose methods return
542+
legacy ``py.path.local`` objects instead when applicable.
543+
544+
New code should avoid using :fixture:`testdir` in favor of :fixture:`pytester`.
545+
546+
.. autoclass:: pytest.Testdir()
547+
:members:
548+
:noindex: TimeoutExpired
549+
550+
549551
.. fixture:: tmp_path
550552

551553
tmp_path

0 commit comments

Comments
 (0)