Skip to main content

Skip rest of tests if previous test failed.

Project description

Welcome to pytest-atomic

PyPi version Python version Build Status codecov

Skip rest of tests if previous test failed.


  • pytest >= 3.10.0
  • python >= 3.6

Not compatible with Python2.x

How to install

$ pip install pytest-atomic --upgrade


# pytest.ini
enable     : true
electronic : true


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


import pytest

def test_fn1():
    assert 0

def test_fn2():
    assert 0

class TestCls:
    def test_1(self):
        assert 0
    def test_2(self):
        assert 1
    def test_3(self):
        assert 0
    def test_4(self):
        assert 1
    def test_5(self):
        assert 0

def test_fn3():
    assert 0
def test_fn4():
    assert 0
def test_fn5():
    assert 0
|____ 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   


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.


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.

Project details

Download files

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

Files for pytest-atomic, version 2.0.0
Filename, size File type Python version Upload date Hashes
Filename, size pytest-atomic-2.0.0.tar.gz (3.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page