Pytest plugin to write test logs to file(s)
Project description
Pytest plugin to write test logs to file(s)
Features
- Logger fixture with specific log node for each test:
--logfest=full writes one log file per test file in a dir tree matching the tests, containing: - log records for start and end of each test - all log records from the test
--logfest=basic writes one log file per root test dir, containing: - log records for start and end of each test - all log records of level info or higher from the test - in case of setup or test failing, all log records from the test
Requirements
Pytest
Pathlib2 (if using Python 2)
Installation
You can install “pytest-logfest” via pip from PyPI:
$ pip install pytest-logfest
Usage
Run pytest with either --logfest=full or --logfest=basic. If you use --logfest=quiet or don’t provide the parameter, no log files will be generated.
Note that the plugin sets log_level and log_format, so changing those will affect the behaviour of the plugin.
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-logfest” is free and open source software.
Issues
If you encounter any problems, please file an issue along with a detailed description.
Acknowledgements
This pytest plugin was generated with Cookiecutter along with @hackebrot’s cookiecutter-pytest-plugin template.
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
File details
Details for the file pytest-logfest-0.1.0.tar.gz
.
File metadata
- Download URL: pytest-logfest-0.1.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e69f66d45a3f8f398885ba57873f5686c2a3c07c57baff9b94e3b4a4b907b698 |
|
MD5 | 7b91d4f0672ac96f1450085cc747f92d |
|
BLAKE2b-256 | f1a5341f2614fe60d49df111130838db9e4b4249aa7fceb0ed670262f343c52c |