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

Method test_additional_class_body

tests/test_make.py:1458–1468  ·  tests/test_make.py::TestMakeClass.test_additional_class_body

Additional class_body is added to newly created class.

(self)

Source from the content-addressed store, hash-verified

1456 assert isinstance(cls(), D)
1457
1458 def test_additional_class_body(self):
1459 class="st">"""
1460 Additional class_body is added to newly created class.
1461 class="st">"""
1462
1463 def echo_func(cls, *args):
1464 return args
1465
1466 cls = make_class(class="st">"C", {}, class_body={class="st">"echo": classmethod(echo_func)})
1467
1468 assert (class="st">"a", class="st">"b") == cls.echo(class="st">"a", class="st">"b")
1469
1470 def test_clean_class(self, slots):
1471 class="st">"""

Callers

nothing calls this directly

Calls 1

make_classFunction · 0.90

Tested by

no test coverage detected