Skip to main content

Organizing pytests by integration or not

Project description

pytest-integration

Overview

Plugin for pytest to mark tests as integration or slow integration.

Integration tests are run after normal tests (unit tests) and slow integration tests are run after (quick) integration tests.

If a unit test fails, (quick) integration and slow integration tests are not run.

If a (quick) integration tests fails, slow integration tests are not run.

If you have also installed pytest-cov, then code coverage is disabled for all integration tests, since unit tests are supposed to cover all the code.

Added pytest markers

  • @pytest.mark.integration_test Marks this test as a (quick) integration test
  • @pytest.mark.slow_integration_test Marks this test as a slow integration test

Added pytest command line options

  • --with-integration Run (quick) integration tests (default)
  • --with-slow-integration Run slow integration tests (default)
  • --integration-cover Let integration tests contribute to coverage

with options also have a without variant.

Example

See the example directory. Examples of how to run are in the Makefile.

Compatibility

  • When running under xdist, each node will pick tests based on an index. That means that nodes that receive only unit tests that pass, will continue to run (slow) integration tests, even if another node receives a unit test that fails.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_integration-0.2.3.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

pytest_integration-0.2.3-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page