Skip to content
Discussion options

You must be logged in to vote

In case you did not find a solution yet.

The problem might be, that the override override_jwt_dependency has one argument fake_jwt. This should be the same as adding it this argument in the me function, resulting in an expected query parameter fake_jwt. (.../api/me?fake_jwt=<some value>).

Using a function without any arguments as override however should work:

# conftest.py
...
@pytest.fixture()
def app_with_db_and_jwt(app_with_db):
    def override_jwt_dependency():
        return TokenData(id=1, email="[email protected]")
    app_with_db.dependency_overrides[validate_access_token] = override_jwt_dependency
    yield app_with_db
    app_with_db.dependency_overrides.pop(validate_a…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #635 on August 30, 2025 15:18.