@@ -148,14 +148,14 @@ def compute(self, named_inputs, outputs=None):
148148 [
149149 # NO old-stuff Operation(fn=_jetsamed_fn, name="test", needs="['a']", provides=[]),
150150 (
151- fnt .partial (
151+ lambda : fnt .partial (
152152 operation (name = "test" , needs = ["a" ], provides = ["b" ])(_scream ).compute ,
153153 named_inputs = {"a" : 1 },
154154 ),
155155 "outputs provides aliases results_fn results_op operation args" .split (),
156156 ),
157157 (
158- fnt .partial (
158+ lambda : fnt .partial (
159159 network .ExecutionPlan (* ([None ] * 6 ))._handle_task ,
160160 op = _ScreamingOperation (),
161161 solution = Solution (MagicMock (), {}),
@@ -168,6 +168,7 @@ def compute(self, named_inputs, outputs=None):
168168)
169169def test_jetsam_sites_screaming_func (acallable , expected_jetsam ):
170170 # Check jetsams when the underlying function fails.
171+ acallable = acallable ()
171172 with pytest .raises (Exception , match = "ABC" ) as excinfo :
172173 acallable ()
173174
@@ -181,11 +182,13 @@ def test_jetsam_sites_screaming_func(acallable, expected_jetsam):
181182 [
182183 # NO old-stuff Operation(fn=_jetsamed_fn, name="test", needs="['a']", provides=[]),
183184 (
184- fnt .partial (operation (_scream , name = "test" )().compute , named_inputs = None ),
185+ lambda : fnt .partial (
186+ operation (_scream , name = "test" )().compute , named_inputs = None
187+ ),
185188 "outputs provides aliases results_fn results_op operation args" .split (),
186189 ),
187190 (
188- fnt .partial (
191+ lambda : fnt .partial (
189192 network .ExecutionPlan (* ([None ] * 6 ))._handle_task ,
190193 op = operation (_scream , name = "Ah!" )(),
191194 solution = Solution (MagicMock (), {}),
@@ -194,13 +197,13 @@ def test_jetsam_sites_screaming_func(acallable, expected_jetsam):
194197 "plan solution task" .split (),
195198 ),
196199 (
197- fnt .partial (
200+ lambda : fnt .partial (
198201 network .ExecutionPlan (* ([None ] * 6 )).execute , named_inputs = None
199202 ),
200203 ["solution" ],
201204 ),
202205 (
203- fnt .partial (
206+ lambda : fnt .partial (
204207 NetworkOperation ([operation (str )()], "name" ).compute ,
205208 named_inputs = None ,
206209 outputs = "bad" ,
@@ -211,6 +214,7 @@ def test_jetsam_sites_screaming_func(acallable, expected_jetsam):
211214)
212215def test_jetsam_sites_scream (acallable , expected_jetsam ):
213216 # Check jetsams when the site fails.
217+ acallable = acallable ()
214218 with pytest .raises (Exception ) as excinfo :
215219 acallable ()
216220
@@ -482,7 +486,7 @@ def test_func_sourcelines_func(fn):
482486 exp = "def _foo():\n pass"
483487 got = base .func_sourcelines (fn , human = 1 )
484488 assert "" .join (got [0 ]).strip () == exp
485- assert got [1 ] == 225
489+ assert got [1 ] == 229
486490
487491
488492@pytest .mark .parametrize (
@@ -499,7 +503,7 @@ def test_func_sourcelines_method(fn):
499503 exp = "def foo(self):\n pass"
500504 got = base .func_sourcelines (fn , human = 1 )
501505 assert "" .join (got [0 ]).strip () == exp
502- assert got [1 ] == 230
506+ assert got [1 ] == 234
503507
504508
505509@pytest .mark .parametrize ("fn" , [eval , fnt .partial (eval )])
0 commit comments