From e5958e1d6961acdc5d9d65da122da5362de3ddc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl> Date: Fri, 29 Nov 2019 22:03:18 +0100 Subject: [PATCH] more unit tests for CallableGroup --- satella/__init__.py | 2 +- tests/test_coding/test_concurrent.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/satella/__init__.py b/satella/__init__.py index fc7c51ff..f059db8f 100644 --- a/satella/__init__.py +++ b/satella/__init__.py @@ -1,2 +1,2 @@ # coding=UTF-8 -__version__ = '2.0.25a1' +__version__ = '2.0.25a2' diff --git a/tests/test_coding/test_concurrent.py b/tests/test_coding/test_concurrent.py index 6011ed43..672a5eba 100644 --- a/tests/test_coding/test_concurrent.py +++ b/tests/test_coding/test_concurrent.py @@ -7,6 +7,18 @@ from satella.coding import CallableGroup class TestCallableGroup(unittest.TestCase): + def test_callable_group_some_raise(self): + cg = CallableGroup(gather=True) + cg.add(lambda: dupa) + cg.add(lambda: 5) + self.assertRaises(NameError, lambda: cg()) + + cg = CallableGroup(gather=True, swallow_exceptions=True) + cg.add(lambda: dupa) + cg.add(lambda: 5) + self.assertEquals(cg()[1], 5) + self.assertIsInstance(cg()[0], NameError) + def test_callable_group(self): a = { -- GitLab