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

Method test_no_init_order

tests/test_dunders.py:789–799  ·  view source on GitHub ↗

If an attribute is `init=False`, it's legal to come after a mandatory attribute.

(self, slots, frozen)

Source from the content-addressed store, hash-verified

787
788 @given(booleans(), booleans())
789 def test_no_init_order(self, slots, frozen):
790 """
791 If an attribute is `init=False`, it's legal to come after a mandatory
792 attribute.
793 """
794 make_class(
795 "C",
796 {"a": attr.ib(default=Factory(list)), "b": attr.ib(init=False)},
797 slots=slots,
798 frozen=frozen,
799 )
800
801 def test_sets_attributes(self):
802 """

Callers

nothing calls this directly

Calls 2

make_classFunction · 0.90
FactoryClass · 0.90

Tested by

no test coverage detected