Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
kratsg authored and matthewfeickert committed Sep 3, 2022
1 parent 51bd4c4 commit 018ec28
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/test_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,16 @@ def test_get_workspace_data(workspace_factory, include_auxdata):
assert w.data(m, include_auxdata=include_auxdata)


def test_get_workspace_data_bad_model(workspace_factory, caplog):
def test_get_workspace_data_bad_model(workspace_factory, caplog, mocker):
w = workspace_factory()
m = w.model()
# the iconic fragrance of an expected failure
m.config.channels = [c.replace('channel', 'chanel') for c in m.config.channels]

mocker.patch(
'pyhf.mixins._ChannelSummaryMixin.channels',
new_callable=mocker.PropertyMock,
return_value=['chanel'],
)
with caplog.at_level(logging.INFO, 'pyhf.pdf'):
with pytest.raises(KeyError):
assert w.data(m)
Expand Down

0 comments on commit 018ec28

Please sign in to comment.