code: def test_exceptions():
      I = QQ.old_poly_ring(x).ideal(x)
      J = QQ.old_poly_ring(y).ideal(1)
      raises(ValueError, lambda: I.union(x))
      raises(ValueError, lambda: I + J)
      raises(ValueError, lambda: I * J)
      raises(ValueError, lambda: I.union(J))
      assert (I == J) is False
      assert I != J
  
file_path: sympy/sympy/polys/agca/tests/test_ideals.py
imports: from sympy.polys import QQ, ilex
  from sympy.abc import x, y, z
  from sympy.testing.pytest import raises
label_desc: Use image node_id 2 for calling a global function with example usage: test_exceptions() without return types