Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cookiecutter flask
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Remy Mudingay
Cookiecutter flask
Commits
43545fb5
Commit
43545fb5
authored
7 years ago
by
Steven Loria
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
{{cookiecutter.app_name}}/tests/conftest.py
+3
-3
3 additions, 3 deletions
{{cookiecutter.app_name}}/tests/conftest.py
with
3 additions
and
3 deletions
{{cookiecutter.app_name}}/tests/conftest.py
+
3
−
3
View file @
43545fb5
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment