rrrene / credo-proposals

Proposals for Credo, the Elixir code analysis tool with a focus on code consistency and teaching
MIT License
9 stars 0 forks source link

Proposal: Warn on async tests using non-async safe behavior #38

Open devonestes opened 5 years ago

devonestes commented 5 years ago

There are some things that you can do in a test that's run asynchronously that you shouldn't do, like using ExUnit.CaptureIO.capture_io/2 with a device other than :stdio. It would be nice if Credo warned you that you're doing something that is potentially going to result in flaky or incorrect tests.

Sound like something that you'd be interested in having? I can put the PR together if you are!

pdgonzalez872 commented 4 years ago

I like this one!

rrrene commented 4 years ago

I can put the PR together if you are!

I like this one!

I somehow missed this one. Sure thing, this could be amazingly useful!

pdgonzalez872 commented 4 years ago

@devonestes you got the green light!

devonestes commented 4 years ago

For this specific case, we actually re-wrote how capture_io works to make it async safe in 1.10! If there are other ideas, though, then this might still be a good idea.