Skip to content

Commit d2cc71d

Browse files
committed
Add pytest.mark.parametrize to try both upload.pypi and test.pypi as repository URLs
Signed-off-by: Aditya Saky <[email protected]>
1 parent ea8d010 commit d2cc71d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/test_upload.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,15 @@ def none_upload(*args, **settings_kwargs):
288288
assert "/foo/bar.crt" == upload_settings.cacert
289289

290290

291-
def test_check_status_code_for_wrong_repo_url(make_settings, capsys):
291+
@pytest.mark.parametrize('repo_url', [
292+
"https://upload.pypi.org/",
293+
"https://test.pypi.org/"
294+
])
295+
def test_check_status_code_for_wrong_repo_url(repo_url, make_settings, capsys):
292296
upload_settings = make_settings()
293297

294298
# override defaults to use incorrect URL
295-
upload_settings.repository_config['repository'] = \
296-
"https://upload.pypi.org"
299+
upload_settings.repository_config['repository'] = repo_url
297300

298301
with pytest.raises(HTTPError):
299302
upload.upload(upload_settings, [

0 commit comments

Comments
 (0)