diff --git a/examples/generators/production_python_smart_contract_python/pyproject.toml b/examples/generators/production_python_smart_contract_python/pyproject.toml index 2b718d1..99fda3c 100644 --- a/examples/generators/production_python_smart_contract_python/pyproject.toml +++ b/examples/generators/production_python_smart_contract_python/pyproject.toml @@ -11,7 +11,7 @@ python = "^3.12" algokit-utils = "^2.3.0" python-dotenv = "^1.0.0" algorand-python = "^2.0.0" -algorand-python-testing = "^0.3.0" +algorand-python-testing = "^0.4.0" [tool.poetry.group.dev.dependencies] algokit-client-generator = "^1.1.3" diff --git a/examples/generators/production_python_smart_contract_python/tests/hello_world_test.py b/examples/generators/production_python_smart_contract_python/tests/hello_world_test.py index 29951b0..b2d41ee 100644 --- a/examples/generators/production_python_smart_contract_python/tests/hello_world_test.py +++ b/examples/generators/production_python_smart_contract_python/tests/hello_world_test.py @@ -1,4 +1,4 @@ -from collections.abc import Generator +from collections.abc import Iterator import pytest from algopy_testing import AlgopyTestContext, algopy_testing_context @@ -7,10 +7,9 @@ @pytest.fixture() -def context() -> Generator[AlgopyTestContext, None, None]: +def context() -> Iterator[AlgopyTestContext]: with algopy_testing_context() as ctx: yield ctx - ctx.reset() def test_hello(context: AlgopyTestContext) -> None: diff --git a/examples/generators/production_python_smart_contract_typescript/pyproject.toml b/examples/generators/production_python_smart_contract_typescript/pyproject.toml index 3231b7d..b0e4ada 100644 --- a/examples/generators/production_python_smart_contract_typescript/pyproject.toml +++ b/examples/generators/production_python_smart_contract_typescript/pyproject.toml @@ -11,7 +11,7 @@ python = "^3.12" algokit-utils = "^2.3.0" python-dotenv = "^1.0.0" algorand-python = "^2.0.0" -algorand-python-testing = "^0.3.0" +algorand-python-testing = "^0.4.0" [tool.poetry.group.dev.dependencies] black = {extras = ["d"], version = "*"} diff --git a/examples/generators/starter_python_smart_contract_python/pyproject.toml b/examples/generators/starter_python_smart_contract_python/pyproject.toml index 7ab3fc2..8000ea4 100644 --- a/examples/generators/starter_python_smart_contract_python/pyproject.toml +++ b/examples/generators/starter_python_smart_contract_python/pyproject.toml @@ -11,7 +11,7 @@ python = "^3.12" algokit-utils = "^2.3.0" python-dotenv = "^1.0.0" algorand-python = "^2.0.0" -algorand-python-testing = "^0.3.0" +algorand-python-testing = "^0.4.0" [tool.poetry.group.dev.dependencies] algokit-client-generator = "^1.1.3" diff --git a/examples/generators/starter_python_smart_contract_typescript/pyproject.toml b/examples/generators/starter_python_smart_contract_typescript/pyproject.toml index 8255303..7db2d1f 100644 --- a/examples/generators/starter_python_smart_contract_typescript/pyproject.toml +++ b/examples/generators/starter_python_smart_contract_typescript/pyproject.toml @@ -11,7 +11,7 @@ python = "^3.12" algokit-utils = "^2.3.0" python-dotenv = "^1.0.0" algorand-python = "^2.0.0" -algorand-python-testing = "^0.3.0" +algorand-python-testing = "^0.4.0" [tool.poetry.group.dev.dependencies] puyapy = "*" diff --git a/examples/production_python/pyproject.toml b/examples/production_python/pyproject.toml index 8b8cd87..d5d82aa 100644 --- a/examples/production_python/pyproject.toml +++ b/examples/production_python/pyproject.toml @@ -11,7 +11,7 @@ python = "^3.12" algokit-utils = "^2.3.0" python-dotenv = "^1.0.0" algorand-python = "^2.0.0" -algorand-python-testing = "^0.3.0" +algorand-python-testing = "^0.4.0" [tool.poetry.group.dev.dependencies] algokit-client-generator = "^1.1.3" diff --git a/examples/production_python/tests/hello_world_test.py b/examples/production_python/tests/hello_world_test.py index 29951b0..b2d41ee 100644 --- a/examples/production_python/tests/hello_world_test.py +++ b/examples/production_python/tests/hello_world_test.py @@ -1,4 +1,4 @@ -from collections.abc import Generator +from collections.abc import Iterator import pytest from algopy_testing import AlgopyTestContext, algopy_testing_context @@ -7,10 +7,9 @@ @pytest.fixture() -def context() -> Generator[AlgopyTestContext, None, None]: +def context() -> Iterator[AlgopyTestContext]: with algopy_testing_context() as ctx: yield ctx - ctx.reset() def test_hello(context: AlgopyTestContext) -> None: diff --git a/examples/starter_python/pyproject.toml b/examples/starter_python/pyproject.toml index b087982..054571a 100644 --- a/examples/starter_python/pyproject.toml +++ b/examples/starter_python/pyproject.toml @@ -11,7 +11,7 @@ python = "^3.12" algokit-utils = "^2.3.0" python-dotenv = "^1.0.0" algorand-python = "^2.0.0" -algorand-python-testing = "^0.3.0" +algorand-python-testing = "^0.4.0" [tool.poetry.group.dev.dependencies] algokit-client-generator = "^1.1.3" diff --git a/template_content/pyproject.toml.jinja b/template_content/pyproject.toml.jinja index 9aefc86..a5e7eb7 100644 --- a/template_content/pyproject.toml.jinja +++ b/template_content/pyproject.toml.jinja @@ -11,7 +11,7 @@ python = "^3.12" algokit-utils = "^2.3.0" python-dotenv = "^1.0.0" algorand-python = "^2.0.0" -algorand-python-testing = "^0.3.0" +algorand-python-testing = "^0.4.0" [tool.poetry.group.dev.dependencies] {% if deployment_language == 'python' -%} diff --git a/template_content/{% if use_python_pytest %}tests{% endif %}/{% if use_python_pytest %}{{ contract_name }}_test.py{% endif %}.jinja b/template_content/{% if use_python_pytest %}tests{% endif %}/{% if use_python_pytest %}{{ contract_name }}_test.py{% endif %}.jinja index b515bc1..a8faaff 100644 --- a/template_content/{% if use_python_pytest %}tests{% endif %}/{% if use_python_pytest %}{{ contract_name }}_test.py{% endif %}.jinja +++ b/template_content/{% if use_python_pytest %}tests{% endif %}/{% if use_python_pytest %}{{ contract_name }}_test.py{% endif %}.jinja @@ -1,4 +1,4 @@ -from collections.abc import Generator +from collections.abc import Iterator import pytest from algopy_testing import AlgopyTestContext, algopy_testing_context @@ -7,10 +7,9 @@ from smart_contracts.{{ contract_name }}.contract import {{ contract_name.split( @pytest.fixture() -def context() -> Generator[AlgopyTestContext, None, None]: +def context() -> Iterator[AlgopyTestContext]: with algopy_testing_context() as ctx: yield ctx - ctx.reset() def test_hello(context: AlgopyTestContext) -> None: