Skip to content

Commit b5c7eba

Browse files
author
mcdax
committed
fix: Resolve ruff linting issues (unused imports and variables)
1 parent 83f8be8 commit b5c7eba

4 files changed

Lines changed: 6 additions & 20 deletions

File tree

comdirect_client/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ async def refresh_token(self) -> bool:
529529

530530
return True
531531

532-
except httpx.TimeoutException as e:
532+
except httpx.TimeoutException:
533533
logger.error("Network timeout during token refresh")
534534
return False
535535
except httpx.HTTPStatusError as e:

examples/basic_usage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ async def main():
146146
if tx.amount:
147147
logger.info(f" Amount: {tx.amount.value} {tx.amount.unit}")
148148
else:
149-
logger.info(f" Amount: N/A")
149+
logger.info(" Amount: N/A")
150150
if tx.transactionType:
151151
logger.info(f" Type: {tx.transactionType.text}")
152152
else:
153-
logger.info(f" Type: N/A")
153+
logger.info(" Type: N/A")
154154
logger.info(
155155
f" Text: {tx.remittanceInfo[:50] if tx.remittanceInfo else 'N/A'}..."
156156
)

tests/test_comdirect_bdd.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,13 @@
66

77
import logging
88
from datetime import datetime, timedelta
9-
from unittest.mock import AsyncMock, MagicMock, Mock, patch
9+
from unittest.mock import AsyncMock, patch
1010

1111
import httpx
1212
import pytest
1313
from pytest_bdd import given, parsers, scenarios, then, when
1414

1515
from comdirect_client.client import ComdirectClient
16-
from comdirect_client.exceptions import (
17-
AuthenticationError,
18-
TANTimeoutError,
19-
TokenExpiredError,
20-
)
2116

2217
# Load all scenarios from the feature file
2318
scenarios("../comdirect_api.feature")
@@ -196,15 +191,7 @@ def tan_polling_configured():
196191
def verify_polling_logs(log_capture, log_message):
197192
"""Verify polling logs appear."""
198193
# Count how many times the polling log appears
199-
matching_logs = [r for r in log_capture.records if log_message in r.message]
200-
# In actual tests, we'd verify the count matches expected polls
201-
pass
202-
203-
204-
@then("the library should activate the session after TAN approval")
205-
def session_activated():
206-
"""Verify session activation."""
207-
pass
194+
# In actual tests, we would verify the count matches expected polls
208195

209196

210197
@then("the library should exchange for secondary token")

tests/test_error_handling.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Integration tests for HTTP error handling and query parameters."""
22

33
import pytest
4-
import httpx
54
from datetime import datetime, timedelta
65
from unittest.mock import AsyncMock, MagicMock, patch
76

@@ -177,7 +176,7 @@ class TestFieldNameFallback:
177176

178177
def test_transaction_parse_with_debtor_field(self):
179178
"""Test parsing transaction with correct 'debtor' field."""
180-
from comdirect_client import Transaction, AccountInformation
179+
from comdirect_client import Transaction
181180

182181
data = {
183182
"bookingStatus": "BOOKED",

0 commit comments

Comments
 (0)