Available Fixtures

owner()[source]

A funded owner account.

This is a regular Algorand account that is automatically funded upon creation. Its name implies that its main purpose is as the creator and administrator account of an Algorand smart contract application.

Yields

AlgoUser

Return type

YieldFixture[AlgoUser]

user1()[source]

A funded user account.

This is an Algorand account that is automatically funded upon creation.

Yields

AlgoUser

Return type

YieldFixture[AlgoUser]

user2()[source]

A second funded user account.

This is an Algorand account that is automatically funded upon creation.

Yields

AlgoUser

Return type

YieldFixture[AlgoUser]

user3()[source]

A third funded user account.

This is an Algorand account that is automatically funded upon creation.

Yields

AlgoUser

Return type

YieldFixture[AlgoUser]

user4()[source]

A fourth funded user account.

This is an Algorand account that is automatically funded upon creation.

Yields

AlgoUser

Return type

YieldFixture[AlgoUser]

create_user()[source]

A factory fixture to create funded user accounts.

Every time this factory fixture is called, a new funded Algorand account is created.

Example

def test_vote_from_many_users(smart_contract_id, create_user):
    users = []

    # Create 10 separate users
    for i in range(10):
        users.append(create_user())

    # Everyone votes for the first user
    for user in users:
        call_app(user, smart_contract_id, app_args=["vote"], accounts=[user[0]])
Yields

Callable[[], AlgoUser] – A function taking no arguments and producing an AlgoUser.

Return type

YieldFixture[Callable]