def test_string_fail(self): with raises(AssertionError) as exc: types.string(1) assert exc.value.args[0] == 'not of type string'
def test_string_pass(self): assert types.string('a string') is None