@@ -306,24 +306,17 @@ def test_watchfiles_no_changes(self) -> None:
306
306
307
307
308
308
@pytest .mark .skipif (WatchFilesReload is None , reason = "watchfiles not available" )
309
- def test_should_watch_one_dir_cwd (mocker : MockerFixture , reload_directory_structure : Path ):
309
+ def test_should_watch_cwd (mocker : MockerFixture , reload_directory_structure : Path ):
310
310
mock_watch = mocker .patch ("uvicorn.supervisors.watchfilesreload.watch" )
311
- app_dir = reload_directory_structure / "app"
312
- app_first_dir = reload_directory_structure / "app_first"
313
311
314
- with as_cwd (reload_directory_structure ):
315
- config = Config (
316
- app = "tests.test_config:asgi_app" ,
317
- reload = True ,
318
- reload_dirs = [str (app_dir ), str (app_first_dir )],
319
- )
320
- WatchFilesReload (config , target = run , sockets = [])
321
- mock_watch .assert_called_once ()
322
- assert mock_watch .call_args [0 ] == (Path .cwd (),)
312
+ config = Config (app = "tests.test_config:asgi_app" , reload = True , reload_dirs = [])
313
+ WatchFilesReload (config , target = run , sockets = [])
314
+ mock_watch .assert_called_once ()
315
+ assert mock_watch .call_args [0 ] == (Path .cwd (),)
323
316
324
317
325
318
@pytest .mark .skipif (WatchFilesReload is None , reason = "watchfiles not available" )
326
- def test_should_watch_separate_dirs_outside_cwd (mocker : MockerFixture , reload_directory_structure : Path ):
319
+ def test_should_watch_multiple_dirs (mocker : MockerFixture , reload_directory_structure : Path ):
327
320
mock_watch = mocker .patch ("uvicorn.supervisors.watchfilesreload.watch" )
328
321
app_dir = reload_directory_structure / "app"
329
322
app_first_dir = reload_directory_structure / "app_first"
@@ -337,7 +330,6 @@ def test_should_watch_separate_dirs_outside_cwd(mocker: MockerFixture, reload_di
337
330
assert set (mock_watch .call_args [0 ]) == {
338
331
app_dir ,
339
332
app_first_dir ,
340
- Path .cwd (),
341
333
}
342
334
343
335
0 commit comments