Skip to content

Commit 1527a76

Browse files
committed
Fix
1 parent e12c18a commit 1527a76

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

chartlets.py/chartlets/callback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def from_decorator(
5757
f" must be of type Input, State, or Output,"
5858
f" but got {arg.__class__.__name__!r}"
5959
)
60-
if not isinstance(arg, Output):
60+
if isinstance(arg, Output):
6161
outputs.append(arg)
6262
else:
6363
inputs.append(arg)

chartlets.py/tests/callback_test.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,17 @@ def test_decorator_target(self):
158158
def test_decorator_args(self):
159159
with pytest.raises(
160160
TypeError,
161-
match="arguments for decorator 'test' must be of"
162-
" type Input, but got 'int'",
161+
match=(
162+
"arguments for decorator 'test' must be of type"
163+
" Input, State, or Output, but got 'int'"
164+
),
163165
):
164166
Callback.from_decorator("test", (13,), my_callback)
165167

166168
with pytest.raises(
167169
TypeError,
168170
match=(
169-
"arguments for decorator 'test' must be of type Input,"
170-
" State, Output, AppInput, or AppOutput, but got 'int'"
171+
"arguments for decorator 'test' must be of type State, but got 'int'"
171172
),
172173
):
173174
Callback.from_decorator("test", (13,), my_callback, states_only=True)

0 commit comments

Comments
 (0)