Vyper theorytheory 0/50 · 0%
Testing · hard

39. Testing with Brownie/Ape

Framework-based testing across Vyper and Solidity.

Brownie and its successor Ape are Python frameworks that support both Solidity and Vyper projects, letting you write pytest-style tests, manage deployments, and fork mainnet state for integration tests.

def test_transfer(token, accounts):
    token.transfer(accounts[1], 100, {"from": accounts[0]})
    assert token.balanceOf(accounts[1]) == 100

Mainnet forking is especially valuable for Vyper DeFi contracts: you can test real interactions against deployed protocols (like an actual Uniswap pool) without spending real ETH.

Check your understanding

  1. 1. What language ecosystem are Brownie/Ape written in?

  2. 2. What does mainnet forking let you test?

  3. 3. What testing style do these frameworks typically use?