Skip to content

Commit ab265ae

Browse files
committed
Put test in a with clause to draw attention that mypy would catch the incorrect signature with [call-overload]
1 parent c971d84 commit ab265ae

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

test/test_bson.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -803,12 +803,11 @@ def test_vector(self):
803803
BinaryVector(list_vector, BinaryVectorDtype.FLOAT32)
804804
)
805805
# Confirm kwargs cannot be passed when BinaryVector is provided
806-
self.assertRaises(
807-
ValueError,
808-
Binary.from_vector,
809-
BinaryVector(list_vector, BinaryVectorDtype.PACKED_BIT, padding),
810-
{"dtype": BinaryVectorDtype.PACKED_BIT},
811-
)
806+
with self.assertRaises(ValueError):
807+
Binary.from_vector(
808+
BinaryVector(list_vector, BinaryVectorDtype.PACKED_BIT, padding),
809+
dtype=BinaryVectorDtype.PACKED_BIT,
810+
) # type: ignore[call-overload]
812811

813812
def test_unicode_regex(self):
814813
"""Tests we do not get a segfault for C extension on unicode RegExs.

0 commit comments

Comments
 (0)