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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytest_integration-0.2.3.tar.gz
.
File metadata
- Download URL: pytest_integration-0.2.3.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b00988a5de8a6826af82d4c7a3485b43fbf32c11235e9f4a8b7225eef5fbcf65 |
|
MD5 | c549105fa6a03583bfa6478f84e32a28 |
|
BLAKE2b-256 | 35e0c823048dc0866f2e0fa2e4a34cd6ec290697b238b7672b30cb07c65e59cc |
File details
Details for the file pytest_integration-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: pytest_integration-0.2.3-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f59ed1fa1cc8cb240f9495b68bc02c0421cce48589f78e49b7b842231604b12 |
|
MD5 | 98b28c5c3059eb3d16281232ced1fb88 |
|
BLAKE2b-256 | 1b419b393be6252635e4d39c3e62805018c42bfcc486b42246b582b755ff9ad3 |