
Security News
Bun 1.2.19 Adds Isolated Installs for Better Monorepo Support
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Enhanced HTML reporting for pytest with categories, specifications, and detailed logging
pip install pytest-html-report
Create a pytest_html_report.yml
file in your project root:
report:
title: "My Test Report"
img_url: "https://your-logo-url.png"
report_dir: "reports"
test_environment: "Development"
functional_specs:
SPEC-001: "User Authentication"
SPEC-002: "Data Processing"
SPEC-003: "API Integration"
categories:
unit: "Unit Tests"
integration: "Integration Tests"
regression: "Regression Tests"
Use the provided markers to add metadata to your tests:
import pytest
@pytest.mark.reporting(
developer="John Doe",
functional_specification="SPEC-001",
test_description="Validate user login flow"
)
@pytest.mark.category("integration", "regression")
def test_user_login(logger):
"""Test user authentication process"""
logger.step("Setting up test data")
# Test implementation
logger.step("Validating results")
assert True
@pytest.mark.reporting(
developer="Jane Smith",
functional_specification=["SPEC-002", "SPEC-003"],
test_description="Complex data pipeline test"
)
@pytest.mark.category("integration")
def test_data_pipeline(logger):
"""Test data processing pipeline"""
logger.step("Initializing pipeline")
# Test implementation
logger.step("Verifying output")
assert 1 == 1
# Test assertions
logger.assertion("Output 1 matches expected result 1")
Run your tests with pytest as usual:
pytest
The HTML report will be generated in the configured report directory (default: reports/
). The report name is the report_date_time.html, e.g., reports/report_20250622_231929.html
.
@pytest.mark.reporting
: Add metadata about the test
developer
: Test owner/developerfunctional_specification
: Link to functional specstest_description
: Brief description of the test@pytest.mark.category
: Categorize tests
The plugin provides a logger
fixture for detailed test steps:
def test_example(logger):
logger.step("Starting test preparation")
# Test setup
logger.step("Executing main test logic")
# Test execution
logger.assertion("Asserting result 1 == 1")
# Assertions
You can customize the report appearance in your config:
theme:
primary_color: "#0052CC"
success_bg: "#E3FCEF"
error_bg: "#FFEBE6"
warning_bg: "#FFFAE6"
info_bg: "#DEEBFF"
FAQs
Enhanced HTML reporting for pytest with categories, specifications, and detailed logging
We found that pytest-html-report demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Security News
Popular npm packages like eslint-config-prettier were compromised after a phishing attack stole a maintainer’s token, spreading malicious updates.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.