From: Vytautas Liuolia Date: Sun, 2 May 2021 18:04:12 +0000 (+0200) Subject: Make the MockTransport example more robust/correct (#1621) X-Git-Tag: 0.18.2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e4b308d7ab138de106f6672326a02e07d350904;p=thirdparty%2Fhttpx.git Make the MockTransport example more robust/correct (#1621) --- diff --git a/docs/advanced.md b/docs/advanced.md index 4438cb2d..5f900cf6 100644 --- a/docs/advanced.md +++ b/docs/advanced.md @@ -1100,7 +1100,7 @@ def handler(request): # Switch to a mock transport, if the TESTING environment variable is set. -if os.environ['TESTING'].upper() == "TRUE": +if os.environ.get('TESTING', '').upper() == "TRUE": transport = httpx.MockTransport(handler) else: transport = httpx.HTTPTransport()