-
Notifications
You must be signed in to change notification settings - Fork 679
/
Copy pathtest_stooq.py
47 lines (29 loc) · 975 Bytes
/
test_stooq.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import pytest
from pandas_datareader import data as web
from pandas_datareader.data import get_data_stooq
pytestmark = pytest.mark.stable
def test_stooq_dji():
f = web.DataReader("GS", "stooq")
assert f.shape[0] > 0
def test_get_data_stooq_dji():
f = get_data_stooq("AMZN")
assert f.shape[0] > 0
def test_get_data_stooq_dates():
f = get_data_stooq("SPY", start="20180101", end="20180115")
assert f.shape[0] == 9
def test_stooq_sp500():
f = get_data_stooq("^SPX")
assert f.shape[0] > 0
@pytest.mark.xfail(reason="No longer works as of October 2023")
def test_stooq_clx19f():
f = get_data_stooq("CLX26.F", start="20200101", end="20200115")
assert f.shape[0] > 0
def test_get_data_stooq_dax():
f = get_data_stooq("^DAX")
assert f.shape[0] > 0
def test_stooq_googl():
f = get_data_stooq("GOOGL.US")
assert f.shape[0] > 0
def test_get_data_ibm():
f = get_data_stooq("IBM.DE")
assert f.shape[0] > 0