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

Method test_empty

tests/test_funcs.py:660–673  ·  view source on GitHub ↗

Empty classes without changes get copied.

(self, slots, frozen)

Source from the content-addressed store, hash-verified

658
659 @given(slots=st.booleans(), frozen=st.booleans())
660 def test_empty(self, slots, frozen):
661 """
662 Empty classes without changes get copied.
663 """
664
665 @attr.s(slots=slots, frozen=frozen)
666 class C:
667 pass
668
669 i1 = C()
670 i2 = evolve(i1)
671
672 assert i1 is not i2
673 assert i1 == i2
674
675 @given(simple_classes())
676 def test_no_changes(self, C):

Callers

nothing calls this directly

Calls 2

evolveFunction · 0.90
CClass · 0.70

Tested by

no test coverage detected