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

Method test_additional_class_body

tests/test_make.py:1458–1468  ·  view source on GitHub ↗

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 """
1460 Additional class_body is added to newly created class.
1461 """
1462
1463 def echo_func(cls, *args):
1464 return args
1465
1466 cls = make_class("C", {}, class_body={"echo": classmethod(echo_func)})
1467
1468 assert ("a", "b") == cls.echo("a", "b")
1469
1470 def test_clean_class(self, slots):
1471 """

Callers

nothing calls this directly

Calls 1

make_classFunction · 0.90

Tested by

no test coverage detected