Skip to content

Commit a3dcde0

Browse files
committed
MAINT: Correct Eurostat tests
1 parent 4aa8d28 commit a3dcde0

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

pandas_datareader/tests/test_econdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numpy as np
22
import pandas as pd
3-
import pytest
43
from pandas import testing as tm
4+
import pytest
55

66
from pandas_datareader import data as web
77

pandas_datareader/tests/test_eurostat.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,19 @@ def test_get_ert_h_eur_a(self):
2020
)
2121
assert isinstance(df, pd.DataFrame)
2222

23-
header = df.columns.levels[0][0]
2423
currencies = ["Italian lira", "Lithuanian litas"]
25-
df = df[header]
26-
df = df["Average"][currencies]
24+
# cols = [(currency, "Average") for currency in currencies]
25+
df_currency = df[currencies]
26+
df_currency = df_currency.xs("Average", axis=1, level=1)
27+
df_currency.columns = df_currency.columns.droplevel(1)
2728

2829
exp_col = pd.MultiIndex.from_product(
2930
[currencies, ["Annual"]], names=["CURRENCY", "FREQ"]
3031
)
3132
exp_idx = pd.DatetimeIndex(["2009-01-01", "2010-01-01"], name="TIME_PERIOD")
3233
values = np.array([[1936.27, 3.4528], [1936.27, 3.4528]])
3334
expected = pd.DataFrame(values, index=exp_idx, columns=exp_col)
34-
tm.assert_frame_equal(df, expected)
35+
tm.assert_frame_equal(df_currency, expected)
3536

3637
def test_get_sts_cobp_a(self):
3738
# Building permits - annual data (2010 = 100)
@@ -44,8 +45,8 @@ def test_get_sts_cobp_a(self):
4445

4546
idx = pd.date_range("2000-01-01", "2013-01-01", freq="AS", name="TIME_PERIOD")
4647
ne_name = (
47-
"Index, 2010=100",
4848
"Building permits - m2 of useful floor area",
49+
"Index, 2010=100",
4950
"Unadjusted data (i.e. neither seasonally adjusted nor "
5051
"calendar adjusted data)",
5152
"Non-residential buildings, except office buildings",
@@ -71,8 +72,8 @@ def test_get_sts_cobp_a(self):
7172
ne = pd.Series(ne_values, name=ne_name, index=idx)
7273

7374
uk_name = (
74-
"Index, 2010=100",
7575
"Building permits - m2 of useful floor area",
76+
"Index, 2010=100",
7677
"Unadjusted data (i.e. neither seasonally adjusted nor "
7778
"calendar adjusted data)",
7879
"Non-residential buildings, except office buildings",
@@ -113,11 +114,11 @@ def test_get_nrg_pc_202(self):
113114
)
114115

115116
name = (
116-
"All taxes and levies included",
117-
"Gigajoule (gross calorific value - GCV)",
118117
"Euro",
119-
"Band D1 : Consumption < 20 GJ",
118+
"Gigajoule (gross calorific value - GCV)",
120119
"Natural gas",
120+
"All taxes and levies included",
121+
"Band D1 : Consumption < 20 GJ",
121122
"Denmark",
122123
"Semi-annual",
123124
)

pandas_datareader/tests/test_quandl.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import os
22

3-
import pytest
43
import pandas as pd
4+
import pytest
55

66
from pandas_datareader import data as web
77
from pandas_datareader.compat import assert_frame_equal
88

9-
109
TEST_API_KEY = os.getenv("QUANDL_API_KEY")
1110
# Ensure blank TEST_API_KEY not used in pull request
1211
TEST_API_KEY = None if not TEST_API_KEY else TEST_API_KEY

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tag_prefix = v
77

88
[isort]
99
known_compat=pandas_datareader.compat.*
10-
sections=FUTURE,COMPAT,STDLIB,THIRDPARTY,PRE_CORE,FIRSTPARTY,LOCALFOLDER
10+
sections=FUTURE,COMPAT,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
1111
known_first_party=pandas_datareader
1212
known_third_party=numpy,pandas,pytest,requests
1313
combine_as_imports=True

0 commit comments

Comments
 (0)