prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  TST: make _skip_if into pytest decorators
  - [X] _skip_if_32bit (#18693)
  - [X] _skip_if_no_mpl (#18427)
  - [X] _skip_if_mpl_1_5 (#18682)
  - [x] _skip_if_no_scipy (#18794)
  - [x] _skip_if_no_lzma (#18820)
  - [x] _skip_if_no_xarray (#18814)
  - [X] _skip_if_windows_python_3 (#18693)
  - [X] _skip_if_windows (#18693)
  - [x] _skip_if_no_pathlib (#18765) 
  - [x] _skip_if_no_localpath (#18765)
  - [x] skip_if_no_ne (#18820)
  - [x] _skip_if_has_locale (#18745) 
  - [x] _skip_if_not_us_locale (#18745)
  - [ ] _skip_if_no_mock
  - [x] _skip_if_no_ipython (#18814)
  - [ ] skip_if_no_package
  
  we should move the ``_skip_if_*`` functions out of ``pandas.util.testing`` to another (private module)
  
  then we can add [skipif decorators](http://pytest.readthedocs.io/en/reorganize-docs/new-docs/user/skipping.html)
  
  and use like this
  
  ```
  @skip_if_windows_py3
  def test_.......():
  ```
  
  rather than calling ``tm._skip_if_windows_py390`` in the body of the function (sometimes you also need to do that, so we leave the functions themselves as well).
  
  this makes much more idiomatic and readable pytest code and removes the need to roll your own when using the decorator.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `pandas/conftest.py`
  Content:
  ```
  1 import pytest
  2 
  3 from distutils.version import LooseVersion
  4 import numpy
  5 import pandas
  6 import pandas.util.testing as tm
  7 import dateutil
  8 
  9 
  10 def pytest_addoption(parser):
  11     parser.addoption("--skip-slow", action="store_true",
  12                      help="skip slow tests")
  13     parser.addoption("--skip-network", action="store_true",
  14                      help="skip network tests")
  15     parser.addoption("--run-high-memory", action="store_true",
  16                      help="run high memory tests")
  17     parser.addoption("--only-slow", action="store_true",
  18                      help="run only slow tests")
  19 
  20 
  21 def pytest_runtest_setup(item):
  22     if 'slow' in item.keywords and item.config.getoption("--skip-slow"):
  23         pytest.skip("skipping due to --skip-slow")
  24 
  25     if 'slow' not in item.keywords and item.config.getoption("--only-slow"):
  26         pytest.skip("skipping due to --only-slow")
  27 
  28     if 'network' in item.keywords and item.config.getoption("--skip-network"):
  29         pytest.skip("skipping due to --skip-network")
  30 
  31     if 'high_memory' in item.keywords and not item.config.getoption(
  32             "--run-high-memory"):
  33         pytest.skip(
  34             "skipping high memory test since --run-high-memory was not set")
  35 
  36 
  37 # Configurations for all tests and all test modules
  38 
  39 @pytest.fixture(autouse=True)
  40 def configure_tests():
  41     pandas.set_option('chained_assignment', 'raise')
  42 
  43 
  44 # For running doctests: make np and pd names available
  45 
  46 @pytest.fixture(autouse=True)
  47 def add_imports(doctest_namespace):
  48     doctest_namespace['np'] = numpy
  49     doctest_namespace['pd'] = pandas
  50 
  51 
  52 @pytest.fixture(params=['bsr', 'coo', 'csc', 'csr', 'dia', 'dok', 'lil'])
  53 def spmatrix(request):
  54     tm._skip_if_no_scipy()
  55     from scipy import sparse
  56     return getattr(sparse, request.param + '_matrix')
  57 
  58 
  59 @pytest.fixture
  60 def ip():
  61     """
  62     Get an instance of IPython.InteractiveShell.
  63 
  64     Will raise a skip if IPython is not installed.
  65     """
  66 
  67     pytest.importorskip('IPython', minversion="6.0.0")
  68     from IPython.core.interactiveshell import InteractiveShell
  69     return InteractiveShell()
  70 
  71 
  72 is_dateutil_le_261 = pytest.mark.skipif(
  73     LooseVersion(dateutil.__version__) > LooseVersion('2.6.1'),
  74     reason="dateutil api change version")
  75 is_dateutil_gt_261 = pytest.mark.skipif(
  76     LooseVersion(dateutil.__version__) <= LooseVersion('2.6.1'),
  77     reason="dateutil stable version")
  78
  ```
  --- 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/pandas/conftest.py b/pandas/conftest.py
  --- a/pandas/conftest.py
  +++ b/pandas/conftest.py
  @@ -3,7 +3,6 @@
   from distutils.version import LooseVersion
   import numpy
   import pandas
  -import pandas.util.testing as tm
   import dateutil
   
   
  @@ -51,7 +50,6 @@
   
   @pytest.fixture(params=['bsr', 'coo', 'csc', 'csr', 'dia', 'dok', 'lil'])
   def spmatrix(request):
  -    tm._skip_if_no_scipy()
       from scipy import sparse
       return getattr(sparse, request.param + '_matrix')
  
verification_info: {"golden_diff": "diff --git a/pandas/conftest.py b/pandas/conftest.py\n--- a/pandas/conftest.py\n+++ b/pandas/conftest.py\n@@ -3,7 +3,6 @@\n from distutils.version import LooseVersion\n import numpy\n import pandas\n-import pandas.util.testing as tm\n import dateutil\n \n \n@@ -51,7 +50,6 @@\n \n @pytest.fixture(params=['bsr', 'coo', 'csc', 'csr', 'dia', 'dok', 'lil'])\n def spmatrix(request):\n-    tm._skip_if_no_scipy()\n     from scipy import sparse\n     return getattr(sparse, request.param + '_matrix')\n", "issue": "TST: make _skip_if into pytest decorators\n- [X] _skip_if_32bit (#18693)\r\n- [X] _skip_if_no_mpl (#18427)\r\n- [X] _skip_if_mpl_1_5 (#18682)\r\n- [x] _skip_if_no_scipy (#18794)\r\n- [x] _skip_if_no_lzma (#18820)\r\n- [x] _skip_if_no_xarray (#18814)\r\n- [X] _skip_if_windows_python_3 (#18693)\r\n- [X] _skip_if_windows (#18693)\r\n- [x] _skip_if_no_pathlib (#18765) \r\n- [x] _skip_if_no_localpath (#18765)\r\n- [x] skip_if_no_ne (#18820)\r\n- [x] _skip_if_has_locale (#18745) \r\n- [x] _skip_if_not_us_locale (#18745)\r\n- [ ] _skip_if_no_mock\r\n- [x] _skip_if_no_ipython (#18814)\r\n- [ ] skip_if_no_package\r\n\r\nwe should move the ``_skip_if_*`` functions out of ``pandas.util.testing`` to another (private module)\r\n\r\nthen we can add [skipif decorators](http://pytest.readthedocs.io/en/reorganize-docs/new-docs/user/skipping.html)\r\n\r\nand use like this\r\n\r\n```\r\n@skip_if_windows_py3\r\ndef test_.......():\r\n```\r\n\r\nrather than calling ``tm._skip_if_windows_py390`` in the body of the function (sometimes you also need to do that, so we leave the functions themselves as well).\r\n\r\nthis makes much more idiomatic and readable pytest code and removes the need to roll your own when using the decorator.\r\n\n", "before_files": [{"content": "import pytest\n\nfrom distutils.version import LooseVersion\nimport numpy\nimport pandas\nimport pandas.util.testing as tm\nimport dateutil\n\n\ndef pytest_addoption(parser):\n    parser.addoption(\"--skip-slow\", action=\"store_true\",\n                     help=\"skip slow tests\")\n    parser.addoption(\"--skip-network\", action=\"store_true\",\n                     help=\"skip network tests\")\n    parser.addoption(\"--run-high-memory\", action=\"store_true\",\n                     help=\"run high memory tests\")\n    parser.addoption(\"--only-slow\", action=\"store_true\",\n                     help=\"run only slow tests\")\n\n\ndef pytest_runtest_setup(item):\n    if 'slow' in item.keywords and item.config.getoption(\"--skip-slow\"):\n        pytest.skip(\"skipping due to --skip-slow\")\n\n    if 'slow' not in item.keywords and item.config.getoption(\"--only-slow\"):\n        pytest.skip(\"skipping due to --only-slow\")\n\n    if 'network' in item.keywords and item.config.getoption(\"--skip-network\"):\n        pytest.skip(\"skipping due to --skip-network\")\n\n    if 'high_memory' in item.keywords and not item.config.getoption(\n            \"--run-high-memory\"):\n        pytest.skip(\n            \"skipping high memory test since --run-high-memory was not set\")\n\n\n# Configurations for all tests and all test modules\n\n@pytest.fixture(autouse=True)\ndef configure_tests():\n    pandas.set_option('chained_assignment', 'raise')\n\n\n# For running doctests: make np and pd names available\n\n@pytest.fixture(autouse=True)\ndef add_imports(doctest_namespace):\n    doctest_namespace['np'] = numpy\n    doctest_namespace['pd'] = pandas\n\n\n@pytest.fixture(params=['bsr', 'coo', 'csc', 'csr', 'dia', 'dok', 'lil'])\ndef spmatrix(request):\n    tm._skip_if_no_scipy()\n    from scipy import sparse\n    return getattr(sparse, request.param + '_matrix')\n\n\n@pytest.fixture\ndef ip():\n    \"\"\"\n    Get an instance of IPython.InteractiveShell.\n\n    Will raise a skip if IPython is not installed.\n    \"\"\"\n\n    pytest.importorskip('IPython', minversion=\"6.0.0\")\n    from IPython.core.interactiveshell import InteractiveShell\n    return InteractiveShell()\n\n\nis_dateutil_le_261 = pytest.mark.skipif(\n    LooseVersion(dateutil.__version__) > LooseVersion('2.6.1'),\n    reason=\"dateutil api change version\")\nis_dateutil_gt_261 = pytest.mark.skipif(\n    LooseVersion(dateutil.__version__) <= LooseVersion('2.6.1'),\n    reason=\"dateutil stable version\")\n", "path": "pandas/conftest.py"}], "after_files": [{"content": "import pytest\n\nfrom distutils.version import LooseVersion\nimport numpy\nimport pandas\nimport dateutil\n\n\ndef pytest_addoption(parser):\n    parser.addoption(\"--skip-slow\", action=\"store_true\",\n                     help=\"skip slow tests\")\n    parser.addoption(\"--skip-network\", action=\"store_true\",\n                     help=\"skip network tests\")\n    parser.addoption(\"--run-high-memory\", action=\"store_true\",\n                     help=\"run high memory tests\")\n    parser.addoption(\"--only-slow\", action=\"store_true\",\n                     help=\"run only slow tests\")\n\n\ndef pytest_runtest_setup(item):\n    if 'slow' in item.keywords and item.config.getoption(\"--skip-slow\"):\n        pytest.skip(\"skipping due to --skip-slow\")\n\n    if 'slow' not in item.keywords and item.config.getoption(\"--only-slow\"):\n        pytest.skip(\"skipping due to --only-slow\")\n\n    if 'network' in item.keywords and item.config.getoption(\"--skip-network\"):\n        pytest.skip(\"skipping due to --skip-network\")\n\n    if 'high_memory' in item.keywords and not item.config.getoption(\n            \"--run-high-memory\"):\n        pytest.skip(\n            \"skipping high memory test since --run-high-memory was not set\")\n\n\n# Configurations for all tests and all test modules\n\n@pytest.fixture(autouse=True)\ndef configure_tests():\n    pandas.set_option('chained_assignment', 'raise')\n\n\n# For running doctests: make np and pd names available\n\n@pytest.fixture(autouse=True)\ndef add_imports(doctest_namespace):\n    doctest_namespace['np'] = numpy\n    doctest_namespace['pd'] = pandas\n\n\n@pytest.fixture(params=['bsr', 'coo', 'csc', 'csr', 'dia', 'dok', 'lil'])\ndef spmatrix(request):\n    from scipy import sparse\n    return getattr(sparse, request.param + '_matrix')\n\n\n@pytest.fixture\ndef ip():\n    \"\"\"\n    Get an instance of IPython.InteractiveShell.\n\n    Will raise a skip if IPython is not installed.\n    \"\"\"\n\n    pytest.importorskip('IPython', minversion=\"6.0.0\")\n    from IPython.core.interactiveshell import InteractiveShell\n    return InteractiveShell()\n\n\nis_dateutil_le_261 = pytest.mark.skipif(\n    LooseVersion(dateutil.__version__) > LooseVersion('2.6.1'),\n    reason=\"dateutil api change version\")\nis_dateutil_gt_261 = pytest.mark.skipif(\n    LooseVersion(dateutil.__version__) <= LooseVersion('2.6.1'),\n    reason=\"dateutil stable version\")\n", "path": "pandas/conftest.py"}]}