Skip to content

Commit

Permalink
Ran ruff check --fix --select UP --unsafe-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Mar 23, 2024
1 parent 0048a63 commit 2838176
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion keyring/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def find_user_password(self, realm, authuri):
user = self.get_username(realm, authuri)
password = get_password(realm, user)
if password is None:
prompt = 'password for %(user)s@%(realm)s for ' '%(authuri)s: ' % vars()
prompt = 'password for {user}@{realm} for ' '{authuri}: '.format(**vars())
password = getpass.getpass(prompt)
set_password(realm, user, password)
return user, password
Expand Down
16 changes: 7 additions & 9 deletions tests/backends/test_kwallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ def check_set_get(self, service, username, password):
self.keyring = keyring = self.init_keyring()
ret_password = keyring.get_password(service, username)
assert ret_password == password, (
"Incorrect password for username: '%s' "
"on service: '%s'. '%s' != '%s'"
% (service, username, ret_password, password),
f"Incorrect password for username: '{service}' "
f"on service: '{username}'. '{ret_password}' != '{password}'",
)

# for the empty password
Expand All @@ -58,15 +57,14 @@ def check_set_get(self, service, username, password):
self.keyring = keyring = self.init_keyring()
ret_password = keyring.get_password(service, username)
assert ret_password == "", (
"Incorrect password for username: '%s' "
"on service: '%s'. '%s' != '%s'" % (service, username, ret_password, ""),
"Incorrect password for username: '{}' "
"on service: '{}'. '{}' != '{}'".format(service, username, ret_password, ""),
)
ret_password = keyring.get_password('Python', username + '@' + service)
assert ret_password is None, (
"Not 'None' password returned for username: '%s' "
"on service: '%s'. '%s' != '%s'. Passwords from old "
"folder should be deleted during migration."
% (service, username, ret_password, None),
f"Not 'None' password returned for username: '{service}' "
f"on service: '{username}'. '{ret_password}' != '{None}'. Passwords from old "
"folder should be deleted during migration.",
)


Expand Down

0 comments on commit 2838176

Please sign in to comment.