Skip to content

Commit

Permalink
🎨 Replace deprecated scope keyword with loop_scope
Browse files Browse the repository at this point in the history
Signed-off-by: ff137 <[email protected]>
  • Loading branch information
ff137 committed Nov 14, 2024
1 parent 36e47ce commit 573c208
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions acapy_agent/multitenant/admin/tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ async def test_wallets_list_query(self):
}
)

@pytest.mark.asyncio(scope="function")
@pytest.mark.asyncio(loop_scope="function")
async def test_wallet_create_tenant_settings(self):
body = {
"wallet_name": "test",
Expand Down Expand Up @@ -796,7 +796,7 @@ async def test_wallet_create_token_x(self):
)
await test_module.wallet_create_token(self.request)

@pytest.mark.asyncio(scope="function")
@pytest.mark.asyncio(loop_scope="function")
async def test_wallet_remove_managed(self):
self.request.has_body = False
self.request.match_info = {"wallet_id": "dummy"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async def asyncSetUp(self):
did_doc_attach=self.did_doc_attach,
)

@pytest.mark.asyncio(scope="function")
@pytest.mark.asyncio(loop_scope="function")
@mock.patch.object(test_module, "DIDXManager")
async def test_called(self, mock_didx_mgr):
mock_didx_mgr.return_value.accept_response = mock.CoroutineMock()
Expand All @@ -89,7 +89,7 @@ async def test_called(self, mock_didx_mgr):
)
assert not responder.messages

@pytest.mark.asyncio(scope="function")
@pytest.mark.asyncio(loop_scope="function")
@mock.patch.object(test_module, "DIDXManager")
async def test_called_auto_ping(self, mock_didx_mgr):
self.ctx.update_settings({"auto_ping_connection": True})
Expand All @@ -107,7 +107,7 @@ async def test_called_auto_ping(self, mock_didx_mgr):
result, _ = messages[0]
assert isinstance(result, Ping)

@pytest.mark.asyncio(scope="function")
@pytest.mark.asyncio(loop_scope="function")
@mock.patch.object(test_module, "DIDXManager")
@mock.patch.object(connection_target, "ConnectionTarget")
async def test_problem_report(self, mock_conn_target, mock_didx_mgr):
Expand Down Expand Up @@ -144,7 +144,7 @@ async def test_problem_report(self, mock_conn_target, mock_didx_mgr):
)
assert target == {"target_list": [mock_conn_target]}

@pytest.mark.asyncio(scope="function")
@pytest.mark.asyncio(loop_scope="function")
@mock.patch.object(test_module, "DIDXManager")
@mock.patch.object(connection_target, "ConnectionTarget")
async def test_problem_report_did_doc(
Expand Down Expand Up @@ -191,7 +191,7 @@ async def test_problem_report_did_doc(
)
assert target == {"target_list": [mock_conn_target]}

@pytest.mark.asyncio(scope="function")
@pytest.mark.asyncio(loop_scope="function")
@mock.patch.object(test_module, "DIDXManager")
@mock.patch.object(connection_target, "ConnectionTarget")
async def test_problem_report_did_doc_no_conn_target(
Expand Down
14 changes: 7 additions & 7 deletions demo/playground/examples/tests/test_mediator_ping_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
logger.info("start testing mediated connections...")


@pytest.fixture(scope="session")
@pytest.fixture(loop_scope="session")
def faber():
"""faber agent fixture."""
logger.info(f"faber = {FABER}")
yield Agent(FABER)


@pytest.fixture(scope="session")
@pytest.fixture(loop_scope="session")
def alice():
"""resolver agent fixture."""
logger.info(f"alice = {ALICE}")
yield Agent(ALICE)


@pytest.fixture(scope="session")
@pytest.fixture(loop_scope="session")
def multi_one():
"""resolver agent fixture."""
agent = Agent(MULTI)
Expand All @@ -42,7 +42,7 @@ def multi_one():
yield agent


@pytest.fixture(scope="session")
@pytest.fixture(loop_scope="session")
def mediation_invite():
invitation_url = os.getenv("MEDIATOR_INVITATION_URL")
logger.info(f"MEDIATOR_INVITATION_URL = {invitation_url}")
Expand Down Expand Up @@ -97,23 +97,23 @@ def initialize_mediation(agent: Agent, invitation):
return result


@pytest.fixture(scope="session")
@pytest.fixture(loop_scope="session")
def faber_mediator(faber, mediation_invite):
logger.info("faber_mediator...")
result = initialize_mediation(faber, mediation_invite)
logger.info(f"...faber_mediator = {result}")
yield result


@pytest.fixture(scope="session")
@pytest.fixture(loop_scope="session")
def alice_mediator(alice, mediation_invite):
logger.info("alice_mediator...")
result = initialize_mediation(alice, mediation_invite)
logger.info(f"...alice_mediator = {result}")
yield result


@pytest.fixture(scope="session")
@pytest.fixture(loop_scope="session")
def multi_one_mediator(multi_one, mediation_invite):
logger.info("multi_one_mediator...")
result = initialize_mediation(multi_one, mediation_invite)
Expand Down
14 changes: 7 additions & 7 deletions demo/playground/examples/tests/test_ping_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
from . import ALICE, FABER, MULTI, Agent, logger


@pytest.fixture(scope="session")
@pytest.fixture(loop_scope="session")
def faber():
"""faber agent fixture."""
yield Agent(FABER)


@pytest.fixture(scope="session")
@pytest.fixture(loop_scope="session")
def alice():
"""resolver agent fixture."""
yield Agent(ALICE)


@pytest.fixture(scope="session")
@pytest.fixture(loop_scope="session")
def multi_one():
"""resolver agent fixture."""
agent = Agent(MULTI)
Expand All @@ -35,7 +35,7 @@ def multi_one():
yield agent


@pytest.fixture(scope="session", autouse=True)
@pytest.fixture(loop_scope="session", autouse=True)
def alice_faber_connection(faber, alice):
"""Established connection filter."""
logger.info("faber create invitation to alice")
Expand All @@ -48,7 +48,7 @@ def alice_faber_connection(faber, alice):
return result


@pytest.fixture(scope="session", autouse=True)
@pytest.fixture(loop_scope="session", autouse=True)
def faber_alice_connection(faber, alice):
"""Established connection filter."""
logger.info("alice create invitation to faber")
Expand All @@ -61,7 +61,7 @@ def faber_alice_connection(faber, alice):
return result


@pytest.fixture(scope="session", autouse=True)
@pytest.fixture(loop_scope="session", autouse=True)
def alice_multi_one_connection(multi_one, alice):
"""Established connection filter."""
logger.info("multi_one create invitation to alice")
Expand All @@ -74,7 +74,7 @@ def alice_multi_one_connection(multi_one, alice):
return result


@pytest.fixture(scope="session", autouse=True)
@pytest.fixture(loop_scope="session", autouse=True)
def multi_one_alice_connection(multi_one, alice):
"""Established connection filter."""
logger.info("alice create invitation to multi_one")
Expand Down

0 comments on commit 573c208

Please sign in to comment.