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

Skip to content

Commit ad000ad

Browse files
Add a dedicated ChannelIDTests.test_shareable().
1 parent f555fbe commit ad000ad

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Lib/test/test__xxsubinterpreters.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,6 @@ def test_types(self):
386386
self._assert_values([
387387
b'spam',
388388
9999,
389-
self.cid,
390389
])
391390

392391
def test_bytes(self):
@@ -1213,6 +1212,18 @@ def test_equality(self):
12131212
self.assertFalse(cid1 != cid2)
12141213
self.assertTrue(cid1 != cid3)
12151214

1215+
def test_shareable(self):
1216+
chan = interpreters.channel_create()
1217+
1218+
obj = interpreters.channel_create()
1219+
interpreters.channel_send(chan, obj)
1220+
got = interpreters.channel_recv(chan)
1221+
1222+
self.assertEqual(got, obj)
1223+
self.assertIs(type(got), type(obj))
1224+
# XXX Check the following in the channel tests?
1225+
#self.assertIsNot(got, obj)
1226+
12161227

12171228
class ChannelTests(TestBase):
12181229

0 commit comments

Comments
 (0)