diff options
| -rw-r--r-- | CHANGES.md | 2 | ||||
| -rw-r--r-- | src/tests/test.py | 11 |
2 files changed, 12 insertions, 1 deletions
@@ -5,7 +5,7 @@ HISTORY ## 4.2.1 (2018-01-14) -Fixed a regression breaking IPython and discovered by https://github.com/spapini +Fixed a regression breaking IPython reported by https://github.com/spapini . ## 4.2.0 (2018-01-14) diff --git a/src/tests/test.py b/src/tests/test.py index e5f2ff4..cd99e95 100644 --- a/src/tests/test.py +++ b/src/tests/test.py @@ -126,6 +126,17 @@ class ExtraTestCase(unittest.TestCase): return method(app) catch_config_error(lambda app: None) + def test_add1(self): + # similar to what IPython is doing in traitlets.config.application + @decorator + def add(func, const=1, *args, **kwargs): + return const + func(*args, **kwargs) + + def f(x): + return x + self.assertEqual(add(f)(0), 1) + self.assertEqual(add(f, 2)(0), 2) + # ################### test dispatch_on ############################# # # adapted from test_functools in Python 3.5 singledispatch = dispatch_on('obj') |
