failed NO_PATCH NO_PATCH UNSUBMITTED empty_patch(None) · None tool calls · 0 s · Textualize/rich
Clear hashed cache when clearing meta. This fixes #2942. ## Type of changes - [x] Bug fix - [ ] New feature - [ ] Documentation / docstrings - [ ] Tests - [ ] Other ## Checklist - [x] I've run the latest [black](https://github.com/psf/black) with default args on new code. - [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate. - [x] I've added tests for new code. - [x] I accept that @willmcgugan may be pedantic in the code review.
| # | Tool | Arguments | Result |
|---|---|---|---|
| No trace captured. | |||
..........................F
=================================== FAILURES ===================================
____________________ test_clear_meta_and_links_clears_hash _____________________
def test_clear_meta_and_links_clears_hash():
"""Regression test for https://github.com/Textualize/rich/issues/2942."""
style = Style.parse("bold red on black link https://example.org") + Style.on(
click="CLICK"
)
hash(style) # Force hash caching.
assert style._hash is not None
clear_style = style.clear_meta_and_links()
> assert clear_style._hash is None
E AssertionError: assert -620704738251074903 is None
E + where -620704738251074903 = Style(color=Color('red', ColorType.STANDARD, number=1), bgcolor=Color('black', ColorType.STANDARD, number=0), bold=True)._hash
tests/test_style.py:267: AssertionError
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
1 failed, 26 passed in 0.06s