Log test config at the beginning of the test run. (#472)
diff --git a/mobly/config_parser.py b/mobly/config_parser.py
index aa43c03..b873af0 100644
--- a/mobly/config_parser.py
+++ b/mobly/config_parser.py
@@ -16,6 +16,7 @@
import copy
import io
+import pprint
import os
import yaml
@@ -189,4 +190,7 @@
return copy.deepcopy(self)
def __str__(self):
- return str(self.__dict__)
+ content = dict(self.__dict__)
+ content.pop('summary_writer')
+ content.pop('register_controller')
+ return pprint.pformat(content)
diff --git a/mobly/test_runner.py b/mobly/test_runner.py
index af834e8..e4fa9d8 100644
--- a/mobly/test_runner.py
+++ b/mobly/test_runner.py
@@ -381,8 +381,9 @@
test_class: class, test class to execute.
tests: Optional list of test names within the class to execute.
"""
-
with test_class(config) as test_instance:
+ logging.debug('Executing test class "%s" with config: %s',
+ test_class.__name__, config)
try:
cls_result = test_instance.run(tests)
self.results += cls_result
diff --git a/tests/mobly/config_parser_test.py b/tests/mobly/config_parser_test.py
index ea16668..44dfbdc 100644
--- a/tests/mobly/config_parser_test.py
+++ b/tests/mobly/config_parser_test.py
@@ -56,6 +56,11 @@
config = config_parser._load_config_file(tmp_file_path)
self.assertEqual(config['TestBeds'][0]['Name'], u'\u901a')
+ def test_run_config_type(self):
+ config = config_parser.TestRunConfig()
+ self.assertNotIn('summary_writer', str(config))
+ self.assertNotIn('register_controller', str(config))
+
if __name__ == "__main__":
unittest.main()