Skip to content

Commit

Permalink
Scheduled monthly dependency update for February (#224)
Browse files Browse the repository at this point in the history
* Update aiohttp from 3.5.1 to 3.5.4

* Update pytest from 4.0.2 to 4.2.0

* Update pytest from 4.0.2 to 4.2.0

* Update pytest-cov from 2.6.0 to 2.6.1

* Update pytest-cov from 2.6.0 to 2.6.1

* Update aiopg from 0.15.0 to 0.16.0

* Update aiopg from 0.15.0 to 0.16.0

* Update sqlalchemy from 1.2.15 to 1.2.17

* Update sqlalchemy from 1.2.15 to 1.2.17

* Update flake8 from 3.6.0 to 3.7.4

* Update pycodestyle from 2.4.0 to 2.5.0

* Update pyflakes from 2.0.0 to 2.1.0

* Update pytest-xdist from 1.25.0 to 1.26.1

* fix pytest, remove pytest-isort and @slow tests

* fix warnings
  • Loading branch information
pyup.io bot authored and samuelcolvin committed Feb 18, 2019
1 parent 0e3d711 commit 1824585
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 55 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ isort:
lint:
python setup.py check -rms
flake8 aiohttp_devtools/ tests/
pytest aiohttp_devtools -p no:sugar -q --cache-clear
isort -rc -w 120 --check-only -sg */template/* aiohttp_devtools
isort -rc -w 120 --check-only tests

.PHONY: test
test:
Expand Down
10 changes: 5 additions & 5 deletions aiohttp_devtools/start/template/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# {# 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.5.1
pytest==4.0.2
aiohttp==3.5.4
pytest==4.2.0
pytest-aiohttp==0.3.0
pytest-cov==2.6.0
pytest-cov==2.6.1

# {% if template_engine.is_jinja %}
aiohttp-jinja2==1.1.0
Expand All @@ -15,6 +15,6 @@ aiohttp-session[secure]==2.7.0
# {% endif %}

# {% if database.is_pg_sqlalchemy %}
aiopg==0.15.0
SQLAlchemy==1.2.15
aiopg==0.16.0
SQLAlchemy==1.2.17
# {% endif %}
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[tool:pytest]
testpaths = tests
addopts = --isort
timeout = 10
isort_ignore =
aiohttp_devtools/start/template/*.py
Expand All @@ -11,6 +10,7 @@ filterwarnings =
ignore::UserWarning:psycopg2
ignore::DeprecationWarning:aiopg
ignore::DeprecationWarning:jinja2
ignore::DeprecationWarning:isort

[flake8]
max-line-length = 120
Expand Down
18 changes: 10 additions & 8 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
from asyncio import Future

import pytest


def pytest_collection_modifyitems(config, items):
if not config.getoption('--boxed'):
skip_boxed = pytest.mark.skip(reason='only run with --boxed flag')
for item in items:
if 'boxed' in item.keywords:
item.add_marker(skip_boxed)


def pytest_addoption(parser):
try:
Expand All @@ -24,14 +34,6 @@ def create_app():
}


def get_slow(_pytest):
return _pytest.mark.skipif(_pytest.config.getoption('--fast'), reason='not run with --fast flag')


def get_if_boxed(_pytest):
return _pytest.mark.skipif(not _pytest.config.getoption('--boxed'), reason='only run with --boxed flag')


def create_future(result=None):
f = Future()
f.set_result(result)
Expand Down
17 changes: 8 additions & 9 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@ aiohttp_debugtoolbar==0.5.0
click==7.0.0
coverage==4.5.2
docutils==0.14
flake8==3.6.0
flake8==3.7.4
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.2
pycodestyle==2.5.0
pyflakes==2.1.0
pytest==4.2.0
pytest-aiohttp==0.3.0
pytest-cov==2.6.0
pytest-isort==0.2.1
pytest-cov==2.6.1
pytest-mock==1.10.0
pytest-sugar==0.9.2
pytest-timeout==1.3.3
pytest-toolbox==0.4
pytest-xdist==1.25.0
pytest-xdist==1.26.1
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.15
aiopg==0.16.0
SQLAlchemy==1.2.17
8 changes: 3 additions & 5 deletions tests/test_runserver_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
from aiohttp_devtools.exceptions import AiohttpDevConfigError
from aiohttp_devtools.runserver.config import Config

from .conftest import SIMPLE_APP, get_if_boxed

if_boxed = get_if_boxed(pytest)
from .conftest import SIMPLE_APP


async def test_load_simple_app(tmpworkdir):
Expand All @@ -23,7 +21,7 @@ async def test_create_app_wrong_name(tmpworkdir, loop):
assert excinfo.value.args[0] == 'Module "app.py" does not define a "missing" attribute/class'


@if_boxed
@pytest.mark.boxed
async def test_no_loop_coroutine(tmpworkdir):
mktree(tmpworkdir, {
'app.py': """\
Expand All @@ -43,7 +41,7 @@ async def app_factory():
assert isinstance(app, web.Application)


@if_boxed
@pytest.mark.boxed
async def test_not_app(tmpworkdir):
mktree(tmpworkdir, {
'app.py': """\
Expand Down
22 changes: 7 additions & 15 deletions tests/test_runserver_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
from aiohttp_devtools.runserver.config import Config
from aiohttp_devtools.runserver.serve import create_auxiliary_app, modify_main_app, src_reload, start_main_app

from .conftest import SIMPLE_APP, get_if_boxed, get_slow

slow = get_slow(pytest)
if_boxed = get_if_boxed(pytest)
from .conftest import SIMPLE_APP


async def check_server_running(check_callback):
Expand All @@ -39,8 +36,7 @@ async def check_server_running(check_callback):
await check_callback(session)


@if_boxed
@slow
@pytest.mark.boxed
def test_start_runserver(tmpworkdir, smart_caplog):
mktree(tmpworkdir, {
'app.py': """\
Expand Down Expand Up @@ -91,8 +87,7 @@ async def check_callback(session):
) in smart_caplog


@if_boxed
@slow
@pytest.mark.boxed
def test_start_runserver_app_instance(tmpworkdir, loop):
mktree(tmpworkdir, {
'app.py': """\
Expand All @@ -117,16 +112,15 @@ def kill_parent_soon(pid):
os.kill(pid, signal.SIGINT)


@if_boxed
@slow
@pytest.mark.boxed
def test_run_app(loop, aiohttp_unused_port):
app = Application()
port = aiohttp_unused_port()
Process(target=kill_parent_soon, args=(os.getpid(),)).start()
run_app(app, port, loop, AccessLogger)


@if_boxed
@pytest.mark.boxed
async def test_run_app_aiohttp_client(tmpworkdir, aiohttp_client):
mktree(tmpworkdir, SIMPLE_APP)
config = Config(app_path='app.py')
Expand All @@ -153,8 +147,7 @@ async def test_aux_app(tmpworkdir, aiohttp_client):
assert text == 'test value'


@if_boxed
@slow
@pytest.mark.boxed
async def test_serve_main_app(tmpworkdir, loop, mocker):
asyncio.set_event_loop(loop)
mktree(tmpworkdir, SIMPLE_APP)
Expand All @@ -167,8 +160,7 @@ async def test_serve_main_app(tmpworkdir, loop, mocker):
mock_modify_main_app.assert_called_with(mock.ANY, config)


@if_boxed
@slow
@pytest.mark.boxed
async def test_start_main_app_app_instance(tmpworkdir, loop, mocker):
mktree(tmpworkdir, {
'app.py': """\
Expand Down
14 changes: 3 additions & 11 deletions tests/test_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@
from aiohttp_devtools.start import DatabaseChoice, ExampleChoice, SessionChoices, StartProject, TemplateChoice
from aiohttp_devtools.start.main import enum_choices

from .conftest import get_if_boxed, get_slow

slow = get_slow(pytest)
if_boxed = get_if_boxed(pytest)


IS_WINDOWS = platform.system() == 'Windows'


Expand Down Expand Up @@ -51,7 +45,7 @@ def test_start_simple(tmpdir, smart_caplog):
adev.main INFO: project created, 18 files generated\n""".format(log_path) == smart_caplog(log_normalizers)


@if_boxed
@pytest.mark.boxed
async def test_start_other_dir(tmpdir, loop, aiohttp_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'}
Expand Down Expand Up @@ -95,8 +89,7 @@ def test_conflicting_file(tmpdir):
assert excinfo.value.args[0].endswith('has files/directories which would conflict with the new project: Makefile')


@if_boxed
@slow
@pytest.mark.boxed
@pytest.mark.parametrize('template_engine,session,database,example', itertools.product(
enum_choices(TemplateChoice),
enum_choices(SessionChoices),
Expand Down Expand Up @@ -130,8 +123,7 @@ async def test_all_options(tmpdir, aiohttp_client, loop, template_engine, sessio
assert '<title>foobar</title>' in text


@if_boxed
@slow
@pytest.mark.boxed
async def test_db_creation(tmpdir, aiohttp_client, loop):
StartProject(
path=str(tmpdir),
Expand Down

0 comments on commit 1824585

Please sign in to comment.