From: Ezio Melotti Date: Tue, 27 Jul 2010 22:24:13 +0000 (+0000) Subject: With skipUnless there is no need to add test classes conditionally. X-Git-Tag: v3.2a1~87 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9a381c7a02022268c1db9c228283e5b533237784;p=thirdparty%2FPython%2Fcpython.git With skipUnless there is no need to add test classes conditionally. --- diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py index fe820de8f23c..5a1b83ce6279 100644 --- a/Lib/test/test_asyncore.py +++ b/Lib/test/test_asyncore.py @@ -693,18 +693,15 @@ class BaseTestAPI(unittest.TestCase): class TestAPI_UseSelect(BaseTestAPI): use_poll = False +@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__":