path: root/macaroonbakery/tests/
diff options
authorColin Watson <>2017-11-06 10:27:10 +0000
committerColin Watson <>2019-12-26 02:13:31 +0000
commite183a35a2f950bc1346e4b9d58cc8960edcb93fe (patch)
tree79f226da975501efd429548c25b36cc5d849e838 /macaroonbakery/tests/
parent17b2ffceaf6e00834e982bfae18a37478eb01ec0 (diff)
Isolate client tests from any HTTP proxy
Debian's Python packaging tools set http_proxy to a non-existent proxy to help flush out packages that try to talk to the network during build, but these tests could previously fail in more normal development environments too. Forwarded: Last-Update: 2018-02-05 Patch-Name: isolate-from-proxy.patch Gbp-Pq: Name isolate-from-proxy.patch
Diffstat (limited to 'macaroonbakery/tests/')
1 files changed, 7 insertions, 0 deletions
diff --git a/macaroonbakery/tests/ b/macaroonbakery/tests/
index b03bafa..2ae08d3 100644
--- a/macaroonbakery/tests/
+++ b/macaroonbakery/tests/
@@ -3,6 +3,7 @@
import base64
import datetime
import json
+import os
import threading
from unittest import TestCase
@@ -27,6 +28,12 @@ TEST_OP = bakery.Op(entity='test', action='test')
class TestClient(TestCase):
+ def setUp(self):
+ super(TestClient, self).setUp()
+ # http_proxy would cause requests to talk to the proxy, which is
+ # unlikely to know how to talk to the test server.
+ os.environ.pop('http_proxy', None)
def test_single_service_first_party(self):
b = new_bakery('loc', None, None)