Path 1: 389 calls (0.73)

1def push(self) -> None:
2        # Before we push the request context we have to ensure that there
3        # is an application context.
4        app_ctx = _cv_app.get(None)
5
6        if app_ctx is None or app_ctx.app is not self.app:
7            app_ctx = self.app.app_context()
8            app_ctx.push()
9        else:
10            app_ctx = None
11
12        self._cv_tokens.append((_cv_request.set(self), app_ctx))
13
14        # Open the session at the moment that the request context is available.
15        # This allows a custom open_session method to use the request context.
16        # Only open a new session if this is the first time the request was
17        # pushed, otherwise stream_with_context loses the session.
18        if self.session is None:
19            session_interface = self.app.session_interface
20            self.session = session_interface.open_session(self.app, self.request)
21
22            if self.session is None:
23                self.session = session_interface.make_null_session(self.app)
24
25        # Match the request URL after loading the session, so that the
26        # session is available in custom URL converters.
27        if self.url_adapter is not None:
28            self.match_request()
            

Path 2: 81 calls (0.15)

1def push(self) -> None:
2        # Before we push the request context we have to ensure that there
3        # is an application context.
4        app_ctx = _cv_app.get(None)
5
6        if app_ctx is None or app_ctx.app is not self.app:
7            app_ctx = self.app.app_context()
8            app_ctx.push()
9        else:
10            app_ctx = None
11
12        self._cv_tokens.append((_cv_request.set(self), app_ctx))
13
14        # Open the session at the moment that the request context is available.
15        # This allows a custom open_session method to use the request context.
16        # Only open a new session if this is the first time the request was
17        # pushed, otherwise stream_with_context loses the session.
18        if self.session is None:
19            session_interface = self.app.session_interface
20            self.session = session_interface.open_session(self.app, self.request)
21
22            if self.session is None:
23                self.session = session_interface.make_null_session(self.app)
24
25        # Match the request URL after loading the session, so that the
26        # session is available in custom URL converters.
27        if self.url_adapter is not None:
28            self.match_request()
            

Path 3: 30 calls (0.06)

1def push(self) -> None:
2        # Before we push the request context we have to ensure that there
3        # is an application context.
4        app_ctx = _cv_app.get(None)
5
6        if app_ctx is None or app_ctx.app is not self.app:
7            app_ctx = self.app.app_context()
8            app_ctx.push()
9        else:
10            app_ctx = None
11
12        self._cv_tokens.append((_cv_request.set(self), app_ctx))
13
14        # Open the session at the moment that the request context is available.
15        # This allows a custom open_session method to use the request context.
16        # Only open a new session if this is the first time the request was
17        # pushed, otherwise stream_with_context loses the session.
18        if self.session is None:
19            session_interface = self.app.session_interface
20            self.session = session_interface.open_session(self.app, self.request)
21
22            if self.session is None:
23                self.session = session_interface.make_null_session(self.app)
24
25        # Match the request URL after loading the session, so that the
26        # session is available in custom URL converters.
27        if self.url_adapter is not None:
28            self.match_request()
            

Path 4: 16 calls (0.03)

1def push(self) -> None:
2        # Before we push the request context we have to ensure that there
3        # is an application context.
4        app_ctx = _cv_app.get(None)
5
6        if app_ctx is None or app_ctx.app is not self.app:
7            app_ctx = self.app.app_context()
8            app_ctx.push()
9        else:
10            app_ctx = None
11
12        self._cv_tokens.append((_cv_request.set(self), app_ctx))
13
14        # Open the session at the moment that the request context is available.
15        # This allows a custom open_session method to use the request context.
16        # Only open a new session if this is the first time the request was
17        # pushed, otherwise stream_with_context loses the session.
18        if self.session is None:
19            session_interface = self.app.session_interface
20            self.session = session_interface.open_session(self.app, self.request)
21
22            if self.session is None:
23                self.session = session_interface.make_null_session(self.app)
24
25        # Match the request URL after loading the session, so that the
26        # session is available in custom URL converters.
27        if self.url_adapter is not None:
28            self.match_request()
            

Path 5: 16 calls (0.03)

1def push(self) -> None:
2        # Before we push the request context we have to ensure that there
3        # is an application context.
4        app_ctx = _cv_app.get(None)
5
6        if app_ctx is None or app_ctx.app is not self.app:
7            app_ctx = self.app.app_context()
8            app_ctx.push()
9        else:
10            app_ctx = None
11
12        self._cv_tokens.append((_cv_request.set(self), app_ctx))
13
14        # Open the session at the moment that the request context is available.
15        # This allows a custom open_session method to use the request context.
16        # Only open a new session if this is the first time the request was
17        # pushed, otherwise stream_with_context loses the session.
18        if self.session is None:
19            session_interface = self.app.session_interface
20            self.session = session_interface.open_session(self.app, self.request)
21
22            if self.session is None:
23                self.session = session_interface.make_null_session(self.app)
24
25        # Match the request URL after loading the session, so that the
26        # session is available in custom URL converters.
27        if self.url_adapter is not None:
28            self.match_request()
            

Path 6: 1 calls (0.0)

SessionError (1)

1def push(self) -> None:
2        # Before we push the request context we have to ensure that there
3        # is an application context.
4        app_ctx = _cv_app.get(None)
5
6        if app_ctx is None or app_ctx.app is not self.app:
7            app_ctx = self.app.app_context()
8            app_ctx.push()
9        else:
10            app_ctx = None
11
12        self._cv_tokens.append((_cv_request.set(self), app_ctx))
13
14        # Open the session at the moment that the request context is available.
15        # This allows a custom open_session method to use the request context.
16        # Only open a new session if this is the first time the request was
17        # pushed, otherwise stream_with_context loses the session.
18        if self.session is None:
19            session_interface = self.app.session_interface
20            self.session = session_interface.open_session(self.app, self.request)
21
22            if self.session is None:
23                self.session = session_interface.make_null_session(self.app)
24
25        # Match the request URL after loading the session, so that the
26        # session is available in custom URL converters.
27        if self.url_adapter is not None:
28            self.match_request()
            

Path 7: 1 calls (0.0)

1def push(self) -> None:
2        # Before we push the request context we have to ensure that there
3        # is an application context.
4        app_ctx = _cv_app.get(None)
5
6        if app_ctx is None or app_ctx.app is not self.app:
7            app_ctx = self.app.app_context()
8            app_ctx.push()
9        else:
10            app_ctx = None
11
12        self._cv_tokens.append((_cv_request.set(self), app_ctx))
13
14        # Open the session at the moment that the request context is available.
15        # This allows a custom open_session method to use the request context.
16        # Only open a new session if this is the first time the request was
17        # pushed, otherwise stream_with_context loses the session.
18        if self.session is None:
19            session_interface = self.app.session_interface
20            self.session = session_interface.open_session(self.app, self.request)
21
22            if self.session is None:
23                self.session = session_interface.make_null_session(self.app)
24
25        # Match the request URL after loading the session, so that the
26        # session is available in custom URL converters.
27        if self.url_adapter is not None:
28            self.match_request()