From 2e4b308d7ab138de106f6672326a02e07d350904 Mon Sep 17 00:00:00 2001 From: Vytautas Liuolia Date: Sun, 2 May 2021 20:04:12 +0200 Subject: [PATCH] Make the MockTransport example more robust/correct (#1621) --- docs/advanced.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()