fix(test-guards): an expected error is an outcome check, so a refusal test is not mock-only
A refusal test raises, then checks nothing was written with assert_not_called. The mock-only signal counted only plain asserts as outcome checks, so 28 of the 44 tests it flagged in Grimoire's own suite were refusals. pytest.raises and assertRaises now count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -116,6 +116,9 @@ def test_weak_signals_are_read_from_the_body():
|
||||
assert tg.test_signals(" f()\n mock.assert_called_once()\n") == ["mock-only"]
|
||||
# A plain assert beside a mock check is a real check, so no signal.
|
||||
assert tg.test_signals(" f()\n mock.assert_called_once()\n assert out == 1\n") == []
|
||||
# So is an expected error: a refusal, then a check that nothing was written.
|
||||
refusal = " with pytest.raises(ValueError):\n f()\n write.assert_not_awaited()\n"
|
||||
assert tg.test_signals(refusal) == []
|
||||
assert tg.test_signals(" text = path.read_text()\n assert 'x' in text\n") == ["source-text"]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user