summaryrefslogtreecommitdiff
path: root/alembic/runtime
diff options
context:
space:
mode:
authorAsh Berlin-Taylor <ash_github@firemirror.com>2019-06-21 08:53:11 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2019-06-21 11:19:06 -0400
commit26453a8b284743bd590a86208968ca862caa67ca (patch)
treeb1037c30551216705a279062c1a297a04fac87ae /alembic/runtime
parenta8b60b4ad9fe8339629da9ce41853519460abb15 (diff)
downloadalembic-26453a8b284743bd590a86208968ca862caa67ca.tar.gz
Report warnings from caller's file/line number, not utils.py
Warnings emitted by Alembic now include a default stack level of 2, and in some cases it's set to 3, in order to help warnings indicate more closely where they are originating from. Pull request courtesy Ash Berlin-Taylor. Closes: #578 Pull-request: https://github.com/sqlalchemy/alembic/pull/578 Pull-request-sha: 49d2922dc61bfc6da42a5f45b53f04032970daeb Change-Id: I31e19cacd63a4a7ff0557d9e7f52d348f63744d6
Diffstat (limited to 'alembic/runtime')
-rw-r--r--alembic/runtime/migration.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/alembic/runtime/migration.py b/alembic/runtime/migration.py
index a4ad740..b3a9863 100644
--- a/alembic/runtime/migration.py
+++ b/alembic/runtime/migration.py
@@ -175,7 +175,8 @@ class MigrationContext(object):
util.warn(
"'connection' argument to configure() is expected "
"to be a sqlalchemy.engine.Connection instance, "
- "got %r" % connection
+ "got %r" % connection,
+ stacklevel=3
)
dialect = connection.dialect
elif url: