CLI: remove log.err(), remove flushLoggedErrors from tests
I think we're better off without this: the CLI commands propagate the Failure up to their callers (rather than eating it silently), the callers are using task.react (which reacts to Failures by exiting with rc!=0), so nothing should get lost. And doing an extra log.err() just creates more cleanup work for test cases to flush, and makes the CLI commands double-print the any errors (maybe task.react also points logging at stderr?).
This commit is contained in:
parent
b4e39edb3f
commit
1bb4e9278a
|
@ -95,7 +95,6 @@ class Receiver:
|
|||
# as the original one)
|
||||
@inlineCallbacks
|
||||
def _bad(f):
|
||||
log.err(f)
|
||||
try:
|
||||
yield w.close() # might be an error too
|
||||
except:
|
||||
|
|
|
@ -74,7 +74,6 @@ class Sender:
|
|||
# as the original one)
|
||||
@inlineCallbacks
|
||||
def _bad(f):
|
||||
log.err(f)
|
||||
try:
|
||||
yield w.close() # might be an error too
|
||||
except:
|
||||
|
|
|
@ -736,7 +736,6 @@ class PregeneratedCode(ServerBase, ScriptsBase, unittest.TestCase):
|
|||
|
||||
# check server stats
|
||||
self._rendezvous.get_stats()
|
||||
self.flushLoggedErrors(TransferError)
|
||||
|
||||
def test_fail_file_noclobber(self):
|
||||
return self._do_test_fail("file", "noclobber")
|
||||
|
@ -766,9 +765,6 @@ class NotWelcome(ServerBase, unittest.TestCase):
|
|||
send_d = cmd_send.send(self.cfg)
|
||||
f = yield self.assertFailure(send_d, WelcomeError)
|
||||
self.assertEqual(str(f), "please upgrade XYZ")
|
||||
# TODO: this comes from log.err() in cmd_send.Sender.go._bad, and I'm
|
||||
# undecided about whether that ought to be doing log.err or not
|
||||
self.flushLoggedErrors(WelcomeError)
|
||||
|
||||
@inlineCallbacks
|
||||
def test_receiver(self):
|
||||
|
@ -777,7 +773,6 @@ class NotWelcome(ServerBase, unittest.TestCase):
|
|||
receive_d = cmd_receive.receive(self.cfg)
|
||||
f = yield self.assertFailure(receive_d, WelcomeError)
|
||||
self.assertEqual(str(f), "please upgrade XYZ")
|
||||
self.flushLoggedErrors(WelcomeError)
|
||||
|
||||
class Cleanup(ServerBase, unittest.TestCase):
|
||||
|
||||
|
@ -825,7 +820,6 @@ class Cleanup(ServerBase, unittest.TestCase):
|
|||
|
||||
cids = self._rendezvous.get_app(cmd_send.APPID).get_nameplate_ids()
|
||||
self.assertEqual(len(cids), 0)
|
||||
self.flushLoggedErrors(WrongPasswordError)
|
||||
|
||||
class ExtractFile(unittest.TestCase):
|
||||
def test_filenames(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user