Skip to content

Commit aa6232e

Browse files
committed
Add flaky decorator to both estimateGas tests
1 parent c89c1fc commit aa6232e

File tree

2 files changed

+29
-18
lines changed

2 files changed

+29
-18
lines changed

tests/integration/go_ethereum/common.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
import pytest
22

3+
from eth_typing import (
4+
ChecksumAddress,
5+
)
6+
from flaky import (
7+
flaky,
8+
)
9+
from typing import (
10+
TYPE_CHECKING,
11+
)
12+
313
from web3._utils.module_testing import ( # noqa: F401
414
AsyncEthModuleTest,
515
AsyncNetModuleTest,
@@ -13,6 +23,11 @@
1323
Web3ModuleTest,
1424
)
1525

26+
if TYPE_CHECKING:
27+
from web3 import ( # noqa: F401
28+
Web3,
29+
)
30+
1631

1732
class GoEthereumTest(Web3ModuleTest):
1833
def _check_web3_clientVersion(self, client_version):
@@ -40,6 +55,18 @@ def test_eth_protocol_version(self, w3):
4055
def test_eth_protocolVersion(self, w3):
4156
super().test_eth_protocolVersion(w3)
4257

58+
@flaky(max_runs=3)
59+
def test_eth_estimate_gas(
60+
self, w3: "Web3", unlocked_account_dual_type: ChecksumAddress
61+
) -> None:
62+
super().test_eth_estimate_gas(w3, unlocked_account_dual_type)
63+
64+
@flaky(max_runs=3)
65+
def test_eth_estimateGas_deprecated(
66+
self, w3: "Web3", unlocked_account_dual_type: ChecksumAddress
67+
) -> None:
68+
super().test_eth_estimateGas_deprecated(w3, unlocked_account_dual_type)
69+
4370

4471
class GoEthereumVersionModuleTest(VersionModuleTest):
4572
@pytest.mark.xfail(reason='eth_protocolVersion was removed in Geth 1.10.0')

tests/integration/go_ethereum/test_goethereum_http.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
import pytest
22

33
import pytest_asyncio
4-
from flaky import (
5-
flaky,
6-
)
74

8-
from eth_typing import (
9-
ChecksumAddress,
10-
)
115
from tests.utils import (
126
get_open_port,
137
)
14-
from typing import (
15-
TYPE_CHECKING,
16-
)
178
from web3 import Web3
189
from web3._utils.module_testing.go_ethereum_admin_module import (
1910
GoEthereumAsyncAdminModuleTest,
@@ -60,10 +51,6 @@
6051
)
6152

6253

63-
if TYPE_CHECKING:
64-
from web3 import Web3 # noqa: F401
65-
66-
6754
@pytest.fixture(scope="module")
6855
def rpc_port():
6956
return get_open_port()
@@ -171,11 +158,8 @@ async def test_admin_start_stop_ws(self, w3: "Web3") -> None:
171158

172159

173160
class TestGoEthereumEthModuleTest(GoEthereumEthModuleTest):
174-
@flaky(max_runs=3)
175-
def test_eth_estimate_gas(
176-
self, w3: "Web3", unlocked_account_dual_type: ChecksumAddress
177-
) -> None:
178-
pass
161+
pass
162+
179163

180164
class TestGoEthereumVersionModuleTest(GoEthereumVersionModuleTest):
181165
pass

0 commit comments

Comments
 (0)