-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.8
-
Component/s: None
-
None
When running in optimized mode, "assert" statements are removed.
https://www.safaribooksonline.com/library/view/learning-python-5th/9781449355722/ch34s05.html
So their usage should be fine in tests, but not in the main pymongo driver, which may or may not be used in optimized mode.
I'm running into some error conditions during heavy load, and I want them to throw an exception in optimized mode too, like this one:
https://github.com/mongodb/mongo-python-driver/blob/master/pymongo/cursor.py#L945
So for least surprise and reproducibility, I think they should be converted to proper, named Python exceptions.
Thanks!
- duplicates
-
PYTHON-895 AssertionError: Result batch started from 101, expected 0
- Closed