Skip to content

Commit d84a384

Browse files
committed
🎨 Remove unnecessary asyncio pytest markers
Resolves unclosed event loop warnings. Signed-off-by: ff137 <[email protected]>
1 parent c65f6ce commit d84a384

File tree

5 files changed

+0
-22
lines changed

5 files changed

+0
-22
lines changed

acapy_agent/anoncreds/tests/test_revocation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,6 @@ async def test_create_credential_w3c(self, mock_supports_revocation):
14141414
assert isinstance(result, tuple)
14151415
assert mock_supports_revocation.call_count == 1
14161416

1417-
@pytest.mark.asyncio
14181417
@mock.patch.object(AskarAnoncredsProfileSession, "handle")
14191418
async def test_create_credential_w3c_keyerror(self, mock_handle):
14201419
mock_handle.fetch = mock.CoroutineMock(side_effect=[MockEntry(), MockEntry()])

acapy_agent/multitenant/admin/tests/test_routes.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from unittest import IsolatedAsyncioTestCase
22

3-
import pytest
43
from marshmallow.exceptions import ValidationError
54

65
from ....admin.request_context import AdminRequestContext
@@ -143,7 +142,6 @@ async def test_wallets_list_query(self):
143142
}
144143
)
145144

146-
@pytest.mark.asyncio(loop_scope="function")
147145
async def test_wallet_create_tenant_settings(self):
148146
body = {
149147
"wallet_name": "test",
@@ -796,7 +794,6 @@ async def test_wallet_create_token_x(self):
796794
)
797795
await test_module.wallet_create_token(self.request)
798796

799-
@pytest.mark.asyncio(loop_scope="function")
800797
async def test_wallet_remove_managed(self):
801798
self.request.has_body = False
802799
self.request.match_info = {"wallet_id": "dummy"}

acapy_agent/protocols/didexchange/v1_0/handlers/tests/test_response_handler.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from unittest import IsolatedAsyncioTestCase
22

3-
import pytest
4-
53
from ......connections.models import connection_target
64
from ......connections.models.diddoc import DIDDoc, PublicKey, PublicKeyType, Service
75
from ......messaging.decorators.attach_decorator import AttachDecorator
@@ -75,7 +73,6 @@ async def asyncSetUp(self):
7573
did_doc_attach=self.did_doc_attach,
7674
)
7775

78-
@pytest.mark.asyncio(loop_scope="function")
7976
@mock.patch.object(test_module, "DIDXManager")
8077
async def test_called(self, mock_didx_mgr):
8178
mock_didx_mgr.return_value.accept_response = mock.CoroutineMock()
@@ -89,7 +86,6 @@ async def test_called(self, mock_didx_mgr):
8986
)
9087
assert not responder.messages
9188

92-
@pytest.mark.asyncio(loop_scope="function")
9389
@mock.patch.object(test_module, "DIDXManager")
9490
async def test_called_auto_ping(self, mock_didx_mgr):
9591
self.ctx.update_settings({"auto_ping_connection": True})
@@ -107,7 +103,6 @@ async def test_called_auto_ping(self, mock_didx_mgr):
107103
result, _ = messages[0]
108104
assert isinstance(result, Ping)
109105

110-
@pytest.mark.asyncio(loop_scope="function")
111106
@mock.patch.object(test_module, "DIDXManager")
112107
@mock.patch.object(connection_target, "ConnectionTarget")
113108
async def test_problem_report(self, mock_conn_target, mock_didx_mgr):
@@ -144,7 +139,6 @@ async def test_problem_report(self, mock_conn_target, mock_didx_mgr):
144139
)
145140
assert target == {"target_list": [mock_conn_target]}
146141

