summaryrefslogtreecommitdiff
path: root/test/orm/test_lambdas.py
diff options
context:
space:
mode:
authorGord Thompson <gord@gordthompson.com>2021-08-12 13:04:28 -0600
committerMike Bayer <mike_mp@zzzcomputing.com>2021-09-30 10:10:16 -0400
commit257f9130c321aaa948690d0e49c7352ad1188abd (patch)
tree2648c88460c3e5de847ee998edb7a6df0aa9b261 /test/orm/test_lambdas.py
parentf7f2df607301afcd11dd49a2ccb632291de12d29 (diff)
downloadsqlalchemy-257f9130c321aaa948690d0e49c7352ad1188abd.tar.gz
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
Diffstat (limited to 'test/orm/test_lambdas.py')
-rw-r--r--test/orm/test_lambdas.py9
1 files changed, 4 insertions, 5 deletions
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")