Repository: DataDog/dd-trace-py

Issue:
async tests are being skipped
unfortunately this is not an error :(

I have a fix here: https://github.com/DataDog/dd-trace-py/pull/1369/files#diff-b91f3d5bd63fcd17221b267e851608e8L186

to be merged here: https://github.com/DataDog/dd-trace-py/pull/1319


Discussion:
That's not really a "fix" though, more a workaround. We want to be able to run latest pytest.

Do you have a "trace" of those tests that are skipped?
https://circleci.com/api/v1.1/project/github/DataDog/dd-trace-py/236166/output/104/0?file=true&allocation-id=5e99768216826a22c8c1894e-0-build%2F5206909E
search for skipped
any recent build just look at the aiohttp tests
If you look at pytest changelog, it seems that those tests were actually never ran, but the warning failed to be emitted in some cases:
https://docs.pytest.org/en/latest/changelog.html

The problem is that pytest-asyncio does not play well with unittest, so most tests should be rewritten without unittest.
it used to work, the recent version broke it, here's some magic you can add to the top of each file to ensure it runs all the tests with the new version: `pytestmark = pytest.mark.asyncio`
> it used to work, the recent version broke it, here's some magic you can add to the top of each file to ensure it runs all the tests with the new version: pytestmark = pytest.mark.asyncio

Did you try?
I tried, and it still ignores the tests because they are `unittest`-based.

Resolving patch:
diff --git a/riotfile.py b/riotfile.py
--- a/riotfile.py
+++ b/riotfile.py
@@ -1153,6 +1153,30 @@ def select_pys(min_version=MIN_PYTHON_VERSION, max_version=MAX_PYTHON_VERSION):
             },
             command="pytest {cmdargs} tests/contrib/aiopg",
         ),
+        Venv(
+            name="aiohttp",
+            command="pytest {cmdargs} tests/contrib/aiohttp",
+            pkgs={"pytest-aiohttp": [latest]},
+            venvs=[
+                Venv(
+                    pys=select_pys(min_version="3.5", max_version="3.6"),
+                    pkgs={
+                        "aiohttp": ["~=2.0", "~=2.1", "~=2.2", "~=2.3"],
+                        "aiohttp_jinja2": ["~=0.12", "~=0.13", "~=0.15"],
+                        "yarl": "~=0.18.0",
+                    },
+                ),
+                Venv(
+                    # Python 3.5 is deprecated for aiohttp >= 3.0
+                    pys=select_pys(min_version="3.6"),
+                    pkgs={
+                        "aiohttp": ["~=3.0", "~=3.1", "~=3.2", "~=3.3", "~=3.4", "~=3.5", "~=3.6"],
+                        "aiohttp_jinja2": "~=0.15",
+                        "yarl": "~=1.0",
+                    },
+                ),
+            ],
+        ),
         Venv(
             name="jinja2",
             venvs=[


Test patch:
diff --git a/tests/contrib/aiohttp/test_templates.py b/tests/contrib/aiohttp/test_templates.py
--- a/tests/contrib/aiohttp/test_templates.py
+++ b/tests/contrib/aiohttp/test_templates.py
@@ -1,3 +1,7 @@
+import sys
+
+import pytest
+
 from .app.web import set_filesystem_loader
 from .app.web import set_package_loader
 
@@ -43,6 +47,7 @@ async def test_template_rendering_filesystem(untraced_app_tracer, aiohttp_client
     assert 0 == span.error
 
 
+@pytest.mark.skipif(sys.version_info < (3, 6), reason="Not compatible with Python 3.5")
 async def test_template_rendering_package(untraced_app_tracer, aiohttp_client, loop):
     app, tracer = untraced_app_tracer
     client = await aiohttp_client(app)