Stop using the mock library for testing #3519

Open
opened 2020-11-24 18:07:14 +00:00 by exarkun · 1 comment

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]query:status=new|assigned|reopened&keywords=~mock

Some discussion about motivations for this * <https://nedbatchelder.com/blog/201206/tldw_stop_mocking_start_testing.html> to start * <https://pythonspeed.com/articles/verified-fakes/> * <https://martinfowler.com/articles/mocksArentStubs.html> 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]query:status=new|assigned|reopened&keywords=~mock
exarkun added the
unknown
normal
defect
n/a
labels 2020-11-24 18:07:14 +00:00
exarkun added this to the undecided milestone 2020-11-24 18:07:14 +00:00
exarkun self-assigned this 2020-11-24 18:07:14 +00:00
Author

(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.

(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.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: tahoe-lafs/trac-2024-07-25#3519
No description provided.