[Python-checkins] cpython (2.7): Fix test failures --without-threads.

stefan.krah python-checkins at python.org
Wed Jan 22 13:19:02 CET 2014


http://hg.python.org/cpython/rev/d8af233da629
changeset:   88636:d8af233da629
branch:      2.7
parent:      88630:c28e07377b03
user:        Stefan Krah <skrah at bytereef.org>
date:        Wed Jan 22 13:18:09 2014 +0100
summary:
  Fix test failures --without-threads.

files:
  Lib/test/test_nntplib.py |  10 +++++++++-
  1 files changed, 9 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py
--- a/Lib/test/test_nntplib.py
+++ b/Lib/test/test_nntplib.py
@@ -1,7 +1,13 @@
 import socket
-import threading
 import nntplib
 import time
+import unittest
+
+try:
+    import threading
+except ImportError:
+    threading = None
+
 
 from unittest import TestCase
 from test import test_support
@@ -41,6 +47,7 @@
         self.evt.wait()
 
 
+ at unittest.skipUnless(threading, 'threading required')
 class ServerTests(BaseServerTest):
     evil = False
 
@@ -49,6 +56,7 @@
         nntp.sock.close()
 
 
+ at unittest.skipUnless(threading, 'threading required')
 class EvilServerTests(BaseServerTest):
     evil = True
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list