Repository navigation
Allow simple stub helpers in around hooks - #48
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
simple_stubandsimple_stub_any_instance_ofavailable insidearound_testandaround_suiteSimpleStubDSLoperations from lifecycle state owned by a per-invocationHookContextTeardownErrorAggregatorRunnerinto dedicated around-suite and around-test hook chainsUnreleasedrather than the already-published 0.7.0 releaseWhy
Broad method stubs previously needed a fixture whose only purpose was to activate the stub. Hook-scoped helpers let suites express intentionally implicit setup without adding a dummy fixture keyword to every test, while preserving automatic teardown.
Closes #40.
User impact
Users can now call the existing simple stub helpers before
test.runorsuite.run. Stubs remain active for that hook invocation and restore any outer hook, fixture, or suite-fixture stub when the scope exits. If the primary operation and cleanup both fail, both errors remain visible in the report.Internally, lifecycle operations no longer receive a shared mutable teardown-error array. Each completed fixture or hook scope exposes its own errors through
teardown_errors, and a dedicated aggregator collects those values for reporting. A stub is also reset transactionally if registration with that lifecycle fails. Teardown owners drain their queues before callbacks, so repeated and reentrant teardown calls do not execute cleanup twice or discard previously recorded errors.Validation
RBENV_VERSION=3.3.0 rbs -I sig validatenpm run buildfromdocumentation/git diff --check