Skip to main content

Rerun testsuite for a certain time or iterations

Project description

pytest-rerun-all

Rerun whole testsuites for a certain time or amount

Still under development.

Arguments

--rerun-time <time>
Rerun testsuite for the specified time, argument as text (e.g "2 min", "3 hours", ...), the default unit is seconds.

--rerun-iter <int>
Rerun testsuite for the specified iterations.

--rerun-delay <time>
After each testsuite run wait for the specified time, argument as text (e.g "2 min", 10, ...), the default unit is seconds.

--rerun-fresh
Start each testsuite run with fresh fixtures (teardown all fixtures), per default no teardown is done if not needed.

NOTE: All arguments can also be set as environment variables, e.g. RERUN_TIME="1 hour".

Examples

pytest --rerun-time "10 min" examples  # run tests for 10 secons
pytest --rerun-iter 10 examples  # run all tests 10 times
# run all tests 10 times and teardown all fixtures after each run
pytest --rerun-iter 10 --rerun-teardown examples 
# run tests for 2 hours with 10 secons delay after each run
pytest --rerun-time "2 hours" --rerun-dealy "10s" examples 
# run tests for 120 seconds with a fresh restart for each testsuite run
RERUN_FRESH=1 pytest --rerun-time 120 examples 

Installation

You can install pytest-rerun-all via pip from PyPI or this repo:

pip install pytest-rerun-all
pip install git+git@github.com:TBxy/pytest-rerun-all.git@main # latest version

Todos

  • Fixture to exclude tests from running more than once (e.g. @pytest_rerun_all.only_once())
  • Issue with only one selected test (teardown on frist run)
  • Output for each new run
  • Summary per test with number of fails and pass (maybe only for failed tests ...)
  • Write tests
  • Github Actions

Contributing

Contributions are very welcome. Tests are not ready at the moment, use the example scripts.

License

Distributed under the terms of the MIT license, pytest-rerun-all is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.


This pytest plugin was generated with Cookiecutter along with @hackebrot's cookiecutter-pytest-plugin template.

Project details


Download files

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

Source Distribution

pytest_rerun_all-0.1.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_rerun_all-0.1.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file pytest_rerun_all-0.1.1.tar.gz.

File metadata

  • Download URL: pytest_rerun_all-0.1.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.3 Linux/6.8.0-64-generic

File hashes

Hashes for pytest_rerun_all-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3eb3cc9a91c8016a1b94a1fad67e5f6793351f55538c5452f0d6ec268db5a48f
MD5 582d90eedc4ef73f332a5e59d82f75a6
BLAKE2b-256 13304fe63dd52ebf6fbd7271d3acad67d12bbaec458a53c2d881990c2d533a32

See more details on using hashes here.

File details

Details for the file pytest_rerun_all-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pytest_rerun_all-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.3 Linux/6.8.0-64-generic

File hashes

Hashes for pytest_rerun_all-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6588f72b98372498b219e71cf893733e41800db81c9a386bffb5dda7df87a75d
MD5 40904d67a1d95a92e8bad7255396f717
BLAKE2b-256 f6984116883b19ff88183116a6c8fa754b0c70ec469c1bcf299134540ef17ddf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page