-
Notifications
You must be signed in to change notification settings - Fork 171
Description
Summary
The PyPI package for html-testRunner contains outdated code that causes AttributeError: '_count_relevant_tb_levels' on newer Python versions, even though this issue has been fixed in the GitHub repository.
Problem
When installing html-testRunner via pip/uv, users still encounter the following error:
AttributeError: 'HtmlTestResult' object has no attribute '_count_relevant_tb_levels'. Did you mean: '_is_relevant_tb_level'?
This error occurs in the _exc_info_to_string method of the HtmlTestResult class in result.py, specifically at:
pythonlength = self._count_relevant_tb_levels(tb)
msg_lines = traceback.format_exception(exctype, value, tb, length)
Expected Behavior
The installed package should contain the latest fixes from the repository where this compatibility issue has been resolved.
Current Workaround
Users must manually edit the installed package files:
Locate the installed package: python -c "import HtmlTestRunner; print(HtmlTestRunner.file)"
Edit result.py in the package directory
Replace the problematic code with:
pythonif exctype is test.failureException:
# Skip assert*() traceback levels
msg_lines = traceback.format_exception(exctype, value, tb)
Environment
Python Version: 3.13.x (also affects other recent Python versions)
Package Installation: pip install html-testRunner or uv add html-testRunner
Operating System: Windows (likely affects all platforms)
Steps to Reproduce
Install html-testRunner from PyPI: pip install html-testRunner
Run any test that fails with assertion error
Observe the AttributeError: '_count_relevant_tb_levels' error
Suggested Solution
Please publish an updated version to PyPI that includes the latest fixes from the GitHub repository. The current PyPI version appears to be outdated and doesn't reflect recent compatibility improvements.
Impact
This issue affects all users trying to use html-testRunner with recent Python versions, forcing them to either:
Manually patch the installed package (not sustainable)
Downgrade Python version
Switch to alternative testing frameworks
Additional Context
This appears to be a common issue as evidenced by multiple users encountering the same error. The fix exists in the codebase but hasn't been distributed through the standard package installation channels.
Request: Could the maintainers please:
Verify the current PyPI version matches the latest repository code
Publish an updated version that includes recent compatibility fixes
Consider setting up automated PyPI releases when repository changes are made
Thank you for maintaining this useful testing tool!