def test_nonempty(x): """ When nonempty is called with empty string, list or dict, then it raises ValueError. """ with pytest.raises(ValueError): mod.nonempty(x)
def test_nonempty_with_value(x): """ When nonemtpy is called with non-empty string, list or dict, then it does not raise, and returns the value passed to it. """ assert mod.nonempty(x) == x