prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Make blaze.test() return True or False
  @asmeurer suggests this. Currently we're passing through pytest.main() which is like the error code from command line programs.
  
  <!---
  @huboard:{"order":398.859375,"milestone_order":452,"custom_state":""}
  -->
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `blaze/__init__.py`
  Content:
  ```
  1 from __future__ import absolute_import, division, print_function
  2 
  3 import logging
  4 
  5 from dynd import nd
  6 from pandas import DataFrame
  7 import h5py
  8 
  9 from multipledispatch import halt_ordering, restart_ordering
  10 
  11 halt_ordering() # Turn off multipledispatch ordering
  12 
  13 from .expr import *
  14 from .expr.functions import *
  15 from .api import *
  16 from .data.csv import *
  17 from .data.json import *
  18 from .data.hdf5 import *
  19 from .compute.python import *
  20 from .data.meta import *
  21 from .compute.pandas import *
  22 from .compute.numpy import *
  23 from .compute.core import *
  24 from .compute.core import compute
  25 from .sql import *
  26 
  27 try:
  28     from .spark import *
  29 except ImportError:
  30     pass
  31 try:
  32     from .compute.pytables import *
  33 except ImportError:
  34     pass
  35 try:
  36     from .compute.chunks import *
  37 except ImportError:
  38     pass
  39 try:
  40     from .bcolz import *
  41 except ImportError:
  42     pass
  43 try:
  44     from .mongo import *
  45 except ImportError:
  46     pass
  47 
  48 restart_ordering() # Restart multipledispatch ordering and do ordering
  49 
  50 logging.basicConfig()
  51 logger = logging.getLogger(__name__)
  52 logger.setLevel(logging.WARNING)
  53 
  54 
  55 inf = float('inf')
  56 nan = float('nan')
  57 
  58 __version__ = '0.6.1'
  59 
  60 # If IPython is already loaded, register the Blaze catalog magic
  61 # from . import catalog
  62 # import sys
  63 # if 'IPython' in sys.modules:
  64 #     catalog.register_ipy_magic()
  65 # del sys
  66 
  67 def print_versions():
  68     """Print all the versions of software that Blaze relies on."""
  69     import sys, platform
  70     import numpy as np
  71     import dynd
  72     import datashape
  73     print("-=" * 38)
  74     print("Blaze version: %s" % __version__)
  75     print("Datashape version: %s" % datashape.__version__)
  76     print("NumPy version: %s" % np.__version__)
  77     print("DyND version: %s / LibDyND %s" %
  78                     (dynd.__version__, dynd.__libdynd_version__))
  79     print("Python version: %s" % sys.version)
  80     (sysname, nodename, release, version, machine, processor) = \
  81         platform.uname()
  82     print("Platform: %s-%s-%s (%s)" % (sysname, release, machine, version))
  83     if sysname == "Linux":
  84         print("Linux dist: %s" % " ".join(platform.linux_distribution()[:-1]))
  85     if not processor:
  86         processor = "not recognized"
  87     print("Processor: %s" % processor)
  88     print("Byte-ordering: %s" % sys.byteorder)
  89     print("-=" * 38)
  90 
  91 
  92 def test(verbose=False, junitfile=None, exit=False):
  93     """
  94     Runs the full Blaze test suite, outputting
  95     the results of the tests to sys.stdout.
  96 
  97     This uses py.test to discover which tests to
  98     run, and runs tests in any 'tests' subdirectory
  99     within the Blaze module.
  100 
  101     Parameters
  102     ----------
  103     verbose : int, optional
  104         Value 0 prints very little, 1 prints a little bit,
  105         and 2 prints the test names while testing.
  106     junitfile : string, optional
  107         If provided, writes the test results to an junit xml
  108         style xml file. This is useful for running the tests
  109         in a CI server such as Jenkins.
  110     exit : bool, optional
  111         If True, the function will call sys.exit with an
  112         error code after the tests are finished.
  113     """
  114     import os
  115     import sys
  116     import pytest
  117 
  118     args = []
  119 
  120     if verbose:
  121         args.append('--verbose')
  122 
  123     # Output an xunit file if requested
  124     if junitfile is not None:
  125         args.append('--junit-xml=%s' % junitfile)
  126 
  127     # Add all 'tests' subdirectories to the options
  128     rootdir = os.path.dirname(__file__)
  129     for root, dirs, files in os.walk(rootdir):
  130         if 'tests' in dirs:
  131             testsdir = os.path.join(root, 'tests')
  132             args.append(testsdir)
  133             print('Test dir: %s' % testsdir[len(rootdir) + 1:])
  134     # print versions (handy when reporting problems)
  135     print_versions()
  136     sys.stdout.flush()
  137 
  138     # Ask pytest to do its thing
  139     error_code = pytest.main(args=args)
  140     if exit:
  141         return sys.exit(error_code)
  142     return error_code
  143
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/blaze/__init__.py b/blaze/__init__.py
  --- a/blaze/__init__.py
  +++ b/blaze/__init__.py
  @@ -139,4 +139,4 @@
       error_code = pytest.main(args=args)
       if exit:
           return sys.exit(error_code)
  -    return error_code
  +    return error_code == 0
  
verification_info: {"golden_diff": "diff --git a/blaze/__init__.py b/blaze/__init__.py\n--- a/blaze/__init__.py\n+++ b/blaze/__init__.py\n@@ -139,4 +139,4 @@\n     error_code = pytest.main(args=args)\n     if exit:\n         return sys.exit(error_code)\n-    return error_code\n+    return error_code == 0\n", "issue": "Make blaze.test() return True or False\n@asmeurer suggests this. Currently we're passing through pytest.main() which is like the error code from command line programs.\n\n<!---\n@huboard:{\"order\":398.859375,\"milestone_order\":452,\"custom_state\":\"\"}\n-->\n\n", "before_files": [{"content": "from __future__ import absolute_import, division, print_function\n\nimport logging\n\nfrom dynd import nd\nfrom pandas import DataFrame\nimport h5py\n\nfrom multipledispatch import halt_ordering, restart_ordering\n\nhalt_ordering() # Turn off multipledispatch ordering\n\nfrom .expr import *\nfrom .expr.functions import *\nfrom .api import *\nfrom .data.csv import *\nfrom .data.json import *\nfrom .data.hdf5 import *\nfrom .compute.python import *\nfrom .data.meta import *\nfrom .compute.pandas import *\nfrom .compute.numpy import *\nfrom .compute.core import *\nfrom .compute.core import compute\nfrom .sql import *\n\ntry:\n    from .spark import *\nexcept ImportError:\n    pass\ntry:\n    from .compute.pytables import *\nexcept ImportError:\n    pass\ntry:\n    from .compute.chunks import *\nexcept ImportError:\n    pass\ntry:\n    from .bcolz import *\nexcept ImportError:\n    pass\ntry:\n    from .mongo import *\nexcept ImportError:\n    pass\n\nrestart_ordering() # Restart multipledispatch ordering and do ordering\n\nlogging.basicConfig()\nlogger = logging.getLogger(__name__)\nlogger.setLevel(logging.WARNING)\n\n\ninf = float('inf')\nnan = float('nan')\n\n__version__ = '0.6.1'\n\n# If IPython is already loaded, register the Blaze catalog magic\n# from . import catalog\n# import sys\n# if 'IPython' in sys.modules:\n#     catalog.register_ipy_magic()\n# del sys\n\ndef print_versions():\n    \"\"\"Print all the versions of software that Blaze relies on.\"\"\"\n    import sys, platform\n    import numpy as np\n    import dynd\n    import datashape\n    print(\"-=\" * 38)\n    print(\"Blaze version: %s\" % __version__)\n    print(\"Datashape version: %s\" % datashape.__version__)\n    print(\"NumPy version: %s\" % np.__version__)\n    print(\"DyND version: %s / LibDyND %s\" %\n                    (dynd.__version__, dynd.__libdynd_version__))\n    print(\"Python version: %s\" % sys.version)\n    (sysname, nodename, release, version, machine, processor) = \\\n        platform.uname()\n    print(\"Platform: %s-%s-%s (%s)\" % (sysname, release, machine, version))\n    if sysname == \"Linux\":\n        print(\"Linux dist: %s\" % \" \".join(platform.linux_distribution()[:-1]))\n    if not processor:\n        processor = \"not recognized\"\n    print(\"Processor: %s\" % processor)\n    print(\"Byte-ordering: %s\" % sys.byteorder)\n    print(\"-=\" * 38)\n\n\ndef test(verbose=False, junitfile=None, exit=False):\n    \"\"\"\n    Runs the full Blaze test suite, outputting\n    the results of the tests to sys.stdout.\n\n    This uses py.test to discover which tests to\n    run, and runs tests in any 'tests' subdirectory\n    within the Blaze module.\n\n    Parameters\n    ----------\n    verbose : int, optional\n        Value 0 prints very little, 1 prints a little bit,\n        and 2 prints the test names while testing.\n    junitfile : string, optional\n        If provided, writes the test results to an junit xml\n        style xml file. This is useful for running the tests\n        in a CI server such as Jenkins.\n    exit : bool, optional\n        If True, the function will call sys.exit with an\n        error code after the tests are finished.\n    \"\"\"\n    import os\n    import sys\n    import pytest\n\n    args = []\n\n    if verbose:\n        args.append('--verbose')\n\n    # Output an xunit file if requested\n    if junitfile is not None:\n        args.append('--junit-xml=%s' % junitfile)\n\n    # Add all 'tests' subdirectories to the options\n    rootdir = os.path.dirname(__file__)\n    for root, dirs, files in os.walk(rootdir):\n        if 'tests' in dirs:\n            testsdir = os.path.join(root, 'tests')\n            args.append(testsdir)\n            print('Test dir: %s' % testsdir[len(rootdir) + 1:])\n    # print versions (handy when reporting problems)\n    print_versions()\n    sys.stdout.flush()\n\n    # Ask pytest to do its thing\n    error_code = pytest.main(args=args)\n    if exit:\n        return sys.exit(error_code)\n    return error_code\n", "path": "blaze/__init__.py"}], "after_files": [{"content": "from __future__ import absolute_import, division, print_function\n\nimport logging\n\nfrom dynd import nd\nfrom pandas import DataFrame\nimport h5py\n\nfrom multipledispatch import halt_ordering, restart_ordering\n\nhalt_ordering() # Turn off multipledispatch ordering\n\nfrom .expr import *\nfrom .expr.functions import *\nfrom .api import *\nfrom .data.csv import *\nfrom .data.json import *\nfrom .data.hdf5 import *\nfrom .compute.python import *\nfrom .data.meta import *\nfrom .compute.pandas import *\nfrom .compute.numpy import *\nfrom .compute.core import *\nfrom .compute.core import compute\nfrom .sql import *\n\ntry:\n    from .spark import *\nexcept ImportError:\n    pass\ntry:\n    from .compute.pytables import *\nexcept ImportError:\n    pass\ntry:\n    from .compute.chunks import *\nexcept ImportError:\n    pass\ntry:\n    from .bcolz import *\nexcept ImportError:\n    pass\ntry:\n    from .mongo import *\nexcept ImportError:\n    pass\n\nrestart_ordering() # Restart multipledispatch ordering and do ordering\n\nlogging.basicConfig()\nlogger = logging.getLogger(__name__)\nlogger.setLevel(logging.WARNING)\n\n\ninf = float('inf')\nnan = float('nan')\n\n__version__ = '0.6.1'\n\n# If IPython is already loaded, register the Blaze catalog magic\n# from . import catalog\n# import sys\n# if 'IPython' in sys.modules:\n#     catalog.register_ipy_magic()\n# del sys\n\ndef print_versions():\n    \"\"\"Print all the versions of software that Blaze relies on.\"\"\"\n    import sys, platform\n    import numpy as np\n    import dynd\n    import datashape\n    print(\"-=\" * 38)\n    print(\"Blaze version: %s\" % __version__)\n    print(\"Datashape version: %s\" % datashape.__version__)\n    print(\"NumPy version: %s\" % np.__version__)\n    print(\"DyND version: %s / LibDyND %s\" %\n                    (dynd.__version__, dynd.__libdynd_version__))\n    print(\"Python version: %s\" % sys.version)\n    (sysname, nodename, release, version, machine, processor) = \\\n        platform.uname()\n    print(\"Platform: %s-%s-%s (%s)\" % (sysname, release, machine, version))\n    if sysname == \"Linux\":\n        print(\"Linux dist: %s\" % \" \".join(platform.linux_distribution()[:-1]))\n    if not processor:\n        processor = \"not recognized\"\n    print(\"Processor: %s\" % processor)\n    print(\"Byte-ordering: %s\" % sys.byteorder)\n    print(\"-=\" * 38)\n\n\ndef test(verbose=False, junitfile=None, exit=False):\n    \"\"\"\n    Runs the full Blaze test suite, outputting\n    the results of the tests to sys.stdout.\n\n    This uses py.test to discover which tests to\n    run, and runs tests in any 'tests' subdirectory\n    within the Blaze module.\n\n    Parameters\n    ----------\n    verbose : int, optional\n        Value 0 prints very little, 1 prints a little bit,\n        and 2 prints the test names while testing.\n    junitfile : string, optional\n        If provided, writes the test results to an junit xml\n        style xml file. This is useful for running the tests\n        in a CI server such as Jenkins.\n    exit : bool, optional\n        If True, the function will call sys.exit with an\n        error code after the tests are finished.\n    \"\"\"\n    import os\n    import sys\n    import pytest\n\n    args = []\n\n    if verbose:\n        args.append('--verbose')\n\n    # Output an xunit file if requested\n    if junitfile is not None:\n        args.append('--junit-xml=%s' % junitfile)\n\n    # Add all 'tests' subdirectories to the options\n    rootdir = os.path.dirname(__file__)\n    for root, dirs, files in os.walk(rootdir):\n        if 'tests' in dirs:\n            testsdir = os.path.join(root, 'tests')\n            args.append(testsdir)\n            print('Test dir: %s' % testsdir[len(rootdir) + 1:])\n    # print versions (handy when reporting problems)\n    print_versions()\n    sys.stdout.flush()\n\n    # Ask pytest to do its thing\n    error_code = pytest.main(args=args)\n    if exit:\n        return sys.exit(error_code)\n    return error_code == 0\n", "path": "blaze/__init__.py"}]}