Skip to content

Commit d55f92d

Browse files
committed
Don't watch the whole directory in the file watcher test
When watching the whole test directory we'll also get some events for the directory, and those events can come with different order depending on the OS, so we can't rely on them. Instead, we should watch a specific file, so we can control the order of the events. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 127e542 commit d55f92d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_file_watcher_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async def test_file_watcher(tmp_path: pathlib.Path) -> None:
2626
number_of_writes = 0
2727
expected_number_of_writes = 3
2828

29-
file_watcher = FileWatcher(paths=[str(tmp_path)])
29+
file_watcher = FileWatcher(paths=[str(filename)])
3030
timer = Timer(timedelta(seconds=0.1), SkipMissedAndDrift())
3131

3232
async for selected in select(file_watcher, timer):

0 commit comments

Comments
 (0)