some links to supporting resources for mocks
[Imported from Trac: page HowToWriteTests, version 14]
parent
8824d12569
commit
0995be2a52
|
@ -28,11 +28,11 @@ class T(TestCase):
|
||||||
Now run it!
|
Now run it!
|
||||||
|
|
||||||
You may notice some existing tests use the `mock` module.
|
You may notice some existing tests use the `mock` module.
|
||||||
We are phasing out this style of testing.
|
We are phasing out this style of testing (<https://nedbatchelder.com/blog/201206/tldw_stop_mocking_start_testing.html>, <https://martinfowler.com/articles/mocksArentStubs.html>).
|
||||||
Please do not use it in new tests.
|
Please do not use it in new tests.
|
||||||
Instead, factor units and interfaces so mocks are not required.
|
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 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.
|
If that is not possible then implement [a verified fake](https://pythonspeed.com/articles/verified-fakes/) of the required interface and use that in the test suite.
|
||||||
|
|
||||||
# code coverage
|
# code coverage
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue