Commit c99e5c3
fix: Isolate storage tests to prevent race conditions in CI
The test_load_empty_stats and test_save_and_load tests were sharing
the same ~/.config/typer-cli/stats.json file, causing intermittent
failures when tests ran in parallel in the CI environment.
Changes:
- Add Storage::with_path() test helper for custom file paths
- Create create_test_storage() helper using tempfile for isolation
- Update tests to use temporary directories instead of shared config
- Add tempfile dev-dependency for test isolation
- Improve test assertions with explicit session count checks
This ensures tests run reliably in both parallel and serial execution,
and prevents test interference in CI environments.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>1 parent f631a4f commit c99e5c3
3 files changed
+100
-8
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
21 | 30 | | |
22 | 31 | | |
23 | 32 | | |
| |||
71 | 80 | | |
72 | 81 | | |
73 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
74 | 91 | | |
75 | 92 | | |
76 | 93 | | |
| |||
79 | 96 | | |
80 | 97 | | |
81 | 98 | | |
82 | | - | |
83 | | - | |
84 | | - | |
| 99 | + | |
| 100 | + | |
85 | 101 | | |
86 | 102 | | |
| 103 | + | |
87 | 104 | | |
88 | 105 | | |
89 | 106 | | |
90 | 107 | | |
91 | | - | |
| 108 | + | |
92 | 109 | | |
93 | 110 | | |
94 | 111 | | |
| |||
105 | 122 | | |
106 | 123 | | |
107 | 124 | | |
108 | | - | |
| 125 | + | |
109 | 126 | | |
110 | 127 | | |
0 commit comments