From bbc45c63d17cad248a0d28c950cb7b3cf86d11e4 Mon Sep 17 00:00:00 2001 From: Joshua Carp Date: Sat, 14 Oct 2017 23:39:41 -0400 Subject: [PATCH] Deprecate pytest yield fixtures. https://docs.pytest.org/en/latest/yieldfixture.html --- {{cookiecutter.app_name}}/tests/conftest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.app_name}}/tests/conftest.py b/{{cookiecutter.app_name}}/tests/conftest.py index 7e3d272..ab709ff 100644 --- a/{{cookiecutter.app_name}}/tests/conftest.py +++ b/{{cookiecutter.app_name}}/tests/conftest.py @@ -11,7 +11,7 @@ from {{cookiecutter.app_name}}.settings import TestConfig from .factories import UserFactory -@pytest.yield_fixture(scope='function') +@pytest.fixture def app(): """An application for the tests.""" _app = create_app(TestConfig) @@ -23,13 +23,13 @@ def app(): ctx.pop() -@pytest.fixture(scope='function') +@pytest.fixture def testapp(app): """A Webtest app.""" return TestApp(app) -@pytest.yield_fixture(scope='function') +@pytest.fixture def db(app): """A database for the tests.""" _db.app = app