Here are the examples of the python api sqlalchemy_utils.get_bind taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
4 Examples
0
Example 1
def test_with_session(self, session, connection):
assert get_bind(session) == connection
0
Example 2
def test_with_connection(self, session, connection):
assert get_bind(connection) == connection
0
Example 3
Project: sqlalchemy-utils Source File: test_get_bind.py
def test_with_model_object(self, session, connection, Article):
article = Article()
session.add(article)
assert get_bind(article) == connection
0
Example 4
def test_with_unknown_type(self):
with pytest.raises(TypeError):
get_bind(None)