Skip to content

Fix test isolation bug in test_startup_error_from_plugin_is_click_exception#2627

Merged
simonw merged 2 commits intomainfrom
claude/fix-plugin-test-isolation-C06ua
Jan 22, 2026
Merged

Fix test isolation bug in test_startup_error_from_plugin_is_click_exception#2627
simonw merged 2 commits intomainfrom
claude/fix-plugin-test-isolation-C06ua

Conversation

@simonw
Copy link
Owner

@simonw simonw commented Jan 22, 2026

The test creates a plugin that raises StartupError("boom") and registers it in the global plugin manager. Without cleanup, this plugin leaks to subsequent tests, causing test_setting_boolean_validation_false_values to fail with "Error: boom" instead of "Forbidden".

Add try/finally block to ensure the plugin is unregistered after the test completes.

…eption

The test creates a plugin that raises StartupError("boom") and registers it
in the global plugin manager (pm). Without cleanup, this plugin leaks to
subsequent tests, causing test_setting_boolean_validation_false_values to
fail with "Error: boom" instead of "Forbidden".

Add try/finally block to ensure the plugin is unregistered after the test
completes, following the established cleanup pattern used elsewhere in
the test suite.
@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.23%. Comparing base (6fede23) to head (db56fd9).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2627      +/-   ##
==========================================
- Coverage   90.29%   90.23%   -0.06%     
==========================================
  Files          51       51              
  Lines        7531     7537       +6     
==========================================
+ Hits         6800     6801       +1     
- Misses        731      736       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Apply blacken-docs formatting to code example that exceeded
the 60 character line limit.
@simonw simonw merged commit b0436fa into main Jan 22, 2026
26 of 39 checks passed
@simonw simonw deleted the claude/fix-plugin-test-isolation-C06ua branch January 22, 2026 15:03
simonw added a commit that referenced this pull request Jan 28, 2026
…eption (#2627)

* Fix test isolation bug in test_startup_error_from_plugin_is_click_exception

The test creates a plugin that raises StartupError("boom") and registers it
in the global plugin manager (pm). Without cleanup, this plugin leaks to
subsequent tests, causing test_setting_boolean_validation_false_values to
fail with "Error: boom" instead of "Forbidden".

Add try/finally block to ensure the plugin is unregistered after the test
completes, following the established cleanup pattern used elsewhere in
the test suite.

* Fix blacken-docs formatting in plugin_hooks.rst

Apply blacken-docs formatting to code example that exceeded
the 60 character line limit.

---------

Co-authored-by: Claude <noreply@anthropic.com>
simonw added a commit that referenced this pull request Jan 29, 2026
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.

2 participants