From 7918641f2fad1d5fcfe10265fcae6a384ae1933e Mon Sep 17 00:00:00 2001 From: Jorrit <16398756+jor-rit@users.noreply.github.com> Date: Wed, 28 Aug 2024 19:32:51 +0200 Subject: [PATCH] Fix watchdog 5.x compatibility (#35) * watchdog 5.x match_any_path kwargs Watchdog 5 changed the util function to only accept a single args and two kwargs. * Format with ruff --------- Co-authored-by: olzhasar --- 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 9d72400..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, 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):