Commit 578322d
committed
fix(test): satisfy CodeQL on the changelog-parsing test
CodeQL flagged the for/else: pytest.fail() pattern as a
potentially-uninitialized-local-variable warning because it
doesn't model pytest.fail as NoReturn — the analyzer sees a path
where submodule_latest is referenced after the loop without ever
being bound.
Pulling the parse into _read_latest_spec_version_from_changelog
that explicitly returns the version or raises AssertionError.
Eliminates the unreachable-after-fail pattern and reads cleaner.1 parent b8ffc43 commit 578322d
1 file changed
Lines changed: 14 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
33 | 46 | | |
34 | 47 | | |
35 | 48 | | |
| |||
41 | 54 | | |
42 | 55 | | |
43 | 56 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 57 | + | |
51 | 58 | | |
52 | 59 | | |
53 | 60 | | |
| |||
0 commit comments