MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_key_index_error

Method test_key_index_error

test/base/test_utils.py:797–806  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

795 eq_(list(sub_cc), [c3, c2])
796
797 def test_key_index_error(self):
798 cc = self._column_collection(
799 columns=[
800 ("col1", sql.column("col1")),
801 ("col2", sql.column("col2")),
802 ]
803 )
804 assert_raises(KeyError, lambda: cc["foo"])
805 assert_raises(KeyError, lambda: cc[object()])
806 assert_raises(IndexError, lambda: cc[5])
807
808 def test_contains_column(self):
809 c1, c2, c3 = sql.column("c1"), sql.column("c2"), sql.column("c3")

Callers

nothing calls this directly

Calls 3

assert_raisesFunction · 0.90
_column_collectionMethod · 0.45
columnMethod · 0.45

Tested by

no test coverage detected