MCPcopy Index your code
hub / github.com/python/cpython / test_bind_release

Method test_bind_release

Lib/test/test_interpreters/test_queues.py:68–94  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

66 self.assertEqual(stderr, '')
67
68 def test_bind_release(self):
69 with self.subTest('typical'):
70 qid = _queues.create(2, REPLACE, -1)
71 _queues.bind(qid)
72 _queues.release(qid)
73 self.assertEqual(get_num_queues(), 0)
74
75 with self.subTest('bind too much'):
76 qid = _queues.create(2, REPLACE, -1)
77 _queues.bind(qid)
78 _queues.bind(qid)
79 _queues.release(qid)
80 _queues.destroy(qid)
81 self.assertEqual(get_num_queues(), 0)
82
83 with self.subTest('nested'):
84 qid = _queues.create(2, REPLACE, -1)
85 _queues.bind(qid)
86 _queues.bind(qid)
87 _queues.release(qid)
88 _queues.release(qid)
89 self.assertEqual(get_num_queues(), 0)
90
91 with self.subTest('release without binding'):
92 qid = _queues.create(2, REPLACE, -1)
93 with self.assertRaises(queues.QueueError):
94 _queues.release(qid)
95
96
97class QueueTests(TestBase):

Callers

nothing calls this directly

Calls 8

get_num_queuesFunction · 0.85
subTestMethod · 0.45
createMethod · 0.45
bindMethod · 0.45
releaseMethod · 0.45
assertEqualMethod · 0.45
destroyMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected