summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Ramacher <sebastian@ramacher.at>2013-04-05 12:23:24 +0200
committerSebastian Ramacher <sebastian@ramacher.at>2013-04-05 12:23:24 +0200
commit501915bc13ac6b350d63f13c3e28909a05fdc3e3 (patch)
tree6c8e2d3eb3d6872d2f819ab295e1003fc4ad24d0
parente60056466f5e181cd31e444ccc4aefd948328996 (diff)
downloadpycrypto-501915bc13ac6b350d63f13c3e28909a05fdc3e3.tar.gz
Pass corret stream to TestTextRunner
If stream is not None, add it to kwargs and pass it to TestTextRunner. Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
-rw-r--r--lib/Crypto/SelfTest/__init__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Crypto/SelfTest/__init__.py b/lib/Crypto/SelfTest/__init__.py
index e2da0f8..7110cd2 100644
--- a/lib/Crypto/SelfTest/__init__.py
+++ b/lib/Crypto/SelfTest/__init__.py
@@ -66,6 +66,8 @@ def run(module=None, verbosity=0, stream=None, tests=None, config=None, **kwargs
raise ValueError("'module' and 'tests' arguments are mutually exclusive")
if stream is None:
kwargs['stream'] = StringIO()
+ else:
+ kwargs['stream'] = stream
runner = unittest.TextTestRunner(verbosity=verbosity, **kwargs)
result = runner.run(suite)
if not result.wasSuccessful():