diff options
| author | Colin Watson <cjwatson@canonical.com> | 2012-11-19 14:15:23 +0000 |
|---|---|---|
| committer | Colin Watson <cjwatson@canonical.com> | 2012-11-19 14:15:23 +0000 |
| commit | b8ea5404dd387aa9f414a44113610d395777b778 (patch) | |
| tree | d4d4a10edd99b5a21a7e1316d5ec2d651452267a | |
| parent | 116aa6eec9cf830d81c45ff257f16d7472e5314b (diff) | |
| download | python-apt-b8ea5404dd387aa9f414a44113610d395777b778.tar.gz | |
* tests/test_all.py:
- Write general test status output to stdout, not stderr.
| -rw-r--r-- | debian/changelog | 2 | ||||
| -rw-r--r-- | tests/test_all.py | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog index 25125971..2fbfc3b4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,8 @@ python-apt (0.8.8ubuntu4) UNRELEASED; urgency=low * tests/test_debfile_multiarch.py: - Don't log warnings when skipping tests; the resulting stderr output causes autopkgtest to fail. + * tests/test_all.py: + - Write general test status output to stdout, not stderr. -- Colin Watson <cjwatson@ubuntu.com> Mon, 19 Nov 2012 11:57:28 +0000 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) |
