prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  TST: Add the first test using hypothesis
  This pull request adds the first test that uses hypothesis and hence brings in hypothesis as an additional test dependency.
  
  @mattip Could you take a look at this please?
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `numpy/conftest.py`
  Content:
  ```
  1 """
  2 Pytest configuration and fixtures for the Numpy test suite.
  3 """
  4 import os
  5 
  6 import pytest
  7 import numpy
  8 
  9 from numpy.core._multiarray_tests import get_fpu_mode
  10 
  11 
  12 _old_fpu_mode = None
  13 _collect_results = {}
  14 
  15 
  16 def pytest_configure(config):
  17     config.addinivalue_line("markers",
  18         "valgrind_error: Tests that are known to error under valgrind.")
  19     config.addinivalue_line("markers",
  20         "leaks_references: Tests that are known to leak references.")
  21     config.addinivalue_line("markers",
  22         "slow: Tests that are very slow.")
  23 
  24 
  25 def pytest_addoption(parser):
  26     parser.addoption("--available-memory", action="store", default=None,
  27                      help=("Set amount of memory available for running the "
  28                            "test suite. This can result to tests requiring "
  29                            "especially large amounts of memory to be skipped. "
  30                            "Equivalent to setting environment variable "
  31                            "NPY_AVAILABLE_MEM. Default: determined"
  32                            "automatically."))
  33 
  34 
  35 def pytest_sessionstart(session):
  36     available_mem = session.config.getoption('available_memory')
  37     if available_mem is not None:
  38         os.environ['NPY_AVAILABLE_MEM'] = available_mem
  39 
  40 
  41 #FIXME when yield tests are gone.
  42 @pytest.hookimpl()
  43 def pytest_itemcollected(item):
  44     """
  45     Check FPU precision mode was not changed during test collection.
  46 
  47     The clumsy way we do it here is mainly necessary because numpy
  48     still uses yield tests, which can execute code at test collection
  49     time.
  50     """
  51     global _old_fpu_mode
  52 
  53     mode = get_fpu_mode()
  54 
  55     if _old_fpu_mode is None:
  56         _old_fpu_mode = mode
  57     elif mode != _old_fpu_mode:
  58         _collect_results[item] = (_old_fpu_mode, mode)
  59         _old_fpu_mode = mode
  60 
  61 
  62 @pytest.fixture(scope="function", autouse=True)
  63 def check_fpu_mode(request):
  64     """
  65     Check FPU precision mode was not changed during the test.
  66     """
  67     old_mode = get_fpu_mode()
  68     yield
  69     new_mode = get_fpu_mode()
  70 
  71     if old_mode != new_mode:
  72         raise AssertionError("FPU precision mode changed from {0:#x} to {1:#x}"
  73                              " during the test".format(old_mode, new_mode))
  74 
  75     collect_result = _collect_results.get(request.node)
  76     if collect_result is not None:
  77         old_mode, new_mode = collect_result
  78         raise AssertionError("FPU precision mode changed from {0:#x} to {1:#x}"
  79                              " when collecting the test".format(old_mode,
  80                                                                 new_mode))
  81 
  82 
  83 @pytest.fixture(autouse=True)
  84 def add_np(doctest_namespace):
  85     doctest_namespace['np'] = numpy
  86
  ```
  --- 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/numpy/conftest.py b/numpy/conftest.py
  --- a/numpy/conftest.py
  +++ b/numpy/conftest.py
  @@ -3,6 +3,7 @@
   """
   import os
   
  +import hypothesis
   import pytest
   import numpy
   
  @@ -12,6 +13,12 @@
   _old_fpu_mode = None
   _collect_results = {}
   
  +# See https://hypothesis.readthedocs.io/en/latest/settings.html
  +hypothesis.settings.register_profile(
  +    name="numpy-profile", deadline=None, print_blob=True,
  +)
  +hypothesis.settings.load_profile("numpy-profile")
  +
   
   def pytest_configure(config):
       config.addinivalue_line("markers",
  
verification_info: {"golden_diff": "diff --git a/numpy/conftest.py b/numpy/conftest.py\n--- a/numpy/conftest.py\n+++ b/numpy/conftest.py\n@@ -3,6 +3,7 @@\n \"\"\"\n import os\n \n+import hypothesis\n import pytest\n import numpy\n \n@@ -12,6 +13,12 @@\n _old_fpu_mode = None\n _collect_results = {}\n \n+# See https://hypothesis.readthedocs.io/en/latest/settings.html\n+hypothesis.settings.register_profile(\n+    name=\"numpy-profile\", deadline=None, print_blob=True,\n+)\n+hypothesis.settings.load_profile(\"numpy-profile\")\n+\n \n def pytest_configure(config):\n     config.addinivalue_line(\"markers\",\n", "issue": "TST: Add the first test using hypothesis\nThis pull request adds the first test that uses hypothesis and hence brings in hypothesis as an additional test dependency.\r\n\r\n@mattip Could you take a look at this please?\r\n\n", "before_files": [{"content": "\"\"\"\nPytest configuration and fixtures for the Numpy test suite.\n\"\"\"\nimport os\n\nimport pytest\nimport numpy\n\nfrom numpy.core._multiarray_tests import get_fpu_mode\n\n\n_old_fpu_mode = None\n_collect_results = {}\n\n\ndef pytest_configure(config):\n    config.addinivalue_line(\"markers\",\n        \"valgrind_error: Tests that are known to error under valgrind.\")\n    config.addinivalue_line(\"markers\",\n        \"leaks_references: Tests that are known to leak references.\")\n    config.addinivalue_line(\"markers\",\n        \"slow: Tests that are very slow.\")\n\n\ndef pytest_addoption(parser):\n    parser.addoption(\"--available-memory\", action=\"store\", default=None,\n                     help=(\"Set amount of memory available for running the \"\n                           \"test suite. This can result to tests requiring \"\n                           \"especially large amounts of memory to be skipped. \"\n                           \"Equivalent to setting environment variable \"\n                           \"NPY_AVAILABLE_MEM. Default: determined\"\n                           \"automatically.\"))\n\n\ndef pytest_sessionstart(session):\n    available_mem = session.config.getoption('available_memory')\n    if available_mem is not None:\n        os.environ['NPY_AVAILABLE_MEM'] = available_mem\n\n\n#FIXME when yield tests are gone.\n@pytest.hookimpl()\ndef pytest_itemcollected(item):\n    \"\"\"\n    Check FPU precision mode was not changed during test collection.\n\n    The clumsy way we do it here is mainly necessary because numpy\n    still uses yield tests, which can execute code at test collection\n    time.\n    \"\"\"\n    global _old_fpu_mode\n\n    mode = get_fpu_mode()\n\n    if _old_fpu_mode is None:\n        _old_fpu_mode = mode\n    elif mode != _old_fpu_mode:\n        _collect_results[item] = (_old_fpu_mode, mode)\n        _old_fpu_mode = mode\n\n\n@pytest.fixture(scope=\"function\", autouse=True)\ndef check_fpu_mode(request):\n    \"\"\"\n    Check FPU precision mode was not changed during the test.\n    \"\"\"\n    old_mode = get_fpu_mode()\n    yield\n    new_mode = get_fpu_mode()\n\n    if old_mode != new_mode:\n        raise AssertionError(\"FPU precision mode changed from {0:#x} to {1:#x}\"\n                             \" during the test\".format(old_mode, new_mode))\n\n    collect_result = _collect_results.get(request.node)\n    if collect_result is not None:\n        old_mode, new_mode = collect_result\n        raise AssertionError(\"FPU precision mode changed from {0:#x} to {1:#x}\"\n                             \" when collecting the test\".format(old_mode,\n                                                                new_mode))\n\n\n@pytest.fixture(autouse=True)\ndef add_np(doctest_namespace):\n    doctest_namespace['np'] = numpy\n", "path": "numpy/conftest.py"}], "after_files": [{"content": "\"\"\"\nPytest configuration and fixtures for the Numpy test suite.\n\"\"\"\nimport os\n\nimport hypothesis\nimport pytest\nimport numpy\n\nfrom numpy.core._multiarray_tests import get_fpu_mode\n\n\n_old_fpu_mode = None\n_collect_results = {}\n\n# See https://hypothesis.readthedocs.io/en/latest/settings.html\nhypothesis.settings.register_profile(\n    name=\"numpy-profile\", deadline=None, print_blob=True,\n)\nhypothesis.settings.load_profile(\"numpy-profile\")\n\n\ndef pytest_configure(config):\n    config.addinivalue_line(\"markers\",\n        \"valgrind_error: Tests that are known to error under valgrind.\")\n    config.addinivalue_line(\"markers\",\n        \"leaks_references: Tests that are known to leak references.\")\n    config.addinivalue_line(\"markers\",\n        \"slow: Tests that are very slow.\")\n\n\ndef pytest_addoption(parser):\n    parser.addoption(\"--available-memory\", action=\"store\", default=None,\n                     help=(\"Set amount of memory available for running the \"\n                           \"test suite. This can result to tests requiring \"\n                           \"especially large amounts of memory to be skipped. \"\n                           \"Equivalent to setting environment variable \"\n                           \"NPY_AVAILABLE_MEM. Default: determined\"\n                           \"automatically.\"))\n\n\ndef pytest_sessionstart(session):\n    available_mem = session.config.getoption('available_memory')\n    if available_mem is not None:\n        os.environ['NPY_AVAILABLE_MEM'] = available_mem\n\n\n#FIXME when yield tests are gone.\n@pytest.hookimpl()\ndef pytest_itemcollected(item):\n    \"\"\"\n    Check FPU precision mode was not changed during test collection.\n\n    The clumsy way we do it here is mainly necessary because numpy\n    still uses yield tests, which can execute code at test collection\n    time.\n    \"\"\"\n    global _old_fpu_mode\n\n    mode = get_fpu_mode()\n\n    if _old_fpu_mode is None:\n        _old_fpu_mode = mode\n    elif mode != _old_fpu_mode:\n        _collect_results[item] = (_old_fpu_mode, mode)\n        _old_fpu_mode = mode\n\n\n@pytest.fixture(scope=\"function\", autouse=True)\ndef check_fpu_mode(request):\n    \"\"\"\n    Check FPU precision mode was not changed during the test.\n    \"\"\"\n    old_mode = get_fpu_mode()\n    yield\n    new_mode = get_fpu_mode()\n\n    if old_mode != new_mode:\n        raise AssertionError(\"FPU precision mode changed from {0:#x} to {1:#x}\"\n                             \" during the test\".format(old_mode, new_mode))\n\n    collect_result = _collect_results.get(request.node)\n    if collect_result is not None:\n        old_mode, new_mode = collect_result\n        raise AssertionError(\"FPU precision mode changed from {0:#x} to {1:#x}\"\n                             \" when collecting the test\".format(old_mode,\n                                                                new_mode))\n\n\n@pytest.fixture(autouse=True)\ndef add_np(doctest_namespace):\n    doctest_namespace['np'] = numpy\n", "path": "numpy/conftest.py"}]}