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