Skip to content

Unregister Token extensions left by the invalid retokenize test - #14082

Open
fanjiahe wants to merge 1 commit into
explosion:masterfrom
fanjiahe:fix/retokenize-extension-cleanup
Open

fanjiahe wants to merge 1 commit into
explosion:masterfrom
fanjiahe:fix/retokenize-extension-cleanup

Conversation

@fanjiahe

Copy link
Copy Markdown

Summary

Fixes #14081.

test_doc_retokenize_merge_extension_attrs_invalid registers Token extensions a and b, then expects ValueError. Those extensions stay on Underscore.token_extensions because nothing unregisters them. Later tests in the same process, including language pipe tests under xdist, then see the leftover getter and method.

The test now removes both extensions in a finally and checks they are gone.

AI assistance was used to inspect the test and draft this change.

Test plan

  • Ran the four parameter cases ({"a": "x"}, {"b": "x"}, {"c": "x"}, [1]) against spaCy 3.8.18. Each still raises ValueError, and Token.has_extension is false for both names afterwards.

…est.

The test registers global Token extensions and then raises, so later tests still see the getter and method.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 08:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
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.

[bug]: test_doc_retokenize_merge_extension_attrs_invalid causes downstream tests to fail

2 participants