Don't add warnings filter on import

The changeset module was adding a warnings filter on import. This
affects all applications that wind up importing it. A library
shouldn't modify the warnings filters unless asked.

Closes-Bug: #1407736
Change-Id: I893f8be48efd3d3642e977ab587c9e6dc867258b
This commit is contained in:
Brant Knudson 2015-01-08 15:38:02 -06:00
parent 1e83840c98
commit 244c6c55d7
2 changed files with 0 additions and 4 deletions

View File

@ -5,13 +5,10 @@
.. [#] SQL Data Definition Language .. [#] SQL Data Definition Language
""" """
import re import re
import warnings
import sqlalchemy import sqlalchemy
from sqlalchemy import __version__ as _sa_version from sqlalchemy import __version__ as _sa_version
warnings.simplefilter('always', DeprecationWarning)
_sa_version = tuple(int(re.match("\d+", x).group(0)) for x in _sa_version.split(".")) _sa_version = tuple(int(re.match("\d+", x).group(0)) for x in _sa_version.split("."))
SQLA_07 = _sa_version >= (0, 7) SQLA_07 = _sa_version >= (0, 7)
SQLA_08 = _sa_version >= (0, 8) SQLA_08 = _sa_version >= (0, 8)

View File

@ -485,7 +485,6 @@ class TestShellDatabase(Shell, DB):
result = self.env.run('migrate compare_model_to_db %s %s --model=%s' \ result = self.env.run('migrate compare_model_to_db %s %s --model=%s' \
% (self.url, repos_path, model_module.replace(":", ".")), expect_error=True) % (self.url, repos_path, model_module.replace(":", ".")), expect_error=True)
self.assertEqual(result.returncode, 0) self.assertEqual(result.returncode, 0)
self.assertTrue("DeprecationWarning" in result.stderr)
self.assertTrue("tables missing from database: tmp_account_rundiffs" in result.stdout) self.assertTrue("tables missing from database: tmp_account_rundiffs" in result.stdout)
# Update db to latest model. # Update db to latest model.