summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncore.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-07-27 22:24:13 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-07-27 22:24:13 (GMT)
commit9a381c7a02022268c1db9c228283e5b533237784 (patch)
treeb9b9c6156a18c4045aba085b0af25839a00aee79 /Lib/test/test_asyncore.py
parentc47bd4a09a6702a08e5fb15d1d8ab3478393aba9 (diff)
downloadcpython-9a381c7a02022268c1db9c228283e5b533237784.zip
cpython-9a381c7a02022268c1db9c228283e5b533237784.tar.gz
cpython-9a381c7a02022268c1db9c228283e5b533237784.tar.bz2
With skipUnless there is no need to add test classes conditionally.
Diffstat (limited to 'Lib/test/test_asyncore.py')
-rw-r--r--Lib/test/test_asyncore.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
index fe820de..5a1b83c 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__":