Skip to content

Commit d61e9c5

Browse files
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 0bf576b commit d61e9c5

63 files changed

Lines changed: 3666 additions & 93 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def extract_string(data: Any, **kwargs) -> str:
4343
**kwargs,
4444
)
4545
elif isinstance(data, tuple(EXTENSIONS_MATCHING["json"])):
46-
string_value = json.dumps(data, **kwargs)
46+
string_value = json.dumps(data, indent=2, ensure_ascii=False, **kwargs)
4747
else:
4848
raise AttributeError(f"Unsupported type : {type(data)}")
4949

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
["cryptocurrency", "currency"]
1+
[
2+
"cryptocurrency",
3+
"currency"
4+
]
Lines changed: 353 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,353 @@
1-
["AAVE", "ABBC", "ACH", "ACT", "ADA", "ADK", "ADX", "AE", "AIB", "AION", "ALGO", "ALIAS", "AMB", "AMP1", "ANKR", "ANT", "APL", "AR", "ARDR", "ARRR", "ATB", "ATOM1", "ATRI", "AVA", "AVAX", "AXEL", "BAND", "BAT", "BCA", "BCD", "BCH", "BCN", "BDX", "BEPRO", "BHD", "BHP", "BIP", "BLK", "BLOCK", "BNB", "BNT", "BONO", "BPC", "BPS", "BRC", "BST", "BSV", "BTC2", "BTG", "BTM", "BTS", "BTT1", "BTX", "BURST", "CCA", "CCXX", "CEL", "CELO", "CET", "CHI", "CHZ", "CKB", "CLAM", "CMT1", "CNX", "COLX", "COMP", "COMP1", "COTI", "CPS", "CRO", "CRU", "CRV", "CSC", "CTC", "CTC1", "CTXC", "CURE", "CUT", "CVC", "DAG", "DASH", "DCN", "DCR", "DCY", "DDK", "DERO", "DEV", "DFI", "DGB", "DGD", "DIME", "DMCH", "DMD", "DNA1", "DNT", "DOGE", "DOT1", "DTEP", "DUN", "ECA", "EDC", "EDG", "EGLD", "ELA", "EMC2", "ENJ", "EOS", "ERK", "ETC", "ETH", "ETN", "ETP", "EWT", "FAIR", "FCT", "FET", "FIL", "FIO", "FIRO", "FLASH", "FO", "FRST", "FTC", "FUN", "GAME", "GBYTE", "GCC1", "GHOST", "GHOST1", "GLEEC", "GLM", "GNO", "GO", "GRC", "GRN", "GRS", "GRT2", "GXC", "HBAR", "HC", "HIVE", "HNC", "HNS", "HNT1", "HPB", "HSS", "HTDF", "HTML", "HYC", "ICX", "IDNA", "ILC", "INSTAR", "INT", "IOC", "IOST", "IOTX", "IRIS", "JDC", "JUL", "KAVA", "KDA", "KMD", "KNC", "KRT", "KSM", "LBC", "LCC", "LINK", "LKK", "LOKI", "LRC", "LRG", "LSK", "LTC", "LUNA1", "LYNX", "MAID", "MAN", "MANA", "MARO", "MASS", "MATIC", "MBC", "MED", "META", "MGO", "MHC", "MIDAS", "MINT", "MIOTA", "MIR", "MIR1", "MKR", "MLN", "MOAC", "MONA", "MOON", "MRX", "MTC2", "MWC", "NAS", "NAV", "NEBL", "NIM", "NLC2", "NLG", "NMC", "NPC", "NU", "NULS", "NVT", "NXS", "NYE", "NYZO", "OBSR", "OMG", "ONE2", "ONT", "OTO", "OURO", "OWC", "OXT", "PAC", "PAI", "PART", "PAY", "PCX", "PHA", "PHR", "PI", "PIVX", "PLC", "PMEER", "POA", "POLIS", "PPC", "PPT", "PZM", "QASH", "QRK", "QRL", "QTUM", "RBTC", "RBY", "RDD", "REP", "REV", "RINGX", "RLC", "RSTR", "RVN", "SALT", "SAPP", "SBD", "SC", "SCC3", "SCP", "SERO", "SFT", "SKY", "SLS", "SMART", "SNGLS", "SNM", "SNT", "SNX", "SOL1", "SONO1", "SPHR", "SRK", "SRM", "STEEM", "STORJ", "STRAX", "STX1", "SUB", "SUSHI", "SYS", "TAAS", "TFUEL", "TOMO", "TRX", "TT", "TUBE", "TUSD", "TWT", "True", "UNI3", "UNO", "USDC", "USDT", "USNBT", "VAL1", "VBK", "VERI", "VET", "VEX", "VGX", "VIA", "VIN", "VITAE", "VLX", "VRA", "VSYS", "VTC", "VTHO", "WABI", "WAN", "WAVES", "WAXP", "WGR", "WICC", "WINGS", "WOZX", "WTC", "XAS", "XBY", "XCP", "XDC", "XDN", "XEM", "XHV", "XLM", "XLQ", "XLT", "XMC", "XMR", "XMY", "XNC", "XNS1", "XRC", "XRP", "XSN", "XTZ", "XUC", "XVG", "XWC", "YEP", "YFI", "YOYOW", "ZANO", "ZEC", "ZEL", "ZEN", "ZIL", "ZNN", "ZRX", "ZVC", "ZYN"]
1+
[
2+
"AAVE",
3+
"ABBC",
4+
"ACH",
5+
"ACT",
6+
"ADA",
7+
"ADK",
8+
"ADX",
9+
"AE",
10+
"AIB",
11+
"AION",
12+
"ALGO",
13+
"ALIAS",
14+
"AMB",
15+
"AMP1",
16+
"ANKR",
17+
"ANT",
18+
"APL",
19+
"AR",
20+
"ARDR",
21+
"ARRR",
22+
"ATB",
23+
"ATOM1",
24+
"ATRI",
25+
"AVA",
26+
"AVAX",
27+
"AXEL",
28+
"BAND",
29+
"BAT",
30+
"BCA",
31+
"BCD",
32+
"BCH",
33+
"BCN",
34+
"BDX",
35+
"BEPRO",
36+
"BHD",
37+
"BHP",
38+
"BIP",
39+
"BLK",
40+
"BLOCK",
41+
"BNB",
42+
"BNT",
43+
"BONO",
44+
"BPC",
45+
"BPS",
46+
"BRC",
47+
"BST",
48+
"BSV",
49+
"BTC2",
50+
"BTG",
51+
"BTM",
52+
"BTS",
53+
"BTT1",
54+
"BTX",
55+
"BURST",
56+
"CCA",
57+
"CCXX",
58+
"CEL",
59+
"CELO",
60+
"CET",
61+
"CHI",
62+
"CHZ",
63+
"CKB",
64+
"CLAM",
65+
"CMT1",
66+
"CNX",
67+
"COLX",
68+
"COMP",
69+
"COMP1",
70+
"COTI",
71+
"CPS",
72+
"CRO",
73+
"CRU",
74+
"CRV",
75+
"CSC",
76+
"CTC",
77+
"CTC1",
78+
"CTXC",
79+
"CURE",
80+
"CUT",
81+
"CVC",
82+
"DAG",
83+
"DASH",
84+
"DCN",
85+
"DCR",
86+
"DCY",
87+
"DDK",
88+
"DERO",
89+
"DEV",
90+
"DFI",
91+
"DGB",
92+
"DGD",
93+
"DIME",
94+
"DMCH",
95+
"DMD",
96+
"DNA1",
97+
"DNT",
98+
"DOGE",
99+
"DOT1",
100+
"DTEP",
101+
"DUN",
102+
"ECA",
103+
"EDC",
104+
"EDG",
105+
"EGLD",
106+
"ELA",
107+
"EMC2",
108+
"ENJ",
109+
"EOS",
110+
"ERK",
111+
"ETC",
112+
"ETH",
113+
"ETN",
114+
"ETP",
115+
"EWT",
116+
"FAIR",
117+
"FCT",
118+
"FET",
119+
"FIL",
120+
"FIO",
121+
"FIRO",
122+
"FLASH",
123+
"FO",
124+
"FRST",
125+
"FTC",
126+
"FUN",
127+
"GAME",
128+
"GBYTE",
129+
"GCC1",
130+
"GHOST",
131+
"GHOST1",
132+
"GLEEC",
133+
"GLM",
134+
"GNO",
135+
"GO",
136+
"GRC",
137+
"GRN",
138+
"GRS",
139+
"GRT2",
140+
"GXC",
141+
"HBAR",
142+
"HC",
143+
"HIVE",
144+
"HNC",
145+
"HNS",
146+
"HNT1",
147+
"HPB",
148+
"HSS",
149+
"HTDF",
150+
"HTML",
151+
"HYC",
152+
"ICX",
153+
"IDNA",
154+
"ILC",
155+
"INSTAR",
156+
"INT",
157+
"IOC",
158+
"IOST",
159+
"IOTX",
160+
"IRIS",
161+
"JDC",
162+
"JUL",
163+
"KAVA",
164+
"KDA",
165+
"KMD",
166+
"KNC",
167+
"KRT",
168+
"KSM",
169+
"LBC",
170+
"LCC",
171+
"LINK",
172+
"LKK",
173+
"LOKI",
174+
"LRC",
175+
"LRG",
176+
"LSK",
177+
"LTC",
178+
"LUNA1",
179+
"LYNX",
180+
"MAID",
181+
"MAN",
182+
"MANA",
183+
"MARO",
184+
"MASS",
185+
"MATIC",
186+
"MBC",
187+
"MED",
188+
"META",
189+
"MGO",
190+
"MHC",
191+
"MIDAS",
192+
"MINT",
193+
"MIOTA",
194+
"MIR",
195+
"MIR1",
196+
"MKR",
197+
"MLN",
198+
"MOAC",
199+
"MONA",
200+
"MOON",
201+
"MRX",
202+
"MTC2",
203+
"MWC",
204+
"NAS",
205+
"NAV",
206+
"NEBL",
207+
"NIM",
208+
"NLC2",
209+
"NLG",
210+
"NMC",
211+
"NPC",
212+
"NU",
213+
"NULS",
214+
"NVT",
215+
"NXS",
216+
"NYE",
217+
"NYZO",
218+
"OBSR",
219+
"OMG",
220+
"ONE2",
221+
"ONT",
222+
"OTO",
223+
"OURO",
224+
"OWC",
225+
"OXT",
226+
"PAC",
227+
"PAI",
228+
"PART",
229+
"PAY",
230+
"PCX",
231+
"PHA",
232+
"PHR",
233+
"PI",
234+
"PIVX",
235+
"PLC",
236+
"PMEER",
237+
"POA",
238+
"POLIS",
239+
"PPC",
240+
"PPT",
241+
"PZM",
242+
"QASH",
243+
"QRK",
244+
"QRL",
245+
"QTUM",
246+
"RBTC",
247+
"RBY",
248+
"RDD",
249+
"REP",
250+
"REV",
251+
"RINGX",
252+
"RLC",
253+
"RSTR",
254+
"RVN",
255+
"SALT",
256+
"SAPP",
257+
"SBD",
258+
"SC",
259+
"SCC3",
260+
"SCP",
261+
"SERO",
262+
"SFT",
263+
"SKY",
264+
"SLS",
265+
"SMART",
266+
"SNGLS",
267+
"SNM",
268+
"SNT",
269+
"SNX",
270+
"SOL1",
271+
"SONO1",
272+
"SPHR",
273+
"SRK",
274+
"SRM",
275+
"STEEM",
276+
"STORJ",
277+
"STRAX",
278+
"STX1",
279+
"SUB",
280+
"SUSHI",
281+
"SYS",
282+
"TAAS",
283+
"TFUEL",
284+
"TOMO",
285+
"TRX",
286+
"TT",
287+
"TUBE",
288+
"TUSD",
289+
"TWT",
290+
"True",
291+
"UNI3",
292+
"UNO",
293+
"USDC",
294+
"USDT",
295+
"USNBT",
296+
"VAL1",
297+
"VBK",
298+
"VERI",
299+
"VET",
300+
"VEX",
301+
"VGX",
302+
"VIA",
303+
"VIN",
304+
"VITAE",
305+
"VLX",
306+
"VRA",
307+
"VSYS",
308+
"VTC",
309+
"VTHO",
310+
"WABI",
311+
"WAN",
312+
"WAVES",
313+
"WAXP",
314+
"WGR",
315+
"WICC",
316+
"WINGS",
317+
"WOZX",
318+
"WTC",
319+
"XAS",
320+
"XBY",
321+
"XCP",
322+
"XDC",
323+
"XDN",
324+
"XEM",
325+
"XHV",
326+
"XLM",
327+
"XLQ",
328+
"XLT",
329+
"XMC",
330+
"XMR",
331+
"XMY",
332+
"XNC",
333+
"XNS1",
334+
"XRC",
335+
"XRP",
336+
"XSN",
337+
"XTZ",
338+
"XUC",
339+
"XVG",
340+
"XWC",
341+
"YEP",
342+
"YFI",
343+
"YOYOW",
344+
"ZANO",
345+
"ZEC",
346+
"ZEL",
347+
"ZEN",
348+
"ZIL",
349+
"ZNN",
350+
"ZRX",
351+
"ZVC",
352+
"ZYN"
353+
]
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
["AUD", "BTC", "CAD", "CNY", "ETH", "EUR", "GBP", "INR", "JPY", "KRW", "RUB", "USD"]
1+
[
2+
"AUD",
3+
"BTC",
4+
"CAD",
5+
"CNY",
6+
"ETH",
7+
"EUR",
8+
"GBP",
9+
"INR",
10+
"JPY",
11+
"KRW",
12+
"RUB",
13+
"USD"
14+
]
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
["cryptocurrency", "currency"]
1+
[
2+
"cryptocurrency",
3+
"currency"
4+
]

0 commit comments

Comments
 (0)