-
Notifications
You must be signed in to change notification settings - Fork 17
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
Difficult to call t.Parallel with td.T #149
Comments
Hi, good proposals. Let me review your PR and think about it after some rest and I come back to you. Thanks! |
#150 just reviewed. After some thought, I am not sure |
Reasonable. That was just something that could be possible once Parallel was supported but obviously an optional feature. If you feel that the confusion it would cause is more than its value, we can omit it. |
testdeep encourages wrapping the
*testing.T
into a*td.T
. Thisunfortunately makes it difficult to call
t.Parallel()
on the*testing.T
once hidden behind the*td.T
.It's possible to call
t.Parallel()
on the*testing.T
with someupcasting on the wrapped
testing.TB
.If you're open to addressing this within testdeep, there are two
straightforward options:
Add a top-level
func Parallel(*td.T)
that does the same as above.Usage would then be,
Add a
Parallel()
method ontd.T
. Usage:The latter is closest to what people already do with
*testing.T
so itmight be preferable.
Separately, either choice opens room for a setting in testdeep to
always call
t.Parallel()
for subtests invoked with a specific*td.T.Run
. For example,But that can be a separate discussion.
The text was updated successfully, but these errors were encountered: