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
I used the GitHub search to find a similar question and didn't find it.
I searched in the documentation/README.
I already searched in Google "How to do X" and didn't find any information.
I already read and followed all the tutorial in the docs/README and didn't find an answer.
Commit to Help
I commit to help with one of those options 👆
Example Code
# run the tests against python 3.12
Description
Hello, I noticed that on python3.12 the following tests fail: test_backend_pre_start.py and test_test_pre_start.py
with the error:
FAILED app/tests/scripts/test_backend_pre_start.py::test_init_successful_connection - AttributeError: 'called_once_with' is not a valid assertion. Use a spec for the mock if 'called_once_with' is meant to be an attribute.. Did you mean: 'assert_called_once_with'?
FAILED app/tests/scripts/test_test_pre_start.py::test_init_successful_connection - AttributeError: 'called_once_with' is not a valid assertion. Use a spec for the mock if 'called_once_with' is meant to be an attribute.. Did you mean: 'assert_called_once_with'?
Operating System
Linux
Operating System Details
using base python:3.12 image
Python Version
Python 3.12.3
Additional Context
It seems to happens with the mock behaving differently and not mocking the sqlmodel.Session module, I am not sure yet if the mock lib has been bump, but so far I could not see anything mention of any relevant changes in either python or mock releases, also there is a lot of change, I might have miss some.
I noticed that the package sqlmodel.Session was not been mock so I tried using from app.core.model.Session, the mock then worked but the call is being done in __enter__ due to the with statement and the select(1) param doesnt match due to not being the same reference.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
First Check
Commit to Help
Example Code
Description
Hello, I noticed that on python3.12 the following tests fail:
test_backend_pre_start.py
andtest_test_pre_start.py
with the error:
Operating System
Linux
Operating System Details
using base python:3.12 image
Python Version
Python 3.12.3
Additional Context
It seems to happens with the mock behaving differently and not mocking the
sqlmodel.Session module
, I am not sure yet if the mock lib has been bump, but so far I could not see anything mention of any relevant changes in either python or mock releases, also there is a lot of change, I might have miss some.I noticed that the package
sqlmodel.Session
was not been mock so I tried using fromapp.core.model.Session
, the mock then worked but the call is being done in__enter__
due to thewith
statement and theselect(1)
param doesnt match due to not being the same reference.Beta Was this translation helpful? Give feedback.
All reactions