From 1b256383b0ae7bfc290d9a2d722b38694cc1555f Mon Sep 17 00:00:00 2001 From: stankudrow Date: Wed, 18 Dec 2024 23:12:22 +0300 Subject: [PATCH] add __test__ attribute --- tests/test_object.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/test_object.py b/tests/test_object.py index 9683b96..19300f9 100644 --- a/tests/test_object.py +++ b/tests/test_object.py @@ -4,7 +4,9 @@ from bson import BSONCoding, dumps, loads, import_class -class _TestData(BSONCoding): +class TestData(BSONCoding): + __test__ = False + def __init__(self, *args): self.args = list(args) self.nested = None @@ -17,7 +19,7 @@ def bson_init(self, raw_values): self.nested = raw_values["nested"] def __eq__(self, other): - if not isinstance(other, _TestData): + if not isinstance(other, TestData): return NotImplemented if self.args != other.args: return False @@ -31,12 +33,12 @@ def __ne__(self, other): class TestObjectCoding(TestCase): def test_codec(self): - import_class(_TestData) - data = _TestData(u"Lorem ipsum dolor sit amet", + import_class(TestData) + data = TestData(u"Lorem ipsum dolor sit amet", "consectetur adipisicing elit", 42) - data2 = _TestData(u"She's got both hands in her pockets", + data2 = TestData(u"She's got both hands in her pockets", "and she won't look at you won't look at you eh", 66, 23.54,