[tahoe-lafs-trac-stream] [Tahoe-LAFS] #2777: modernize tests, use "mock"
Tahoe-LAFS
trac at tahoe-lafs.org
Tue Apr 12 19:28:36 UTC 2016
#2777: modernize tests, use "mock"
--------------------+---------------------------
Reporter: warner | Owner:
Type: task | Status: new
Priority: minor | Milestone: undecided
Component: code | Version: 1.11.0
Keywords: | Launchpad Bug:
--------------------+---------------------------
I'd like to clean up our unit tests.. there are a lot of archaic idioms
that have crept in (partly because I'm not up-to-date on modern practices,
partly because the tests were initially written before those practices
were established). Here are some things that come to mind:
* use [https://github.com/testing-cabal/mock "mock"] (which is kinda
official now, added to stdlib as of py3.3) to shrink our 32 "Fake*"
classes.
* replace our home-grown `self.shouldFail` with
`t.trial.unittest.assertFailure`
* switch to `inlineCallbacks` to flatten the control-flow nest of helper
functions
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2777>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list