Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions aiohttp_devtools/start/template/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# {# 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.0.1
pytest==3.4.0
aiohttp==3.2.1
pytest==3.5.1
pytest-aiohttp==0.3.0
pytest-cov==2.5.1

# {% if template_engine.is_jinja %}
aiohttp-jinja2==0.15.0
aiohttp-jinja2==1.0.0
# {% endif %}

# {% if session.is_secure %}
aiohttp-session[secure]==2.2.0
aiohttp-session[secure]==2.3.0
# {% endif %}

# {% if database.is_pg_sqlalchemy %}
aiopg==0.13.2
SQLAlchemy==1.2.2
SQLAlchemy==1.2.7
# {% endif %}
22 changes: 11 additions & 11 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
coverage==4.4.2
coverage==4.5.1
docutils==0.14
flake8==3.5.0
grablib==0.6.1
grablib==0.6.1 # pyup: ignore (last version which is compatible with python 3.5)
pycodestyle==2.3.1
pyflakes==1.6.0
pytest==3.4.0
pytest==3.5.1
pytest-aiohttp==0.3.0
pytest-cov==2.5.1
pytest-isort==0.1.0
pytest-mock==1.6.3
pytest-mock==1.9.0
pytest-sugar==0.9.1
pytest-timeout==1.2.1
pytest-toolbox==0.2
pytest-xdist==1.22.0
Sphinx==1.6.6
pytest-toolbox==0.4
pytest-xdist==1.22.2
Sphinx==1.7.4

# required to run "start" apps
aiohttp-jinja2==0.15.0
aiohttp-session[secure]==2.2.0
aiohttp-session[aioredis]==2.2.0
aiohttp-jinja2==1.0.0
aiohttp-session[secure]==2.3.0
aiohttp-session[aioredis]==2.3.0
aiopg==0.13.2
SQLAlchemy==1.2.2
SQLAlchemy==1.2.7
18 changes: 9 additions & 9 deletions tests/test_runserver_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async def check_server_running(loop, check_callback):

@if_boxed
@slow
def test_start_runserver(tmpworkdir, caplog):
def test_start_runserver(tmpworkdir, smart_caplog):
mktree(tmpworkdir, {
'app.py': """\
from aiohttp import web
Expand Down Expand Up @@ -86,7 +86,7 @@ async def check_callback(session):
'adev.server.dft INFO: Starting aux server at http://localhost:8001 ◆\n'
'adev.server.dft INFO: serving static files from ./static_dir/ at http://localhost:8001/static/\n'
'adev.server.dft INFO: Starting dev server at http://localhost:8000 ●\n'
) in caplog
) in smart_caplog


@if_boxed
Expand Down Expand Up @@ -220,7 +220,7 @@ def aux_cli(test_client, loop):
loop.run_until_complete(cli.close())


async def test_websocket_hello(aux_cli, caplog):
async def test_websocket_hello(aux_cli, smart_caplog):
async with aux_cli.session.ws_connect(aux_cli.make_url('/livereload')) as ws:
await ws.send_json({'command': 'hello', 'protocols': ['http://livereload.com/protocols/official-7']})
async for msg in ws:
Expand All @@ -232,7 +232,7 @@ async def test_websocket_hello(aux_cli, caplog):
'protocols': ['http://livereload.com/protocols/official-7']
}
break # noqa
assert 'adev.server.aux WARNING: browser disconnected, appears no websocket connection was made' in caplog
assert 'adev.server.aux WARNING: browser disconnected, appears no websocket connection was made' in smart_caplog


async def test_websocket_info(aux_cli, loop):
Expand All @@ -246,7 +246,7 @@ async def test_websocket_info(aux_cli, loop):
await ws.close()


async def test_websocket_bad(aux_cli, caplog):
async def test_websocket_bad(aux_cli, smart_caplog):
async with aux_cli.session.ws_connect(aux_cli.make_url('/livereload')) as ws:
await ws.send_str('not json')
async with aux_cli.session.ws_connect(aux_cli.make_url('/livereload')) as ws:
Expand All @@ -255,10 +255,10 @@ async def test_websocket_bad(aux_cli, caplog):
await ws.send_json({'command': 'boom', 'url': 'foobar', 'plugins': 'bang'})
async with aux_cli.session.ws_connect(aux_cli.make_url('/livereload')) as ws:
await ws.send_bytes(b'this is bytes')
assert 'adev.server.aux ERROR: live reload protocol 7 not supported' in caplog.log
assert 'adev.server.aux ERROR: JSON decode error' in caplog.log
assert 'adev.server.aux ERROR: Unknown ws message' in caplog.log
assert "adev.server.aux ERROR: unknown websocket message type binary, data: b'this is bytes'" in caplog
assert 'adev.server.aux ERROR: live reload protocol 7 not supported' in smart_caplog.log
assert 'adev.server.aux ERROR: JSON decode error' in smart_caplog.log
assert 'adev.server.aux ERROR: Unknown ws message' in smart_caplog.log
assert "adev.server.aux ERROR: unknown websocket message type binary, data: b'this is bytes'" in smart_caplog


async def test_websocket_reload(aux_cli, loop):
Expand Down
8 changes: 4 additions & 4 deletions tests/test_runserver_serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async def test_check_port_not_open(unused_port, loop):
await check_port_open(port, loop, 0.001)


async def test_aux_reload(caplog):
async def test_aux_reload(smart_caplog):
aux_app = Application()
ws = MagicMock()
ws.send_str = MagicMock(return_value=create_future())
Expand All @@ -45,7 +45,7 @@ async def test_aux_reload(caplog):
'liveCSS': True,
'liveImg': True,
}
assert 'adev.server.aux INFO: prompted reload of /static/the_file.js on 1 client\n' == caplog
assert 'adev.server.aux INFO: prompted reload of /static/the_file.js on 1 client\n' == smart_caplog


async def test_aux_reload_no_path():
Expand Down Expand Up @@ -81,7 +81,7 @@ async def test_aux_reload_html_different():
assert ws.send_str.call_count == 0


async def test_aux_reload_runtime_error(caplog):
async def test_aux_reload_runtime_error(smart_caplog):
aux_app = Application()
ws = MagicMock()
ws.send_str = MagicMock(return_value=create_future())
Expand All @@ -93,7 +93,7 @@ async def test_aux_reload_runtime_error(caplog):
)
assert 0 == await src_reload(aux_app)
assert ws.send_str.call_count == 1
assert 'adev.server.aux ERROR: Error broadcasting change to /foo/bar, RuntimeError: foobar\n' == caplog
assert 'adev.server.aux ERROR: Error broadcasting change to /foo/bar, RuntimeError: foobar\n' == smart_caplog


async def test_aux_cleanup(loop):
Expand Down
8 changes: 4 additions & 4 deletions tests/test_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
if_boxed = get_if_boxed(pytest)


def test_start_simple(tmpdir, caplog):
def test_start_simple(tmpdir, smart_caplog):
StartProject(path=str(tmpdir), name='foobar')
assert {p.basename for p in tmpdir.listdir()} == {
'app',
Expand All @@ -38,11 +38,11 @@ def test_start_simple(tmpdir, caplog):
session: secure
database: pg-sqlalchemy
example: message-board
adev.main INFO: project created, 18 files generated\n""" == caplog(('"/tmp/.*?"', '"/tmp/..."'))
adev.main INFO: project created, 18 files generated\n""" == smart_caplog(('"/tmp/.*?"', '"/tmp/..."'))


@if_boxed
async def test_start_other_dir(tmpdir, loop, test_client, caplog):
async def test_start_other_dir(tmpdir, loop, test_client, smart_caplog):
StartProject(path=str(tmpdir.join('the-path')), name='foobar', database=DatabaseChoice.NONE)
assert {p.basename for p in tmpdir.listdir()} == {'the-path'}
assert {p.basename for p in tmpdir.join('the-path').listdir()} == {
Expand All @@ -62,7 +62,7 @@ async def test_start_other_dir(tmpdir, loop, test_client, caplog):
session: secure
database: none
example: message-board
adev.main INFO: project created, 16 files generated\n""" == caplog.log.replace(str(tmpdir), '/<tmpdir>')
adev.main INFO: project created, 16 files generated\n""" == smart_caplog.log.replace(str(tmpdir), '/<tmpdir>')
config = Config(app_path='the-path/app/', root_path=str(tmpdir), static_path='.')
app_factory = config.import_app_factory()
app = app_factory()
Expand Down