Skip to content

Commit

Permalink
add __test__ attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
stankudrow committed Dec 18, 2024
1 parent 79dd9ab commit 1b25638
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/test_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 1b25638

Please sign in to comment.