Skip to content

Commit

Permalink
test: Fix test_global_body_hook test
Browse files Browse the repository at this point in the history
  • Loading branch information
Stranger6667 committed Dec 26, 2020
1 parent e85d4e0 commit d9ed57e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/hooks/test_hooks.py
Expand Up @@ -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":
Expand All @@ -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):
Expand Down

0 comments on commit d9ed57e

Please sign in to comment.