diff options
Diffstat (limited to 'test/orm/test_deprecations.py')
| -rw-r--r-- | test/orm/test_deprecations.py | 58 |
1 files changed, 1 insertions, 57 deletions
diff --git a/test/orm/test_deprecations.py b/test/orm/test_deprecations.py index 91b15d14a..4efff1f76 100644 --- a/test/orm/test_deprecations.py +++ b/test/orm/test_deprecations.py @@ -1,7 +1,6 @@ import sqlalchemy as sa from sqlalchemy import and_ from sqlalchemy import event -from sqlalchemy import exc from sqlalchemy import func from sqlalchemy import Integer from sqlalchemy import select @@ -463,7 +462,7 @@ class DeprecatedQueryTest(_fixtures.FixtureTest, AssertsCompiledSQL): # same here, this was "passing string names to Query.columns" # deprecation message, that's gone here? assert_raises_message( - exc.ArgumentError, + sa.exc.ArgumentError, "Textual column expression 'name' should be explicitly", s.query, User.id, @@ -1508,61 +1507,6 @@ class DeprecatedOptionAllTest(OptionsPathTest, _fixtures.FixtureTest): sess.query(User).options(undefer("addresses", "email_address")) -class LegacyLockModeTest(_fixtures.FixtureTest): - run_inserts = None - - @classmethod - def setup_mappers(cls): - User, users = cls.classes.User, cls.tables.users - mapper(User, users) - - def _assert_legacy(self, arg, read=False, nowait=False): - User = self.classes.User - s = Session() - - with testing.expect_deprecated( - r"The Query.with_lockmode\(\) method is deprecated" - ): - q = s.query(User).with_lockmode(arg) - sel = q._compile_context().statement - - if arg is None: - assert q._for_update_arg is None - assert sel._for_update_arg is None - return - - assert q._for_update_arg.read is read - assert q._for_update_arg.nowait is nowait - - assert sel._for_update_arg.read is read - assert sel._for_update_arg.nowait is nowait - - def test_false_legacy(self): - self._assert_legacy(None) - - def test_plain_legacy(self): - self._assert_legacy("update") - - def test_nowait_legacy(self): - self._assert_legacy("update_nowait", nowait=True) - - def test_read_legacy(self): - self._assert_legacy("read", read=True) - - def test_unknown_legacy_lock_mode(self): - User = self.classes.User - sess = Session() - with testing.expect_deprecated( - r"The Query.with_lockmode\(\) method is deprecated" - ): - assert_raises_message( - exc.ArgumentError, - "Unknown with_lockmode argument: 'unknown_mode'", - sess.query(User.id).with_lockmode, - "unknown_mode", - ) - - class InstrumentationTest(fixtures.ORMTest): def test_dict_subclass4(self): # tests #2654 |
