MCPcopy
hub / github.com/encode/uvicorn / test_override_defaults

Method test_override_defaults

tests/supervisors/test_reload.py:246–265  ·  view source on GitHub ↗
(self, touch_soon: Callable[[Path], None])

Source from the content-addressed store, hash-verified

244
245 @pytest.mark.parametrize("reloader_class", [pytest.param(WatchFilesReload, marks=skip_non_linux)])
246 def test_override_defaults(self, touch_soon: Callable[[Path], None]) -> None: # pragma: py-not-linux
247 dotted_file = self.reload_path / ".dotted"
248 dotted_dir_file = self.reload_path / ".dotted_dir" / "file.txt"
249 python_file = self.reload_path / "main.py"
250
251 with as_cwd(self.reload_path):
252 config = Config(
253 app="tests.test_config:asgi_app",
254 reload=True,
255 # We need to add *.txt otherwise no regular files will match
256 reload_includes=[".*", "*.txt"],
257 reload_excludes=["*.py"],
258 )
259 reloader = self._setup_reloader(config)
260
261 assert self._reload_tester(touch_soon, reloader, dotted_file)
262 assert self._reload_tester(touch_soon, reloader, dotted_dir_file)
263 assert not self._reload_tester(touch_soon, reloader, python_file)
264
265 reloader.shutdown()
266
267 @pytest.mark.parametrize("reloader_class", [pytest.param(WatchFilesReload, marks=skip_non_linux)])
268 def test_explicit_paths(self, touch_soon: Callable[[Path], None]) -> None: # pragma: py-not-linux

Callers

nothing calls this directly

Calls 5

_setup_reloaderMethod · 0.95
_reload_testerMethod · 0.95
as_cwdFunction · 0.90
ConfigClass · 0.90
shutdownMethod · 0.45

Tested by

no test coverage detected