Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Handler configuration based on the result of "get_config" in main function, but if something wrong happens in "get_config", the "logger.handlers" will be empty, and result in the error 'No handlers could be found for logger "altsrc"'. Add logging.basicConfig in main function for root logger's default handler creation, this is used to catch log before "setup_logging" is called. Update logic in setup_logging: only the root logger has handlers. 2. Add an autouse pytest fixture "reset_loggers" in conftest.py. It saves the handlers before each test, then puts them back after end of the test. It keeps the loggers and handlers in every test consistent.
- Loading branch information