prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Defer `pytest` import?
  Looks like `pytest` isn't the safest dependency, causing issues with scikit-learn: https://community.plot.ly/t/pytest-transient-dependency/25383
  
  Could we move the `import pytest` into the testing module/class/function itself and not require it upon install? We could even have a separate install with setup.py's "extras" feature (https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies) like `pip install dash[testing]` or something.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `setup.py`
  Content:
  ```
  1 import io
  2 from setuptools import setup, find_packages
  3 
  4 main_ns = {}
  5 exec(open("dash/version.py").read(), main_ns)  # pylint: disable=exec-used
  6 
  7 
  8 def read_req_file(req_type):
  9     with open("requires-{}.txt".format(req_type)) as fp:
  10         requires = (line.strip() for line in fp)
  11         return [req for req in requires if req and not req.startswith("#")]
  12 
  13 
  14 setup(
  15     name="dash",
  16     version=main_ns["__version__"],
  17     author="chris p",
  18     author_email="chris@plot.ly",
  19     packages=find_packages(exclude=["tests*"]),
  20     include_package_data=True,
  21     license="MIT",
  22     description=(
  23         "A Python framework for building reactive web-apps. "
  24         "Developed by Plotly."
  25     ),
  26     long_description=io.open("README.md", encoding="utf-8").read(),
  27     long_description_content_type="text/markdown",
  28     install_requires=read_req_file("install"),
  29     extras_require={"ci": read_req_file("ci")},
  30     entry_points={
  31         "console_scripts": [
  32             "dash-generate-components ="
  33             " dash.development.component_generator:cli"
  34         ],
  35         "pytest11": ["dash = dash.testing.plugin"],
  36     },
  37     url="https://plot.ly/dash",
  38     classifiers=[
  39         "Development Status :: 5 - Production/Stable",
  40         "Environment :: Web Environment",
  41         "Framework :: Flask",
  42         "Intended Audience :: Developers",
  43         "Intended Audience :: Education",
  44         "Intended Audience :: Financial and Insurance Industry",
  45         "Intended Audience :: Healthcare Industry",
  46         "Intended Audience :: Manufacturing",
  47         "Intended Audience :: Science/Research",
  48         "License :: OSI Approved :: MIT License",
  49         "Programming Language :: Python",
  50         "Programming Language :: Python :: 2",
  51         "Programming Language :: Python :: 2.7",
  52         "Programming Language :: Python :: 3",
  53         "Programming Language :: Python :: 3.3",
  54         "Programming Language :: Python :: 3.4",
  55         "Programming Language :: Python :: 3.5",
  56         "Programming Language :: Python :: 3.6",
  57         "Programming Language :: Python :: 3.7",
  58         "Topic :: Database :: Front-Ends",
  59         "Topic :: Office/Business :: Financial :: Spreadsheet",
  60         "Topic :: Scientific/Engineering :: Visualization",
  61         "Topic :: Software Development :: Libraries :: Application Frameworks",
  62         "Topic :: Software Development :: Widget Sets",
  63     ],
  64 )
  65
  ```
  --- 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/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -26,7 +26,10 @@
       long_description=io.open("README.md", encoding="utf-8").read(),
       long_description_content_type="text/markdown",
       install_requires=read_req_file("install"),
  -    extras_require={"ci": read_req_file("ci")},
  +    extras_require={
  +        "ci": read_req_file("ci"),
  +        "testing": read_req_file("testing"),
  +    },
       entry_points={
           "console_scripts": [
               "dash-generate-components ="
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -26,7 +26,10 @@\n     long_description=io.open(\"README.md\", encoding=\"utf-8\").read(),\n     long_description_content_type=\"text/markdown\",\n     install_requires=read_req_file(\"install\"),\n-    extras_require={\"ci\": read_req_file(\"ci\")},\n+    extras_require={\n+        \"ci\": read_req_file(\"ci\"),\n+        \"testing\": read_req_file(\"testing\"),\n+    },\n     entry_points={\n         \"console_scripts\": [\n             \"dash-generate-components =\"\n", "issue": "Defer `pytest` import?\nLooks like `pytest` isn't the safest dependency, causing issues with scikit-learn: https://community.plot.ly/t/pytest-transient-dependency/25383\r\n\r\nCould we move the `import pytest` into the testing module/class/function itself and not require it upon install? We could even have a separate install with setup.py's \"extras\" feature (https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies) like `pip install dash[testing]` or something.\n", "before_files": [{"content": "import io\nfrom setuptools import setup, find_packages\n\nmain_ns = {}\nexec(open(\"dash/version.py\").read(), main_ns)  # pylint: disable=exec-used\n\n\ndef read_req_file(req_type):\n    with open(\"requires-{}.txt\".format(req_type)) as fp:\n        requires = (line.strip() for line in fp)\n        return [req for req in requires if req and not req.startswith(\"#\")]\n\n\nsetup(\n    name=\"dash\",\n    version=main_ns[\"__version__\"],\n    author=\"chris p\",\n    author_email=\"chris@plot.ly\",\n    packages=find_packages(exclude=[\"tests*\"]),\n    include_package_data=True,\n    license=\"MIT\",\n    description=(\n        \"A Python framework for building reactive web-apps. \"\n        \"Developed by Plotly.\"\n    ),\n    long_description=io.open(\"README.md\", encoding=\"utf-8\").read(),\n    long_description_content_type=\"text/markdown\",\n    install_requires=read_req_file(\"install\"),\n    extras_require={\"ci\": read_req_file(\"ci\")},\n    entry_points={\n        \"console_scripts\": [\n            \"dash-generate-components =\"\n            \" dash.development.component_generator:cli\"\n        ],\n        \"pytest11\": [\"dash = dash.testing.plugin\"],\n    },\n    url=\"https://plot.ly/dash\",\n    classifiers=[\n        \"Development Status :: 5 - Production/Stable\",\n        \"Environment :: Web Environment\",\n        \"Framework :: Flask\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Education\",\n        \"Intended Audience :: Financial and Insurance Industry\",\n        \"Intended Audience :: Healthcare Industry\",\n        \"Intended Audience :: Manufacturing\",\n        \"Intended Audience :: Science/Research\",\n        \"License :: OSI Approved :: MIT License\",\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 2\",\n        \"Programming Language :: Python :: 2.7\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.3\",\n        \"Programming Language :: Python :: 3.4\",\n        \"Programming Language :: Python :: 3.5\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Topic :: Database :: Front-Ends\",\n        \"Topic :: Office/Business :: Financial :: Spreadsheet\",\n        \"Topic :: Scientific/Engineering :: Visualization\",\n        \"Topic :: Software Development :: Libraries :: Application Frameworks\",\n        \"Topic :: Software Development :: Widget Sets\",\n    ],\n)\n", "path": "setup.py"}], "after_files": [{"content": "import io\nfrom setuptools import setup, find_packages\n\nmain_ns = {}\nexec(open(\"dash/version.py\").read(), main_ns)  # pylint: disable=exec-used\n\n\ndef read_req_file(req_type):\n    with open(\"requires-{}.txt\".format(req_type)) as fp:\n        requires = (line.strip() for line in fp)\n        return [req for req in requires if req and not req.startswith(\"#\")]\n\n\nsetup(\n    name=\"dash\",\n    version=main_ns[\"__version__\"],\n    author=\"chris p\",\n    author_email=\"chris@plot.ly\",\n    packages=find_packages(exclude=[\"tests*\"]),\n    include_package_data=True,\n    license=\"MIT\",\n    description=(\n        \"A Python framework for building reactive web-apps. \"\n        \"Developed by Plotly.\"\n    ),\n    long_description=io.open(\"README.md\", encoding=\"utf-8\").read(),\n    long_description_content_type=\"text/markdown\",\n    install_requires=read_req_file(\"install\"),\n    extras_require={\n        \"ci\": read_req_file(\"ci\"),\n        \"testing\": read_req_file(\"testing\"),\n    },\n    entry_points={\n        \"console_scripts\": [\n            \"dash-generate-components =\"\n            \" dash.development.component_generator:cli\"\n        ],\n        \"pytest11\": [\"dash = dash.testing.plugin\"],\n    },\n    url=\"https://plot.ly/dash\",\n    classifiers=[\n        \"Development Status :: 5 - Production/Stable\",\n        \"Environment :: Web Environment\",\n        \"Framework :: Flask\",\n        \"Intended Audience :: Developers\",\n        \"Intended Audience :: Education\",\n        \"Intended Audience :: Financial and Insurance Industry\",\n        \"Intended Audience :: Healthcare Industry\",\n        \"Intended Audience :: Manufacturing\",\n        \"Intended Audience :: Science/Research\",\n        \"License :: OSI Approved :: MIT License\",\n        \"Programming Language :: Python\",\n        \"Programming Language :: Python :: 2\",\n        \"Programming Language :: Python :: 2.7\",\n        \"Programming Language :: Python :: 3\",\n        \"Programming Language :: Python :: 3.3\",\n        \"Programming Language :: Python :: 3.4\",\n        \"Programming Language :: Python :: 3.5\",\n        \"Programming Language :: Python :: 3.6\",\n        \"Programming Language :: Python :: 3.7\",\n        \"Topic :: Database :: Front-Ends\",\n        \"Topic :: Office/Business :: Financial :: Spreadsheet\",\n        \"Topic :: Scientific/Engineering :: Visualization\",\n        \"Topic :: Software Development :: Libraries :: Application Frameworks\",\n        \"Topic :: Software Development :: Widget Sets\",\n    ],\n)\n", "path": "setup.py"}]}