From fee02ea69ce8f1a02712ee1ab16473a868dcb256 Mon Sep 17 00:00:00 2001 From: DanCardin Date: Wed, 31 Aug 2022 20:50:54 -0400 Subject: [PATCH] Perform `in` check against cached fixturedefs --- CHANGELOG.rst | 4 ++++ pytest_asyncio/plugin.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8de226c4..0b0f2205 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,10 @@ Changelog ========= +UNRELEASED +================= +- Fixed an issue which prevented fixture setup from being cached. `#404 `_ + 0.19.0 (22-07-13) ================= - BREAKING: The default ``asyncio_mode`` is now *strict*. `#293 `_ diff --git a/pytest_asyncio/plugin.py b/pytest_asyncio/plugin.py index dd6a782b..ce172f5f 100644 --- a/pytest_asyncio/plugin.py +++ b/pytest_asyncio/plugin.py @@ -203,7 +203,7 @@ def _preprocess_async_fixtures(config: Config, holder: Set[FixtureDef]) -> None: fixturemanager = config.pluginmanager.get_plugin("funcmanage") for fixtures in fixturemanager._arg2fixturedefs.values(): for fixturedef in fixtures: - if fixturedef is holder: + if fixturedef in holder: continue func = fixturedef.func if not _is_coroutine_or_asyncgen(func):