Skip to main content

Sort tests by their last duration, slowest first

Project description

PyPI version Python versions See Build Status on AppVeyor

Sort tests by their last duration, slowest first.


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

Features

  • Sort tests on consecutive runs by their last duration, slowest first.

  • Works with pytest-xdist by pre-assigning tests to workers based on their last duration.

Requirements

  • pytest

  • pytest-xdist (optional)

Installation

You can install “pytest-slowest-first” via pip from PyPI:

$ pip install pytest-slowest-first

Usage

For best results, use this plugin with pytest-xdist to run tests in parallel. When used together, make sure to pass --dist=loadgroup to pytest to ensure that tests are distributed evenly across workers.

Example command line:

$ pytest --sf -n auto --dist=loadgroup

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-slowest-first” is free and open source software

Issues

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

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-slowest-first-0.1.2.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file pytest-slowest-first-0.1.2.tar.gz.

File metadata

  • Download URL: pytest-slowest-first-0.1.2.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for pytest-slowest-first-0.1.2.tar.gz
Algorithm Hash digest
SHA256 331aa532b48f85cf2041ac6d79a8d4382bab44395f3079ff01b0f97e4f9d056b
MD5 41dcc9fed5832bce0762f7fa09221d9d
BLAKE2b-256 c005d0c97b4f2fa7814d4c6dc4db8049de83cbaa1a28333edd512243df5a46e4

See more details on using hashes here.

Supported by

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