From fb3e5c9aabf2268cae3fb42861b720b482a825b7 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sun, 1 Dec 2024 10:29:32 -0800 Subject: [PATCH] test: add minimal coder instance for FileWatcher test --- tests/basic/test_watch.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/basic/test_watch.py b/tests/basic/test_watch.py index 768f75eaa..aa2efb647 100644 --- a/tests/basic/test_watch.py +++ b/tests/basic/test_watch.py @@ -1,11 +1,23 @@ from pathlib import Path +from aider.io import InputOutput from aider.watch import FileWatcher def test_ai_comment_pattern(): - # Create a FileWatcher instance for testing - watcher = FileWatcher(None) + # Create minimal IO and Coder instances for testing + class MinimalCoder: + def __init__(self, io): + self.io = io + self.root = "." + self.abs_fnames = set() + + def get_rel_fname(self, fname): + return fname + + io = InputOutput(pretty=False, fancy_input=False, yes=False) + coder = MinimalCoder(io) + watcher = FileWatcher(coder) fixtures_dir = Path(__file__).parent.parent / "fixtures" # Test Python fixture