@@ -49,7 +49,7 @@ def test_fails_no_distributions(caplog):
49
49
]
50
50
51
51
52
- def build_sdist (src_path , project_files ):
52
+ def build_package (src_path , project_files , distribution = "sdist" ):
53
53
"""
54
54
Build a source distribution similar to `python3 -m build --sdist`.
55
55
@@ -70,12 +70,13 @@ def build_sdist(src_path, project_files):
70
70
(src_path / filename ).write_text (textwrap .dedent (content ))
71
71
72
72
builder = build .ProjectBuilder (src_path )
73
- return builder .build ("sdist" , str (src_path / "dist" ))
73
+ return builder .build (distribution , str (src_path / "dist" ))
74
74
75
75
76
+ @pytest .mark .parametrize ("distribution" , ["sdist" , "wheel" ])
76
77
@pytest .mark .parametrize ("strict" , [False , True ])
77
- def test_warns_missing_description (strict , tmp_path , capsys , caplog ):
78
- sdist = build_sdist (
78
+ def test_warns_missing_description (distribution , strict , tmp_path , capsys , caplog ):
79
+ sdist = build_package (
79
80
tmp_path ,
80
81
{
81
82
"setup.cfg" : (
@@ -86,6 +87,7 @@ def test_warns_missing_description(strict, tmp_path, capsys, caplog):
86
87
"""
87
88
),
88
89
},
90
+ distribution = distribution ,
89
91
)
90
92
91
93
assert check .check ([sdist ], strict = strict ) is strict
@@ -109,7 +111,7 @@ def test_warns_missing_description(strict, tmp_path, capsys, caplog):
109
111
110
112
111
113
def test_warns_missing_file (tmp_path , capsys , caplog ):
112
- sdist = build_sdist (
114
+ sdist = build_package (
113
115
tmp_path ,
114
116
{
115
117
"setup.cfg" : (
@@ -138,7 +140,7 @@ def test_warns_missing_file(tmp_path, capsys, caplog):
138
140
139
141
140
142
def test_fails_rst_syntax_error (tmp_path , capsys , caplog ):
141
- sdist = build_sdist (
143
+ sdist = build_package (
142
144
tmp_path ,
143
145
{
144
146
"setup.cfg" : (
@@ -174,7 +176,7 @@ def test_fails_rst_syntax_error(tmp_path, capsys, caplog):
174
176
175
177
176
178
def test_fails_rst_no_content (tmp_path , capsys , caplog ):
177
- sdist = build_sdist (
179
+ sdist = build_package (
178
180
tmp_path ,
179
181
{
180
182
"setup.cfg" : (
@@ -211,7 +213,7 @@ def test_fails_rst_no_content(tmp_path, capsys, caplog):
211
213
212
214
213
215
def test_passes_rst_description (tmp_path , capsys , caplog ):
214
- sdist = build_sdist (
216
+ sdist = build_package (
215
217
tmp_path ,
216
218
{
217
219
"setup.cfg" : (
@@ -243,7 +245,7 @@ def test_passes_rst_description(tmp_path, capsys, caplog):
243
245
244
246
@pytest .mark .parametrize ("content_type" , ["text/markdown" , "text/plain" ])
245
247
def test_passes_markdown_description (content_type , tmp_path , capsys , caplog ):
246
- sdist = build_sdist (
248
+ sdist = build_package (
247
249
tmp_path ,
248
250
{
249
251
"setup.cfg" : (
0 commit comments