summaryrefslogtreecommitdiff
path: root/test/ext/declarative
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-01-03 13:49:26 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2022-01-05 19:28:49 -0500
commit01c50c64e302c193733cef7fb146fbab8eaa44bd (patch)
treedca946206da557a14a681768d094b92c95dfabe4 /test/ext/declarative
parent146a349d81023805264f81643db50a5281da90da (diff)
downloadsqlalchemy-01c50c64e302c193733cef7fb146fbab8eaa44bd.tar.gz
Remove all remaining removed_in_20 warnings slated for removal
Finalize all remaining removed-in-2.0 changes so that we can begin doing pep-484 typing without old things getting in the way (we will also have to do public_factory). note there are a few "moved_in_20()" and "became_legacy_in_20()" warnings still in place. The SQLALCHEMY_WARN_20 variable is now removed. Also removed here are the legacy "in place mutators" for Select statements, and some keyword-only argument signatures in Core have been added. Also in the big change department, the ORM mapper() function is removed entirely; the Mapper class is otherwise unchanged, just the public-facing API function. Mappers are now always given a registry in which to participate, however the argument signature of Mapper is not changed. ideally "registry" would be the first positional argument. Fixes: #7257 Change-Id: Ic70c57b9f1cf7eb996338af5183b11bdeb3e1623
Diffstat (limited to 'test/ext/declarative')
-rw-r--r--test/ext/declarative/test_deprecations.py21
1 files changed, 0 insertions, 21 deletions
diff --git a/test/ext/declarative/test_deprecations.py b/test/ext/declarative/test_deprecations.py
index 58ad2fced..a4192fddb 100644
--- a/test/ext/declarative/test_deprecations.py
+++ b/test/ext/declarative/test_deprecations.py
@@ -1,34 +1,13 @@
import sqlalchemy as sa
from sqlalchemy import inspect
from sqlalchemy.ext import declarative as legacy_decl
-from sqlalchemy.ext.declarative import instrument_declarative
-from sqlalchemy.orm import Mapper
from sqlalchemy.testing import eq_
from sqlalchemy.testing import expect_deprecated_20
from sqlalchemy.testing import fixtures
-from sqlalchemy.testing import is_
from sqlalchemy.testing import is_false
from sqlalchemy.testing import is_true
-class TestInstrumentDeclarative(fixtures.TestBase):
- def test_ok(self):
- class Foo:
- __tablename__ = "foo"
- id = sa.Column(sa.Integer, primary_key=True)
-
- meta = sa.MetaData()
- reg = {}
- with expect_deprecated_20(
- "the instrument_declarative function is deprecated"
- ):
- instrument_declarative(Foo, reg, meta)
-
- mapper = sa.inspect(Foo)
- is_true(isinstance(mapper, Mapper))
- is_(mapper.class_, Foo)
-
-
class DeprecatedImportsTest(fixtures.TestBase):
def _expect_warning(self, name):
return expect_deprecated_20(