You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Make BeforeEvery/AfterEvery hooks check test class before asserting custom executor
The BeforeEvery(Test) and AfterEvery(Test) hooks are GLOBAL - they run for ALL tests in the assembly.
When SetHookExecutorWithStaticHooksTests was added, these global hooks would run for every test,
including tests like AfterTestAttributeTests that don't have CustomHookExecutor set, causing assertions to fail.
The fix: Check context.TestDetails.ClassType before running assertions in the global hooks,
so they only assert custom executor behavior for tests in SetHookExecutorWithStaticHooksTests.
This demonstrates that static hooks DO respect CustomHookExecutor when it's set on the TestContext.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments