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

Method test_underscores

tests/test_dunders.py:396–408  ·  view source on GitHub ↗

repr does not strip underscores.

(self)

Source from the content-addressed store, hash-verified

394 assert "LongCycle(value=14, cycle={'cycle': [...]})" == repr(cycle)
395
396 def test_underscores(self):
397 """
398 repr does not strip underscores.
399 """
400
401 class C:
402 __attrs_attrs__ = [simple_attr("_x")]
403
404 C = _add_repr(C)
405 i = C()
406 i._x = 42
407
408 assert "C(_x=42)" == repr(i)
409
410 def test_repr_uninitialized_member(self):
411 """

Callers

nothing calls this directly

Calls 2

_add_reprFunction · 0.90
CClass · 0.70

Tested by

no test coverage detected