[Python-checkins] r83186 - python/branches/py3k/Lib/test/test_asyncore.py

ezio.melotti python-checkins at python.org
Wed Jul 28 00:24:13 CEST 2010


Author: ezio.melotti
Date: Wed Jul 28 00:24:13 2010
New Revision: 83186

Log:
With skipUnless there is no need to add test classes conditionally.

Modified:
   python/branches/py3k/Lib/test/test_asyncore.py

Modified: python/branches/py3k/Lib/test/test_asyncore.py
==============================================================================
--- python/branches/py3k/Lib/test/test_asyncore.py	(original)
+++ python/branches/py3k/Lib/test/test_asyncore.py	Wed Jul 28 00:24:13 2010
@@ -693,18 +693,15 @@
 class TestAPI_UseSelect(BaseTestAPI):
     use_poll = False
 
+ at unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required')
 class TestAPI_UsePoll(BaseTestAPI):
     use_poll = True
 
 
 def test_main():
     tests = [HelperFunctionTests, DispatcherTests, DispatcherWithSendTests,
-             DispatcherWithSendTests_UsePoll, TestAPI_UseSelect]
-    if hasattr(asyncore, 'file_wrapper'):
-        tests.append(FileWrapperTest)
-    if hasattr(select, 'poll'):
-        tests.append(TestAPI_UsePoll)
-
+             DispatcherWithSendTests_UsePoll, TestAPI_UseSelect,
+             TestAPI_UsePoll, FileWrapperTest]
     run_unittest(*tests)
 
 if __name__ == "__main__":


More information about the Python-checkins mailing list