extra credit Search 85,062 technologies ⌘K Download for Mac

pytest

Category
Frameworks and libraries
Docs outline
16 sections

Official docs outline

docs.pytest.org
  1. Get Started

    Writing a first test, assertions, running tests, grouping tests in classes, and test discovery.

  2. Invoking pytest

    Command line options, selecting tests by node ID, keyword or marker, -x, --lf, and exit codes.

  3. Assertions

    Plain assert rewriting, pytest.raises, approx, expected exceptions, and custom assertion explanations.

  4. Fixtures

    Defining fixtures, scopes, yield teardown, autouse, fixture factories, conftest.py, and fixture overriding.

  5. Anatomy of a Test and About Fixtures

    Arrange-act-assert-cleanup phases and how fixtures structure tests and dependencies.

  6. Marks

    Custom markers, registering markers, and selecting tests with -m.

  7. Parametrization

    pytest.mark.parametrize, parametrized fixtures, indirect parametrization, and ids.

  8. Skip and xfail

    skip, skipif, xfail, strict xfail, and conditional test outcomes.

  9. Temporary Directories and Files

    tmp_path, tmp_path_factory, and test isolation with file systems.

  10. Monkeypatching and Mocking

    monkeypatch fixture, setattr, setenv, patching dictionaries, and isolating tests from the environment.

  11. Capturing Output, Logging and Warnings

    capsys and capfd, caplog, recwarn, pytest.warns, and output control.

  12. Plugins and Hooks

    conftest.py plugins, hook functions, installing and writing plugins, and plugin discovery.

  13. unittest and xunit-style Setup

    Running unittest.TestCase tests, setup_method/teardown_method, and mixing styles.

  14. Good Integration Practices

    Project layout, src layout, test discovery conventions, editable installs, and tox.

  15. Flaky Tests and CI

    Causes of flaky tests, rerunning, random ordering, and CI pipeline setup.

  16. Reference Guides

    Built-in fixtures, marks, configuration options, hooks, and exit codes.

Each section links to the official page. Titles and summaries by Extra Credit; the docs belong to their authors.

All 113
↑↓ move ↵ open