From fa1b111e63ebd069c027a3b969f679b2de54949f Mon Sep 17 00:00:00 2001 From: jacob Date: Mon, 10 Jun 2019 15:19:22 +0800 Subject: [PATCH] Test: Add clean up in app fixture --- tests/conftest.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 48d307e..f50eca4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,10 +1,15 @@ import pytest from sanic import Sanic -from sanic_openapi import swagger_blueprint + +import sanic_openapi @pytest.fixture() def app(): - app = Sanic('test') - app.blueprint(swagger_blueprint) - return app + app = Sanic("test") + app.blueprint(sanic_openapi.swagger_blueprint) + yield app + + # Clean up + sanic_openapi.swagger.definitions = {} + sanic_openapi.swagger._spec = {}