Skip to content

Commit babfc0d

Browse files
committed
Merge pull request #10731 from jreback/data
TST: better testing for io/data
2 parents f88ce3b + d751c63 commit babfc0d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

pandas/io/tests/test_data.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,11 @@ def setUpClass(cls):
291291

292292
# aapl has monthlies
293293
cls.aapl = web.Options('aapl', 'yahoo')
294-
today = datetime.today()
295-
cls.year = today.year
296-
cls.month = today.month + 1
297-
if cls.month > 12:
298-
cls.year = cls.year + 1
299-
cls.month = 1
300-
cls.expiry = datetime(cls.year, cls.month, 1)
294+
d = (Timestamp.today() + pd.offsets.MonthBegin(1)).normalize()
295+
cls.year = d.year
296+
cls.month = d.month
297+
cls.expiry = d
298+
cls.expiry2 = d + pd.offsets.MonthBegin(1)
301299
cls.dirpath = tm.get_data_path()
302300
cls.html1 = os.path.join(cls.dirpath, 'yahoo_options1.html')
303301
cls.html2 = os.path.join(cls.dirpath, 'yahoo_options2.html')
@@ -325,7 +323,7 @@ def test_get_options_data(self):
325323
def test_get_near_stock_price(self):
326324
try:
327325
options = self.aapl.get_near_stock_price(call=True, put=True,
328-
expiry=self.expiry)
326+
expiry=[self.expiry,self.expiry2])
329327
except RemoteDataError as e:
330328
raise nose.SkipTest(e)
331329
self.assertTrue(len(options) > 1)

0 commit comments

Comments
 (0)