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

Allow test classes with constructor parameters #982

Merged
merged 2 commits into from
Oct 27, 2020

Conversation

RobinJDCox
Copy link
Contributor

This PR removes a filter from the test discovery that ignores classes that have parameters in their constructor. I think this is problematic as it is perfectly valid for tests to have constructor parameters depending on the test framework, and so this should be a decision made by the testing framework rather than the build tool.

Here's an example where I encountered this issue recently: disneystreaming/weaver-test#113. After running these tests again with the changes made in this PR the example tests shown in that issue now pass.

I've attempted to verify that these changes are compatible with other test frameworks. With some fairly basic examples uTest and Scalatest both seem to continue to work as expected. I'd be happy to verify the changes against other test frameworks if you have any further suggestions.

Thanks

Copy link
Member

@lefou lefou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@lefou lefou merged commit cc0d0fc into com-lihaoyi:master Oct 27, 2020
@lefou lefou added this to the after 0.8.0 milestone Oct 27, 2020
@lefou
Copy link
Member

lefou commented Oct 27, 2020

Thank you!

@RobinJDCox RobinJDCox deleted the allow-constructor-params-tests branch October 28, 2020 13:10
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.

None yet

2 participants