Test that the ensure_deterministic override is not lost if tokenize() is called recursively
()
| 382 | |
| 383 | |
| 384 | def nested_tokenize_ensure_deterministic(): |
| 385 | """Test that the ensure_deterministic override is not lost if tokenize() is |
| 386 | called recursively |
| 387 | """ |
| 388 | |
| 389 | class C: |
| 390 | def __dask_tokenize__(self): |
| 391 | return tokenize(object()) |
| 392 | |
| 393 | assert tokenize(C(), ensure_deterministic=False) != tokenize( |
| 394 | C(), ensure_deterministic=False |
| 395 | ) |
| 396 | with pytest.raises(TokenizationError): |
| 397 | tokenize(C()) |
| 398 | |
| 399 | |
| 400 | _GLOBAL = 1 |