Skip to content

Commit f240be7

Browse files
committed
Fixed unit tests
1 parent a450976 commit f240be7

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

financepy/market/volatility/fx_vol_surface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ def solver_for_smile_strike(
894894

895895
###########################################################################
896896

897-
def check_calibration(self, verbose: bool, tol: float = 1e-6):
897+
def check_calibration(self, verbose: bool, tol: float = 1e-5):
898898

899899
if verbose:
900900

unit_tests/test_FinBondOption.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
def test_european_call_bk():
4141

4242
opt_type = OptionTypes.EUROPEAN_CALL
43-
strike_price = 100
43+
strike_price = 100.0
4444

4545
bond_option = BondOption(bond, expiry_dt, strike_price, opt_type)
4646

@@ -60,7 +60,7 @@ def test_european_call_bk():
6060
def test_american_call_bk():
6161

6262
opt_type = OptionTypes.AMERICAN_CALL
63-
strike_price = 100
63+
strike_price = 100.0
6464

6565
bond_option = BondOption(bond, expiry_dt, strike_price, opt_type)
6666

@@ -79,7 +79,7 @@ def test_american_call_bk():
7979
def test_european_put_bk():
8080

8181
opt_type = OptionTypes.EUROPEAN_PUT
82-
strike_price = 100
82+
strike_price = 100.0
8383

8484
bond_option = BondOption(bond, expiry_dt, strike_price, opt_type)
8585

@@ -98,7 +98,7 @@ def test_european_put_bk():
9898
def test_american_put_bk():
9999

100100
opt_type = OptionTypes.AMERICAN_PUT
101-
strike_price = 100
101+
strike_price = 100.0
102102

103103
bond_option = BondOption(bond, expiry_dt, strike_price, opt_type)
104104

@@ -117,7 +117,7 @@ def test_american_put_bk():
117117
def test_european_call_bdt():
118118

119119
opt_type = OptionTypes.EUROPEAN_CALL
120-
strike_price = 100
120+
strike_price = 100.0
121121

122122
bond_option = BondOption(bond, expiry_dt, strike_price, opt_type)
123123

@@ -135,7 +135,7 @@ def test_european_call_bdt():
135135
def test_american_call_bdt():
136136

137137
opt_type = OptionTypes.AMERICAN_CALL
138-
strike_price = 100
138+
strike_price = 100.0
139139

140140
bond_option = BondOption(bond, expiry_dt, strike_price, opt_type)
141141

@@ -153,7 +153,7 @@ def test_american_call_bdt():
153153
def test_european_put_bdt():
154154

155155
opt_type = OptionTypes.EUROPEAN_PUT
156-
strike_price = 100
156+
strike_price = 100.0
157157

158158
bond_option = BondOption(bond, expiry_dt, strike_price, opt_type)
159159

@@ -171,7 +171,7 @@ def test_european_put_bdt():
171171
def test_american_put_bdt():
172172

173173
opt_type = OptionTypes.AMERICAN_PUT
174-
strike_price = 100
174+
strike_price = 100.0
175175

176176
bond_option = BondOption(bond, expiry_dt, strike_price, opt_type)
177177

@@ -192,7 +192,7 @@ def test_american_put_bdt():
192192
def test_european_call_hw():
193193

194194
opt_type = OptionTypes.EUROPEAN_CALL
195-
strike_price = 100
195+
strike_price = 100.0
196196
num_time_steps = 100
197197

198198
bond_option = BondOption(bond, expiry_dt, strike_price, opt_type)
@@ -212,7 +212,7 @@ def test_european_call_hw():
212212
def test_american_call_hw():
213213

214214
opt_type = OptionTypes.AMERICAN_CALL
215-
strike_price = 100
215+
strike_price = 100.0
216216

217217
bond_option = BondOption(bond, expiry_dt, strike_price, opt_type)
218218

@@ -231,7 +231,7 @@ def test_american_call_hw():
231231
def test_european_put_hw():
232232

233233
opt_type = OptionTypes.EUROPEAN_PUT
234-
strike_price = 100
234+
strike_price = 100.0
235235

236236
bond_option = BondOption(bond, expiry_dt, strike_price, opt_type)
237237

@@ -250,7 +250,7 @@ def test_european_put_hw():
250250
def test_american_put_hw():
251251

252252
opt_type = OptionTypes.AMERICAN_PUT
253-
strike_price = 100
253+
strike_price = 100.0
254254

255255
bond_option = BondOption(bond, expiry_dt, strike_price, opt_type)
256256

0 commit comments

Comments
 (0)