Repository: google/mobly

Issue:
Modules missing from API docs
Our [API docs](http://mobly.readthedocs.io/en/stable/)
Is missing some modules like `mobly.runtime_test_info`


Discussion:

Resolving patch:
diff --git a/mobly/controllers/android_device.py b/mobly/controllers/android_device.py
--- a/mobly/controllers/android_device.py
+++ b/mobly/controllers/android_device.py
@@ -436,8 +436,9 @@ def __init__(self, serial=''):
         self._log_path = os.path.join(self._log_path_base,
                                       'AndroidDevice%s' % self._serial)
         self._debug_tag = self._serial
-        self.log = AndroidDeviceLoggerAdapter(logging.getLogger(),
-                                              {'tag': self.debug_tag})
+        self.log = AndroidDeviceLoggerAdapter(logging.getLogger(), {
+            'tag': self.debug_tag
+        })
         self.sl4a = None
         self.ed = None
         self._adb_logcat_process = None
@@ -680,6 +681,9 @@ def handle_usb_disconnect(self):
         execution result after device got reconnected.
 
         Example Usage:
+
+        .. code-block:: python
+
             with ad.handle_usb_disconnect():
                 try:
                   # User action that triggers USB disconnect, could throw
@@ -842,9 +846,12 @@ def load_snippet(self, name, package):
         """Starts the snippet apk with the given package name and connects.
 
         Examples:
-            >>> ad.load_snippet(
+
+        .. code-block:: python
+
+            ad.load_snippet(
                     name='maps', package='com.google.maps.snippets')
-            >>> ad.maps.activateZoom('3')
+            ad.maps.activateZoom('3')
 
         Args:
             name: The attribute name to which to attach the snippet server.
diff --git a/mobly/controllers/android_device_lib/adb.py b/mobly/controllers/android_device_lib/adb.py
--- a/mobly/controllers/android_device_lib/adb.py
+++ b/mobly/controllers/android_device_lib/adb.py
@@ -245,6 +245,9 @@ def instrument(self, package, options=None, runner=None):
         This is a convenience wrapper to avoid parameter formatting.
 
         Example:
+
+        .. code-block:: python
+
             device.instrument(
                 'com.my.package.test',
                 options = {
diff --git a/mobly/suite_runner.py b/mobly/suite_runner.py
--- a/mobly/suite_runner.py
+++ b/mobly/suite_runner.py
@@ -16,6 +16,8 @@
 To create a test suite, call suite_runner.run_suite() with one or more
 individual test classes. For example:
 
+.. code-block:: python
+
     from mobly import suite_runner
 
     from my.test.lib import foo_test
@@ -103,7 +105,7 @@ def run_suite(test_classes, argv=None):
         sys.exit(1)
 
 
-def _compute_selected_tests(test_classes, selected_tests):
+def compute_selected_tests(test_classes, selected_tests):
     """Computes tests to run for each class from selector strings.
 
     This function transforms a list of selector strings (such as FooTest or
@@ -112,24 +114,34 @@ def _compute_selected_tests(test_classes, selected_tests):
     that class are selected.
 
     Args:
-        test_classes: (list of class) all classes that are part of this suite.
-        selected_tests: (list of string) list of tests to execute, eg:
-            [
-                'FooTest',
-                'BarTest',
-                'BazTest.test_method_a',
-                'BazTest.test_method_b'
-            ].
-            May be empty, in which case all tests in the class are selected.
+        test_classes: list of strings, names of all the classes that are part
+            of a suite.
+        selected_tests: list of strings, list of tests to execute. If empty,
+            all classes `test_classes` are selected. E.g.
+
+            .. code-block:: python
+
+                [
+                    'FooTest',
+                    'BarTest',
+                    'BazTest.test_method_a',
+                    'BazTest.test_method_b'
+                ]
 
     Returns:
-        dict: test_name class -> list(test_name name):
-        identifiers for TestRunner. For the above example:
-        {
-            FooTest: None,
-            BarTest: None,
-            BazTest: ['test_method_a', 'test_method_b'],
-        }
+        dict: Identifiers for TestRunner. Keys are test class names; valures
+            are lists of test names within class. E.g. the example in
+            `selected_tests` would translate to:
+
+            .. code-block:: python
+
+                {
+                    FooTest: None,
+                    BarTest: None,
+                    BazTest: ['test_method_a', 'test_method_b']
+                }
+
+            This dict is easy to consume for `TestRunner`.
     """
     class_to_tests = collections.OrderedDict()
     if not selected_tests:


Test patch:
diff --git a/tests/mobly/suite_runner_test.py b/tests/mobly/suite_runner_test.py
--- a/tests/mobly/suite_runner_test.py
+++ b/tests/mobly/suite_runner_test.py
@@ -21,7 +21,7 @@
 
 class SuiteRunnerTest(unittest.TestCase):
     def test_select_no_args(self):
-        identifiers = suite_runner._compute_selected_tests(
+        identifiers = suite_runner.compute_selected_tests(
             test_classes=[
                 integration_test.IntegrationTest,
                 integration2_test.Integration2Test
@@ -33,7 +33,7 @@ def test_select_no_args(self):
         }, identifiers)
 
     def test_select_by_class(self):
-        identifiers = suite_runner._compute_selected_tests(
+        identifiers = suite_runner.compute_selected_tests(
             test_classes=[
                 integration_test.IntegrationTest,
                 integration2_test.Integration2Test
@@ -42,7 +42,7 @@ def test_select_by_class(self):
         self.assertEqual({integration_test.IntegrationTest: None}, identifiers)
 
     def test_select_by_method(self):
-        identifiers = suite_runner._compute_selected_tests(
+        identifiers = suite_runner.compute_selected_tests(
             test_classes=[
                 integration_test.IntegrationTest,
                 integration2_test.Integration2Test
@@ -55,7 +55,7 @@ def test_select_by_method(self):
         }, identifiers)
 
     def test_select_all_clobbers_method(self):
-        identifiers = suite_runner._compute_selected_tests(
+        identifiers = suite_runner.compute_selected_tests(
             test_classes=[
                 integration_test.IntegrationTest,
                 integration2_test.Integration2Test
@@ -63,7 +63,7 @@ def test_select_all_clobbers_method(self):
             selected_tests=['IntegrationTest.test_a', 'IntegrationTest'])
         self.assertEqual({integration_test.IntegrationTest: None}, identifiers)
 
-        identifiers = suite_runner._compute_selected_tests(
+        identifiers = suite_runner.compute_selected_tests(
             test_classes=[
                 integration_test.IntegrationTest,
                 integration2_test.Integration2Test