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

Method test_dict

tests/test_make.py:1367–1380  ·  tests/test_make.py::TestMakeClass.test_dict

Passing a dict of name: _CountingAttr creates an equivalent class.

(self)

Source from the content-addressed store, hash-verified

1365 assert C1.__attrs_attrs__ == C2.__attrs_attrs__
1366
1367 def test_dict(self):
1368 class="st">"""
1369 Passing a dict of name: _CountingAttr creates an equivalent class.
1370 class="st">"""
1371 C1 = make_class(
1372 class="st">"C1", {class="st">"a": attr.ib(default=42), class="st">"b": attr.ib(default=None)}
1373 )
1374
1375 @attr.s
1376 class C2:
1377 a = attr.ib(default=42)
1378 b = attr.ib(default=None)
1379
1380 assert C1.__attrs_attrs__ == C2.__attrs_attrs__
1381
1382 def test_attr_args(self):
1383 class="st">"""

Callers

nothing calls this directly

Calls 1

make_classFunction · 0.90

Tested by

no test coverage detected