diff options
author | Sascha Silbe <sascha@silbe.org> | 2009-08-12 12:44:51 (GMT) |
---|---|---|
committer | Sascha Silbe <sascha@silbe.org> | 2009-08-13 22:36:17 (GMT) |
commit | 31a9c674c421de221eb5d260527c3559928d387e (patch) | |
tree | 642cff9cc5b919df9992167c54cbb0d4ce2be6b7 | |
parent | efa55121ae141b8a0abc979a7b0079713849a5f0 (diff) |
runalltests.py: PEP8 / pylint fixes
-rw-r--r-- | tests/__init__.py | 2 | ||||
-rwxr-xr-x | tests/runalltests.py | 19 | ||||
-rw-r--r-- | tests/testutils.py | 2 |
3 files changed, 10 insertions, 13 deletions
diff --git a/tests/__init__.py b/tests/__init__.py index 6f73726..5b3912c 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,3 +1 @@ # testing package - - diff --git a/tests/runalltests.py b/tests/runalltests.py index 56a09bc..cf1677b 100755 --- a/tests/runalltests.py +++ b/tests/runalltests.py @@ -15,11 +15,9 @@ import sys import tempfile import unittest -import dbus.mainloop.glib - logging.basicConfig(level=logging.WARN, - format="%(asctime)-15s %(name)s %(levelname)s: %(message)s", - stream=sys.stderr) + format="%(asctime)-15s %(name)s %(levelname)s: %(message)s", + stream=sys.stderr) doctests = [ "basic_api.txt", @@ -49,7 +47,7 @@ def cleanup(): shutil.rmtree(os.environ['HOME']) -def test_suite(tests=[]): +def test_suite(tests=None): global doctests suite = unittest.TestSuite() if tests: @@ -76,19 +74,20 @@ def run_tests(tests): suite = test_suite(tests) runner.run(suite) -def main(my_name, arguments) : - if "--have-dbus" not in arguments : + +def main(my_name, arguments): + if "--have-dbus" not in arguments: setup() - try : + try: pipe = subprocess.Popen(['dbus-launch', os.path.abspath(my_name), '--have-dbus']+arguments, cwd=os.environ['HOME']) return pipe.wait() - finally : + finally: cleanup() - else : + else: run_tests(arguments[1:]) return 0 diff --git a/tests/testutils.py b/tests/testutils.py index fc667db..f6c131f 100644 --- a/tests/testutils.py +++ b/tests/testutils.py @@ -1,10 +1,10 @@ import tempfile import os + def tmpData(data): """Put data into a temporary file returning the filename """ fd, fn = tempfile.mkstemp() os.write(fd, data) os.close(fd) return fn - |