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 7a96a2c point at it.
Add support for unix domain sockets (#511)Jonas Lundbergbefore adoption7a96a2c
lines 1–4why, one step back1import contextlib2import logging3import os4Switch to private module names (#785)Florimond Mancabefore adoption82dc6f3
line 5why, one step back5from httpx import _utilsAdd support for unix domain sockets (#511)Jonas Lundbergbefore adoption7a96a2c
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")Add support for unix domain sockets (#511)Jonas Lundbergbefore adoption7a96a2c
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 = []