as the order of the validators at the level of function decorator
can't be made deterministic.
+ .. change::
+ :tags: bug, orm
+
+ Mapper errors raised during :func:`.configure_mappers` now explicitly
+ include the name of the originating mapper in the exception message
+ to help in those situations where the wrapped exception does not
+ itself include the source mapper. Pull request courtesy
+ John Perkins.
.. change::
:tags: bug, mysql
e = sa_exc.InvalidRequestError(
"One or more mappers failed to initialize - "
"can't proceed with initialization of other "
- "mappers. Original exception was: %s"
- % mapper._configure_failed)
+ "mappers. Triggering mapper: '%s'. "
+ "Original exception was: %s"
+ % (mapper, mapper._configure_failed))
e._configure_failed = mapper._configure_failed
raise e
if not mapper.configured:
for i in range(3):
assert_raises_message(
sa.exc.InvalidRequestError,
- "^One or more mappers failed to initialize - "
- "can't proceed with initialization of other "
- "mappers. Original exception was: When initializing.*",
+ "^One or more mappers failed to initialize"
+ " - can't proceed with initialization of other mappers. "
+ r"Triggering mapper: 'Mapper\|User\|users'. "
+ "Original exception was: When initializing.*",
configure_mappers)
def test_custom_base(self):
for i in range(3):
assert_raises_message(sa.exc.InvalidRequestError,
- "^One or more mappers failed to "
- "initialize - can't proceed with "
- "initialization of other mappers. "
- "Original exception was: Class "
+ "^One or more "
+ "mappers failed to initialize - can't "
+ "proceed with initialization of other "
+ r"mappers. Triggering mapper\: "
+ r"'Mapper\|Address\|addresses'."
+ " Original exception was: Class "
"'test.orm._fixtures.User' is not mapped$",
configure_mappers)