#3519 new defect

Stop using the mock library for testing

Reported by: exarkun Owned by: exarkun
Priority: normal Milestone: undecided
Component: unknown Version: n/a
Keywords: mock Cc:
Launchpad Bug:

Description (last modified by exarkun)

Some discussion about motivations for this

Instead:

  • Where possible, we will completely remove whatever role the mock is serving from the test and focus on more well-defined, isolated units of functionality.
  • Failing that, where possible, we will use the implementation that is used under real usage of whatever the relevant interface is.
  • Failing that, we will use verified fakes of whatever the relevant interface is.

This is a tracking ticket for various other tickets which make progress towards this goal. There are too many uses of mock to address this all at once. Fortunately each use should be essentially independent from the rest so the task is easily broken up.

Individual implementation tickets

Change History (3)

comment:1 Changed at 2020-11-24T18:10:20Z by exarkun

  • Keywords mock added

comment:2 Changed at 2020-11-24T18:11:59Z by exarkun

  • Description modified (diff)

comment:3 Changed at 2020-11-24T18:23:44Z by exarkun

https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2777 is a somewhat related ticket that discusses this as well as other codebase-wide test implementation improvements.

Note: See TracTickets for help on using tickets.