From a945f9e5e1553d7c595eae988b5bfe26ef47637b 2019-06-18 18:28:11 From: Matthias Bussonnier Date: 2019-06-18 18:28:11 Subject: [PATCH] Merge pull request #11790 from Carreau/fix-skip Fix skip decorator. --- diff --git a/IPython/testing/decorators.py b/IPython/testing/decorators.py index fff6221..91e7193 100644 --- a/IPython/testing/decorators.py +++ b/IPython/testing/decorators.py @@ -245,8 +245,10 @@ def skip(msg=None): Decorator, which, when applied to a function, causes SkipTest to be raised, with the optional message added. """ - - return skipif(True,msg) + if msg and not isinstance(msg, str): + raise ValueError('invalid object passed to `@skip` decorator, did you ' + 'meant `@skip()` with brackets ?') + return skipif(True, msg) def onlyif(condition, msg): diff --git a/IPython/testing/tests/test_decorators.py b/IPython/testing/tests/test_decorators.py index ef34625..dc1ff41 100644 --- a/IPython/testing/tests/test_decorators.py +++ b/IPython/testing/tests/test_decorators.py @@ -46,7 +46,7 @@ def trivial(): pass -@dec.skip +@dec.skip() def test_deliberately_broken(): """A deliberately broken test - we want to skip this one.""" 1/0