Skip to content

Abhishekvaish/pytest-retry-class

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pytest-retry-class

Pytest rerun/retry class if any test inside the class fails

Python

pytest retry failure

https://pypi.org/project/pytest-retry-class/0.2.0/

how to install

pip install pytest-retry-class

how to run with pytest

pytest --maxretry 2 --retry_on_exception "[AssertionError, DBError]" test.py

Where:

  • --maxretry is the number of times to retry a failed test [default: 1]
  • --retry_on_exception is a list of exceptions to retry on [default: all exceptions]

how to run with pytest.ini

You can also set the retry count and exceptions in pytest.ini file

[pytest]
maxretry = 2
retry_on_exception = AssertionError
                     DBError

Warning: CMD line arguments will override the pytest.ini file.

how to run examples

  1. pytest-xdist
pytest example/pytest-xdist-support/tests
  1. pytest-dependency
pytest example/pytest-dependency-support/tests
  1. pytest-rerun-class
pytest example/rerun-class/tests

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages