def test_warns_bad_type(self, item): with patch("tavern.util.dict_util.logger.warning") as wmock: _check_and_format_values("{fd}", {"fd": item}) assert wmock.called_with( "Formatting 'fd' will result in it being coerced to a string (it is a {})" .format(type(item)))
def test_no_warn_good_type(self, item): with patch("tavern.util.dict_util.logger.warning") as wmock: _check_and_format_values("{fd}", {"fd": item}) assert not wmock.called