utils.py
This file
Path
tests/utils.py
20 lines · 463 bytes · Python
Last changed by
Switch to private module names (#785)Florimond Mancabefore adoption82dc6f3
History of this fileTake it
The walk stopped after 200 commits: lines older than f8794cb point at it.
Improve backend docs, particularly wrt. autodetection (#595)Tom Christiebefore adoptionf8794cb
lines 1–4why, one step back1import contextlib2import logging3import os4Switch to private module names (#785)Florimond Mancabefore adoption82dc6f3
line 5why, one step back5from httpx import _utilsImprove backend docs, particularly wrt. autodetection (#595)Tom Christiebefore adoptionf8794cb
lines 6–12why, one step back678@contextlib.contextmanager9def override_log_level(log_level: str):10 os.environ["HTTPX_LOG_LEVEL"] = log_level1112 # Force a reload on the logging handlersSwitch to private module names (#785)Florimond Mancabefore adoption82dc6f3
lines 13–14why, one step back13 _utils._LOGGER_INITIALIZED = False14 _utils.get_logger("httpx")Improve backend docs, particularly wrt. autodetection (#595)Tom Christiebefore adoptionf8794cb
lines 15–20why, one step back1516 try:17 yield18 finally:19 # Reset the logger so we don't have verbose output in all unit tests20 logging.getLogger("httpx").handlers = []