Skip to content

Commit

Permalink
art: Remove unnecessary asyncio pytest markers
Browse files Browse the repository at this point in the history
Resolves unclosed event loop warnings.

Signed-off-by: ff137 <[email protected]>
  • Loading branch information
ff137 committed Nov 14, 2024
1 parent 7c53452 commit f002ccb
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 22 deletions.
1 change: 0 additions & 1 deletion acapy_agent/anoncreds/tests/test_revocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,6 @@ async def test_create_credential_w3c(self, mock_supports_revocation):
assert isinstance(result, tuple)
assert mock_supports_revocation.call_count == 1

@pytest.mark.asyncio
@mock.patch.object(AskarAnoncredsProfileSession, "handle")
async def test_create_credential_w3c_keyerror(self, mock_handle):
mock_handle.fetch = mock.CoroutineMock(side_effect=[MockEntry(), MockEntry()])
Expand Down
3 changes: 0 additions & 3 deletions acapy_agent/multitenant/admin/tests/test_routes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from unittest import IsolatedAsyncioTestCase

import pytest
from marshmallow.exceptions import ValidationError

from ....admin.request_context import AdminRequestContext
Expand Down Expand Up @@ -143,7 +142,6 @@ async def test_wallets_list_query(self):
}
)

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

@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
@@ -1,7 +1,5 @@
from unittest import IsolatedAsyncioTestCase

import pytest

from ......connections.models import connection_target
from ......connections.models.diddoc import DIDDoc, PublicKey, PublicKeyType, Service
from ......messaging.decorators.attach_decorator import AttachDecorator
Expand Down Expand Up @@ -75,7 +73,6 @@ async def asyncSetUp(self):
did_doc_attach=self.did_doc_attach,
)

@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 +86,6 @@ async def test_called(self, mock_didx_mgr):
)
assert not responder.messages

@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 +103,6 @@ async def test_called_auto_ping(self, mock_didx_mgr):
result, _ = messages[0]
assert isinstance(result, Ping)

@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 +139,6 @@ async def test_problem_report(self, mock_conn_target, mock_didx_mgr):
)
assert target == {"target_list": [mock_conn_target]}

@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 +185,6 @@ async def test_problem_report_did_doc(
)
assert target == {"target_list": [mock_conn_target]}

@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
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,6 @@ async def test_issue_credential_non_revocable(self):
# assert data is encoded as base64
assert attachment.data.base64

@pytest.mark.asyncio
async def test_match_sent_cred_def_id_error(self):
tag_query = {"tag": "test_tag"}

Expand All @@ -737,7 +736,6 @@ async def test_match_sent_cred_def_id_error(self):
context.exception
)

@pytest.mark.asyncio
async def test_store_credential(self):
attr_values = {
"legalName": "value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1549,7 +1549,6 @@ async def test_filter_string(self):
)
assert len(tmp_vp.get("verifiableCredential")) == 1

@pytest.mark.asyncio
@pytest.mark.ursa_bbs_signatures
async def test_filter_schema(self):
cred_list, _ = await self.setup_tuple(self.profile)
Expand Down Expand Up @@ -2384,7 +2383,6 @@ async def test_no_filter(self):
)
assert len(tmp_vp.get("verifiableCredential")) == 6

@pytest.mark.asyncio
@pytest.mark.ursa_bbs_signatures
async def test_filter_with_only_string_type(self):
cred_list, _ = await self.setup_tuple(self.profile)
Expand Down Expand Up @@ -2436,7 +2434,6 @@ async def test_filter_with_only_string_type(self):
)
assert len(tmp_vp.get("verifiableCredential")) == 6

@pytest.mark.asyncio
@pytest.mark.ursa_bbs_signatures
async def test_filter_with_only_num_type(self):
await self.setup_tuple(self.profile)
Expand Down Expand Up @@ -2850,7 +2847,6 @@ async def test_filter_by_field_path_match_on_proof(self):
with pytest.raises(DIFPresExchError):
await dif_pres_exch_handler.filter_by_field(field, cred)

@pytest.mark.asyncio
async def test_filter_creds_record_id(self):
dif_pres_exch_handler = DIFPresExchHandler(self.profile)
cred_list = [
Expand Down Expand Up @@ -3214,7 +3210,6 @@ async def test_apply_constraint_received_cred_path_update(self):
constraint=constraint, cred_dict=cred_dict
)

@pytest.mark.asyncio
@pytest.mark.ursa_bbs_signatures
async def test_apply_constraint_received_cred_invalid(self):
dif_pres_exch_handler = DIFPresExchHandler(
Expand Down Expand Up @@ -3270,7 +3265,6 @@ async def test_apply_constraint_received_cred_invalid(self):
constraint=constraint, cred_dict=cred_dict
)

@pytest.mark.asyncio
@pytest.mark.ursa_bbs_signatures
async def test_apply_constraint_received_cred_valid(self):
dif_pres_exch_handler = DIFPresExchHandler(
Expand Down Expand Up @@ -3464,7 +3458,6 @@ async def test_apply_constraint_received_cred_no_sel_disc(self):
constraint=constraint, cred_dict=cred_dict
)

@pytest.mark.asyncio
async def test_get_updated_path(self):
dif_pres_exch_handler = DIFPresExchHandler(
self.profile, proof_type=BbsBlsSignature2020.signature_type
Expand Down Expand Up @@ -3532,7 +3525,6 @@ def test_get_dict_keys_from_path(self):
cred_dict, "credentialSubject.Patient.address"
) == ["@id"]

@pytest.mark.asyncio
async def test_filter_by_field_keyerror(self):
dif_pres_exch_handler = DIFPresExchHandler(
self.profile, proof_type=BbsBlsSignature2020.signature_type
Expand All @@ -3555,7 +3547,6 @@ async def test_filter_by_field_keyerror(self):
)
assert not await dif_pres_exch_handler.filter_by_field(field, vc_record_cred)

@pytest.mark.asyncio
async def test_filter_by_field_xsd_parser(self):
dif_pres_exch_handler = DIFPresExchHandler(
self.profile, proof_type=BbsBlsSignature2020.signature_type
Expand Down

0 comments on commit f002ccb

Please sign in to comment.