Skip to content

Commit 54cd2ad

Browse files
committed
Run isort across all files
1 parent a767dc8 commit 54cd2ad

36 files changed

+191
-172
lines changed

conftest.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
import time
33
import warnings
44

5-
from web3.providers.eth_tester import (
6-
EthereumTesterProvider,
7-
)
85
from web3._utils.threads import (
96
Timeout,
107
)
11-
from web3.main import Web3
8+
from web3.main import (
9+
Web3,
10+
)
11+
from web3.providers.eth_tester import (
12+
EthereumTesterProvider,
13+
)
1214

1315

1416
class PollDelayCounter:

tests/core/contracts/test_contract_call_interface.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
HexBytes,
1414
)
1515

16+
from web3._utils.ens import (
17+
contract_ens_addresses,
18+
)
19+
from web3._utils.toolz import (
20+
identity,
21+
)
1622
from web3.exceptions import (
1723
BadFunctionCallOutput,
1824
BlockNumberOutofRange,
@@ -21,12 +27,6 @@
2127
NoABIFunctionsFound,
2228
ValidationError,
2329
)
24-
from web3._utils.ens import (
25-
contract_ens_addresses,
26-
)
27-
from web3._utils.toolz import (
28-
identity,
29-
)
3030

3131
# Ignore warning in pyethereum 1.6 - will go away with the upgrade
3232
pytestmark = pytest.mark.filterwarnings("ignore:implicit cast from 'char *'")

tests/core/contracts/test_contract_init.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import pytest
22

3-
from web3.exceptions import (
4-
BadFunctionCallOutput,
5-
NameNotFound,
6-
)
73
from web3._utils.ens import (
84
contract_ens_addresses,
95
ens_addresses,
106
)
7+
from web3.exceptions import (
8+
BadFunctionCallOutput,
9+
NameNotFound,
10+
)
1111

1212

1313
@pytest.fixture()

tests/core/contracts/test_contract_method_to_argument_matching.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import json
22
import pytest
33

4-
from web3.exceptions import (
5-
ValidationError,
6-
)
74
from web3._utils.abi import (
85
get_abi_input_types,
96
)
107
from web3._utils.function_identifiers import (
118
FallbackFn,
129
)
10+
from web3.exceptions import (
11+
ValidationError,
12+
)
1313

1414
SINGLE_FN_NO_ARGS = json.loads('[{"constant":false,"inputs":[],"name":"a","outputs":[],"type":"function"}]') # noqa: E501
1515
SINGLE_FN_ONE_ARG = json.loads('[{"constant":false,"inputs":[{"name":"","type":"uint256"}],"name":"a","outputs":[],"type":"function"}]') # noqa: E501

tests/core/eth-module/test_accounts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
Account,
1717
Web3,
1818
)
19-
from web3.providers.eth_tester import (
20-
EthereumTesterProvider,
21-
)
2219
from web3._utils.encoding import (
2320
to_bytes,
2421
to_hex,
2522
)
2623
from web3._utils.toolz import (
2724
dissoc,
2825
)
26+
from web3.providers.eth_tester import (
27+
EthereumTesterProvider,
28+
)
2929

3030
# from https://github.com/ethereum/tests/blob/3930ca3a9a377107d5792b3e7202f79c688f1a67/BasicTests/txtest.json # noqa: 501
3131
ETH_TEST_TRANSACTIONS = [

tests/core/filtering/test_existing_filter_instance.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import pytest
22

3-
from web3.providers.eth_tester import (
4-
EthereumTesterProvider,
5-
)
63
from web3._utils.threads import (
74
Timeout,
85
)
6+
from web3.providers.eth_tester import (
7+
EthereumTesterProvider,
8+
)
99

1010

1111
@pytest.fixture()

tests/core/filtering/test_filter_against_latest_blocks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
from web3.providers.eth_tester import (
2-
EthereumTesterProvider,
3-
)
41
from web3._utils.threads import (
52
Timeout,
63
)
4+
from web3.providers.eth_tester import (
5+
EthereumTesterProvider,
6+
)
77

88

99
def test_sync_filter_against_latest_blocks(web3, sleep_interval, wait_for_block):

tests/core/middleware/test_latest_block_based_cache_middleware.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
)
1111

1212
from web3 import Web3
13+
from web3._utils.caching import (
14+
generate_cache_key,
15+
)
1316
from web3.middleware import ( # noqa: F401
1417
construct_error_generator_middleware,
1518
construct_latest_block_based_cache_middleware,
@@ -18,9 +21,6 @@
1821
from web3.providers.base import (
1922
BaseProvider,
2023
)
21-
from web3._utils.caching import (
22-
generate_cache_key,
23-
)
2424

2525

2626
@pytest.fixture

tests/core/middleware/test_simple_cache_middleware.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import uuid
44

55
from web3 import Web3
6+
from web3._utils.caching import (
7+
generate_cache_key,
8+
)
69
from web3.middleware import (
710
construct_error_generator_middleware,
811
construct_result_generator_middleware,
@@ -11,9 +14,6 @@
1114
from web3.providers.base import (
1215
BaseProvider,
1316
)
14-
from web3._utils.caching import (
15-
generate_cache_key,
16-
)
1717

1818

1919
@pytest.fixture

tests/core/middleware/test_stalecheck.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
patch,
66
)
77

8+
from web3._utils.datastructures import (
9+
AttributeDict,
10+
)
811
from web3.middleware import (
912
make_stalecheck_middleware,
1013
)
1114
from web3.middleware.stalecheck import (
1215
StaleBlockchain,
1316
_isfresh,
1417
)
15-
from web3._utils.datastructures import (
16-
AttributeDict,
17-
)
1818

1919

2020
@pytest.fixture

tests/core/middleware/test_time_based_cache_middleware.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
import uuid
55

66
from web3 import Web3
7+
from web3._utils.caching import (
8+
generate_cache_key,
9+
)
710
from web3.middleware import ( # noqa: F401
811
construct_error_generator_middleware,
912
construct_result_generator_middleware,
@@ -12,9 +15,6 @@
1215
from web3.providers.base import (
1316
BaseProvider,
1417
)
15-
from web3._utils.caching import (
16-
generate_cache_key,
17-
)
1818

1919

2020
@pytest.fixture

tests/core/middleware/test_transaction_signing.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
)
1212

1313
from web3 import Web3
14+
from web3._utils.toolz import (
15+
identity,
16+
merge,
17+
valfilter,
18+
)
1419
from web3.exceptions import (
1520
InvalidAddress,
1621
)
@@ -27,11 +32,6 @@
2732
from web3.providers.eth_tester import (
2833
EthereumTesterProvider,
2934
)
30-
from web3._utils.toolz import (
31-
identity,
32-
merge,
33-
valfilter,
34-
)
3535

3636
PRIVATE_KEY_1 = to_bytes(
3737
hexstr='0x6a8b4de52b288e111c14e1c4b868bc125d325d40331d86d875a3467dd44bf829')

tests/core/utilities/test_encoding.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
strategies as st,
1717
)
1818

19-
from web3.providers import (
20-
JSONBaseProvider,
21-
)
2219
from web3._utils.encoding import (
2320
FriendlyJsonSerde as FriendlyJson,
2421
hex_encode_abi_type,
@@ -30,6 +27,9 @@
3027
from web3._utils.hypothesis import (
3128
hexstr_strategy,
3229
)
30+
from web3.providers import (
31+
JSONBaseProvider,
32+
)
3333

3434

3535
@pytest.mark.parametrize(

tests/core/utilities/test_math.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
strategies as st,
66
)
77

8-
from web3.exceptions import (
9-
InsufficientData,
10-
)
118
from web3._utils.math import (
129
percentile,
1310
)
11+
from web3.exceptions import (
12+
InsufficientData,
13+
)
1414

1515
values = range(100)
1616

tests/core/utilities/test_validation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
to_bytes,
55
)
66

7-
from web3.exceptions import (
8-
InvalidAddress,
9-
)
107
from web3._utils.validation import (
118
validate_abi,
129
validate_abi_type,
1310
validate_abi_value,
1411
validate_address,
1512
)
13+
from web3.exceptions import (
14+
InvalidAddress,
15+
)
1616

1717
ABI = [
1818
{

tests/integration/test_ethereum_tester.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
)
1111

1212
from web3 import Web3
13-
from web3.providers.eth_tester import (
14-
EthereumTesterProvider,
15-
)
1613
from web3._utils.module_testing import (
1714
EthModuleTest,
1815
NetModuleTest,
@@ -23,6 +20,9 @@
2320
from web3._utils.module_testing.emitter_contract import (
2421
EMITTER_ENUM,
2522
)
23+
from web3.providers.eth_tester import (
24+
EthereumTesterProvider,
25+
)
2626

2727
pytestmark = pytest.mark.filterwarnings("ignore:implicit cast from 'char *'")
2828

web3/_utils/abi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
to_tuple,
2020
)
2121

22-
from web3.exceptions import (
23-
FallbackNotFound,
24-
)
2522
from web3._utils.ens import (
2623
is_ens_name,
2724
)
@@ -33,6 +30,9 @@
3330
partial,
3431
pipe,
3532
)
33+
from web3.exceptions import (
34+
FallbackNotFound,
35+
)
3636

3737

3838
def filter_by_type(_type, contract_abi):

web3/_utils/contracts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
HexBytes,
1717
)
1818

19-
from web3.exceptions import (
20-
ValidationError,
21-
)
2219
from web3._utils.abi import (
2320
abi_to_signature,
2421
check_if_arguments_can_be_encoded,
@@ -48,6 +45,9 @@
4845
pipe,
4946
valmap,
5047
)
48+
from web3.exceptions import (
49+
ValidationError,
50+
)
5151

5252

5353
def find_matching_event_abi(abi, event_name=None, argument_names=None):

web3/_utils/events.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
to_tuple,
1616
)
1717

18-
from web3.exceptions import (
19-
MismatchedABI,
20-
)
2118
from web3._utils.datastructures import (
2219
AttributeDict,
2320
)
@@ -32,6 +29,9 @@
3229
compose,
3330
curry,
3431
)
32+
from web3.exceptions import (
33+
MismatchedABI,
34+
)
3535

3636
from .abi import (
3737
exclude_indexed_event_inputs,

web3/_utils/module_testing/web3_module.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
)
66

77
from web3 import Web3
8-
from web3.exceptions import (
9-
InvalidAddress,
10-
)
118
from web3._utils.ens import (
129
ens_addresses,
1310
)
11+
from web3.exceptions import (
12+
InvalidAddress,
13+
)
1414

1515

1616
class Web3ModuleTest:

0 commit comments

Comments
 (0)