Skip to content

Commit 4c1469f

Browse files
committed
Use simplified state.report
1 parent 0f6fec5 commit 4c1469f

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

shellwhat/checks/has_funcs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def has_code(
6565

6666
if not res:
6767
_msg = state.build_message(incorrect_msg, fmt_kwargs={"text": text})
68-
state.report(Feedback(_msg))
68+
state.report(_msg)
6969

7070
return state
7171

@@ -122,7 +122,7 @@ def has_output(
122122
_msg = state.build_message(
123123
incorrect_msg, fmt_kwargs={"text": text, "fixed": fixed}
124124
)
125-
state.report(Feedback(_msg))
125+
state.report(_msg)
126126

127127
return state
128128

@@ -188,7 +188,7 @@ def has_expr(
188188
_msg = state.build_message(
189189
incorrect_msg, fmt_kwargs={"expr": expr, "output": output}
190190
)
191-
state.report(Feedback(_msg))
191+
state.report(_msg)
192192

193193
return state
194194

tests/test_selectors.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def d():
3636

3737
@pytest.fixture("function")
3838
def shell_script():
39-
return """# Use curl, download file from URL and rename
39+
return """# Use curl, download file from URL and rename
4040
curl -o Spotify201812.zip -L https://tinyurl.com/Zipped201812Spotify
4141
4242
# Unzip file then delete original zipped file
@@ -111,11 +111,7 @@ def test_osh_selector_high_priority(self, state):
111111
assert isinstance(child.student_ast, target)
112112
assert child.student_ast.token.val == "c"
113113
with pytest.raises(TF):
114-
from protowhat.Feedback import Feedback
115-
116-
fb = Feedback("test")
117-
child.report(fb)
118-
assert fb.highlight is not None
114+
child.report("test")
119115

120116
def test_osh_selector_fail(self, state):
121117
with pytest.raises(TF):

0 commit comments

Comments
 (0)