You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we recognize that decorators named @asynccontextmanager and @fixture (including attributes and calls, so e.g. @pytest.fixture(...) also works) mean the function isn't really an async generator:
I think we should make this list extensible, similar to our existing no-checkpoint-warning-decorators list config. Could be called something like not-a-generator-decorators.
The motivation is that you might well want to use the nice syntax of yield, which is safe if wrapped in something like groove-x/trio-util#9 (see python-trio/trio#638 for design discussion). I'm inclined to see if we can upstream something similar into Trio and AnyIO, but even then there will be people on older versions of the libraries (or asyncio!) for years to come and so even if we add to the baseline list later having a config option seems useful.
The text was updated successfully, but these errors were encountered:
Currently, we recognize that decorators named
@asynccontextmanager
and@fixture
(including attributes and calls, so e.g.@pytest.fixture(...)
also works) mean the function isn't really an async generator:flake8-async/flake8_async/visitors/visitors.py
Lines 415 to 418 in bae7ab7
I think we should make this list extensible, similar to our existing
no-checkpoint-warning-decorators
list config. Could be called something likenot-a-generator-decorators
.The motivation is that you might well want to use the nice syntax of
yield
, which is safe if wrapped in something like groove-x/trio-util#9 (see python-trio/trio#638 for design discussion). I'm inclined to see if we can upstream something similar into Trio and AnyIO, but even then there will be people on older versions of the libraries (or asyncio!) for years to come and so even if we add to the baseline list later having a config option seems useful.The text was updated successfully, but these errors were encountered: