Skip to content

Commit

Permalink
Merge pull request #2764 from ff137/upgrade-pytest-asyncio
Browse files Browse the repository at this point in the history
⬆️ Update pytest-asyncio to 0.23.4
  • Loading branch information
swcurran authored Feb 7, 2024
2 parents a705c3c + 56c7032 commit da5e01f
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 141 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import asyncio
from copy import deepcopy
from datetime import datetime
from typing import Sequence
Expand Down Expand Up @@ -62,14 +61,7 @@
)


@pytest.fixture(scope="class")
def event_loop(request):
loop = asyncio.get_event_loop_policy().new_event_loop()
yield loop
loop.close()


@pytest.fixture(scope="class")
@pytest.fixture(scope="module")
def profile():
profile = InMemoryProfile.test_profile(bind={DIDMethods: DIDMethods()})
context = profile.context
Expand All @@ -82,7 +74,7 @@ def profile():
return profile


@pytest.fixture(scope="class")
@pytest.fixture(scope="module")
async def setup_tuple(profile):
async with profile.session() as session:
wallet = session.inject_or(BaseWallet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,20 @@ def handle(self):
)

credx_module = importlib.import_module("indy_credx")
rev_reg_delta = credx_module.RevocationRegistryDelta.load(
json.dumps(
{
"ver": "1.0",
"value": {
"accum": "1 0792BD1C8C1A529173FDF54A5B30AC90C2472956622E9F04971D36A9BF77C2C5 1 13B18B6B68AD62605C74FD61088814338EDEEB41C2195F96EC0E83B2B3D0258F 1 102ED0DDE96F6367199CE1C0B138F172BC913B65E37250581606974034F4CA20 1 1C53786D2C15190B57167CDDD2A046CAD63970B5DE43F4D492D4F46B8EEE6FF1 2 095E45DDF417D05FB10933FFC63D474548B7FFFF7888802F07FFFFFF7D07A8A8 1 0000000000000000000000000000000000000000000000000000000000000000"
},
}
)
rev_reg_delta_json = json.dumps(
{
"ver": "1.0",
"value": {
"accum": "1 0792BD1C8C1A529173FDF54A5B30AC90C2472956622E9F04971D36A9BF77C2C5 1 13B18B6B68AD62605C74FD61088814338EDEEB41C2195F96EC0E83B2B3D0258F 1 102ED0DDE96F6367199CE1C0B138F172BC913B65E37250581606974034F4CA20 1 1C53786D2C15190B57167CDDD2A046CAD63970B5DE43F4D492D4F46B8EEE6FF1 2 095E45DDF417D05FB10933FFC63D474548B7FFFF7888802F07FFFFFF7D07A8A8 1 0000000000000000000000000000000000000000000000000000000000000000"
},
}
)
rev_reg_delta = credx_module.RevocationRegistryDelta.load(rev_reg_delta_json)

if hasattr(rev_reg_delta.to_json, "return_value"):
# if indy_credx is not installed, then we're dealing with a mocked method
# therefore, set the return_value to avoid MagicMock being passed to json.loads
rev_reg_delta.to_json.return_value = rev_reg_delta_json

TEST_GENESIS_TXN = "test_genesis_txn"
rec = IssuerRevRegRecord(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ async def holder():
await profile.close()


@pytest.mark.askar
class TestAskarVCHolder(in_memory.TestInMemoryVCHolder):
# run same test suite with different holder fixture

Expand Down
9 changes: 5 additions & 4 deletions aries_cloudagent/vc/vc_ld/tests/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ async def test_prepare_detail_ed25519_2020(
assert SECURITY_CONTEXT_ED25519_2020_URL in vc.context_urls


@pytest.mark.asyncio
@pytest.mark.asyncio(scope="module")
async def test_issue(
profile: Profile,
manager: VcLdpManager,
Expand All @@ -317,7 +317,7 @@ async def test_issue(
assert cred


@pytest.mark.asyncio
@pytest.mark.asyncio(scope="module")
async def test_issue_ed25519_2020(
profile: Profile,
manager: VcLdpManager,
Expand All @@ -337,7 +337,8 @@ async def test_issue_ed25519_2020(
assert cred


@pytest.mark.asyncio
@pytest.mark.asyncio(scope="module")
@pytest.mark.ursa_bbs_signatures
async def test_issue_bbs(
profile: Profile,
manager: VcLdpManager,
Expand Down Expand Up @@ -371,7 +372,7 @@ async def test_get_all_suites(manager: VcLdpManager):
assert isinstance(suite, types)


@pytest.mark.asyncio
@pytest.mark.asyncio(scope="module")
async def test_store(
profile: Profile,
manager: VcLdpManager,
Expand Down
Loading

0 comments on commit da5e01f

Please sign in to comment.