File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments