-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
Test is failing with the following trace:
bson.errors.InvalidBSON: year -140744 is out of range During handling of the above exception, another exception occurred: self = <test.test_bson.TestDatetimeConversion testMethod=test_millis_from_datetime_ms> def test_millis_from_datetime_ms(self): # Test 65+ bit integer conversion, expect OverflowError. big_ms = 2**65 with self.assertRaises(OverflowError): encode({"x": DatetimeMS(big_ms)}) # Subclass of DatetimeMS w/ __int__ override, expect an Error. class DatetimeMSOverride(DatetimeMS): def __int__(self): return float(self._value) float_ms = DatetimeMSOverride(2) with self.assertRaises(TypeError): encode({"x": float_ms}) # Test InvalidBSON errors on conversion include _DATETIME_ERROR_SUGGESTION small_ms = -2 << 51 > with self.assertRaisesRegex(InvalidBSON, re.compile(re.escape(_DATETIME_ERROR_SUGGESTION))): E AssertionError: "\(Consider\ Using\ CodecOptions\(datetime_conversion=DATETIME_AUTO\)\ or\ MongoClient\(datetime_conversion='DATETIME_AUTO'\)\)\.\ See:\ https://pymongo\.readthedocs\.io/en/stable/examples/datetimes\.html\#handling\-out\-of\-range\-datetimes" does not match "year -140744 is out of range" test/test_bson.py:1314: AssertionError