Pirate Wiki Docs
Alpine.jsData WarehouseDjangoDockerDjango REST FrameworkpytestPythonRustStreamlitSwiftTypeScriptVue.js
pytest
    • Introduction
    • Installation
    • Target Specific Tests
    • Filters, Markers & Expected Exceptions
    • Parametrized Testing
    • Introduction
    • Sharing
    • Scope
    • Extending and Renaming
    • Parametrizing
      • Introduction
      • request
      • tmp_path
      • pytestconfig
      • cache
      • capsys
      • caplog
      • monkeypatch
    • Plugins
    • Configuration
    • Introduction
    • pdb
    • Coverage.py
    • mock
    • unittest
    • tox
    • Jenkins CI
    • Version Info
    • References
pytest

Builtin Fixtures

pytest provides several useful built-in fixtures. Below are some of the most commonly used ones, explained at a high level. For a complete list of all pytest built-in fixtures, see the official reference. If you want to explore any specific fixture in more depth, refer to its dedicated documentation page.

Parametrizing

Fixtures can be parametrized using params=[...]. The elements can be accessed using the special pytest's built-in request fixture.

request

The request fixture is a special fixture that provides information about the requesting test function. It also exposes a param attribute when the fixture is parametrized, as shown in the example above.

© 2021-2026 Dev Pirates