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

Prevent test methods incorrectly defined as Kotlin top-level functions from being considered for test execution #325

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

mannodermaus
Copy link
Owner

@mannodermaus mannodermaus commented Apr 11, 2024

This won't work, as JUnit 5 doesn't actually run these methods. However, if a runner is created for the class, then there is a mismatch between Android's expectations and JUnit 5's deliverables. This messes up Android's internal test counting, causing issues like "Expected N+1 tests, received N".

This resolves #316 and may be a first indicator towards solving #298.

…s from being considered for test execution

This won't work, as JUnit 5 doesn't actually run these methods. However, if a runner is created for the class,
then there is a mismatch between Android's expectations and JUnit 5's deliverables.
This messes up Android's internal test counting, causing issues like "Expected N+1 tests, received N"
@mannodermaus mannodermaus self-assigned this Apr 11, 2024
@mannodermaus mannodermaus merged commit be10b22 into main Apr 11, 2024
3 checks passed
@mannodermaus mannodermaus deleted the fix/top-level-function-detection branch April 11, 2024 14:21
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

Successfully merging this pull request may close these issues.

"Expected N+1 tests, received N" caused by fun with @TestTemplate
1 participant