-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing of code with asyncio version of redis-om can't be done #527
Comments
Finally, in my project, I've used an overloaded db method, like this: models.py:
|
You can add the Meta class to change the connection parameters without needed a BaseClass
Remember to call |
It will be validated only once then, the unit-testing assumes that all the resources are reinitialized for each case. |
requirements.txt:
models.py:
func.py:
test_func.py:
outputs an error:
As you can see, the tests are the same, but the first is OK and the second fails.
Besides of that, if to debug, there will be an exception "got Future attached to a different loop".
But if I change the test it works ok, however, in a real project it could be problematic to do like this:
models_hacked.py:
The text was updated successfully, but these errors were encountered: