I'm trying to do a simple query with SQLAlchemy 1.4.17 from within pytest
def test_first():
engine = create_engine(settings.SQLALCHEMY_DATABASE_URI)
result = engine.execute(text("SELECT email FROM user"))
but am getting this error
Exception has occurred: MissingGreenlet
greenlet_spawn has not been called; can't call await_() here. Was IO attempted in an unexpected place? (Background on this error at: http://sqlalche.me/e/14/xd2s)
File "/Users/mattc/Development/inference/server/inference_server/app/tests/test_01_user.py", line 27, in test_first
result = engine.execute(text("SELECT email FROM user"))
and do not know why? Any suggestions?