prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Fix pytest warnings in Python 3
  `pytests` currently produces the following warnings:
  
      mobly/mobly/test_runner.py:181: PytestWarning: cannot collect test class 'TestRunner' because it has a __init__ constructor
        class TestRunner(object):
  
      mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.
        expected_completed_and_passed)
  
      mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.
        expected_completed_and_passed)
  
      mobly/tests/mobly/base_instrumentation_test_test.py:192: DeprecationWarning: Please use assertEqual instead.
        self.assertEquals(actual_test.begin_time, expected_begin_time)
      mobly/tests/mobly/base_instrumentation_test_test.py:193: DeprecationWarning: Please use assertEqual instead.
        self.assertEquals(actual_test.end_time, expected_end_time)
  
      mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.
        expected_completed_and_passed)
      mobly/tests/mobly/base_instrumentation_test_test.py:192: DeprecationWarning: Please use assertEqual instead.
        self.assertEquals(actual_test.begin_time, expected_begin_time)
      mobly/tests/mobly/base_instrumentation_test_test.py:193: DeprecationWarning: Please use assertEqual instead.
        self.assertEquals(actual_test.end_time, expected_end_time)
      mobly/tests/mobly/base_instrumentation_test_test.py:192: DeprecationWarning: Please use assertEqual instead.
        self.assertEquals(actual_test.begin_time, expected_begin_time)
      mobly/tests/mobly/base_instrumentation_test_test.py:193: DeprecationWarning: Please use assertEqual instead.
        self.assertEquals(actual_test.end_time, expected_end_time)
  
      mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.
        expected_completed_and_passed)
  
      mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.
        expected_completed_and_passed)
  
      mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.
        expected_completed_and_passed)
      mobly/tests/mobly/base_instrumentation_test_test.py:192: DeprecationWarning: Please use assertEqual instead.
        self.assertEquals(actual_test.begin_time, expected_begin_time)
      mobly/tests/mobly/base_instrumentation_test_test.py:193: DeprecationWarning: Please use assertEqual instead.
        self.assertEquals(actual_test.end_time, expected_end_time)
      mobly/tests/mobly/base_instrumentation_test_test.py:192: DeprecationWarning: Please use assertEqual instead.
        self.assertEquals(actual_test.begin_time, expected_begin_time)
      mobly/tests/mobly/base_instrumentation_test_test.py:193: DeprecationWarning: Please use assertEqual instead.
        self.assertEquals(actual_test.end_time, expected_end_time)
  
      mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.
        expected_completed_and_passed)
  
      mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.
        expected_completed_and_passed)
      mobly/tests/mobly/base_instrumentation_test_test.py:192: DeprecationWarning: Please use assertEqual instead.
        self.assertEquals(actual_test.begin_time, expected_begin_time)
      mobly/tests/mobly/base_instrumentation_test_test.py:193: DeprecationWarning: Please use assertEqual instead.
        self.assertEquals(actual_test.end_time, expected_end_time)
  
      mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.
        expected_completed_and_passed)
  
      mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.
        expected_completed_and_passed)
  
      mobly/tests/mobly/output_test.py:171: DeprecationWarning: Please use assertNotEqual instead.
        self.assertNotEquals(output_dir1, output_dir2)
  
      mobly/tests/mobly/output_test.py:205: DeprecationWarning: Please use assertNotEqual instead.
        self.assertNotEquals(output_dir1, output_dir2)
  
      -- Docs: https://docs.pytest.org/en/latest/warnings.html
  
  --- 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 # Copyright 2016 Google Inc.
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 #
  7 #     http://www.apache.org/licenses/LICENSE-2.0
  8 #
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 
  15 import platform
  16 import setuptools
  17 from setuptools.command import test
  18 import sys
  19 
  20 install_requires = [
  21     'future', 'portpicker', 'psutil>=5.4.4', 'pyserial', 'pyyaml',
  22     'timeout_decorator'
  23 ]
  24 
  25 if sys.version_info < (3, ):
  26     install_requires.extend([
  27         'enum34',
  28         # "futures" is needed for py2 compatibility and it only works in 2.7
  29         'futures',
  30     ])
  31 
  32 if platform.system() == 'Windows':
  33     install_requires.append('pywin32')
  34 
  35 
  36 class PyTest(test.test):
  37     """Class used to execute unit tests using PyTest. This allows us to execute
  38     unit tests without having to install the package.
  39     """
  40 
  41     def finalize_options(self):
  42         test.test.finalize_options(self)
  43         self.test_args = ['-x', "tests"]
  44         self.test_suite = True
  45 
  46     def run_tests(self):
  47         import pytest
  48         errno = pytest.main(self.test_args)
  49         sys.exit(errno)
  50 
  51 
  52 def main():
  53     setuptools.setup(
  54         name='mobly',
  55         version='1.7.5',
  56         maintainer='Ang Li',
  57         maintainer_email='mobly-github@googlegroups.com',
  58         description='Automation framework for special end-to-end test cases',
  59         license='Apache2.0',
  60         url='https://github.com/google/mobly',
  61         download_url='https://github.com/google/mobly/tarball/1.7.5',
  62         packages=setuptools.find_packages(),
  63         include_package_data=False,
  64         scripts=['tools/sl4a_shell.py', 'tools/snippet_shell.py'],
  65         tests_require=[
  66             'mock',
  67             'pytest',
  68             'pytz',
  69         ],
  70         install_requires=install_requires,
  71         cmdclass={'test': PyTest},
  72     )
  73 
  74 
  75 if __name__ == '__main__':
  76     main()
  77
  ```
  --- 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
  @@ -40,7 +40,7 @@
   
       def finalize_options(self):
           test.test.finalize_options(self)
  -        self.test_args = ['-x', "tests"]
  +        self.test_args = ['-x', "tests/mobly"]
           self.test_suite = True
   
       def run_tests(self):
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -40,7 +40,7 @@\n \n     def finalize_options(self):\n         test.test.finalize_options(self)\n-        self.test_args = ['-x', \"tests\"]\n+        self.test_args = ['-x', \"tests/mobly\"]\n         self.test_suite = True\n \n     def run_tests(self):\n", "issue": "Fix pytest warnings in Python 3\n`pytests` currently produces the following warnings:\r\n\r\n    mobly/mobly/test_runner.py:181: PytestWarning: cannot collect test class 'TestRunner' because it has a __init__ constructor\r\n      class TestRunner(object):\r\n\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.\r\n      expected_completed_and_passed)\r\n\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.\r\n      expected_completed_and_passed)\r\n\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:192: DeprecationWarning: Please use assertEqual instead.\r\n      self.assertEquals(actual_test.begin_time, expected_begin_time)\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:193: DeprecationWarning: Please use assertEqual instead.\r\n      self.assertEquals(actual_test.end_time, expected_end_time)\r\n\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.\r\n      expected_completed_and_passed)\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:192: DeprecationWarning: Please use assertEqual instead.\r\n      self.assertEquals(actual_test.begin_time, expected_begin_time)\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:193: DeprecationWarning: Please use assertEqual instead.\r\n      self.assertEquals(actual_test.end_time, expected_end_time)\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:192: DeprecationWarning: Please use assertEqual instead.\r\n      self.assertEquals(actual_test.begin_time, expected_begin_time)\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:193: DeprecationWarning: Please use assertEqual instead.\r\n      self.assertEquals(actual_test.end_time, expected_end_time)\r\n\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.\r\n      expected_completed_and_passed)\r\n\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.\r\n      expected_completed_and_passed)\r\n\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.\r\n      expected_completed_and_passed)\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:192: DeprecationWarning: Please use assertEqual instead.\r\n      self.assertEquals(actual_test.begin_time, expected_begin_time)\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:193: DeprecationWarning: Please use assertEqual instead.\r\n      self.assertEquals(actual_test.end_time, expected_end_time)\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:192: DeprecationWarning: Please use assertEqual instead.\r\n      self.assertEquals(actual_test.begin_time, expected_begin_time)\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:193: DeprecationWarning: Please use assertEqual instead.\r\n      self.assertEquals(actual_test.end_time, expected_end_time)\r\n\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.\r\n      expected_completed_and_passed)\r\n\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.\r\n      expected_completed_and_passed)\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:192: DeprecationWarning: Please use assertEqual instead.\r\n      self.assertEquals(actual_test.begin_time, expected_begin_time)\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:193: DeprecationWarning: Please use assertEqual instead.\r\n      self.assertEquals(actual_test.end_time, expected_end_time)\r\n\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.\r\n      expected_completed_and_passed)\r\n\r\n    mobly/tests/mobly/base_instrumentation_test_test.py:179: DeprecationWarning: Please use assertEqual instead.\r\n      expected_completed_and_passed)\r\n\r\n    mobly/tests/mobly/output_test.py:171: DeprecationWarning: Please use assertNotEqual instead.\r\n      self.assertNotEquals(output_dir1, output_dir2)\r\n\r\n    mobly/tests/mobly/output_test.py:205: DeprecationWarning: Please use assertNotEqual instead.\r\n      self.assertNotEquals(output_dir1, output_dir2)\r\n\r\n    -- Docs: https://docs.pytest.org/en/latest/warnings.html\n", "before_files": [{"content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport platform\nimport setuptools\nfrom setuptools.command import test\nimport sys\n\ninstall_requires = [\n    'future', 'portpicker', 'psutil>=5.4.4', 'pyserial', 'pyyaml',\n    'timeout_decorator'\n]\n\nif sys.version_info < (3, ):\n    install_requires.extend([\n        'enum34',\n        # \"futures\" is needed for py2 compatibility and it only works in 2.7\n        'futures',\n    ])\n\nif platform.system() == 'Windows':\n    install_requires.append('pywin32')\n\n\nclass PyTest(test.test):\n    \"\"\"Class used to execute unit tests using PyTest. This allows us to execute\n    unit tests without having to install the package.\n    \"\"\"\n\n    def finalize_options(self):\n        test.test.finalize_options(self)\n        self.test_args = ['-x', \"tests\"]\n        self.test_suite = True\n\n    def run_tests(self):\n        import pytest\n        errno = pytest.main(self.test_args)\n        sys.exit(errno)\n\n\ndef main():\n    setuptools.setup(\n        name='mobly',\n        version='1.7.5',\n        maintainer='Ang Li',\n        maintainer_email='mobly-github@googlegroups.com',\n        description='Automation framework for special end-to-end test cases',\n        license='Apache2.0',\n        url='https://github.com/google/mobly',\n        download_url='https://github.com/google/mobly/tarball/1.7.5',\n        packages=setuptools.find_packages(),\n        include_package_data=False,\n        scripts=['tools/sl4a_shell.py', 'tools/snippet_shell.py'],\n        tests_require=[\n            'mock',\n            'pytest',\n            'pytz',\n        ],\n        install_requires=install_requires,\n        cmdclass={'test': PyTest},\n    )\n\n\nif __name__ == '__main__':\n    main()\n", "path": "setup.py"}], "after_files": [{"content": "# Copyright 2016 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport platform\nimport setuptools\nfrom setuptools.command import test\nimport sys\n\ninstall_requires = [\n    'future', 'portpicker', 'psutil>=5.4.4', 'pyserial', 'pyyaml',\n    'timeout_decorator'\n]\n\nif sys.version_info < (3, ):\n    install_requires.extend([\n        'enum34',\n        # \"futures\" is needed for py2 compatibility and it only works in 2.7\n        'futures',\n    ])\n\nif platform.system() == 'Windows':\n    install_requires.append('pywin32')\n\n\nclass PyTest(test.test):\n    \"\"\"Class used to execute unit tests using PyTest. This allows us to execute\n    unit tests without having to install the package.\n    \"\"\"\n\n    def finalize_options(self):\n        test.test.finalize_options(self)\n        self.test_args = ['-x', \"tests/mobly\"]\n        self.test_suite = True\n\n    def run_tests(self):\n        import pytest\n        errno = pytest.main(self.test_args)\n        sys.exit(errno)\n\n\ndef main():\n    setuptools.setup(\n        name='mobly',\n        version='1.7.5',\n        maintainer='Ang Li',\n        maintainer_email='mobly-github@googlegroups.com',\n        description='Automation framework for special end-to-end test cases',\n        license='Apache2.0',\n        url='https://github.com/google/mobly',\n        download_url='https://github.com/google/mobly/tarball/1.7.5',\n        packages=setuptools.find_packages(),\n        include_package_data=False,\n        scripts=['tools/sl4a_shell.py', 'tools/snippet_shell.py'],\n        tests_require=[\n            'mock',\n            'pytest',\n            'pytz',\n        ],\n        install_requires=install_requires,\n        cmdclass={'test': PyTest},\n    )\n\n\nif __name__ == '__main__':\n    main()\n", "path": "setup.py"}]}