Make the MockTransport example more robust/correct (#1621)
This commit is contained in:
parent
2129a9789a
commit
2e4b308d7a
@ -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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user