-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-1690: Fix error message when insert_many is given a single RawBSONDocument instead of a list #580
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
@prashantmital @ShaneHarvey thoughts on whether this requires a testing change? I was looking for tests for invalid input types and couldn't find any existing ones |
Yeah it would be great to add a test in |
added tests in the most recent commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🥳
Note that normally if you would have backported this commit to a branch that tested against Python 2.7, your tests would have failed because you are using assertRaisesRegex
where Py 2 called that same method assertRaisesRegexp
. Fortunately, our test setup code has a nifty tweak in place to prevent this from becoming a problem - see
mongo-python-driver/test/__init__.py
Line 822 in c40a455
# Use assertRaisesRegex if available, otherwise use Python 2.7's |
Please run the tests before pushing a backport to v3.12. I think the |
…BSONDocument instead of a list (mongodb#580) (cherry picked from commit 94f4de1) (cherry picked from commit 0ba1f7e)
…BSONDocument instead of a list (mongodb#580) (cherry picked from commit 94f4de1)
Changed type checking from
abc.Iterable
toabc.Sequence
in order to better match 'list-like' types