from ppb_vector import Vector2
from utils import vectors
from hypothesis import assume, given, note, example
from hypothesis.strategies import floats


@given(x=vectors(), abs_tol=floats(min_value=0), rel_tol=floats(min_value=0))
def test_isclose_to_self(x, abs_tol, rel_tol):
    assert x.isclose(x, abs_tol=abs_tol, rel_tol=rel_tol)

from ppb_vector import Vector2
from pytest import raises # type: ignore
from utils import vectors
from hypothesis import assume, given, note, example
from hypothesis.strategies import floats


@given(x=vectors(), abs_tol=floats(min_value=0), rel_tol=floats(min_value=0))
def test_isclose_to_self(x, abs_tol, rel_tol):
    assert x.isclose(x, abs_tol=abs_tol, rel_tol=rel_tol)


def test_isclose_negative_tolerances():
    zero = Vector2(0, 0)

    with raises(ValueError):
        zero.isclose(zero, abs_tol=-1)

    with raises(ValueError):
        zero.isclose(zero, rel_tol=-1)

Test Vector2.isclose with invalid values
Test Vector2.isclose with invalid values

  from ppb_vector import Vector2
+ from pytest import raises # type: ignore
  from utils import vectors
  from hypothesis import assume, given, note, example
  from hypothesis.strategies import floats
  
  
  @given(x=vectors(), abs_tol=floats(min_value=0), rel_tol=floats(min_value=0))
  def test_isclose_to_self(x, abs_tol, rel_tol):
      assert x.isclose(x, abs_tol=abs_tol, rel_tol=rel_tol)
  
+ 
+ def test_isclose_negative_tolerances():
+     zero = Vector2(0, 0)
+ 
+     with raises(ValueError):
+         zero.isclose(zero, abs_tol=-1)
+ 
+     with raises(ValueError):
+         zero.isclose(zero, rel_tol=-1)
+ 
Test Vector2.isclose with invalid values
## Code Before:
from ppb_vector import Vector2
from utils import vectors
from hypothesis import assume, given, note, example
from hypothesis.strategies import floats


@given(x=vectors(), abs_tol=floats(min_value=0), rel_tol=floats(min_value=0))
def test_isclose_to_self(x, abs_tol, rel_tol):
    assert x.isclose(x, abs_tol=abs_tol, rel_tol=rel_tol)

## Instruction:
Test Vector2.isclose with invalid values
## Code After:
from ppb_vector import Vector2
from pytest import raises # type: ignore
from utils import vectors
from hypothesis import assume, given, note, example
from hypothesis.strategies import floats


@given(x=vectors(), abs_tol=floats(min_value=0), rel_tol=floats(min_value=0))
def test_isclose_to_self(x, abs_tol, rel_tol):
    assert x.isclose(x, abs_tol=abs_tol, rel_tol=rel_tol)


def test_isclose_negative_tolerances():
    zero = Vector2(0, 0)

    with raises(ValueError):
        zero.isclose(zero, abs_tol=-1)

    with raises(ValueError):
        zero.isclose(zero, rel_tol=-1)
