Skip to content

Commit 5d96acc

Browse files
committed
fix(tests): json_infra, imports, parse exceptions in some tests
1 parent 3d1bc88 commit 5d96acc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

tests/json_infra/helpers/load_blockchain_tests.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ def runtest(self) -> None:
148148
if key.startswith("expectException"):
149149
block_exception = value
150150
break
151+
if key == "exceptions":
152+
block_exception = value
153+
break
151154

152155
if block_exception:
153156
# TODO: Once all the specific exception types are thrown,

tests/json_infra/helpers/load_state_tests.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
from ethereum.exceptions import StateWithEmptyAccount
1313
from ethereum.utils.hexadecimal import hex_to_bytes
1414
from ethereum_spec_tools.evm_tools import create_parser
15-
from ethereum_spec_tools.evm_tools.statetest import TestCase as StateTestCase
16-
from ethereum_spec_tools.evm_tools.statetest import (
17-
read_test_case as read_state_test_case,
18-
)
15+
from ethereum_spec_tools.evm_tools.statetest import TestCase, read_test_case
1916
from ethereum_spec_tools.evm_tools.t8n import T8N
2017

2118
from .. import FORKS
@@ -30,13 +27,13 @@
3027
class StateTest(Item):
3128
"""Single state test case item."""
3229

33-
test_case: StateTestCase
30+
test_case: TestCase
3431
test_dict: Dict[str, Any]
3532

3633
def __init__(
3734
self,
3835
*args: Any,
39-
test_case: StateTestCase,
36+
test_case: TestCase,
4037
test_dict: Dict[str, Any],
4138
**kwargs: Any,
4239
) -> None:
@@ -149,7 +146,7 @@ def is_format(cls, test_dict: Dict[str, Any]) -> bool:
149146

150147
def collect(self) -> Iterable[Item | Collector]:
151148
"""Collect state test cases inside of this fixture."""
152-
for test_case in read_state_test_case(
149+
for test_case in read_test_case(
153150
test_file_path=self.test_file,
154151
key=self.test_key,
155152
test=self.test_dict,

0 commit comments

Comments
 (0)