Test that calling tokenize() recursively doesn't alter the output due to memoization of already-seen objects
()
| 842 | |
| 843 | |
| 844 | def test_nested_tokenize_seen(): |
| 845 | """Test that calling tokenize() recursively doesn't alter the output due to |
| 846 | memoization of already-seen objects |
| 847 | """ |
| 848 | o = [1, 2, 3] |
| 849 | |
| 850 | class C: |
| 851 | def __init__(self, x): |
| 852 | self.x = x |
| 853 | self.tok = None |
| 854 | |
| 855 | def __dask_tokenize__(self): |
| 856 | if not self.tok: |
| 857 | self.tok = tokenize(self.x) |
| 858 | return self.tok |
| 859 | |
| 860 | c1, c2 = C(o), C(o) |
| 861 | check_tokenize(o, c1, o) |
| 862 | assert c1.tok |
| 863 | assert check_tokenize(c1) == check_tokenize(c2) |
| 864 | |
| 865 | |
| 866 | def test_tokenize_dict(): |
nothing calls this directly
no test coverage detected