diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2012-12-11 15:32:02 +0100 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2012-12-11 15:32:02 +0100 |
| commit | 610c1592a0118483651e66d12eea51df0624ebc1 (patch) | |
| tree | f4ce184c0418eccd47bcde40df1063a4430c6f88 /tests/test_all.py | |
| parent | 2ad969f628aee2948a12f8c3ba03572646ac4c5f (diff) | |
| parent | c7eb97c2fc8e2f4d3a7e41ac615382657eb95d49 (diff) | |
| download | python-apt-610c1592a0118483651e66d12eea51df0624ebc1.tar.gz | |
merged test-fixes from ubuntu (mostly for dep8)
Diffstat (limited to 'tests/test_all.py')
| -rw-r--r-- | tests/test_all.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/test_all.py b/tests/test_all.py index 0f548781..0eccfa91 100644 --- a/tests/test_all.py +++ b/tests/test_all.py @@ -33,17 +33,22 @@ def get_library_dir(): plat_specifier) return os.path.abspath(library_dir) +class MyTestRunner(unittest.runner.TextTestRunner): + def __init__(self, *args, **kwargs): + kwargs["stream"] = sys.stdout + super(MyTestRunner, self).__init__(*args, **kwargs) + if __name__ == '__main__': if not os.access("/etc/apt/sources.list", os.R_OK): - sys.stderr.write("[tests] Skipping because sources.list is not readable\n") + sys.stdout.write("[tests] Skipping because sources.list is not readable\n") sys.exit(0) - sys.stderr.write("[tests] Running on %s\n" % sys.version.replace("\n", "")) + sys.stdout.write("[tests] Running on %s\n" % sys.version.replace("\n", "")) dirname = os.path.dirname(__file__) if dirname: os.chdir(dirname) library_dir = get_library_dir() - sys.stderr.write("Using library_dir: '%s'" % library_dir) + sys.stdout.write("Using library_dir: '%s'" % library_dir) if library_dir: sys.path.insert(0, os.path.abspath(library_dir)) @@ -51,4 +56,4 @@ if __name__ == '__main__': if path.endswith('.py') and os.path.isfile(path): exec('from %s import *' % path[:-3]) - unittest.main() + unittest.main(testRunner=MyTestRunner) |
