Closed Jaapel closed 1 week ago
Still struggling with logging during tests. Reproduce with:
pixi run -e full-py311 pytest tests/cli/test_cli.py::test_cli_build_override tests/components/test_grid_component.py::test_add_data_from_rasterdataset --ff --pdb
HydroMT version checks
Reproducible Example
test_cli_build_override
produces exceptions on windows.Current behaviour
In ModelRoot and in multiple functions in cli.main a FileHandler for logging is created, pointing to the same file. Logging is passed through (almost) every method and function in HydroMT as a keyword argument.
Desired behaviour
Use logging as intended by creating a hierarchy and getting a logger using
getLogger(__name__)
. No need to pass loggers around.Additional context
No response