Skip to content

Commit

Permalink
Bump ruff from v0.3.4 to v0.4.2 (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmartin16 authored May 1, 2024
1 parent 39c0fcb commit abba349
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
- --non-cap=qBittorrent

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.3.4
rev: v0.4.2
hooks:
- id: ruff
args:
Expand Down
2 changes: 1 addition & 1 deletion src/qbittorrentapi/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ def _handle_error_responses(
hash_source = data or params or {}
error_hash = hash_source.get("hashes", hash_source.get("hash", ""))
if error_hash:
error_message = "Torrent hash(es): %s" % error_hash
error_message = f"Torrent hash(es): {error_hash}"
raise NotFound404Error(error_message, request=request, response=response)

if response.status_code == 405:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def rss_feed(client, api_version):
if done:
break
else:
raise Exception("RSS Feed '%s' did not refresh..." % ITEM_ONE)
raise Exception(f"RSS Feed '{ITEM_ONE}' did not refresh...")
finally:
delete_feed(client, ITEM_ONE)
delete_feed(client, RSS_NAME)
Expand Down Expand Up @@ -80,7 +80,7 @@ def test_rss_refresh_item(client, rss_feed, refresh_item_func):

check(
lambda: [e.message for e in client.log.main(last_known_id=last_log_id)],
"RSS feed at '%s' updated. Added 0 new articles." % RSS_URL,
f"RSS feed at '{RSS_URL}' updated. Added 0 new articles.",
reverse=True,
)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_torrents.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def download_file(url, filename=None, return_bytes=False):
pass # throw away errors until we hit the retry limit
else:
return
raise Exception("Download failed: %s" % url)
raise Exception(f"Download failed: {url}")

def delete():
client.func(delete_func)(delete_files=True, torrent_hashes=TORRENT1_HASH)
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def get_torrent(client, torrent_hash) -> TorrentDictionary:
# not all versions of torrents_info() support passing a hash
return [t for t in client.torrents_info() if t.hash == torrent_hash][0]
except Exception:
pytest.exit("Failed to find torrent for %s" % torrent_hash)
pytest.exit(f"Failed to find torrent for {torrent_hash}")


@retry(200)
Expand Down

0 comments on commit abba349

Please sign in to comment.