From fd022a425711a9486bec93c9ebd441ff84432a78 Mon Sep 17 00:00:00 2001 From: Tom Cammann Date: Tue, 1 Sep 2015 20:52:05 +0100 Subject: [PATCH] Fix pep8 and py27 checks for gate Change-Id: I6d0abb66a4e39aaef762a2b31c2522991078e06c --- .testr.conf | 7 +++++++ cathead/cathead.py | 4 +++- tests/test_selfsigndriver.py | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .testr.conf diff --git a/.testr.conf b/.testr.conf new file mode 100644 index 0000000..35d9ba4 --- /dev/null +++ b/.testr.conf @@ -0,0 +1,7 @@ +[DEFAULT] +test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ + OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ + OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ + ${PYTHON:-python} -m subunit.run discover -t ./ ./tests $LISTOPT $IDOPTION +test_id_option=--load-list $IDFILE +test_list_option=--list diff --git a/cathead/cathead.py b/cathead/cathead.py index 5c226c0..652ebba 100644 --- a/cathead/cathead.py +++ b/cathead/cathead.py @@ -113,12 +113,14 @@ class Cathead(object): def wait(self): self._scheduler.wait() + def main(): if len(sys.argv) == 2: # sys.path.append(os.path.abspath(sys.argv[1])) # conf_module = importlib.import_module(sys.argv[1].split(".py")[0]) # conf = __import__(sys.argv[1].split(".py")[0]) - (file, path, desc) = imp.find_module(sys.argv[1].split(".py")[0], ["."]) + py_file = sys.argv[1].split(".py")[0] + (file, path, desc) = imp.find_module(py_file, ["."]) conf_module = imp.load_module('', file, path, desc) Cathead(conf_module.CONF).start() else: diff --git a/tests/test_selfsigndriver.py b/tests/test_selfsigndriver.py index d82d539..cc02c1c 100644 --- a/tests/test_selfsigndriver.py +++ b/tests/test_selfsigndriver.py @@ -1,6 +1,6 @@ import re -import unittest import tempfile +import unittest from cathead.drivers import selfsign from cathead import x509