()
| 507 | |
| 508 | |
| 509 | def test_callbackregistry_signals(): |
| 510 | cr = cbook.CallbackRegistry(signals=["foo"]) |
| 511 | results = [] |
| 512 | def cb(x): results.append(x) |
| 513 | cr.connect("foo", cb) |
| 514 | with pytest.raises(ValueError): |
| 515 | cr.connect("bar", cb) |
| 516 | cr.process("foo", 1) |
| 517 | with pytest.raises(ValueError): |
| 518 | cr.process("bar", 1) |
| 519 | assert results == [1] |
| 520 | |
| 521 | |
| 522 | def test_callbackregistry_blocking(): |