Closed amks1 closed 1 month ago
Have you tried using freezegun for your tests? It may be more reliable than mocking out datetimes with unittest.mock.patch
. Especially since you can ignore specific libraries. It may be helpful to ignore grpc
here, or python-firestore
. Maybe experiment with that
That said, I'm going to close this as Won't Fix
. It's expected that you may run into problems when replacing functionality of core standard libraries in your tests, and there's nothing we can do at the python-firestore
level to guard against that. You may just have to adjust your tests to make sure the mocking is more targeted, so grpc isn't trying to make requests from the future
I have 2 Firebase projects: one production and the other for development. I use the development one for my unit tests, which has been working perfectly until recently. However now I'm facing issues at the places in my unit tests where I mock the date and time.
Code
Stack trace
Running test.py gives the error:
Environment details
google-cloud-firestore
version: 2.16.0