From 0bb2076a90eddb097c1fb934947d8cbce6c11fb3 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 10 Nov 2021 09:52:18 -0500 Subject: [PATCH] qualify asyncpg API tests for python 3.8 Getting TypeError: object MagicMock can't be used in 'await' expression for Python 3.7 and earlier. this test is not needed on all platforms it's confirming that two methods are present. Change-Id: If918add023c98c062ea0c1cd132a999647a2d35f (cherry picked from commit 2c41cd99d8a4d8bb27c975f5e2511ab2bf261110) --- lib/sqlalchemy/testing/requirements.py | 6 ++++++ test/dialect/postgresql/test_async_pg_py3k.py | 1 + 2 files changed, 7 insertions(+) diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py index e6f669e4c3..a0f262a760 100644 --- a/lib/sqlalchemy/testing/requirements.py +++ b/lib/sqlalchemy/testing/requirements.py @@ -1262,6 +1262,12 @@ class SuiteRequirements(Requirements): def dataclasses(self): return self.python37 + @property + def python38(self): + return exclusions.only_if( + lambda: util.py38, "Python 3.8 or above required" + ) + @property def cpython(self): return exclusions.only_if( diff --git a/test/dialect/postgresql/test_async_pg_py3k.py b/test/dialect/postgresql/test_async_pg_py3k.py index 12917e9766..782cf33dd3 100644 --- a/test/dialect/postgresql/test_async_pg_py3k.py +++ b/test/dialect/postgresql/test_async_pg_py3k.py @@ -258,6 +258,7 @@ class AsyncPgTest(fixtures.TestBase): "setup_asyncpg_jsonb_codec", argnames="methname", ) + @testing.requires.python38 @async_test async def test_codec_registration( self, metadata, async_testing_engine, methname -- 2.47.3