def test_is_list_assign(self): for ok in LISTS: assert is_list_assign(ok) assert is_list_assign(ok + '=', allow_assign_mark=True) assert is_list_assign(ok + ' =', allow_assign_mark=True) assert not is_list_assign(ok + '[item]') assert not is_list_assign(' ' + ok) for nok in NOK_ASSIGNS + SCALARS + DICTS: assert not is_list_assign(nok)
def test_is_list_assign(self): for ok in LISTS: assert is_list_assign(ok) assert search_variable(ok).is_list_assign() assert is_list_assign(ok + '=', allow_assign_mark=True) assert is_list_assign(ok + ' =', allow_assign_mark=True) assert not is_list_assign(ok + '[item]') assert not is_list_assign(' ' + ok) for nok in NOK_ASSIGNS + SCALARS + DICTS: assert not is_list_assign(nok) assert not search_variable(nok, ignore_errors=True).is_list_assign()
def _is_varargs(self, arg): return is_list_assign(arg)