-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: testify.PanicsWithErrorRegex
#1304
Labels
Comments
assert.Panics definitely lacks flexibility in matching the recovered value as PanicTestFunc doesn't receives it. Bad API design 😕 |
mvo5
added a commit
to mvo5/images
that referenced
this issue
Nov 29, 2023
When trying to create enough data for a full pipeline run for osbuild#287 I struggled a bit because it was not clear which items where faulty. This commit adds more context to the errors. Sadly I had to implement `assertPanicsWithErrorRegexp` because of stretchr/testify#1304 I can contribute it upstream but for that it needs some tests around it first :)
mvo5
added a commit
to mvo5/images
that referenced
this issue
Nov 29, 2023
When trying to create enough data for a full pipeline run for osbuild#287 I struggled a bit because it was not clear which items where faulty. This commit adds more context to the errors. Sadly I had to implement `assertPanicsWithErrorRegexp` because of stretchr/testify#1304 I can contribute it upstream but for that it needs some tests around it first :)
mvo5
added a commit
to mvo5/images
that referenced
this issue
Nov 29, 2023
When trying to create enough data for a full pipeline run for osbuild#287 I struggled a bit because it was not clear which items where faulty. This commit adds more context to the errors. Sadly I had to implement `assertPanicsWithErrorRegexp` because of stretchr/testify#1304 I can contribute it upstream but for that it needs some tests around it first :)
mvo5
added a commit
to mvo5/images
that referenced
this issue
Dec 4, 2023
This adds a new internal package with `testify/assert` extensions. It contains the new 'PanicsWithErrorRegexp()` helper that can be removed once upstream stretchr/testify#1304 is fixed (or we contributed this back). It could not be added to `internal/test` as it would have created cyclic dependencies when importing from `pkg/osbuild`.
mvo5
added a commit
to mvo5/images
that referenced
this issue
Dec 4, 2023
When trying to create enough data for a full pipeline run for osbuild#287 I struggled a bit because it was not clear which items where faulty. This commit adds more context to the errors. It uses the new `assertx.PanicsWithErrorRegexp` that is needed because of stretchr/testify#1304 (until fixed or contributed back).
github-merge-queue bot
pushed a commit
to osbuild/images
that referenced
this issue
Dec 4, 2023
This adds a new internal package with `testify/assert` extensions. It contains the new 'PanicsWithErrorRegexp()` helper that can be removed once upstream stretchr/testify#1304 is fixed (or we contributed this back). It could not be added to `internal/test` as it would have created cyclic dependencies when importing from `pkg/osbuild`.
github-merge-queue bot
pushed a commit
to osbuild/images
that referenced
this issue
Dec 4, 2023
When trying to create enough data for a full pipeline run for #287 I struggled a bit because it was not clear which items where faulty. This commit adds more context to the errors. It uses the new `assertx.PanicsWithErrorRegexp` that is needed because of stretchr/testify#1304 (until fixed or contributed back).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Somewhat-related to #323, I'd like to be able to specify a regex (or a anonymous function callback) to verify "conformance" of the expected panic.
Differently to the issue above, I cannot work with the error outside
require.Panics
, since Testify swallows it.The text was updated successfully, but these errors were encountered: