Skip to content

Commit

Permalink
Run isort across all files
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjw committed Aug 29, 2018
1 parent a767dc8 commit 54cd2ad
Show file tree
Hide file tree
Showing 36 changed files with 191 additions and 172 deletions.
10 changes: 6 additions & 4 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
import time
import warnings

from web3.providers.eth_tester import (
EthereumTesterProvider,
)
from web3._utils.threads import (
Timeout,
)
from web3.main import Web3
from web3.main import (
Web3,
)
from web3.providers.eth_tester import (
EthereumTesterProvider,
)


class PollDelayCounter:
Expand Down
12 changes: 6 additions & 6 deletions tests/core/contracts/test_contract_call_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
HexBytes,
)

from web3._utils.ens import (
contract_ens_addresses,
)
from web3._utils.toolz import (
identity,
)
from web3.exceptions import (
BadFunctionCallOutput,
BlockNumberOutofRange,
Expand All @@ -21,12 +27,6 @@
NoABIFunctionsFound,
ValidationError,
)
from web3._utils.ens import (
contract_ens_addresses,
)
from web3._utils.toolz import (
identity,
)

# Ignore warning in pyethereum 1.6 - will go away with the upgrade
pytestmark = pytest.mark.filterwarnings("ignore:implicit cast from 'char *'")
Expand Down
8 changes: 4 additions & 4 deletions tests/core/contracts/test_contract_init.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import pytest

from web3.exceptions import (
BadFunctionCallOutput,
NameNotFound,
)
from web3._utils.ens import (
contract_ens_addresses,
ens_addresses,
)
from web3.exceptions import (
BadFunctionCallOutput,
NameNotFound,
)


@pytest.fixture()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import json
import pytest

from web3.exceptions import (
ValidationError,
)
from web3._utils.abi import (
get_abi_input_types,
)
from web3._utils.function_identifiers import (
FallbackFn,
)
from web3.exceptions import (
ValidationError,
)

SINGLE_FN_NO_ARGS = json.loads('[{"constant":false,"inputs":[],"name":"a","outputs":[],"type":"function"}]') # noqa: E501
SINGLE_FN_ONE_ARG = json.loads('[{"constant":false,"inputs":[{"name":"","type":"uint256"}],"name":"a","outputs":[],"type":"function"}]') # noqa: E501
Expand Down
6 changes: 3 additions & 3 deletions tests/core/eth-module/test_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
Account,
Web3,
)
from web3.providers.eth_tester import (
EthereumTesterProvider,
)
from web3._utils.encoding import (
to_bytes,
to_hex,
)
from web3._utils.toolz import (
dissoc,
)
from web3.providers.eth_tester import (
EthereumTesterProvider,
)

# from https://github.com/ethereum/tests/blob/3930ca3a9a377107d5792b3e7202f79c688f1a67/BasicTests/txtest.json # noqa: 501
ETH_TEST_TRANSACTIONS = [
Expand Down
6 changes: 3 additions & 3 deletions tests/core/filtering/test_existing_filter_instance.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import pytest

from web3.providers.eth_tester import (
EthereumTesterProvider,
)
from web3._utils.threads import (
Timeout,
)
from web3.providers.eth_tester import (
EthereumTesterProvider,
)


@pytest.fixture()
Expand Down
6 changes: 3 additions & 3 deletions tests/core/filtering/test_filter_against_latest_blocks.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from web3.providers.eth_tester import (
EthereumTesterProvider,
)
from web3._utils.threads import (
Timeout,
)
from web3.providers.eth_tester import (
EthereumTesterProvider,
)


def test_sync_filter_against_latest_blocks(web3, sleep_interval, wait_for_block):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
)

from web3 import Web3
from web3._utils.caching import (
generate_cache_key,
)
from web3.middleware import ( # noqa: F401
construct_error_generator_middleware,
construct_latest_block_based_cache_middleware,
Expand All @@ -18,9 +21,6 @@
from web3.providers.base import (
BaseProvider,
)
from web3._utils.caching import (
generate_cache_key,
)


@pytest.fixture
Expand Down
6 changes: 3 additions & 3 deletions tests/core/middleware/test_simple_cache_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import uuid

from web3 import Web3
from web3._utils.caching import (
generate_cache_key,
)
from web3.middleware import (
construct_error_generator_middleware,
construct_result_generator_middleware,
Expand All @@ -11,9 +14,6 @@
from web3.providers.base import (
BaseProvider,
)
from web3._utils.caching import (
generate_cache_key,
)


@pytest.fixture
Expand Down
6 changes: 3 additions & 3 deletions tests/core/middleware/test_stalecheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
patch,
)

from web3._utils.datastructures import (
AttributeDict,
)
from web3.middleware import (
make_stalecheck_middleware,
)
from web3.middleware.stalecheck import (
StaleBlockchain,
_isfresh,
)
from web3._utils.datastructures import (
AttributeDict,
)


@pytest.fixture
Expand Down
6 changes: 3 additions & 3 deletions tests/core/middleware/test_time_based_cache_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import uuid

from web3 import Web3
from web3._utils.caching import (
generate_cache_key,
)
from web3.middleware import ( # noqa: F401
construct_error_generator_middleware,
construct_result_generator_middleware,
Expand All @@ -12,9 +15,6 @@
from web3.providers.base import (
BaseProvider,
)
from web3._utils.caching import (
generate_cache_key,
)


@pytest.fixture
Expand Down
10 changes: 5 additions & 5 deletions tests/core/middleware/test_transaction_signing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
)

from web3 import Web3
from web3._utils.toolz import (
identity,
merge,
valfilter,
)
from web3.exceptions import (
InvalidAddress,
)
Expand All @@ -27,11 +32,6 @@
from web3.providers.eth_tester import (
EthereumTesterProvider,
)
from web3._utils.toolz import (
identity,
merge,
valfilter,
)

PRIVATE_KEY_1 = to_bytes(
hexstr='0x6a8b4de52b288e111c14e1c4b868bc125d325d40331d86d875a3467dd44bf829')
Expand Down
6 changes: 3 additions & 3 deletions tests/core/utilities/test_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
strategies as st,
)

from web3.providers import (
JSONBaseProvider,
)
from web3._utils.encoding import (
FriendlyJsonSerde as FriendlyJson,
hex_encode_abi_type,
Expand All @@ -30,6 +27,9 @@
from web3._utils.hypothesis import (
hexstr_strategy,
)
from web3.providers import (
JSONBaseProvider,
)


@pytest.mark.parametrize(
Expand Down
6 changes: 3 additions & 3 deletions tests/core/utilities/test_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
strategies as st,
)

from web3.exceptions import (
InsufficientData,
)
from web3._utils.math import (
percentile,
)
from web3.exceptions import (
InsufficientData,
)

values = range(100)

Expand Down
6 changes: 3 additions & 3 deletions tests/core/utilities/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
to_bytes,
)

from web3.exceptions import (
InvalidAddress,
)
from web3._utils.validation import (
validate_abi,
validate_abi_type,
validate_abi_value,
validate_address,
)
from web3.exceptions import (
InvalidAddress,
)

ABI = [
{
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/test_ethereum_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
)

from web3 import Web3
from web3.providers.eth_tester import (
EthereumTesterProvider,
)
from web3._utils.module_testing import (
EthModuleTest,
NetModuleTest,
Expand All @@ -23,6 +20,9 @@
from web3._utils.module_testing.emitter_contract import (
EMITTER_ENUM,
)
from web3.providers.eth_tester import (
EthereumTesterProvider,
)

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

Expand Down
6 changes: 3 additions & 3 deletions web3/_utils/abi.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
to_tuple,
)

from web3.exceptions import (
FallbackNotFound,
)
from web3._utils.ens import (
is_ens_name,
)
Expand All @@ -33,6 +30,9 @@
partial,
pipe,
)
from web3.exceptions import (
FallbackNotFound,
)


def filter_by_type(_type, contract_abi):
Expand Down
6 changes: 3 additions & 3 deletions web3/_utils/contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
HexBytes,
)

from web3.exceptions import (
ValidationError,
)
from web3._utils.abi import (
abi_to_signature,
check_if_arguments_can_be_encoded,
Expand Down Expand Up @@ -48,6 +45,9 @@
pipe,
valmap,
)
from web3.exceptions import (
ValidationError,
)


def find_matching_event_abi(abi, event_name=None, argument_names=None):
Expand Down
6 changes: 3 additions & 3 deletions web3/_utils/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
to_tuple,
)

from web3.exceptions import (
MismatchedABI,
)
from web3._utils.datastructures import (
AttributeDict,
)
Expand All @@ -32,6 +29,9 @@
compose,
curry,
)
from web3.exceptions import (
MismatchedABI,
)

from .abi import (
exclude_indexed_event_inputs,
Expand Down
6 changes: 3 additions & 3 deletions web3/_utils/module_testing/web3_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
)

from web3 import Web3
from web3.exceptions import (
InvalidAddress,
)
from web3._utils.ens import (
ens_addresses,
)
from web3.exceptions import (
InvalidAddress,
)


class Web3ModuleTest:
Expand Down
Loading

0 comments on commit 54cd2ad

Please sign in to comment.