MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_callbacks

Function test_callbacks

lib/matplotlib/tests/test_artist.py:355–370  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

353
354
355def test_callbacks():
356 def func(artist):
357 func.counter += 1
358
359 func.counter = 0
360
361 art = martist.Artist()
362 oid = art.add_callback(func)
363 assert func.counter == 0
364 art.pchanged() # must call the callback
365 assert func.counter == 1
366 art.set_zorder(10) # setting a property must also call the callback
367 assert func.counter == 2
368 art.remove_callback(oid)
369 art.pchanged() # must not call the callback anymore
370 assert func.counter == 2
371
372
373def test_set_signature():

Callers

nothing calls this directly

Calls 4

add_callbackMethod · 0.95
pchangedMethod · 0.95
set_zorderMethod · 0.95
remove_callbackMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…