All you have to do to drop it is not save it in the first place

Also it would have been dropped as soon as this function returned, anyway.
This commit is contained in:
Jean-Paul Calderone 2020-12-16 20:51:11 -05:00
parent d5bff458b6
commit 1f229ce9f6

View File

@ -526,11 +526,10 @@ class CLI(CLITestMixin, unittest.TestCase):
def fake_react(f, *args):
reactor = Mock()
d = f(reactor)
# 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.
del d
f(reactor, *args)
patcher = MonkeyPatcher((runner, 'parse_or_exit_with_explanation',
call_parse_or_exit),