Commit 3f8a12f
authored
fix(tests): add events_checker() fixture(#1151)
* Wait for directory reader thread to start.
* fix: add events_checker() fixture, use for tests
This makes the unit tests more reliable by allowing events to be
received in different orders and by allowing additional (non-expected)
events.
* Check for DirModifiedEvent on file create.
This matches the original test logic, before addition of the
events_checker() fixture.
* Make events_checker() validate order by default.
Rather than allow events in any order, match the order of the events as
added. On MacOS, fsevents does not produce events in a determistic
order so allow any ordering on that platform.
* Use events_checker() as a context manager.
This reduces the code a little. Use `ec` as the short local name of
the checker instance.
Add `verbose` argument to `events_checker()` that turns on verbose
debugging output.
* Fix lint warnings.
* Unit test fixes for MacOS.
Remove events that are sometimes not generated.
* Fix unreliable test for Window.
* Fix lint warning, improve comment.1 parent 1e48d0b commit 3f8a12f
File tree
6 files changed
+473
-338
lines changed- src/watchdog/observers
- tests
6 files changed
+473
-338
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
| 415 | + | |
415 | 416 | | |
416 | 417 | | |
417 | 418 | | |
| |||
430 | 431 | | |
431 | 432 | | |
432 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
433 | 439 | | |
434 | 440 | | |
435 | 441 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
0 commit comments