prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  message about unit tests not available
  If scikits-image is installed without nose, a message is printed about unit tests not being available is printed on import but it is a little bit distracting to the casual end-user.
  
  
  </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         print("Could not load nose.  Unit tests not available.")
  76         return None
  77     else:
  78         f = functools.partial(_nose.run, 'skimage', argv=args)
  79         f.__doc__ = 'Invoke the skimage test suite.'
  80         return f
  81 
  82 test = _setup_test()
  83 if test is None:
  84     try:
  85         del test
  86     except NameError:
  87         pass
  88 
  89 test_verbose = _setup_test(verbose=True)
  90 if test_verbose is None:
  91     try:
  92         del test
  93     except NameError:
  94         pass
  95 
  96 
  97 def get_log(name=None):
  98     """Return a console logger.
  99 
  100     Output may be sent to the logger using the `debug`, `info`, `warning`,
  101     `error` and `critical` methods.
  102 
  103     Parameters
  104     ----------
  105     name : str
  106         Name of the log.
  107 
  108     References
  109     ----------
  110     .. [1] Logging facility for Python,
  111            http://docs.python.org/library/logging.html
  112 
  113     """
  114     import logging
  115 
  116     if name is None:
  117         name = 'skimage'
  118     else:
  119         name = 'skimage.' + name
  120 
  121     log = logging.getLogger(name)
  122     return log
  123 
  124 
  125 def _setup_log():
  126     """Configure root logger.
  127 
  128     """
  129     import logging
  130     import sys
  131 
  132     log = logging.getLogger()
  133 
  134     try:
  135         handler = logging.StreamHandler(stream=sys.stdout)
  136     except TypeError:
  137         handler = logging.StreamHandler(strm=sys.stdout)
  138 
  139     formatter = logging.Formatter(
  140         '%(name)s: %(levelname)s: %(message)s'
  141         )
  142     handler.setFormatter(formatter)
  143 
  144     log.addHandler(handler)
  145     log.setLevel(logging.WARNING)
  146 
  147 _setup_log()
  148 
  149 from .util.dtype import *
  150
  [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
  @@ -72,26 +72,20 @@
       try:
           import nose as _nose
       except ImportError:
  -        print("Could not load nose.  Unit tests not available.")
  -        return None
  +        def broken_test_func():
  +            """This would invoke the skimage test suite, but nose couldn't be
  +            imported so the test suite can not run.
  +            """
  +            raise ImportError("Could not load nose.  Unit tests not available.")
  +        return broken_test_func
       else:
           f = functools.partial(_nose.run, 'skimage', argv=args)
           f.__doc__ = 'Invoke the skimage test suite.'
           return f
   
  -test = _setup_test()
  -if test is None:
  -    try:
  -        del test
  -    except NameError:
  -        pass
   
  +test = _setup_test()
   test_verbose = _setup_test(verbose=True)
  -if test_verbose is None:
  -    try:
  -        del test
  -    except NameError:
  -        pass
   
   
   def get_log(name=None):
  
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@@ -72,26 +72,20 @@\n     try:\n         import nose as _nose\n     except ImportError:\n-        print(\"Could not load nose.  Unit tests not available.\")\n-        return None\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-test = _setup_test()\n-if test is None:\n-    try:\n-        del test\n-    except NameError:\n-        pass\n \n+test = _setup_test()\n test_verbose = _setup_test(verbose=True)\n-if test_verbose is None:\n-    try:\n-        del test\n-    except NameError:\n-        pass\n \n \n def get_log(name=None):\n", "issue": "message about unit tests not available\nIf scikits-image is installed without nose, a message is printed about unit tests not being available is printed on import but it is a little bit distracting to the casual end-user.\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        print(\"Could not load nose.  Unit tests not available.\")\n        return None\n    else:\n        f = functools.partial(_nose.run, 'skimage', argv=args)\n        f.__doc__ = 'Invoke the skimage test suite.'\n        return f\n\ntest = _setup_test()\nif test is None:\n    try:\n        del test\n    except NameError:\n        pass\n\ntest_verbose = _setup_test(verbose=True)\nif test_verbose is None:\n    try:\n        del test\n    except NameError:\n        pass\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    log = logging.getLogger()\n\n    try:\n        handler = logging.StreamHandler(stream=sys.stdout)\n    except TypeError:\n        handler = logging.StreamHandler(strm=sys.stdout)\n\n    formatter = logging.Formatter(\n        '%(name)s: %(levelname)s: %(message)s'\n        )\n    handler.setFormatter(formatter)\n\n    log.addHandler(handler)\n    log.setLevel(logging.WARNING)\n\n_setup_log()\n\nfrom .util.dtype import *\n", "path": "skimage/__init__.py"}]}