Skip to content

Commit 9a46d2c

Browse files
committed
Merge pull request #9137 from jnmclarty/fixwbtests
TST: Fix failing test due to revision in WB data #9115
2 parents ab20769 + b65839d commit 9a46d2c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/io/tests/test_wb.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ def test_wdi_download(self):
4040

4141
expected = {'NY.GDP.PCAP.CD': {('Canada', '2003'): 28026.006013044702, ('Mexico', '2003'): 6601.0420648056606, ('Canada', '2004'): 31829.522562759001, ('Kosovo', '2003'): 1969.56271307405, ('Mexico', '2004'): 7042.0247834044303, ('United States', '2004'): 41928.886136479705, ('United States', '2003'): 39682.472247320402, ('Kosovo', '2004'): 2135.3328465238301}}
4242
expected = pandas.DataFrame(expected)
43+
#Round, to ignore revisions to data.
44+
expected = pandas.np.round(expected,decimals=-3)
4345
expected.sort(inplace=True)
4446
result = download(country=cntry_codes, indicator=inds,
4547
start=2003, end=2004, errors='ignore')
4648
result.sort(inplace=True)
49+
#Round, to ignore revisions to data.
50+
result = pandas.np.round(result,decimals=-3)
4751
expected.index = result.index
4852
assert_frame_equal(result, pandas.DataFrame(expected))
4953

0 commit comments

Comments
 (0)