@@ -333,50 +333,6 @@ For more details, consult the full :ref:`fixtures docs <fixture>`.
333
333
:decorator:
334
334
335
335
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
-
380
336
.. fixture :: capfd
381
337
382
338
capfd
@@ -387,6 +343,7 @@ capfd
387
343
.. autofunction :: _pytest.capture.capfd()
388
344
:no-auto-options:
389
345
346
+
390
347
.. fixture :: capfdbinary
391
348
392
349
capfdbinary
@@ -398,71 +355,74 @@ capfdbinary
398
355
:no-auto-options:
399
356
400
357
401
- .. fixture :: doctest_namespace
402
-
403
- doctest_namespace
404
- ~~~~~~~~~~~~~~~~~
405
-
406
- **Tutorial **: :ref: `doctest `
358
+ .. fixture :: caplog
407
359
408
- .. autofunction :: _pytest.doctest.doctest_namespace()
360
+ caplog
361
+ ~~~~~~
409
362
363
+ **Tutorial **: :ref: `logging `
410
364
411
- .. fixture :: request
365
+ .. autofunction :: _pytest.logging.caplog()
366
+ :no-auto-options:
412
367
413
- request
414
- ~~~~~~~
368
+ Returns a :class: `pytest.LogCaptureFixture ` instance.
415
369
416
- **Example **: :ref: `request example `
370
+ .. autoclass :: pytest.LogCaptureFixture()
371
+ :members:
417
372
418
- The ``request `` fixture is a special fixture providing information of the requesting test function.
419
373
420
- .. autoclass :: pytest.FixtureRequest()
421
- :members:
374
+ .. fixture :: capsys
422
375
376
+ capsys
377
+ ~~~~~~
423
378
424
- .. fixture :: pytestconfig
379
+ ** Tutorial **: :ref: ` captures `
425
380
426
- pytestconfig
427
- ~~~~~~~~~~~~
381
+ .. autofunction :: _pytest.capture.capsys()
382
+ :no-auto-options:
428
383
429
- .. autofunction :: _pytest.fixtures.pytestconfig()
384
+ .. autoclass :: pytest.CaptureFixture()
385
+ :members:
430
386
387
+ .. fixture :: capsysbinary
431
388
432
- .. fixture :: record_property
389
+ capsysbinary
390
+ ~~~~~~~~~~~~
433
391
434
- record_property
435
- ~~~~~~~~~~~~~~~~~~~
392
+ **Tutorial **: :ref: `captures `
436
393
437
- **Tutorial **: :ref: `record_property example `
394
+ .. autofunction :: _pytest.capture.capsysbinary()
395
+ :no-auto-options:
438
396
439
- .. autofunction :: _pytest.junitxml.record_property()
440
397
398
+ .. fixture :: cache
441
399
442
- .. fixture :: record_testsuite_property
400
+ config.cache
401
+ ~~~~~~~~~~~~
443
402
444
- record_testsuite_property
445
- ~~~~~~~~~~~~~~~~~~~~~~~~~
403
+ **Tutorial **: :ref: `cache `
446
404
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 ``.
448
408
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.
450
411
412
+ ``config.cache `` is an instance of :class: `pytest.Cache `:
451
413
452
- .. fixture :: caplog
414
+ .. autoclass :: pytest.Cache()
415
+ :members:
453
416
454
- caplog
455
- ~~~~~~
456
417
457
- ** Tutorial **: :ref: ` logging `
418
+ .. fixture :: doctest_namespace
458
419
459
- .. autofunction :: _pytest.logging.caplog()
460
- :no-auto-options:
420
+ doctest_namespace
421
+ ~~~~~~~~~~~~~~~~~
461
422
462
- Returns a :class: ` pytest.LogCaptureFixture ` instance.
423
+ ** Tutorial **: :ref: ` doctest `
463
424
464
- .. autoclass :: pytest.LogCaptureFixture()
465
- :members:
425
+ .. autofunction :: _pytest.doctest.doctest_namespace()
466
426
467
427
468
428
.. fixture :: monkeypatch
@@ -481,6 +441,14 @@ monkeypatch
481
441
:members:
482
442
483
443
444
+ .. fixture :: pytestconfig
445
+
446
+ pytestconfig
447
+ ~~~~~~~~~~~~
448
+
449
+ .. autofunction :: _pytest.fixtures.pytestconfig()
450
+
451
+
484
452
.. fixture :: pytester
485
453
486
454
pytester
@@ -517,19 +485,25 @@ To use it, include in your topmost ``conftest.py`` file:
517
485
.. autoclass :: pytest.RecordedHookCall()
518
486
:members:
519
487
520
- .. fixture :: testdir
521
488
522
- testdir
523
- ~~~~~~~
489
+ .. fixture :: record_property
524
490
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
+ ~~~~~~~~~~~~~~~~~~~
527
493
528
- New code should avoid using :fixture: ` testdir ` in favor of :fixture: ` pytester `.
494
+ ** Tutorial **: :ref: ` record_property example `
529
495
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()
533
507
534
508
535
509
.. fixture :: recwarn
@@ -546,6 +520,34 @@ recwarn
546
520
:members:
547
521
548
522
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
+
549
551
.. fixture :: tmp_path
550
552
551
553
tmp_path
0 commit comments