Skip to content

Commit

Permalink
style(tests): apply isort 5
Browse files Browse the repository at this point in the history
  • Loading branch information
matejcik committed Aug 16, 2023
1 parent b008367 commit b151a3d
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 21 deletions.
3 changes: 2 additions & 1 deletion tests/click_tests/test_autolock.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
from .common import go_next

if TYPE_CHECKING:
from ..device_handler import BackgroundDeviceHandler
from trezorlib.debuglink import DebugLink, LayoutContent

from ..device_handler import BackgroundDeviceHandler

TX_CACHE_MAINNET = TxCache("Bitcoin")
TX_CACHE_TESTNET = TxCache("Testnet")

Expand Down
3 changes: 2 additions & 1 deletion tests/click_tests/test_passphrase_tr.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
)

if TYPE_CHECKING:
from ..device_handler import BackgroundDeviceHandler
from trezorlib.debuglink import DebugLink

from ..device_handler import BackgroundDeviceHandler


pytestmark = [pytest.mark.skip_t1, pytest.mark.skip_t2]

Expand Down
3 changes: 2 additions & 1 deletion tests/click_tests/test_passphrase_tt.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
from .common import CommonPass, PassphraseCategory, get_char_category

if TYPE_CHECKING:
from ..device_handler import BackgroundDeviceHandler
from trezorlib.debuglink import DebugLink

from ..device_handler import BackgroundDeviceHandler


pytestmark = [pytest.mark.skip_t1, pytest.mark.skip_tr]

Expand Down
3 changes: 2 additions & 1 deletion tests/click_tests/test_pin.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
from .common import go_back, go_next, navigate_to_action_and_press

if TYPE_CHECKING:
from ..device_handler import BackgroundDeviceHandler
from trezorlib.debuglink import DebugLink

from ..device_handler import BackgroundDeviceHandler


pytestmark = pytest.mark.skip_t1

Expand Down
3 changes: 2 additions & 1 deletion tests/click_tests/test_recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
from . import recovery

if TYPE_CHECKING:
from ..device_handler import BackgroundDeviceHandler
from trezorlib.debuglink import DebugLink

from ..device_handler import BackgroundDeviceHandler


pytestmark = [pytest.mark.skip_t1]

Expand Down
3 changes: 2 additions & 1 deletion tests/click_tests/test_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
from trezorlib.exceptions import Cancelled

if TYPE_CHECKING:
from ..device_handler import BackgroundDeviceHandler
from trezorlib.debuglink import DebugLink

from ..device_handler import BackgroundDeviceHandler


# TR-only
pytestmark = [pytest.mark.skip_t1, pytest.mark.skip_t2]
Expand Down
6 changes: 4 additions & 2 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
from trezorlib.messages import ButtonRequestType

if TYPE_CHECKING:
from trezorlib.debuglink import DebugLink, TrezorClientDebugLink as Client
from trezorlib.messages import ButtonRequest
from _pytest.mark.structures import MarkDecorator

from trezorlib.debuglink import DebugLink
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.messages import ButtonRequest


BRGeneratorType = Generator[None, messages.ButtonRequest, None]

Expand Down
6 changes: 4 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,21 @@

from trezorlib import debuglink, log
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.device import apply_settings, wipe as wipe_device
from trezorlib.device import apply_settings
from trezorlib.device import wipe as wipe_device
from trezorlib.transport import enumerate_devices, get_transport

from . import ui_tests
from .device_handler import BackgroundDeviceHandler
from .emulators import EmulatorWrapper

if TYPE_CHECKING:
from trezorlib._internal.emulator import Emulator
from _pytest.config import Config
from _pytest.config.argparsing import Parser
from _pytest.terminal import TerminalReporter

from trezorlib._internal.emulator import Emulator


HERE = Path(__file__).resolve().parent

Expand Down
5 changes: 3 additions & 2 deletions tests/device_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
from trezorlib.transport import udp

if TYPE_CHECKING:
from trezorlib.messages import Features
from trezorlib.debuglink import DebugLink, TrezorClientDebugLink as Client
from trezorlib._internal.emulator import Emulator
from trezorlib.debuglink import DebugLink
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.messages import Features


udp.SOCKET_TIMEOUT = 0.1
Expand Down
3 changes: 2 additions & 1 deletion tests/device_tests/bitcoin/test_signmessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import pytest

from trezorlib import btc, messages
from trezorlib.debuglink import TrezorClientDebugLink as Client, message_filters
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.debuglink import message_filters
from trezorlib.tools import parse_path

from ...input_flows import InputFlowSignMessagePagination
Expand Down
3 changes: 2 additions & 1 deletion tests/device_tests/ethereum/test_signtx.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import pytest

from trezorlib import ethereum, exceptions, messages
from trezorlib.debuglink import TrezorClientDebugLink as Client, message_filters
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.debuglink import message_filters
from trezorlib.exceptions import TrezorFailure
from trezorlib.tools import parse_path, unharden

Expand Down
3 changes: 2 additions & 1 deletion tests/device_tests/misc/test_msg_getentropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

import pytest

from trezorlib import messages as m, misc
from trezorlib import messages as m
from trezorlib import misc
from trezorlib.debuglink import TrezorClientDebugLink as Client

ENTROPY_LENGTHS_POW2 = [2**l for l in range(10)]
Expand Down
9 changes: 3 additions & 6 deletions tests/input_flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
from typing import Callable, Generator

from trezorlib import messages
from trezorlib.debuglink import (
DebugLink,
LayoutContent,
TrezorClientDebugLink as Client,
multipage_content,
)
from trezorlib.debuglink import DebugLink, LayoutContent
from trezorlib.debuglink import TrezorClientDebugLink as Client
from trezorlib.debuglink import multipage_content

from . import buttons
from .common import (
Expand Down

0 comments on commit b151a3d

Please sign in to comment.