Navigation

  • modules
  • pytest-0.1 »
  • How-to guides

How-to guides¶

Core pytest functionality¶

  • How to invoke pytest
  • How to write and report assertions in tests
  • How to use fixtures
  • How to mark test functions with attributes
  • How to parametrize fixtures and test functions
  • How to use temporary directories and files in tests
  • How to monkeypatch/mock modules and environments
  • How to run doctests
  • How to re-run failed tests and maintain state between test runs

Test output and outcomes¶

  • How to handle test failures
  • Managing pytest’s output
  • How to manage logging
  • How to capture stdout/stderr output
  • How to capture warnings
  • How to use skip and xfail to deal with tests that cannot succeed

Plugins¶

  • How to install and use plugins
  • Writing plugins
  • Writing hook functions

pytest and other test systems¶

  • How to use pytest with an existing test suite
  • How to use unittest-based tests with pytest
  • How to run tests written for nose
  • How to implement xunit-style set-up

pytest development environment¶

  • How to set up bash completion

Logo

Contents

  • Home
  • Get started
  • How-to guides
  • Reference guides
  • Explanation
  • Complete table of contents
  • Library of examples

About the project

  • Changelog
  • Contributing
  • Backwards Compatibility
  • Sponsor
  • pytest for Enterprise
  • License
  • Contact Channels

  • How-to guides
    • Core pytest functionality
    • Test output and outcomes
    • Plugins
    • pytest and other test systems
    • pytest development environment

Related Topics

  • Documentation overview

Useful Links

  • pytest @ PyPI
  • pytest @ GitHub
  • Issue Tracker
  • PDF Documentation
© Copyright 2015, holger krekel and pytest-dev team. Created using Sphinx 5.3.0.