Plugin to run pystack after a timeout for a test suite.
Project description
pytest-pystack
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 thepystack
executable.--pystack-args
: Additional args to pass topystack 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"
License
This project is Apache-2.0 licensed, as found in the LICENSE file.
Code of Conduct
This project has adopted a Code of Conduct. If you have any concerns about the Code, or behavior that you have experienced in the project, please contact us at opensource@bloomberg.net.
Contributing
We welcome your contributions to help us improve and extend this project!
Below you will find some basic steps required to be able to contribute to the project. If you have any questions about this process or any other aspect of contributing to a Bloomberg open source project, feel free to send an email to opensource@bloomberg.net and we'll get your questions answered as quickly as we can.
Contribution Licensing
Since this project is distributed under the terms of an open source license, contributions that you make are licensed under the same terms. For us to be able to accept your contributions, we will need explicit confirmation from you that you are able and willing to provide them under these terms, and the mechanism we use to do this is called a Developer's Certificate of Origin (DCO). This is similar to the process used by the Linux kernel, Samba, and many other major open source projects.
To participate under these terms, all that you must do is include a line like the following as the last line of the commit message for each commit in your contribution:
Signed-Off-By: Random J. Developer <random@developer.example.org>
The simplest way to accomplish this is to add -s
or --signoff
to your git commit
command.
You must use your real name (sorry, no pseudonyms, and no anonymous contributions).
Steps
- Create an Issue, select 'Feature Request', and explain the proposed change.
- Follow the guidelines in the issue template presented to you.
- Submit the Issue.
- Submit a Pull Request and link it to the Issue by including "#" in the Pull Request summary.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytest-pystack-1.0.1.tar.gz
.
File metadata
- Download URL: pytest-pystack-1.0.1.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 452bc50d87ef2d3f35dc43cafa88a8683da38d6f95a4267c9c3022c2f4a5fd99 |
|
MD5 | 8e5433535d8d4d5fc7b47ba0d4adbdcc |
|
BLAKE2b-256 | 2e628294b432c9d7c2a0a6a21a00de23de4faba476d69d6444d5130f6a3df53c |
File details
Details for the file pytest_pystack-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: pytest_pystack-1.0.1-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3001a651c787b3b09f17c625bd31cfe129ca82251860e265a024f5a54460f1e6 |
|
MD5 | ab5115ba9213cd426203f399e5dee7e4 |
|
BLAKE2b-256 | a280642296c1e2726cef84264c880b40314fea7414ff8e281158cc413e0f7649 |