From 1824585b081f0f1571b9ecf526fcc1249c6f03ee Mon Sep 17 00:00:00 2001 From: "pyup.io bot" Date: Mon, 18 Feb 2019 13:41:10 +0200 Subject: [PATCH] Scheduled monthly dependency update for February (#224) * 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 --- Makefile | 3 ++- .../start/template/requirements.txt | 10 ++++----- setup.cfg | 2 +- tests/conftest.py | 18 ++++++++------- tests/requirements.txt | 17 +++++++------- tests/test_runserver_config.py | 8 +++---- tests/test_runserver_main.py | 22 ++++++------------- tests/test_start.py | 14 +++--------- 8 files changed, 39 insertions(+), 55 deletions(-) diff --git a/Makefile b/Makefile index 5889bad2..2ba41bdd 100644 --- a/Makefile +++ b/Makefile @@ -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: diff --git a/aiohttp_devtools/start/template/requirements.txt b/aiohttp_devtools/start/template/requirements.txt index 1b9032db..73555ba4 100644 --- a/aiohttp_devtools/start/template/requirements.txt +++ b/aiohttp_devtools/start/template/requirements.txt @@ -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 @@ -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 %} diff --git a/setup.cfg b/setup.cfg index be530f9c..67e1fd91 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,5 @@ [tool:pytest] testpaths = tests -addopts = --isort timeout = 10 isort_ignore = aiohttp_devtools/start/template/*.py @@ -11,6 +10,7 @@ filterwarnings = ignore::UserWarning:psycopg2 ignore::DeprecationWarning:aiopg ignore::DeprecationWarning:jinja2 + ignore::DeprecationWarning:isort [flake8] max-line-length = 120 diff --git a/tests/conftest.py b/tests/conftest.py index 212201ae..8e29b4a4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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: @@ -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) diff --git a/tests/requirements.txt b/tests/requirements.txt index 35436a20..dfffe265 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -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 diff --git a/tests/test_runserver_config.py b/tests/test_runserver_config.py index 733482e3..2e526ef9 100644 --- a/tests/test_runserver_config.py +++ b/tests/test_runserver_config.py @@ -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): @@ -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': """\ @@ -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': """\ diff --git a/tests/test_runserver_main.py b/tests/test_runserver_main.py index 417d6cf6..58509db9 100644 --- a/tests/test_runserver_main.py +++ b/tests/test_runserver_main.py @@ -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): @@ -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': """\ @@ -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': """\ @@ -117,8 +112,7 @@ 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() @@ -126,7 +120,7 @@ def test_run_app(loop, aiohttp_unused_port): 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') @@ -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) @@ -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': """\ diff --git a/tests/test_start.py b/tests/test_start.py index 653a1319..6b2d88a8 100644 --- a/tests/test_start.py +++ b/tests/test_start.py @@ -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' @@ -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'} @@ -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), @@ -130,8 +123,7 @@ async def test_all_options(tmpdir, aiohttp_client, loop, template_engine, sessio assert 'foobar' in text -@if_boxed -@slow +@pytest.mark.boxed async def test_db_creation(tmpdir, aiohttp_client, loop): StartProject( path=str(tmpdir),