]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
remove _py3k suffixes from test files
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 20 Sep 2025 22:31:25 +0000 (18:31 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 20 Sep 2025 22:33:58 +0000 (18:33 -0400)
on the theme of 2.0/2.1 are relatively similar right now, do
some more cleanup removing the py3k suffixes that we dont need anymore.

I'm not sure that the logic that would search for these suffixes is
even present anymore and I would guess we removed it when we removed
py2k support.  However, I am planning on possibly bringing it back
for some of the py314 stuff, so I still want to be able to do
suffix stuff.  that will be for another patch.

Change-Id: I929e6edd922f8d5f943acce77191fb1e3035b42c
(cherry picked from commit fb3243475e208673d98c6a543cf16169f7f5f42d)

test/base/test_misc_py3k.py [deleted file]
test/base/test_typing_utils.py
test/dialect/postgresql/test_async_pg.py [moved from test/dialect/postgresql/test_async_pg_py3k.py with 100% similarity]
test/ext/asyncio/test_engine.py [moved from test/ext/asyncio/test_engine_py3k.py with 100% similarity]
test/ext/asyncio/test_scoping.py [moved from test/ext/asyncio/test_scoping_py3k.py with 98% similarity]
test/ext/asyncio/test_session.py [moved from test/ext/asyncio/test_session_py3k.py with 99% similarity]
test/orm/test_dataclasses.py [moved from test/orm/test_dataclasses_py3k.py with 100% similarity]

diff --git a/test/base/test_misc_py3k.py b/test/base/test_misc_py3k.py
deleted file mode 100644 (file)
index 99dbe2a..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-import operator
-from typing import cast
-
-from sqlalchemy import Column
-from sqlalchemy.testing import eq_
-from sqlalchemy.testing import fixtures
-
-
-class TestGenerics(fixtures.TestBase):
-    def test_traversible_is_generic(self):
-        """test #6759"""
-        col = Column[int]
-
-        # looked in the source for typing._GenericAlias.
-        # col.__origin__ is Column, but it's not public API.
-        # __reduce__ could change too but seems good enough for now
-        eq_(cast(object, col).__reduce__(), (operator.getitem, (Column, int)))
index 51f5e13c4182d3674644ae876622d70c1a993ec0..58ad10fa95c4498d8b4621583d4d4937dd63ebd3 100644 (file)
@@ -1,14 +1,17 @@
 # NOTE: typing implementation is full of heuristic so unit test it to avoid
 # unexpected breakages.
 
+import operator
 import typing
+from typing import cast
 
 import typing_extensions
 
+from sqlalchemy import Column
+from sqlalchemy.testing import eq_
 from sqlalchemy.testing import fixtures
+from sqlalchemy.testing import is_
 from sqlalchemy.testing import requires
-from sqlalchemy.testing.assertions import eq_
-from sqlalchemy.testing.assertions import is_
 from sqlalchemy.util import py310
 from sqlalchemy.util import py312
 from sqlalchemy.util import py314
@@ -246,6 +249,17 @@ def exec_code(code: str, *vars: str) -> typing.Any:
     return [scope[name] for name in vars]
 
 
+class TestGenerics(fixtures.TestBase):
+    def test_traversible_is_generic(self):
+        """test #6759"""
+        col = Column[int]
+
+        # looked in the source for typing._GenericAlias.
+        # col.__origin__ is Column, but it's not public API.
+        # __reduce__ could change too but seems good enough for now
+        eq_(cast(object, col).__reduce__(), (operator.getitem, (Column, int)))
+
+
 class TestTestingThings(fixtures.TestBase):
     def test_unions_are_the_same(self):
         # the point of this test is to reduce the cases to test since
similarity index 98%
rename from test/ext/asyncio/test_scoping_py3k.py
rename to test/ext/asyncio/test_scoping.py
index caba1c66001fe2be4340186a69d11eda536e1385..de00108bc4c437ed76d5839e5d61bb7a3ff0d046 100644 (file)
@@ -7,7 +7,7 @@ from sqlalchemy.orm import sessionmaker
 from sqlalchemy.testing import async_test
 from sqlalchemy.testing import eq_
 from sqlalchemy.testing import is_
-from .test_session_py3k import AsyncFixture
+from .test_session import AsyncFixture
 
 
 class AsyncScopedSessionTest(AsyncFixture):
similarity index 99%
rename from test/ext/asyncio/test_session_py3k.py
rename to test/ext/asyncio/test_session.py
index 5f9bf2e089e87b87544e10a7296d1b64dea6d15f..dedbc7928bc8338453318a663b317b2783e3c8df 100644 (file)
@@ -48,7 +48,7 @@ from sqlalchemy.testing.assertions import not_in
 from sqlalchemy.testing.entities import ComparableEntity
 from sqlalchemy.testing.provision import normalize_sequence
 from sqlalchemy.testing.schema import Column
-from .test_engine_py3k import AsyncFixture as _AsyncFixture
+from .test_engine import AsyncFixture as _AsyncFixture
 from ...orm import _fixtures