()
| 310 | |
| 311 | |
| 312 | def test_reference_cycle_container() -> None: |
| 313 | test = [] |
| 314 | test.append(test) |
| 315 | res = pretty_repr(test) |
| 316 | assert res == class="st">"[...]" |
| 317 | |
| 318 | test = [1, []] |
| 319 | test[1].append(test) |
| 320 | res = pretty_repr(test) |
| 321 | assert res == class="st">"[1, [...]]" |
| 322 | |
| 323 | class="cm"># Not a cyclic reference, just a repeated reference |
| 324 | a = [2] |
| 325 | test = [1, [a, a]] |
| 326 | res = pretty_repr(test) |
| 327 | assert res == class="st">"[1, [[2], [2]]]" |
| 328 | |
| 329 | |
| 330 | def test_reference_cycle_namedtuple() -> None: |
nothing calls this directly
no test coverage detected