Skip to content

Commit d459d61

Browse files
committed
Use top level imports in tests where possible
1 parent fdd0409 commit d459d61

7 files changed

Lines changed: 13 additions & 9 deletions

File tree

tests/test_abi_types.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
import pytest
55
from ethereum_rpc import Address, keccak
66

7-
from pons import abi
7+
from pons import ABI_JSON, ABIDecodingError, abi
88
from pons._abi_types import (
9-
ABI_JSON,
10-
ABIDecodingError,
119
ABIType,
1210
Type,
1311
decode_args,

tests/test_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from pons import (
2121
ABIDecodingError,
2222
AccountSigner,
23+
BadResponseFormat,
2324
BoundEvent,
2425
Client,
2526
ClientSession,
@@ -33,11 +34,11 @@
3334
Method,
3435
Mutability,
3536
ProviderError,
37+
TransactionFailed,
3638
abi,
3739
compile_contract_file,
3840
)
3941
from pons._abi_types import encode_args
40-
from pons._client import BadResponseFormat, TransactionFailed
4142
from pons._contract_abi import PANIC_ERROR
4243
from pons._provider import RPC_JSON
4344

tests/test_client_rpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
from pons import (
2424
AccountSigner,
25+
BadResponseFormat,
2526
ClientSession,
2627
CompiledContract,
2728
Either,
@@ -31,7 +32,6 @@
3132
compile_contract_file,
3233
)
3334
from pons._abi_types import encode_args
34-
from pons._client_rpc import BadResponseFormat
3535
from pons._provider import RPC_JSON
3636

3737

tests/test_contract.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
from ethereum_rpc import Address, BlockHash, LogEntry, LogTopic, TxHash, keccak
55

66
from pons import (
7+
BoundMethod,
78
CompiledContract,
89
Constructor,
10+
DeployedContract,
911
Event,
1012
Fallback,
1113
Method,
@@ -14,7 +16,6 @@
1416
compile_contract_file,
1517
)
1618
from pons._abi_types import encode_args
17-
from pons._contract import BoundMethod, DeployedContract
1819

1920

2021
@pytest.fixture

tests/test_fallback_provider.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@
1111
CycleFallback,
1212
FallbackProvider,
1313
HTTPError,
14+
InvalidResponse,
1415
PriorityFallback,
1516
ProtocolError,
17+
Provider,
1618
ProviderError,
19+
ProviderPath,
1720
Unreachable,
1821
)
1922
from pons._fallback_provider import PriorityFallbackStrategy
20-
from pons._provider import RPC_JSON, InvalidResponse, Provider, ProviderPath, ProviderSession
23+
from pons._provider import RPC_JSON, ProviderSession
2124

2225

2326
def random_request() -> str:

tests/test_provider.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
LocalProvider,
2020
Provider,
2121
ProviderError,
22+
ProviderPath,
2223
_http_provider_server, # For monkeypatching purposes
2324
)
24-
from pons._provider import RPC_JSON, ProviderPath, ProviderSession
25+
from pons._provider import RPC_JSON, ProviderSession
2526

2627

2728
@pytest.fixture

tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
EVMVersion,
1111
compile_contract_file,
1212
get_create2_address,
13+
get_create_address,
1314
)
14-
from pons._utils import get_create_address
1515

1616

1717
@pytest.fixture

0 commit comments

Comments
 (0)