MCPcopy Create free account
hub / github.com/dask/dask / test_tokenize_circular_recursion

Function test_tokenize_circular_recursion

dask/tests/test_tokenize.py:1086–1109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1084
1085
1086def test_tokenize_circular_recursion():
1087 a = [1, 2]
1088 a[0] = a
1089
1090 # Test that tokenization doesn't stop as soon as you hit the circular recursion
1091 b = [1, 3]
1092 b[0] = b
1093
1094 assert check_tokenize(a) != check_tokenize(b)
1095
1096 # Different circular recursions tokenize differently
1097 c = [[], []]
1098 c[0].append(c[0])
1099 c[1].append(c[1])
1100
1101 d = [[], []]
1102 d[0].append(d[1])
1103 d[1].append(d[0])
1104 assert check_tokenize(c) != check_tokenize(d)
1105
1106 # For dicts, the dict itself is not passed to _normalize_seq_func
1107 e = {}
1108 e[0] = e
1109 check_tokenize(e)
1110
1111
1112@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

check_tokenizeFunction · 0.85

Tested by

no test coverage detected