13
13
14
14
class ExchangeMock (object ):
15
15
def get_latest_asset_bid_ask (self , asset ):
16
- return (np .NaN , np .NaN )
16
+ return (np .nan , np .nan )
17
17
18
18
def is_open_at_datetime (self , dt ):
19
19
return True
@@ -34,10 +34,10 @@ def is_open_at_datetime(self, dt):
34
34
35
35
class DataHandlerMock (object ):
36
36
def get_asset_latest_bid_ask_price (self , dt , asset ):
37
- return (np .NaN , np .NaN )
37
+ return (np .nan , np .nan )
38
38
39
39
def get_asset_latest_mid_price (self , dt , asset ):
40
- return np .NaN
40
+ return np .nan
41
41
42
42
43
43
class DataHandlerMockPrice (object ):
@@ -570,7 +570,7 @@ def test_submit_order():
570
570
"""
571
571
Tests the execute_order method for:
572
572
* Raises ValueError if no portfolio_id
573
- * Raises ValueError if bid/ask is (np.NaN , np.NaN )
573
+ * Raises ValueError if bid/ask is (np.nan , np.nan )
574
574
* Checks that bid/ask are correctly set dependent
575
575
upon order direction
576
576
* Checks that portfolio values are correct after
@@ -589,7 +589,7 @@ def test_submit_order():
589
589
with pytest .raises (KeyError ):
590
590
sb .submit_order ("1234" , order )
591
591
592
- # Raises ValueError if bid/ask is (np.NaN , np.NaN )
592
+ # Raises ValueError if bid/ask is (np.nan , np.nan )
593
593
exchange_exception = ExchangeMockException ()
594
594
sbnp = SimulatedBroker (start_dt , exchange_exception , data_handler )
595
595
sbnp .create_portfolio (portfolio_id = 1234 , name = "My Portfolio #1" )
0 commit comments