Skip to content

Commit e6463eb

Browse files
committed
Unskip tests for asynchat and asyncore
1 parent 2dbe4a9 commit e6463eb

File tree

3 files changed

+3
-49
lines changed

3 files changed

+3
-49
lines changed

Lib/test/test_asynchat.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -130,22 +130,16 @@ def line_terminator_check(self, term, server_chunk):
130130
# chunks back from the server in order to exercise all branches of
131131
# async_chat.handle_read
132132

133-
# TODO: RUSTPYTHON
134-
@unittest.expectedFailure
135133
def test_line_terminator1(self):
136134
# test one-character terminator
137135
for l in (1, 2, 3):
138136
self.line_terminator_check(b'\n', l)
139137

140-
# TODO: RUSTPYTHON
141-
@unittest.expectedFailure
142138
def test_line_terminator2(self):
143139
# test two-character terminator
144140
for l in (1, 2, 3):
145141
self.line_terminator_check(b'\r\n', l)
146142

147-
# TODO: RUSTPYTHON
148-
@unittest.expectedFailure
149143
def test_line_terminator3(self):
150144
# test three-character terminator
151145
for l in (1, 2, 3):
@@ -163,20 +157,14 @@ def numeric_terminator_check(self, termlen):
163157

164158
self.assertEqual(c.contents, [data[:termlen]])
165159

166-
# TODO: RUSTPYTHON
167-
@unittest.expectedFailure
168160
def test_numeric_terminator1(self):
169161
# check that ints & longs both work (since type is
170162
# explicitly checked in async_chat.handle_read)
171163
self.numeric_terminator_check(1)
172164

173-
# TODO: RUSTPYTHON
174-
@unittest.expectedFailure
175165
def test_numeric_terminator2(self):
176166
self.numeric_terminator_check(6)
177167

178-
# TODO: RUSTPYTHON
179-
@unittest.expectedFailure
180168
def test_none_terminator(self):
181169
# Try reading a fixed number of bytes
182170
s, event = start_echo_server()
@@ -190,8 +178,6 @@ def test_none_terminator(self):
190178
self.assertEqual(c.contents, [])
191179
self.assertEqual(c.buffer, data)
192180

193-
# TODO: RUSTPYTHON
194-
@unittest.expectedFailure
195181
def test_simple_producer(self):
196182
s, event = start_echo_server()
197183
c = echo_client(b'\n', s.port)
@@ -203,8 +189,6 @@ def test_simple_producer(self):
203189

204190
self.assertEqual(c.contents, [b"hello world", b"I'm not dead yet!"])
205191

206-
# TODO: RUSTPYTHON
207-
@unittest.expectedFailure
208192
def test_string_producer(self):
209193
s, event = start_echo_server()
210194
c = echo_client(b'\n', s.port)
@@ -215,8 +199,6 @@ def test_string_producer(self):
215199

216200
self.assertEqual(c.contents, [b"hello world", b"I'm not dead yet!"])
217201

218-
# TODO: RUSTPYTHON
219-
@unittest.expectedFailure
220202
def test_empty_line(self):
221203
# checks that empty lines are handled correctly
222204
s, event = start_echo_server()
@@ -229,8 +211,6 @@ def test_empty_line(self):
229211
self.assertEqual(c.contents,
230212
[b"hello world", b"", b"I'm not dead yet!"])
231213

232-
# TODO: RUSTPYTHON
233-
@unittest.expectedFailure
234214
def test_close_when_done(self):
235215
s, event = start_echo_server()
236216
s.start_resend_event = threading.Event()
@@ -253,8 +233,6 @@ def test_close_when_done(self):
253233
# (which could still result in the client not having received anything)
254234
self.assertGreater(len(s.buffer), 0)
255235

256-
# TODO: RUSTPYTHON
257-
@unittest.expectedFailure
258236
def test_push(self):
259237
# Issue #12523: push() should raise a TypeError if it doesn't get
260238
# a bytes string

Lib/test/test_asyncore.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,6 @@ def setUp(self):
323323
def tearDown(self):
324324
asyncore.close_all()
325325

326-
# TODO: RUSTPYTHON
327-
@unittest.expectedFailure
328326
@support.reap_threads
329327
def test_send(self):
330328
evt = threading.Event()
@@ -376,7 +374,6 @@ def setUp(self):
376374
def tearDown(self):
377375
support.unlink(support.TESTFN)
378376

379-
@unittest.skip("TODO: RUSTPYTHON, thread 'main' panicked at 'assertion failed: `(left != right)` left: `-1`, right: `-1`'")
380377
def test_recv(self):
381378
fd = os.open(support.TESTFN, os.O_RDONLY)
382379
w = asyncore.file_wrapper(fd)
@@ -515,8 +512,6 @@ def loop_waiting_for_flag(self, instance, timeout=5):
515512
time.sleep(timeout)
516513
self.fail("flag not set")
517514

518-
# TODO: RUSTPYTHON
519-
@unittest.expectedFailure
520515
def test_handle_connect(self):
521516
# make sure handle_connect is called on connect()
522517

@@ -528,8 +523,6 @@ def handle_connect(self):
528523
client = TestClient(self.family, server.address)
529524
self.loop_waiting_for_flag(client)
530525

