MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_key_index_error

Method test_key_index_error

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

Source from the content-addressed store, hash-verified

890 eq_(list(sub_cc), [c3, c2])
891
892 def test_key_index_error(self):
893 cc = self._column_collection(
894 columns=[
895 ("col1", sql.column("col1")),
896 ("col2", sql.column("col2")),
897 ]
898 )
899 assert_raises(KeyError, lambda: cc["foo"])
900 assert_raises(KeyError, lambda: cc[object()])
901 assert_raises(IndexError, lambda: cc[5])
902
903 def test_contains_column(self):
904 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