import pytest  # type: ignore

from ppb_vector import Vector2
from utils import vector_likes

@pytest.mark.parametrize('vector_like', vector_likes(), ids=lambda x: type(x).__name__) # type: ignore
def test_convert_subclass(vector_like):
    class V(Vector2): pass

    # test_binop_vectorlike already checks the output value is correct
    assert isinstance(V.convert(vector_like), V)

import pytest  # type: ignore

from ppb_vector import Vector2
from utils import vector_likes

@pytest.mark.parametrize('vector_like', vector_likes(), ids=lambda x: type(x).__name__) # type: ignore
def test_convert_subclass(vector_like):
    class V(Vector2): pass

    vector = V.convert(vector_like)
    assert isinstance(vector, V)
    assert vector == vector_like

Test converted vector equals original vector-like
tests/convert: Test converted vector equals original vector-like

The comment mentioned that property was tested by `test_binop_vectorlike`, but
Vector2.convert isn't a binary operator, so it isn't exercised by that test.

  import pytest  # type: ignore
  
  from ppb_vector import Vector2
  from utils import vector_likes
  
  @pytest.mark.parametrize('vector_like', vector_likes(), ids=lambda x: type(x).__name__) # type: ignore
  def test_convert_subclass(vector_like):
      class V(Vector2): pass
  
-     # test_binop_vectorlike already checks the output value is correct
+     vector = V.convert(vector_like)
-     assert isinstance(V.convert(vector_like), V)
+     assert isinstance(vector, V)
+     assert vector == vector_like
  
Test converted vector equals original vector-like
## Code Before:
import pytest  # type: ignore

from ppb_vector import Vector2
from utils import vector_likes

@pytest.mark.parametrize('vector_like', vector_likes(), ids=lambda x: type(x).__name__) # type: ignore
def test_convert_subclass(vector_like):
    class V(Vector2): pass

    # test_binop_vectorlike already checks the output value is correct
    assert isinstance(V.convert(vector_like), V)

## Instruction:
Test converted vector equals original vector-like
## Code After:
import pytest  # type: ignore

from ppb_vector import Vector2
from utils import vector_likes

@pytest.mark.parametrize('vector_like', vector_likes(), ids=lambda x: type(x).__name__) # type: ignore
def test_convert_subclass(vector_like):
    class V(Vector2): pass

    vector = V.convert(vector_like)
    assert isinstance(vector, V)
    assert vector == vector_like
