Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eckersley <pde@users.noreply.github.com>2016-12-07 07:39:16 +0300
committerGitHub <noreply@github.com>2016-12-07 07:39:16 +0300
commit59c602d9caf2fdba8ad09fc501b5a6bc6c3e5342 (patch)
tree911faa2ad54493c3077c7fa11ddfb0255d595756 /certbot-nginx
parent184d67337892d044a78e55e72778d705a579c09d (diff)
Parallalelise nosetests from tox (#3836)
* Parallalelise nosetests from tox * Parallelise even more things, break even more things * Now unbreak all the tests that aren't ready for ||ism * Try to pass tests! - Remove non-working hack in reporter_test - also be selective about ||ism in the cover environment * Try again * certbot-apache tests also work, given enough time * Nginx may need more time in Travis's cloud * Unbreak reporter_test under ||ism * More timeout * Working again? * This goes way faster * Another big win * Split a couple more large test suites * A last improvement * More ||ism! * ||ise lint too * Allow nosetests to figure out how many cores to use * simplify merge * Mark the new CLI tests as ||izable * Simplify reporter_test changes * Rationalise ||ism flags * Re-up coverage * Clean up reporter tests * Stop modifying testdata during tests * remove unused os
Diffstat (limited to 'certbot-nginx')
-rw-r--r--certbot-nginx/certbot_nginx/tests/configurator_test.py2
-rw-r--r--certbot-nginx/certbot_nginx/tests/nginxparser_test.py58
2 files changed, 26 insertions, 34 deletions
diff --git a/certbot-nginx/certbot_nginx/tests/configurator_test.py b/certbot-nginx/certbot_nginx/tests/configurator_test.py
index 08a66fc98..fd442d88e 100644
--- a/certbot-nginx/certbot_nginx/tests/configurator_test.py
+++ b/certbot-nginx/certbot_nginx/tests/configurator_test.py
@@ -21,6 +21,8 @@ from certbot_nginx.tests import util
class NginxConfiguratorTest(util.NginxTest):
"""Test a semi complex vhost configuration."""
+ _multiprocess_can_split_ = True
+
def setUp(self):
super(NginxConfiguratorTest, self).setUp()
diff --git a/certbot-nginx/certbot_nginx/tests/nginxparser_test.py b/certbot-nginx/certbot_nginx/tests/nginxparser_test.py
index 5c8d6d215..e83b414cf 100644
--- a/certbot-nginx/certbot_nginx/tests/nginxparser_test.py
+++ b/certbot-nginx/certbot_nginx/tests/nginxparser_test.py
@@ -1,7 +1,7 @@
"""Test for certbot_nginx.nginxparser."""
import copy
import operator
-import os
+import tempfile
import unittest
from pyparsing import ParseException
@@ -128,44 +128,34 @@ class TestRawNginxParser(unittest.TestCase):
[['root', ' ', 'html'],
['index', ' ', 'index.html index.htm']]]]]))
- with open(util.get_data_filename('nginx.new.conf'), 'w') as handle:
- dump(parsed, handle)
- with open(util.get_data_filename('nginx.new.conf')) as handle:
- parsed_new = load(handle)
- try:
- self.maxDiff = None
- self.assertEqual(parsed[0], parsed_new[0])
- self.assertEqual(parsed[1:], parsed_new[1:])
- finally:
- os.unlink(util.get_data_filename('nginx.new.conf'))
+ with tempfile.TemporaryFile() as f:
+ dump(parsed, f)
+ f.seek(0)
+ parsed_new = load(f)
+ self.assertEqual(parsed, parsed_new)
def test_comments(self):
with open(util.get_data_filename('minimalistic_comments.conf')) as handle:
parsed = load(handle)
- with open(util.get_data_filename('minimalistic_comments.new.conf'), 'w') as handle:
- dump(parsed, handle)
-
- with open(util.get_data_filename('minimalistic_comments.new.conf')) as handle:
- parsed_new = load(handle)
-
- try:
- self.assertEqual(parsed, parsed_new)
-
- self.assertEqual(parsed_new, [
- ['#', " Use bar.conf when it's a full moon!"],
- ['include', 'foo.conf'],
- ['#', ' Kilroy was here'],
- ['check_status'],
- [['server'],
- [['#', ''],
- ['#', " Don't forget to open up your firewall!"],
- ['#', ''],
- ['listen', '1234'],
- ['#', ' listen 80;']]],
- ])
- finally:
- os.unlink(util.get_data_filename('minimalistic_comments.new.conf'))
+ with tempfile.TemporaryFile() as f:
+ dump(parsed, f)
+ f.seek(0)
+ parsed_new = load(f)
+
+ self.assertEqual(parsed, parsed_new)
+ self.assertEqual(parsed_new, [
+ ['#', " Use bar.conf when it's a full moon!"],
+ ['include', 'foo.conf'],
+ ['#', ' Kilroy was here'],
+ ['check_status'],
+ [['server'],
+ [['#', ''],
+ ['#', " Don't forget to open up your firewall!"],
+ ['#', ''],
+ ['listen', '1234'],
+ ['#', ' listen 80;']]],
+ ])
def test_issue_518(self):
parsed = loads('if ($http_accept ~* "webp") { set $webp "true"; }')