Pytest-snail

Latest version: v0.1.0

Safety actively analyzes 621444 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.1.0

[pip]: https://pypi.python.org/pypi/pip/
[PyPI]: https://pypi.org/project/pytest-snail/

Usage

When you run your tests, **pytest-snail** keeps track of test durations for each test item by test phase: setup, call, and teardown. ⏱

The next time you run your tests, **pytest-snail** adds a `snail` marker to all test items with a recorded, accumulated duration that is equal or longer than the value for the `--snail` CLI option (defaults to `5.0` seconds).

You can then use pytest's marker expressions to select or deselect tests.

Examples

First run your tests to measure test durations:

text
pytest


Then deselect all tests that take longer than `5.0` seconds to complete:

text
pytest -m "not snail"


Select only tests that take longer than `10.0` seconds to complete:

text
pytest --snail 10.0 -m snail

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.