prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  State leakage across test runs when using parrellization
  ### What is wrong.
  
  The tests at `tests/examples/safe_remote_purchase/test_safe_remote_purchase.py` fail when run using `pytest-xdist` to parallelize test runs.
  
  ```
      def test_abort(w3, assert_tx_failed, check_balance, get_contract, contract_code):
          a0, a1, a2 = w3.eth.accounts[:3]
          c = get_contract(contract_code, value=2)
          # Only sender can trigger refund
          assert_tx_failed(lambda: c.abort(transact={'from': a2}))
          # Refund works correctly
          c.abort(transact={'from': a0, 'gasPrice': 0})
  >       assert check_balance() == (INIT_BAL_a0 - w3.toWei(2, 'ether'), INIT_BAL_a1)
  E       assert (100000000000...0000000000000) == (9999980000000...0000000000000)
  E         At index 0 diff: 1000000000000000000000000 != 999998000000000000000000
  E         Use -v to get the full diff
  
  tests/examples/safe_remote_purchase/test_safe_remote_purchase.py:62: AssertionError
  ```
  
  replicate by installing `pytest-xdist` and running with
  
  ```
  pytest tests/examples/safe_remote_purchase/test_safe_remote_purchase.py -n 2
  ```
  
  It's likely this isn't deterministic and you may need to run the full suite.
  
  ### How can it be fixed.
  
  Figure out where statefulness is leaking across test runs and fix it.
  
  </issue>
  <code>
  [start of setup.py]
  1 # -*- coding: utf-8 -*-
  2 
  3 from setuptools import setup, find_packages
  4 
  5 
  6 test_deps = [
  7     'pytest',
  8     'pytest-cov',
  9     'py-evm==0.2.0a34',
  10     'eth-tester==0.1.0b33',
  11     'web3==4.8.2',
  12 ]
  13 
  14 
  15 extras = {
  16     'test': test_deps
  17 }
  18 
  19 
  20 setup(
  21     name='vyper',
  22     # *IMPORTANT*: Don't manually change the version here. Use the 'bumpversion' utility.
  23     version='0.1.0-beta.8',
  24     description='Vyper Programming Language for Ethereum',
  25     long_description_markdown_filename='README.md',
  26     author='Vitalik Buterin',
  27     author_email='',
  28     url='https://github.com/ethereum/vyper',
  29     license="MIT",
  30     keywords='ethereum',
  31     include_package_data=True,
  32     packages=find_packages(exclude=('tests', 'docs')),
  33     python_requires='>=3.6',
  34     py_modules=['vyper'],
  35     install_requires=[
  36         'pycryptodome>=3.5.1,<4',
  37     ],
  38     setup_requires=[
  39         'pytest-runner',
  40         'setuptools-markdown'
  41     ],
  42     tests_require=test_deps,
  43     extras_require=extras,
  44     scripts=[
  45         'bin/vyper',
  46         'bin/vyper-serve',
  47         'bin/vyper-lll'
  48     ],
  49     classifiers=[
  50         'Intended Audience :: Developers',
  51         'License :: OSI Approved :: MIT License',
  52         'Programming Language :: Python :: 3.6',
  53     ]
  54 )
  55
  [end of setup.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/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -4,11 +4,12 @@
   
   
   test_deps = [
  -    'pytest',
  -    'pytest-cov',
  -    'py-evm==0.2.0a34',
  -    'eth-tester==0.1.0b33',
  -    'web3==4.8.2',
  +    'pytest>=3.6',
  +    'pytest-cov==2.4.0',
  +    'pytest-xdist==1.18.1',
  +    'py-evm==0.2.0a39',
  +    'eth-tester==0.1.0b37',
  +    'web3==5.0.0a6'
   ]
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -4,11 +4,12 @@\n \n \n test_deps = [\n-    'pytest',\n-    'pytest-cov',\n-    'py-evm==0.2.0a34',\n-    'eth-tester==0.1.0b33',\n-    'web3==4.8.2',\n+    'pytest>=3.6',\n+    'pytest-cov==2.4.0',\n+    'pytest-xdist==1.18.1',\n+    'py-evm==0.2.0a39',\n+    'eth-tester==0.1.0b37',\n+    'web3==5.0.0a6'\n ]\n", "issue": "State leakage across test runs when using parrellization\n### What is wrong.\r\n\r\nThe tests at `tests/examples/safe_remote_purchase/test_safe_remote_purchase.py` fail when run using `pytest-xdist` to parallelize test runs.\r\n\r\n```\r\n    def test_abort(w3, assert_tx_failed, check_balance, get_contract, contract_code):\r\n        a0, a1, a2 = w3.eth.accounts[:3]\r\n        c = get_contract(contract_code, value=2)\r\n        # Only sender can trigger refund\r\n        assert_tx_failed(lambda: c.abort(transact={'from': a2}))\r\n        # Refund works correctly\r\n        c.abort(transact={'from': a0, 'gasPrice': 0})\r\n>       assert check_balance() == (INIT_BAL_a0 - w3.toWei(2, 'ether'), INIT_BAL_a1)\r\nE       assert (100000000000...0000000000000) == (9999980000000...0000000000000)\r\nE         At index 0 diff: 1000000000000000000000000 != 999998000000000000000000\r\nE         Use -v to get the full diff\r\n\r\ntests/examples/safe_remote_purchase/test_safe_remote_purchase.py:62: AssertionError\r\n```\r\n\r\nreplicate by installing `pytest-xdist` and running with\r\n\r\n```\r\npytest tests/examples/safe_remote_purchase/test_safe_remote_purchase.py -n 2\r\n```\r\n\r\nIt's likely this isn't deterministic and you may need to run the full suite.\r\n\r\n### How can it be fixed.\r\n\r\nFigure out where statefulness is leaking across test runs and fix it.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\nfrom setuptools import setup, find_packages\n\n\ntest_deps = [\n    'pytest',\n    'pytest-cov',\n    'py-evm==0.2.0a34',\n    'eth-tester==0.1.0b33',\n    'web3==4.8.2',\n]\n\n\nextras = {\n    'test': test_deps\n}\n\n\nsetup(\n    name='vyper',\n    # *IMPORTANT*: Don't manually change the version here. Use the 'bumpversion' utility.\n    version='0.1.0-beta.8',\n    description='Vyper Programming Language for Ethereum',\n    long_description_markdown_filename='README.md',\n    author='Vitalik Buterin',\n    author_email='',\n    url='https://github.com/ethereum/vyper',\n    license=\"MIT\",\n    keywords='ethereum',\n    include_package_data=True,\n    packages=find_packages(exclude=('tests', 'docs')),\n    python_requires='>=3.6',\n    py_modules=['vyper'],\n    install_requires=[\n        'pycryptodome>=3.5.1,<4',\n    ],\n    setup_requires=[\n        'pytest-runner',\n        'setuptools-markdown'\n    ],\n    tests_require=test_deps,\n    extras_require=extras,\n    scripts=[\n        'bin/vyper',\n        'bin/vyper-serve',\n        'bin/vyper-lll'\n    ],\n    classifiers=[\n        'Intended Audience :: Developers',\n        'License :: OSI Approved :: MIT License',\n        'Programming Language :: Python :: 3.6',\n    ]\n)\n", "path": "setup.py"}]}