-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Expert Python Programming – Fourth Edition - Fourth Edition
By :
When it comes to efficiency in writing tests, it usually boils down to handling all those mundane or inconvenient problems like providing realistic data entries, dealing with time-sensitive processing, or working with remote services. Experienced programmers usually boost their effectiveness with the help of a large collection of small tools for dealing with all these small typical problems. Let's take a look at a few of them.
When writing tests based on input-output data samples, we often need to provide values that have some meaning in our application:
The easiest way around that is to use hardcoded values. We've already done that in the example of our test_send() function in the Mocks and unittest.mock module section:
def test_send()...