prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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
  
  
  </issue>
  <code>
  [start of tasks.py]
  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 of tasks.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: 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'),
  
verification_info: {"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"}]}