Repository: google/mobly

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


Discussion:
Assigning to sparky to fix the ones in `base_instrumentation_test_test`
I tested this by calling pytest directly, but apparently when going through setup.py, there are still warnings

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -40,7 +40,7 @@ class PyTest(test.test):
 
     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):


Test patch: