From c7882945b83cf64b7e2820e13ca8d52a8d68459b Mon Sep 17 00:00:00 2001 From: Bartek Wrona <wrona@syncad.com> Date: Fri, 21 Mar 2025 16:43:49 +0100 Subject: [PATCH] Sources auto updated by linter (removed unused noqua, changed pytest.fixture directives) --- beekeepy/beekeepy/_communication/abc/rules.py | 2 +- beekeepy/beekeepy/_remote_handle/beekeeper.py | 4 ++-- tests/beekeepy_test/conftest.py | 4 ++-- tests/beekeepy_test/handle/commandline/conftest.py | 2 +- tests/beekeepy_test/handle/conftest.py | 10 +++++----- .../handle/various/test_blocking_unlock.py | 6 +++--- .../beekeepy_test/interface/test_invalidated_state.py | 2 +- tests/conftest.py | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/beekeepy/beekeepy/_communication/abc/rules.py b/beekeepy/beekeepy/_communication/abc/rules.py index 335f83ae..a87c0c5e 100644 --- a/beekeepy/beekeepy/_communication/abc/rules.py +++ b/beekeepy/beekeepy/_communication/abc/rules.py @@ -76,7 +76,7 @@ class OverseerRule(ABC): assert isinstance(self.request, dict), f"self.request is not a dict, nor list, but is `{type(self.request)}`" return self.request - def _construct_exception( # noqa: PLR0913 + def _construct_exception( self, error_cls: type[OverseerError], response: Json | list[Json] | Exception, diff --git a/beekeepy/beekeepy/_remote_handle/beekeeper.py b/beekeepy/beekeepy/_remote_handle/beekeeper.py index 4d077cde..cd21bb10 100644 --- a/beekeepy/beekeepy/_remote_handle/beekeeper.py +++ b/beekeepy/beekeepy/_remote_handle/beekeeper.py @@ -32,7 +32,7 @@ def _raise_acquire_not_possible() -> NoReturn: class _SyncSessionBatchHandle(SyncBatchHandle[BeekeeperSyncApiCollection], SyncSessionHolder): - def __init__( # noqa: PLR0913 + def __init__( self, url: HttpUrl, overseer: AbstractOverseer, @@ -50,7 +50,7 @@ class _SyncSessionBatchHandle(SyncBatchHandle[BeekeeperSyncApiCollection], SyncS class _AsyncSessionBatchHandle(AsyncBatchHandle[BeekeeperAsyncApiCollection], AsyncSessionHolder): - def __init__( # noqa: PLR0913 + def __init__( self, url: HttpUrl, overseer: AbstractOverseer, diff --git a/tests/beekeepy_test/conftest.py b/tests/beekeepy_test/conftest.py index 2944d128..7b2eafc0 100644 --- a/tests/beekeepy_test/conftest.py +++ b/tests/beekeepy_test/conftest.py @@ -15,7 +15,7 @@ if TYPE_CHECKING: from loguru import Logger -@pytest.fixture() +@pytest.fixture def settings(working_directory: Path) -> SettingsFactory: @wraps(settings) def _factory(settings_update: Settings | None = None) -> Settings: @@ -28,7 +28,7 @@ def settings(working_directory: Path) -> SettingsFactory: return _factory -@pytest.fixture() +@pytest.fixture def settings_with_logger(request: pytest.FixtureRequest, settings: SettingsFactory) -> Iterator[SettingsLoggerFactory]: handlers_to_remove = [] diff --git a/tests/beekeepy_test/handle/commandline/conftest.py b/tests/beekeepy_test/handle/commandline/conftest.py index 625860c4..2b34069b 100644 --- a/tests/beekeepy_test/handle/commandline/conftest.py +++ b/tests/beekeepy_test/handle/commandline/conftest.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: from local_tools.beekeepy.models import SettingsLoggerFactory -@pytest.fixture() +@pytest.fixture def beekeeper_exe(settings_with_logger: SettingsLoggerFactory) -> BeekeeperExecutable: incoming_settings, logger = settings_with_logger() return BeekeeperExecutable(settings=incoming_settings, logger=logger) diff --git a/tests/beekeepy_test/handle/conftest.py b/tests/beekeepy_test/handle/conftest.py index 3063076f..d13ae688 100644 --- a/tests/beekeepy_test/handle/conftest.py +++ b/tests/beekeepy_test/handle/conftest.py @@ -20,7 +20,7 @@ from local_tools.beekeepy.models import ( from beekeepy.handle.runnable import Beekeeper -@pytest.fixture() +@pytest.fixture def beekeeper_not_started(settings_with_logger: SettingsLoggerFactory) -> Iterator[Beekeeper]: incoming_settings, logger = settings_with_logger() bk = Beekeeper(settings=incoming_settings, logger=logger) @@ -31,20 +31,20 @@ def beekeeper_not_started(settings_with_logger: SettingsLoggerFactory) -> Iterat bk.teardown() -@pytest.fixture() +@pytest.fixture def beekeeper(beekeeper_not_started: Beekeeper) -> Iterator[Beekeeper]: with beekeeper_not_started as bk: yield bk -@pytest.fixture() +@pytest.fixture def wallet(beekeeper: Beekeeper) -> WalletInfo: name, password = default_wallet_credentials() beekeeper.api.create(wallet_name=name, password=password) return WalletInfo(name=name, password=password) -@pytest.fixture() +@pytest.fixture def account(beekeeper: Beekeeper, wallet: WalletInfo) -> AccountCredentials: acc = AccountCredentials.create() beekeeper.api.import_key(wallet_name=wallet.name, wif_key=acc.private_key) @@ -56,7 +56,7 @@ def keys_to_import() -> list[AccountCredentials]: return AccountCredentials.create_multiple(10) -@pytest.fixture() +@pytest.fixture def setup_wallets(beekeeper: Beekeeper) -> WalletsGeneratorT: @wraps(setup_wallets) def __setup_wallets( diff --git a/tests/beekeepy_test/handle/various/test_blocking_unlock.py b/tests/beekeepy_test/handle/various/test_blocking_unlock.py index 8eb8edd3..c36d4e58 100644 --- a/tests/beekeepy_test/handle/various/test_blocking_unlock.py +++ b/tests/beekeepy_test/handle/various/test_blocking_unlock.py @@ -22,7 +22,7 @@ AES_DECRYPTION_ERROR: Final[str] = "Invalid password for wallet" WALLET_UNACCESSIBLE_ERROR: Final[str] = "Assert Exception:false: unlock is not accessible" -@pytest.fixture() +@pytest.fixture def beekeeper_not_started(settings_with_logger: SettingsLoggerFactory) -> Iterator[AsyncBeekeeper]: incoming_settings, logger = settings_with_logger() bk = AsyncBeekeeper(settings=incoming_settings, logger=logger) @@ -33,13 +33,13 @@ def beekeeper_not_started(settings_with_logger: SettingsLoggerFactory) -> Iterat bk.teardown() -@pytest.fixture() +@pytest.fixture async def beekeeper(beekeeper_not_started: AsyncBeekeeper) -> AsyncIterator[AsyncBeekeeper]: async with beekeeper_not_started as bk: yield bk -@pytest.fixture() +@pytest.fixture async def wallet(beekeeper: AsyncBeekeeper) -> WalletInfo: name, password = default_wallet_credentials() await beekeeper.api.create(wallet_name=name, password=password) diff --git a/tests/beekeepy_test/interface/test_invalidated_state.py b/tests/beekeepy_test/interface/test_invalidated_state.py index bcc797be..96eb4f2f 100644 --- a/tests/beekeepy_test/interface/test_invalidated_state.py +++ b/tests/beekeepy_test/interface/test_invalidated_state.py @@ -14,7 +14,7 @@ if TYPE_CHECKING: from beekeepy import Session, Wallet -@pytest.fixture() +@pytest.fixture def beekeepy_interfaces(settings: SettingsFactory) -> Iterator[tuple[Beekeeper, Session, Wallet]]: bk = Beekeeper.factory(settings=settings()) session = bk.create_session() diff --git a/tests/conftest.py b/tests/conftest.py index d0847cce..8e438830 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -44,13 +44,13 @@ def pytest_addoption(parser: pytest.Parser) -> None: ) -@pytest.fixture() +@pytest.fixture def registered_apis() -> RegisteredApisT: """Return registered methods.""" return AbstractApi._get_registered_methods() -@pytest.fixture() +@pytest.fixture def hived_http_endpoint(request: pytest.FixtureRequest) -> HttpUrl: raw_url = request.config.getoption("--hived-http-endpoint") assert raw_url is not None -- GitLab