How to exclude a single test *method*

I know you can exclude test classes like this

test {
  exclude "**/MyTest.class"
}

However, I want to exclude only a single method in that test class. Something like this:

test {
  exclude "**/MyTest.class#testMethod"
}

Any way to achieve this behavior?

Unfortunately, no. The includes/excludes here work on file patters so you can only match against an entire class.

Thanks, Mark. Is that kind of feature planned for the future? Looks like the TestFilter class can already do method-grained filtering. Maybe we can simply add exclude to that class?

Hi, I wonder if any improvements have been made to support this case. We have a few large files with many tests and only want to exclude a few tests from each.