531-
# TODO: RUSTPYTHON
532-
@unittest.expectedFailure
533526
def test_handle_accept(self):
534527
# make sure handle_accept() is called when a client connects
535528

@@ -549,8 +542,6 @@ def handle_accept(self):
549542
client = BaseClient(self.family, server.address)
550543
self.loop_waiting_for_flag(server)
551544

552-
# TODO: RUSTPYTHON
553-
@unittest.expectedFailure
554545
def test_handle_accepted(self):
555546
# make sure handle_accepted() is called when a client connects
556547

@@ -575,8 +566,6 @@ def handle_accepted(self, sock, addr):
575566
self.loop_waiting_for_flag(server)
576567

577568

578-
# TODO: RUSTPYTHON
579-
@unittest.expectedFailure
580569
def test_handle_read(self):
581570
# make sure handle_read is called on data received
582571

@@ -593,8 +582,6 @@ def __init__(self, conn):
593582
client = TestClient(self.family, server.address)
594583
self.loop_waiting_for_flag(client)
595584

596-
# TODO: RUSTPYTHON
597-
@unittest.expectedFailure
598585
def test_handle_write(self):
599586
# make sure handle_write is called
600587

@@ -606,8 +593,6 @@ def handle_write(self):
606593
client = TestClient(self.family, server.address)
607594
self.loop_waiting_for_flag(client)
608595

609-
# TODO: RUSTPYTHON
610-
@unittest.expectedFailure
611596
def test_handle_close(self):
612597
# make sure handle_close is called when the other end closes
613598
# the connection
@@ -632,8 +617,6 @@ def __init__(self, conn):
632617
client = TestClient(self.family, server.address)
633618
self.loop_waiting_for_flag(client)
634619

635-
# TODO: RUSTPYTHON
636-
@unittest.expectedFailure
637620
def test_handle_close_after_conn_broken(self):
638621
# Check that ECONNRESET/EPIPE is correctly handled (issues #5661 and
639622
# #11265).
@@ -666,8 +649,6 @@ def writable(self):
666649
client = TestClient(self.family, server.address)
667650
self.loop_waiting_for_flag(client)
668651

669-
# TODO: RUSTPYTHON
670-
@unittest.expectedFailure
671652
@unittest.skipIf(sys.platform.startswith("sunos"),
672653
"OOB support is broken on Solaris")
673654
def test_handle_expt(self):
@@ -694,8 +675,6 @@ def __init__(self, conn):
694675
client = TestClient(self.family, server.address)
695676
self.loop_waiting_for_flag(client)
696677

697-
# TODO: RUSTPYTHON
698-
@unittest.expectedFailure
699678
def test_handle_error(self):
700679

701680
class TestClient(BaseClient):
@@ -714,8 +693,6 @@ def handle_error(self):
714693
client = TestClient(self.family, server.address)
715694
self.loop_waiting_for_flag(client)
716695

717-
# TODO: RUSTPYTHON
718-
@unittest.expectedFailure
719696
def test_connection_attributes(self):
720697
server = BaseServer(self.family, self.addr)
721698
client = BaseClient(self.family, server.address)
@@ -790,8 +767,6 @@ def test_set_reuse_addr(self):
790767
self.assertTrue(s.socket.getsockopt(socket.SOL_SOCKET,
791768
socket.SO_REUSEADDR))
792769

793-
# TODO: RUSTPYTHON
794-
@unittest.expectedFailure
795770
@support.reap_threads
796771
def test_quick_connect(self):
797772
# see: http://bugs.python.org/issue10340

vm/src/stdlib/socket.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ mod c {
6969
pub use winapi::shared::ws2def::*;
7070
pub use winapi::um::winsock2::{
7171
SD_BOTH as SHUT_RDWR, SD_RECEIVE as SHUT_RD, SD_SEND as SHUT_WR, SOCK_DGRAM, SOCK_RAW,
72-
SOCK_RDM, SOCK_STREAM, SOL_SOCKET, SO_BROADCAST, SO_ERROR, SO_OOBINLINE, SO_REUSEADDR,
73-
SO_TYPE, *,
72+
SOCK_RDM, SOCK_STREAM, SOL_SOCKET, SO_BROADCAST, SO_ERROR, SO_LINGER, SO_OOBINLINE,
73+
SO_REUSEADDR, SO_TYPE, *,
7474
};
7575
}
7676

@@ -1558,6 +1558,7 @@ pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
15581558
"SO_BROADCAST" => ctx.new_int(c::SO_BROADCAST),
15591559
"SO_OOBINLINE" => ctx.new_int(c::SO_OOBINLINE),
15601560
"SO_ERROR" => ctx.new_int(c::SO_ERROR),
1561+
"SO_LINGER" => ctx.new_int(c::SO_LINGER),
15611562
"TCP_NODELAY" => ctx.new_int(c::TCP_NODELAY),
15621563
"NI_NAMEREQD" => ctx.new_int(c::NI_NAMEREQD),
15631564
"NI_NOFQDN" => ctx.new_int(c::NI_NOFQDN),

0 commit comments

Comments
 (0)