-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add munit cats-effect integration #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! I left a couple very minor comments. Feel free to merge as-is though.
): FunFixture[T] = | ||
fromResource( | ||
resource, | ||
(_, _) => IO.pure(()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note you can do IO.unit
instead of IO.pure(())
abstract class CatsEffectSuite extends FunSuite { | ||
|
||
def munitContextShift: ContextShift[IO] = | ||
IO.contextShift(munitExecutionContext) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
munitExecutionContext
is parasitic -- I've seen issues when running async tests as a result (the parZip
tests in FS2 specifically, where the parasitic nature breaks concurrency, which the test relies on).
I guess the solution can be telling folks to override munitExecutionContext
if they need true concurrency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be a good comment/remark to add to the documentation for sure!
I have nothing to add since I know very little about fs2 😉 |
Moved and improved the logic from scalameta/munit#134
Let me know what you think :)