Skip to content
This repository was archived by the owner on Dec 10, 2019. It is now read-only.

Add *args and **kwargs to no_op function in notebook support check #24

Merged
merged 1 commit into from
Sep 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rasterfoundry/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 11 additions & 0 deletions tests/test_notebook_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down