def _run_mach(self, args, context_handler=None): mach_dir = os.path.dirname(mach.__file__) providers = [ 'commands.py', os.path.join(mach_dir, 'commands', 'commandinfo.py'), ] return TestBase._run_mach(self, args, providers, context_handler=context_handler)
def _run_mach(self, args): mach_dir = os.path.dirname(mach.__file__) providers = [ 'commands.py', os.path.join(mach_dir, 'commands', 'commandinfo.py'), ] def context_handler(key): if key == 'topdir': return topsrcdir return TestBase._run_mach(self, args, providers, context_handler=context_handler)
def test_set_isatty_environ(monkeypatch): # Make sure the 'MACH_STDOUT_ISATTY' variable gets set. monkeypatch.delenv('MACH_STDOUT_ISATTY', raising=False) monkeypatch.setattr(os, 'isatty', lambda fd: True) m = TestBase.get_mach() orig_run = m._run env_is_set = [] def wrap_run(*args, **kwargs): env_is_set.append('MACH_STDOUT_ISATTY' in os.environ) return orig_run(*args, **kwargs) monkeypatch.setattr(m, '_run', wrap_run) ret = m.run([]) assert ret == 0 assert env_is_set[0]
def run_mach(): tester = TestBase() def inner(args): mach_dir = os.path.dirname(mach.__file__) providers = [ 'commands.py', os.path.join(mach_dir, 'commands', 'commandinfo.py'), ] def context_handler(key): if key == 'topdir': return topsrcdir return tester._run_mach(args, providers, context_handler=context_handler) return inner
def _run_mach(self, args, context_handler=_populate_bare_context): return TestBase._run_mach(self, args, 'conditions.py', context_handler=context_handler)
def _run_mach(self, args): return TestBase._run_mach(self, args, 'throw.py', context_handler=_populate_context)
def _run_mach(self, args): return TestBase._run_mach(self, args, 'throw.py')
def _run_mach(self): return TestBase._run_mach(self, ['help'], entry_point='mach.providers')
def _run_mach(self, args, context_handler=None): return TestBase._run_mach(self, args, 'conditions.py', context_handler=context_handler)