File tree 1 file changed +6
-8
lines changed
1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -291,13 +291,11 @@ def setUpClass(cls):
291
291
292
292
# aapl has monthlies
293
293
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 )
301
299
cls .dirpath = tm .get_data_path ()
302
300
cls .html1 = os .path .join (cls .dirpath , 'yahoo_options1.html' )
303
301
cls .html2 = os .path .join (cls .dirpath , 'yahoo_options2.html' )
@@ -325,7 +323,7 @@ def test_get_options_data(self):
325
323
def test_get_near_stock_price (self ):
326
324
try :
327
325
options = self .aapl .get_near_stock_price (call = True , put = True ,
328
- expiry = self .expiry )
326
+ expiry = [ self .expiry , self . expiry2 ] )
329
327
except RemoteDataError as e :
330
328
raise nose .SkipTest (e )
331
329
self .assertTrue (len (options ) > 1 )
You can’t perform that action at this time.
0 commit comments