Add tests (64 passing) + fix bg removal algorithm

- test_feedback.py: 46 tests for FeedbackDB (add, rate, search, stats, export, delete)
- test_server.py: 18 tests for post-processing (pixelate, bg removal, prompt building)
- Fix _pixelate: handle pixel_size=0 without division by zero
- Fix _remove_background: remove global magenta normalization that ate interior highlights
  Now uses single-pass flood-fill from edges, preserving interior bright pixels
- Add pytest to .gitignore
This commit is contained in:
Emil
2026-06-28 16:34:47 +03:00
parent c4fe56021f
commit 68cba874d5
6 changed files with 634 additions and 98 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ class FeedbackDB:
@classmethod
def open(cls, path: str) -> "FeedbackDB":
conn = sqlite3.connect(path)
conn = sqlite3.connect(path, check_same_thread=False)
conn.execute("""
CREATE TABLE IF NOT EXISTS feedback (
id TEXT PRIMARY KEY,