

from __future__ import absolute_import

import dask_distance._pycompat


def test_irange():
    r = dask_distance._pycompat.irange(5)

    assert not isinstance(r, list)

    assert list(r) == [0, 1, 2, 3, 4]



from __future__ import absolute_import

import dask_distance._pycompat


def test_irange():
    r = dask_distance._pycompat.irange(5)

    assert not isinstance(r, list)

    assert list(r) == [0, 1, 2, 3, 4]


def test_izip():
    r = dask_distance._pycompat.izip([1, 2, 3], ["a", "b", "c"])

    assert not isinstance(r, list)

    assert list(r) == [(1, 'a'), (2, 'b'), (3, 'c')]

Add a test for izip
Add a test for izip

Make sure that it generates an iterator on both Python 2 and Python 3.
Also check that it can be converted to a `list`.

  
  
  from __future__ import absolute_import
  
  import dask_distance._pycompat
  
  
  def test_irange():
      r = dask_distance._pycompat.irange(5)
  
      assert not isinstance(r, list)
  
      assert list(r) == [0, 1, 2, 3, 4]
  
+ 
+ def test_izip():
+     r = dask_distance._pycompat.izip([1, 2, 3], ["a", "b", "c"])
+ 
+     assert not isinstance(r, list)
+ 
+     assert list(r) == [(1, 'a'), (2, 'b'), (3, 'c')]
+ 
Add a test for izip
## Code Before:


from __future__ import absolute_import

import dask_distance._pycompat


def test_irange():
    r = dask_distance._pycompat.irange(5)

    assert not isinstance(r, list)

    assert list(r) == [0, 1, 2, 3, 4]

## Instruction:
Add a test for izip
## Code After:


from __future__ import absolute_import

import dask_distance._pycompat


def test_irange():
    r = dask_distance._pycompat.irange(5)

    assert not isinstance(r, list)

    assert list(r) == [0, 1, 2, 3, 4]


def test_izip():
    r = dask_distance._pycompat.izip([1, 2, 3], ["a", "b", "c"])

    assert not isinstance(r, list)

    assert list(r) == [(1, 'a'), (2, 'b'), (3, 'c')]
