MCPcopy
hub / github.com/dask/dask / assert_slots_equal

Function assert_slots_equal

dask/tests/test_task_spec.py:251–262  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

249def test_pickle():
250
251 def assert_slots_equal(a, b):
252 def get_all_slots(obj):
253 slots = set()
254 for cls in obj.__class__.mro():
255 slots.update(getattr(cls, "__slots__", ()))
256 return slots
257
258 all_slots = get_all_slots(a) | get_all_slots(a)
259 assert all_slots == get_all_slots(a) == get_all_slots(a)
260 assert all(getattr(a, slot) == getattr(b, slot) for slot in all_slots)
261 assert not hasattr(a, "__dict__")
262 assert not hasattr(b, "__dict__")
263
264 t1 = Task("key-1", func, "a", "b")
265 t2 = Task("key-2", func, "c", "d")

Callers 1

test_pickleFunction · 0.85

Calls 2

get_all_slotsFunction · 0.85
allFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…