mirror of
https://github.com/python/cpython
synced 2026-09-29 11:30:29 +03:00
With skipUnless there is no need to add test classes conditionally.
This commit is contained in:
parent
c47bd4a09a
commit
9a381c7a02
1 changed files with 3 additions and 6 deletions
|
|
@ -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__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue