Commit 2ee9ad2
committed
Fix mock for 'autospec' and 'new' together
mock does not accept 'autospec' and 'new' attributes
together to create mock object for tests. If autospec
is True the mock object is created using create_autospec()
and pass the keyword args to called function.
If both are passed then it start failing with oslotest 4.4.0
which is migrated to unittest.mock.
- https://d088a63e8edc60022939-485bd9eedc766dc9e54cbbb4001038bd.ssl.cf5.rackcdn.com/739330/1/check/cross-nova-py36/843ec44/testr_results.html
Creating mock with autospec only to fix this test to make
nova pass for oslo 4.4.0 so that requirement
can constraint oslotest to 4.4.0 (needed-by patch).
Change-Id: I9d6d97563114380f9a7549f08cede4b808352a3e
Needed-By: https://review.opendev.org/#/c/739531/1 parent 43802e5 commit 2ee9ad2
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | | - | |
65 | | - | |
| 64 | + | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
0 commit comments