@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Helper functions for loading environment settings.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import io
|
||||
import json
|
||||
@@ -10,6 +10,7 @@ import sys
|
||||
from time import sleep
|
||||
|
||||
import memcache
|
||||
import six
|
||||
from lazy import lazy
|
||||
from path import Path as path
|
||||
from paver.easy import BuildFailure, sh
|
||||
@@ -260,7 +261,7 @@ class Env(object):
|
||||
),
|
||||
capture=True
|
||||
)
|
||||
return unicode(value).strip()
|
||||
return six.text_type(value).strip()
|
||||
except BuildFailure:
|
||||
print(u"Unable to print the value of the {} setting:".format(django_setting))
|
||||
with io.open(cls.PRINT_SETTINGS_LOG_FILE, 'r') as f:
|
||||
|
||||
@@ -8,6 +8,8 @@ Provides:
|
||||
as the `passthrough_options` argument to the decorated function
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
from optparse import BadOptionError, OptionParser
|
||||
|
||||
import paver.tasks
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
Helper functions for managing processes.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import atexit
|
||||
import os
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
Definitions of all options used by the various bok_choy tasks.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
from optparse import make_option
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
"""
|
||||
Helper functions for bok_choy test tasks
|
||||
"""
|
||||
from __future__ import print_function
|
||||
import httplib
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
import six
|
||||
import six.moves.http_client # pylint: disable=import-error
|
||||
from paver import tasks
|
||||
from paver.easy import cmdopts, needs, sh, task
|
||||
|
||||
@@ -40,7 +42,7 @@ def start_servers(options):
|
||||
print(cmd, logfile)
|
||||
run_background_process(cmd, out_log=logfile, err_log=logfile, cwd=cwd)
|
||||
|
||||
for service, info in Env.BOK_CHOY_SERVERS.iteritems():
|
||||
for service, info in six.iteritems(Env.BOK_CHOY_SERVERS):
|
||||
address = "0.0.0.0:{}".format(info['port'])
|
||||
cmd = (u"DEFAULT_STORE={default_store} ").format(default_store=options.default_store)
|
||||
if coveragerc:
|
||||
@@ -57,7 +59,7 @@ def start_servers(options):
|
||||
)
|
||||
start_server(cmd, info['log'])
|
||||
|
||||
for service, info in Env.BOK_CHOY_STUBS.iteritems():
|
||||
for service, info in six.iteritems(Env.BOK_CHOY_STUBS):
|
||||
cmd = (
|
||||
u"python -m stubs.start {service} {port} "
|
||||
"{config}".format(
|
||||
@@ -88,7 +90,7 @@ def wait_for_server(server, port):
|
||||
|
||||
while attempts < 120:
|
||||
try:
|
||||
connection = httplib.HTTPConnection(server, port, timeout=10)
|
||||
connection = six.moves.http_client.HTTPConnection(server, port, timeout=10)
|
||||
connection.request('GET', '/')
|
||||
response = connection.getresponse()
|
||||
|
||||
@@ -109,7 +111,7 @@ def wait_for_test_servers():
|
||||
Wait until we get a successful response from the servers or time out
|
||||
"""
|
||||
|
||||
for service, info in Env.BOK_CHOY_SERVERS.iteritems():
|
||||
for service, info in six.iteritems(Env.BOK_CHOY_SERVERS):
|
||||
ready = wait_for_server(info['host'], info['port'])
|
||||
if not ready:
|
||||
msg = colorize(
|
||||
@@ -145,7 +147,7 @@ def is_mysql_running():
|
||||
"""
|
||||
# We need to check whether or not mysql is running as a process
|
||||
# even if it is not daemonized.
|
||||
with open(os.devnull, 'w') as os_devnull:
|
||||
with open(os.devnull, 'w') as os_devnull: # pylint: disable=W6005
|
||||
#pgrep returns the PID, which we send to /dev/null
|
||||
returncode = subprocess.call("pgrep mysqld", stdout=os_devnull, shell=True)
|
||||
return returncode == 0
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"""
|
||||
TestSuite class and subclasses
|
||||
"""
|
||||
from .suite import TestSuite
|
||||
from .pytest_suite import PytestSuite, SystemTestSuite, LibTestSuite
|
||||
from .python_suite import PythonTestSuite
|
||||
from .js_suite import JsTestSuite, JestSnapshotTestSuite
|
||||
from .bokchoy_suite import BokChoyTestSuite
|
||||
from .js_suite import JestSnapshotTestSuite, JsTestSuite
|
||||
from .pytest_suite import LibTestSuite, PytestSuite, SystemTestSuite
|
||||
from .python_suite import PythonTestSuite
|
||||
from .suite import TestSuite
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
"""
|
||||
Classes used for defining and running python test suites
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
|
||||
from pavelib.utils.test import utils as test_utils
|
||||
from pavelib.utils.test.suites.suite import TestSuite
|
||||
from pavelib.utils.test.suites.pytest_suite import LibTestSuite, SystemTestSuite
|
||||
from pavelib.utils.envs import Env
|
||||
from pavelib.utils.test import utils as test_utils
|
||||
from pavelib.utils.test.suites.pytest_suite import LibTestSuite, SystemTestSuite
|
||||
from pavelib.utils.test.suites.suite import TestSuite
|
||||
|
||||
__test__ = False # do not collect
|
||||
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
"""
|
||||
A class used for defining and running test suites
|
||||
"""
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from paver import tasks
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
"""
|
||||
Helper functions for test tasks
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
Reference in New Issue
Block a user