From 2746eb9ae1919084218ae66fb439d20e106996ec Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Wed, 16 Dec 2020 20:58:27 -0500 Subject: [PATCH] Fix the broken fake_react by not using the argv feature --- src/allmydata/scripts/runner.py | 2 +- src/allmydata/test/cli/test_cli.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/allmydata/scripts/runner.py b/src/allmydata/scripts/runner.py index 9843edb6e..8b730d9cd 100644 --- a/src/allmydata/scripts/runner.py +++ b/src/allmydata/scripts/runner.py @@ -180,7 +180,7 @@ def run(argv=sys.argv, stderr=sys.stderr): from allmydata.windows.fixups import initialize initialize() # doesn't return: calls sys.exit(rc) - task.react(_run_with_reactor, argv, stderr) + task.react(lambda reactor: _run_with_reactor(reactor, argv, stderr)) def _setup_coverage(reactor, argv): diff --git a/src/allmydata/test/cli/test_cli.py b/src/allmydata/test/cli/test_cli.py index 9c3958704..d1bcfc128 100644 --- a/src/allmydata/test/cli/test_cli.py +++ b/src/allmydata/test/cli/test_cli.py @@ -524,12 +524,12 @@ class CLI(CLITestMixin, unittest.TestCase): ns.sys_exit_called = True self.failUnlessEqual(exitcode, 1) - def fake_react(f, *args): + def fake_react(f): reactor = Mock() # normally this Deferred would be errbacked with SystemExit, but # since we mocked out sys.exit, it will be fired with None. So # it's safe to drop it on the floor. - f(reactor, *args) + f(reactor) patcher = MonkeyPatcher((runner, 'parse_or_exit_with_explanation', call_parse_or_exit),