html-testRunner is a Python unittest test runner that generates human-readable HTML reports for test results. It extends the standard library's unittest module to provide clear and organized visual output. The current version is 1.2.1, released in September 2019. The project currently has an infrequent release cadence, with the latest update several years ago, and is considered to be in a maintenance state.
pip install html-testrunnerVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to set up a basic `unittest.TestCase` suite and run it using `HtmlTestRunner.HTMLTestRunner` to generate an HTML report. The report will be saved in a 'reports' directory, which is created if it doesn't exist.
Consider using community-maintained forks like `HtmlTestRunner-Ably` (pip install HtmlTestRunner-Ably) or `HTMLTestRunner-rv` (pip install HTMLTestRunner-rv) if you are encountering issues with newer Python versions, as these forks often include fixes and modernizations not present in the original package.
For projects requiring active development, broader compatibility, or more modern features and styling, explore alternative or forked HTML test runners such as `HTMLTestRunner-rv` or `pytest-html` (for pytest users).
Always verify the exact package name (`pip install html-testrunner`) and check the PyPI project page for the specific version and maintainer you intend to use.
Ensure the package is installed: `pip install html-testrunner`. Verify the import statement is `from HtmlTestRunner import HTMLTestRunner`. If using an IDE, ensure the correct Python interpreter is selected for the project. For older versions, direct download and placement of the `HTMLTestRunner.py` file was common, which can cause module resolution issues if not handled properly.
Upgrade to the officially maintained `html-testrunner` package (version 1.2.1) via `pip install --upgrade html-testrunner` which should contain Python 3 compatible code. If using a standalone `HTMLTestRunner.py` file, ensure it's a Python 3 compatible version or switch to the pip-installed package. Alternatively, use a modern fork like `HTMLTestRunner-rv` or `HtmlTestRunner-Ably`.
Check that the `if __name__ == '__main__':` block and the code within it are correctly indented and will execute. Ensure the `output` directory specified in `HTMLTestRunner(output=...)` exists and the Python process has write permissions to it. Add `print()` statements to trace execution flow and verify that `runner.run(suite)` is being called.
No dependency data recorded yet.