Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachDecorator ¶
func AttachDecorator[K comparable](tb testing.TB, key K, decorator func(context.Context) context.Context)
AttachDecorator applies decorator to the test-scoped context once for key. Reusing the same key is a no-op. If the test context does not exist yet, AttachDecorator creates it with the default timeout. Call For with WithTimeout first when using a custom timeout.
func DefaultTimeout ¶
DefaultTimeout returns the effective default timeout for test-scoped contexts.
func For ¶
For returns the test-scoped context for tb. The context is canceled when the test ends or when the configured test timeout expires.
The first call creates the per-test context and fixes its timeout. Later calls return the same context, but an explicit different timeout fails instead of being silently ignored.