diff --git a/debian/rules b/debian/rules
index a02250f1624f60000a2b1f9f3cc70441a9982a28..7e114ade2470badb2383391ac9b8ead15b41e468 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,6 +6,7 @@
 
 # This has to be exported to make some magic below work.
 export DH_OPTIONS
+export UNITTEST_NO_NETWORK=1
 
 %:
 	dh $@  --with=python2,sphinxdoc --buildsystem=pybuild
diff --git a/monkeysign/tests/test_network.py b/monkeysign/tests/test_network.py
index f35524536644072908e495128058ddaf9982bf04..035fb81669e0a0636ef5343a7c198c549bea53dc 100755
--- a/monkeysign/tests/test_network.py
+++ b/monkeysign/tests/test_network.py
@@ -33,6 +33,7 @@ from test_lib import TestTimeLimit, AlarmException, find_test_file
 import test_ui
 
 
+@unittest.skipIf('UNITTEST_NO_NETWORK' in os.environ, 'network tests disabled')
 class TestGpgNetwork(TestTimeLimit):
     """Separate test cases for functions that hit the network
 
@@ -66,6 +67,7 @@ the network forever"""
         del self.gpg
 
 
+@unittest.skipIf('UNITTEST_NO_NETWORK' in os.environ, 'network tests disabled')
 class KeyserverTests(test_ui.BaseTestCase):
     args = ['--keyserver', 'pool.sks-keyservers.net']
     pattern = '7B75921E'