Skip to content

Commit

Permalink
Merge branch 'dont-run-docs-tests-without-internet' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ojii committed Dec 24, 2011
2 parents 587515d + 6be0eae commit 47e9221
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cms/tests/docs.py
Expand Up @@ -9,15 +9,27 @@
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import unittest
import socket

ROOT_DIR = os.path.dirname(cms.__file__)
DOCS_DIR = os.path.abspath(os.path.join(ROOT_DIR, '..', 'docs'))


def has_no_internet():
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('4.4.4.2', 80))
except socket.error: # no internet
return True
return False


class DocsTestCase(CMSTestCase):
"""
Test docs building correctly for HTML
"""
@unittest.skipIf(has_no_internet(), "No internet")
def test_html(self):
nullout = StringIO()
with TemporaryDirectory() as OUT_DIR:
Expand Down

0 comments on commit 47e9221

Please sign in to comment.