MCPcopy
hub / github.com/celery/celery / test_same_as_repr

Method test_same_as_repr

t/unit/utils/test_saferepr.py:167–177  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

165 range(10, -11, -1)
166 ])
167 def test_same_as_repr(self, value):
168 # Simple objects, small containers, and classes that overwrite __repr__
169 # For those the result should be the same as repr().
170 # Ahem. The docs don't say anything about that -- this appears to
171 # be testing an implementation quirk. Starting in Python 2.5, it's
172 # not true for dicts: pprint always sorts dicts by key now; before,
173 # it sorted a dict display if and only if the display required
174 # multiple lines. For that reason, dicts with more than one element
175 # aren't tested here.
176 native = old_repr(value)
177 assert saferepr(value) == native
178
179 def test_single_quote(self):
180 val = {"foo's": "bar's"}

Callers

nothing calls this directly

Calls 2

safereprFunction · 0.90
old_reprFunction · 0.85

Tested by

no test coverage detected