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 <aditya@saky.in>
  • Loading branch information
adityasaky committed Oct 8, 2019
1 parent ea8d010 commit 445c092
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,16 @@ 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('repository_url', [
"https://upload.pypi.org/",
"https://test.pypi.org/"
])
def test_check_status_code_for_wrong_repo_url(repository_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'] = repository_url

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

0 comments on commit 445c092

Please sign in to comment.