]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
internal test framework files for standardization of is_not/not_in;
authorjonathan vanasco <jonathan@2xlp.com>
Mon, 24 Aug 2020 22:53:31 +0000 (18:53 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 29 Aug 2020 16:34:51 +0000 (12:34 -0400)
this is safe for 1.3.x

Change-Id: Icba38fdc20f5d8ac407383a4278ccb346e09af38
(cherry picked from commit 672087176eaf3d0e867c6b5c67bfea3c713be42e)

22 files changed:
lib/sqlalchemy/testing/__init__.py
lib/sqlalchemy/testing/assertions.py
test/base/test_events.py
test/dialect/mssql/test_types.py
test/dialect/test_all.py
test/engine/test_execute.py
test/engine/test_pool.py
test/engine/test_reflection.py
test/ext/test_baked.py
test/ext/test_indexable.py
test/orm/test_eager_relations.py
test/orm/test_events.py
test/orm/test_merge.py
test/orm/test_selectin_relations.py
test/orm/test_subquery_relations.py
test/orm/test_transaction.py
test/sql/test_computed.py
test/sql/test_deprecations.py
test/sql/test_generative.py
test/sql/test_operators.py
test/sql/test_resultset.py
test/sql/test_types.py

index 3f21726b214609d4bdbd187c33b7e9d4500e5837..c85fe5225f1f7ba73cb91ad7864014a01a8ff636 100644 (file)
@@ -27,10 +27,12 @@ from .assertions import in_  # noqa
 from .assertions import is_  # noqa
 from .assertions import is_false  # noqa
 from .assertions import is_instance_of  # noqa
+from .assertions import is_not  # noqa
 from .assertions import is_not_  # noqa
 from .assertions import is_true  # noqa
 from .assertions import le_  # noqa
 from .assertions import ne_  # noqa
+from .assertions import not_in  # noqa
 from .assertions import not_in_  # noqa
 from .assertions import startswith_  # noqa
 from .assertions import uses_deprecated  # noqa
index 8aa150b0f4e6850f510feefdf51490d2586f533b..74d38ad20d0f3e27f8bf23c2fd931ccc6f25ce56 100644 (file)
@@ -264,21 +264,29 @@ def is_(a, b, msg=None):
     assert a is b, msg or "%r is not %r" % (a, b)
 
 
-def is_not_(a, b, msg=None):
+def is_not(a, b, msg=None):
     """Assert a is not b, with repr messaging on failure."""
     assert a is not b, msg or "%r is %r" % (a, b)
 
 
+# deprecated.  See #5429
+is_not_ = is_not
+
+
 def in_(a, b, msg=None):
     """Assert a in b, with repr messaging on failure."""
     assert a in b, msg or "%r not in %r" % (a, b)
 
 
-def not_in_(a, b, msg=None):
+def not_in(a, b, msg=None):
     """Assert a in not b, with repr messaging on failure."""
     assert a not in b, msg or "%r is in %r" % (a, b)
 
 
+# deprecated.  See #5429
+not_in_ = not_in
+
+
 def startswith_(a, fragment, msg=None):
     """Assert a.startswith(fragment), with repr messaging on failure."""
     assert a.startswith(fragment), msg or "%r does not start with %r" % (
index f13137084a377ce886424801dd4662cf896afcbc..47bea58bf9f3fa39d1e84b851f8bfb8e8645deec 100644 (file)
@@ -8,7 +8,7 @@ from sqlalchemy.testing import assert_raises_message
 from sqlalchemy.testing import eq_
 from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import is_
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
 from sqlalchemy.testing.mock import call
 from sqlalchemy.testing.mock import Mock
 from sqlalchemy.testing.util import gc_collect
@@ -162,7 +162,7 @@ class EventsTest(fixtures.TestBase):
         def listen_two(x, y):
             pass
 
-        is_not_(
+        is_not(
             self.Target.dispatch._empty_listener_reg[self.Target]["event_one"],
             t1.dispatch.event_one,
         )
index 68b024f49d3d7d465f56fca1797d7e111f9da97b..8c9679a70f6802060895308c0070a11c117bd0f8 100644 (file)
@@ -51,7 +51,7 @@ from sqlalchemy.testing import engines
 from sqlalchemy.testing import eq_
 from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import is_
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
 from sqlalchemy.testing import pickleable
 from sqlalchemy.util import b
 
@@ -1051,7 +1051,7 @@ class TypeRoundTripTest(
                     is_(tbl._autoincrement_column, col)
                 else:
                     eq_(col.autoincrement, "auto")
-                    is_not_(tbl._autoincrement_column, col)
+                    is_not(tbl._autoincrement_column, col)
 
             # mxodbc can't handle scope_identity() with DEFAULT VALUES
 
index 1e4366eb720f256971bca6c6bbbd281a33be9013..f03c4745f9b602fa80b2ee3f1db4706745b1ba36 100644 (file)
@@ -1,6 +1,6 @@
 from sqlalchemy import dialects
 from sqlalchemy.testing import fixtures
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
 
 
 class ImportStarTest(fixtures.TestBase):
@@ -14,4 +14,4 @@ class ImportStarTest(fixtures.TestBase):
     def test_all_import(self):
         for package in self._all_dialect_packages():
             for item_name in package.__all__:
-                is_not_(None, getattr(package, item_name))
+                is_not(None, getattr(package, item_name))
index 9885a497ce238e8aea849ad837237f5aef220eb5..304ffe6d4139784d8edecad22825ddd7231ff29b 100644 (file)
@@ -33,7 +33,7 @@ from sqlalchemy.testing import eq_
 from sqlalchemy.testing import expect_warnings
 from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import is_
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
 from sqlalchemy.testing import mock
 from sqlalchemy.testing.assertsql import CompiledSQL
 from sqlalchemy.testing.engines import testing_engine
@@ -2325,7 +2325,7 @@ class HandleErrorTest(fixtures.TestBase):
 
         for crec in crecs:
             if crec is target_crec or not set_to_false:
-                is_not_(crec.connection, crec.get_connection())
+                is_not(crec.connection, crec.get_connection())
             else:
                 is_(crec.connection, crec.get_connection())
 
index d6baf19fb56a8e57b6e85e25fad990c66b314851..51d1b3eb481a7b64eb0708b835a96123b5f68618 100644 (file)
@@ -15,7 +15,7 @@ from sqlalchemy.testing import assert_raises_message
 from sqlalchemy.testing import eq_
 from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import is_
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
 from sqlalchemy.testing import is_true
 from sqlalchemy.testing.engines import testing_engine
 from sqlalchemy.testing.mock import ANY
@@ -151,7 +151,7 @@ class PoolTest(PoolTestBase):
         self.assert_("foo2" in c.info)
 
         c2 = p.connect()
-        is_not_(c.connection, c2.connection)
+        is_not(c.connection, c2.connection)
         assert not c2.info
         assert "foo2" in c.info
 
@@ -215,7 +215,7 @@ class PoolTest(PoolTestBase):
 
         c2 = r1.get_connection()
 
-        is_not_(c1, c2)
+        is_not(c1, c2)
         is_(c2, r1.connection)
 
         eq_(c2.mock_calls, [])
@@ -1189,7 +1189,7 @@ class QueuePoolTest(PoolTestBase):
 
             mock.return_value = 10035
             c3 = p.connect()
-            is_not_(c3.connection, c_ref())
+            is_not(c3.connection, c_ref())
 
     @testing.requires.timing_intensive
     def test_recycle_on_invalidate(self):
@@ -1207,7 +1207,7 @@ class QueuePoolTest(PoolTestBase):
         time.sleep(0.5)
         c3 = p.connect()
 
-        is_not_(c3.connection, c_ref())
+        is_not(c3.connection, c_ref())
 
     @testing.requires.timing_intensive
     def test_recycle_on_soft_invalidate(self):
@@ -1230,7 +1230,7 @@ class QueuePoolTest(PoolTestBase):
         c2.close()
 
         c3 = p.connect()
-        is_not_(c3.connection, c_ref())
+        is_not(c3.connection, c_ref())
         is_(c3._connection_record, c2_rec)
         is_(c2_rec.connection, c3.connection)
 
index 64224d6c2736c7f1002fe0f259ed1596746e763d..fef8363cfbb1137877b237678c0ca95c5c94dc84 100644 (file)
@@ -27,10 +27,10 @@ from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import in_
 from sqlalchemy.testing import is_
 from sqlalchemy.testing import is_instance_of
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
 from sqlalchemy.testing import is_true
 from sqlalchemy.testing import mock
-from sqlalchemy.testing import not_in_
+from sqlalchemy.testing import not_in
 from sqlalchemy.testing import skip
 from sqlalchemy.testing.schema import Column
 from sqlalchemy.testing.schema import Table
@@ -168,7 +168,7 @@ class ReflectionTest(fixtures.TestBase, ComparesTables):
         meta2 = MetaData()
         t1 = Table("t1", meta2, resolve_fks=False, autoload_with=testing.db)
         in_("t1", meta2.tables)
-        not_in_("t2", meta2.tables)
+        not_in("t2", meta2.tables)
 
         assert_raises(
             sa.exc.NoReferencedTableError,
@@ -208,7 +208,7 @@ class ReflectionTest(fixtures.TestBase, ComparesTables):
             autoload_with=testing.db,
             extend_existing=True,
         )
-        not_in_("t2", meta2.tables)
+        not_in("t2", meta2.tables)
 
         assert_raises(
             sa.exc.NoReferencedTableError,
@@ -240,7 +240,7 @@ class ReflectionTest(fixtures.TestBase, ComparesTables):
         meta2 = MetaData()
         meta2.reflect(testing.db, resolve_fks=False, only=["t1"])
         in_("t1", meta2.tables)
-        not_in_("t2", meta2.tables)
+        not_in("t2", meta2.tables)
 
         t1 = meta2.tables["t1"]
 
@@ -2272,7 +2272,7 @@ class ComputedColumnTest(fixtures.ComputedReflectionFixtureTest):
     def check_table_column(self, table, name, text, persisted):
         is_true(name in table.columns)
         col = table.columns[name]
-        is_not_(col.computed, None)
+        is_not(col.computed, None)
         is_instance_of(col.computed, Computed)
 
         eq_(self.normalize(str(col.computed.sqltext)), text)
index 1b008a249a939f51664871afb1b8d4ba0c659950..ec4b9cdeeb3a48449a104ead2bea72c1387d48b8 100644 (file)
@@ -22,7 +22,7 @@ from sqlalchemy.orm.query import Query
 from sqlalchemy.testing import assert_raises_message
 from sqlalchemy.testing import eq_
 from sqlalchemy.testing import is_
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
 from sqlalchemy.testing import mock
 from sqlalchemy.testing.assertsql import CompiledSQL
 from test.orm import _fixtures
@@ -108,7 +108,7 @@ class StateChangeTest(BakedTest):
         q1 = self.bakery(l1)
 
         q2 = q1.with_criteria(l2)
-        is_not_(q2, q1)
+        is_not(q2, q1)
 
         self._assert_cache_key(q1._cache_key, [l1])
         self._assert_cache_key(q2._cache_key, [l1, l2])
@@ -126,7 +126,7 @@ class StateChangeTest(BakedTest):
         q1 = self.bakery(l1)
 
         q2 = q1 + l2
-        is_not_(q2, q1)
+        is_not(q2, q1)
 
         self._assert_cache_key(q1._cache_key, [l1])
         self._assert_cache_key(q2._cache_key, [l1, l2])
index 2ffd273bc32da4e452635cbf71522b5bd4219dd0..295325b7b5f120e54ee252eb4aa0fc17f512aba7 100644 (file)
@@ -14,7 +14,7 @@ from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import in_
 from sqlalchemy.testing import is_
 from sqlalchemy.testing import ne_
-from sqlalchemy.testing import not_in_
+from sqlalchemy.testing import not_in
 from sqlalchemy.testing.schema import Column
 
 
@@ -246,7 +246,7 @@ class IndexPropertyArrayTest(fixtures.DeclarativeMappedTest):
         a.first = 10
 
         is_(i.modified, True)
-        not_in_("array", i.unmodified)
+        not_in("array", i.unmodified)
 
 
 class IndexPropertyJsonTest(fixtures.DeclarativeMappedTest):
@@ -339,7 +339,7 @@ class IndexPropertyJsonTest(fixtures.DeclarativeMappedTest):
         j.other = 42
 
         is_(i.modified, True)
-        not_in_("json", i.unmodified)
+        not_in("json", i.unmodified)
 
     def test_cast_type(self):
         Json = self.classes.Json
index cbf2c4bfbfe7b56cf874bb5698dc1265ec24939a..b7909a8e9c490e629db7e0a5daa2171b833cf667 100644 (file)
@@ -35,7 +35,7 @@ from sqlalchemy.testing import eq_
 from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import in_
 from sqlalchemy.testing import is_
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
 from sqlalchemy.testing.assertsql import CompiledSQL
 from sqlalchemy.testing.schema import Column
 from sqlalchemy.testing.schema import Table
@@ -1696,7 +1696,7 @@ class EagerTest(_fixtures.FixtureTest, testing.AssertsCompiledSQL):
 
         def go():
             a = q.filter(addresses.c.id == 1).one()
-            is_not_(a.user, None)
+            is_not(a.user, None)
             u1 = sess.query(User).get(7)
             is_(a.user, u1)
 
index 1774bbc546fd81f1ae9a7e3a0f77a397b04455e6..54ad88a20e75d36a8928b151c17cbeba55547640 100644 (file)
@@ -26,7 +26,7 @@ from sqlalchemy.testing import AssertsCompiledSQL
 from sqlalchemy.testing import eq_
 from sqlalchemy.testing import expect_warnings
 from sqlalchemy.testing import fixtures
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
 from sqlalchemy.testing.assertsql import CompiledSQL
 from sqlalchemy.testing.mock import ANY
 from sqlalchemy.testing.mock import call
@@ -2115,7 +2115,7 @@ class SessionLifecycleEventsTest(_RemoveListeners, _fixtures.FixtureTest):
             listener.flag_checked(instance)
             # this is actually u1, because
             # we have a strong ref internally
-            is_not_(None, instance)
+            is_not(None, instance)
 
         u1 = User(name="u1")
         sess.add(u1)
@@ -2148,7 +2148,7 @@ class SessionLifecycleEventsTest(_RemoveListeners, _fixtures.FixtureTest):
 
         @event.listens_for(sess, "persistent_to_deleted")
         def persistent_to_deleted(session, instance):
-            is_not_(None, instance)
+            is_not(None, instance)
             listener.flag_checked(instance)
 
         sess.delete(u1)
index b52f4ddb1cb6383a4234f8f0a13935440976390d..2317ec8cecd436ca2ab0547f3dfb5ff307c6b769 100644 (file)
@@ -29,7 +29,7 @@ from sqlalchemy.testing import eq_
 from sqlalchemy.testing import expect_warnings
 from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import in_
-from sqlalchemy.testing import not_in_
+from sqlalchemy.testing import not_in
 from sqlalchemy.testing.schema import Column
 from sqlalchemy.testing.schema import Table
 from sqlalchemy.util import OrderedSet
@@ -1806,7 +1806,7 @@ class DeferredMergeTest(fixtures.MappedTest):
 
             # should not emit load for deferred 'excerpt'
             eq_(b2.summary, "some summary")
-            not_in_("excerpt", b2.__dict__)
+            not_in("excerpt", b2.__dict__)
 
             # now it should emit load for deferred 'excerpt'
             eq_(b2.excerpt, "some excerpt")
@@ -1852,7 +1852,7 @@ class DeferredMergeTest(fixtures.MappedTest):
 
             # should not emit load for deferred 'excerpt'
             eq_(b2.summary, "some summary")
-            not_in_("excerpt", b2.__dict__)
+            not_in("excerpt", b2.__dict__)
 
             # now it should emit load for deferred 'excerpt'
             eq_(b2.excerpt, "some excerpt")
index 0d8474abc4a55ac08e231395f8dabca73a311a52..f4c17b482b3073f0a437651f136c25fdd97eb27c 100644 (file)
@@ -25,7 +25,7 @@ from sqlalchemy.testing import assert_raises_message
 from sqlalchemy.testing import eq_
 from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import is_
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
 from sqlalchemy.testing import is_true
 from sqlalchemy.testing import mock
 from sqlalchemy.testing.assertsql import AllOf
@@ -1167,7 +1167,7 @@ class EagerTest(_fixtures.FixtureTest, testing.AssertsCompiledSQL):
 
         def go():
             a = q.filter(addresses.c.id == 1).one()
-            is_not_(a.user, None)
+            is_not(a.user, None)
             u1 = sess.query(User).get(7)
             is_(a.user, u1)
 
index 61ff11ec9c5b68ea70708ced6d6d555db6c24251..825375d0607b26f4e078b3cd9c01718a3b973151 100644 (file)
@@ -24,7 +24,7 @@ from sqlalchemy.testing import assert_raises_message
 from sqlalchemy.testing import eq_
 from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import is_
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
 from sqlalchemy.testing import is_true
 from sqlalchemy.testing.assertsql import CompiledSQL
 from sqlalchemy.testing.entities import ComparableEntity
@@ -1197,7 +1197,7 @@ class EagerTest(_fixtures.FixtureTest, testing.AssertsCompiledSQL):
 
         def go():
             a = q.filter(addresses.c.id == 1).one()
-            is_not_(a.user, None)
+            is_not(a.user, None)
             u1 = sess.query(User).get(7)
             is_(a.user, u1)
 
index 304c9e39a6cc999e21be7ce3450c725a7763cb1d..b7a05ece002aa30e075fd81a953a6d02bd497030 100644 (file)
@@ -27,7 +27,7 @@ from sqlalchemy.testing import eq_
 from sqlalchemy.testing import expect_warnings
 from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import is_
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
 from sqlalchemy.testing import is_true
 from sqlalchemy.testing import mock
 from sqlalchemy.testing.util import gc_collect
@@ -620,7 +620,7 @@ class SessionTransactionTest(fixtures.RemovesEvents, FixtureTest):
         eq_(trans._state, _session.CLOSED)
 
         # outermost transaction is new
-        is_not_(session.transaction, trans)
+        is_not(session.transaction, trans)
 
         # outermost is active
         eq_(session.transaction._state, _session.ACTIVE)
@@ -893,9 +893,8 @@ class SessionTransactionTest(fixtures.RemovesEvents, FixtureTest):
         session = create_session(autocommit=False)
         session.add(User(name="ed"))
         session.transaction.commit()
-        assert (
-            session.transaction is not None
-        ), "autocommit=False should start a new transaction"
+
+        is_not(session.transaction, None)
 
     @testing.requires.python2
     @testing.requires.savepoints_w_release
@@ -1580,7 +1579,7 @@ class SavepointTest(_LocalFixture):
         assert u1 not in s.new
 
         is_(trans._state, _session.CLOSED)
-        is_not_(s.transaction, trans)
+        is_not(s.transaction, trans)
         is_(s.transaction._state, _session.ACTIVE)
 
         is_(s.transaction.nested, False)
index 2999c621cbf5f51881d6aa716238d38498bffddf..b2fc23717d17c2ca3919b6dadcb8651c02776bbc 100644 (file)
@@ -11,7 +11,7 @@ from sqlalchemy.testing import AssertsCompiledSQL
 from sqlalchemy.testing import combinations
 from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import is_
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
 
 
 class DDLComputedTest(fixtures.TestBase, AssertsCompiledSQL):
@@ -69,7 +69,7 @@ class DDLComputedTest(fixtures.TestBase, AssertsCompiledSQL):
         t2 = t.tometadata(m2)
         comp2 = t2.c.y.server_default
 
-        is_not_(comp1, comp2)
+        is_not(comp1, comp2)
 
         is_(comp1.column, t.c.y)
         is_(t.c.y.server_onupdate, comp1)
index 4559806495a3475c00c64b13d1e427a9b8520673..9e3a3182a12616244a4b8116bc3aef485133af57 100644 (file)
@@ -35,7 +35,7 @@ from sqlalchemy.testing import eq_
 from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import in_
 from sqlalchemy.testing import mock
-from sqlalchemy.testing import not_in_
+from sqlalchemy.testing import not_in
 
 
 class DeprecationWarningsTest(fixtures.TestBase):
@@ -173,8 +173,8 @@ class CaseSensitiveFunctionDeprecationsTest(fixtures.TestBase):
         assert isinstance(func.myfunc().type, DateTime)
 
         in_("myfunc", reg)
-        not_in_("MYFUNC", reg)
-        not_in_("MyFunc", reg)
+        not_in("MYFUNC", reg)
+        not_in("MyFunc", reg)
         in_("myfunc", cs_reg)
         eq_(set(cs_reg["myfunc"].keys()), set(["MYFUNC"]))
 
@@ -198,8 +198,8 @@ class CaseSensitiveFunctionDeprecationsTest(fixtures.TestBase):
             assert isinstance(func.myfunc().type, Integer)
 
         eq_(reg["myfunc"], functions._CASE_SENSITIVE)
-        not_in_("MYFUNC", reg)
-        not_in_("MyFunc", reg)
+        not_in("MYFUNC", reg)
+        not_in("MyFunc", reg)
         in_("myfunc", cs_reg)
         eq_(set(cs_reg["myfunc"].keys()), set(["MYFUNC", "MyFunc"]))
 
@@ -217,8 +217,8 @@ class CaseSensitiveFunctionDeprecationsTest(fixtures.TestBase):
         assert isinstance(func.replaceable_func().type, Integer)
 
         in_("replaceable_func", reg)
-        not_in_("REPLACEABLE_FUNC", reg)
-        not_in_("Replaceable_Func", reg)
+        not_in("REPLACEABLE_FUNC", reg)
+        not_in("Replaceable_Func", reg)
         in_("replaceable_func", cs_reg)
         eq_(set(cs_reg["replaceable_func"].keys()), set(["REPLACEABLE_FUNC"]))
 
@@ -241,8 +241,8 @@ class CaseSensitiveFunctionDeprecationsTest(fixtures.TestBase):
         assert isinstance(func.replaceable_func().type, NullType)
 
         eq_(reg["replaceable_func"], functions._CASE_SENSITIVE)
-        not_in_("REPLACEABLE_FUNC", reg)
-        not_in_("Replaceable_Func", reg)
+        not_in("REPLACEABLE_FUNC", reg)
+        not_in("Replaceable_Func", reg)
         in_("replaceable_func", cs_reg)
         eq_(
             set(cs_reg["replaceable_func"].keys()),
@@ -287,8 +287,8 @@ class CaseSensitiveFunctionDeprecationsTest(fixtures.TestBase):
         assert isinstance(func.replaceable_func().type, String)
 
         eq_(reg["replaceable_func"], functions._CASE_SENSITIVE)
-        not_in_("REPLACEABLE_FUNC", reg)
-        not_in_("Replaceable_Func", reg)
+        not_in("REPLACEABLE_FUNC", reg)
+        not_in("Replaceable_Func", reg)
         in_("replaceable_func", cs_reg)
         eq_(
             set(cs_reg["replaceable_func"].keys()),
index 469015026e53bfbe90eedabc69595612d64af285..212206f0a1c9e92c4f10d00daab1f501019d8bad 100644 (file)
@@ -35,7 +35,7 @@ from sqlalchemy.testing import AssertsExecutionResults
 from sqlalchemy.testing import eq_
 from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import is_
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
 
 
 A = B = t1 = t2 = t3 = table1 = table2 = table3 = table4 = None
@@ -446,7 +446,7 @@ class ClauseTest(fixtures.TestBase, AssertsCompiledSQL):
         adapter = sql_util.ColumnAdapter(t3_alias)
 
         lblx_adapted = adapter.traverse(lbl_x)
-        is_not_(lblx_adapted._element, lbl_x._element)
+        is_not(lblx_adapted._element, lbl_x._element)
 
         lblx_adapted = adapter.traverse(lbl_x)
         self.assert_compile(
@@ -806,7 +806,7 @@ class ColumnAdapterTest(fixtures.TestBase, AssertsCompiledSQL):
 
         expr = select([t1a.c.col1]).label("x")
         expr_adapted = adapter.traverse(expr)
-        is_not_(expr, expr_adapted)
+        is_not(expr, expr_adapted)
         is_(adapter.columns[expr], expr_adapted)
 
     def test_traverse_memoizes_w_itself(self):
@@ -815,7 +815,7 @@ class ColumnAdapterTest(fixtures.TestBase, AssertsCompiledSQL):
 
         expr = select([t1a.c.col1]).label("x")
         expr_adapted = adapter.traverse(expr)
-        is_not_(expr, expr_adapted)
+        is_not(expr, expr_adapted)
         is_(adapter.traverse(expr), expr_adapted)
 
     def test_columns_memoizes_w_itself(self):
@@ -824,7 +824,7 @@ class ColumnAdapterTest(fixtures.TestBase, AssertsCompiledSQL):
 
         expr = select([t1a.c.col1]).label("x")
         expr_adapted = adapter.columns[expr]
-        is_not_(expr, expr_adapted)
+        is_not(expr, expr_adapted)
         is_(adapter.columns[expr], expr_adapted)
 
     def test_wrapping_fallthrough(self):
@@ -1799,9 +1799,9 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL):
             select_copy,
             "SELECT table1.col1, table1.col2, " "table1.col3, yyy FROM table1",
         )
-        assert s.columns is not select_copy.columns
-        assert s._columns is not select_copy._columns
-        assert s._raw_columns is not select_copy._raw_columns
+        is_not(s.columns, select_copy.columns)
+        is_not(s._columns, select_copy._columns)
+        is_not(s._raw_columns, select_copy._raw_columns)
         self.assert_compile(
             s, "SELECT table1.col1, table1.col2, " "table1.col3 FROM table1"
         )
index 8b2648ff7516e70b889e74098878152980fd4704..e3224084dc9de310c179c7a641bed7e837137529 100644 (file)
@@ -53,7 +53,7 @@ from sqlalchemy.testing import eq_
 from sqlalchemy.testing import expect_warnings
 from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import is_
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
 from sqlalchemy.types import ARRAY
 from sqlalchemy.types import Boolean
 from sqlalchemy.types import Concatenable
@@ -1083,9 +1083,9 @@ class ConjunctionTest(fixtures.TestBase, testing.AssertsCompiledSQL):
         )
 
     def test_constant_non_singleton(self):
-        is_not_(null(), null())
-        is_not_(false(), false())
-        is_not_(true(), true())
+        is_not(null(), null())
+        is_not(false(), false())
+        is_not(true(), true())
 
     def test_constant_render_distinct(self):
         self.assert_compile(
@@ -2002,7 +2002,7 @@ class NegationTest(fixtures.TestBase, testing.AssertsCompiledSQL):
         expr = not_(orig_expr)
         isinstance(expr, Label)
         eq_(expr.name, "foo")
-        is_not_(expr, orig_expr)
+        is_not(expr, orig_expr)
         is_(expr._element.operator, operator.inv)  # e.g. and not false_
 
         self.assert_compile(
@@ -2016,7 +2016,7 @@ class NegationTest(fixtures.TestBase, testing.AssertsCompiledSQL):
             self.table1.c.myid == 1, self.table1.c.myid == 2
         ).self_group()
         expr = not_(orig_expr)
-        is_not_(expr, orig_expr)
+        is_not(expr, orig_expr)
 
         self.assert_compile(
             expr,
index db7c1f47b22511142f08b05de947424f83e25918..41dbc4838b6cff665a7a6a8c0f67eb5ec22ea310 100644 (file)
@@ -34,7 +34,7 @@ from sqlalchemy.testing import in_
 from sqlalchemy.testing import is_
 from sqlalchemy.testing import le_
 from sqlalchemy.testing import ne_
-from sqlalchemy.testing import not_in_
+from sqlalchemy.testing import not_in
 from sqlalchemy.testing.mock import Mock
 from sqlalchemy.testing.mock import patch
 from sqlalchemy.testing.schema import Column
@@ -187,7 +187,7 @@ class ResultProxyTest(fixtures.TablesTest):
 
         row = testing.db.execute(content.select(use_labels=True)).first()
         in_(content.c.type, row)
-        not_in_(bar.c.content_type, row)
+        not_in(bar.c.content_type, row)
         in_(sql.column("content_type"), row)
 
         row = testing.db.execute(
@@ -195,16 +195,16 @@ class ResultProxyTest(fixtures.TablesTest):
         ).first()
         in_(content.c.type, row)
 
-        not_in_(bar.c.content_type, row)
+        not_in(bar.c.content_type, row)
 
         in_(sql.column("content_type"), row)
 
         row = testing.db.execute(
             select([func.now().label("content_type")])
         ).first()
-        not_in_(content.c.type, row)
+        not_in(content.c.type, row)
 
-        not_in_(bar.c.content_type, row)
+        not_in(bar.c.content_type, row)
 
         in_(sql.column("content_type"), row)
 
@@ -413,15 +413,15 @@ class ResultProxyTest(fixtures.TablesTest):
         )
 
         if testing.against("sqlite < 3.10.0"):
-            not_in_("user_id", r)
-            not_in_("user_name", r)
+            not_in("user_id", r)
+            not_in("user_name", r)
             eq_(r["users.user_id"], 1)
             eq_(r["users.user_name"], "john")
 
             eq_(list(r.keys()), ["users.user_id", "users.user_name"])
         else:
-            not_in_("users.user_id", r)
-            not_in_("users.user_name", r)
+            not_in("users.user_id", r)
+            not_in("users.user_name", r)
             eq_(r["user_id"], 1)
             eq_(r["user_name"], "john")
 
@@ -450,8 +450,8 @@ class ResultProxyTest(fixtures.TablesTest):
             eq_(r["users.user_id"], 1)
             eq_(r["users.user_name"], "john")
         else:
-            not_in_("users.user_id", r)
-            not_in_("users.user_name", r)
+            not_in("users.user_id", r)
+            not_in("users.user_name", r)
 
         eq_(list(r.keys()), ["user_id", "user_name"])
 
@@ -473,7 +473,7 @@ class ResultProxyTest(fixtures.TablesTest):
         )
         eq_(r["users.user_id"], 1)
         eq_(r["users.user_name"], "john")
-        not_in_("user_name", r)
+        not_in("user_name", r)
         eq_(list(r.keys()), ["users.user_id", "users.user_name"])
 
     def test_column_accessor_unary(self):
@@ -613,7 +613,7 @@ class ResultProxyTest(fixtures.TablesTest):
 
         in_("case_insensitive", row._keymap)
         in_("CaseSensitive", row._keymap)
-        not_in_("casesensitive", row._keymap)
+        not_in("casesensitive", row._keymap)
 
         eq_(row["case_insensitive"], 1)
         eq_(row["CaseSensitive"], 2)
@@ -640,7 +640,7 @@ class ResultProxyTest(fixtures.TablesTest):
 
         in_("case_insensitive", row._keymap)
         in_("CaseSensitive", row._keymap)
-        not_in_("casesensitive", row._keymap)
+        not_in("casesensitive", row._keymap)
 
         eq_(row["case_insensitive"], 1)
         eq_(row["CaseSensitive"], 2)
@@ -1360,24 +1360,24 @@ class KeyTargetingTest(fixtures.TablesTest):
             select([content.c.type.label("content_type")])
         ).first()
 
-        not_in_(content.c.type, row)
-        not_in_(bar.c.content_type, row)
+        not_in(content.c.type, row)
+        not_in(bar.c.content_type, row)
 
         in_(sql.column("content_type"), row)
 
         row = testing.db.execute(
             select([func.now().label("content_type")])
         ).first()
-        not_in_(content.c.type, row)
-        not_in_(bar.c.content_type, row)
+        not_in(content.c.type, row)
+        not_in(bar.c.content_type, row)
         in_(sql.column("content_type"), row)
 
     def test_column_label_overlap_fallback_2(self):
         content, bar = self.tables.content, self.tables.bar
         row = testing.db.execute(content.select(use_labels=True)).first()
         in_(content.c.type, row)
-        not_in_(bar.c.content_type, row)
-        not_in_(sql.column("content_type"), row)
+        not_in(bar.c.content_type, row)
+        not_in(sql.column("content_type"), row)
 
     def test_columnclause_schema_column_one(self):
         keyed2 = self.tables.keyed2
index be8389c9ce49e3a2ad12d8a02691515fc48a461b..2c028508f1852b60b86df0c43d95bd438008583d 100644 (file)
@@ -77,7 +77,7 @@ from sqlalchemy.testing import eq_
 from sqlalchemy.testing import expect_warnings
 from sqlalchemy.testing import fixtures
 from sqlalchemy.testing import is_
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
 from sqlalchemy.testing import mock
 from sqlalchemy.testing import pickleable
 from sqlalchemy.testing.schema import Column
@@ -2555,12 +2555,12 @@ class ExpressionTest(
         expr = tab.c.avalue["foo"] == "bar"
 
         is_(expr.right.type._type_affinity, String)
-        is_not_(expr.right.type, my_json_normal)
+        is_not(expr.right.type, my_json_normal)
 
         expr = tab.c.bvalue["foo"] == "bar"
 
         is_(expr.right.type._type_affinity, String)
-        is_not_(expr.right.type, my_json_variant)
+        is_not(expr.right.type, my_json_variant)
 
     def test_variant_righthand_coercion_returns_self(self):
         my_datetime_normal = DateTime()