MCPcopy
hub / github.com/gorakhargosh/watchdog / expect_event

Method expect_event

tests/utils.py:84–89  ·  view source on GitHub ↗

Utility function to wait up to `timeout` seconds for an `event_type` for `path` to show up in the queue. Provides some robustness for the otherwise flaky nature of asynchronous notifications.

(self, expected_event: FileSystemEvent, timeout: float = 2)

Source from the content-addressed store, hash-verified

82 return emitter
83
84 def expect_event(self, expected_event: FileSystemEvent, timeout: float = 2) -> None:
85 """Utility function to wait up to `timeout` seconds for an `event_type` for `path` to show up in the queue.
86
87 Provides some robustness for the otherwise flaky nature of asynchronous notifications.
88 """
89 assert self.event_queue.get(timeout=timeout)[0] == expected_event
90
91 def close(self) -> None:
92 for emitter in self.emitters:

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected