Skip to content
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

go-test-current-test doesn't work if the current test is part of a testify test suite #67

Closed
jguenther opened this issue Apr 16, 2018 · 0 comments

Comments

@jguenther
Copy link

If point is in a test that's part of a testify test suite, go-test-current-test fails with an error:

$ go test -m TestSomeTestInASuite\$ .
flag provided but not defined: -m

After playing around with it, it seems to work just fine if I change -m to -testify.m:

$ go test -testify.m TestSomeTestInASuite\$ .

Although this testify issue suggests that the correct command would be:

$ go test -run TestThatCallsSuiteRun -testify.m TestSomeTestInASuite\$ .

Where TestThatCallsSuiteRun is the function that calls suite.Run() with your test suite struct type.

But it seems like at least for go 1.10 and the latest version of testify, it works with just -testify.m without -run.

nerikj pushed a commit to nerikj/gotest.el that referenced this issue Jan 10, 2020
Originally this was just `-m`, but was namespaced to `-testify.m` 2 years
ago, in stretchr/testify@bfe70f3

This commit updates the suite aware flag to use the namespaced version. This
will be a breaking change if you're using a testify from > 2 years ago, but
on the flip side, it's currently broken if you're using something more
recent than that!
nlamirault added a commit that referenced this issue Feb 21, 2021
resolves #67 -- use namespaced testify flag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant