summaryrefslogtreecommitdiff
path: root/test/engine
diff options
context:
space:
mode:
authorValery Yundin <yuvalery@gmail.com>2016-12-16 09:22:08 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2017-01-16 14:02:26 -0500
commitbccc1419a67c06636b5d5a8d5c00612b7d843edd (patch)
treec152ebc97afc1dc0cd1f018fdf794e370d814edc /test/engine
parent710ce4aaf9130cce0ad17cc471be57038dd641aa (diff)
downloadsqlalchemy-bccc1419a67c06636b5d5a8d5c00612b7d843edd.tar.gz
Better hide engine password
Avoid putting engine password in the exception message in `MetaData.reflect` (since exception messages often appear in logs). Use the same redacted `__repr__` implementation in `TLEngine` as in its base class `Engine` Change-Id: Ic0a7baea917a9c8d87dffdd82ef566673ab08e02 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/327
Diffstat (limited to 'test/engine')
-rw-r--r--test/engine/test_reflection.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/engine/test_reflection.py b/test/engine/test_reflection.py
index 869fd63e5..0bc5b111e 100644
--- a/test/engine/test_reflection.py
+++ b/test/engine/test_reflection.py
@@ -932,11 +932,13 @@ class ReflectionTest(fixtures.TestBase, ComparesTables):
self.assert_(set(m3.tables.keys()) == set(['rt_c']))
m4 = MetaData(testing.db)
- try:
- m4.reflect(only=['rt_a', 'rt_f'])
- self.assert_(False)
- except sa.exc.InvalidRequestError as e:
- self.assert_(e.args[0].endswith('(rt_f)'))
+
+ assert_raises_message(
+ sa.exc.InvalidRequestError,
+ r"Could not reflect: requested table\(s\) not available in "
+ r"Engine\(.*?\): \(rt_f\)",
+ m4.reflect, only=['rt_a', 'rt_f']
+ )
m5 = MetaData(testing.db)
m5.reflect(only=[])