Skip to content

Commit 602d57c

Browse files
refactor: typing update
1 parent 59c9242 commit 602d57c

File tree

1 file changed

+4
-7
lines changed
  • packages/testing/src/execution_testing/cli/pytest_commands/plugins/shared

1 file changed

+4
-7
lines changed

packages/testing/src/execution_testing/cli/pytest_commands/plugins/shared/address_stubs.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import warnings
99
from pathlib import Path
10-
from typing import Dict, Self, Union
10+
from typing import Dict, Self
1111

1212
from pydantic import model_validator
1313

@@ -43,10 +43,7 @@ def _validate_key_matches_address(self) -> Self:
4343
return self
4444

4545

46-
StubEntry = Union[StubAddress, StubEOA]
47-
48-
49-
class AddressStubs(EthereumTestRootModel[Dict[str, StubEntry]]):
46+
class AddressStubs(EthereumTestRootModel[Dict[str, StubAddress | StubEOA]]):
5047
"""
5148
Address stubs class.
5249
@@ -55,7 +52,7 @@ class AddressStubs(EthereumTestRootModel[Dict[str, StubEntry]]):
5552
the on-chain address and an optional private key.
5653
"""
5754

58-
root: Dict[str, StubEntry]
55+
root: Dict[str, StubAddress | StubEOA]
5956

6057
def __contains__(self, item: str) -> bool:
6158
"""Check if an item is in the address stubs."""
@@ -65,7 +62,7 @@ def __getitem__(self, item: str) -> Address:
6562
"""Get the address for a stub label."""
6663
return self.root[item].addr
6764

68-
def get_entry(self, item: str) -> StubEntry:
65+
def get_entry(self, item: str) -> StubAddress | StubEOA:
6966
"""Get the full stub entry for a label."""
7067
return self.root[item]
7168

0 commit comments

Comments
 (0)