Pytest Marker Sequence
This plugin helps you sequence your markers in pytest.
We mark our tests with different markers, say like nightly, sanity, stress etc. If we wish to sequence these markers for execution of our tests, we can sequence them in pytest.ini itself as mentioned below.
Installation
- Plugin is available on
pypi.orgaspipinstallable. - Install by pip command as
pip install pytest-sequence-markers
Editing pytest.ini
pytest.iniis a configuration file forpytest.- For sequencing the markers, add a section named
test_execution_sequenceinpytest.ini - Add a key named
marker_sequenceand mention the sequence of the markers you want.
[pytest]
markers = sanity: Sanity Tests
nightly: Nightly Tests
release: Release Tests
negative: Negative Tests
[test_execution_sequence]
marker_sequence = sanity, negative, nightly, release
- The sequence of markers you specify comma separated in the ini file, tests will be executed in that sequence only
Example
- Edit the
pytest.inias mentioned above and mention your own sequence with own markers - Add a test file containing all
pytesttests
import pytest
@pytest.mark.sanity
def test_sanity():
pass
@pytest.mark.release
def test_release():
pass
@pytest.mark.negative
def test_negative():
pass
@pytest.mark.nightly
def test_nightly():
pass
@pytest.mark.nightly
def test_nightly2():
pass
- Execute the test with pytest command
$ pytest -sv
========================================================== test session starts ==========================================================
platform linux -- Python 3.8.10, pytest-7.3.1, pluggy-1.0.0 -- /home/siddhesh/py38/bin/python
cachedir: .pytest_cache
rootdir: /home/siddhesh/plugin_test
configfile: pytest.ini
plugins: sequence-markers-0.0.1
collecting ... I am in local one
collected 5 items
tests/test_me.py::test_sanity PASSED
tests/test_me.py::test_negative PASSED
tests/test_me.py::test_nightly PASSED
tests/test_me.py::test_nightly2 PASSED
tests/test_me.py::test_release PASSED
========================================================== 5 passed in 0.01s ==========================================================
Metadata
Release files for pytest-sequence-markers 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pytest_sequence_markers-0.0.2.tar.gz | 3.1 kB | Without provenance | Details for pytest_sequence_markers-0.0.2.tar.gz |
Release files / pytest_sequence_markers-0.0.2.tar.gz
| Download URL | pytest_sequence_markers-0.0.2.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5dde177e57ba1ee882aa172374e36844c06148eaa12b464482a4c8b0ddce9e3b
|
|
BLAKE2b-256 checksum How to use checksums |
5d2997a7d1e1860737093933aecdcc3c769d9b1c42f0cb5809b2e7607a33cd54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Security for pytest-sequence-markers 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.