Commit 9c50fc1a authored by Ezio Melotti's avatar Ezio Melotti

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

parent 110d0e36
...@@ -693,18 +693,15 @@ class BaseTestAPI(unittest.TestCase): ...@@ -693,18 +693,15 @@ class BaseTestAPI(unittest.TestCase):
class TestAPI_UseSelect(BaseTestAPI): class TestAPI_UseSelect(BaseTestAPI):
use_poll = False use_poll = False
@unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required')
class TestAPI_UsePoll(BaseTestAPI): class TestAPI_UsePoll(BaseTestAPI):
use_poll = True use_poll = True
def test_main(): def test_main():
tests = [HelperFunctionTests, DispatcherTests, DispatcherWithSendTests, tests = [HelperFunctionTests, DispatcherTests, DispatcherWithSendTests,
DispatcherWithSendTests_UsePoll, TestAPI_UseSelect] DispatcherWithSendTests_UsePoll, TestAPI_UseSelect,
if hasattr(asyncore, 'file_wrapper'): TestAPI_UsePoll, FileWrapperTest]
tests.append(FileWrapperTest)
if hasattr(select, 'poll'):
tests.append(TestAPI_UsePoll)
run_unittest(*tests) run_unittest(*tests)
if __name__ == "__main__": if __name__ == "__main__":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment