[Python-modules-commits] [twisted] 13/16: no-stderr-in-test_ckeygen

Free Ekanayaka freee at moszumanska.debian.org
Mon Aug 28 17:40:04 UTC 2017


This is an automated email from the git hooks/post-receive script.

freee pushed a commit to branch patch-queue/master
in repository twisted.

commit 6cd4c42787e8df24aab3b703cfa3e3814d85659d
Author: Free Ekanayaka <freee at debian.org>
Date:   Sat Nov 26 11:37:52 2016 +0000

    no-stderr-in-test_ckeygen
    
    Fix an test writing to stderr. See:
    
    https://twistedmatrix.com/trac/ticket/8924
    
    Gbp-Pq: Name 0009-no-stderr-in-test_ckeygen.patch
---
 src/twisted/conch/test/test_ckeygen.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/twisted/conch/test/test_ckeygen.py b/src/twisted/conch/test/test_ckeygen.py
index 57123d4..61c9dfb 100644
--- a/src/twisted/conch/test/test_ckeygen.py
+++ b/src/twisted/conch/test/test_ckeygen.py
@@ -7,6 +7,7 @@ Tests for L{twisted.conch.scripts.ckeygen}.
 
 import getpass
 import sys
+import os
 import subprocess
 
 from io import BytesIO, StringIO
@@ -94,7 +95,10 @@ class KeyGenTests(TestCase):
     def test_runBadKeytype(self):
         filename = self.mktemp()
         with self.assertRaises(subprocess.CalledProcessError):
-            subprocess.check_call(['ckeygen', '-t', 'foo', '-f', filename])
+            with open(os.devnull, "rb") as devnull:
+                subprocess.check_call(
+                    ['ckeygen', '-t', 'foo', '-f', filename],
+                    stderr=devnull)
 
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/twisted.git



More information about the Python-modules-commits mailing list