From 859769229d2ccc17d38caed77e43a5a8b42e0293 Mon Sep 17 00:00:00 2001 From: Aaron Weisberg Date: Mon, 6 Jan 2025 22:46:02 +0100 Subject: [PATCH] refactor: rename watcher to comment_processor Improve variable naming by changing 'watcher' to more descriptive 'comment_processor' to better reflect its purpose in the test file. This enhances code readability and maintains consistent naming convention. --- tests/basic/test_comment_processor.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/basic/test_comment_processor.py b/tests/basic/test_comment_processor.py index d13b235dfd1..f0c1c83b718 100644 --- a/tests/basic/test_comment_processor.py +++ b/tests/basic/test_comment_processor.py @@ -74,12 +74,12 @@ def get_rel_fname(self, fname): io = InputOutput(pretty=False, fancy_input=False, yes=False) coder = MinimalCoder(io) - watcher = CommentProcessor(io, coder) + comment_processor = CommentProcessor(io, coder) fixtures_dir = Path(__file__).parent.parent / "fixtures" # Test Python fixture py_path = fixtures_dir / "watch.py" - py_lines, py_comments, py_has_bang = watcher.get_ai_comments(str(py_path)) + py_lines, py_comments, py_has_bang = comment_processor.get_ai_comments(str(py_path)) # Count unique AI comments (excluding duplicates and variations with extra spaces) unique_py_comments = set(comment.strip().lower() for comment in py_comments) @@ -93,7 +93,7 @@ def get_rel_fname(self, fname): # Test JavaScript fixture js_path = fixtures_dir / "watch.js" - js_lines, js_comments, js_has_bang = watcher.get_ai_comments(str(js_path)) + js_lines, js_comments, js_has_bang = comment_processor.get_ai_comments(str(js_path)) js_expected = 16 assert ( len(js_lines) == js_expected @@ -102,8 +102,8 @@ def get_rel_fname(self, fname): # Test watch_question.js fixture question_js_path = fixtures_dir / "watch_question.js" - question_js_lines, question_js_comments, question_js_has_bang = watcher.get_ai_comments( - str(question_js_path) + question_js_lines, question_js_comments, question_js_has_bang = ( + comment_processor.get_ai_comments(str(question_js_path)) ) question_js_expected = 6 assert len(question_js_lines) == question_js_expected, (