summaryrefslogtreecommitdiff
path: root/test/orm/test_mapper.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-09-09 16:18:44 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2011-09-09 16:18:44 -0400
commitbb978f2e0a4c455b28825aed3fcc80bf70f09c49 (patch)
treece4ef4aa4428a5625ee3ff91b931d0211de2ebf5 /test/orm/test_mapper.py
parentd2bd1395c65b2c298a1deef54fd1d04bbf54697f (diff)
downloadsqlalchemy-bb978f2e0a4c455b28825aed3fcc80bf70f09c49.tar.gz
- Calling class_mapper() and passing in an object
that is not a "type" (i.e. a class that could potentially be mapped) now raises an informative ArgumentError, rather than UnmappedClassError. [ticket:2196]
Diffstat (limited to 'test/orm/test_mapper.py')
-rw-r--r--test/orm/test_mapper.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/orm/test_mapper.py b/test/orm/test_mapper.py
index ce729ed6b..90ad2d215 100644
--- a/test/orm/test_mapper.py
+++ b/test/orm/test_mapper.py
@@ -1374,7 +1374,17 @@ class MapperTest(_fixtures.FixtureTest):
'addresses':relationship(Address)
})
- assert_raises(sa.orm.exc.UnmappedClassError, sa.orm.configure_mappers)
+ assert_raises_message(
+ sa.orm.exc.UnmappedClassError,
+ "Class 'test.orm._fixtures.Address' is not mapped",
+ sa.orm.configure_mappers)
+
+ def test_unmapped_not_type_error(self):
+ assert_raises_message(
+ sa.exc.ArgumentError,
+ "Class object expected, got '5'.",
+ class_mapper, 5
+ )
def test_unmapped_subclass_error_postmap(self):
users = self.tables.users