Skip to content
Snippets Groups Projects
Commit 43545fb5 authored by Steven Loria's avatar Steven Loria Committed by GitHub
Browse files

Merge pull request #225 from jmcarp/deprecate-yield-fixtures

Deprecate pytest yield fixtures.
parents bf92a49f bbc45c63
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ from {{cookiecutter.app_name}}.settings import TestConfig ...@@ -11,7 +11,7 @@ from {{cookiecutter.app_name}}.settings import TestConfig
from .factories import UserFactory from .factories import UserFactory
@pytest.yield_fixture(scope='function') @pytest.fixture
def app(): def app():
"""An application for the tests.""" """An application for the tests."""
_app = create_app(TestConfig) _app = create_app(TestConfig)
...@@ -23,13 +23,13 @@ def app(): ...@@ -23,13 +23,13 @@ def app():
ctx.pop() ctx.pop()
@pytest.fixture(scope='function') @pytest.fixture
def testapp(app): def testapp(app):
"""A Webtest app.""" """A Webtest app."""
return TestApp(app) return TestApp(app)
@pytest.yield_fixture(scope='function') @pytest.fixture
def db(app): def db(app):
"""A database for the tests.""" """A database for the tests."""
_db.app = app _db.app = app
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment