Closed yuuuxt closed 4 years ago
Thanks for the report @yuuuxt . You're right, I should be able to reproduce this issue :). TBH. I'm quite swamped at the moment. I'll will not have time to look at this issues until in about two weeks.
Since ipytest rewrites the assertions of the notebook independently from pytest, you can safely disable global global assertion rewriting:
import ipytest
ipytest.autoconfig(addopts=['-q', '--assert=plain'])
This should solve the warning. Could you give it a try and see whether anything else breaks? Thanks :)
I tried with a simple test case and it works fine. However, I may not encounter more complex cases.
Thanks for solving this! :)
Thanks for the feedback. Feel free to re-open if the issue pops up again.
Too bad that with this configuration the fancy coloring is gone, would be cool to find an alternative solution.
Sorry I spoke too soon: ipytest.autoconfig(addopts=['-q', '--assert=plain', '--color=yes'])
works 🎉
If I run
import dash
before running any tests, the following warning will appear:PytestAssertRewriteWarning: Module already imported so cannot be rewritten: dash
I assume this is enough to reproduce this issue. Feel free to contact if you need more information :)