Skip to content

Commit

Permalink
Add pytest.mark.parametrize to try both upload.pypi and test.pypi as …
Browse files Browse the repository at this point in the history
…repository URLs

Signed-off-by: Aditya Saky <[email protected]>
  • Loading branch information
adityasaky committed Oct 8, 2019
1 parent ea8d010 commit d2cc71d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,15 @@ def none_upload(*args, **settings_kwargs):
assert "/foo/bar.crt" == upload_settings.cacert


def test_check_status_code_for_wrong_repo_url(make_settings, capsys):
@pytest.mark.parametrize('repo_url', [
"https://upload.pypi.org/",
"https://test.pypi.org/"
])
def test_check_status_code_for_wrong_repo_url(repo_url, make_settings, capsys):
upload_settings = make_settings()

# override defaults to use incorrect URL
upload_settings.repository_config['repository'] = \
"https://upload.pypi.org"
upload_settings.repository_config['repository'] = repo_url

with pytest.raises(HTTPError):
upload.upload(upload_settings, [
Expand Down

0 comments on commit d2cc71d

Please sign in to comment.