code: def test_rect():
      with pytest.raises(ValueError):
          rect(pt(0, 0), pt(1, 1, dtype=np.int))  # dtypes do not match
  
      with pytest.raises(ValueError):
          rect(pt(0, 0), pt(0, 0))  # doesn't form rect
  
      with pytest.raises(ValueError):
          rect(pt(1, 1), pt(0, 0))  # doesn't form rect
  
      with pytest.raises(ValueError):
          rect(pt(0, 0), pt(1, 0))  # doesn't form rect
  
      a = pt(0, 0)
      b = pt(1, 1)
      r = rect(a, b)
      assert r.dtype == a.dtype == b.dtype
      assert np.array_equal(r[0], a)
      assert np.array_equal(r[1], b)
  
      a = pt(-3, -1)
      b = pt(8, 1.2)
      r = rect(a, b)
      assert r.dtype == a.dtype == b.dtype
      assert np.array_equal(r[0], a)
      assert np.array_equal(r[1], b)
  
imports: import math
  import pytest
  from hypothesis import given
  import hypothesis.strategies
  import numpy
  from pdftabextract.geom import pt, ptdist, vecangle, vecrotate, overlap, lineintersect, rect, rectcenter, rectarea, rectintersect, normalize_angle, normalize_angle_halfcircle, project_polarcoord_lines
label_desc: Use image node_id 8 for calling a global function with example usage: test_rect() without return types