From 1cf0186406560d0215f4011d09f48442af43f1c4 Mon Sep 17 00:00:00 2001 From: Jorrit <16398756+jor-rit@users.noreply.github.com> Date: Tue, 27 Aug 2024 14:00:58 +0200 Subject: [PATCH 1/2] watchdog 5.x match_any_path kwargs Watchdog 5 changed the util function to only accept a single args and two kwargs. --- pytest_watcher/event_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest_watcher/event_handler.py b/pytest_watcher/event_handler.py index 9d72400..132319d 100644 --- a/pytest_watcher/event_handler.py +++ b/pytest_watcher/event_handler.py @@ -46,7 +46,7 @@ def _is_event_watched(self, event: events.FileSystemEvent) -> bool: # For file moved type events we are also interested in the destination paths.append(event.dest_path) - return match_any_paths(paths, self.patterns, self.ignore_patterns) + return match_any_paths(paths, included_patterns=self.patterns, excluded_patterns=self.ignore_patterns) def dispatch(self, event: events.FileSystemEvent) -> None: if self._is_event_watched(event): From e01d96fcabe5ed9bf55839227253c8ed6be88c41 Mon Sep 17 00:00:00 2001 From: olzhasar Date: Wed, 28 Aug 2024 22:29:35 +0500 Subject: [PATCH 2/2] Format with ruff --- pytest_watcher/event_handler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pytest_watcher/event_handler.py b/pytest_watcher/event_handler.py index 132319d..aaf1678 100644 --- a/pytest_watcher/event_handler.py +++ b/pytest_watcher/event_handler.py @@ -46,7 +46,11 @@ def _is_event_watched(self, event: events.FileSystemEvent) -> bool: # For file moved type events we are also interested in the destination paths.append(event.dest_path) - return match_any_paths(paths, included_patterns=self.patterns, excluded_patterns=self.ignore_patterns) + return match_any_paths( + paths, + included_patterns=self.patterns, + excluded_patterns=self.ignore_patterns, + ) def dispatch(self, event: events.FileSystemEvent) -> None: if self._is_event_watched(event):