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'm trying to write tests for functions that rely on using object IDs. These work fine when running normally, but while writing unit tests for the functions I noticed that using object IDs doesn't work when using mongomock.
This is a very important feature for our project and we need robust unit tests for it to make sure everything works. With this issue present in mongomock, it is not possible. I hope you can get this fixed soon!
The text was updated successfully, but these errors were encountered:
I tried to isolate and reproduce the problem you described, but I couldn't. Here is the code I used in my test. I removed all pieces of code not relevant to the described issue. Tested on Python 3.12 and both mongomock 4.0.0 and 4.1.2
The test passes, so it doesn't seem to be an issue with the mongomock. I suggest you check if the MongoClient object you set in a mock and one you access later are the same object. The way you set up the test and use global module to store and retrieve the client suggests me the problem could be with the mocking.
I'm trying to write tests for functions that rely on using object IDs. These work fine when running normally, but while writing unit tests for the functions I noticed that using object IDs doesn't work when using mongomock.
Here is some code I have:
This is a very important feature for our project and we need robust unit tests for it to make sure everything works. With this issue present in mongomock, it is not possible. I hope you can get this fixed soon!
The text was updated successfully, but these errors were encountered: