From 9e00771b0a62d2eb41ba7b6a2e966cb42b496d81 Mon Sep 17 00:00:00 2001 From: danceratopz Date: Thu, 30 Oct 2025 15:57:47 +0100 Subject: [PATCH] fix: restore default gas after in `fill` pytester test --- .../plugins/filler/tests/conftest.py | 15 +++++++++++++++ .../plugins/filler/tests/test_filler.py | 1 + 2 files changed, 16 insertions(+) create mode 100644 packages/testing/src/execution_testing/cli/pytest_commands/plugins/filler/tests/conftest.py diff --git a/packages/testing/src/execution_testing/cli/pytest_commands/plugins/filler/tests/conftest.py b/packages/testing/src/execution_testing/cli/pytest_commands/plugins/filler/tests/conftest.py new file mode 100644 index 0000000000..381c85f193 --- /dev/null +++ b/packages/testing/src/execution_testing/cli/pytest_commands/plugins/filler/tests/conftest.py @@ -0,0 +1,15 @@ +"""Pytest configuration for filler tests.""" + +from typing import Generator + +import pytest + + +@pytest.fixture +def restore_environment_defaults() -> Generator[None, None, None]: + """Restore EnvironmentDefaults.gas_limit after test runs to prevent side effects.""" + from execution_testing.test_types.block_types import EnvironmentDefaults + + original_gas_limit = EnvironmentDefaults.gas_limit + yield + EnvironmentDefaults.gas_limit = original_gas_limit diff --git a/packages/testing/src/execution_testing/cli/pytest_commands/plugins/filler/tests/test_filler.py b/packages/testing/src/execution_testing/cli/pytest_commands/plugins/filler/tests/test_filler.py index 1ceaa02b6c..6643c2d3a3 100644 --- a/packages/testing/src/execution_testing/cli/pytest_commands/plugins/filler/tests/test_filler.py +++ b/packages/testing/src/execution_testing/cli/pytest_commands/plugins/filler/tests/test_filler.py @@ -603,6 +603,7 @@ def test_max_gas_limit(state_test, pre, block_gas_limit) -> None: ), ], ) +@pytest.mark.usefixtures("restore_environment_defaults") def test_fill_variables( testdir: pytest.Testdir, args: list[str],