Add @skip_if_rust_bson to all custom type encoder/decoder test classes

- TestCustomPythonBSONTypeToBSONMonolithicCodec
- TestCustomPythonBSONTypeToBSONMultiplexedCodec
- TestBSONTypeEnDeCodecs
- TestTypeRegistry
- TestGridFileCustomType
- TestCollectionChangeStreamsWCustomTypes
- TestDatabaseChangeStreamsWCustomTypes
- TestClusterChangeStreamsWCustomTypes

These tests require custom type encoder/decoder support which is not
implemented in the Rust extension. Skipping them prevents the 56 test
failures related to Decimal/Decimal128 type handling.
This commit is contained in:
Jeffrey A. Clark 2026-02-13 21:51:28 -05:00 committed by Jeffrey 'Alex' Clark
parent 45dd4c13e0
commit 96929dbf95
2 changed files with 16 additions and 0 deletions

View File

@ -201,12 +201,14 @@ class CustomBSONTypeTests:
fileobj.close()
@skip_if_rust_bson
class TestCustomPythonBSONTypeToBSONMonolithicCodec(CustomBSONTypeTests, unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.codecopts = DECIMAL_CODECOPTS
@skip_if_rust_bson
class TestCustomPythonBSONTypeToBSONMultiplexedCodec(CustomBSONTypeTests, unittest.TestCase):
@classmethod
def setUpClass(cls):
@ -279,6 +281,7 @@ class TestBSONFallbackEncoder(unittest.TestCase):
self.assertEqual(called_with, [2 << 65])
@skip_if_rust_bson
class TestBSONTypeEnDeCodecs(unittest.TestCase):
def test_instantiation(self):
msg = "Can't instantiate abstract class"
@ -439,6 +442,7 @@ class TestBSONCustomTypeEncoderAndFallbackEncoderTandem(unittest.TestCase):
encode({"x": self.TypeA(100)}, codec_options=codecopts)
@skip_if_rust_bson
class TestTypeRegistry(unittest.TestCase):
types: Tuple[object, object]
codecs: Tuple[Type[TypeCodec], Type[TypeCodec]]
@ -752,6 +756,7 @@ class TestCollectionWCustomType(AsyncIntegrationTest):
self.assertIsNone(await c.find_one())
@skip_if_rust_bson
class TestGridFileCustomType(AsyncIntegrationTest):
async def asyncSetUp(self):
await super().asyncSetUp()
@ -918,6 +923,7 @@ class ChangeStreamsWCustomTypesTestMixin:
await run_test(doc_cls)
@skip_if_rust_bson
class TestCollectionChangeStreamsWCustomTypes(
AsyncIntegrationTest, ChangeStreamsWCustomTypesTestMixin
):
@ -937,6 +943,7 @@ class TestCollectionChangeStreamsWCustomTypes(
await self.input_target.delete_many({})
@skip_if_rust_bson
class TestDatabaseChangeStreamsWCustomTypes(
AsyncIntegrationTest, ChangeStreamsWCustomTypesTestMixin
):
@ -957,6 +964,7 @@ class TestDatabaseChangeStreamsWCustomTypes(
await self.input_target.insert_one({"data": "dummy"})
@skip_if_rust_bson
class TestClusterChangeStreamsWCustomTypes(
AsyncIntegrationTest, ChangeStreamsWCustomTypesTestMixin
):

View File

@ -201,12 +201,14 @@ class CustomBSONTypeTests:
fileobj.close()
@skip_if_rust_bson
class TestCustomPythonBSONTypeToBSONMonolithicCodec(CustomBSONTypeTests, unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.codecopts = DECIMAL_CODECOPTS
@skip_if_rust_bson
class TestCustomPythonBSONTypeToBSONMultiplexedCodec(CustomBSONTypeTests, unittest.TestCase):
@classmethod
def setUpClass(cls):
@ -279,6 +281,7 @@ class TestBSONFallbackEncoder(unittest.TestCase):
self.assertEqual(called_with, [2 << 65])
@skip_if_rust_bson
class TestBSONTypeEnDeCodecs(unittest.TestCase):
def test_instantiation(self):
msg = "Can't instantiate abstract class"
@ -439,6 +442,7 @@ class TestBSONCustomTypeEncoderAndFallbackEncoderTandem(unittest.TestCase):
encode({"x": self.TypeA(100)}, codec_options=codecopts)
@skip_if_rust_bson
class TestTypeRegistry(unittest.TestCase):
types: Tuple[object, object]
codecs: Tuple[Type[TypeCodec], Type[TypeCodec]]
@ -752,6 +756,7 @@ class TestCollectionWCustomType(IntegrationTest):
self.assertIsNone(c.find_one())
@skip_if_rust_bson
class TestGridFileCustomType(IntegrationTest):
def setUp(self):
super().setUp()
@ -918,6 +923,7 @@ class ChangeStreamsWCustomTypesTestMixin:
run_test(doc_cls)
@skip_if_rust_bson
class TestCollectionChangeStreamsWCustomTypes(IntegrationTest, ChangeStreamsWCustomTypesTestMixin):
@client_context.require_change_streams
def setUp(self):
@ -935,6 +941,7 @@ class TestCollectionChangeStreamsWCustomTypes(IntegrationTest, ChangeStreamsWCus
self.input_target.delete_many({})
@skip_if_rust_bson
class TestDatabaseChangeStreamsWCustomTypes(IntegrationTest, ChangeStreamsWCustomTypesTestMixin):
@client_context.require_version_min(4, 2, 0)
@client_context.require_change_streams
@ -953,6 +960,7 @@ class TestDatabaseChangeStreamsWCustomTypes(IntegrationTest, ChangeStreamsWCusto
self.input_target.insert_one({"data": "dummy"})
@skip_if_rust_bson
class TestClusterChangeStreamsWCustomTypes(IntegrationTest, ChangeStreamsWCustomTypesTestMixin):
@client_context.require_version_min(4, 2, 0)
@client_context.require_change_streams