You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Register the mocked engine in the sqlalchemy.inspections._registrars dictionary. You would need to specialize the MagickMock class when setting up the db_engine to make sure we get a handle on just the mocked engine. something like:
Code that uses SQLAlchemy's Reflection facilities won't work with a monkey patched database engine.
code like this:
raises the error
sqlalchemy.exc.NoInspectionAvailable: No inspection system is available for object of type <class 'unittest.mock.MagicMock'>
The relevant SQLAlchemy code is here: https://github.com/sqlalchemy/sqlalchemy/blob/52e8545b2df312898d46f6a5b119675e8d0aa956/lib/sqlalchemy/sql/schema.py#L693-L718
it might be enough to
Register the mocked engine in the
sqlalchemy.inspections._registrars
dictionary. You would need to specialize the MagickMock class when setting up the db_engine to make sure we get a handle on just the mocked engine. something like:=
The text was updated successfully, but these errors were encountered: