File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 2222from quantlib .quotes import SimpleQuote
2323from quantlib .termstructures .volatility .api import BlackConstantVol
2424
25+ import contextlib
2526import unittest
2627
2728from .utilities import flat_rate
@@ -42,9 +43,11 @@ class AsianOptionTestCase(unittest.TestCase):
4243 """
4344
4445 def setUp (self ):
45-
4646 self .settings = Settings ()
47-
47+ stack = contextlib .ExitStack ()
48+ self .settings = stack .enter_context (Settings ())
49+ self .addCleanup (stack .close )
50+
4851 self .calendar = NullCalendar ()
4952
5053 self .today = Date (6 , June , 2021 )
@@ -96,10 +99,9 @@ def setUp(self):
9699
97100 self .payoff = PlainVanillaPayoff (self .option_type , self .strike )
98101
99-
100102 def test_analytic_cont_geom_av_price (self ):
101103 """
102- " Testing analytic continuous geometric average-price Asians...")
104+ Testing analytic continuous geometric average-price Asians
103105
104106 data from "Option Pricing Formulas", Haug, pag.96-97
105107 """
You can’t perform that action at this time.
0 commit comments