[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [bridgedb/master] Only run txrecaptcha.submit() unittest on CI infrastructure.



commit ad647e38847cf88f6b4f99951d2f79cbe4919c16
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Mon May 2 16:28:00 2016 +0000

    Only run txrecaptcha.submit() unittest on CI infrastructure.
---
 test/test_txrecaptcha.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/test/test_txrecaptcha.py b/test/test_txrecaptcha.py
index 4704d49..9e4f5f6 100644
--- a/test/test_txrecaptcha.py
+++ b/test/test_txrecaptcha.py
@@ -10,6 +10,7 @@
 """Unittests for the bridgedb.txrecaptcha module."""
 
 import logging
+import os
 
 from twisted.internet import defer
 from twisted.internet import reactor
@@ -19,6 +20,7 @@ from twisted.internet.error import ConnectionLost
 from twisted.internet.error import ConnectionRefusedError
 from twisted.test import proto_helpers
 from twisted.trial import unittest
+from twisted.trial.unittest import SkipTest
 from twisted.python import failure
 from twisted.web.client import ResponseDone
 from twisted.web.http_headers import Headers
@@ -208,6 +210,10 @@ class SubmitTests(unittest.TestCase):
         :func:`txrecaptcha.submit` should be a
         :class:`txcaptcha.RecaptchaResponse`.
         """
+        if not os.environ.get("CI"):
+            raise SkipTest(("This test requires network so it is only run "
+                            "on CI servers."))
+
         def checkResponse(response):
             """Check that the response is a
             :class:`txcaptcha.RecaptchaResponse`.



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits