Skip to content

test: add unit tests for _plotly_utils string helpers - #5669

Merged
emilykl merged 1 commit into
plotly:mainfrom
DogInfantry:test/plotly-utils-string-helpers
Jul 30, 2026
Merged

test: add unit tests for _plotly_utils string helpers#5669
emilykl merged 1 commit into
plotly:mainfrom
DogInfantry:test/plotly-utils-string-helpers

Conversation

@DogInfantry

Copy link
Copy Markdown
Contributor

Adds unit coverage for pure string/utility helpers in _plotly_utils/utils.py that currently have no tests. These functions back the "did you mean" suggestions and path parsing used in validator error messages.

Covered:

  • levenshtein
  • find_closest_string
  • split_multichar
  • split_string_positions
  • display_string_positions
  • chomp_empty_strings
  • is_skipped_key
  • _natural_sort_strings

Notes:

Verification: pytest tests/test_plotly_utils/test_utils.py -> 34 passed; ruff check and ruff format --check clean.

Cover the previously untested pure helpers in _plotly_utils/utils.py:
levenshtein, find_closest_string, split_multichar, split_string_positions,
display_string_positions, chomp_empty_strings, is_skipped_key, and
_natural_sort_strings. Expected values come from the function docstrings and
were confirmed against actual output. Follows the pattern of the recent
utility test PRs.
@DogInfantry

Copy link
Copy Markdown
Contributor Author

Hi maintainers, friendly ping on this one. The Python CI workflows are sitting at action_required (the first-time-contributor approval gate), so the test suite hasn't run yet. Whenever someone has a moment, could a maintainer approve and run the workflows? Happy to rebase or address any feedback. Thanks!

@camdecoster

Copy link
Copy Markdown
Contributor

Thanks for the PR! Our team will review and follow up.

@emilykl emilykl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @DogInfantry for the contribution! Looks good.

@emilykl
emilykl merged commit 094c3dc into plotly:main Jul 30, 2026
24 checks passed
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