File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ import functools
34import warnings
45from typing import Any
56from typing import Callable
1314
1415
1516def is_task_function (func : Any ) -> bool :
16- return callable (func ) and getattr (func , "__name__" , "<lambda>" ) != "<lambda>"
17+ return (callable (func ) and getattr (func , "__name__" , "<lambda>" ) != "<lambda>" ) or (
18+ isinstance (func , functools .partial )
19+ and getattr (func .func , "__name__" , "<lambda>" ) != "<lambda>"
20+ )
1721
1822
1923@define (frozen = True )
Original file line number Diff line number Diff line change @@ -347,7 +347,7 @@ def func(produces, content):
347347 produces.write_text(content)
348348
349349 task_func = pytask.mark.produces("out.txt")(
350- pytask.mark.skip( functools.partial(func, content="hello") )
350+ functools.partial(func, content="hello")
351351 )
352352 """
353353 tmp_path .joinpath ("task_module.py" ).write_text (textwrap .dedent (source ))
@@ -357,6 +357,7 @@ def func(produces, content):
357357 assert result .exit_code == ExitCode .OK
358358 assert "Collected 1 task." in result .output
359359 assert "1 Succeeded" in result .output
360+ assert tmp_path .joinpath ("out.txt" ).exists ()
360361
361362
362363@pytest .mark .end_to_end
You can’t perform that action at this time.
0 commit comments