From f6fca84a7ffc71d743bea22e688ef3c944ba545b Mon Sep 17 00:00:00 2001 From: jonathan vanasco Date: Thu, 21 Jan 2021 12:25:04 -0500 Subject: [PATCH] Removed some legacy terms in favor of modern equivalents. (D&I) Migrated testing fixture: `TestBase.__whitelist__` -> `TestBase.__allowlist__` Migrated tox commands from deprecated to current: `whitelist_externals` > `allowlist_externals` Migrated test_session: `blacklist` -> `blocklist` Change-Id: I395d5ee977ff22fa703276b9b873cc96c59b9a35 --- lib/sqlalchemy/testing/fixtures.py | 2 +- regen_callcounts.tox.ini | 2 +- test/orm/test_session.py | 4 ++-- tox.ini | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/sqlalchemy/testing/fixtures.py b/lib/sqlalchemy/testing/fixtures.py index 45ca484449..515be459b9 100644 --- a/lib/sqlalchemy/testing/fixtures.py +++ b/lib/sqlalchemy/testing/fixtures.py @@ -30,7 +30,7 @@ from ..schema import sort_tables_and_constraints class TestBase(object): # A sequence of database names to always run, regardless of the # constraints below. - __whitelist__ = () + __allowlist__ = () # A sequence of requirement names matching testing.requires decorators __requires__ = () diff --git a/regen_callcounts.tox.ini b/regen_callcounts.tox.ini index 5374e19cd1..f162220c4f 100644 --- a/regen_callcounts.tox.ini +++ b/regen_callcounts.tox.ini @@ -12,7 +12,7 @@ deps=pytest db_mssql: .[mssql] -whitelist_externals=sh +allowlist_externals=sh commands= db_{mysql}: {env:BASECOMMAND} {env:MYSQL:} {posargs} diff --git a/test/orm/test_session.py b/test/orm/test_session.py index 3d4566af3e..23826128c1 100644 --- a/test/orm/test_session.py +++ b/test/orm/test_session.py @@ -1811,7 +1811,7 @@ class SessionInterface(fixtures.TestBase): def _public_session_methods(self): Session = sa.orm.session.Session - blacklist = {"begin", "query", "bind_mapper", "get", "bind_table"} + blocklist = {"begin", "query", "bind_mapper", "get", "bind_table"} specials = {"__iter__", "__contains__"} ok = set() for name in dir(Session): @@ -1823,7 +1823,7 @@ class SessionInterface(fixtures.TestBase): or _py_inspect.isfunction(getattr(Session, name)) ) ): - if name in blacklist: + if name in blocklist: continue spec = inspect_getfullargspec(getattr(Session, name)) if len(spec[0]) > 1 or spec[1]: diff --git a/tox.ini b/tox.ini index ea2b76e166..41892a2fff 100644 --- a/tox.ini +++ b/tox.ini @@ -39,7 +39,7 @@ deps= cov: pytest-cov -whitelist_externals=sh +allowlist_externals=sh # PYTHONPATH - erased so that we use the build that's present # in .tox as the SQLAlchemy library to be imported -- 2.47.2