From 1375114955e78cb6463a133e883d3f390bfbea75 Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 7 Jan 2019 13:41:47 -0800 Subject: [PATCH] Scheduled monthly dependency update for January (#220) * Update aiohttp from 3.4.4 to 3.5.1 * Update pytest from 4.0.1 to 4.0.2 * Update pytest from 4.0.1 to 4.0.2 * Update sqlalchemy from 1.2.14 to 1.2.15 * Update sqlalchemy from 1.2.14 to 1.2.15 * Update pytest-xdist from 1.24.1 to 1.25.0 * Update sphinx from 1.8.2 to 1.8.3 * fix with latest aiohttp --- aiohttp_devtools/runserver/serve.py | 2 +- aiohttp_devtools/runserver/watch.py | 2 +- aiohttp_devtools/start/template/app/main.py | 2 +- aiohttp_devtools/start/template/requirements.txt | 6 +++--- setup.cfg | 2 +- tests/requirements.txt | 8 ++++---- tests/test_runserver_watch.py | 7 ++++++- 7 files changed, 17 insertions(+), 12 deletions(-) diff --git a/aiohttp_devtools/runserver/serve.py b/aiohttp_devtools/runserver/serve.py index bb7317a3..f5da9621 100644 --- a/aiohttp_devtools/runserver/serve.py +++ b/aiohttp_devtools/runserver/serve.py @@ -160,7 +160,7 @@ async def src_reload(app, path: str = None): is_html = mimetypes.guess_type(path)[0] == 'text/html' reloads = 0 - aux_logger.debug('prompting source reload for %d clients', len(app[WS])) + aux_logger.debug('prompting source reload for %d clients', cli_count) for ws, url in app[WS]: if path and is_html and path not in {url, url + '.html', url.rstrip('/') + '/index.html'}: aux_logger.debug('skipping reload for client at %s', url) diff --git a/aiohttp_devtools/runserver/watch.py b/aiohttp_devtools/runserver/watch.py index e88877ba..595a72fb 100644 --- a/aiohttp_devtools/runserver/watch.py +++ b/aiohttp_devtools/runserver/watch.py @@ -75,7 +75,7 @@ async def _src_reload_when_live(self, checks=20): url = 'http://localhost:{.main_port}/?_checking_alive=1'.format(self._config) logger.debug('checking app at "%s" is running before prompting reload...', url) for i in range(checks): - await asyncio.sleep(0.1, loop=self._app.loop) + await asyncio.sleep(0.1) try: async with self._session.get(url): pass diff --git a/aiohttp_devtools/start/template/app/main.py b/aiohttp_devtools/start/template/app/main.py index 0c36ee0e..7f40cca7 100644 --- a/aiohttp_devtools/start/template/app/main.py +++ b/aiohttp_devtools/start/template/app/main.py @@ -45,7 +45,7 @@ def pg_dsn(settings: Settings) -> str: async def startup(app: web.Application): - app['pg_engine'] = await create_engine(pg_dsn(app['settings']), loop=app.loop) + app['pg_engine'] = await create_engine(pg_dsn(app['settings'])) async def cleanup(app: web.Application): diff --git a/aiohttp_devtools/start/template/requirements.txt b/aiohttp_devtools/start/template/requirements.txt index 495e1797..1b9032db 100644 --- a/aiohttp_devtools/start/template/requirements.txt +++ b/aiohttp_devtools/start/template/requirements.txt @@ -1,8 +1,8 @@ # {# This file is special: lines are made unique, stripped and sorted before the new requirements.txt file is created #} # you will need to install these requirements with `pip install -r requirements.txt` -aiohttp==3.4.4 -pytest==4.0.1 +aiohttp==3.5.1 +pytest==4.0.2 pytest-aiohttp==0.3.0 pytest-cov==2.6.0 @@ -16,5 +16,5 @@ aiohttp-session[secure]==2.7.0 # {% if database.is_pg_sqlalchemy %} aiopg==0.15.0 -SQLAlchemy==1.2.14 +SQLAlchemy==1.2.15 # {% endif %} diff --git a/setup.cfg b/setup.cfg index 9cc2b992..28370b7e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,7 +17,7 @@ max-complexity = 10 exclude = aiohttp_devtools/start/template [bdist_wheel] -python-tag = py35.py36 +python-tag = py35.py36.py37 [isort] known_first_party=aiohttp_devtools diff --git a/tests/requirements.txt b/tests/requirements.txt index 94ee8400..35436a20 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -6,7 +6,7 @@ flake8==3.6.0 grablib==0.6.1 # pyup: ignore (last version which is compatible with python 3.5) pycodestyle==2.4.0 pyflakes==2.0.0 -pytest==4.0.1 +pytest==4.0.2 pytest-aiohttp==0.3.0 pytest-cov==2.6.0 pytest-isort==0.2.1 @@ -14,12 +14,12 @@ pytest-mock==1.10.0 pytest-sugar==0.9.2 pytest-timeout==1.3.3 pytest-toolbox==0.4 -pytest-xdist==1.24.1 -Sphinx==1.8.2 +pytest-xdist==1.25.0 +Sphinx==1.8.3 # required to run "start" apps aiohttp-jinja2==1.1.0 aiohttp-session[secure]==2.7.0 aiohttp-session[aioredis]==2.7.0 aiopg==0.15.0 -SQLAlchemy==1.2.14 +SQLAlchemy==1.2.15 diff --git a/tests/test_runserver_watch.py b/tests/test_runserver_watch.py index ec01fcac..f07585fe 100644 --- a/tests/test_runserver_watch.py +++ b/tests/test_runserver_watch.py @@ -1,3 +1,4 @@ +import asyncio from platform import system as get_os_family from unittest.mock import MagicMock, call @@ -75,7 +76,11 @@ async def test_python_no_server(loop, mocker): app_task._stop_dev_server = MagicMock() app = Application() app.src_reload = MagicMock() - app['websockets'] = [None] + mock_ws = MagicMock() + f = asyncio.Future() + f.set_result(1) + mock_ws.send_str = MagicMock(return_value=f) + app['websockets'] = [(mock_ws, '/')] app_task._app = app await app_task._run(2) assert app_task._app.src_reload.called is False