diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2021-04-29 21:28:19 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2021-04-29 21:28:19 +0000 |
| commit | 8716e54b5b6d9ec20d40169de3d60db3da3ad41c (patch) | |
| tree | 582ada49c2411992b92bc3eb08cdf17fa94561fa /test/sql | |
| parent | 75d1a599519fde61c9ea2c9d8c935f1e420b8333 (diff) | |
| parent | 416fdb1674daf72ef215c6abfed3e08343f1e05e (diff) | |
| download | sqlalchemy-8716e54b5b6d9ec20d40169de3d60db3da3ad41c.tar.gz | |
Merge "Fix ForeignKeyConstraint.copy() error"
Diffstat (limited to 'test/sql')
| -rw-r--r-- | test/sql/test_deprecations.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/sql/test_deprecations.py b/test/sql/test_deprecations.py index 1e5b1b995..4af1f65e3 100644 --- a/test/sql/test_deprecations.py +++ b/test/sql/test_deprecations.py @@ -58,6 +58,7 @@ from sqlalchemy.testing import mock from sqlalchemy.testing import not_in from sqlalchemy.testing.schema import Column from sqlalchemy.testing.schema import Table +from sqlalchemy.util import compat from .test_update import _UpdateFromTestBase @@ -194,6 +195,28 @@ class DeprecationWarningsTest(fixtures.TestBase, AssertsCompiledSQL): ): self.assert_compile(or_(and_()), "") + @testing.combinations( + (schema.Column), + (schema.UniqueConstraint,), + (schema.PrimaryKeyConstraint,), + (schema.CheckConstraint,), + (schema.ForeignKeyConstraint,), + (schema.ForeignKey,), + (schema.Identity,), + ) + def test_copy_dep_warning(self, cls): + obj = cls.__new__(cls) + with mock.patch.object(cls, "_copy") as _copy: + with testing.expect_deprecated( + r"The %s\(\) method is deprecated" % compat._qualname(cls.copy) + ): + obj.copy(schema="s", target_table="tt", arbitrary="arb") + + eq_( + _copy.mock_calls, + [mock.call(target_table="tt", schema="s", arbitrary="arb")], + ) + class ConvertUnicodeDeprecationTest(fixtures.TestBase): |
