PyTest Ethereum Plugin
py.test plugin for testing Ethereum Smart Contracts
Usage
Step 1: Install
pip install pytest-ethereum # python 3.6+
Step 2: Compile your contracts into a package (soon to be ethPM-compliant)
solc --combined-json abi,bin,bin-runtime contracts/ > contracts.json
Step 3. Execute your test suite (make sure to import your package file!)
py.test --package-file contracts.json tests/
Guidelines
- This plugin is opinionated
- There should only be one way to do something
- Support for special needs is possible, but undesireable
- This plugin is intuitive
- It should be VERY clear how to use it
- It should not get in the way of smart contract testing
- It should remove the complexities of a production environment
- This plugin is concise
- Fixture API is simple and expressive
- Write high quality tests quickly and easily
Contributing
Rules:
- Test cases should be grep'd from documentation
- Unless they are uninteresting corner cases
- Test cases should be well explained
- Follow the Guidelines!