Commit Graph

83 Commits

Author SHA1 Message Date
Iris
65089ead4c
PYTHON-5386 Better test assertions for isinstance (#2347) 2025-05-22 16:15:44 -07:00
Noah Stapp
c8d3afdefd
PYTHON-5086 - Convert test.json_util integration test to async (#2102) 2025-01-30 16:30:04 -05:00
Shane Harvey
32269aac1e
PYTHON-4885 Fix legacy extended JSON encoding of DatetimeMS (#1986) 2024-10-31 14:01:30 -07:00
Shane Harvey
a2059dc9cb
PYTHON-4663 Fix compatibility with dateutil timezones (#1812) 2024-08-28 14:20:55 -07:00
Shane Harvey
296a44df46
PYTHON-4179 Verify document_class type in json_util.loads test (#1509) 2024-02-06 14:18:09 -08:00
Shane Harvey
b8d6bfdf08
PYTHON-4144 Optimize json_util encoding performance using single dispatch table (#1475) 2024-01-18 11:43:36 -08:00
Shane Harvey
72663deb33
PYTHON-4142 json_util.default should always convert Int64 (#1473) 2024-01-12 10:57:54 -08:00
Steven Silvester
7936708d97
PYTHON-4014 Apply QA Suggestions from Scientific Python Library Development Guide (#1414) 2023-11-01 19:37:22 -05:00
Steven Silvester
992d1507e7
PYTHON-4005 Replace flake8 and isort with ruff (#1399) 2023-10-19 11:56:22 -05:00
Julius Park
05845b8038
PYTHON-3562 Type annotation of bson.json_utils.loads is incorrect (only accepts str) (#1152) 2023-02-10 15:28:04 -08:00
Ben Warner
46673c3705
PYTHON-3379 Refactored DatetimeConversionOpts to DatetimeConversion (#1031) 2022-08-04 12:53:57 -07:00
Ben Warner
14002a5a0d
PYTHON-1824 Allow encoding/decoding out-of-range datetimes via DatetimeMS and datetime_conversion (#981)
https://jira.mongodb.org/browse/PYTHON-1824

Co-authored-by: Ben Warner <ben.warner@mongodb.com>
2022-07-27 16:53:52 -07:00
Steven Silvester
a0fe7c03af
PYTHON-3120 Set up flake8 linting (#868) 2022-02-17 06:44:08 -06:00
Steven Silvester
5578999a90
PYTHON-1834 Use a code formatter (#852) 2022-02-09 06:44:28 -06:00
Steven Silvester
f4cef37328
PYTHON-3064 Add typings to test package (#844) 2022-02-07 19:33:41 -06:00
Julius Park
70f7fe7542
PYTHON-3028 $regex as a field name does not allow for non-string values (#807) 2021-12-06 13:13:15 -08:00
Julius Park
e3771587c3
PYTHON-1949 CodecOptions and JSONOptions should have the same default value for tz_aware (#720) 2021-09-14 16:54:11 -07:00
Shane Harvey
fb20975a1f
PYTHON-2245 Change default uuidRepresentation to UNSPECIFIED (ie disable UUID encoding by default) (#724)
This change also stops decoding both 3 and 4 subtypes as UUIDs.
With standard, only subtype 4 is decoded to UUID and subtype 3 is decoded to Binary.
With legacy representations, only subtype 3 is decoded to UUID and subtype 4 is decoded to Binary.
2021-09-14 16:48:52 -07:00
Shane Harvey
fb38fbe35e
PYTHON-2046 Change default JSONMode and dumps output from LEGACY to RELAXED (#711) 2021-09-08 11:33:41 -07:00
Bernie Hackett
a72e8b8823 PYTHON-2133 Remove py2 support from test
Also delete bson/py3compat.py
2021-01-20 09:40:36 -08:00
Prashant Mital
963759af33
PYTHON-2354 Add support for JSONOptions.with_options (#482) 2020-09-09 14:15:21 -07:00
Prashant Mital
f24e165336
PYTHON-2263 Respect UuidRepresentation.UNSPECIFIED when parsing $uuid fields in extended JSON (#464) 2020-07-13 11:03:02 -07:00
Prashant Mital
4760d07815
PYTHON-2152 Expand native UUID handling support; Implement UUID specification 2020-06-01 17:45:08 -07:00
Shane Harvey
8855a510a8 PYTHON-1875 Fix parsing of json datetime without timezone or fractional seconds
{"$date": "2019-01-01T01:02:03"} is now parsed the same as
{"$date": "2019-01-01T01:02:03Z"},
{"$date": "2019-01-01T01:02:03.000"}, and
{"$date": "2019-01-01T01:02:03.000Z"}
2019-06-24 16:20:34 -07:00
Bernie Hackett
749c1a2f0b PYTHON-1467 - PyMongo no longer supports Python 2.6 2018-07-02 15:15:43 -07:00
Bernie Hackett
507f954ed4 Update copyright dates 2017-12-01 17:23:39 -08:00
Bernie Hackett
410027c057 PYTHON-1387 - Improve detection of object_pairs_hook support 2017-09-30 09:28:09 -07:00
Shane Harvey
e775295ab5 PYTHON-1367 Ignore uuid_representation when decoding BSON binary subtype 4. 2017-09-12 17:20:14 -07:00
Shane Harvey
6a11888a9c PYTHON-1330 Decode JSON binary type 0 to Python 3 bytes. 2017-07-31 13:16:46 -07:00
Shane Harvey
888d0fab1f PYTHON-1135 Replace JSONOptions.strict_date with JSONOptions.datetime_representation 2016-09-12 11:11:30 -07:00
Shane Harvey
b341474ef7 Fix failing datetime test
UTC ISO-8601 datetimes are now represented with 'Z' rather than '+0000'.
2016-08-24 15:25:37 -07:00
Luke Lovett
6692e8877a PYTHON-1131 - Fix inconsistent handling of scope, unicode support for Code. 2016-08-19 15:22:19 -07:00
Shane Harvey
6e2ecc1817 PYTHON-1111 JSONOptions.document_class requires simplejson in Python2.6 2016-08-01 10:05:16 -07:00
Shane Harvey
57d1ccde2f PYTHON-1111 Add JSONOptions for dumps and loads
PYTHON-767 Support JSON strict mode $date output
PYTHON-1039 Support JSON strict mode $numberLong output
PYTHON-1103 Support JSON strict mode UUID output
PYTHON-1111 Support custom document class in loads
PYTHON-1111 Support tz_aware and tzinfo in loads
Refactor milliseconds to datetime conversions
2016-07-27 11:32:59 -07:00
Bernie Hackett
59d8fdadc1 PYTHON-1058 - Support decoding datetime.isoformat format for $date
This change also adds support for the (+|-)HH offset format.
2016-05-20 13:12:47 -07:00
Bernie Hackett
4bbe2133a1 PYTHON-996 - Adjust regex tests for python 3.5 2015-09-22 15:17:50 -07:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
Bernie Hackett
bba49fd618 PYTHON-864 - Support RFC-3339 offset format for $date. 2015-03-20 16:23:55 -07:00
Bernie Hackett
30af616009 PYTHON-821 - Migrate most tests to new the CRUD API. 2015-02-13 08:46:43 -08:00
A. Jesse Jiryu Davis
beb2e412b0 Unused import 2014-12-05 15:38:40 -05:00
A. Jesse Jiryu Davis
32eecb5a91 Python 3 compatibility in TestJsonUtil.test_regex.
Removing "compile_re" means that Python 2 and 3 no longer behave differently,
remove test code that was specific to Python 3.
2014-12-05 15:37:16 -05:00
A. Jesse Jiryu Davis
2ba730722b PYTHON-526 Remove 'compile_re' option.
PyMongo now never attempts to compile BSON regular expressions as Python native
regular expressions.
2014-12-05 14:06:38 -05:00
A. Jesse Jiryu Davis
2c6483b348 Rely on standard json module.
Now that we've dropped Python 2.4 and 2.5, we know the standard json module is
available.
2014-12-03 16:32:41 -05:00
Bernie Hackett
5aee3e1b31 PYTHON-791 - Fix JSON support for Timestamp. 2014-11-21 14:35:48 -08:00
A. Jesse Jiryu Davis
5991635553 Unused imports in test files. 2014-11-17 16:15:12 -05:00
A. Jesse Jiryu Davis
c5eae2f99f Use replica set connection in tests wherever possible.
Most tests now inherit from IntegrationTest and use self.client for all MongoDB
operations. self.client is now a replica set connection if an RS is available,
otherwise a connection to a standalone.
2014-10-07 13:36:52 -04:00
Bernie Hackett
9c8852d93f PYTHON-760 - BSONInt64 -> Int64 2014-09-23 11:43:41 -07:00
Bernie Hackett
6595657128 PYTHON-759 - Support $date as ISO-8601 or $numberLong 2014-09-17 14:02:18 -07:00
Luke Lovett
35c7445a67 PYTHON-708 Support $undefined and $numberLong extended JSON types. 2014-07-18 16:46:35 +00:00
Luke Lovett
4fa96c6c2e PYTHON-683 Separate unit tests and integration tests in the pymongo test suite.
Raise SkipTest in tests that require a connection to MongoDB when none is available.
2014-06-30 17:42:29 +00:00