Commits

Anonymous committed 3c6a259

Allow custom arg command line in BaseConfig constructor

  • Participants
  • Parent commits 9c5f657

Comments (0)

Files changed (2)

mozharness/base/config.py

     """
     def __init__(self, config=None, initial_config_file=None, config_options=None,
                  all_actions=None, default_actions=None,
-                 volatile_config=None,
+                 volatile_config=None, args=None,
                  require_config_file=False, usage="usage: %prog [options]"):
         self._config = {}
         self.actions = []
         if config_options is None:
             config_options = []
         self._create_config_parser(config_options, usage)
-        self.parse_args()
+        self.parse_args(args=args)
 
     def get_read_only_config(self):
         return ReadOnlyDict(self._config)
         child objects can manipulate it.
         """
         self.command_line = ' '.join(sys.argv)
-        if not args:
+        if args is None:
             args = sys.argv[1:]
         (options, args) = self.config_parser.parse_args(args)
 

mozharness/mozilla/testing/testbase.py

                                     os.path.join(dirs['abs_work_dir'], 'tests'))
         tree_config_path = os.path.join(test_install_dir, 'config', 'mozharness_config.py')
         if os.path.isfile(tree_config_path):
-            rw_config = BaseConfig(config=self.config.copy())
+            rw_config = BaseConfig(config=self.config.copy(), args=[])
             rw_config.set_config(parse_config_file(tree_config_path))
             self.config = rw_config.get_read_only_config()