Skip to content

test: clean up string formatting TODO in test_parent_err - #496

Merged
isaacbrodsky merged 3 commits into
uber:masterfrom
dyrpsf:test-formatting-cleanup
Aug 3, 2026
Merged

test: clean up string formatting TODO in test_parent_err#496
isaacbrodsky merged 3 commits into
uber:masterfrom
dyrpsf:test-formatting-cleanup

Conversation

@dyrpsf

@dyrpsf dyrpsf commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Description

This is a quick cleanup PR to resolve a lingering todo comment I noticed while looking through the test suite.

In test_parent_err inside tests/test_lib/test_cells_and_edges.py, there was a comment to revisit the "weird formatting stuff" used to generate the hex error message. I replaced the clunky hex(h3.str_to_int(h)) conversion with a standard, readable Python f-string: f'Invalid parent resolution -1 for cell 0x{h}.'

This makes the test much more idiomatic and removes the TODO without changing any of the underlying test logic.

Maintainers

cc: @dfellis @ajfriend @isaacbrodsky - Just a small housekeeping fix for whenever you have the time to review!

Comment thread tests/test_lib/test_cells_and_edges.py
Co-authored-by: Isaac Brodsky <isaac@isaacbrodsky.com>
@dyrpsf

dyrpsf commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

@isaacbrodsky I've applied your suggestion to remove the 0x prefix! Let me know if you need to re-approve the CI workflows for this new commit, or if it is fully good to merge.

@dyrpsf

dyrpsf commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@isaacbrodsky It looks like the CI tests failed after applying the suggestion! I dug into it, and it turns out the underlying library's exception message actually does include the 0x prefix (which is why the original test was using Python's hex() function). I've added the 0x back to the f-string so the assertion passes again. It should be fully green and ready to go now!

@isaacbrodsky
isaacbrodsky merged commit c86f442 into uber:master Aug 3, 2026
41 checks passed
@dyrpsf
dyrpsf deleted the test-formatting-cleanup branch August 3, 2026 16:05
@dyrpsf

dyrpsf commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Grateful for the merge—thank you! I’m here if any additional changes are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants