forked from IronLanguages/ironpython3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_socket_stdlib.py
More file actions
77 lines (67 loc) · 4.46 KB
/
Copy pathtest_socket_stdlib.py
File metadata and controls
77 lines (67 loc) · 4.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
##
## Run selected tests from test_socket from StdLib
##
import sys
from iptest import is_ironpython, generate_suite, run_test, is_linux, is_osx, net_version, is_mono, is_posix
import test.test_socket
def load_tests(loader, standard_tests, pattern):
tests = loader.loadTestsFromModule(test.test_socket, pattern=pattern)
if is_ironpython:
failing_tests = [
test.test_socket.BasicTCPTest('testDetach'), # https://github.com/IronLanguages/ironpython3/issues/1224
test.test_socket.BasicTCPTest('testDup'), # https://github.com/IronLanguages/ironpython3/issues/1223
test.test_socket.BasicTCPTest('testFromFd'), # https://github.com/IronLanguages/ironpython3/issues/1223
test.test_socket.BasicTCPTest2('testDetach'), # https://github.com/IronLanguages/ironpython3/issues/1224
test.test_socket.BasicTCPTest2('testDup'), # https://github.com/IronLanguages/ironpython3/issues/1223
test.test_socket.BasicTCPTest2('testFromFd'), # https://github.com/IronLanguages/ironpython3/issues/1223
test.test_socket.GeneralModuleTests('testSendtoErrors'), # TypeError messages all different
test.test_socket.GeneralModuleTests('test_csocket_repr'), # https://github.com/IronLanguages/ironpython3/issues/1221
test.test_socket.GeneralModuleTests('test_uknown_socket_family_repr'), # TODO: figure out
test.test_socket.InheritanceTest('test_default_inheritable'), # https://github.com/IronLanguages/ironpython3/issues/1225
test.test_socket.InheritanceTest('test_dup'), # https://github.com/IronLanguages/ironpython3/issues/1223
test.test_socket.InheritanceTest('test_get_inheritable_cloexec'), # https://github.com/IronLanguages/ironpython3/issues/1225
test.test_socket.InheritanceTest('test_set_inheritable'), # https://github.com/IronLanguages/ironpython3/issues/1225
test.test_socket.InheritanceTest('test_set_inheritable_cloexec'), # https://github.com/IronLanguages/ironpython3/issues/1225
test.test_socket.InheritanceTest('test_socketpair'), # https://github.com/IronLanguages/ironpython3/issues/1225
test.test_socket.TestSocketSharing('testShare'), # https://github.com/IronLanguages/ironpython3/issues/1226
test.test_socket.TestSocketSharing('testShareLength'), # https://github.com/IronLanguages/ironpython3/issues/1226
test.test_socket.TestSocketSharing('testShareLocal'), # https://github.com/IronLanguages/ironpython3/issues/1226
test.test_socket.TestSocketSharing('testTypes'), # https://github.com/IronLanguages/ironpython3/issues/1226
test.test_socket.UnbufferedFileObjectClassTestCase('testSmallReadNonBlocking'), # TODO: figure out
]
if sys.version_info >= (3, 6):
failing_tests += [
test.test_socket.GeneralModuleTests('testCloseException'), # TODO: figure out
]
if is_posix: # https://github.com/IronLanguages/ironpython3/pull/1638#discussion_r1059535867
failing_tests += [
test.test_socket.GeneralModuleTests('test_socket_fileno_requires_socket_fd'),
]
if is_mono or sys.version_info < (3, 6) and (is_linux or (is_osx and net_version < (10, 0))):
failing_tests += [
test.test_socket.NonBlockingTCPTests('testRecv'), # TODO: figure out
]
if is_linux:
failing_tests += [
test.test_socket.GeneralModuleTests('test_idna'), # TODO: figure out
]
skip_tests = [
test.test_socket.UnbufferedFileObjectClassTestCase('testWriteNonBlocking') # fails intermittently during CI
]
if is_posix: # TODO: figure out - failure in setup
skip_tests += [
test.test_socket.BasicSocketPairTest('testDefaults'),
test.test_socket.BasicSocketPairTest('testRecv'),
test.test_socket.BasicSocketPairTest('testSend'),
]
if is_posix: # TODO: figure out - failure in teardown
skip_tests += [
test.test_socket.NonBlockingTCPTests('testAccept')
]
return generate_suite(tests, failing_tests, skip_tests)
else:
return tests
run_test(__name__)