10 Commits

Author SHA1 Message Date
Bastien Gerard
ef57a58155 housekeeping - pre-commit autoupdate 2021-04-22 10:18:15 +02:00
Bastien Gerard
8a1a68ea7c fix flake8 warnings 2020-12-13 00:14:53 +01:00
Bastien Gérard
421e3f324f Drop python2 support 2020-03-09 00:18:52 +01:00
Bastien Gérard
9166ba91d7 fix minor styling issue 2019-12-14 16:11:59 +01:00
Bastien Gérard
44b7f792fe fix benchmarks prints 2019-12-13 23:52:59 +01:00
Bastien Gérard
a3e432eb68 remove references to '2to3' in doc, travis, etc 2019-12-13 23:46:13 +01:00
Stefan Wójcik
b47669403b
Format the codebase using Black (#2109)
This commit:
1. Formats all of our existing code using `black`.
2. Adds a note about using `black` to `CONTRIBUTING.rst`.
3. Runs `black --check` as part of CI (failing builds that aren't properly formatted).
2019-06-27 13:05:54 +02:00
Stefan Wojcik
6527b1386f Benchmarks: Python 3 tweaks + more consistent testing of small vs big docs 2019-06-17 09:31:51 +02:00
Stefan Wojcik
008bb19b0b Add a test covering basic Document operations
It covers operations such as:
1. Document initialization.
2. Accessing/setting attributes on a Document instance.
3. Serializing a Document instance (via `to_mongo`).
4. Deserializing a Document instance (via `_from_son`).
5. Serializing + saving a Document in the database (via `save`).
5. Loading a Document from the database + deserializing (via `Doc.objects[0]`).

And it does so for both basic flat documents and more complex nested docs.
2019-06-14 11:59:41 +02:00
Stefan Wojcik
023acab779 Clean up benchmark.py and move it to benchmarks/test_inserts.py
1. Removes the cascade=save tests. It's not an option I'd recommend using AND
   it primarily matters if you have any reference fields in your document,
   which is not the case in this script.
2. Uses PyMongo-v3.x-style write concern.
3. Removes an old docstring describing some random benchmark run from the past.
4. Removes unused parts of the code.

I'll add more tests to the "benchmarks/" directory in future commits.
2019-06-14 11:59:41 +02:00