Report Jackett setup errors in search results - #464
Closed
q5x-v6e-n7z-6x3 wants to merge 3 commits into
Closed
q5x-v6e-n7z-6x3 wants to merge 3 commits into
q5x-v6e-n7z-6x3 wants to merge 3 commits into
Conversation
Chocobo1
reviewed
Sep 26, 2026
Comment on lines
1
to
5
| from typing import List, Optional, Tuple | ||
|
|
||
| import pytest | ||
|
|
||
| from ..engines import jackett |
Member
There was a problem hiding this comment.
coding style:
Suggested change
| from typing import List, Optional, Tuple | |
| import pytest | |
| from ..engines import jackett | |
| import pytest | |
| from ..engines import jackett | |
| from typing import List, Optional, Tuple |
Use standard library mocks to keep response and search stand-ins local to each test while retaining strict type checking. Check stderr without matching fragile message text.
Chocobo1
reviewed
Sep 26, 2026
Chocobo1
left a comment
Member
There was a problem hiding this comment.
only a few comment left.
@q5x-v6e-n7z-6x3
FYI, you are expected to handle replies yourself (manually) rather than through AI agents.
| return response | ||
|
|
||
| def handle_error(self, error_msg: str, what: str) -> None: | ||
| print(f"Jackett: {error_msg}. Search: {what}", file=sys.stderr) |
Member
There was a problem hiding this comment.
you are already passing the error to stdout so don't do this.
@q5x-v6e-n7z-6x3
Clearly you are using AI. Please instruct your AI to follow/address the review comments closely and don't invent new ideas.
Comment on lines
+1
to
7
| from __future__ import annotations | ||
|
|
||
| from unittest.mock import Mock | ||
|
|
||
| import pytest | ||
|
|
||
| from ..engines import jackett |
Comment on lines
-11
to
-12
| assert capturedOutput.err == "" | ||
| assert len(capturedOutput.out) >= 0 |
Member
There was a problem hiding this comment.
Revert this.
Don't touch existing code unless it is broken.
Comment on lines
+62
to
+63
| search_mock = Mock() | ||
| monkeypatch.setattr(engine, 'get_response', Mock(return_value='<indexers><indexer id="thepiratebay" /></indexers>')) |
Member
There was a problem hiding this comment.
Suggested change
| search_mock = Mock() | |
| monkeypatch.setattr(engine, 'get_response', Mock(return_value='<indexers><indexer id="thepiratebay" /></indexers>')) | |
| monkeypatch.setattr(engine, 'get_response', Mock(return_value='<indexers><indexer id="thepiratebay" /></indexers>')) | |
| search_mock = Mock() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Report user-fixable Jackett setup errors through search results and stderr: a missing API key, an unreachable service, or no configured indexers. Check indexers even when
thread_countis 1. RaiseRuntimeErrorfor malformed XML and Jackett API errors. Update the plugin version to 4.14.Tests check stderr output without relying on exact wording. Response and search stand-ins are inlined with standard library mocks.
Testing
co_lnotabcrash on upstreammaster: https://github.com/qbittorrent/search-plugins/actions/runs/35631964355/job/106440057337