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)
| 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: |