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

Method test_non_init_attrs

tests/test_funcs.py:757–767  ·  view source on GitHub ↗

evolve() handles `init=False` attributes.

(self)

Source from the content-addressed store, hash-verified

755 evolve(C(1), a=3, _a=2)
756
757 def test_non_init_attrs(self):
758 """
759 evolve() handles `init=False` attributes.
760 """
761
762 @attr.s
763 class C:
764 a = attr.ib()
765 b = attr.ib(init=False, default=0)
766
767 assert evolve(C(1), a=2).a == 2
768
769 def test_regression_attrs_classes(self):
770 """

Callers

nothing calls this directly

Calls 2

evolveFunction · 0.90
CClass · 0.70

Tested by

no test coverage detected