@@ -684,8 +684,10 @@ async def test_search_with_provider_google_and_phone_one(driver_config_app: Any)
684684 data_json = json .loads (response .data )
685685 assert len (data_json ["users" ]) == 0
686686
687+
687688from tests .utils import get_st_init_args
688689
690+
689691@fixture (scope = "function" )
690692def flask_app ():
691693 app = Flask (__name__ )
@@ -695,9 +697,9 @@ def flask_app():
695697
696698 counter : Dict [str , int ] = {}
697699
698- @app .before_request # type: ignore
700+ @app .before_request # type: ignore
699701 @verify_session (session_required = False )
700- def audit_request (): # type: ignore
702+ def audit_request (): # type: ignore
701703 nonlocal counter
702704
703705 user_id = None
@@ -713,8 +715,8 @@ def audit_request(): # type: ignore
713715 if request .path != "/stats" :
714716 counter [user_id ] = counter .get (user_id , 0 ) + 1
715717
716- @app .route ("/stats" ) # type: ignore
717- def test_api (): # type: ignore
718+ @app .route ("/stats" ) # type: ignore
719+ def test_api (): # type: ignore
718720 return jsonify (counter )
719721
720722 @app .route ("/login" ) # type: ignore
@@ -723,19 +725,20 @@ def login(): # type: ignore
723725 s = create_new_session (request , user_id , {}, {})
724726 return jsonify ({"user" : s .get_user_id ()})
725727
726- @app .route ("/ping" ) # type: ignore
727- def ping (): # type: ignore
728+ @app .route ("/ping" ) # type: ignore
729+ def ping (): # type: ignore
728730 return jsonify ({"msg" : "pong" })
729731
730- @app .route ("/options-api" , methods = ["OPTIONS" , "GET" ]) # type: ignore
732+ @app .route ("/options-api" , methods = ["OPTIONS" , "GET" ]) # type: ignore
731733 @verify_session ()
732- def options_api (): # type: ignore
734+ def options_api (): # type: ignore
733735 return jsonify ({"msg" : "Shouldn't come here" })
734736
735737 return app
736738
739+
737740def test_verify_session_with_before_request_with_no_response (flask_app : Any ):
738- init (** {** get_st_init_args ([session .init (get_token_transfer_method = lambda * _ : "cookie" )]), "framework" : "flask" }) # type: ignore
741+ init (** {** get_st_init_args ([session .init (get_token_transfer_method = lambda * _ : "cookie" )]), "framework" : "flask" }) # type: ignore
739742 start_st ()
740743
741744 client = flask_app .test_client ()
0 commit comments