Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 39648d1

Browse files
author
Charles-François Natali
committed
test_asyncore: Enable tests of Unix domain sockets with poll().
1 parent 8f7bded commit 39648d1

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

Lib/test/test_asyncore.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,6 @@ class TestAPI_UseUnixSockets(BaseTestAPI):
792792
if HAS_UNIX_SOCKETS:
793793
family = socket.AF_UNIX
794794
addr = support.TESTFN
795-
use_poll = False
796795

797796
def tearDown(self):
798797
unlink(self.addr)
@@ -812,11 +811,19 @@ class TestAPI_UseIPv6Select(TestAPI_UseIPv6Sockets):
812811
class TestAPI_UseIPv6Poll(TestAPI_UseIPv6Sockets):
813812
use_poll = True
814813

814+
class TestAPI_UseUnixSocketsSelect(TestAPI_UseUnixSockets):
815+
use_poll = False
816+
817+
@unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required')
818+
class TestAPI_UseUnixSocketsPoll(TestAPI_UseUnixSockets):
819+
use_poll = True
820+
815821
def test_main():
816822
tests = [HelperFunctionTests, DispatcherTests, DispatcherWithSendTests,
817823
DispatcherWithSendTests_UsePoll, FileWrapperTest,
818824
TestAPI_UseIPv4Select, TestAPI_UseIPv4Poll, TestAPI_UseIPv6Select,
819-
TestAPI_UseIPv6Poll, TestAPI_UseUnixSockets]
825+
TestAPI_UseIPv6Poll, TestAPI_UseUnixSocketsSelect,
826+
TestAPI_UseUnixSocketsPoll]
820827
run_unittest(*tests)
821828

822829
if __name__ == "__main__":

0 commit comments

Comments
 (0)