Skip to content

Commit

Permalink
Fix tests, close test loop if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Jun 22, 2015
1 parent b20f166 commit 5e97e11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/selectors_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def test_select_interrupt(self):
s.register(rd, EVENT_READ)
t = time()
self.assertFalse(s.select(2))
self.assertLess(time() - t, 2.5)
self.assertLess(time() - t, 3.5)

# see issue #18963 for why it's skipped on older OS X versions
@requires_mac_ver(10, 5)
Expand Down
6 changes: 6 additions & 0 deletions tests/transport_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def setUp(self):
self.exc_handler = mock.Mock()
self.loop.set_exception_handler(self.exc_handler)

def tearDown(self):
self.loop.close()

def test_empty_write(self):
self.tr.write([b''])
self.assertTrue(self.sock.send_multipart.called)
Expand Down Expand Up @@ -571,6 +574,9 @@ def setUp(self):
self.exc_handler = mock.Mock()
self.loop.set_exception_handler(self.exc_handler)

def tearDown(self):
self.loop.close()

def test_incomplete_read(self):
self.sock.recv_multipart.side_effect = zmq.Again(errno.EAGAIN)
self.tr._do_read()
Expand Down

0 comments on commit 5e97e11

Please sign in to comment.