Bug 1696251 - Pass MachCommandBase object as first argument for Mach Commands. r=mhentges,remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers
As an intermediate step to allow mach commands as standalone functions, the MachCommandBase subclass instance that currently corresponds to self has to be made available as a separate argument (named command_context). Differential Revision: https://phabricator.services.mozilla.com/D109650
This commit is contained in:
@@ -61,7 +61,14 @@ class MachCommands(MachCommandBase):
|
||||
)
|
||||
@CommandArgument("args", nargs=argparse.REMAINDER)
|
||||
def python(
|
||||
self, no_virtualenv, no_activate, exec_file, ipython, requirements, args
|
||||
self,
|
||||
command_context,
|
||||
no_virtualenv,
|
||||
no_activate,
|
||||
exec_file,
|
||||
ipython,
|
||||
requirements,
|
||||
args,
|
||||
):
|
||||
# Avoid logging the command
|
||||
self.log_manager.terminal_handler.setLevel(logging.CRITICAL)
|
||||
@@ -165,7 +172,7 @@ class MachCommands(MachCommandBase):
|
||||
"passed as it is to pytest"
|
||||
),
|
||||
)
|
||||
def python_test(self, *args, **kwargs):
|
||||
def python_test(self, command_context, *args, **kwargs):
|
||||
try:
|
||||
tempdir = str(tempfile.mkdtemp(suffix="-python-test"))
|
||||
if six.PY2:
|
||||
|
||||
Reference in New Issue
Block a user