From 257f9130c321aaa948690d0e49c7352ad1188abd Mon Sep 17 00:00:00 2001 From: Gord Thompson Date: Thu, 12 Aug 2021 13:04:28 -0600 Subject: Modernize tests - calling_mapper_directly a few changes for py2k: * map_imperatively() includes the check that a class is being sent, this was only working for mapper() before * the test suite didn't place the py2k "autouse" workaround in the correct order, seemingly, tried to adjust the per-test ordering setup in pytestplugin.py Change-Id: I4cc39630724e810953cfda7b2afdadc8b948e3c2 --- test/orm/test_lambdas.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'test/orm/test_lambdas.py') diff --git a/test/orm/test_lambdas.py b/test/orm/test_lambdas.py index a1657d746..30048585b 100644 --- a/test/orm/test_lambdas.py +++ b/test/orm/test_lambdas.py @@ -9,7 +9,6 @@ from sqlalchemy import testing from sqlalchemy import update from sqlalchemy.future import select from sqlalchemy.orm import aliased -from sqlalchemy.orm import mapper from sqlalchemy.orm import relationship from sqlalchemy.orm import selectinload from sqlalchemy.orm import Session @@ -44,7 +43,7 @@ class LambdaTest(QueryTest, AssertsCompiledSQL): self.classes.User, ) - mapper( + self.mapper_registry.map_imperatively( User, users, properties={ @@ -52,7 +51,7 @@ class LambdaTest(QueryTest, AssertsCompiledSQL): }, ) - mapper( + self.mapper_registry.map_imperatively( Address, addresses, properties={ @@ -444,7 +443,7 @@ class UpdateDeleteTest(fixtures.MappedTest): Address = cls.classes.Address addresses = cls.tables.addresses - mapper( + cls.mapper_registry.map_imperatively( User, users, properties={ @@ -452,7 +451,7 @@ class UpdateDeleteTest(fixtures.MappedTest): "addresses": relationship(Address), }, ) - mapper(Address, addresses) + cls.mapper_registry.map_imperatively(Address, addresses) def test_update(self): User, Address = self.classes("User", "Address") -- cgit v1.2.1