We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to use pytest-flask-sqlalchemy with fixtures with scope='module'
scope='module'
For example i have creating user:
@pytest.fixture(scope='module') def user(db_session): user = User( username='My user', ) db_session.add(user) db_session.commit() return user
Then when i testing some functions, after changing user, i get Instance not bound to session exception Example of changing user fixture:
Instance not bound to session
@pytest.fixture def user_with_other_username(db_session, user): user.username='Other username' db_session.add(user) db_session.commit() return user
I got this exception when user fixture has module scope. When i set function scope i hasn`t exception
user
The text was updated successfully, but these errors were encountered:
All the fixtures are function-scoped, therefore I don't think it's possible to use them at the module level
Sorry, something went wrong.
No branches or pull requests
I want to use pytest-flask-sqlalchemy with fixtures with
scope='module'
For example i have creating user:
Then when i testing some functions, after changing user, i get
Instance not bound to session
exceptionExample of changing user fixture:
I got this exception when
user
fixture has module scope. When i set function scope i hasn`t exceptionThe text was updated successfully, but these errors were encountered: