algorand-python-testing 0.3.0b9__tar.gz → 0.3.0b10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/.github/workflows/ci.yaml +3 -0
  2. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/.github/workflows/gh-pages.yaml +3 -0
  3. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/CHANGELOG.md +2 -0
  4. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/PKG-INFO +1 -1
  5. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/api.md +10 -0
  6. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/conf.py +10 -0
  7. algorand_python_testing-0.3.0b10/docs/faq.md +61 -0
  8. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/index.md +1 -17
  9. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/pyproject.toml +5 -3
  10. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/context_helpers/context_storage.py +3 -0
  11. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/context_helpers/txn_context.py +7 -5
  12. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/test_context.py +37 -0
  13. algorand_python_testing-0.3.0b9/docs/glossary.md +0 -8
  14. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/.coveragerc +0 -0
  15. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/.editorconfig +0 -0
  16. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  17. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  18. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/.github/pull_request_template.md +0 -0
  19. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/.github/workflows/cd.yaml +0 -0
  20. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/.gitignore +0 -0
  21. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/.pre-commit-config.yaml +0 -0
  22. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/.vscode/extensions.json +0 -0
  23. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/.vscode/launch.json +0 -0
  24. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/.vscode/settings.json +0 -0
  25. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/CONTRIBUTING.md +0 -0
  26. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/LICENSE +0 -0
  27. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/README.md +0 -0
  28. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/Makefile +0 -0
  29. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/__init__.py +0 -0
  30. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/_static/custom.css +0 -0
  31. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/algopy.md +0 -0
  32. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/coverage.md +0 -0
  33. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/examples.md +0 -0
  34. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/make.bat +0 -0
  35. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/testing-guide/arc4-types.md +0 -0
  36. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/testing-guide/avm-types.md +0 -0
  37. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/testing-guide/concepts.md +0 -0
  38. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/testing-guide/contract-testing.md +0 -0
  39. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/testing-guide/index.md +0 -0
  40. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/testing-guide/opcodes.md +0 -0
  41. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/testing-guide/signature-testing.md +0 -0
  42. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/testing-guide/state-management.md +0 -0
  43. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/testing-guide/subroutines.md +0 -0
  44. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/docs/testing-guide/transactions.md +0 -0
  45. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/README.md +0 -0
  46. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/__init__.py +0 -0
  47. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/auction/__init__.py +0 -0
  48. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/auction/contract.py +0 -0
  49. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/auction/test_contract.py +0 -0
  50. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/htlc_logicsig/__init__.py +0 -0
  51. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/htlc_logicsig/signature.py +0 -0
  52. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/htlc_logicsig/test_signature.py +0 -0
  53. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/marketplace/__init__.py +0 -0
  54. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/marketplace/contract.py +0 -0
  55. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/marketplace/test_contract.py +0 -0
  56. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/proof_of_attendance/__init__.py +0 -0
  57. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/proof_of_attendance/contract.py +0 -0
  58. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/proof_of_attendance/test_contract.py +0 -0
  59. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/scratch_storage/__init__.py +0 -0
  60. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/scratch_storage/contract.py +0 -0
  61. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/scratch_storage/test_contract.py +0 -0
  62. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/simple_voting/__init__.py +0 -0
  63. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/simple_voting/contract.py +0 -0
  64. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/simple_voting/test_contract.py +0 -0
  65. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/zk_whitelist/__init__.py +0 -0
  66. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/zk_whitelist/contract.py +0 -0
  67. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/examples/zk_whitelist/test_contract.py +0 -0
  68. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/scripts/__init__.py +0 -0
  69. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/scripts/check_stubs_cov.py +0 -0
  70. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/scripts/refresh_test_artifacts.py +0 -0
  71. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/scripts/validate_examples.py +0 -0
  72. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/__init__.py +0 -0
  73. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/arc4.py +0 -0
  74. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/compiled.py +0 -0
  75. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/constants.py +0 -0
  76. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/context.py +0 -0
  77. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/context_helpers/__init__.py +0 -0
  78. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/context_helpers/ledger_context.py +0 -0
  79. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/decorators/__init__.py +0 -0
  80. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/decorators/arc4.py +0 -0
  81. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/decorators/subroutine.py +0 -0
  82. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/enums.py +0 -0
  83. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/gtxn.py +0 -0
  84. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/itxn.py +0 -0
  85. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/itxn_loader.py +0 -0
  86. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/__init__.py +0 -0
  87. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/account.py +0 -0
  88. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/application.py +0 -0
  89. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/asset.py +0 -0
  90. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/contract.py +0 -0
  91. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/logicsig.py +0 -0
  92. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/template_variable.py +0 -0
  93. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/txn_fields.py +0 -0
  94. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/models/unsigned_builtins.py +0 -0
  95. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/mutable.py +0 -0
  96. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/__init__.py +0 -0
  97. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/block.py +0 -0
  98. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/constants.py +0 -0
  99. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/crypto.py +0 -0
  100. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/global_values.py +0 -0
  101. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/itxn.py +0 -0
  102. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/misc.py +0 -0
  103. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/pure.py +0 -0
  104. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/op/txn.py +0 -0
  105. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/primitives/__init__.py +0 -0
  106. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/primitives/biguint.py +0 -0
  107. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/primitives/bytes.py +0 -0
  108. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/primitives/string.py +0 -0
  109. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/primitives/uint64.py +0 -0
  110. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/protocols.py +0 -0
  111. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/py.typed +0 -0
  112. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/state/__init__.py +0 -0
  113. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/state/box.py +0 -0
  114. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/state/global_state.py +0 -0
  115. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/state/local_state.py +0 -0
  116. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/state/utils.py +0 -0
  117. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/utilities/__init__.py +0 -0
  118. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/utilities/budget.py +0 -0
  119. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/utilities/log.py +0 -0
  120. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/utils.py +0 -0
  121. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/value_generators/__init__.py +0 -0
  122. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/value_generators/arc4.py +0 -0
  123. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/value_generators/avm.py +0 -0
  124. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/_algopy_testing/value_generators/txn.py +0 -0
  125. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/algopy/__init__.py +0 -0
  126. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/algopy/arc4.py +0 -0
  127. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/algopy/gtxn.py +0 -0
  128. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/algopy/itxn.py +0 -0
  129. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/algopy/op.py +0 -0
  130. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/algopy/py.typed +0 -0
  131. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/algopy_testing/__init__.py +0 -0
  132. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/src/algopy_testing/py.typed +0 -0
  133. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/templates/.macros.j2 +0 -0
  134. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/templates/.release_notes.md.j2 +0 -0
  135. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/templates/CHANGELOG.md.j2 +0 -0
  136. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/__init__.py +0 -0
  137. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/arc4/__init__.py +0 -0
  138. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/arc4/conftest.py +0 -0
  139. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/arc4/test_abi_call.py +0 -0
  140. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/arc4/test_address.py +0 -0
  141. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/arc4/test_arc4_method_signature.py +0 -0
  142. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/arc4/test_bool.py +0 -0
  143. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/arc4/test_dynamic_array.py +0 -0
  144. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/arc4/test_dynamic_bytes.py +0 -0
  145. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/arc4/test_emit.py +0 -0
  146. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/arc4/test_static_array.py +0 -0
  147. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/arc4/test_string.py +0 -0
  148. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/arc4/test_struct.py +0 -0
  149. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/arc4/test_tuple.py +0 -0
  150. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/arc4/test_ufixednxm.py +0 -0
  151. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/arc4/test_uintn.py +0 -0
  152. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4ABIMethod/__init__.py +0 -0
  153. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4ABIMethod/contract.py +0 -0
  154. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.approval.teal +0 -0
  155. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.arc32.json +0 -0
  156. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4ABIMethod/data/SignaturesContract.clear.teal +0 -0
  157. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4InnerTxns/__init__.py +0 -0
  158. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4InnerTxns/contract.py +0 -0
  159. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.approval.teal +0 -0
  160. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.arc32.json +0 -0
  161. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4InnerTxns/data/Arc4InnerTxnsContract.clear.teal +0 -0
  162. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4PrimitiveOps/__init__.py +0 -0
  163. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4PrimitiveOps/contract.py +0 -0
  164. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.approval.teal +0 -0
  165. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.arc32.json +0 -0
  166. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/Arc4PrimitiveOps/data/Arc4PrimitiveOpsContract.clear.teal +0 -0
  167. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/BoxContract/__init__.py +0 -0
  168. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/BoxContract/contract.py +0 -0
  169. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/BoxContract/data/BoxContract.approval.teal +0 -0
  170. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/BoxContract/data/BoxContract.arc32.json +0 -0
  171. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/BoxContract/data/BoxContract.clear.teal +0 -0
  172. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/CryptoOps/__init__.py +0 -0
  173. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/CryptoOps/contract.py +0 -0
  174. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/CryptoOps/data/CryptoOpsContract.approval.teal +0 -0
  175. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/CryptoOps/data/CryptoOpsContract.arc32.json +0 -0
  176. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/CryptoOps/data/CryptoOpsContract.clear.teal +0 -0
  177. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/GlobalStateValidator/__init__.py +0 -0
  178. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/GlobalStateValidator/contract.py +0 -0
  179. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.approval.teal +0 -0
  180. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.arc32.json +0 -0
  181. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/GlobalStateValidator/data/GlobalStateValidator.clear.teal +0 -0
  182. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/MiscellaneousOps/__init__.py +0 -0
  183. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/MiscellaneousOps/contract.py +0 -0
  184. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.approval.teal +0 -0
  185. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.arc32.json +0 -0
  186. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/MiscellaneousOps/data/MiscellaneousOpsContract.clear.teal +0 -0
  187. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/PrimitiveOps/__init__.py +0 -0
  188. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/PrimitiveOps/contract.py +0 -0
  189. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.approval.teal +0 -0
  190. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.arc32.json +0 -0
  191. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/PrimitiveOps/data/PrimitiveOpsContract.clear.teal +0 -0
  192. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateMutations/__init__.py +0 -0
  193. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateMutations/data/Contract.approval.teal +0 -0
  194. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateMutations/data/Contract.arc32.json +0 -0
  195. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateMutations/data/Contract.clear.teal +0 -0
  196. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateMutations/statemutations.py +0 -0
  197. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/__init__.py +0 -0
  198. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/contract.py +0 -0
  199. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/GlobalStateContract.approval.teal +0 -0
  200. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/GlobalStateContract.arc32.json +0 -0
  201. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/GlobalStateContract.clear.teal +0 -0
  202. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/ITxnOpsContract.approval.teal +0 -0
  203. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/ITxnOpsContract.arc32.json +0 -0
  204. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/ITxnOpsContract.clear.teal +0 -0
  205. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/LocalStateContract.approval.teal +0 -0
  206. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/LocalStateContract.arc32.json +0 -0
  207. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/LocalStateContract.clear.teal +0 -0
  208. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAcctParamsGet.approval.teal +0 -0
  209. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAcctParamsGet.arc32.json +0 -0
  210. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAcctParamsGet.clear.teal +0 -0
  211. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.approval.teal +0 -0
  212. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.arc32.json +0 -0
  213. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAcctParamsGetContract.clear.teal +0 -0
  214. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppGlobalContract.approval.teal +0 -0
  215. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppGlobalContract.arc32.json +0 -0
  216. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppGlobalContract.clear.teal +0 -0
  217. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppGlobalExContract.approval.teal +0 -0
  218. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppGlobalExContract.arc32.json +0 -0
  219. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppGlobalExContract.clear.teal +0 -0
  220. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppLocalContract.approval.teal +0 -0
  221. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppLocalContract.arc32.json +0 -0
  222. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppLocalContract.clear.teal +0 -0
  223. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppLocalExContract.approval.teal +0 -0
  224. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppLocalExContract.arc32.json +0 -0
  225. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppLocalExContract.clear.teal +0 -0
  226. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppParamsContract.approval.teal +0 -0
  227. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppParamsContract.arc32.json +0 -0
  228. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAppParamsContract.clear.teal +0 -0
  229. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAssetHoldingContract.approval.teal +0 -0
  230. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAssetHoldingContract.arc32.json +0 -0
  231. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAssetHoldingContract.clear.teal +0 -0
  232. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAssetParamsContract.approval.teal +0 -0
  233. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAssetParamsContract.arc32.json +0 -0
  234. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/StateOps/data/StateAssetParamsContract.clear.teal +0 -0
  235. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/artifacts/__init__.py +0 -0
  236. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/common.py +0 -0
  237. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/conftest.py +0 -0
  238. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/contexts/__init__.py +0 -0
  239. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/models/__init__.py +0 -0
  240. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/models/test_asset.py +0 -0
  241. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/models/test_box.py +0 -0
  242. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/models/test_box_map.py +0 -0
  243. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/models/test_box_ref.py +0 -0
  244. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/models/test_contract.py +0 -0
  245. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/models/test_uenumerate.py +0 -0
  246. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/models/test_urange.py +0 -0
  247. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/primitives/__init__.py +0 -0
  248. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/primitives/conftest.py +0 -0
  249. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/primitives/test_biguint.py +0 -0
  250. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/primitives/test_bytes.py +0 -0
  251. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/primitives/test_string.py +0 -0
  252. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/primitives/test_uint64.py +0 -0
  253. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/state/__init__.py +0 -0
  254. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/state/conftest.py +0 -0
  255. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/state/test_global_state.py +0 -0
  256. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/state/test_local_state.py +0 -0
  257. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/state/test_mutations.py +0 -0
  258. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/test_miscellaneous_op.py +0 -0
  259. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/test_op.py +0 -0
  260. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/util.py +0 -0
  261. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/utilities/__init__.py +0 -0
  262. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/utilities/conftest.py +0 -0
  263. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/utilities/test_log.py +0 -0
  264. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/value_generators/__init__.py +0 -0
  265. {algorand_python_testing-0.3.0b9 → algorand_python_testing-0.3.0b10}/tests/value_generators/test_avm.py +0 -0
@@ -42,3 +42,6 @@ jobs:
42
42
 
43
43
  - name: Run tests (examples)
44
44
  run: hatch run examples:tests
45
+
46
+ - name: Check doctests
47
+ run: hatch run docs:test
@@ -24,6 +24,9 @@ jobs:
24
24
  python-version: "3.12"
25
25
  cache: "pip"
26
26
 
27
+ - name: Test doctests
28
+ run: hatch run docs:test
29
+
27
30
  - name: Build doc
28
31
  run: hatch run docs:build
29
32
 
@@ -1,4 +1,6 @@
1
1
  # CHANGELOG
2
+ ## v0.3.0-beta.10 (2024-08-22)
3
+
2
4
  ## v0.3.0-beta.9 (2024-08-22)
3
5
 
4
6
  ## v0.3.0-beta.8 (2024-08-22)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: algorand-python-testing
3
- Version: 0.3.0b9
3
+ Version: 0.3.0b10
4
4
  Summary: Algorand Python testing library
5
5
  Project-URL: Documentation, https://github.com/algorandfoundation/puya/tree/main/algopy_testing#README.md
6
6
  Project-URL: Issues, https://github.com/algorandfoundation/puya/issues
@@ -1,5 +1,15 @@
1
1
  # API Reference
2
2
 
3
+ An overview of the `algorand-python-testing`'s `algopy_testing` module - covering the main classes and functions.
4
+
5
+ ```{hint}
6
+ Spotted a typo in documentation? This project is open source, please submit an issue or a PR on [GitHub](https://github.com/algorand/algorand-python-testing).
7
+ ```
8
+
9
+ ```{warning}
10
+ Note, assume `_algopy_testing` to refer to `algopy_testing` namespace in the auto-generated class documentation above. To be patched in near future.
11
+ ```
12
+
3
13
  ## Contexts
4
14
 
5
15
  ```{autodoc2-summary}
@@ -84,3 +84,13 @@ doctest_test_doctest_blocks = "default"
84
84
  sphinxmermaid_mermaid_init = {
85
85
  "theme": "dark",
86
86
  }
87
+
88
+ # Ignore specific warning types
89
+ # TODO : remove upon refining autodoc2 (or finding alternative to sphinx)
90
+ suppress_warnings = [
91
+ "myst.xref_missing",
92
+ "autodoc2.dup_item",
93
+ "ref.python", # Ignore Python reference warnings
94
+ "ref.class", # Ignore class reference warnings
95
+ "ref.obj", # Ignore object reference warnings
96
+ ]
@@ -0,0 +1,61 @@
1
+ # FAQ
2
+
3
+ ## What is a Test Context?
4
+
5
+ A Test Context is a context manager that provides a simulated Algorand environment for testing Python smart contracts. It allows developers to create and manipulate a virtual Algorand ecosystem for testing purposes. For more details, see the [Test Context section](testing-guide/concepts.md#test-context) in our documentation.
6
+
7
+ ## What is the Algorand Virtual Machine (AVM)?
8
+
9
+ The Algorand Virtual Machine (AVM) is the runtime environment for Algorand smart contracts. It executes the compiled code of smart contracts on the Algorand blockchain. To learn more about the AVM, visit the [official Algorand documentation](https://developer.algorand.org/docs/get-details/dapps/avm/).
10
+
11
+ ## What are Operational Codes in Algorand?
12
+
13
+ Operational Codes, or opcodes, are AVM instructions that are executed directly by the AVM. In the context of Algorand Python testing, these opcodes are provided by `algopy` stubs and are either emulated, implemented, or mocked by `algorand-python-testing`. For a comprehensive list of opcodes, refer to the [Algorand Developer Documentation](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/?from_query=OPcodes#template-modal-overlay).
14
+
15
+ ## What are Value Generators?
16
+
17
+ Value Generators are helper methods that generate randomized values for testing when the specific value of the tested type is not important. In the context of Algorand Python testing, these are represented by property on the context manager, accessed via `any.*` (or `any.arc4.*`, `any.txn.*`. in the case of ARC 4 types). To understand how to use Value Generators effectively, check out our [Value Generators section](testing-guide/concepts.md#value-generators) in the documentation.
18
+
19
+ ## What are the limitations of the Algorand Python Testing framework?
20
+
21
+ The Algorand Python Testing framework emulates the Algorand Virtual Machine (AVM) for unit testing Algorand Python smart contracts without interacting with the real Algorand Network. However, it has some limitations due to its scope and purpose:
22
+
23
+ 1. Simplified balance tracking and transaction validation
24
+ 2. No consensus mechanism or AVM network operations simulation
25
+ 3. Absence of a strict opcode budget system
26
+ 4. Certain cryptographic operations are mocked or simplified
27
+ 5. No state proof generation or verification
28
+
29
+ For scenarios where these limitations are crucial, it's recommended to pair this framework with integration testing. If you have a solid reason to justify introducing new emulated behaviour, please open an issue or contribute to the project on [Github](https://github.com/algorandfoundation/algorand-python-testing).
30
+
31
+ ## How does balance tracking work in the testing framework?
32
+
33
+ The framework uses simplified balance tracking and transaction validation. For scenarios where precise balance or fee verification is important, it's recommended to complement unit tests with integration testing.
34
+
35
+ ## Does the framework simulate the entire AVM network?
36
+
37
+ No, the framework does not simulate the entire AVM network or consensus mechanism. It focuses on emulating the parts of the AVM relevant to unit testing smart contracts.
38
+
39
+ ## How does the framework handle opcode budgets?
40
+
41
+ The framework does not implement a strict opcode budget system. For scenarios where validating opcode budget is crucial, it's recommended to use integration testing alongside this framework.
42
+
43
+ ## Are all cryptographic operations fully implemented?
44
+
45
+ Some cryptographic operations are mocked or simplified in the framework. For a detailed list of which operations are mocked, refer to the _mockable_ types under the [coverage](./coverage.md) section.
46
+
47
+ ## Can I use this framework for security-critical validations?
48
+
49
+ While this framework is useful for unit testing and local development, it should not be the only tool used for security-critical validations or performance benchmarking. It's designed to approximate AVM behavior for common scenarios. Always complement your testing with additional integration testing options available in `algokit`, where you can test against real localnet or testnet environments.
50
+
51
+ ## Is there an example of how to use this framework alongside integration tests?
52
+
53
+ Yes, the `algokit-python-template`, accessible via `algokit init`, provides a working example of how to structure `algorand-python-testing` along with regular integration tests against localnet.
54
+
55
+ ```{hint}
56
+ An `algokit-python-template` accessible via `algokit init -t python`, provides a comprehensive and customizable working example of how to structure `algorand-python-testing` along with regular integration tests against localnet.
57
+ ```
58
+
59
+ ## Is it compatible with `pytest`?
60
+
61
+ Yes, it is compatible with `pytest` and _any_ other python testing framework as its agnostic of the testing framework as long as its python. If you spot incompatibility with a certain tool, please open an issue or contribute to the project on [Github](https://github.com/algorandfoundation/algorand-python-testing).
@@ -13,18 +13,6 @@ The `algorand-python-testing` package provides:
13
13
  - An offline testing environment that simulates core AVM functionality
14
14
  - A familiar Pythonic experience, compatible with testing frameworks like [pytest](https://docs.pytest.org/en/latest/), [unittest](https://docs.python.org/3/library/unittest.html), and [hypothesis](https://hypothesis.readthedocs.io/en/latest/)
15
15
 
16
- ```{testsetup}
17
- import algopy
18
- import algopy_testing
19
- from algopy_testing import algopy_testing_context
20
-
21
- # Create the context manager for snippets below
22
- ctx_manager = algopy_testing_context()
23
-
24
- # Enter the context
25
- context = ctx_manager.__enter__()
26
- ```
27
-
28
16
  ## Quick Start
29
17
 
30
18
  `algopy` is a prerequisite for `algorand-python-testing`, providing stubs and type annotations for Algorand Python syntax. It enhances code completion and type checking when writing smart contracts. Note that this code isn't directly executable in standard Python interpreters; it's compiled by `puya` into TEAL for Algorand Network deployment.
@@ -188,11 +176,7 @@ hidden: true
188
176
  testing-guide/index
189
177
  examples
190
178
  coverage
191
- glossary
179
+ faq
192
180
  api
193
181
  algopy
194
182
  ```
195
-
196
- ```{testcleanup}
197
- ctx_manager.__exit__(None, None, None)
198
- ```
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "algorand-python-testing"
7
- version = "0.3.0-beta.9"
7
+ version = "0.3.0-beta.10"
8
8
  description = 'Algorand Python testing library'
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -150,8 +150,10 @@ post-install-commands = [
150
150
  ]
151
151
 
152
152
  [tool.hatch.envs.docs.scripts]
153
- build = "sphinx-build -b doctest docs docs/_build -W --keep-going -n -E"
154
- dev = "sphinx-build -b doctest docs docs/_build && sphinx-autobuild docs docs/_build"
153
+ test = "sphinx-build -b doctest docs docs/_build -W --keep-going -n -E"
154
+ clear = "rm -rf docs/_build"
155
+ build = "hatch run docs:clear && sphinx-build docs docs/_build -W --keep-going -n -E"
156
+ dev = "hatch run docs:test && sphinx-autobuild docs docs/_build"
155
157
 
156
158
  # Examples environment
157
159
  [tool.hatch.envs.examples]
@@ -104,6 +104,9 @@ def algopy_testing_context(
104
104
  """
105
105
  from _algopy_testing.context import AlgopyTestContext
106
106
 
107
+ if _var.get(None) is not None:
108
+ raise RuntimeError("Nested `algopy_testing_context`s are not allowed.")
109
+
107
110
  token = _var.set(
108
111
  AlgopyTestContext(
109
112
  default_sender=default_sender,
@@ -145,6 +145,8 @@ class TransactionContext:
145
145
  :param active_txn_overrides: Overrides for active txn
146
146
  :return: None
147
147
  """
148
+ if self._active_group is not None:
149
+ raise RuntimeError("Nested `create_group` calls are not allowed.")
148
150
  if gtxns and active_txn_overrides:
149
151
  raise ValueError("cannot specified gtxns and active_txn_overrides at the same time")
150
152
  if active_txn_index is not None and not gtxns:
@@ -164,18 +166,18 @@ class TransactionContext:
164
166
  last_app_call_txn = app_calls[-1]._txns[-1]
165
167
  active_txn_index = processed_gtxns.index(last_app_call_txn)
166
168
 
167
- previous_group = self._active_group
168
- active_group = self._active_group = TransactionGroup(
169
+ new_group = TransactionGroup(
169
170
  txns=processed_gtxns,
170
171
  active_txn_index=active_txn_index,
171
172
  active_txn_overrides=typing.cast(dict[str, typing.Any], active_txn_overrides),
172
173
  )
174
+ self._active_group = new_group
173
175
  try:
174
176
  yield
175
177
  finally:
176
- if active_group.txns:
177
- self._groups.append(active_group)
178
- self._active_group = previous_group
178
+ if new_group.txns:
179
+ self._groups.append(new_group)
180
+ self._active_group = None
179
181
 
180
182
  @contextlib.contextmanager
181
183
  def _get_or_create_group(self) -> Iterator[TransactionGroup]:
@@ -1,3 +1,6 @@
1
+ import typing
2
+ from contextlib import ExitStack
3
+
1
4
  import algopy.itxn
2
5
  import algosdk
3
6
  import pytest
@@ -15,6 +18,12 @@ from tests.artifacts.GlobalStateValidator.contract import GlobalStateValidator
15
18
  _ARC4_PREFIX_LEN = 2
16
19
 
17
20
 
21
+ @pytest.fixture()
22
+ def context() -> typing.Generator[AlgopyTestContext, None, None]:
23
+ with algopy_testing_context() as ctx:
24
+ yield ctx
25
+
26
+
18
27
  def test_patch_global_fields() -> None:
19
28
  with algopy_testing_context() as context:
20
29
  context.ledger.patch_global_fields(min_txn_fee=UInt64(100), min_balance=UInt64(10))
@@ -207,3 +216,31 @@ def test_arc4_variable_length_methods(
207
216
  value = func(bit_length)
208
217
  assert isinstance(value, type_)
209
218
  assert len(value.bytes) == expected_length + _ARC4_PREFIX_LEN # type: ignore[attr-defined]
219
+
220
+
221
+ def test_nested_contexts_exception() -> None:
222
+ with ExitStack() as stack:
223
+ _ = stack.enter_context(algopy_testing_context())
224
+ with pytest.raises(
225
+ RuntimeError, match="Nested `algopy_testing_context`s are not allowed."
226
+ ):
227
+ __ = stack.enter_context(algopy_testing_context())
228
+
229
+
230
+ def test_nested_create_group(context: AlgopyTestContext) -> None:
231
+ with (
232
+ pytest.raises(RuntimeError, match="Nested `create_group` calls are not allowed."),
233
+ context.txn.create_group(),
234
+ context.txn.create_group(),
235
+ ):
236
+ pass
237
+
238
+
239
+ def test_sequential_create_group(context: AlgopyTestContext) -> None:
240
+ with context.txn.create_group(gtxns=[context.any.txn.payment()]):
241
+ pass
242
+
243
+ with context.txn.create_group(gtxns=[context.any.txn.application_call()]):
244
+ pass
245
+
246
+ assert len(context.txn._groups) == 2
@@ -1,8 +0,0 @@
1
- # Glossary
2
-
3
- | Term | Definition |
4
- | ------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5
- | [**Test Context**](testing-guide/concepts.md#test-context) | A context manager that provides a simulated Algorand environment for testing Python smart contracts. |
6
- | [**Algorand Virtual Machine (AVM)**](https://developer.algorand.org/docs/get-details/dapps/avm/) | The AVM is the runtime environment for Algorand smart contracts. |
7
- | [**Operational codes**](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/?from_query=OPcodes#template-modal-overlay) | AVM instructions that are executed directly by the AVM, provided by `algopy` stubs and emulated/implemented or mocked by `algorand-python-testing`. |
8
- | [**Value generators**](testing-guide/concepts.md#value-generators) | Helper methods that generate randomized values for testing when the value of the tested type is not needed. Represented by instance methods on the context manager, prefixed with `any_*` (or `arc.any_*` in case of ARC 4 types). |