Skip to content

Commit d9a3070

Browse files
refactor: typing update
1 parent 59c9242 commit d9a3070

File tree

1 file changed

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

1 file changed

+6
-7
lines changed

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

Lines changed: 6 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,9 @@ 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(
47+
EthereumTestRootModel[Dict[str, StubAddress | StubEOA]]
48+
):
5049
"""
5150
Address stubs class.
5251
@@ -55,7 +54,7 @@ class AddressStubs(EthereumTestRootModel[Dict[str, StubEntry]]):
5554
the on-chain address and an optional private key.
5655
"""
5756

58-
root: Dict[str, StubEntry]
57+
root: Dict[str, StubAddress | StubEOA]
5958

6059
def __contains__(self, item: str) -> bool:
6160
"""Check if an item is in the address stubs."""
@@ -65,7 +64,7 @@ def __getitem__(self, item: str) -> Address:
6564
"""Get the address for a stub label."""
6665
return self.root[item].addr
6766

68-
def get_entry(self, item: str) -> StubEntry:
67+
def get_entry(self, item: str) -> StubAddress | StubEOA:
6968
"""Get the full stub entry for a label."""
7069
return self.root[item]
7170

0 commit comments

Comments
 (0)