diff options
| author | Joshua Harlow <harlowja@yahoo-inc.com> | 2014-12-01 21:44:45 -0800 |
|---|---|---|
| committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2014-12-02 12:47:03 -0800 |
| commit | 14ecaa45503c8a0efcb5972f342de171b4b8cd9b (patch) | |
| tree | 5f0b08d011e6bb7c2830b319887dfc6b0df02515 /taskflow/tests/unit/test_notifier.py | |
| parent | 96a387f66f5d151259601b86047eec8eee72df6c (diff) | |
| download | taskflow-14ecaa45503c8a0efcb5972f342de171b4b8cd9b.tar.gz | |
Raise value errors instead of asserts
Since asserts can be silenced using -0 and/or compiled out
we want to be more strict here and raise value errors when the
expected callable objects/functions are not actually callable.
Change-Id: Ib14e2e7329dbfcce50660f144ad4780d99f36854
Diffstat (limited to 'taskflow/tests/unit/test_notifier.py')
| -rw-r--r-- | taskflow/tests/unit/test_notifier.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/taskflow/tests/unit/test_notifier.py b/taskflow/tests/unit/test_notifier.py index 0761cb6..ab53607 100644 --- a/taskflow/tests/unit/test_notifier.py +++ b/taskflow/tests/unit/test_notifier.py @@ -79,6 +79,11 @@ class NotifierTest(test.TestCase): nt.Notifier.ANY, call_me, kwargs={'details': 5}) + def test_not_callable(self): + notifier = nt.Notifier() + self.assertRaises(ValueError, notifier.register, + nt.Notifier.ANY, 2) + def test_selective_notify(self): call_counts = collections.defaultdict(list) |
