Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for test_dependency_contextvars (0.21 sec)

  1. tests/test_dependency_contextvars.py

    def get_user():
        request_state = legacy_request_state_context_var.get()
        assert request_state
        return request_state["user"]
    
    
    client = TestClient(app)
    
    
    def test_dependency_contextvars():
        """
        Check that custom middlewares don't affect the contextvar context for dependencies.
    
        The code before yield and the code after yield should be run in the same contextvar
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Feb 17 12:40:12 GMT 2022
    - 1.5K bytes
    - Viewed (0)
Back to top