Changes between Initial Version and Version 6 of Ticket #2777


Ignore:
Timestamp:
2020-01-13T20:03:40Z (5 years ago)
Author:
exarkun
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2777

    • Property Summary changed from modernize tests, use "mock" to modernize tests
  • Ticket #2777 – Description

    initial v6  
    11I'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:
    22
    3 * 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.
    4 * replace our home-grown `self.shouldFail` with `t.trial.unittest.assertFailure`
     3* switch from trial's TestCase to testtools' TestCase (probably via a base class in one of our common modules)
     4* replace JUnit-style assertions (`assertEqual(...)`) with "hamcrest" style assertions (`assertThat(x, Equals(y))`)
    55* switch to `inlineCallbacks` to flatten the control-flow nest of helper functions
    66