Skip to content

Commit b7aef16

Browse files
authored
Make the intent of the example more clear
The `app` argument is no longer needed in the `test_user_model()` once the context of the app is loaded by `app_ctx` fixture, so removing the `app` argument will make the intent of this example more clear. Additionally, `pytest.mark.fixture` is not available in the latest Pytest. I replace it with `pytest.fixture`.
1 parent 2e2bee7 commit b7aef16

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/contexts.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ a context for a specific test.
7878
7979
import pytest
8080
81-
@pytest.mark.fixture
81+
@pytest.fixture
8282
def app_ctx(app):
8383
with app.app_context():
8484
yield
8585
8686
@pytest.mark.usefixtures("app_ctx")
87-
def test_user_model(app):
87+
def test_user_model():
8888
user = User()
8989
db.session.add(user)
9090
db.session.commit()

0 commit comments

Comments
 (0)