[Python-modules-commits] r28678 - in packages/cookiecutter/trunk/debian (4 files)
bernat at users.alioth.debian.org
bernat at users.alioth.debian.org
Sun Apr 27 10:27:38 UTC 2014
Date: Sunday, April 27, 2014 @ 10:27:37
Author: bernat
Revision: 28678
Really add test patch.
Added:
packages/cookiecutter/trunk/debian/patches/
packages/cookiecutter/trunk/debian/patches/disable-network-tests.patch
packages/cookiecutter/trunk/debian/patches/series
Modified:
packages/cookiecutter/trunk/debian/changelog
Modified: packages/cookiecutter/trunk/debian/changelog
===================================================================
--- packages/cookiecutter/trunk/debian/changelog 2014-04-27 10:26:50 UTC (rev 28677)
+++ packages/cookiecutter/trunk/debian/changelog 2014-04-27 10:27:37 UTC (rev 28678)
@@ -3,6 +3,7 @@
* New upstream release. Closes: #733567.
+ Drop all patches are that are not needed any more.
+ Build-Depends on python{,3}-yaml.
+ * Patch to disable network tests.
-- Vincent Bernat <bernat at debian.org> Sun, 27 Apr 2014 12:01:02 +0200
Added: packages/cookiecutter/trunk/debian/patches/disable-network-tests.patch
===================================================================
--- packages/cookiecutter/trunk/debian/patches/disable-network-tests.patch (rev 0)
+++ packages/cookiecutter/trunk/debian/patches/disable-network-tests.patch 2014-04-27 10:27:37 UTC (rev 28678)
@@ -0,0 +1,113 @@
+Author: Vincent Bernat
+Subject: add an environment variable to disable network tests
+
+ This is useful when we want to test the package on an environement
+ without networking. This can happen on some buildbots, like the Debian
+ builders.
+
+Forwarded: https://github.com/audreyr/cookiecutter/pull/167
+
+diff --git a/tests/test_examples.py b/tests/test_examples.py
+index eb325ee13ef1..b5c579e5d1ce 100755
+--- a/tests/test_examples.py
++++ b/tests/test_examples.py
+@@ -37,6 +37,11 @@ try:
+ except KeyError:
+ travis = False
+
++try:
++ nonetwork = os.environ[u'DISABLE_NETWORK_TESTS']
++except KeyError:
++ nonetwork = False
++
+ from cookiecutter import config, utils
+ from tests import force_delete, CookiecutterCleanSystemTestCase
+
+@@ -45,6 +50,7 @@ logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG)
+
+
+ @unittest.skipIf(condition=travis, reason='Works locally with tox but fails on Travis.')
++ at unittest.skipIf(condition=nonetwork, reason='Needs a network connection to GitHub.')
+ class TestPyPackage(CookiecutterCleanSystemTestCase):
+
+
+@@ -79,6 +85,7 @@ class TestPyPackage(CookiecutterCleanSystemTestCase):
+
+
+ @unittest.skipIf(condition=travis, reason='Works locally with tox but fails on Travis.')
++ at unittest.skipIf(condition=nonetwork, reason='Needs a network connection to GitHub.')
+ class TestJQuery(CookiecutterCleanSystemTestCase):
+
+
+@@ -113,6 +120,7 @@ class TestJQuery(CookiecutterCleanSystemTestCase):
+
+
+ @unittest.skipIf(condition=travis, reason='Works locally with tox but fails on Travis.')
++ at unittest.skipIf(condition=nonetwork, reason='Needs a network connection to GitHub.')
+ class TestExamplesRepoArg(CookiecutterCleanSystemTestCase):
+
+ def tearDown(self):
+@@ -138,6 +146,7 @@ class TestExamplesRepoArg(CookiecutterCleanSystemTestCase):
+
+
+ @unittest.skipIf(condition=travis, reason='Works locally with tox but fails on Travis.')
++ at unittest.skipIf(condition=nonetwork, reason='Needs a network connection to GitHub.')
+ class TestGitBranch(CookiecutterCleanSystemTestCase):
+
+ def tearDown(self):
+diff --git a/tests/test_main.py b/tests/test_main.py
+index 52e69e2f8e60..6a5a87555232 100755
+--- a/tests/test_main.py
++++ b/tests/test_main.py
+@@ -31,6 +31,11 @@ else:
+ input_str = '__builtin__.raw_input'
+ from cStringIO import StringIO
+
++try:
++ nonetwork = os.environ[u'DISABLE_NETWORK_TESTS']
++except KeyError:
++ nonetwork = False
++
+
+ # Log debug and above to console
+ logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG)
+@@ -91,6 +96,7 @@ class TestArgParsing(unittest.TestCase):
+ self.assertEqual(args.checkout, 'develop')
+
+
++ at unittest.skipIf(condition=nonetwork, reason='Needs a network connection to GitHub/Bitbucket.')
+ class TestCookiecutterRepoArg(CookiecutterCleanSystemTestCase):
+
+ def tearDown(self):
+diff --git a/tests/test_vcs.py b/tests/test_vcs.py
+index c26aa5b51a5f..85a84bb04884 100755
+--- a/tests/test_vcs.py
++++ b/tests/test_vcs.py
+@@ -28,6 +28,11 @@ else:
+
+ from cookiecutter import utils, vcs
+
++try:
++ nonetwork = os.environ[u'DISABLE_NETWORK_TESTS']
++except KeyError:
++ nonetwork = False
++
+
+ # Log debug and above to console
+ logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG)
+@@ -53,6 +58,7 @@ class TestIdentifyRepo(unittest.TestCase):
+ self.assertEqual(vcs.identify_repo(repo_url), "hg")
+
+
++ at unittest.skipIf(condition=nonetwork, reason='Needs a network connection to GitHub/Bitbucket.')
+ class TestVCS(unittest.TestCase):
+
+ def test_git_clone(self):
+@@ -111,6 +117,7 @@ class TestVCS(unittest.TestCase):
+ shutil.rmtree('cookiecutter-trytonmodule')
+
+
++ at unittest.skipIf(condition=nonetwork, reason='Needs a network connection to GitHub/Bitbucket.')
+ class TestVCSPrompt(unittest.TestCase):
+
+ def setUp(self):
Added: packages/cookiecutter/trunk/debian/patches/series
===================================================================
--- packages/cookiecutter/trunk/debian/patches/series (rev 0)
+++ packages/cookiecutter/trunk/debian/patches/series 2014-04-27 10:27:37 UTC (rev 28678)
@@ -0,0 +1 @@
+disable-network-tests.patch
More information about the Python-modules-commits
mailing list