Algorand Python Testing is a companion package to Algorand Python that enables efficient unit testing of Algorand Python smart contracts in an offline environment. It emulates key AVM behaviors without requiring a network connection, offering fast and reliable testing capabilities with a familiar Pythonic interface.
Documentation | Algorand Python Documentation
Quick start
The easiest way to use Algorand Python Testing is to instantiate a template with AlgoKit via algokit init -t python. This will give you a full development environment with testing capabilities built-in.
Alternatively, if you want to start from scratch:
-
Ensure you have Python 3.12+
-
Install AlgoKit CLI
-
Install Algorand Python Testing into your project:
pip install algorand-python-testing
-
Create a test file (e.g.,
test_contract.py):from algopy_testing import algopy_testing_context from your_contract import YourContract def test_your_contract(): with algopy_testing_context() as context: # Arrange contract = YourContract() expected_result = ... # Your expected result here # Act result = contract.your_method(context.any.uint64()) # Your test code here # Assert assert result == expected_result
-
Run your tests using your preferred Python testing framework (e.g., pytest, unittest)
For more detailed information, check out the full documentation.
Features
- Offline testing environment simulating core AVM functionality
- Compatible with popular Python testing frameworks
- Supports testing of ARC4 contracts, smart signatures, and more
- Provides tools for mocking blockchain state and transactions
Examples
For detailed examples showcasing various testing scenarios, refer to the examples section in the documentation.
Contributing
We welcome contributions to this project! Please read our contributing guide to get started.
Metadata
Release files for algorand-python-testing 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| algorand_python_testing-1.1.0.tar.gz | 474.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| algorand_python_testing-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 570.8 kB
Release files / algorand_python_testing-1.1.0.tar.gz
| Download URL | algorand_python_testing-1.1.0.tar.gz |
|---|---|
| Size | 474.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b2e0129bf3157db430ff1e1dabb052e9905039a89c769715bdc338071589cf2
|
|
BLAKE2b-256 checksum How to use checksums |
e68aa891432b3538dda610e8482893efb8a982508d1bac2adb33dd11c5351c68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2025.
Transparency logRelease files / algorand_python_testing-1.1.0-py3-none-any.whl
| Download URL | algorand_python_testing-1.1.0-py3-none-any.whl |
|---|---|
| Size | 96.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ff753c5e4e0e5a65664e0b8b974d4206c91768fc19b3b24184fd3d00f66ada9
|
|
BLAKE2b-256 checksum How to use checksums |
7676299a87ed691036971d723e21078802ebc78a325da5b3540fd07b10a75c13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2025.
Transparency log