Skip to content

Commit

Permalink
Restore ability for users to override the username even for PyPI.
Browse files Browse the repository at this point in the history
Partially reverts 4a2dfb0.
  • Loading branch information
jaraco committed Jun 26, 2024
1 parent 5099b21 commit cfef7f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions tests/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,15 @@ def none_register(*args, **settings_kwargs):
monkeypatch.setattr(register, "register", replaced_register)
testenv = {
"TWINE_REPOSITORY": repo,
# Ignored because the TWINE_REPOSITORY is PyPI/TestPyPI
"TWINE_USERNAME": "this-is-ignored",
"TWINE_USERNAME": "pypiuser",
"TWINE_PASSWORD": "pypipassword",
"TWINE_CERT": "/foo/bar.crt",
}
with helpers.set_env(**testenv):
cli.dispatch(["register", helpers.WHEEL_FIXTURE])
register_settings = replaced_register.calls[0].args[0]
assert "pypipassword" == register_settings.password
assert "__token__" == register_settings.username
assert "pypiuser" == register_settings.username
assert "/foo/bar.crt" == register_settings.cacert


Expand Down
5 changes: 2 additions & 3 deletions tests/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,16 +604,15 @@ def none_upload(*args, **settings_kwargs):
monkeypatch.setattr(upload, "upload", replaced_upload)
testenv = {
"TWINE_REPOSITORY": repo,
# Ignored because TWINE_REPOSITORY is PyPI/TestPyPI
"TWINE_USERNAME": "this-is-ignored",
"TWINE_USERNAME": "pypiuser",
"TWINE_PASSWORD": "pypipassword",
"TWINE_CERT": "/foo/bar.crt",
}
with helpers.set_env(**testenv):
cli.dispatch(["upload", "path/to/file"])
upload_settings = replaced_upload.calls[0].args[0]
assert "pypipassword" == upload_settings.password
assert "__token__" == upload_settings.username
assert "pypiuser" == upload_settings.username
assert "/foo/bar.crt" == upload_settings.cacert


Expand Down

0 comments on commit cfef7f2

Please sign in to comment.