Skip to main content

Plugin to run pystack after a timeout for a test suite.

Project description

pytest-pystack

CI PyPI - Python Version PyPI PyPI - Downloads Code Style

A pytest plug-in for easy integration of PyStack in your test suite.

It can be used to automatically dump the stack trace of a hanging test in your suite.

See PyStack for further information about the tool.

Installation

To install the PyStack pytest plug-in, just run the following command in your venv:

python -m pip install pytest-pystack

Quick Start

After you have installed the pytest plug-in, you can have PyStack monitor your test suite and output a stack trace if a test takes more than 5 seconds, simply by running pytest with argument --pystack-threshold=5.

Configuration

The PyStack plug-in can be configured via the command line with the following options:

  • --pystack-threshold: Enables the plug-in and monitors all tests, generating a stack trace if they take longer than the specified threshold. Note, this neither stops nor fails the test case after the specified threshold.
  • --pystack-output-file: Appends PyStack output to a file.
  • --pystack-path: Path to the pystack executable.
  • --pystack-args: Additional args to pass to pystack remote <pid>, like --native or --native-all.

And through any pytest config file, see an example of pyproject.toml:

[tool.pytest.ini_options]
pystack_threshold=60
pystack_path="custom-version-of-pystack"
pystack_output_file="./pystack.log"
pystack_args="--native"

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-pystack-1.0.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

pytest_pystack-1.0.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file pytest-pystack-1.0.0.tar.gz.

File metadata

  • Download URL: pytest-pystack-1.0.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for pytest-pystack-1.0.0.tar.gz
Algorithm Hash digest
SHA256 af694f9a899d6a1988e945d88817b1f64d674322a43a6677ebd92c565d26fb90
MD5 ef76ed3c2eeea7bff852e4d7b9a5621a
BLAKE2b-256 e6d3a4412e036e5ba71e2790a3a667c3fd99683103f946ecf989e1572efb1f3b

See more details on using hashes here.

File details

Details for the file pytest_pystack-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_pystack-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6aa3d92b5ba5e0e1b2f99429ded6aa08c478718e7aaa164b109629a5da1defa2
MD5 f8693e857e8945382958ebfad80afaf1
BLAKE2b-256 1b617665fd9e4d99154f8f7479325e5a25529667c37e90d0b6d99f2c788f26f3

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