Skip to content

Commit

Permalink
Merge pull request #1217 from minrk/test-tornado-4
Browse files Browse the repository at this point in the history
fix zmqstream tests with tornado 4.5
  • Loading branch information
minrk committed Aug 20, 2018
2 parents 1b78d39 + e6685b8 commit 90d7a93
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
25 changes: 18 additions & 7 deletions .travis.yml
Expand Up @@ -16,14 +16,17 @@ before_install:
- sudo add-apt-repository -y ppa:anton+/dnscrypt
- sudo apt-get update
- |
# install libzmq, libsodium unless zmq=bundled
if [[ $ZMQ != bundled ]]; then
sudo apt-get install -y -qq libzmq3-dev libsodium-dev
fi
- |
# install cython unless pypy
if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then
pip install -q cython --install-option="--no-cython-compile"
pip install cython
fi
- |
# build libzmq
if [[ ! -z "$ZMQ" && $ZMQ != bundled ]]; then
wget https://github.com/zeromq/$ZMQ/archive/master.zip -O libzmq.zip
unzip libzmq.zip
Expand All @@ -39,13 +42,15 @@ before_install:
fi
- pip install -r test-requirements.txt
- |
# install pinned tornado
if [[ "$TORNADO" == "master" ]]; then
pip install https://github.com/tornadoweb/tornado/archive/master.zip
fi
- |
if [[ "$NOTORNADO" == "1" ]]; then
elif [[ "$TORNADO" == "none" ]]; then
pip uninstall -yq tornado
elif [[ ! -z "$TORNADO" ]]; then
pip install tornado==${TORNADO}
fi
- pip freeze

install:
- python setup.py build_ext --inplace --zmq=$ZMQ
Expand All @@ -54,8 +59,6 @@ matrix:
include:
- python: pypy
env: ZMQ=bundled
- python: 3.6-dev
env: ZMQ=bundled
- python: 3.7
env: ZMQ=
dist: xenial
Expand All @@ -65,11 +68,19 @@ matrix:
- python: 3.6
env:
- ZMQ=
- NOTORNADO=1
- TORNADO=none
- python: 3.6
env:
- ZMQ=
- TORNADO=master
- python: 3.6
env:
- ZMQ=
- TORNADO=4.5.*
- python: 2.7
env:
- ZMQ=
- TORNADO=4.5.*
- python: 3.5
env: ZMQ=libzmq
- python: 3.4
Expand Down
5 changes: 3 additions & 2 deletions zmq/tests/test_zmqstream.py
Expand Up @@ -27,7 +27,8 @@ def setUp(self):
if asyncio:
asyncio.set_event_loop(asyncio.new_event_loop())
self.context = zmq.Context()
self.loop = ioloop.IOLoop.instance()
self.loop = ioloop.IOLoop()
self.loop.make_current()
self.push = zmqstream.ZMQStream(self.context.socket(zmq.PUSH))
self.pull = zmqstream.ZMQStream(self.context.socket(zmq.PULL))
port = self.push.bind_to_random_port('tcp://127.0.0.1')
Expand All @@ -37,7 +38,7 @@ def setUp(self):
def tearDown(self):
self.loop.close(all_fds=True)
self.context.term()
ioloop.IOLoop.clear_instance()
ioloop.IOLoop.clear_current()

def run_until_timeout(self, timeout=10):
timed_out = []
Expand Down

0 comments on commit 90d7a93

Please sign in to comment.