BLogger is a Pytest plugin for enhanced test logging and generating convenient and lightweight reports.
Project description
BLogger — Pytest Logging Plugin
Full README.md available at GitHub
Overview
BLogger is a Pytest plugin for enhanced test logging and generating convenient and lightweight reports.
It supports structured test steps, descriptions, info notes, known bugs, and automatic screenshots.
Works seamlessly with Selenium WebDriver and Playwright Page instances.
Integrates with Allure and Qase for fewer duplicates like .steps, .attach etc.
Report Examples
Sample HTML reports and screenshots are available in the GitHub repository.
Installation
pip install pytest-b-logger
Setup
!!! Add blog.config.yaml file to the root of your project. !!!
project_name
Bare minimum for everything to work is project_name:
project_name: 'Project Name'
Can be changed later via CLI when running tests
pytest --blog-project-name '...'
timezone
Then you can set the desired Time Zone (IANA format e.g. Europe/Moscow, UTC, America/New_York).
The list of available timezones: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
project_name: 'Project Name'
tz: 'Europe/Moscow'
integrations
By default, integrations are turned off.
If you are using Allure and want steps, info, description etc. to be duplicated to Allure,
simply add integrations block and set allure: True
project_name: 'Project Name'
tz: 'Europe/Moscow'
integrations:
allure: True
hide_passwords
By default, passwords inside parameters are hidden.
If you want passwords to be shown simply set hide_passwords: False
project_name: 'Project Name'
tz: 'Europe/Moscow'
integrations:
allure: True
hide_passwords: False
env and base_url
You can add env and base url here.
project_name: 'Project Name'
tz: 'Europe/Moscow'
integrations:
allure: True
hide_passwords: True
env: 'prod' # optional
base_url: 'https://base-url.com' # optional
Which, could also be passed as command line options on test run, e.g. when using CI/CD:
pytest --blog-env 'prod' --blog-base-url 'https://base-url.com'
!!! Note !!! Options apply in the following order: blog.config.yaml > blog methods inside code > Command Line Arguments
Now you are all set up.
Simply run pytest and b_logs folder will be generated
with blog_report.html and blog_summary.html
For more advanced usage please review BLogger API
BLogger API
Please see API Reference at GitHub
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytest_b_logger-1.2.3.tar.gz.
File metadata
- Download URL: pytest_b_logger-1.2.3.tar.gz
- Upload date:
- Size: 55.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74f33cbb4ffcb483d816e85e1d3000473801645854a261c72668bbc464636aca
|
|
| MD5 |
549d65d26c6148db10c186c10cb388a6
|
|
| BLAKE2b-256 |
5b6caa7e46bfd452eb069e46ef67d9a5d5fec8e5c500c17bba77d136d3aa4465
|
File details
Details for the file pytest_b_logger-1.2.3-py3-none-any.whl.
File metadata
- Download URL: pytest_b_logger-1.2.3-py3-none-any.whl
- Upload date:
- Size: 58.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c5b807c4f59a3f345227c34d2295f52f53822df5d005417f2fd7f00019f92a7
|
|
| MD5 |
acb69288f9628cd5699d56aa4ecf0603
|
|
| BLAKE2b-256 |
e97753cbb611029084010d7451026d9963b293033475669591bfab86d6725f2b
|