Commit 89e95f4
committed
Pretty-print JSON test snapshots + tighten test module quality
**Pretty-print snapshots**
The `test_show_options*.json` snapshots used by `tests/test_*.py` were
single-line JSON arrays — typically 1-2 KB strings with ~100 country or
currency names crammed onto one line. When a database update adds or
removes a single country, the diff in CI/PR reviews is one giant string
change with no way to see what actually differs.
Switched `json.dumps()` in `tests/conftest.py` to use `indent=2` and
`ensure_ascii=False` so each array element lands on its own line and
non-ASCII characters render natively (e.g. "Côte d'Ivoire" instead of
escaped sequences). Diffs in future data PRs now show exactly which
country/currency/exchange was added or removed.
Regenerated all 54 snapshot files via `pytest --rewrite-expected`. No
test semantics change — content is identical.
**Test module quality fixes (free with the regen)**
Since the regen touched every test file, took the opportunity to:
* Fix wrong module docstrings (`test_equities.py` and
`test_moneymarkets.py` both started with "Currencies Test Module")
* Replace `# pylint: disable=missing-function-docstring` with actual
one-line docstrings on each test function
* Add type hints: `(recorder: Recorder) -> None` on test signatures,
guarded behind `from __future__ import annotations` so the import
stays under `TYPE_CHECKING` and adds no runtime cost
No test was renamed or parametrized — that would have invalidated the
positional snapshot naming (`test_select.csv`, `test_select_1.csv`, …)
that `Recorder.capture()` relies on. Refactors that change snapshot
naming were intentionally kept out of scope.
All 31 tests pass.1 parent d8b69e1 commit 89e95f4
63 files changed
Lines changed: 3692 additions & 98 deletions
File tree
- tests
- json
- test_cryptos
- test_currencies
- test_equities
- test_etfs
- test_funds
- test_indices
- test_moneymarkets
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | | - | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
228 | 247 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
233 | 251 | | |
234 | 252 | | |
235 | 253 | | |
236 | 254 | | |
237 | 255 | | |
238 | 256 | | |
239 | 257 | | |
240 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
241 | 262 | | |
242 | 263 | | |
243 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments