summaryrefslogtreecommitdiff
path: root/macaroonbakery/tests/test_bakery.py
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2017-11-06 10:27:10 +0000
committerColin Watson <cjwatson@debian.org>2018-02-28 17:08:17 +0000
commit920e53a9172a6a76d6f1abcef56be2edf4301596 (patch)
treecd22512055a5d2cd92f1312d60fac08cc469193d /macaroonbakery/tests/test_bakery.py
parent4379a501141f75557e535f9c2ef3b58ef362259c (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: https://github.com/go-macaroon-bakery/py-macaroon-bakery/pull/28 Last-Update: 2018-02-05 Patch-Name: isolate-from-proxy.patch
Diffstat (limited to 'macaroonbakery/tests/test_bakery.py')
-rw-r--r--macaroonbakery/tests/test_bakery.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/macaroonbakery/tests/test_bakery.py b/macaroonbakery/tests/test_bakery.py
index a6c3e58..72a6928 100644
--- a/macaroonbakery/tests/test_bakery.py
+++ b/macaroonbakery/tests/test_bakery.py
@@ -1,5 +1,6 @@
# Copyright 2017 Canonical Ltd.
# Licensed under the LGPLv3, see LICENCE file for details.
+import os
from unittest import TestCase
import macaroonbakery.httpbakery as httpbakery
@@ -171,6 +172,11 @@ def wait_on_error(url, request):
class TestBakery(TestCase):
+ def setUp(self):
+ super(TestBakery, 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 assert_cookie_security(self, cookies, name, secure):
for cookie in cookies: