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 hashes)

Uploaded Source

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