Repository navigation
Commit 3e86efa
tests: add real coverage for _generate_installed_modules
Fixes #4594.
The previous test for this function (removed in #4593) just mirrored
the implementation's own loop, so it never exercised any behavior
independent of the code it was testing.
This mocks importlib.metadata.distributions() with a small fixed set
of fake distributions and asserts on the actual contract: names are
normalized case-insensitively, entries with no Name are skipped,
entries with no version are skipped, and a case-insensitive duplicate
name is skipped in favor of the first occurrence. Verified the test
actually catches a regression by temporarily breaking the dedup check
locally and confirming the test fails, then reverting.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 3189a58 commit 3e86efa
1 file changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
964 | 965 | | |
965 | 966 | | |
966 | 967 | | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
967 | 993 | | |
968 | 994 | | |
969 | 995 | | |
| |||
0 commit comments