{"id":8539,"library":"pytest-reporter-html1","title":"Pytest HTML1 Reporter","description":"Pytest-reporter-html1 is a basic HTML report template for Pytest, leveraging the Jinja2 template engine. It extends `pytest-reporter` to generate rich, expandable reports covering test files, phases, and detailed test information. The current version is 0.9.5, and it maintains an active release cadence for bug fixes and feature enhancements.","status":"active","version":"0.9.5","language":"en","source_language":"en","source_url":"https://github.com/christiansandberg/pytest-reporter-html1.git","tags":["pytest","html report","testing","jinja2","reporting"],"install":[{"cmd":"pip install pytest-reporter-html1","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core testing framework that this plugin extends.","package":"pytest","optional":false},{"reason":"Provides the underlying data structure and hooks for report generation, on which pytest-reporter-html1 is based.","package":"pytest-reporter","optional":false},{"reason":"Templating engine used for rendering the HTML report.","package":"Jinja2","optional":false},{"reason":"Dependency for Jinja2, also addressed in older deprecation warnings.","package":"MarkupSafe","optional":false},{"reason":"Supported for enhanced report metadata.","package":"pytest-metadata","optional":true},{"reason":"Supported for showing rerun information in reports.","package":"pytest-rerunfailures","optional":true}],"imports":[],"quickstart":{"code":"# tests/test_example.py\ndef test_success():\n    assert True\n\ndef test_failure():\n    assert False\n\n# Run from your terminal in the project root\n# This command will generate a detailed HTML report named 'report.html'\n# using the html1 template.\n# pytest --template=html1/index.html --report=report.html\n\n# To make the report self-contained (embed CSS, JS, images):\n# pytest --template=html1/index.html --report=report.html --split-report=False\n# Note: --split-report=False is the default behavior. For older versions, --self-contained might be used, but is deprecated.\n\n# To split assets (CSS, JS, images) into separate files:\n# pytest --template=html1/index.html --report=report.html --split-report\n","lang":"bash","description":"To generate an HTML report, run pytest with the `--template` and `--report` command-line options. The `--template` argument specifies the template to use (here, `html1/index.html`), and `--report` defines the output path and filename for the generated HTML report. By default, the report is self-contained. Use `--split-report` to separate assets like CSS and JavaScript."},"warnings":[{"fix":"Always use `--report=report.html` to specify the output file and `--template=html1/index.html` to select the HTML1 template with `pytest-reporter-html1`.","message":"Confusing `--html` with `--report`: Users migrating from or familiar with `pytest-html` often incorrectly try to use `--html=report.html` for report generation. `pytest-reporter-html1` uses `--report=report.html` instead.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Implement a custom `pytest_runtest_makereport` hook in your `conftest.py` to capture and attach screenshot data to the report context, using the provided `asset` filter in your custom Jinja2 template.","message":"No native screenshot support: Unlike some other HTML reporters, `pytest-reporter-html1` does not natively support embedding screenshots on test failures. Custom `pytest` hooks (e.g., `pytest_runtest_makereport`) must be implemented to add this functionality.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade `pytest-reporter-html1` to version 0.8.x or newer to resolve this warning. The issue was closed as completed, indicating a fix was implemented.","message":"`DeprecationWarning: 'jinja2.Markup'` for older versions: Versions of `pytest-reporter-html1` prior to 0.8.x might issue a `DeprecationWarning` related to `jinja2.Markup`, advising to import `markupsafe.Markup` instead.","severity":"deprecated","affected_versions":"<0.8.x"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Change the command-line argument from `--html=report.html` to `--report=report.html` and ensure you also specify `--template=html1/index.html`. Example: `pytest --template=html1/index.html --report=report.html`.","cause":"Attempting to use the `--html` argument, which is associated with `pytest-html`, instead of the correct `--report` argument for `pytest-reporter-html1`.","error":"pytest: error: unrecognized arguments: --html=report.html"},{"fix":"Check for open issues on the `pytest-reporter-html1` GitHub repository, ensure all related plugins (e.g., `pytest`, `pytest-reporter`) are up-to-date, and consider simplifying complex test data structures if a minimal reproducible example can be created. If the issue persists, filing a bug report with a minimal reproducible example is recommended.","cause":"This error has been reported in GitHub issues and can occur with specific test structures or interactions with other plugins, where dictionary objects are incorrectly used as hashable keys.","error":"TypeError: unhashable type: 'dict' during report generation"}]}