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