Skip to content

Commit 8f48874

Browse files
committed
Remove old flaky decorator we longer use.
1 parent b99cb18 commit 8f48874

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

web3/_utils/module_testing/module_testing_utils.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
import asyncio
2-
import functools
3-
import pytest
42
from typing import (
53
TYPE_CHECKING,
64
Any,
7-
Callable,
85
Collection,
96
Dict,
107
Generator,
118
Literal,
129
Sequence,
13-
Tuple,
14-
Type,
1510
Union,
1611
)
1712

@@ -63,43 +58,6 @@
6358
flaky_geth_dev_mining = flaky(max_runs=3, min_passes=1)
6459

6560

66-
def flaky_with_xfail_on_exception(
67-
reason: str,
68-
exception: Union[Type[Exception], Tuple[Type[Exception], ...]],
69-
max_runs: int = 3,
70-
min_passes: int = 1,
71-
) -> Callable[[Any], Any]:
72-
"""
73-
Some tests inconsistently fail hard with a particular exception and retrying
74-
these tests often times does not get them "unstuck". If we've exhausted all flaky
75-
retries and this expected exception is raised, `xfail` the test with the given
76-
reason.
77-
"""
78-
runs = max_runs
79-
80-
def decorator(func: Any) -> Any:
81-
@flaky(max_runs=max_runs, min_passes=min_passes)
82-
@functools.wraps(func)
83-
async def wrapper(self: Any, *args: Any, **kwargs: Any) -> Any:
84-
nonlocal runs
85-
try:
86-
return await func(self, *args, **kwargs)
87-
except exception:
88-
# xfail the test only if the exception is raised and we have exhausted
89-
# all flaky retries
90-
if runs == 1:
91-
pytest.xfail(reason)
92-
runs -= 1
93-
pytest.fail(f"xfailed but {runs} run(s) remaining with flaky...")
94-
except Exception as e:
95-
# let flaky handle it
96-
raise e
97-
98-
return wrapper
99-
100-
return decorator
101-
102-
10361
def assert_contains_log(
10462
result: Sequence[LogReceipt],
10563
block_with_txn_with_log: BlockData,

0 commit comments

Comments
 (0)