'Test getting vars from an expression.'

def test_get_vars(self):

    size = (5, 4)
    x = create_var(size)
    y = create_var(size)
    A = create_const(np.ones(size), size)
    add_expr = sum_expr([x, y, A])
    vars_ = get_expr_vars(add_expr)
    ref = [(x.data, size), (y.data, size)]
    if PY2:
        self.assertItemsEqual(vars_, ref)
    else:
        self.assertCountEqual(vars_, ref)
