Skip to content

Instantly share code, notes, and snippets.

@nedbat
Created August 4, 2016 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nedbat/a482ea69fa509de5e0a7c3da8f378e4b to your computer and use it in GitHub Desktop.
Save nedbat/a482ea69fa509de5e0a7c3da8f378e4b to your computer and use it in GitHub Desktop.
[:~] $ mkvirtualenv -p python3.5 bug512
Running virtualenv with interpreter /usr/local/bin/python3.5
Using base prefix '/usr/local/pythonz/pythons/CPython-3.5.2'
New python executable in bug512/bin/python3.5
Also creating executable in bug512/bin/python
Installing setuptools, pip, wheel...done.
[:~] [bug512] 30s $
[:~] [bug512] $ cd ~/foo
[:~/foo] [bug512] $ mkdir bug512
[:~/foo] [bug512] $ g clone https://github.com/samuelcolvin/arq.git
Cloning into 'arq'...
remote: Counting objects: 301, done.
remote: Compressing objects: 100% (38/38), done.
remote: Total 301 (delta 22), reused 0 (delta 0), pack-reused 263
Receiving objects: 100% (301/301), 74.57 KiB | 0 bytes/s, done.
Resolving deltas: 100% (201/201), done.
Checking connectivity... done.
[:~/foo] [bug512] $ #pip install -e . && pip install -r tests/requirements.txt
[:~/foo] [bug512] $ cd arq/
[:~/foo/arq] [bug512] master ± pip install -e . && pip install -r tests/requirements.txt
Obtaining file:///Users/ned/foo/arq
Collecting aioredis>=0.2.8 (from arq==0.0.3)
Downloading aioredis-0.2.8-py3-none-any.whl
Collecting click>=6.6 (from arq==0.0.3)
Collecting msgpack-python>=0.4.7 (from arq==0.0.3)
Downloading msgpack-python-0.4.8.tar.gz (113kB)
100% |████████████████████████████████| 114kB 3.4MB/s
Collecting hiredis (from aioredis>=0.2.8->arq==0.0.3)
Downloading hiredis-0.2.0.tar.gz (46kB)
100% |████████████████████████████████| 49kB 7.2MB/s
Building wheels for collected packages: msgpack-python, hiredis
Running setup.py bdist_wheel for msgpack-python
Complete output from command /usr/local/virtualenvs/bug512/bin/python3.5 -c "import setuptools;__file__='/private/var/folders/j2/gr3cj3jn63s5q8g3bjvw57hm0000gp/T/pip-build-1k21lkvn/msgpack-python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /var/folders/j2/gr3cj3jn63s5q8g3bjvw57hm0000gp/T/tmpmys604gjpip-wheel-:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.10-x86_64-3.5
creating build/lib.macosx-10.10-x86_64-3.5/msgpack
copying msgpack/__init__.py -> build/lib.macosx-10.10-x86_64-3.5/msgpack
copying msgpack/_version.py -> build/lib.macosx-10.10-x86_64-3.5/msgpack
copying msgpack/exceptions.py -> build/lib.macosx-10.10-x86_64-3.5/msgpack
copying msgpack/fallback.py -> build/lib.macosx-10.10-x86_64-3.5/msgpack
running build_ext
building 'msgpack._packer' extension
creating build/temp.macosx-10.10-x86_64-3.5
creating build/temp.macosx-10.10-x86_64-3.5/msgpack
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -D__LITTLE_ENDIAN__=1 -I. -I/usr/local/pythonz/pythons/CPython-3.5.2/include/python3.5m -c msgpack/_packer.cpp -o build/temp.macosx-10.10-x86_64-3.5/msgpack/_packer.o
msgpack/_packer.cpp:3407:13: warning: code will never be executed [-Wunreachable-code]
__pyx_r = 0;
^
msgpack/_packer.cpp:7546:32: warning: unused function '__Pyx_PyUnicode_FromString' [-Wunused-function]
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
^
msgpack/_packer.cpp:7661:33: warning: unused function '__Pyx_PyIndex_AsSsize_t' [-Wunused-function]
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
^
msgpack/_packer.cpp:5421:27: warning: unused function '__Pyx_ErrFetchInState' [-Wunused-function]
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
^
msgpack/_packer.cpp:7205:42: warning: unused function '__Pyx_PyInt_From_long' [-Wunused-function]
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
^
msgpack/_packer.cpp:7232:36: warning: function '__Pyx_PyInt_As_int' is not needed and will not be emitted [-Wunneeded-internal-declaration]
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
^
6 warnings generated.
g++ -bundle -undefined dynamic_lookup build/temp.macosx-10.10-x86_64-3.5/msgpack/_packer.o -o build/lib.macosx-10.10-x86_64-3.5/msgpack/_packer.cpython-35m-darwin.so
building 'msgpack._unpacker' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -D__LITTLE_ENDIAN__=1 -I. -I/usr/local/pythonz/pythons/CPython-3.5.2/include/python3.5m -c msgpack/_unpacker.cpp -o build/temp.macosx-10.10-x86_64-3.5/msgpack/_unpacker.o
msgpack/_unpacker.cpp:7801:28: warning: unused function '__Pyx_PyObject_AsString' [-Wunused-function]
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
^
msgpack/_unpacker.cpp:7798:32: warning: unused function '__Pyx_PyUnicode_FromString' [-Wunused-function]
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
^
msgpack/_unpacker.cpp:7975:33: warning: unused function '__Pyx_PyInt_FromSize_t' [-Wunused-function]
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
^
msgpack/_unpacker.cpp:6933:27: warning: unused function '__Pyx__ExceptionSave' [-Wunused-function]
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
^
msgpack/_unpacker.cpp:7457:42: warning: unused function '__Pyx_PyInt_From_long' [-Wunused-function]
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
^
msgpack/_unpacker.cpp:7484:37: warning: function '__Pyx_PyInt_As_long' is not needed and will not be emitted [-Wunneeded-internal-declaration]
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
^
6 warnings generated.
g++ -bundle -undefined dynamic_lookup build/temp.macosx-10.10-x86_64-3.5/msgpack/_unpacker.o -o build/lib.macosx-10.10-x86_64-3.5/msgpack/_unpacker.cpython-35m-darwin.so
installing to build/bdist.macosx-10.10-x86_64/wheel
running install
running install_lib
creating build/bdist.macosx-10.10-x86_64
creating build/bdist.macosx-10.10-x86_64/wheel
creating build/bdist.macosx-10.10-x86_64/wheel/msgpack
copying build/lib.macosx-10.10-x86_64-3.5/msgpack/__init__.py -> build/bdist.macosx-10.10-x86_64/wheel/msgpack
copying build/lib.macosx-10.10-x86_64-3.5/msgpack/_packer.cpython-35m-darwin.so -> build/bdist.macosx-10.10-x86_64/wheel/msgpack
copying build/lib.macosx-10.10-x86_64-3.5/msgpack/_unpacker.cpython-35m-darwin.so -> build/bdist.macosx-10.10-x86_64/wheel/msgpack
copying build/lib.macosx-10.10-x86_64-3.5/msgpack/_version.py -> build/bdist.macosx-10.10-x86_64/wheel/msgpack
copying build/lib.macosx-10.10-x86_64-3.5/msgpack/exceptions.py -> build/bdist.macosx-10.10-x86_64/wheel/msgpack
copying build/lib.macosx-10.10-x86_64-3.5/msgpack/fallback.py -> build/bdist.macosx-10.10-x86_64/wheel/msgpack
running install_egg_info
running egg_info
creating msgpack_python.egg-info
writing top-level names to msgpack_python.egg-info/top_level.txt
writing dependency_links to msgpack_python.egg-info/dependency_links.txt
writing msgpack_python.egg-info/PKG-INFO
writing manifest file 'msgpack_python.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
reading manifest file 'msgpack_python.egg-info/SOURCES.txt'
writing manifest file 'msgpack_python.egg-info/SOURCES.txt'
Copying msgpack_python.egg-info to build/bdist.macosx-10.10-x86_64/wheel/msgpack_python-0.4.8-py3.5.egg-info
running install_scripts
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/j2/gr3cj3jn63s5q8g3bjvw57hm0000gp/T/pip-build-1k21lkvn/msgpack-python/setup.py", line 120, in <module>
'License :: OSI Approved :: Apache Software License',
File "/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 213, in run
archive_basename = self.get_archive_basename()
File "/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 161, in get_archive_basename
impl_tag, abi_tag, plat_tag = self.get_tag()
File "/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 155, in get_tag
assert tag == supported_tags[0]
AssertionError
----------------------------------------
Failed building wheel for msgpack-python
Running setup.py bdist_wheel for hiredis
Complete output from command /usr/local/virtualenvs/bug512/bin/python3.5 -c "import setuptools;__file__='/private/var/folders/j2/gr3cj3jn63s5q8g3bjvw57hm0000gp/T/pip-build-1k21lkvn/hiredis/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /var/folders/j2/gr3cj3jn63s5q8g3bjvw57hm0000gp/T/tmpwigaqiqjpip-wheel-:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.10-x86_64-3.5
creating build/lib.macosx-10.10-x86_64-3.5/hiredis
copying hiredis/__init__.py -> build/lib.macosx-10.10-x86_64-3.5/hiredis
copying hiredis/version.py -> build/lib.macosx-10.10-x86_64-3.5/hiredis
running build_clib
building 'hiredis_for_hiredis_py' library
creating build/temp.macosx-10.10-x86_64-3.5
creating build/temp.macosx-10.10-x86_64-3.5/vendor
creating build/temp.macosx-10.10-x86_64-3.5/vendor/hiredis
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -c vendor/hiredis/read.c -o build/temp.macosx-10.10-x86_64-3.5/vendor/hiredis/read.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -c vendor/hiredis/sds.c -o build/temp.macosx-10.10-x86_64-3.5/vendor/hiredis/sds.o
ar rc build/temp.macosx-10.10-x86_64-3.5/libhiredis_for_hiredis_py.a build/temp.macosx-10.10-x86_64-3.5/vendor/hiredis/read.o build/temp.macosx-10.10-x86_64-3.5/vendor/hiredis/sds.o
ranlib build/temp.macosx-10.10-x86_64-3.5/libhiredis_for_hiredis_py.a
running build_ext
building 'hiredis.hiredis' extension
creating build/temp.macosx-10.10-x86_64-3.5/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ivendor -I/usr/local/pythonz/pythons/CPython-3.5.2/include/python3.5m -c src/hiredis.c -o build/temp.macosx-10.10-x86_64-3.5/src/hiredis.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ivendor -I/usr/local/pythonz/pythons/CPython-3.5.2/include/python3.5m -c src/reader.c -o build/temp.macosx-10.10-x86_64-3.5/src/reader.o
gcc -bundle -undefined dynamic_lookup build/temp.macosx-10.10-x86_64-3.5/src/hiredis.o build/temp.macosx-10.10-x86_64-3.5/src/reader.o -Lbuild/temp.macosx-10.10-x86_64-3.5 -lhiredis_for_hiredis_py -o build/lib.macosx-10.10-x86_64-3.5/hiredis/hiredis.cpython-35m-darwin.so
installing to build/bdist.macosx-10.10-x86_64/wheel
running install
running install_lib
creating build/bdist.macosx-10.10-x86_64
creating build/bdist.macosx-10.10-x86_64/wheel
creating build/bdist.macosx-10.10-x86_64/wheel/hiredis
copying build/lib.macosx-10.10-x86_64-3.5/hiredis/__init__.py -> build/bdist.macosx-10.10-x86_64/wheel/hiredis
copying build/lib.macosx-10.10-x86_64-3.5/hiredis/hiredis.cpython-35m-darwin.so -> build/bdist.macosx-10.10-x86_64/wheel/hiredis
copying build/lib.macosx-10.10-x86_64-3.5/hiredis/version.py -> build/bdist.macosx-10.10-x86_64/wheel/hiredis
running install_egg_info
running egg_info
writing dependency_links to hiredis.egg-info/dependency_links.txt
writing top-level names to hiredis.egg-info/top_level.txt
writing hiredis.egg-info/PKG-INFO
warning: manifest_maker: standard file '-c' not found
reading manifest file 'hiredis.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files found matching 'vendor/hiredis/example*'
warning: no previously-included files found matching 'vendor/hiredis/text*'
writing manifest file 'hiredis.egg-info/SOURCES.txt'
Copying hiredis.egg-info to build/bdist.macosx-10.10-x86_64/wheel/hiredis-0.2.0-py3.5.egg-info
running install_scripts
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/j2/gr3cj3jn63s5q8g3bjvw57hm0000gp/T/pip-build-1k21lkvn/hiredis/setup.py", line 81, in <module>
'Topic :: Software Development',
File "/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 213, in run
archive_basename = self.get_archive_basename()
File "/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 161, in get_archive_basename
impl_tag, abi_tag, plat_tag = self.get_tag()
File "/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 155, in get_tag
assert tag == supported_tags[0]
AssertionError
----------------------------------------
Failed building wheel for hiredis
Failed to build msgpack-python hiredis
Installing collected packages: hiredis, aioredis, click, msgpack-python, arq
Running setup.py install for hiredis
Running setup.py install for msgpack-python
Running setup.py develop for arq
Successfully installed aioredis-0.2.8 arq click-6.6 hiredis-0.2.0 msgpack-python-0.4.8
You are using pip version 7.1.2, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting codecov (from -r tests/requirements.txt (line 1))
Downloading codecov-2.0.5-py2.py3-none-any.whl
Collecting coverage (from -r tests/requirements.txt (line 2))
Downloading coverage-4.2-cp35-cp35m-macosx_10_10_x86_64.whl (161kB)
100% |████████████████████████████████| 163kB 2.1MB/s
Collecting flake8 (from -r tests/requirements.txt (line 3))
Downloading flake8-3.0.3-py2.py3-none-any.whl (64kB)
100% |████████████████████████████████| 65kB 5.0MB/s
Collecting pep8 (from -r tests/requirements.txt (line 4))
Using cached pep8-1.7.0-py2.py3-none-any.whl
Collecting pytest (from -r tests/requirements.txt (line 5))
Using cached pytest-2.9.2-py2.py3-none-any.whl
Collecting pytest-cov (from -r tests/requirements.txt (line 6))
Downloading pytest_cov-2.3.0-py2.py3-none-any.whl
Collecting pytest-sugar (from -r tests/requirements.txt (line 7))
Using cached pytest-sugar-0.7.1.tar.gz
Collecting requests>=2.0.0 (from codecov->-r tests/requirements.txt (line 1))
Using cached requests-2.10.0-py2.py3-none-any.whl
Collecting argparse (from codecov->-r tests/requirements.txt (line 1))
Downloading argparse-1.4.0-py2.py3-none-any.whl
Collecting mccabe<0.6.0,>=0.5.0 (from flake8->-r tests/requirements.txt (line 3))
Downloading mccabe-0.5.2-py2.py3-none-any.whl
Collecting pycodestyle<2.1.0,>=2.0.0 (from flake8->-r tests/requirements.txt (line 3))
Using cached pycodestyle-2.0.0-py2.py3-none-any.whl
Collecting pyflakes!=1.2.0,!=1.2.1,!=1.2.2,<1.3.0,>=0.8.1 (from flake8->-r tests/requirements.txt (line 3))
Using cached pyflakes-1.2.3-py2.py3-none-any.whl
Collecting py>=1.4.29 (from pytest->-r tests/requirements.txt (line 5))
Using cached py-1.4.31-py2.py3-none-any.whl
Collecting termcolor>=1.1.0 (from pytest-sugar->-r tests/requirements.txt (line 7))
Using cached termcolor-1.1.0.tar.gz
Building wheels for collected packages: pytest-sugar, termcolor
Running setup.py bdist_wheel for pytest-sugar
Stored in directory: /Users/ned/Library/Caches/pip/wheels/03/fc/01/71793edbdea99e93c5c0d209707953aef1cc84a5bb7849826e
Running setup.py bdist_wheel for termcolor
Stored in directory: /Users/ned/Library/Caches/pip/wheels/de/f7/bf/1bcac7bf30549e6a4957382e2ecab04c88e513117207067b03
Successfully built pytest-sugar termcolor
Installing collected packages: requests, argparse, coverage, codecov, mccabe, pycodestyle, pyflakes, flake8, pep8, py, pytest, pytest-cov, termcolor, pytest-sugar
Successfully installed argparse-1.4.0 codecov-2.0.5 coverage-4.2 flake8-3.0.3 mccabe-0.5.2 pep8-1.7.0 py-1.4.31 pycodestyle-2.0.0 pyflakes-1.2.3 pytest-2.9.2 pytest-cov-2.3.0 pytest-sugar-0.7.1 requests-2.10.0 termcolor-1.1.0
You are using pip version 7.1.2, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[:~/foo/arq] [bug512] master 17s ±
[:~/foo/arq] [bug512] master ± py.test --cov=arq
Test session starts (platform: darwin, Python 3.5.2, pytest 2.9.2, pytest-sugar 0.7.1)
rootdir: /Users/ned/foo/arq, inifile: setup.cfg
plugins: cov-2.3.0, sugar-0.7.1
tests/test_cli.py ✓✓✓✓✓ 12% █▍
tests/test_main.py ✓ 15% █▌
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR at setup of test_enqueue_redis_job ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
@pytest.yield_fixture
def redis_conn(loop):
async def _get_conn():
conn = await create_redis(('localhost', 6379), loop=loop)
await conn.flushall()
return conn
> conn = loop.run_until_complete(_get_conn())
arq/testing.py:165:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:387: in run_until_complete
return future.result()
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/futures.py:274: in result
raise self._exception
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/tasks.py:241: in _step
result = coro.throw(exc)
arq/testing.py:162: in _get_conn
conn = await create_redis(('localhost', 6379), loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/commands/__init__.py:140: in create_redis
loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/connection.py:69: in create_connection
host, port, ssl=ssl, loop=loop)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/streams.py:75: in open_connection
lambda: protocol, host, port, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_UnixSelectorEventLoop running=False closed=False debug=False>, protocol_factory = <function open_connection.<locals>.<lambda> at 0x10f806620>
host = 'localhost', port = 6379
@coroutine
def create_connection(self, protocol_factory, host=None, port=None, *,
ssl=None, family=0, proto=0, flags=0, sock=None,
local_addr=None, server_hostname=None):
"""Connect to a TCP server.
Create a streaming transport connection to a given Internet host and
port: socket family AF_INET or socket.AF_INET6 depending on host (or
family if specified), socket type SOCK_STREAM. protocol_factory must be
a callable returning a protocol instance.
This method is a coroutine which will try to establish the connection
in the background. When successful, the coroutine returns a
(transport, protocol) pair.
"""
if server_hostname is not None and not ssl:
raise ValueError('server_hostname is only meaningful with ssl')
if server_hostname is None and ssl:
# Use host as default for server_hostname. It is an error
# if host is empty or not set, e.g. when an
# already-connected socket was passed or when only a port
# is given. To avoid this error, you can pass
# server_hostname='' -- this will bypass the hostname
# check. (This also means that if host is a numeric
# IP/IPv6 address, we will attempt to verify that exact
# address; this will probably fail, but it is possible to
# create a certificate for a specific IP address, so we
# don't judge it here.)
if not host:
raise ValueError('You must set server_hostname '
'when using ssl without a host')
server_hostname = host
if host is not None or port is not None:
if sock is not None:
raise ValueError(
'host/port and sock can not be specified at the same time')
f1 = _ensure_resolved((host, port), family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs = [f1]
if local_addr is not None:
f2 = _ensure_resolved(local_addr, family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs.append(f2)
else:
f2 = None
yield from tasks.wait(fs, loop=self)
infos = f1.result()
if not infos:
raise OSError('getaddrinfo() returned empty list')
if f2 is not None:
laddr_infos = f2.result()
if not laddr_infos:
raise OSError('getaddrinfo() returned empty list')
exceptions = []
for family, type, proto, cname, address in infos:
try:
sock = socket.socket(family=family, type=type, proto=proto)
sock.setblocking(False)
if f2 is not None:
for _, _, _, _, laddr in laddr_infos:
try:
sock.bind(laddr)
break
except OSError as exc:
exc = OSError(
exc.errno, 'error while '
'attempting to bind on address '
'{!r}: {}'.format(
laddr, exc.strerror.lower()))
exceptions.append(exc)
else:
sock.close()
sock = None
continue
if self._debug:
logger.debug("connect %r to %r", sock, address)
yield from self.sock_connect(sock, address)
except OSError as exc:
if sock is not None:
sock.close()
exceptions.append(exc)
except:
if sock is not None:
sock.close()
raise
else:
break
else:
if len(exceptions) == 1:
raise exceptions[0]
else:
# If they all have the same str(), raise one.
model = str(exceptions[0])
if all(str(exc) == model for exc in exceptions):
raise exceptions[0]
# Raise a combined exception so the user can see all
# the various error messages.
raise OSError('Multiple exceptions: {}'.format(
> ', '.join(str(exc) for exc in exceptions)))
E OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError
tests/test_main.py ✓ 18% █▊
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR at setup of test_dispatch_work ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
@pytest.yield_fixture
def redis_conn(loop):
async def _get_conn():
conn = await create_redis(('localhost', 6379), loop=loop)
await conn.flushall()
return conn
> conn = loop.run_until_complete(_get_conn())
/Users/ned/foo/arq/arq/testing.py:165:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:387: in run_until_complete
return future.result()
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/futures.py:274: in result
raise self._exception
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/tasks.py:241: in _step
result = coro.throw(exc)
/Users/ned/foo/arq/arq/testing.py:162: in _get_conn
conn = await create_redis(('localhost', 6379), loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/commands/__init__.py:140: in create_redis
loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/connection.py:69: in create_connection
host, port, ssl=ssl, loop=loop)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/streams.py:75: in open_connection
lambda: protocol, host, port, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_UnixSelectorEventLoop running=False closed=False debug=False>, protocol_factory = <function open_connection.<locals>.<lambda> at 0x1114e4400>
host = 'localhost', port = 6379
@coroutine
def create_connection(self, protocol_factory, host=None, port=None, *,
ssl=None, family=0, proto=0, flags=0, sock=None,
local_addr=None, server_hostname=None):
"""Connect to a TCP server.
Create a streaming transport connection to a given Internet host and
port: socket family AF_INET or socket.AF_INET6 depending on host (or
family if specified), socket type SOCK_STREAM. protocol_factory must be
a callable returning a protocol instance.
This method is a coroutine which will try to establish the connection
in the background. When successful, the coroutine returns a
(transport, protocol) pair.
"""
if server_hostname is not None and not ssl:
raise ValueError('server_hostname is only meaningful with ssl')
if server_hostname is None and ssl:
# Use host as default for server_hostname. It is an error
# if host is empty or not set, e.g. when an
# already-connected socket was passed or when only a port
# is given. To avoid this error, you can pass
# server_hostname='' -- this will bypass the hostname
# check. (This also means that if host is a numeric
# IP/IPv6 address, we will attempt to verify that exact
# address; this will probably fail, but it is possible to
# create a certificate for a specific IP address, so we
# don't judge it here.)
if not host:
raise ValueError('You must set server_hostname '
'when using ssl without a host')
server_hostname = host
if host is not None or port is not None:
if sock is not None:
raise ValueError(
'host/port and sock can not be specified at the same time')
f1 = _ensure_resolved((host, port), family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs = [f1]
if local_addr is not None:
f2 = _ensure_resolved(local_addr, family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs.append(f2)
else:
f2 = None
yield from tasks.wait(fs, loop=self)
infos = f1.result()
if not infos:
raise OSError('getaddrinfo() returned empty list')
if f2 is not None:
laddr_infos = f2.result()
if not laddr_infos:
raise OSError('getaddrinfo() returned empty list')
exceptions = []
for family, type, proto, cname, address in infos:
try:
sock = socket.socket(family=family, type=type, proto=proto)
sock.setblocking(False)
if f2 is not None:
for _, _, _, _, laddr in laddr_infos:
try:
sock.bind(laddr)
break
except OSError as exc:
exc = OSError(
exc.errno, 'error while '
'attempting to bind on address '
'{!r}: {}'.format(
laddr, exc.strerror.lower()))
exceptions.append(exc)
else:
sock.close()
sock = None
continue
if self._debug:
logger.debug("connect %r to %r", sock, address)
yield from self.sock_connect(sock, address)
except OSError as exc:
if sock is not None:
sock.close()
exceptions.append(exc)
except:
if sock is not None:
sock.close()
raise
else:
break
else:
if len(exceptions) == 1:
raise exceptions[0]
else:
# If they all have the same str(), raise one.
model = str(exceptions[0])
if all(str(exc) == model for exc in exceptions):
raise exceptions[0]
# Raise a combined exception so the user can see all
# the various error messages.
raise OSError('Multiple exceptions: {}'.format(
> ', '.join(str(exc) for exc in exceptions)))
E OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError
tests/test_main.py ✓✓✓✓✓ 30% ███
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― test_custom_name ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
loop = <_UnixSelectorEventLoop running=False closed=False debug=False>, logcap = < logcap: ''>
async def test_custom_name(loop, logcap):
actor = FoobarActor(loop=loop)
> assert re.match('^<FoobarActor\(foobar\) at 0x[a-f0-9]{12}>$', str(actor))
E assert None
E + where None = <function match at 0x10f822ae8>('^<FoobarActor\\(foobar\\) at 0x[a-f0-9]{12}>$', '<FoobarActor(foobar) at 0x110687208>')
E + where <function match at 0x10f822ae8> = re.match
E + and '<FoobarActor(foobar) at 0x110687208>' = str(<FoobarActor(foobar) at 0x110687208>)
tests/test_main.py:137: AssertionError
tests/test_main.py ✓✓✓✓✓⨯✓✓ 38% ███▊
―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR at setup of test_dynamic_worker ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
@pytest.yield_fixture
def redis_conn(loop):
async def _get_conn():
conn = await create_redis(('localhost', 6379), loop=loop)
await conn.flushall()
return conn
> conn = loop.run_until_complete(_get_conn())
/Users/ned/foo/arq/arq/testing.py:165:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:387: in run_until_complete
return future.result()
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/futures.py:274: in result
raise self._exception
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/tasks.py:241: in _step
result = coro.throw(exc)
/Users/ned/foo/arq/arq/testing.py:162: in _get_conn
conn = await create_redis(('localhost', 6379), loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/commands/__init__.py:140: in create_redis
loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/connection.py:69: in create_connection
host, port, ssl=ssl, loop=loop)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/streams.py:75: in open_connection
lambda: protocol, host, port, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_UnixSelectorEventLoop running=False closed=False debug=False>, protocol_factory = <function open_connection.<locals>.<lambda> at 0x1114c8840>
host = 'localhost', port = 6379
@coroutine
def create_connection(self, protocol_factory, host=None, port=None, *,
ssl=None, family=0, proto=0, flags=0, sock=None,
local_addr=None, server_hostname=None):
"""Connect to a TCP server.
Create a streaming transport connection to a given Internet host and
port: socket family AF_INET or socket.AF_INET6 depending on host (or
family if specified), socket type SOCK_STREAM. protocol_factory must be
a callable returning a protocol instance.
This method is a coroutine which will try to establish the connection
in the background. When successful, the coroutine returns a
(transport, protocol) pair.
"""
if server_hostname is not None and not ssl:
raise ValueError('server_hostname is only meaningful with ssl')
if server_hostname is None and ssl:
# Use host as default for server_hostname. It is an error
# if host is empty or not set, e.g. when an
# already-connected socket was passed or when only a port
# is given. To avoid this error, you can pass
# server_hostname='' -- this will bypass the hostname
# check. (This also means that if host is a numeric
# IP/IPv6 address, we will attempt to verify that exact
# address; this will probably fail, but it is possible to
# create a certificate for a specific IP address, so we
# don't judge it here.)
if not host:
raise ValueError('You must set server_hostname '
'when using ssl without a host')
server_hostname = host
if host is not None or port is not None:
if sock is not None:
raise ValueError(
'host/port and sock can not be specified at the same time')
f1 = _ensure_resolved((host, port), family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs = [f1]
if local_addr is not None:
f2 = _ensure_resolved(local_addr, family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs.append(f2)
else:
f2 = None
yield from tasks.wait(fs, loop=self)
infos = f1.result()
if not infos:
raise OSError('getaddrinfo() returned empty list')
if f2 is not None:
laddr_infos = f2.result()
if not laddr_infos:
raise OSError('getaddrinfo() returned empty list')
exceptions = []
for family, type, proto, cname, address in infos:
try:
sock = socket.socket(family=family, type=type, proto=proto)
sock.setblocking(False)
if f2 is not None:
for _, _, _, _, laddr in laddr_infos:
try:
sock.bind(laddr)
break
except OSError as exc:
exc = OSError(
exc.errno, 'error while '
'attempting to bind on address '
'{!r}: {}'.format(
laddr, exc.strerror.lower()))
exceptions.append(exc)
else:
sock.close()
sock = None
continue
if self._debug:
logger.debug("connect %r to %r", sock, address)
yield from self.sock_connect(sock, address)
except OSError as exc:
if sock is not None:
sock.close()
exceptions.append(exc)
except:
if sock is not None:
sock.close()
raise
else:
break
else:
if len(exceptions) == 1:
raise exceptions[0]
else:
# If they all have the same str(), raise one.
model = str(exceptions[0])
if all(str(exc) == model for exc in exceptions):
raise exceptions[0]
# Raise a combined exception so the user can see all
# the various error messages.
raise OSError('Multiple exceptions: {}'.format(
> ', '.join(str(exc) for exc in exceptions)))
E OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError
tests/test_main.py ✓✓✓✓✓⨯✓✓✓✓✓ 48% ████▊
tests/test_utils.py ✓✓✓ 55% █████▌
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR at setup of test_run_job_batch ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
@pytest.yield_fixture
def redis_conn(loop):
async def _get_conn():
conn = await create_redis(('localhost', 6379), loop=loop)
await conn.flushall()
return conn
> conn = loop.run_until_complete(_get_conn())
/Users/ned/foo/arq/arq/testing.py:165:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:387: in run_until_complete
return future.result()
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/futures.py:274: in result
raise self._exception
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/tasks.py:241: in _step
result = coro.throw(exc)
/Users/ned/foo/arq/arq/testing.py:162: in _get_conn
conn = await create_redis(('localhost', 6379), loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/commands/__init__.py:140: in create_redis
loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/connection.py:69: in create_connection
host, port, ssl=ssl, loop=loop)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/streams.py:75: in open_connection
lambda: protocol, host, port, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_UnixSelectorEventLoop running=False closed=False debug=False>, protocol_factory = <function open_connection.<locals>.<lambda> at 0x1114c88c8>
host = 'localhost', port = 6379
@coroutine
def create_connection(self, protocol_factory, host=None, port=None, *,
ssl=None, family=0, proto=0, flags=0, sock=None,
local_addr=None, server_hostname=None):
"""Connect to a TCP server.
Create a streaming transport connection to a given Internet host and
port: socket family AF_INET or socket.AF_INET6 depending on host (or
family if specified), socket type SOCK_STREAM. protocol_factory must be
a callable returning a protocol instance.
This method is a coroutine which will try to establish the connection
in the background. When successful, the coroutine returns a
(transport, protocol) pair.
"""
if server_hostname is not None and not ssl:
raise ValueError('server_hostname is only meaningful with ssl')
if server_hostname is None and ssl:
# Use host as default for server_hostname. It is an error
# if host is empty or not set, e.g. when an
# already-connected socket was passed or when only a port
# is given. To avoid this error, you can pass
# server_hostname='' -- this will bypass the hostname
# check. (This also means that if host is a numeric
# IP/IPv6 address, we will attempt to verify that exact
# address; this will probably fail, but it is possible to
# create a certificate for a specific IP address, so we
# don't judge it here.)
if not host:
raise ValueError('You must set server_hostname '
'when using ssl without a host')
server_hostname = host
if host is not None or port is not None:
if sock is not None:
raise ValueError(
'host/port and sock can not be specified at the same time')
f1 = _ensure_resolved((host, port), family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs = [f1]
if local_addr is not None:
f2 = _ensure_resolved(local_addr, family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs.append(f2)
else:
f2 = None
yield from tasks.wait(fs, loop=self)
infos = f1.result()
if not infos:
raise OSError('getaddrinfo() returned empty list')
if f2 is not None:
laddr_infos = f2.result()
if not laddr_infos:
raise OSError('getaddrinfo() returned empty list')
exceptions = []
for family, type, proto, cname, address in infos:
try:
sock = socket.socket(family=family, type=type, proto=proto)
sock.setblocking(False)
if f2 is not None:
for _, _, _, _, laddr in laddr_infos:
try:
sock.bind(laddr)
break
except OSError as exc:
exc = OSError(
exc.errno, 'error while '
'attempting to bind on address '
'{!r}: {}'.format(
laddr, exc.strerror.lower()))
exceptions.append(exc)
else:
sock.close()
sock = None
continue
if self._debug:
logger.debug("connect %r to %r", sock, address)
yield from self.sock_connect(sock, address)
except OSError as exc:
if sock is not None:
sock.close()
exceptions.append(exc)
except:
if sock is not None:
sock.close()
raise
else:
break
else:
if len(exceptions) == 1:
raise exceptions[0]
else:
# If they all have the same str(), raise one.
model = str(exceptions[0])
if all(str(exc) == model for exc in exceptions):
raise exceptions[0]
# Raise a combined exception so the user can see all
# the various error messages.
raise OSError('Multiple exceptions: {}'.format(
> ', '.join(str(exc) for exc in exceptions)))
E OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError
tests/test_utils.py ✓✓✓ 57% █████▊
tests/test_worker.py ✓✓✓✓✓✓✓✓ 78% ███████▊
―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR at setup of test_import_start_worker ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
@pytest.yield_fixture
def redis_conn(loop):
async def _get_conn():
conn = await create_redis(('localhost', 6379), loop=loop)
await conn.flushall()
return conn
> conn = loop.run_until_complete(_get_conn())
/Users/ned/foo/arq/arq/testing.py:165:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:387: in run_until_complete
return future.result()
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/futures.py:274: in result
raise self._exception
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/tasks.py:241: in _step
result = coro.throw(exc)
/Users/ned/foo/arq/arq/testing.py:162: in _get_conn
conn = await create_redis(('localhost', 6379), loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/commands/__init__.py:140: in create_redis
loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/connection.py:69: in create_connection
host, port, ssl=ssl, loop=loop)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/streams.py:75: in open_connection
lambda: protocol, host, port, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_UnixSelectorEventLoop running=False closed=False debug=False>, protocol_factory = <function open_connection.<locals>.<lambda> at 0x1114c8f28>
host = 'localhost', port = 6379
@coroutine
def create_connection(self, protocol_factory, host=None, port=None, *,
ssl=None, family=0, proto=0, flags=0, sock=None,
local_addr=None, server_hostname=None):
"""Connect to a TCP server.
Create a streaming transport connection to a given Internet host and
port: socket family AF_INET or socket.AF_INET6 depending on host (or
family if specified), socket type SOCK_STREAM. protocol_factory must be
a callable returning a protocol instance.
This method is a coroutine which will try to establish the connection
in the background. When successful, the coroutine returns a
(transport, protocol) pair.
"""
if server_hostname is not None and not ssl:
raise ValueError('server_hostname is only meaningful with ssl')
if server_hostname is None and ssl:
# Use host as default for server_hostname. It is an error
# if host is empty or not set, e.g. when an
# already-connected socket was passed or when only a port
# is given. To avoid this error, you can pass
# server_hostname='' -- this will bypass the hostname
# check. (This also means that if host is a numeric
# IP/IPv6 address, we will attempt to verify that exact
# address; this will probably fail, but it is possible to
# create a certificate for a specific IP address, so we
# don't judge it here.)
if not host:
raise ValueError('You must set server_hostname '
'when using ssl without a host')
server_hostname = host
if host is not None or port is not None:
if sock is not None:
raise ValueError(
'host/port and sock can not be specified at the same time')
f1 = _ensure_resolved((host, port), family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs = [f1]
if local_addr is not None:
f2 = _ensure_resolved(local_addr, family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs.append(f2)
else:
f2 = None
yield from tasks.wait(fs, loop=self)
infos = f1.result()
if not infos:
raise OSError('getaddrinfo() returned empty list')
if f2 is not None:
laddr_infos = f2.result()
if not laddr_infos:
raise OSError('getaddrinfo() returned empty list')
exceptions = []
for family, type, proto, cname, address in infos:
try:
sock = socket.socket(family=family, type=type, proto=proto)
sock.setblocking(False)
if f2 is not None:
for _, _, _, _, laddr in laddr_infos:
try:
sock.bind(laddr)
break
except OSError as exc:
exc = OSError(
exc.errno, 'error while '
'attempting to bind on address '
'{!r}: {}'.format(
laddr, exc.strerror.lower()))
exceptions.append(exc)
else:
sock.close()
sock = None
continue
if self._debug:
logger.debug("connect %r to %r", sock, address)
yield from self.sock_connect(sock, address)
except OSError as exc:
if sock is not None:
sock.close()
exceptions.append(exc)
except:
if sock is not None:
sock.close()
raise
else:
break
else:
if len(exceptions) == 1:
raise exceptions[0]
else:
# If they all have the same str(), raise one.
model = str(exceptions[0])
if all(str(exc) == model for exc in exceptions):
raise exceptions[0]
# Raise a combined exception so the user can see all
# the various error messages.
raise OSError('Multiple exceptions: {}'.format(
> ', '.join(str(exc) for exc in exceptions)))
E OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError
tests/test_worker.py ✓✓✓✓✓✓✓✓ 80% ████████
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR at setup of test_run_quit ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
@pytest.yield_fixture
def redis_conn(loop):
async def _get_conn():
conn = await create_redis(('localhost', 6379), loop=loop)
await conn.flushall()
return conn
> conn = loop.run_until_complete(_get_conn())
/Users/ned/foo/arq/arq/testing.py:165:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:387: in run_until_complete
return future.result()
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/futures.py:274: in result
raise self._exception
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/tasks.py:241: in _step
result = coro.throw(exc)
/Users/ned/foo/arq/arq/testing.py:162: in _get_conn
conn = await create_redis(('localhost', 6379), loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/commands/__init__.py:140: in create_redis
loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/connection.py:69: in create_connection
host, port, ssl=ssl, loop=loop)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/streams.py:75: in open_connection
lambda: protocol, host, port, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_UnixSelectorEventLoop running=False closed=False debug=False>, protocol_factory = <function open_connection.<locals>.<lambda> at 0x11158d950>
host = 'localhost', port = 6379
@coroutine
def create_connection(self, protocol_factory, host=None, port=None, *,
ssl=None, family=0, proto=0, flags=0, sock=None,
local_addr=None, server_hostname=None):
"""Connect to a TCP server.
Create a streaming transport connection to a given Internet host and
port: socket family AF_INET or socket.AF_INET6 depending on host (or
family if specified), socket type SOCK_STREAM. protocol_factory must be
a callable returning a protocol instance.
This method is a coroutine which will try to establish the connection
in the background. When successful, the coroutine returns a
(transport, protocol) pair.
"""
if server_hostname is not None and not ssl:
raise ValueError('server_hostname is only meaningful with ssl')
if server_hostname is None and ssl:
# Use host as default for server_hostname. It is an error
# if host is empty or not set, e.g. when an
# already-connected socket was passed or when only a port
# is given. To avoid this error, you can pass
# server_hostname='' -- this will bypass the hostname
# check. (This also means that if host is a numeric
# IP/IPv6 address, we will attempt to verify that exact
# address; this will probably fail, but it is possible to
# create a certificate for a specific IP address, so we
# don't judge it here.)
if not host:
raise ValueError('You must set server_hostname '
'when using ssl without a host')
server_hostname = host
if host is not None or port is not None:
if sock is not None:
raise ValueError(
'host/port and sock can not be specified at the same time')
f1 = _ensure_resolved((host, port), family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs = [f1]
if local_addr is not None:
f2 = _ensure_resolved(local_addr, family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs.append(f2)
else:
f2 = None
yield from tasks.wait(fs, loop=self)
infos = f1.result()
if not infos:
raise OSError('getaddrinfo() returned empty list')
if f2 is not None:
laddr_infos = f2.result()
if not laddr_infos:
raise OSError('getaddrinfo() returned empty list')
exceptions = []
for family, type, proto, cname, address in infos:
try:
sock = socket.socket(family=family, type=type, proto=proto)
sock.setblocking(False)
if f2 is not None:
for _, _, _, _, laddr in laddr_infos:
try:
sock.bind(laddr)
break
except OSError as exc:
exc = OSError(
exc.errno, 'error while '
'attempting to bind on address '
'{!r}: {}'.format(
laddr, exc.strerror.lower()))
exceptions.append(exc)
else:
sock.close()
sock = None
continue
if self._debug:
logger.debug("connect %r to %r", sock, address)
yield from self.sock_connect(sock, address)
except OSError as exc:
if sock is not None:
sock.close()
exceptions.append(exc)
except:
if sock is not None:
sock.close()
raise
else:
break
else:
if len(exceptions) == 1:
raise exceptions[0]
else:
# If they all have the same str(), raise one.
model = str(exceptions[0])
if all(str(exc) == model for exc in exceptions):
raise exceptions[0]
# Raise a combined exception so the user can see all
# the various error messages.
raise OSError('Multiple exceptions: {}'.format(
> ', '.join(str(exc) for exc in exceptions)))
E OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError
tests/test_worker.py ✓✓✓✓✓✓✓✓ 82% ████████▍
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR at setup of test_task_exc ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
@pytest.yield_fixture
def redis_conn(loop):
async def _get_conn():
conn = await create_redis(('localhost', 6379), loop=loop)
await conn.flushall()
return conn
> conn = loop.run_until_complete(_get_conn())
arq/testing.py:165:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:387: in run_until_complete
return future.result()
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/futures.py:274: in result
raise self._exception
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/tasks.py:241: in _step
result = coro.throw(exc)
arq/testing.py:162: in _get_conn
conn = await create_redis(('localhost', 6379), loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/commands/__init__.py:140: in create_redis
loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/connection.py:69: in create_connection
host, port, ssl=ssl, loop=loop)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/streams.py:75: in open_connection
lambda: protocol, host, port, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_UnixSelectorEventLoop running=False closed=False debug=False>, protocol_factory = <function open_connection.<locals>.<lambda> at 0x11158dbf8>
host = 'localhost', port = 6379
@coroutine
def create_connection(self, protocol_factory, host=None, port=None, *,
ssl=None, family=0, proto=0, flags=0, sock=None,
local_addr=None, server_hostname=None):
"""Connect to a TCP server.
Create a streaming transport connection to a given Internet host and
port: socket family AF_INET or socket.AF_INET6 depending on host (or
family if specified), socket type SOCK_STREAM. protocol_factory must be
a callable returning a protocol instance.
This method is a coroutine which will try to establish the connection
in the background. When successful, the coroutine returns a
(transport, protocol) pair.
"""
if server_hostname is not None and not ssl:
raise ValueError('server_hostname is only meaningful with ssl')
if server_hostname is None and ssl:
# Use host as default for server_hostname. It is an error
# if host is empty or not set, e.g. when an
# already-connected socket was passed or when only a port
# is given. To avoid this error, you can pass
# server_hostname='' -- this will bypass the hostname
# check. (This also means that if host is a numeric
# IP/IPv6 address, we will attempt to verify that exact
# address; this will probably fail, but it is possible to
# create a certificate for a specific IP address, so we
# don't judge it here.)
if not host:
raise ValueError('You must set server_hostname '
'when using ssl without a host')
server_hostname = host
if host is not None or port is not None:
if sock is not None:
raise ValueError(
'host/port and sock can not be specified at the same time')
f1 = _ensure_resolved((host, port), family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs = [f1]
if local_addr is not None:
f2 = _ensure_resolved(local_addr, family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs.append(f2)
else:
f2 = None
yield from tasks.wait(fs, loop=self)
infos = f1.result()
if not infos:
raise OSError('getaddrinfo() returned empty list')
if f2 is not None:
laddr_infos = f2.result()
if not laddr_infos:
raise OSError('getaddrinfo() returned empty list')
exceptions = []
for family, type, proto, cname, address in infos:
try:
sock = socket.socket(family=family, type=type, proto=proto)
sock.setblocking(False)
if f2 is not None:
for _, _, _, _, laddr in laddr_infos:
try:
sock.bind(laddr)
break
except OSError as exc:
exc = OSError(
exc.errno, 'error while '
'attempting to bind on address '
'{!r}: {}'.format(
laddr, exc.strerror.lower()))
exceptions.append(exc)
else:
sock.close()
sock = None
continue
if self._debug:
logger.debug("connect %r to %r", sock, address)
yield from self.sock_connect(sock, address)
except OSError as exc:
if sock is not None:
sock.close()
exceptions.append(exc)
except:
if sock is not None:
sock.close()
raise
else:
break
else:
if len(exceptions) == 1:
raise exceptions[0]
else:
# If they all have the same str(), raise one.
model = str(exceptions[0])
if all(str(exc) == model for exc in exceptions):
raise exceptions[0]
# Raise a combined exception so the user can see all
# the various error messages.
raise OSError('Multiple exceptions: {}'.format(
> ', '.join(str(exc) for exc in exceptions)))
E OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError
tests/test_worker.py ✓✓✓✓✓✓✓✓ 85% ████████▌
―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR at setup of test_run_sigint ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
@pytest.yield_fixture
def redis_conn(loop):
async def _get_conn():
conn = await create_redis(('localhost', 6379), loop=loop)
await conn.flushall()
return conn
> conn = loop.run_until_complete(_get_conn())
/Users/ned/foo/arq/arq/testing.py:165:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:387: in run_until_complete
return future.result()
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/futures.py:274: in result
raise self._exception
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/tasks.py:241: in _step
result = coro.throw(exc)
/Users/ned/foo/arq/arq/testing.py:162: in _get_conn
conn = await create_redis(('localhost', 6379), loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/commands/__init__.py:140: in create_redis
loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/connection.py:69: in create_connection
host, port, ssl=ssl, loop=loop)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/streams.py:75: in open_connection
lambda: protocol, host, port, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_UnixSelectorEventLoop running=False closed=False debug=False>, protocol_factory = <function open_connection.<locals>.<lambda> at 0x11158de18>
host = 'localhost', port = 6379
@coroutine
def create_connection(self, protocol_factory, host=None, port=None, *,
ssl=None, family=0, proto=0, flags=0, sock=None,
local_addr=None, server_hostname=None):
"""Connect to a TCP server.
Create a streaming transport connection to a given Internet host and
port: socket family AF_INET or socket.AF_INET6 depending on host (or
family if specified), socket type SOCK_STREAM. protocol_factory must be
a callable returning a protocol instance.
This method is a coroutine which will try to establish the connection
in the background. When successful, the coroutine returns a
(transport, protocol) pair.
"""
if server_hostname is not None and not ssl:
raise ValueError('server_hostname is only meaningful with ssl')
if server_hostname is None and ssl:
# Use host as default for server_hostname. It is an error
# if host is empty or not set, e.g. when an
# already-connected socket was passed or when only a port
# is given. To avoid this error, you can pass
# server_hostname='' -- this will bypass the hostname
# check. (This also means that if host is a numeric
# IP/IPv6 address, we will attempt to verify that exact
# address; this will probably fail, but it is possible to
# create a certificate for a specific IP address, so we
# don't judge it here.)
if not host:
raise ValueError('You must set server_hostname '
'when using ssl without a host')
server_hostname = host
if host is not None or port is not None:
if sock is not None:
raise ValueError(
'host/port and sock can not be specified at the same time')
f1 = _ensure_resolved((host, port), family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs = [f1]
if local_addr is not None:
f2 = _ensure_resolved(local_addr, family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs.append(f2)
else:
f2 = None
yield from tasks.wait(fs, loop=self)
infos = f1.result()
if not infos:
raise OSError('getaddrinfo() returned empty list')
if f2 is not None:
laddr_infos = f2.result()
if not laddr_infos:
raise OSError('getaddrinfo() returned empty list')
exceptions = []
for family, type, proto, cname, address in infos:
try:
sock = socket.socket(family=family, type=type, proto=proto)
sock.setblocking(False)
if f2 is not None:
for _, _, _, _, laddr in laddr_infos:
try:
sock.bind(laddr)
break
except OSError as exc:
exc = OSError(
exc.errno, 'error while '
'attempting to bind on address '
'{!r}: {}'.format(
laddr, exc.strerror.lower()))
exceptions.append(exc)
else:
sock.close()
sock = None
continue
if self._debug:
logger.debug("connect %r to %r", sock, address)
yield from self.sock_connect(sock, address)
except OSError as exc:
if sock is not None:
sock.close()
exceptions.append(exc)
except:
if sock is not None:
sock.close()
raise
else:
break
else:
if len(exceptions) == 1:
raise exceptions[0]
else:
# If they all have the same str(), raise one.
model = str(exceptions[0])
if all(str(exc) == model for exc in exceptions):
raise exceptions[0]
# Raise a combined exception so the user can see all
# the various error messages.
raise OSError('Multiple exceptions: {}'.format(
> ', '.join(str(exc) for exc in exceptions)))
E OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError
tests/test_worker.py ✓✓✓✓✓✓✓✓ 88% ████████▊
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR at setup of test_run_sigint_twice ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
@pytest.yield_fixture
def redis_conn(loop):
async def _get_conn():
conn = await create_redis(('localhost', 6379), loop=loop)
await conn.flushall()
return conn
> conn = loop.run_until_complete(_get_conn())
/Users/ned/foo/arq/arq/testing.py:165:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:387: in run_until_complete
return future.result()
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/futures.py:274: in result
raise self._exception
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/tasks.py:241: in _step
result = coro.throw(exc)
/Users/ned/foo/arq/arq/testing.py:162: in _get_conn
conn = await create_redis(('localhost', 6379), loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/commands/__init__.py:140: in create_redis
loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/connection.py:69: in create_connection
host, port, ssl=ssl, loop=loop)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/streams.py:75: in open_connection
lambda: protocol, host, port, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_UnixSelectorEventLoop running=False closed=False debug=False>, protocol_factory = <function open_connection.<locals>.<lambda> at 0x1114df268>
host = 'localhost', port = 6379
@coroutine
def create_connection(self, protocol_factory, host=None, port=None, *,
ssl=None, family=0, proto=0, flags=0, sock=None,
local_addr=None, server_hostname=None):
"""Connect to a TCP server.
Create a streaming transport connection to a given Internet host and
port: socket family AF_INET or socket.AF_INET6 depending on host (or
family if specified), socket type SOCK_STREAM. protocol_factory must be
a callable returning a protocol instance.
This method is a coroutine which will try to establish the connection
in the background. When successful, the coroutine returns a
(transport, protocol) pair.
"""
if server_hostname is not None and not ssl:
raise ValueError('server_hostname is only meaningful with ssl')
if server_hostname is None and ssl:
# Use host as default for server_hostname. It is an error
# if host is empty or not set, e.g. when an
# already-connected socket was passed or when only a port
# is given. To avoid this error, you can pass
# server_hostname='' -- this will bypass the hostname
# check. (This also means that if host is a numeric
# IP/IPv6 address, we will attempt to verify that exact
# address; this will probably fail, but it is possible to
# create a certificate for a specific IP address, so we
# don't judge it here.)
if not host:
raise ValueError('You must set server_hostname '
'when using ssl without a host')
server_hostname = host
if host is not None or port is not None:
if sock is not None:
raise ValueError(
'host/port and sock can not be specified at the same time')
f1 = _ensure_resolved((host, port), family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs = [f1]
if local_addr is not None:
f2 = _ensure_resolved(local_addr, family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs.append(f2)
else:
f2 = None
yield from tasks.wait(fs, loop=self)
infos = f1.result()
if not infos:
raise OSError('getaddrinfo() returned empty list')
if f2 is not None:
laddr_infos = f2.result()
if not laddr_infos:
raise OSError('getaddrinfo() returned empty list')
exceptions = []
for family, type, proto, cname, address in infos:
try:
sock = socket.socket(family=family, type=type, proto=proto)
sock.setblocking(False)
if f2 is not None:
for _, _, _, _, laddr in laddr_infos:
try:
sock.bind(laddr)
break
except OSError as exc:
exc = OSError(
exc.errno, 'error while '
'attempting to bind on address '
'{!r}: {}'.format(
laddr, exc.strerror.lower()))
exceptions.append(exc)
else:
sock.close()
sock = None
continue
if self._debug:
logger.debug("connect %r to %r", sock, address)
yield from self.sock_connect(sock, address)
except OSError as exc:
if sock is not None:
sock.close()
exceptions.append(exc)
except:
if sock is not None:
sock.close()
raise
else:
break
else:
if len(exceptions) == 1:
raise exceptions[0]
else:
# If they all have the same str(), raise one.
model = str(exceptions[0])
if all(str(exc) == model for exc in exceptions):
raise exceptions[0]
# Raise a combined exception so the user can see all
# the various error messages.
raise OSError('Multiple exceptions: {}'.format(
> ', '.join(str(exc) for exc in exceptions)))
E OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError
tests/test_worker.py ✓✓✓✓✓✓✓✓ 90% █████████
――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ERROR at setup of test_non_existent_function ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――
loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
@pytest.yield_fixture
def redis_conn(loop):
async def _get_conn():
conn = await create_redis(('localhost', 6379), loop=loop)
await conn.flushall()
return conn
> conn = loop.run_until_complete(_get_conn())
arq/testing.py:165:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:387: in run_until_complete
return future.result()
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/futures.py:274: in result
raise self._exception
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/tasks.py:241: in _step
result = coro.throw(exc)
arq/testing.py:162: in _get_conn
conn = await create_redis(('localhost', 6379), loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/commands/__init__.py:140: in create_redis
loop=loop)
/usr/local/virtualenvs/bug512/lib/python3.5/site-packages/aioredis/connection.py:69: in create_connection
host, port, ssl=ssl, loop=loop)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/streams.py:75: in open_connection
lambda: protocol, host, port, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_UnixSelectorEventLoop running=False closed=False debug=False>, protocol_factory = <function open_connection.<locals>.<lambda> at 0x1114df840>
host = 'localhost', port = 6379
@coroutine
def create_connection(self, protocol_factory, host=None, port=None, *,
ssl=None, family=0, proto=0, flags=0, sock=None,
local_addr=None, server_hostname=None):
"""Connect to a TCP server.
Create a streaming transport connection to a given Internet host and
port: socket family AF_INET or socket.AF_INET6 depending on host (or
family if specified), socket type SOCK_STREAM. protocol_factory must be
a callable returning a protocol instance.
This method is a coroutine which will try to establish the connection
in the background. When successful, the coroutine returns a
(transport, protocol) pair.
"""
if server_hostname is not None and not ssl:
raise ValueError('server_hostname is only meaningful with ssl')
if server_hostname is None and ssl:
# Use host as default for server_hostname. It is an error
# if host is empty or not set, e.g. when an
# already-connected socket was passed or when only a port
# is given. To avoid this error, you can pass
# server_hostname='' -- this will bypass the hostname
# check. (This also means that if host is a numeric
# IP/IPv6 address, we will attempt to verify that exact
# address; this will probably fail, but it is possible to
# create a certificate for a specific IP address, so we
# don't judge it here.)
if not host:
raise ValueError('You must set server_hostname '
'when using ssl without a host')
server_hostname = host
if host is not None or port is not None:
if sock is not None:
raise ValueError(
'host/port and sock can not be specified at the same time')
f1 = _ensure_resolved((host, port), family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs = [f1]
if local_addr is not None:
f2 = _ensure_resolved(local_addr, family=family,
type=socket.SOCK_STREAM, proto=proto,
flags=flags, loop=self)
fs.append(f2)
else:
f2 = None
yield from tasks.wait(fs, loop=self)
infos = f1.result()
if not infos:
raise OSError('getaddrinfo() returned empty list')
if f2 is not None:
laddr_infos = f2.result()
if not laddr_infos:
raise OSError('getaddrinfo() returned empty list')
exceptions = []
for family, type, proto, cname, address in infos:
try:
sock = socket.socket(family=family, type=type, proto=proto)
sock.setblocking(False)
if f2 is not None:
for _, _, _, _, laddr in laddr_infos:
try:
sock.bind(laddr)
break
except OSError as exc:
exc = OSError(
exc.errno, 'error while '
'attempting to bind on address '
'{!r}: {}'.format(
laddr, exc.strerror.lower()))
exceptions.append(exc)
else:
sock.close()
sock = None
continue
if self._debug:
logger.debug("connect %r to %r", sock, address)
yield from self.sock_connect(sock, address)
except OSError as exc:
if sock is not None:
sock.close()
exceptions.append(exc)
except:
if sock is not None:
sock.close()
raise
else:
break
else:
if len(exceptions) == 1:
raise exceptions[0]
else:
# If they all have the same str(), raise one.
model = str(exceptions[0])
if all(str(exc) == model for exc in exceptions):
raise exceptions[0]
# Raise a combined exception so the user can see all
# the various error messages.
raise OSError('Multiple exceptions: {}'.format(
> ', '.join(str(exc) for exc in exceptions)))
E OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
/usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError
tests/test_worker.py ✓✓✓✓✓✓✓✓✓✓✓ 100% ██████████
---------- coverage: platform darwin, python 3.5.2-final-0 -----------
Name Stmts Miss Branch BrPart Cover
---------------------------------------------------
arq/__init__.py 4 0 0 0 100%
arq/cli.py 15 0 0 0 100%
arq/logs.py 18 1 2 1 90%
arq/main.py 85 1 22 1 98%
arq/testing.py 164 6 34 0 97%
arq/utils.py 53 2 12 1 95%
arq/version.py 2 0 0 0 100%
arq/worker.py 245 31 54 4 88%
---------------------------------------------------
TOTAL 586 41 124 7 93%
Results (4.23s):
29 passed
11 failed
- /usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
- /usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
- /Users/ned/foo/arq/tests/test_main.py:137: assert None
- /usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
- /usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
- /usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
- /usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
- /usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
- /usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
- /usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
- /usr/local/pythonz/pythons/CPython-3.5.2/lib/python3.5/asyncio/base_events.py:704: OSError: Multiple exceptions: [Errno 61] Connect call failed ('127.0.0.1', 6379), [Errno 61] Connect call failed ('::1', 6379), [Errno 61] Connect call failed ('fe80::1%lo0', 6379, 0, 1)
[:~/foo/arq] [bug512] master 1 ± pip freeze
aioredis==0.2.8
-e git+https://github.com/samuelcolvin/arq.git@1a1fa49796ef772aff2c56730ed721c55d817493#egg=arq-master
click==6.6
codecov==2.0.5
coverage==4.2
flake8==3.0.3
hiredis==0.2.0
mccabe==0.5.2
msgpack-python==0.4.8
pep8==1.7.0
py==1.4.31
pycodestyle==2.0.0
pyflakes==1.2.3
pytest==2.9.2
pytest-cov==2.3.0
pytest-sugar==0.7.1
requests==2.10.0
termcolor==1.1.0
wheel==0.24.0
You are using pip version 7.1.2, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[:~/foo/arq] [bug512] master ±
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment