summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncore.py
diff options
context:
space:
mode:
authorCharles-François Natali <neologix@free.fr>2011-10-31 11:08:09 (GMT)
committerCharles-François Natali <neologix@free.fr>2011-10-31 11:08:09 (GMT)
commit39648d11ab487fcc5e3ad88e06ced9c96e45cd43 (patch)
tree916b9db9e733f6bafa1589c5a9e6315eb02c1276 /Lib/test/test_asyncore.py
parent8f7bded7e0118d79615b9ac4a639aba7a4346bca (diff)
downloadcpython-39648d11ab487fcc5e3ad88e06ced9c96e45cd43.zip
cpython-39648d11ab487fcc5e3ad88e06ced9c96e45cd43.tar.gz
cpython-39648d11ab487fcc5e3ad88e06ced9c96e45cd43.tar.bz2
test_asyncore: Enable tests of Unix domain sockets with poll().
Diffstat (limited to 'Lib/test/test_asyncore.py')
-rw-r--r--Lib/test/test_asyncore.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
index dccdfed..c1b8637 100644
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -792,7 +792,6 @@ class TestAPI_UseUnixSockets(BaseTestAPI):
if HAS_UNIX_SOCKETS:
family = socket.AF_UNIX
addr = support.TESTFN
- use_poll = False
def tearDown(self):
unlink(self.addr)
@@ -812,11 +811,19 @@ class TestAPI_UseIPv6Select(TestAPI_UseIPv6Sockets):
class TestAPI_UseIPv6Poll(TestAPI_UseIPv6Sockets):
use_poll = True
+class TestAPI_UseUnixSocketsSelect(TestAPI_UseUnixSockets):
+ use_poll = False
+
+@unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required')
+class TestAPI_UseUnixSocketsPoll(TestAPI_UseUnixSockets):
+ use_poll = True
+
def test_main():
tests = [HelperFunctionTests, DispatcherTests, DispatcherWithSendTests,
DispatcherWithSendTests_UsePoll, FileWrapperTest,
TestAPI_UseIPv4Select, TestAPI_UseIPv4Poll, TestAPI_UseIPv6Select,
- TestAPI_UseIPv6Poll, TestAPI_UseUnixSockets]
+ TestAPI_UseIPv6Poll, TestAPI_UseUnixSocketsSelect,
+ TestAPI_UseUnixSocketsPoll]
run_unittest(*tests)
if __name__ == "__main__":