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

Method test_repr

tests/test_dunders.py:332–340  ·  view source on GitHub ↗

If `repr` is False, ignore that attribute.

(self, slots)

Source from the content-addressed store, hash-verified

330 """
331
332 def test_repr(self, slots):
333 """
334 If `repr` is False, ignore that attribute.
335 """
336 C = make_class(
337 "C", {"a": attr.ib(repr=False), "b": attr.ib()}, slots=slots
338 )
339
340 assert "C(b=2)" == repr(C(1, 2))
341
342 @pytest.mark.parametrize("cls", [ReprC, ReprCSlots])
343 def test_repr_works(self, cls):

Callers

nothing calls this directly

Calls 2

make_classFunction · 0.90
CClass · 0.70

Tested by

no test coverage detected