Commit 2b8fdbb
kunit: tool: move kunitconfig parsing into __init__, make it optional
LinuxSourceTree will unceremoniously crash if the user doesn't call
read_kunitconfig() first in a number of functions.
And currently every place we create an instance, the caller also calls
create_kunitconfig() and read_kunitconfig().
Move these instead into __init__() so they can't be forgotten and to
reduce copy-paste.
The https://github.com/google/pytype type-checker complained that
_config wasn't initialized. With this, kunit_tool now type checks
under both pytype and mypy.
Add an optional boolean that can be used to disable this for use cases
in the future where we might not need/want to load the config.
Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Tested-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>1 parent 81c6030 commit 2b8fdbb
2 files changed
Lines changed: 17 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
| 259 | + | |
263 | 260 | | |
264 | 261 | | |
265 | 262 | | |
| |||
277 | 274 | | |
278 | 275 | | |
279 | 276 | | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
| 277 | + | |
284 | 278 | | |
285 | 279 | | |
286 | 280 | | |
| |||
292 | 286 | | |
293 | 287 | | |
294 | 288 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
| 289 | + | |
299 | 290 | | |
300 | 291 | | |
301 | 292 | | |
| |||
309 | 300 | | |
310 | 301 | | |
311 | 302 | | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
| 303 | + | |
316 | 304 | | |
317 | 305 | | |
318 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
| 126 | + | |
128 | 127 | | |
129 | 128 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
137 | 133 | | |
138 | | - | |
139 | 134 | | |
140 | 135 | | |
141 | 136 | | |
142 | 137 | | |
143 | | - | |
144 | | - | |
145 | 138 | | |
146 | 139 | | |
147 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
0 commit comments