147-
@pytest.mark.asyncio(loop_scope="function")
148142
@mock.patch.object(test_module, "DIDXManager")
149143
@mock.patch.object(connection_target, "ConnectionTarget")
150144
async def test_problem_report_did_doc(
@@ -191,7 +185,6 @@ async def test_problem_report_did_doc(
191185
)
192186
assert target == {"target_list": [mock_conn_target]}
193187

194-
@pytest.mark.asyncio(loop_scope="function")
195188
@mock.patch.object(test_module, "DIDXManager")
196189
@mock.patch.object(connection_target, "ConnectionTarget")
197190
async def test_problem_report_did_doc_no_conn_target(

acapy_agent/protocols/issue_credential/v2_0/formats/vc_di/tests/test_handler.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,6 @@ async def test_issue_credential_non_revocable(self):
727727
# assert data is encoded as base64
728728
assert attachment.data.base64
729729

730-
@pytest.mark.asyncio
731730
async def test_match_sent_cred_def_id_error(self):
732731
tag_query = {"tag": "test_tag"}
733732

@@ -737,7 +736,6 @@ async def test_match_sent_cred_def_id_error(self):
737736
context.exception
738737
)
739738

740-
@pytest.mark.asyncio
741739
async def test_store_credential(self):
742740
attr_values = {
743741
"legalName": "value",

acapy_agent/protocols/present_proof/dif/tests/test_pres_exch_handler.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,6 @@ async def test_filter_string(self):
15491549
)
15501550
assert len(tmp_vp.get("verifiableCredential")) == 1
15511551

1552-
@pytest.mark.asyncio
15531552
@pytest.mark.ursa_bbs_signatures
15541553
async def test_filter_schema(self):
15551554
cred_list, _ = await self.setup_tuple(self.profile)
@@ -2384,7 +2383,6 @@ async def test_no_filter(self):
23842383
)
23852384
assert len(tmp_vp.get("verifiableCredential")) == 6
23862385

2387-
@pytest.mark.asyncio
23882386
@pytest.mark.ursa_bbs_signatures
23892387
async def test_filter_with_only_string_type(self):
23902388
cred_list, _ = await self.setup_tuple(self.profile)
@@ -2436,7 +2434,6 @@ async def test_filter_with_only_string_type(self):
24362434
)
24372435
assert len(tmp_vp.get("verifiableCredential")) == 6
24382436

2439-
@pytest.mark.asyncio
24402437
@pytest.mark.ursa_bbs_signatures
24412438
async def test_filter_with_only_num_type(self):
24422439
await self.setup_tuple(self.profile)
@@ -2850,7 +2847,6 @@ async def test_filter_by_field_path_match_on_proof(self):
28502847
with pytest.raises(DIFPresExchError):
28512848
await dif_pres_exch_handler.filter_by_field(field, cred)
28522849

2853-
@pytest.mark.asyncio
28542850
async def test_filter_creds_record_id(self):
28552851
dif_pres_exch_handler = DIFPresExchHandler(self.profile)
28562852
cred_list = [
@@ -3214,7 +3210,6 @@ async def test_apply_constraint_received_cred_path_update(self):
32143210
constraint=constraint, cred_dict=cred_dict
32153211
)
32163212

3217-
@pytest.mark.asyncio
32183213
@pytest.mark.ursa_bbs_signatures
32193214
async def test_apply_constraint_received_cred_invalid(self):
32203215
dif_pres_exch_handler = DIFPresExchHandler(
@@ -3270,7 +3265,6 @@ async def test_apply_constraint_received_cred_invalid(self):
32703265
constraint=constraint, cred_dict=cred_dict
32713266
)
32723267

3273-
@pytest.mark.asyncio
32743268
@pytest.mark.ursa_bbs_signatures
32753269
async def test_apply_constraint_received_cred_valid(self):
32763270
dif_pres_exch_handler = DIFPresExchHandler(
@@ -3464,7 +3458,6 @@ async def test_apply_constraint_received_cred_no_sel_disc(self):
34643458
constraint=constraint, cred_dict=cred_dict
34653459
)
34663460

3467-
@pytest.mark.asyncio
34683461
async def test_get_updated_path(self):
34693462
dif_pres_exch_handler = DIFPresExchHandler(
34703463
self.profile, proof_type=BbsBlsSignature2020.signature_type
@@ -3532,7 +3525,6 @@ def test_get_dict_keys_from_path(self):
35323525
cred_dict, "credentialSubject.Patient.address"
35333526
) == ["@id"]
35343527

3535-
@pytest.mark.asyncio
35363528
async def test_filter_by_field_keyerror(self):
35373529
dif_pres_exch_handler = DIFPresExchHandler(
35383530
self.profile, proof_type=BbsBlsSignature2020.signature_type
@@ -3555,7 +3547,6 @@ async def test_filter_by_field_keyerror(self):
35553547
)
35563548
assert not await dif_pres_exch_handler.filter_by_field(field, vc_record_cred)
35573549

3558-
@pytest.mark.asyncio
35593550
async def test_filter_by_field_xsd_parser(self):
35603551
dif_pres_exch_handler = DIFPresExchHandler(
35613552
self.profile, proof_type=BbsBlsSignature2020.signature_type

0 commit comments

Comments
 (0)