mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-03-10 14:34:05 +00:00
asserts for systemexit
This commit is contained in:
parent
5071ddf124
commit
5175a6c6a0
@ -254,7 +254,11 @@ class RunTests(unittest.TestCase):
|
|||||||
])
|
])
|
||||||
|
|
||||||
i, o, e = StringIO(), StringIO(), StringIO()
|
i, o, e = StringIO(), StringIO(), StringIO()
|
||||||
runner.dispatch(config, i, o, e)
|
d = runner.dispatch(config, i, o, e)
|
||||||
|
|
||||||
|
def must_be_systemexit(f):
|
||||||
|
assert isinstance(f.value, SystemExit)
|
||||||
|
d.addErrback(must_be_systemexit)
|
||||||
|
|
||||||
output = e.getvalue()
|
output = e.getvalue()
|
||||||
# should print out the collected logs and an error-code
|
# should print out the collected logs and an error-code
|
||||||
@ -266,10 +270,6 @@ class RunTests(unittest.TestCase):
|
|||||||
"Configuration error:",
|
"Configuration error:",
|
||||||
output,
|
output,
|
||||||
)
|
)
|
||||||
# this is SystemExit(0) for some reason I can't understand,
|
|
||||||
# while running on the command-line, "echo $?" shows "1" on
|
|
||||||
# this same error (some config exception)...
|
|
||||||
errs = self.flushLoggedErrors(SystemExit)
|
|
||||||
self.assertEqual(1, len(errs))
|
|
||||||
# ensure reactor.stop was actually called
|
# ensure reactor.stop was actually called
|
||||||
self.assertEqual([None], stopped)
|
self.assertEqual([None], stopped)
|
||||||
|
return d
|
||||||
|
Loading…
x
Reference in New Issue
Block a user