MCPcopy
hub / github.com/python-attrs/attrs / test_bases

Method test_bases

tests/test_make.py:1441–1456  ·  tests/test_make.py::TestMakeClass.test_bases

Parameter bases default to (object,) and subclasses correctly

(self)

Source from the content-addressed store, hash-verified

1439 assert (class="st">"attrs argument must be a dict or a list.",) == e.value.args
1440
1441 def test_bases(self):
1442 class="st">"""
1443 Parameter bases default to (object,) and subclasses correctly
1444 class="st">"""
1445
1446 class D:
1447 pass
1448
1449 cls = make_class(class="st">"C", {})
1450
1451 assert cls.__mro__[-1] is object
1452
1453 cls = make_class(class="st">"C", {}, bases=(D,))
1454
1455 assert D in cls.__mro__
1456 assert isinstance(cls(), D)
1457
1458 def test_additional_class_body(self):
1459 class="st">"""

Callers

nothing calls this directly

Calls 1

make_classFunction · 0.90

Tested by

no test coverage detected