prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Please add info how to run the skimage unit tests at the end of the installation instructions
  I couldn't find instructions how to run the skimage unit tests.
  
  First I tried
  
  ```
  python -c 'import skimage; skimage.test()
  ```
  
  which ran 287 tests and gave 16 errors, all the same:
  
  ```
  ImportError: cannot import name BytesIO
  ```
  
  Then I tried
  
  ```
  nosetests --exe skimage
  ```
  
  which ran 490 tests, no error.
  
  Full output is here: https://gist.github.com/3832077
  
  Apparently it is important to not use `skimage.test()`, but `nosetests` instead?
  Could you please add this info somewhere, the first place I would have looked is at the end of http://skimage.org/docs/dev/install.html ( or make "nosetests" or "run tests" in the sphinx search find the appropriate command to run).
  
  Thanks!
  
  
  </issue>
  <code>
  [start of skimage/__init__.py]
  1 """Image Processing SciKit (Toolbox for SciPy)
  2 
  3 ``scikits-image`` (a.k.a. ``skimage``) is a collection of algorithms for image
  4 processing and computer vision.
  5 
  6 The main package of ``skimage`` only provides a few utilities for converting
  7 between image data types; for most features, you need to import one of the
  8 following subpackages:
  9 
  10 Subpackages
  11 -----------
  12 color
  13     Color space conversion.
  14 data
  15     Test images and example data.
  16 draw
  17     Image drawing primitives (lines, text, etc.).
  18 exposure
  19     Image intensity adjustment (e.g., histogram equalization).
  20 feature
  21     Feature detection (e.g. texture analysis, corners, etc.).
  22 filter
  23     Sharpening, edge finding, denoising, etc.
  24 graph
  25     Graph-theoretic operations, e.g. dynamic programming (shortest paths).
  26 io
  27     Reading, saving, and displaying images and video.
  28 measure
  29     Measurement of image properties, e.g., similarity and contours.
  30 morphology
  31     Morphological operations, e.g. opening or skeletonization.
  32 segmentation
  33     Splitting an image into self-similar regions.
  34 transform
  35     Geometric and other transforms, e.g. rotation or the Radon transform.
  36 util
  37     Generic utilities.
  38 
  39 Utility Functions
  40 -----------------
  41 get_log
  42     Returns the ``skimage`` log.  Use this to print debug output.
  43 img_as_float
  44     Convert an image to floating point format, with values in [0, 1].
  45 img_as_uint
  46     Convert an image to unsigned integer format, with values in [0, 65535].
  47 img_as_int
  48     Convert an image to signed integer format, with values in [-32768, 32767].
  49 img_as_ubyte
  50     Convert an image to unsigned byte format, with values in [0, 255].
  51 
  52 """
  53 
  54 import os.path as _osp
  55 
  56 pkg_dir = _osp.abspath(_osp.dirname(__file__))
  57 data_dir = _osp.join(pkg_dir, 'data')
  58 
  59 try:
  60     from .version import version as __version__
  61 except ImportError:
  62     __version__ = "unbuilt-dev"
  63 
  64 
  65 def _setup_test(verbose=False):
  66     import functools
  67 
  68     args = ['', '--exe', '-w', pkg_dir]
  69     if verbose:
  70         args.extend(['-v', '-s'])
  71 
  72     try:
  73         import nose as _nose
  74     except ImportError:
  75         def broken_test_func():
  76             """This would invoke the skimage test suite, but nose couldn't be
  77             imported so the test suite can not run.
  78             """
  79             raise ImportError("Could not load nose.  Unit tests not available.")
  80         return broken_test_func
  81     else:
  82         f = functools.partial(_nose.run, 'skimage', argv=args)
  83         f.__doc__ = 'Invoke the skimage test suite.'
  84         return f
  85 
  86 
  87 test = _setup_test()
  88 test_verbose = _setup_test(verbose=True)
  89 
  90 
  91 def get_log(name=None):
  92     """Return a console logger.
  93 
  94     Output may be sent to the logger using the `debug`, `info`, `warning`,
  95     `error` and `critical` methods.
  96 
  97     Parameters
  98     ----------
  99     name : str
  100         Name of the log.
  101 
  102     References
  103     ----------
  104     .. [1] Logging facility for Python,
  105            http://docs.python.org/library/logging.html
  106 
  107     """
  108     import logging
  109 
  110     if name is None:
  111         name = 'skimage'
  112     else:
  113         name = 'skimage.' + name
  114 
  115     log = logging.getLogger(name)
  116     return log
  117 
  118 
  119 def _setup_log():
  120     """Configure root logger.
  121 
  122     """
  123     import logging
  124     import sys
  125 
  126     formatter = logging.Formatter(
  127         '%(name)s: %(levelname)s: %(message)s'
  128         )
  129 
  130     try:
  131         handler = logging.StreamHandler(stream=sys.stdout)
  132     except TypeError:
  133         handler = logging.StreamHandler(strm=sys.stdout)
  134     handler.setFormatter(formatter)
  135 
  136     log = get_log()
  137     log.addHandler(handler)
  138     log.setLevel(logging.WARNING)
  139     log.propagate = False
  140 
  141 _setup_log()
  142 
  143 from .util.dtype import *
  144
  [end of skimage/__init__.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/skimage/__init__.py b/skimage/__init__.py
  --- a/skimage/__init__.py
  +++ b/skimage/__init__.py
  @@ -65,7 +65,7 @@
   def _setup_test(verbose=False):
       import functools
   
  -    args = ['', '--exe', '-w', pkg_dir]
  +    args = ['', pkg_dir, '--exe']
       if verbose:
           args.extend(['-v', '-s'])
  
verification_info: {"golden_diff": "diff --git a/skimage/__init__.py b/skimage/__init__.py\n--- a/skimage/__init__.py\n+++ b/skimage/__init__.py\n@@ -65,7 +65,7 @@\n def _setup_test(verbose=False):\n     import functools\n \n-    args = ['', '--exe', '-w', pkg_dir]\n+    args = ['', pkg_dir, '--exe']\n     if verbose:\n         args.extend(['-v', '-s'])\n", "issue": "Please add info how to run the skimage unit tests at the end of the installation instructions\nI couldn't find instructions how to run the skimage unit tests.\n\nFirst I tried\n\n```\npython -c 'import skimage; skimage.test()\n```\n\nwhich ran 287 tests and gave 16 errors, all the same:\n\n```\nImportError: cannot import name BytesIO\n```\n\nThen I tried\n\n```\nnosetests --exe skimage\n```\n\nwhich ran 490 tests, no error.\n\nFull output is here: https://gist.github.com/3832077\n\nApparently it is important to not use `skimage.test()`, but `nosetests` instead?\nCould you please add this info somewhere, the first place I would have looked is at the end of http://skimage.org/docs/dev/install.html ( or make \"nosetests\" or \"run tests\" in the sphinx search find the appropriate command to run).\n\nThanks!\n\n", "before_files": [{"content": "\"\"\"Image Processing SciKit (Toolbox for SciPy)\n\n``scikits-image`` (a.k.a. ``skimage``) is a collection of algorithms for image\nprocessing and computer vision.\n\nThe main package of ``skimage`` only provides a few utilities for converting\nbetween image data types; for most features, you need to import one of the\nfollowing subpackages:\n\nSubpackages\n-----------\ncolor\n    Color space conversion.\ndata\n    Test images and example data.\ndraw\n    Image drawing primitives (lines, text, etc.).\nexposure\n    Image intensity adjustment (e.g., histogram equalization).\nfeature\n    Feature detection (e.g. texture analysis, corners, etc.).\nfilter\n    Sharpening, edge finding, denoising, etc.\ngraph\n    Graph-theoretic operations, e.g. dynamic programming (shortest paths).\nio\n    Reading, saving, and displaying images and video.\nmeasure\n    Measurement of image properties, e.g., similarity and contours.\nmorphology\n    Morphological operations, e.g. opening or skeletonization.\nsegmentation\n    Splitting an image into self-similar regions.\ntransform\n    Geometric and other transforms, e.g. rotation or the Radon transform.\nutil\n    Generic utilities.\n\nUtility Functions\n-----------------\nget_log\n    Returns the ``skimage`` log.  Use this to print debug output.\nimg_as_float\n    Convert an image to floating point format, with values in [0, 1].\nimg_as_uint\n    Convert an image to unsigned integer format, with values in [0, 65535].\nimg_as_int\n    Convert an image to signed integer format, with values in [-32768, 32767].\nimg_as_ubyte\n    Convert an image to unsigned byte format, with values in [0, 255].\n\n\"\"\"\n\nimport os.path as _osp\n\npkg_dir = _osp.abspath(_osp.dirname(__file__))\ndata_dir = _osp.join(pkg_dir, 'data')\n\ntry:\n    from .version import version as __version__\nexcept ImportError:\n    __version__ = \"unbuilt-dev\"\n\n\ndef _setup_test(verbose=False):\n    import functools\n\n    args = ['', '--exe', '-w', pkg_dir]\n    if verbose:\n        args.extend(['-v', '-s'])\n\n    try:\n        import nose as _nose\n    except ImportError:\n        def broken_test_func():\n            \"\"\"This would invoke the skimage test suite, but nose couldn't be\n            imported so the test suite can not run.\n            \"\"\"\n            raise ImportError(\"Could not load nose.  Unit tests not available.\")\n        return broken_test_func\n    else:\n        f = functools.partial(_nose.run, 'skimage', argv=args)\n        f.__doc__ = 'Invoke the skimage test suite.'\n        return f\n\n\ntest = _setup_test()\ntest_verbose = _setup_test(verbose=True)\n\n\ndef get_log(name=None):\n    \"\"\"Return a console logger.\n\n    Output may be sent to the logger using the `debug`, `info`, `warning`,\n    `error` and `critical` methods.\n\n    Parameters\n    ----------\n    name : str\n        Name of the log.\n\n    References\n    ----------\n    .. [1] Logging facility for Python,\n           http://docs.python.org/library/logging.html\n\n    \"\"\"\n    import logging\n\n    if name is None:\n        name = 'skimage'\n    else:\n        name = 'skimage.' + name\n\n    log = logging.getLogger(name)\n    return log\n\n\ndef _setup_log():\n    \"\"\"Configure root logger.\n\n    \"\"\"\n    import logging\n    import sys\n\n    formatter = logging.Formatter(\n        '%(name)s: %(levelname)s: %(message)s'\n        )\n\n    try:\n        handler = logging.StreamHandler(stream=sys.stdout)\n    except TypeError:\n        handler = logging.StreamHandler(strm=sys.stdout)\n    handler.setFormatter(formatter)\n\n    log = get_log()\n    log.addHandler(handler)\n    log.setLevel(logging.WARNING)\n    log.propagate = False\n\n_setup_log()\n\nfrom .util.dtype import *\n", "path": "skimage/__init__.py"}]}