Closed jakkdl closed 1 year ago
Added a separate error message when both are available.
But I'm unsure how to handle TRIO103 when both are imported, should bare excepts require that both have been handled in that case?
See the new trio103_both_imported.py
which tests for such cases.
I'm unsure how to handle TRIO103 when both are imported, should bare excepts require that both have been handled in that case?
I think in this case it's safe to just catch anyio.get_cancelled_exc_class()
, because if you're actually running Trio code that will return trio.Cancelled
.
I'm unsure how to handle TRIO103 when both are imported, should bare excepts require that both have been handled in that case?
I think in this case it's safe to just catch
anyio.get_cancelled_exc_class()
, because if you're actually running Trio code that will returntrio.Cancelled
.
If you're running all three async libraries, and anyio's current backend is asyncio
, and in the try:
statement stuff is ran that could either raise trio.Cancelled
or anyio.get_cancelled_exc_class()
, it might bork? But that seems weird enough that I think not raising false alarms is more important.
addressed nitpicks and rebased on top of main to ensure coverage.
Fixes #122
rewrote
critical_except
a bit as I updated it, in large part because I personally failed to read the old version of the code :innocent: Fix #106 for TRIO102 (#109 only fixed TRIO103 & TRIO104) Thanks to #125 it was quite smooth to add a different suggestion for TRIO103 when anyio is the primary library. As I started to write aassert_correct_message
test helper I realized I had pretty bad code duplication, so checking of column, message and args are now all handled inassert_correct_attribute
. Improved howignore_column
is handled in anyio tests. A slew of tests being moved around and modified and stuff so the necessary eval_files are handled with trio/anyio as appropriate. And some additional ones for #106+TRIO102