-
Notifications
You must be signed in to change notification settings - Fork 351
Support read_concern in database.get_collection() #708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Remove test checking that read_concern is not supported.
Codecov Report
@@ Coverage Diff @@
## develop #708 +/- ##
==========================================
Coverage ? 95.33%
==========================================
Files ? 19
Lines ? 3665
Branches ? 0
==========================================
Hits ? 3494
Misses ? 171
Partials ? 0
Continue to review full report at Codecov.
|
|
Read concern is supported since 0.19.1 #628 |
|
@pcorpet would it be possible for you to find time to review and merge this change? |
|
Hi @m-aciek and thanks for your contribution. If we're going to go that way, please make it possible to use a However two things to do before removing those checks:
|
|
Thanks for looking into this. Read concern works already in I think read concern shouldn't make a difference when using one replica, which we are mocking. I wonder if I should bring a duck typing like in collection.with_options() (with using _WITH_OPTIONS_KWARGS) or just checking the type (first trying to import it from PyMongo, then from mongomock) is enough? |
|
You're right, I think we're fine like this. Pease cover the new lines with some new tests, and I'll merge it. |
30aaae6 to
ae37318
Compare
|
I've added missing test. I've added read concern type check support in Collection constructor (the constructor may be called in Database().get_collection() method). Also removed read concern type check from Collection().with_options() as it is now handled in the constructor. |
|
Pylint failure is not connected with changes here. I've added a new issue to track that: #709. Is there a way to retrigger Codecov check? |
Throw a TypeError for read concern of wrong type.
Throw a TypeError for read concern of wrong type. Move check from with_options() to underlying constructor.
|
Added test for database.read_concern attribute, added setting default ReadConcern() if no value provided. |
|
Thanks for all the cleanups and tests. |
This argument is passed to underlying methods, so effectively is supported, only check removal is required.