Welcome to pytest-atomic
Skip rest of tests if previous test failed.
Requirements
- pytest >= 3.10.0
- python >= 3.6
Not compatible with Python2.x
How to install
$ pip install pytest-atomic --upgrade
Usage
# pytest.ini
[pytest]
[atomic]
enable : true
electronic : true
Options
Notice! [pytest]section must be included.
Notice! All options bellow must be under [atomic] section in pytest.ini.
- enable : [true / false] default is false
- electronic : [true / false] default is true
Example
import pytest
@pytest.mark.atomic
def test_fn1():
assert 0
def test_fn2():
assert 0
class TestCls:
@pytest.mark.atomic
def test_1(self):
assert 0
@pytest.mark.electronic
def test_2(self):
assert 1
def test_3(self):
assert 0
@pytest.mark.electronic
def test_4(self):
assert 1
def test_5(self):
assert 0
def test_fn3():
assert 0
@pytest.mark.atomic
def test_fn4():
assert 0
def test_fn5():
assert 0
test_demo
|____ test_fn1: Failed
|____ test_fn2: Skipped
|____ TestCls
| |____ test_1 Failed
| |____ test_2 Passed
| |____ test_3 Skipped
| |____ test_4 Passed
| |____ test_5 Skipped
|
|____ test_fn3: Skipped
|____ test_fn4: Failed
|____ test_fn5: Skipped
Contributing
Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.
License
Distributed under the terms of the MIT license, "pytest-atomic" is free and open source software
Known Issue
- Mark a Test class directly seems not work, but you can mark the first of test method in that class.
Metadata
Release files for pytest-atomic 2.0.0
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-atomic-2.0.0.tar.gz | 3.8 kB | Without provenance | Details for pytest-atomic-2.0.0.tar.gz |
Release files / pytest-atomic-2.0.0.tar.gz
| Download URL | pytest-atomic-2.0.0.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
02b990b3132e540cc14b59ae66b0c9319cb33d03082b56d59d2fe3075d47c214
|
|
BLAKE2b-256 checksum How to use checksums |
7236a4c277cf2f81decd7ce391bee6449c7bede1874265bc649b85335f0930f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0
|
Security for pytest-atomic 2.0.0
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.