Skip to content

Commit 7832583

Browse files
mergify[bot]mabdinurKyle-Verhoog
authored
Move contrib/aiohttp tests to riot (backport #2866) (#2972)
* Move aiohttp tests to riot Migrate aiohttp from tox to riot. Fixes #1370 * Pin async-timeout to <4.0.0 for older aiohttp versions (#2963) async-timeout introduces a breaking change (changing the `timeout` class to a function) which breaks older versions of aiohttp. Co-authored-by: Munir Abdinur <[email protected]> Co-authored-by: Kyle Verhoog <[email protected]>
1 parent ca4470c commit 7832583

File tree

4 files changed

+34
-27
lines changed

4 files changed

+34
-27
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,8 @@ jobs:
465465
aiohttp:
466466
<<: *contrib_job
467467
steps:
468-
- run_tox_scenario:
469-
pattern: '^aiohttp_contrib-'
468+
- run_test:
469+
pattern: 'aiohttp'
470470

471471
asgi:
472472
<<: *contrib_job_small

riotfile.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,33 @@ def select_pys(min_version=MIN_PYTHON_VERSION, max_version=MAX_PYTHON_VERSION):
11831183
},
11841184
command="pytest {cmdargs} tests/contrib/aiopg",
11851185
),
1186+
Venv(
1187+
name="aiohttp",
1188+
command="pytest {cmdargs} tests/contrib/aiohttp",
1189+
pkgs={
1190+
"pytest-aiohttp": [latest],
1191+
},
1192+
venvs=[
1193+
Venv(
1194+
pys=select_pys(min_version="3.5", max_version="3.6"),
1195+
pkgs={
1196+
"aiohttp": ["~=2.0", "~=2.1", "~=2.2", "~=2.3"],
1197+
"aiohttp_jinja2": ["~=0.12", "~=0.13", "~=0.15"],
1198+
"async-timeout": ["<4.0.0"],
1199+
"yarl": "~=0.18.0",
1200+
},
1201+
),
1202+
Venv(
1203+
# Python 3.5 is deprecated for aiohttp >= 3.0
1204+
pys=select_pys(min_version="3.6"),
1205+
pkgs={
1206+
"aiohttp": ["~=3.0", "~=3.1", "~=3.2", "~=3.3", "~=3.4", "~=3.5", "~=3.6"],
1207+
"aiohttp_jinja2": "~=0.15",
1208+
"yarl": "~=1.0",
1209+
},
1210+
),
1211+
],
1212+
),
11861213
Venv(
11871214
name="jinja2",
11881215
venvs=[

tests/contrib/aiohttp/test_templates.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import sys
2+
3+
import pytest
4+
15
from .app.web import set_filesystem_loader
26
from .app.web import set_package_loader
37

@@ -43,6 +47,7 @@ async def test_template_rendering_filesystem(untraced_app_tracer, aiohttp_client
4347
assert 0 == span.error
4448

4549

50+
@pytest.mark.skipif(sys.version_info < (3, 6), reason="Not compatible with Python 3.5")
4651
async def test_template_rendering_package(untraced_app_tracer, aiohttp_client, loop):
4752
app, tracer = untraced_app_tracer
4853
client = await aiohttp_client(app)

tox.ini

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ envlist =
2222
{py27,py35,py36,py37,py38,py39,py310}-profile-minreqs{,-gevent}
2323
py{27,35,36,37,38,39,310}-integration-{v5,latest,snapshot}
2424
# Integrations environments
25-
# Python 3.7 needs at least aiohttp 2.3
26-
aiohttp_contrib-{py35,py36}-aiohttp{20,21,22}-aiohttp_jinja{012,013}-yarl-pytest3
27-
aiohttp_contrib-{py35,py36,py37,py38}-aiohttp23-aiohttp_jinja015-yarl10-pytest3
28-
aiohttp_contrib-{py35,py36,py37}-aiohttp{30,31,32,33,35,36}-aiohttp_jinja{015}-yarl10-pytest3
29-
aiohttp_contrib-py{38,39}-aiohttp{30,31,32,33,36}-aiohttp_jinja015-yarl10-pytest3
3025
algoliasearch_contrib-py{27,35,36,37,38,39,310}-algoliasearch{1,2,}
3126
asyncio_contrib-py{35,36,37,38,39,310}
3227
bottle_contrib{,_autopatch}-py{27,35,36,37,38,39}-bottle{11,12,}-webtest
@@ -117,28 +112,9 @@ deps =
117112
py39-profile-minreqs-gevent: greenlet==0.4.16
118113
py310-profile-minreqs-gevent: gevent==21.8.0
119114
py310-profile-minreqs-gevent: greenlet==1.1.0
120-
# force the downgrade as a workaround
121-
# https://github.com/aio-libs/aiohttp/issues/2662
122-
yarl: yarl==0.18.0
123-
yarl10: yarl>=1.0,<1.1
124115
# backports
125116
py27: enum34
126117
# integrations
127-
aiohttp_contrib: pytest-aiohttp
128-
aiohttp20: aiohttp>=2.0,<2.1
129-
aiohttp21: aiohttp>=2.1,<2.2
130-
aiohttp22: aiohttp>=2.2,<2.3
131-
aiohttp23: aiohttp>=2.3,<2.4
132-
aiohttp30: aiohttp>=3.0,<3.1
133-
aiohttp31: aiohttp>=3.1,<3.2
134-
aiohttp32: aiohttp>=3.2,<3.3
135-
aiohttp33: aiohttp>=3.3,<3.4
136-
aiohttp34: aiohttp>=3.4,<3.5
137-
aiohttp35: aiohttp>=3.5,<3.6
138-
aiohttp36: aiohttp>=3.6,<3.7
139-
aiohttp_jinja012: aiohttp_jinja2>=0.12,<0.13
140-
aiohttp_jinja013: aiohttp_jinja2>=0.13,<0.14
141-
aiohttp_jinja015: aiohttp_jinja2>=0.15,<0.16
142118
algoliasearch: algoliasearch
143119
algoliasearch1: algoliasearch>=1.2,<2
144120
algoliasearch2: algoliasearch>=2,<3
@@ -279,7 +255,6 @@ commands =
279255
opentracer_gevent: pytest {posargs} tests/opentracer/test_tracer_gevent.py
280256
integration-{v5,latest,snapshot}: pytest --no-cov {posargs} tests/integration/
281257
# Contribs
282-
aiohttp_contrib: pytest {posargs} tests/contrib/aiohttp
283258
algoliasearch_contrib: pytest {posargs} tests/contrib/algoliasearch
284259
asyncio_contrib: pytest {posargs} tests/contrib/asyncio
285260
bottle_contrib: pytest {posargs} --ignore="tests/contrib/bottle/test_autopatch.py" tests/contrib/bottle/

0 commit comments

Comments
 (0)