diff --git a/rasterfoundry/decorators.py b/rasterfoundry/decorators.py index d98bcba..62c88ed 100644 --- a/rasterfoundry/decorators.py +++ b/rasterfoundry/decorators.py @@ -4,7 +4,7 @@ def check_notebook(f): - def no_op(): + def no_op(*args, **kwargs): logging.warn('This function requires jupyter notebook and ipyleaflet') return diff --git a/tests/test_notebook_check.py b/tests/test_notebook_check.py index bc8cb52..8cdb062 100644 --- a/tests/test_notebook_check.py +++ b/tests/test_notebook_check.py @@ -9,6 +9,17 @@ def f(): assert f() is None +def test_warn_without_notebook_support_with_args(): + import rasterfoundry.decorators + rasterfoundry.decorators.NOTEBOOK_SUPPORT = False + from rasterfoundry.decorators import check_notebook + + @check_notebook + def f(*args, **kwargs): + return 'foo' + assert f(1, 2, 3, foo='bar') is None + + def test_no_warn_with_notebook_support(): import rasterfoundry.decorators rasterfoundry.decorators.NOTEBOOK_SUPPORT = True