1
1
# stdlib
2
2
from types import SimpleNamespace
3
+ from typing import List
3
4
4
5
# 3rd party
5
6
import pytest
6
7
import toml
7
8
from coincidence import AdvancedDataRegressionFixture
9
+ from domdf_python_tools .paths import PathPlus
8
10
from shippinglabel .requirements import read_requirements
9
11
10
12
# this package
38
40
(bad_example_requirements , bad_expected_mapping ),
39
41
]
40
42
)
41
- def test_seed_intersphinx_mapping (tmp_pathplus , contents , expects , capsys ):
43
+ def test_seed_intersphinx_mapping (
44
+ tmp_pathplus : PathPlus ,
45
+ contents : str ,
46
+ expects : List [str ],
47
+ capsys ,
48
+ ):
42
49
(tmp_pathplus / "requirements.txt" ).write_text (contents )
43
50
44
51
assert seed_intersphinx_mapping (* parse_requirements_txt (tmp_pathplus )) == expects
@@ -57,7 +64,7 @@ def test_seed_intersphinx_mapping(tmp_pathplus, contents, expects, capsys):
57
64
(bad_example_requirements , bad_expected_mapping ),
58
65
]
59
66
)
60
- def test_seed_intersphinx_mapping_pyproject (tmp_pathplus , contents , expects , capsys ):
67
+ def test_seed_intersphinx_mapping_pyproject (tmp_pathplus : PathPlus , contents : str , expects : List [ str ] , capsys ):
61
68
data = {"project" : {"dependencies" : contents .splitlines ()}}
62
69
(tmp_pathplus / "pyproject.toml" ).write_clean (toml .dumps (data ))
63
70
@@ -72,7 +79,7 @@ def test_seed_intersphinx_mapping_pyproject(tmp_pathplus, contents, expects, cap
72
79
(bad_example_requirements , bad_expected_mapping ),
73
80
]
74
81
)
75
- def test_seed_intersphinx_mapping_flit (tmp_pathplus , contents , expects , capsys ):
82
+ def test_seed_intersphinx_mapping_flit (tmp_pathplus : PathPlus , contents : str , expects : List [ str ] , capsys ):
76
83
data = {"tool" : {"flit" : {"metadata" : {"requires" : contents .splitlines ()}}}}
77
84
(tmp_pathplus / "pyproject.toml" ).write_clean (toml .dumps (data ))
78
85
@@ -90,9 +97,9 @@ def test_seed_intersphinx_mapping_flit(tmp_pathplus, contents, expects, capsys):
90
97
]
91
98
)
92
99
def test_sphinx_seed_intersphinx_mapping_mocked (
93
- tmp_pathplus ,
100
+ tmp_pathplus : PathPlus ,
94
101
capsys ,
95
- contents ,
102
+ contents : str ,
96
103
advanced_data_regression : AdvancedDataRegressionFixture ,
97
104
pkg_requirements_source : str
98
105
):
@@ -122,7 +129,7 @@ def test_sphinx_seed_intersphinx_mapping_mocked(
122
129
123
130
124
131
def test_sphinx_seed_intersphinx_mapping_list_mocked (
125
- tmp_pathplus ,
132
+ tmp_pathplus : PathPlus ,
126
133
advanced_data_regression : AdvancedDataRegressionFixture ,
127
134
):
128
135
0 commit comments