From d9ed57e24c09afbf06eb208c6c731ea1b7d206b7 Mon Sep 17 00:00:00 2001 From: Dmitry Dygalo Date: Sat, 26 Dec 2020 12:51:20 +0100 Subject: [PATCH] test: Fix `test_global_body_hook` test --- test/hooks/test_hooks.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/hooks/test_hooks.py b/test/hooks/test_hooks.py index 601851e294..2ab5eff843 100644 --- a/test/hooks/test_hooks.py +++ b/test/hooks/test_hooks.py @@ -5,6 +5,12 @@ from schemathesis.hooks import HookDispatcher, HookScope +@pytest.fixture(autouse=True) +def reset_hooks(): + yield + schemathesis.hooks.unregister_all() + + @pytest.fixture(params=["direct", "named"]) def global_hook(request): if request.param == "direct": @@ -19,9 +25,6 @@ def before_generate_query(context, strategy): def hook(context, strategy): return strategy.filter(lambda x: x["id"].isdigit()) - yield - schemathesis.hooks.unregister_all() - @pytest.fixture def schema(flask_app):