diff --git a/tests/hosting_core/_oauth/test_oauth_flow.py b/tests/hosting_core/_oauth/test_oauth_flow.py index f92c09b5..8e9681a1 100644 --- a/tests/hosting_core/_oauth/test_oauth_flow.py +++ b/tests/hosting_core/_oauth/test_oauth_flow.py @@ -25,7 +25,7 @@ FLOW_DATA = TEST_FLOW_DATA() -def testing_Activity( +def create_testing_Activity( mocker, type=ActivityTypes.message, name="a", @@ -53,7 +53,7 @@ def testing_Activity( class TestUtils(FlowStateFixtures): def setup_method(self): self.UserTokenClient = mock_UserTokenClient - self.Activity = testing_Activity + self.Activity = create_testing_Activity @pytest.fixture def user_token_client(self, mocker): diff --git a/tests/hosting_core/app/_oauth/_common.py b/tests/hosting_core/app/_oauth/_common.py index 81247cb8..1a0dc422 100644 --- a/tests/hosting_core/app/_oauth/_common.py +++ b/tests/hosting_core/app/_oauth/_common.py @@ -8,7 +8,7 @@ DEFAULTS = TEST_DEFAULTS() -def testing_Activity(): +def create_testing_Activity(): return Activity( type=ActivityTypes.message, channel_id=DEFAULTS.channel_id, @@ -17,7 +17,7 @@ def testing_Activity(): ) -def testing_TurnContext( +def create_testing_TurnContext( mocker, channel_id=DEFAULTS.channel_id, user_id=DEFAULTS.user_id, @@ -45,7 +45,7 @@ def testing_TurnContext( return turn_context -def testing_TurnContext_magic( +def create_testing_TurnContext_magic( mocker, channel_id=DEFAULTS.channel_id, user_id=DEFAULTS.user_id, diff --git a/tests/hosting_core/app/_oauth/_handlers/test_agentic_user_authorization.py b/tests/hosting_core/app/_oauth/_handlers/test_agentic_user_authorization.py index 87f8ba27..260f0c87 100644 --- a/tests/hosting_core/app/_oauth/_handlers/test_agentic_user_authorization.py +++ b/tests/hosting_core/app/_oauth/_handlers/test_agentic_user_authorization.py @@ -18,7 +18,7 @@ from tests._common.mock_utils import mock_class from .._common import ( - testing_TurnContext_magic, + create_testing_TurnContext_magic, ) DEFAULTS = TEST_DEFAULTS() @@ -27,7 +27,7 @@ class TestUtils: def setup_method(self, mocker): - self.TurnContext = testing_TurnContext_magic + self.TurnContext = create_testing_TurnContext_magic @pytest.fixture def storage(self): @@ -78,7 +78,6 @@ def mock_class_provider( class TestAgenticUserAuthorization(TestUtils): - @pytest.mark.asyncio async def test_get_agentic_instance_token_not_agentic( self, mocker, non_agentic_role, agentic_auth diff --git a/tests/hosting_core/app/_oauth/_handlers/test_user_authorization.py b/tests/hosting_core/app/_oauth/_handlers/test_user_authorization.py index f2764125..cc3dd7bd 100644 --- a/tests/hosting_core/app/_oauth/_handlers/test_user_authorization.py +++ b/tests/hosting_core/app/_oauth/_handlers/test_user_authorization.py @@ -49,7 +49,7 @@ async def _handle_flow_response(self, *args, **kwargs): pass -def testing_TurnContext( +def create_testing_TurnContext( mocker, channel_id=DEFAULTS.channel_id, user_id=DEFAULTS.user_id, @@ -94,7 +94,7 @@ def mock_provider(mocker, exchange_token=None): class TestEnv(FlowStateFixtures): def setup_method(self): - self.TurnContext = testing_TurnContext + self.TurnContext = create_testing_TurnContext @pytest.fixture def context(self, mocker): diff --git a/tests/hosting_core/app/_oauth/test_authorization.py b/tests/hosting_core/app/_oauth/test_authorization.py index d3905fdf..8b0d99e6 100644 --- a/tests/hosting_core/app/_oauth/test_authorization.py +++ b/tests/hosting_core/app/_oauth/test_authorization.py @@ -44,7 +44,7 @@ mock_class_Authorization, ) -from ._common import testing_TurnContext, testing_Activity +from ._common import create_testing_TurnContext, create_testing_Activity DEFAULTS = TEST_DEFAULTS() FLOW_DATA = TEST_FLOW_DATA() @@ -109,7 +109,7 @@ def copy_sign_in_state(state: _SignInState) -> _SignInState: class TestEnv(FlowStateFixtures): def setup_method(self): - self.TurnContext = testing_TurnContext + self.TurnContext = create_testing_TurnContext self.UserTokenClient = mock_UserTokenClient self.ConnectionManager = lambda mocker: MockConnectionManager() @@ -119,7 +119,7 @@ def context(self, mocker): @pytest.fixture def activity(self): - return testing_Activity() + return create_testing_Activity() @pytest.fixture def baseline_storage(self): @@ -191,7 +191,6 @@ def test_sign_in_state_key(self, mocker, connection_manager, storage): class TestAuthorizationUsage(TestEnv): - @pytest.mark.asyncio @pytest.mark.parametrize( "initial_turn_state, final_turn_state, initial_sign_in_state, auth_handler_id",