You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`pymongo/synchronous/` — sync driver (MongoClient, Collection, etc.) generated from `pymongo/asynchronous/` using `just synchro`
18
17
-`bson/` — BSON implementation
19
18
-`gridfs/` — GridFS API
20
-
-`test/` — sync test suite
21
-
-`test/asynchronous/` — async test suite, mirrors `test/`
19
+
-`test/asynchronous/` — async test suite
20
+
-`test/` — sync test suite (generated from `test/asynchronous/` by `just synchro`) and shared test suite
22
21
-`test/unified_format/` — cross-driver spec tests (Unified Test Format)
23
-
-`tools/convert_test_to_async.py` — generates async test stubs from sync tests
22
+
23
+
Do not edit files in `pymongo/synchronous/` or mirrored files in `test/` directly: they are generated by `just synchro` from `pymongo/asynchronous/` and `test/asynchronous/`.
24
+
A file in `test/` is mirrored if a file of the same name exists in `test/asynchronous/`.
24
25
25
26
## Commands
26
27
```bash
27
-
just install # set up venv + pre-commit hook
28
-
just typing-mypy # type check
29
-
just run lint-manual # ruff linter
30
-
31
-
hatch run test:test # run sync tests
32
-
hatch run test:test-async # run async tests
33
-
34
-
MONGODB_VERSION=8.0 just run-server # start a local MongoDB server
28
+
just install # set up venv + pre-commit hooks
29
+
just typing # type check
30
+
just lint-manual # pre-commit linting and synchro
31
+
just synchro # generate synchronous driver and mirrored tests
32
+
just test# run all tests
33
+
just test test/asynchronous # run async tests
34
+
MONGODB_VERSION=8.0 just run-server # start a local MongoDB 8.0 server
35
35
```
36
36
37
37
## Testing
38
38
Tests require a live MongoDB server (`just run-server` above).
39
39
40
-
Never modify pymongo/synchronous code first; update the async counterpart and run our `tools/synchro.py` script:
41
-
1. Make changes in `pymongo/asynchronous` or top-level `pymongo/` files and `test/`.
42
-
2. Run `tools/convert_test_to_async.py` on the sync test file to generate a starting-point async version.
43
-
3. Manually complete the async version in `test/asynchronous/`.
44
-
45
-
Do not edit files in `pymongo/synchronous/` or mirrored files in `test/` directly — they are auto-generated by `tools/synchro.py` from `pymongo/asynchronous/` and `test/asynchronous/`. Only edit them if the change includes a `_IS_SYNC` statement.
46
-
47
40
Async functions must not call blocking I/O.
48
41
49
42
New features need integration tests. Bug fixes need regression tests.
0 commit comments