Skip to content
Myr

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 file

Take it

The walk stopped after 200 commits: lines older than c337938 point at it.

asyncio: Don't wait for the stream to close (#640)Florimond Mancabefore adoptionc337938

lines 1–4why, one step back
1import contextlib
2import logging3import os4

Switch to private module names (#785)Florimond Mancabefore adoption82dc6f3

line 5why, one step back
5from httpx import _utils

asyncio: Don't wait for the stream to close (#640)Florimond Mancabefore adoptionc337938

lines 6–12why, one step back
6
78@contextlib.contextmanager9def override_log_level(log_level: str):10 os.environ["HTTPX_LOG_LEVEL"] = log_level1112 # Force a reload on the logging handlers

Switch to private module names (#785)Florimond Mancabefore adoption82dc6f3

lines 13–14why, one step back
13 _utils._LOGGER_INITIALIZED = False
14 _utils.get_logger("httpx")

asyncio: Don't wait for the stream to close (#640)Florimond Mancabefore adoptionc337938

lines 15–20why, one step back
15
16 try:17 yield18 finally:19 # Reset the logger so we don't have verbose output in all unit tests20 logging.getLogger("httpx").handlers = []