(cls_name)
| 1058 | @pytest.mark.skipif("not sp") |
| 1059 | @pytest.mark.parametrize("cls_name", ("dok",)) |
| 1060 | def test_tokenize_dense_sparse_array(cls_name): |
| 1061 | rng = np.random.RandomState(1234) |
| 1062 | |
| 1063 | a = sp.rand(10, 100, random_state=rng).asformat(cls_name) |
| 1064 | b = a.copy() |
| 1065 | |
| 1066 | assert check_tokenize(a) == check_tokenize(b) |
| 1067 | |
| 1068 | # modifying the data values |
| 1069 | if hasattr(b, "data"): |
| 1070 | b.data[:10] = 1 |
| 1071 | elif cls_name == "dok": |
| 1072 | b[3, 3] = 1 |
| 1073 | else: |
| 1074 | raise ValueError |
| 1075 | check_tokenize(b) |
| 1076 | assert check_tokenize(a) != check_tokenize(b) |
| 1077 | |
| 1078 | # modifying the data indices |
| 1079 | b = a.copy().asformat("coo") |
| 1080 | b.row[:10] = np.arange(10) |
| 1081 | b = b.asformat(cls_name) |
| 1082 | assert check_tokenize(a) != check_tokenize(b) |
| 1083 | |
| 1084 | |
| 1085 | def test_tokenize_circular_recursion(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…