Skip to content

Latest commit

 

History

History
43 lines (24 loc) · 1.79 KB

File metadata and controls

43 lines (24 loc) · 1.79 KB

Fixtures

Fixtures provide quick access to custom Brownie objects frequently used throughout testing. Visit the Brownie Documentation for more detail and the PyTest Documentation for additional background.

FIXTURES

PyTest fixtures are located in tests/conftest.py

Fixtures are created by prepending the function with the fixture decorator

@pytest.fixture
def my_fixture():
	...

FIXTURE SCOPES

The scope of the fixture can be passed to determine when the fixture is destroyed.

@pytest.fixture(scope=_scope_)
def my_fixture():
	...
  • function: (default) fixture destroyed at end of test
  • class: fixture destroyed at last test in class
  • module: fixture destroyed at last test in module
  • session: fixture destroyed at end of test session

BROWNIE CONTRACT PERSISTENCE

After being created once, Brownie stores a copy of contracts in a local database that persists between sessions

CURVE REGISTRY

Contract used to locate all active Curve contracts and perform high level interactions. More information at the Documentation. The active address may change and can be retrieved from the permanent Address Provider contract

CURVE TRIPOOL

Core Curve pool allowing staking and transactions among DAI, USDC, and Tether stablecoins. DAI is a decentralized stablecoin currently pegged to the value of the US dollar created by MakerDAO