From 172471ba75c78c09c851c1d941414f9038a7818e Mon Sep 17 00:00:00 2001 From: Pavel Date: Fri, 16 Jan 2026 13:10:27 +0300 Subject: [PATCH] Linter fixes --- .ruff.toml | 6 +++++- tests/integration/base.py | 1 - tests/integration/run_all.py | 2 +- tests/integration/test_conversations.py | 2 +- tests/integration/test_misc.py | 2 +- tests/integration/test_sources.py | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.ruff.toml b/.ruff.toml index 857f8153..8d9833ff 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -1,2 +1,6 @@ # Allow lines to be as long as 120 characters. -line-length = 120 \ No newline at end of file +line-length = 120 + +[lint.per-file-ignores] +# Integration tests use sys.path.insert() before imports for standalone execution +"tests/integration/*.py" = ["E402"] \ No newline at end of file diff --git a/tests/integration/base.py b/tests/integration/base.py index 4c84b87a..797bcb61 100644 --- a/tests/integration/base.py +++ b/tests/integration/base.py @@ -11,7 +11,6 @@ This module provides: import argparse import json as json_module import os -import sys from pathlib import Path from typing import Any, Iterator, Optional, Type, TypeVar diff --git a/tests/integration/run_all.py b/tests/integration/run_all.py index 02d51b8f..12397a84 100644 --- a/tests/integration/run_all.py +++ b/tests/integration/run_all.py @@ -39,7 +39,7 @@ _ROOT_DIR = _TESTS_DIR.parent if str(_ROOT_DIR) not in sys.path: sys.path.insert(0, str(_ROOT_DIR)) -from tests.integration.base import Colors, DocsGPTTestBase, generate_jwt_token +from tests.integration.base import Colors, generate_jwt_token from tests.integration.test_chat import ChatTests from tests.integration.test_sources import SourceTests from tests.integration.test_agents import AgentTests diff --git a/tests/integration/test_conversations.py b/tests/integration/test_conversations.py index 00b15f16..a2fed996 100644 --- a/tests/integration/test_conversations.py +++ b/tests/integration/test_conversations.py @@ -408,7 +408,7 @@ class ConversationTests(DocsGPTTestBase): if response.status_code == 200: result = response.json() - self.print_success(f"Retrieved shared conversation") + self.print_success("Retrieved shared conversation") self.print_info(f"Messages: {len(result.get('queries', []))}") self.record_result(test_name, True, f"Share ID: {share_id}") return True diff --git a/tests/integration/test_misc.py b/tests/integration/test_misc.py index 86682c23..3433b146 100644 --- a/tests/integration/test_misc.py +++ b/tests/integration/test_misc.py @@ -232,7 +232,7 @@ class MiscTests(DocsGPTTestBase): ) if response.status_code in [200, 201]: - result = response.json() + response.json() # Validate JSON response self.print_success("Large attachment stored") self.record_result(test_name, True, "Attachment stored") return True diff --git a/tests/integration/test_sources.py b/tests/integration/test_sources.py index f1bfb9bf..9363d7f6 100644 --- a/tests/integration/test_sources.py +++ b/tests/integration/test_sources.py @@ -524,7 +524,7 @@ Created at: {int(time.time())} self.print_info(f"Status Code: {response.status_code}") if response.status_code == 200: - result = response.json() + response.json() # Validate JSON response self.print_success("Directory structure retrieved") self.record_result(test_name, True, "Success") return True