@@ -314,11 +314,10 @@ request ``pytestconfig`` into your fixture and get it with ``pytestconfig.cache`
314
314
Under the hood, the cache plugin uses the simple
315
315
``dumps ``/``loads `` API of the :py:mod: `json ` stdlib module.
316
316
317
- .. currentmodule :: _pytest.cacheprovider
317
+ `` config.cache `` is an instance of :class: ` pytest.Cache `:
318
318
319
- .. automethod :: Cache.get
320
- .. automethod :: Cache.set
321
- .. automethod :: Cache.makedir
319
+ .. autoclass :: pytest.Cache()
320
+ :members:
322
321
323
322
324
323
.. fixture :: capsys
@@ -328,12 +327,10 @@ capsys
328
327
329
328
**Tutorial **: :doc: `capture `.
330
329
331
- .. currentmodule :: _pytest.capture
332
-
333
- .. autofunction :: capsys()
330
+ .. autofunction :: _pytest.capture.capsys()
334
331
:no-auto-options:
335
332
336
- Returns an instance of :py: class: `CaptureFixture `.
333
+ Returns an instance of :class: `CaptureFixture[str] <pytest.CaptureFixture> `.
337
334
338
335
Example:
339
336
@@ -344,7 +341,7 @@ capsys
344
341
captured = capsys.readouterr()
345
342
assert captured.out == " hello\n "
346
343
347
- .. autoclass :: CaptureFixture()
344
+ .. autoclass :: pytest. CaptureFixture()
348
345
:members:
349
346
350
347
@@ -355,10 +352,10 @@ capsysbinary
355
352
356
353
**Tutorial **: :doc: `capture `.
357
354
358
- .. autofunction :: capsysbinary()
355
+ .. autofunction :: _pytest.capture. capsysbinary()
359
356
:no-auto-options:
360
357
361
- Returns an instance of :py: class: `CaptureFixture `.
358
+ Returns an instance of :class: `CaptureFixture[bytes] <pytest.CaptureFixture> `.
362
359
363
360
Example:
364
361
@@ -377,10 +374,10 @@ capfd
377
374
378
375
**Tutorial **: :doc: `capture `.
379
376
380
- .. autofunction :: capfd()
377
+ .. autofunction :: _pytest.capture. capfd()
381
378
:no-auto-options:
382
379
383
- Returns an instance of :py: class: `CaptureFixture `.
380
+ Returns an instance of :class: `CaptureFixture[str] <pytest.CaptureFixture> `.
384
381
385
382
Example:
386
383
@@ -399,10 +396,10 @@ capfdbinary
399
396
400
397
**Tutorial **: :doc: `capture `.
401
398
402
- .. autofunction :: capfdbinary()
399
+ .. autofunction :: _pytest.capture. capfdbinary()
403
400
:no-auto-options:
404
401
405
- Returns an instance of :py: class: `CaptureFixture `.
402
+ Returns an instance of :class: `CaptureFixture[bytes] <pytest.CaptureFixture> `.
406
403
407
404
Example:
408
405
@@ -443,7 +440,7 @@ request
443
440
444
441
The ``request `` fixture is a special fixture providing information of the requesting test function.
445
442
446
- .. autoclass :: _pytest.fixtures .FixtureRequest()
443
+ .. autoclass :: pytest .FixtureRequest()
447
444
:members:
448
445
449
446
@@ -485,9 +482,9 @@ caplog
485
482
.. autofunction :: _pytest.logging.caplog()
486
483
:no-auto-options:
487
484
488
- Returns a :class: `_pytest.logging .LogCaptureFixture ` instance.
485
+ Returns a :class: `pytest .LogCaptureFixture ` instance.
489
486
490
- .. autoclass :: _pytest.logging. LogCaptureFixture
487
+ .. autoclass :: pytest. LogCaptureFixture()
491
488
:members:
492
489
493
490
@@ -514,9 +511,7 @@ pytester
514
511
515
512
.. versionadded :: 6.2
516
513
517
- .. currentmodule :: _pytest.pytester
518
-
519
- Provides a :class: `Pytester ` instance that can be used to run and test pytest itself.
514
+ Provides a :class: `~pytest.Pytester ` instance that can be used to run and test pytest itself.
520
515
521
516
It provides an empty directory where pytest can be executed in isolation, and contains facilities
522
517
to write tests, configuration files, and match against expected output.
@@ -529,17 +524,17 @@ To use it, include in your topmost ``conftest.py`` file:
529
524
530
525
531
526
532
- .. autoclass :: Pytester()
527
+ .. autoclass :: pytest. Pytester()
533
528
:members:
534
529
535
- .. autoclass :: RunResult()
530
+ .. autoclass :: _pytest.pytester. RunResult()
536
531
:members:
537
532
538
- .. autoclass :: LineMatcher()
533
+ .. autoclass :: _pytest.pytester. LineMatcher()
539
534
:members:
540
535
:special-members: __str__
541
536
542
- .. autoclass :: HookRecorder()
537
+ .. autoclass :: _pytest.pytester. HookRecorder()
543
538
:members:
544
539
545
540
.. fixture :: testdir
@@ -552,7 +547,7 @@ legacy ``py.path.local`` objects instead when applicable.
552
547
553
548
New code should avoid using :fixture: `testdir ` in favor of :fixture: `pytester `.
554
549
555
- .. autoclass :: Testdir()
550
+ .. autoclass :: pytest. Testdir()
556
551
:members:
557
552
558
553
@@ -563,12 +558,10 @@ recwarn
563
558
564
559
**Tutorial **: :ref: `assertwarnings `
565
560
566
- .. currentmodule :: _pytest.recwarn
567
-
568
- .. autofunction :: recwarn()
561
+ .. autofunction :: _pytest.recwarn.recwarn()
569
562
:no-auto-options:
570
563
571
- .. autoclass :: WarningsRecorder()
564
+ .. autoclass :: pytest. WarningsRecorder()
572
565
:members:
573
566
574
567
Each recorded warning is an instance of :class: `warnings.WarningMessage `.
@@ -585,13 +578,11 @@ tmp_path
585
578
586
579
**Tutorial **: :doc: `tmpdir `
587
580
588
- .. currentmodule :: _pytest.tmpdir
589
-
590
- .. autofunction :: tmp_path()
581
+ .. autofunction :: _pytest.tmpdir.tmp_path()
591
582
:no-auto-options:
592
583
593
584
594
- .. fixture :: tmp_path_factory
585
+ .. fixture :: _pytest.tmpdir. tmp_path_factory
595
586
596
587
tmp_path_factory
597
588
~~~~~~~~~~~~~~~~
@@ -600,12 +591,9 @@ tmp_path_factory
600
591
601
592
.. _`tmp_path_factory factory api` :
602
593
603
- ``tmp_path_factory `` instances have the following methods :
594
+ ``tmp_path_factory `` is an instance of :class: ` ~pytest.TempPathFactory ` :
604
595
605
- .. currentmodule :: _pytest.tmpdir
606
-
607
- .. automethod :: TempPathFactory.mktemp
608
- .. automethod :: TempPathFactory.getbasetemp
596
+ .. autoclass :: pytest.TempPathFactory()
609
597
610
598
611
599
.. fixture :: tmpdir
@@ -615,9 +603,7 @@ tmpdir
615
603
616
604
**Tutorial **: :doc: `tmpdir `
617
605
618
- .. currentmodule :: _pytest.tmpdir
619
-
620
- .. autofunction :: tmpdir()
606
+ .. autofunction :: _pytest.tmpdir.tmpdir()
621
607
:no-auto-options:
622
608
623
609
@@ -630,12 +616,9 @@ tmpdir_factory
630
616
631
617
.. _`tmpdir factory api` :
632
618
633
- ``tmpdir_factory `` instances have the following methods:
634
-
635
- .. currentmodule :: _pytest.tmpdir
619
+ ``tmp_path_factory `` is an instance of :class: `~pytest.TempdirFactory `:
636
620
637
- .. automethod :: TempdirFactory.mktemp
638
- .. automethod :: TempdirFactory.getbasetemp
621
+ .. autoclass :: pytest.TempdirFactory()
639
622
640
623
641
624
.. _`hook-reference` :
0 commit comments