Try the Xian demo contracts & run the full unit-test suite in under a minute—locally or in the cloud.
Requires Python 3.11 (matches the
environment.yml
and CI matrix).
One-click playgrounds | |
---|---|
Colab | |
Binder |
quickstart-smart-contract-tests/
├─ contracts/ ← demo smart-contracts
│ ├─ currency.py
│ └─ con_quickstart.py
├─ tests/ ← pre-written PyTest/Unittest spec
│ └─ test_con_quickstart.py
├─ quickstart_tests.ipynb ← notebook that shows & runs the tests
├─ environment.yml ← Binder / Replit Python-3.11 env
└─ .github/workflows/tests.yml ← CI: runs pytest on every push/PR
Platform | Action |
---|---|
Colab | Click the badge above, then Runtime → Run all. |
Binder | Click the badge & wait ~30 s; notebook opens automatically. |
You’ll see green pytest
dots:
tests/test_con_quickstart.py ... [100%]
3 passed in 0.84s
git clone https://github.com/xian-network/quickstart-smart-contract-tests.git
cd quickstart-smart-contract-tests
# create a Python 3.11 venv
python3.11 -m venv .venv && source .venv/bin/activate
pip install git+https://github.com/xian-network/xian-contracting pytest
pytest -q
- Create a file under
tests/
, e.g.test_my_feature.py
. - Copy the
ContractingClient
setup shown in the existing test. pytest -q
again—your new assertions run alongside ours.
MIT — do what you like, just keep the notice.
Made with ❤️ by the Xian community. PRs, issues & stars welcome!