@@ -304,11 +304,10 @@ request ``pytestconfig`` into your fixture and get it with ``pytestconfig.cache`
304
304
Under the hood, the cache plugin uses the simple
305
305
``dumps ``/``loads `` API of the :py:mod: `json ` stdlib module.
306
306
307
- .. currentmodule :: _pytest.cacheprovider
307
+ `` config.cache `` is an instance of :class: ` pytest.Cache `:
308
308
309
- .. automethod :: Cache.get
310
- .. automethod :: Cache.set
311
- .. automethod :: Cache.makedir
309
+ .. autoclass :: pytest.Cache()
310
+ :members:
312
311
313
312
314
313
.. fixture :: capsys
@@ -318,12 +317,10 @@ capsys
318
317
319
318
**Tutorial **: :doc: `capture `.
320
319
321
- .. currentmodule :: _pytest.capture
322
-
323
- .. autofunction :: capsys()
320
+ .. autofunction :: _pytest.capture.capsys()
324
321
:no-auto-options:
325
322
326
- Returns an instance of :py: class: `CaptureFixture `.
323
+ Returns an instance of :class: `CaptureFixture[str] <pytest.CaptureFixture> `.
327
324
328
325
Example:
329
326
@@ -334,7 +331,7 @@ capsys
334
331
captured = capsys.readouterr()
335
332
assert captured.out == " hello\n "
336
333
337
- .. autoclass :: CaptureFixture()
334
+ .. autoclass :: pytest. CaptureFixture()
338
335
:members:
339
336
340
337
@@ -345,10 +342,10 @@ capsysbinary
345
342
346
343
**Tutorial **: :doc: `capture `.
347
344
348
- .. autofunction :: capsysbinary()
345
+ .. autofunction :: _pytest.capture. capsysbinary()
349
346
:no-auto-options:
350
347
351
- Returns an instance of :py: class: `CaptureFixture `.
348
+ Returns an instance of :class: `CaptureFixture[bytes] <pytest.CaptureFixture> `.
352
349
353
350
Example:
354
351
@@ -367,10 +364,10 @@ capfd
367
364
368
365
**Tutorial **: :doc: `capture `.
369
366
370
- .. autofunction :: capfd()
367
+ .. autofunction :: _pytest.capture. capfd()
371
368
:no-auto-options:
372
369
373
- Returns an instance of :py: class: `CaptureFixture `.
370
+ Returns an instance of :class: `CaptureFixture[str] <pytest.CaptureFixture> `.
374
371
375
372
Example:
376
373
@@ -389,10 +386,10 @@ capfdbinary
389
386
390
387
**Tutorial **: :doc: `capture `.
391
388
392
- .. autofunction :: capfdbinary()
389
+ .. autofunction :: _pytest.capture. capfdbinary()
393
390
:no-auto-options:
394
391
395
- Returns an instance of :py: class: `CaptureFixture `.
392
+ Returns an instance of :class: `CaptureFixture[bytes] <pytest.CaptureFixture> `.
396
393
397
394
Example:
398
395
@@ -433,7 +430,7 @@ request
433
430
434
431
The ``request `` fixture is a special fixture providing information of the requesting test function.
435
432
436
- .. autoclass :: _pytest.fixtures .FixtureRequest()
433
+ .. autoclass :: pytest .FixtureRequest()
437
434
:members:
438
435
439
436
@@ -475,9 +472,9 @@ caplog
475
472
.. autofunction :: _pytest.logging.caplog()
476
473
:no-auto-options:
477
474
478
- Returns a :class: `_pytest.logging .LogCaptureFixture ` instance.
475
+ Returns a :class: `pytest .LogCaptureFixture ` instance.
479
476
480
- .. autoclass :: _pytest.logging. LogCaptureFixture
477
+ .. autoclass :: pytest. LogCaptureFixture()
481
478
:members:
482
479
483
480
@@ -504,9 +501,7 @@ pytester
504
501
505
502
.. versionadded :: 6.2
506
503
507
- .. currentmodule :: _pytest.pytester
508
-
509
- Provides a :class: `Pytester ` instance that can be used to run and test pytest itself.
504
+ Provides a :class: `~pytest.Pytester ` instance that can be used to run and test pytest itself.
510
505
511
506
It provides an empty directory where pytest can be executed in isolation, and contains facilities
512
507
to write tests, configuration files, and match against expected output.
@@ -519,16 +514,16 @@ To use it, include in your topmost ``conftest.py`` file:
519
514
520
515
521
516
522
- .. autoclass :: Pytester()
517
+ .. autoclass :: pytest. Pytester()
523
518
:members:
524
519
525
- .. autoclass :: RunResult()
520
+ .. autoclass :: _pytest.pytester. RunResult()
526
521
:members:
527
522
528
- .. autoclass :: LineMatcher()
523
+ .. autoclass :: _pytest.pytester. LineMatcher()
529
524
:members:
530
525
531
- .. autoclass :: HookRecorder()
526
+ .. autoclass :: _pytest.pytester. HookRecorder()
532
527
:members:
533
528
534
529
.. fixture :: testdir
@@ -541,7 +536,7 @@ legacy ``py.path.local`` objects instead when applicable.
541
536
542
537
New code should avoid using :fixture: `testdir ` in favor of :fixture: `pytester `.
543
538
544
- .. autoclass :: Testdir()
539
+ .. autoclass :: pytest. Testdir()
545
540
:members:
546
541
547
542
@@ -552,12 +547,10 @@ recwarn
552
547
553
548
**Tutorial **: :ref: `assertwarnings `
554
549
555
- .. currentmodule :: _pytest.recwarn
556
-
557
- .. autofunction :: recwarn()
550
+ .. autofunction :: _pytest.recwarn.recwarn()
558
551
:no-auto-options:
559
552
560
- .. autoclass :: WarningsRecorder()
553
+ .. autoclass :: pytest. WarningsRecorder()
561
554
:members:
562
555
563
556
Each recorded warning is an instance of :class: `warnings.WarningMessage `.
@@ -574,13 +567,11 @@ tmp_path
574
567
575
568
**Tutorial **: :doc: `tmpdir `
576
569
577
- .. currentmodule :: _pytest.tmpdir
578
-
579
- .. autofunction :: tmp_path()
570
+ .. autofunction :: _pytest.tmpdir.tmp_path()
580
571
:no-auto-options:
581
572
582
573
583
- .. fixture :: tmp_path_factory
574
+ .. fixture :: _pytest.tmpdir. tmp_path_factory
584
575
585
576
tmp_path_factory
586
577
~~~~~~~~~~~~~~~~
@@ -589,12 +580,9 @@ tmp_path_factory
589
580
590
581
.. _`tmp_path_factory factory api` :
591
582
592
- ``tmp_path_factory `` instances have the following methods :
583
+ ``tmp_path_factory `` is an instance of :class: ` ~pytest.TempPathFactory ` :
593
584
594
- .. currentmodule :: _pytest.tmpdir
595
-
596
- .. automethod :: TempPathFactory.mktemp
597
- .. automethod :: TempPathFactory.getbasetemp
585
+ .. autoclass :: pytest.TempPathFactory()
598
586
599
587
600
588
.. fixture :: tmpdir
@@ -604,9 +592,7 @@ tmpdir
604
592
605
593
**Tutorial **: :doc: `tmpdir `
606
594
607
- .. currentmodule :: _pytest.tmpdir
608
-
609
- .. autofunction :: tmpdir()
595
+ .. autofunction :: _pytest.tmpdir.tmpdir()
610
596
:no-auto-options:
611
597
612
598
@@ -619,12 +605,9 @@ tmpdir_factory
619
605
620
606
.. _`tmpdir factory api` :
621
607
622
- ``tmpdir_factory `` instances have the following methods:
623
-
624
- .. currentmodule :: _pytest.tmpdir
608
+ ``tmp_path_factory `` is an instance of :class: `~pytest.TempdirFactory `:
625
609
626
- .. automethod :: TempdirFactory.mktemp
627
- .. automethod :: TempdirFactory.getbasetemp
610
+ .. autoclass :: pytest.TempdirFactory()
628
611
629
612
630
613
.. _`hook-reference` :
0 commit comments