Skip to main content

Pytest plugin to write test logs to file(s)

Project description

PyPI version Python versions See Build Status on Travis CI See Build Status on AppVeyor

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-logfest-0.1.0.tar.gz (5.4 kB view details)

Uploaded Source

File details

Details for the file pytest-logfest-0.1.0.tar.gz.

File metadata

File hashes

Hashes for pytest-logfest-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e69f66d45a3f8f398885ba57873f5686c2a3c07c57baff9b94e3b4a4b907b698
MD5 7b91d4f0672ac96f1450085cc747f92d
BLAKE2b-256 f1a5341f2614fe60d49df111130838db9e4b4249aa7fceb0ed670262f343c52c

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