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
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" % (
from sqlalchemy.testing import expect_deprecated
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
def listen_two(x, y):
pass
- is_not_(
+ is_not(
self.Target.dispatch._empty_listener_reg[self.Target]["event_one"],
t1.dispatch.event_one,
)
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
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
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):
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))
from sqlalchemy.testing import fixtures
from sqlalchemy.testing import is_
from sqlalchemy.testing import is_false
-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 CompiledSQL
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())
c2 = eng.connect()
dbapi_conn_two = c2.connection.connection
- is_not_(dbapi_conn_one, dbapi_conn_two)
+ is_not(dbapi_conn_one, dbapi_conn_two)
eq_(
m1.mock_calls,
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
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
c2 = r1.get_connection()
- is_not_(c1, c2)
+ is_not(c1, c2)
is_(c2, r1.connection)
eq_(c2.mock_calls, [])
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):
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):
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)
from sqlalchemy.testing import is_
from sqlalchemy.testing import is_false
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
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,
autoload_with=testing.db,
extend_existing=True,
)
- not_in_("t2", meta2.tables)
+ not_in("t2", meta2.tables)
assert_raises(
sa.exc.NoReferencedTableError,
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"]
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)
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 test.orm import _fixtures
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])
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])
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
a.first = 10
is_(i.modified, True)
- not_in_("array", i.unmodified)
+ not_in("array", i.unmodified)
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
from sqlalchemy.testing import fixtures
from sqlalchemy.testing import is_
from sqlalchemy.testing import is_false
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
from sqlalchemy.testing import is_true
-from sqlalchemy.testing import not_in_
+from sqlalchemy.testing import not_in
from sqlalchemy.testing.mock import call
from sqlalchemy.testing.mock import Mock
from sqlalchemy.testing.util import all_partial_orderings
existing = a1.bs
is_(state._empty_collections["bs"], existing)
- is_not_(existing._sa_adapter, None)
+ is_not(existing._sa_adapter, None)
a1.bs = [] # replaces previous "empty" collection
- not_in_("bs", state._empty_collections) # empty is replaced
+ not_in("bs", state._empty_collections) # empty is replaced
is_(existing._sa_adapter, None)
def test_assert_false_on_default_value(self):
eq_(a1.__dict__["bs"], [b1, b2])
old = a1.__dict__["bs"]
- is_not_(old._sa_adapter, None)
+ is_not(old._sa_adapter, None)
state = attributes.instance_state(a1)
# this occurs during a load with populate_existing
from sqlalchemy.testing import eq_
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 test.orm import _fixtures
sess.expunge(u1)
- not_in_(orders[0], sess)
- not_in_(orders[1], sess)
+ not_in(orders[0], sess)
+ not_in(orders[1], sess)
def test_default_none_cascade(self):
User, Order, orders, users = (
u1.orders.append(o1)
u1.orders.append(o2)
- not_in_(o1, sess)
- not_in_(o2, sess)
+ not_in(o1, sess)
+ not_in(o2, sess)
def test_default_merge_cascade(self):
User, Order, orders, users = (
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
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)
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
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)
@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)
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
# 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")
# 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")
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
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)
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 import pickleable
is_(s._transaction, None)
s.execute(select(1))
- is_not_(s._transaction, None)
+ is_not(s._transaction, None)
s.commit()
is_(s._transaction, None)
s.execute(select(1))
- is_not_(s._transaction, None)
+ is_not(s._transaction, None)
s.close()
is_(s._transaction, None)
s.execute(select(1))
- is_not_(s._transaction, None)
+ is_not(s._transaction, None)
s.close()
is_(s._transaction, None)
s.add(User(id=1, name="name"))
s.flush()
- is_not_(s._transaction, None)
+ is_not(s._transaction, None)
s.commit()
is_(s._transaction, None)
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
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)
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.util import gc_collect
from test.orm._fixtures import FixtureTest
eq_(trans._state, _session.CLOSED)
# outermost transaction is new
- is_not_(session._transaction, trans)
+ is_not(session._transaction, trans)
is_(session._transaction, None)
eq_(session.is_active, True)
session.add(User(name="ed"))
session.transaction.commit()
- is_not_(session.transaction, None)
+ is_not(session.transaction, None)
def test_no_autocommit_with_explicit_commit_future(self):
User, users = self.classes.User, self.tables.users
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)
s1.commit()
eq_(s1.connection().scalar(select(func.count()).select_from(users)), 1)
- is_not_(s1.transaction, None)
+ is_not(s1.transaction, None)
def test_session_as_ctx_manager_one(self):
users = self.tables.users
with Session(testing.db) as sess:
- is_not_(sess.transaction, None)
+ is_not(sess.transaction, None)
sess.connection().execute(
users.insert().values(id=1, name="user1")
sess.connection().execute(users.select()).all(), [(1, "user1")]
)
- is_not_(sess.transaction, None)
+ is_not(sess.transaction, None)
- is_not_(sess.transaction, None)
+ is_not(sess.transaction, None)
# did not commit
eq_(sess.connection().execute(users.select()).all(), [])
sess.connection().execute(users.select()).all(), [(1, "user1")]
)
- is_not_(sess.transaction, None)
+ is_not(sess.transaction, None)
is_(sess.transaction, None)
try:
with Session(testing.db) as sess:
- is_not_(sess.transaction, None)
+ is_not(sess.transaction, None)
sess.connection().execute(
users.insert().values(id=1, name="user1")
raise Exception("force rollback")
except:
pass
- is_not_(sess.transaction, None)
+ is_not(sess.transaction, None)
def test_session_as_ctx_manager_two_future(self):
users = self.tables.users
from sqlalchemy.testing import eq_
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.assertsql import CompiledSQL
from sqlalchemy.testing.schema import Column
from sqlalchemy.testing.schema import Table
)
in_(john, sess)
- not_in_(jack, sess)
+ not_in(jack, sess)
in_(jill, sess)
- not_in_(jane, sess)
+ not_in(jane, sess)
def test_delete_fetch_returning_lambda(self):
User = self.classes.User
)
in_(john, sess)
- not_in_(jack, sess)
+ not_in(jack, sess)
in_(jill, sess)
- not_in_(jane, sess)
+ not_in(jane, sess)
def test_update_with_filter_statement(self):
"""test for [ticket:4556] """
from sqlalchemy.testing import fixtures
from sqlalchemy.testing import is_
from sqlalchemy.testing import is_false
-from sqlalchemy.testing import is_not_
+from sqlalchemy.testing import is_not
from sqlalchemy.testing import is_true
from sqlalchemy.testing import ne_
from sqlalchemy.testing.util import random_choices
ck2 = s2._generate_cache_key()
ne_(ck1, ck2)
- is_not_(ck1, None)
- is_not_(ck2, None)
+ is_not(ck1, None)
+ is_not(ck2, None)
def test_generative_cache_key_regen_w_del(self):
t1 = table("t1", column("a"), column("b"))
ck3 = s3._generate_cache_key()
ne_(ck1, ck3)
- is_not_(ck1, None)
- is_not_(ck3, None)
+ is_not(ck1, None)
+ is_not(ck3, None)
class CompareAndCopyTest(CoreFixtures, fixtures.TestBase):
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):
t2 = t.to_metadata(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)
from sqlalchemy.testing import in_
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.schema import Column
from sqlalchemy.testing.schema import Table
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)
with testing.expect_deprecated(
"Retrieving row values using Column objects "
row = connection.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)
with testing.expect_deprecated(
"Retrieving row values using Column objects "
"with only matching names"
row = connection.execute(content.select().apply_labels()).first()
in_(content.c.type, row._mapping)
- not_in_(bar.c.content_type, row)
+ not_in(bar.c.content_type, row)
with testing.expect_deprecated(
"Retrieving row values using Column objects "
"with only matching names"
):
in_(content.c.type, row)
- not_in_(bar.c.content_type, row)
+ not_in(bar.c.content_type, row)
with testing.expect_deprecated(
"Retrieving row values using Column objects "
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)
with testing.expect_deprecated(
"Retrieving row values using Column objects "
in_("user_name", r)
# no warning if the key is not there
- not_in_("foobar", r)
+ not_in("foobar", r)
# this seems to happen only with Python BaseRow
# with testing.expect_deprecated(
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
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(
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):
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):
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):
is_(a1_to_a2.columns[t2.c.col1], stmt2.c.table2_col1)
# check that these aren't the same column
- is_not_(stmt2.c.col1, stmt2.c.table2_col1)
+ is_not(stmt2.c.col1, stmt2.c.table2_col1)
# for mutually exclusive columns, order doesn't matter
is_(a2_to_a1.columns[t1.c.col1], stmt2.c.table1_col1)
select_copy,
"SELECT table1.col1, table1.col2, " "table1.col3, yyy FROM table1",
)
- is_not_(s.selected_columns, select_copy.selected_columns)
- is_not_(s._raw_columns, select_copy._raw_columns)
+ is_not(s.selected_columns, select_copy.selected_columns)
+ is_not(s._raw_columns, select_copy._raw_columns)
self.assert_compile(
s, "SELECT table1.col1, table1.col2, " "table1.col3 FROM table1"
)
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
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(
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,
from sqlalchemy.testing import is_true
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
row = connection.execute(content.select(use_labels=True)).first()
in_(content.c.type, row._mapping)
- not_in_(bar.c.content_type, row._mapping)
+ not_in(bar.c.content_type, row._mapping)
- not_in_(bar.c.content_type, row._mapping)
+ not_in(bar.c.content_type, row._mapping)
row = connection.execute(
select([func.now().label("content_type")])
).first()
- not_in_(content.c.type, row._mapping)
+ not_in(content.c.type, row._mapping)
- not_in_(bar.c.content_type, row._mapping)
+ not_in(bar.c.content_type, row._mapping)
def test_pickled_rows(self, connection):
users = self.tables.users
).first()
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._fields), ["users.user_id", "users.user_name"])
else:
- not_in_("users.user_id", r._mapping)
- not_in_("users.user_name", r._mapping)
+ not_in("users.user_id", r._mapping)
+ not_in("users.user_name", r._mapping)
eq_(r._mapping["user_id"], 1)
eq_(r._mapping["user_name"], "john")
eq_(r._mapping["users.user_id"], 1)
eq_(r._mapping["users.user_name"], "john")
else:
- not_in_("users.user_id", r._mapping)
- not_in_("users.user_name", r._mapping)
+ not_in("users.user_id", r._mapping)
+ not_in("users.user_name", r._mapping)
eq_(list(r._fields), ["user_id", "user_name"])
).first()
eq_(r._mapping["users.user_id"], 1)
eq_(r._mapping["users.user_name"], "john")
- not_in_("user_name", r._mapping)
+ not_in("user_name", r._mapping)
eq_(list(r._fields), ["users.user_id", "users.user_name"])
def test_column_accessor_unary(self, connection):
in_("case_insensitive", row._keymap)
in_("CaseSensitive", row._keymap)
- not_in_("casesensitive", row._keymap)
+ not_in("casesensitive", row._keymap)
eq_(row._mapping["case_insensitive"], 1)
eq_(row._mapping["CaseSensitive"], 2)
in_("case_insensitive", row._keymap)
in_("CaseSensitive", row._keymap)
- not_in_("casesensitive", row._keymap)
+ not_in("casesensitive", row._keymap)
eq_(row._mapping["case_insensitive"], 1)
eq_(row._mapping["CaseSensitive"], 2)
eq_(keys, ["user_id", "user_name"])
ne_(keys, ["user_name", "user_id"])
in_("user_id", keys)
- not_in_("foo", keys)
+ not_in("foo", keys)
in_(users.c.user_id, keys)
- not_in_(0, keys)
- not_in_(addresses.c.user_id, keys)
- not_in_(addresses.c.address, keys)
+ not_in(0, keys)
+ not_in(addresses.c.user_id, keys)
+ not_in(addresses.c.address, keys)
if isinstance(obj, Row):
eq_(obj._fields, ("user_id", "user_name"))
eq_(row._fields, ("user_id", "user_name"))
in_("user_id", row.keys())
- not_in_("foo", row.keys())
+ not_in("foo", row.keys())
in_(users.c.user_id, row.keys())
def test_row_keys_legacy_dont_warn(self, connection):
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 import ne_
):
eq_(elem, {})
- is_not_(b2.left, bin_.left)
- is_not_(b3.left, b2.left)
- is_not_(b2.left, bin_.left)
+ is_not(b2.left, bin_.left)
+ is_not(b3.left, b2.left)
+ is_not(b2.left, bin_.left)
is_(b4.left, bin_.left) # since column is immutable
# deannotate copies the element
- is_not_(bin_.right, b2.right)
- is_not_(b2.right, b3.right)
- is_not_(b3.right, b4.right)
+ is_not(bin_.right, b2.right)
+ is_not(b2.right, b3.right)
+ is_not(b3.right, b4.right)
def test_deannotate_clone(self):
table1 = table("table1", column("col1"), column("col2"))
eq_(s3._raw_columns[0]._annotations, {})
eq_(s4._raw_columns[0]._annotations, {})
- is_not_(s3, s2)
- is_not_(s4, s3) # deep deannotate makes a clone unconditionally
+ is_not(s3, s2)
+ is_not(s4, s3) # deep deannotate makes a clone unconditionally
is_(s3._deannotate(), s3) # regular deannotate returns same object
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
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()