no mocks !

[Imported from Trac: page HowToWriteTests, version 13]
exarkun 2021-09-14 14:55:31 +00:00
parent 4544e463e3
commit 8824d12569

@ -27,6 +27,13 @@ class T(TestCase):
Now run it! 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 # code coverage
Now install Ned Batchelder's "[coverage"](http://nedbatchelder.com/code/coverage/) tool and run your test with code coverage, like this: Now install Ned Batchelder's "[coverage"](http://nedbatchelder.com/code/coverage/) tool and run your test with code coverage, like this: