We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Refactor tests
The tests can be DRY'd up significantly. I suggest the following:
- [ ] Implement the same HTTP API across all the supported frameworks
- [ ] Use webtest to test endpoints; create a base test class that tests common functionality


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `tasks.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 import os
3 import sys
4 import webbrowser
5 
6 from invoke import task, run
7 
8 docs_dir = 'docs'
9 build_dir = os.path.join(docs_dir, '_build')
10 
11 @task
12 def test(coverage=False, browse=False):
13     flake()
14     import pytest
15     args = []
16     if coverage:
17         args.extend(['--cov=webargs', '--cov-report=term', '--cov-report=html'])
18 
19     if sys.version_info < (3, 4, 1):
20         args.append('--ignore={0}'.format(os.path.join('tests', 'test_aiohttp')))
21     retcode = pytest.main(args)
22     if coverage and browse:
23         webbrowser.open_new_tab(os.path.join('htmlcov', 'index.html'))
24     sys.exit(retcode)
25 
26 @task
27 def flake():
28     """Run flake8 on codebase."""
29     cmd = 'flake8 .'
30     if sys.version_info < (3, 4, 1):
31         excludes = [
32             os.path.join('tests', 'test_aiohttp'),
33             os.path.join('webargs', 'async.py'),
34             os.path.join('webargs', 'aiohttpparser.py'),
35             os.path.join('examples', 'annotations_example.py'),
36             'build',
37         ]
38         cmd += ' --exclude={0}'.format(','.join(excludes))
39     run(cmd, echo=True)
40 
41 @task
42 def clean():
43     run("rm -rf build")
44     run("rm -rf dist")
45     run("rm -rf webargs.egg-info")
46     clean_docs()
47     print("Cleaned up.")
48 
49 @task
50 def readme(browse=False):
51     run('rst2html.py README.rst > README.html')
52     if browse:
53         webbrowser.open_new_tab('README.html')
54 
55 @task
56 def clean_docs():
57     run("rm -rf %s" % build_dir)
58 
59 @task
60 def browse_docs():
61     path = os.path.join(build_dir, 'index.html')
62     webbrowser.open_new_tab(path)
63 
64 @task
65 def docs(clean=False, browse=False, watch=False):
66     """Build the docs."""
67     if clean:
68         clean_docs()
69     run("sphinx-build %s %s" % (docs_dir, build_dir), echo=True)
70     if browse:
71         browse_docs()
72     if watch:
73         watch_docs()
74 
75 @task
76 def watch_docs():
77     """Run build the docs when a file changes."""
78     try:
79         import sphinx_autobuild  # noqa
80     except ImportError:
81         print('ERROR: watch task requires the sphinx_autobuild package.')
82         print('Install it with:')
83         print('    pip install sphinx-autobuild')
84         sys.exit(1)
85     run('sphinx-autobuild {0} {1} --watch {2}'.format(
86         docs_dir, build_dir, 'webargs'), echo=True, pty=True)
87 
88 @task
89 def publish(test=False):
90     """Publish to the cheeseshop."""
91     clean()
92     if test:
93         run('python setup.py register -r test sdist bdist_wheel', echo=True)
94         run('twine upload dist/* -r test', echo=True)
95     else:
96         run('python setup.py register sdist bdist_wheel', echo=True)
97         run('twine upload dist/*', echo=True)
98
```
--- 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()

```

diff --git a/tasks.py b/tasks.py
--- a/tasks.py
+++ b/tasks.py
@@ -17,7 +17,7 @@
         args.extend(['--cov=webargs', '--cov-report=term', '--cov-report=html'])
 
     if sys.version_info < (3, 4, 1):
-        args.append('--ignore={0}'.format(os.path.join('tests', 'test_aiohttp')))
+        args.append('--ignore={0}'.format(os.path.join('tests', 'test_aiohttpparser.py')))
     retcode = pytest.main(args)
     if coverage and browse:
         webbrowser.open_new_tab(os.path.join('htmlcov', 'index.html'))
@@ -29,7 +29,8 @@
     cmd = 'flake8 .'
     if sys.version_info < (3, 4, 1):
         excludes = [
-            os.path.join('tests', 'test_aiohttp'),
+            os.path.join('tests', 'apps', 'aiohttp_app.py'),
+            os.path.join('tests', 'test_aiohttparser.py'),
             os.path.join('webargs', 'async.py'),
             os.path.join('webargs', 'aiohttpparser.py'),
             os.path.join('examples', 'annotations_example.py'),

{"golden_diff": "diff --git a/tasks.py b/tasks.py\n--- a/tasks.py\n+++ b/tasks.py\n@@ -17,7 +17,7 @@\n         args.extend(['--cov=webargs', '--cov-report=term', '--cov-report=html'])\n \n     if sys.version_info < (3, 4, 1):\n-        args.append('--ignore={0}'.format(os.path.join('tests', 'test_aiohttp')))\n+        args.append('--ignore={0}'.format(os.path.join('tests', 'test_aiohttpparser.py')))\n     retcode = pytest.main(args)\n     if coverage and browse:\n         webbrowser.open_new_tab(os.path.join('htmlcov', 'index.html'))\n@@ -29,7 +29,8 @@\n     cmd = 'flake8 .'\n     if sys.version_info < (3, 4, 1):\n         excludes = [\n-            os.path.join('tests', 'test_aiohttp'),\n+            os.path.join('tests', 'apps', 'aiohttp_app.py'),\n+            os.path.join('tests', 'test_aiohttparser.py'),\n             os.path.join('webargs', 'async.py'),\n             os.path.join('webargs', 'aiohttpparser.py'),\n             os.path.join('examples', 'annotations_example.py'),\n", "issue": "Refactor tests\nThe tests can be DRY'd up significantly. I suggest the following:\n- [ ] Implement the same HTTP API across all the supported frameworks\n- [ ] Use webtest to test endpoints; create a base test class that tests common functionality\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nimport os\nimport sys\nimport webbrowser\n\nfrom invoke import task, run\n\ndocs_dir = 'docs'\nbuild_dir = os.path.join(docs_dir, '_build')\n\n@task\ndef test(coverage=False, browse=False):\n    flake()\n    import pytest\n    args = []\n    if coverage:\n        args.extend(['--cov=webargs', '--cov-report=term', '--cov-report=html'])\n\n    if sys.version_info < (3, 4, 1):\n        args.append('--ignore={0}'.format(os.path.join('tests', 'test_aiohttp')))\n    retcode = pytest.main(args)\n    if coverage and browse:\n        webbrowser.open_new_tab(os.path.join('htmlcov', 'index.html'))\n    sys.exit(retcode)\n\n@task\ndef flake():\n    \"\"\"Run flake8 on codebase.\"\"\"\n    cmd = 'flake8 .'\n    if sys.version_info < (3, 4, 1):\n        excludes = [\n            os.path.join('tests', 'test_aiohttp'),\n            os.path.join('webargs', 'async.py'),\n            os.path.join('webargs', 'aiohttpparser.py'),\n            os.path.join('examples', 'annotations_example.py'),\n            'build',\n        ]\n        cmd += ' --exclude={0}'.format(','.join(excludes))\n    run(cmd, echo=True)\n\n@task\ndef clean():\n    run(\"rm -rf build\")\n    run(\"rm -rf dist\")\n    run(\"rm -rf webargs.egg-info\")\n    clean_docs()\n    print(\"Cleaned up.\")\n\n@task\ndef readme(browse=False):\n    run('rst2html.py README.rst > README.html')\n    if browse:\n        webbrowser.open_new_tab('README.html')\n\n@task\ndef clean_docs():\n    run(\"rm -rf %s\" % build_dir)\n\n@task\ndef browse_docs():\n    path = os.path.join(build_dir, 'index.html')\n    webbrowser.open_new_tab(path)\n\n@task\ndef docs(clean=False, browse=False, watch=False):\n    \"\"\"Build the docs.\"\"\"\n    if clean:\n        clean_docs()\n    run(\"sphinx-build %s %s\" % (docs_dir, build_dir), echo=True)\n    if browse:\n        browse_docs()\n    if watch:\n        watch_docs()\n\n@task\ndef watch_docs():\n    \"\"\"Run build the docs when a file changes.\"\"\"\n    try:\n        import sphinx_autobuild  # noqa\n    except ImportError:\n        print('ERROR: watch task requires the sphinx_autobuild package.')\n        print('Install it with:')\n        print('    pip install sphinx-autobuild')\n        sys.exit(1)\n    run('sphinx-autobuild {0} {1} --watch {2}'.format(\n        docs_dir, build_dir, 'webargs'), echo=True, pty=True)\n\n@task\ndef publish(test=False):\n    \"\"\"Publish to the cheeseshop.\"\"\"\n    clean()\n    if test:\n        run('python setup.py register -r test sdist bdist_wheel', echo=True)\n        run('twine upload dist/* -r test', echo=True)\n    else:\n        run('python setup.py register sdist bdist_wheel', echo=True)\n        run('twine upload dist/*', echo=True)\n", "path": "tasks.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\nimport os\nimport sys\nimport webbrowser\n\nfrom invoke import task, run\n\ndocs_dir = 'docs'\nbuild_dir = os.path.join(docs_dir, '_build')\n\n@task\ndef test(coverage=False, browse=False):\n    flake()\n    import pytest\n    args = []\n    if coverage:\n        args.extend(['--cov=webargs', '--cov-report=term', '--cov-report=html'])\n\n    if sys.version_info < (3, 4, 1):\n        args.append('--ignore={0}'.format(os.path.join('tests', 'test_aiohttpparser.py')))\n    retcode = pytest.main(args)\n    if coverage and browse:\n        webbrowser.open_new_tab(os.path.join('htmlcov', 'index.html'))\n    sys.exit(retcode)\n\n@task\ndef flake():\n    \"\"\"Run flake8 on codebase.\"\"\"\n    cmd = 'flake8 .'\n    if sys.version_info < (3, 4, 1):\n        excludes = [\n            os.path.join('tests', 'apps', 'aiohttp_app.py'),\n            os.path.join('tests', 'test_aiohttparser.py'),\n            os.path.join('webargs', 'async.py'),\n            os.path.join('webargs', 'aiohttpparser.py'),\n            os.path.join('examples', 'annotations_example.py'),\n            'build',\n        ]\n        cmd += ' --exclude={0}'.format(','.join(excludes))\n    run(cmd, echo=True)\n\n@task\ndef clean():\n    run(\"rm -rf build\")\n    run(\"rm -rf dist\")\n    run(\"rm -rf webargs.egg-info\")\n    clean_docs()\n    print(\"Cleaned up.\")\n\n@task\ndef readme(browse=False):\n    run('rst2html.py README.rst > README.html')\n    if browse:\n        webbrowser.open_new_tab('README.html')\n\n@task\ndef clean_docs():\n    run(\"rm -rf %s\" % build_dir)\n\n@task\ndef browse_docs():\n    path = os.path.join(build_dir, 'index.html')\n    webbrowser.open_new_tab(path)\n\n@task\ndef docs(clean=False, browse=False, watch=False):\n    \"\"\"Build the docs.\"\"\"\n    if clean:\n        clean_docs()\n    run(\"sphinx-build %s %s\" % (docs_dir, build_dir), echo=True)\n    if browse:\n        browse_docs()\n    if watch:\n        watch_docs()\n\n@task\ndef watch_docs():\n    \"\"\"Run build the docs when a file changes.\"\"\"\n    try:\n        import sphinx_autobuild  # noqa\n    except ImportError:\n        print('ERROR: watch task requires the sphinx_autobuild package.')\n        print('Install it with:')\n        print('    pip install sphinx-autobuild')\n        sys.exit(1)\n    run('sphinx-autobuild {0} {1} --watch {2}'.format(\n        docs_dir, build_dir, 'webargs'), echo=True, pty=True)\n\n@task\ndef publish(test=False):\n    \"\"\"Publish to the cheeseshop.\"\"\"\n    clean()\n    if test:\n        run('python setup.py register -r test sdist bdist_wheel', echo=True)\n        run('twine upload dist/* -r test', echo=True)\n    else:\n        run('python setup.py register sdist bdist_wheel', echo=True)\n        run('twine upload dist/*', echo=True)\n", "path": "tasks.py"}]}