12
12
@needs_latexmk
13
13
@skip_on_github_actions_with_win
14
14
@pytest .mark .end_to_end
15
- @pytest .mark .parametrize ("infer_dependencies" , [True , False ])
16
- def test_infer_dependencies_from_task (tmp_path , infer_dependencies ):
15
+ @pytest .mark .parametrize ("infer_dependencies" , ["true" , "false" ])
16
+ @pytest .mark .parametrize (
17
+ "config_file, content" ,
18
+ [
19
+ ("pytask.ini" , "[pytask]\n infer_latex_dependencies = {}" ),
20
+ ("pyproject.toml" , "[tool.pytask.ini_options]\n infer_latex_dependencies = {}" ),
21
+ ],
22
+ )
23
+ def test_infer_dependencies_from_task (
24
+ tmp_path , infer_dependencies , config_file , content
25
+ ):
17
26
task_source = """
18
27
import pytask
19
28
@@ -32,14 +41,12 @@ def task_compile_document():
32
41
tmp_path .joinpath ("document.tex" ).write_text (textwrap .dedent (latex_source ))
33
42
tmp_path .joinpath ("sub_document.tex" ).write_text ("Lorem ipsum." )
34
43
35
- tmp_path .joinpath ("pytask.ini" ).write_text (
36
- f"[pytask]\n infer_latex_dependencies = { infer_dependencies } "
37
- )
44
+ tmp_path .joinpath (config_file ).write_text (content .format (infer_dependencies ))
38
45
39
46
session = main ({"paths" : tmp_path })
40
47
assert session .exit_code == ExitCode .OK
41
48
assert len (session .tasks ) == 1
42
- if infer_dependencies :
49
+ if infer_dependencies == "true" :
43
50
assert len (session .tasks [0 ].depends_on ) == 2
44
51
else :
45
52
assert len (session .tasks [0 ].depends_on ) == 1
0 commit comments