From 8824d12569cf1f2c800bd4c7656b6fc18a532d6f Mon Sep 17 00:00:00 2001 From: exarkun <> Date: Tue, 14 Sep 2021 14:55:31 +0000 Subject: [PATCH] no mocks ! [Imported from Trac: page HowToWriteTests, version 13] --- HowToWriteTests.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/HowToWriteTests.md b/HowToWriteTests.md index f334d95..fe0bfab 100644 --- a/HowToWriteTests.md +++ b/HowToWriteTests.md @@ -27,6 +27,13 @@ class T(TestCase): Now run it! +You may notice some existing tests use the `mock` module. +We are phasing out this style of testing. +Please do not use it in new tests. +Instead, factor units and interfaces so mocks are not required. +If that is not possible then implement units so that they don't need to be mocked and can be used in the test suite. +If that is not possible then implement a verified fake of the required interface and use that in the test suite. + # code coverage Now install Ned Batchelder's "[coverage"](http://nedbatchelder.com/code/coverage/) tool and run your test with code coverage, like this: