|
17 | 17 | 00:54 And for this I'm just going to use the unittest |
18 | 18 | 00:57 patch method on the mock module |
19 | 19 | 01:00 because it's a perfect fit for this scenario. |
20 | | -01:05 So from unittest.mark, import patch. |
| 20 | +01:05 So from unittest.mock, import patch. |
21 | 21 | 01:10 I actually need to import to random module |
22 | | -01:12 because that's the one we're going to mark. |
| 22 | +01:12 because that's the one we're going to mock. |
23 | 23 | 01:15 And you can use it as patch object |
24 | 24 | 01:20 and that's to random module. Just specify the function |
25 | 25 | 01:24 or method you want to patch. |
|
0 commit comments