Skip to content

Commit 79b600b

Browse files
committed
Normalize keyring monkeypatch
1 parent 572f93c commit 79b600b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/test_auth.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class MockKeyring:
2020
def get_credential(system, user):
2121
return None
2222

23-
monkeypatch.setattr(auth, "keyring", MockKeyring())
23+
monkeypatch.setattr(auth, "keyring", MockKeyring)
2424

2525
username = auth.Resolver(config, auth.CredentialInput()).username
2626
assert username == "entered user"
@@ -135,7 +135,7 @@ class FailKeyring:
135135
def get_credential(system, username):
136136
raise RuntimeError("fail!")
137137

138-
monkeypatch.setattr(auth, "keyring", FailKeyring())
138+
monkeypatch.setattr(auth, "keyring", FailKeyring)
139139

140140
assert auth.Resolver(config, auth.CredentialInput()).username == "entered user"
141141

@@ -156,7 +156,7 @@ class FailKeyring:
156156
def get_password(system, username):
157157
raise RuntimeError("fail!")
158158

159-
monkeypatch.setattr(auth, "keyring", FailKeyring())
159+
monkeypatch.setattr(auth, "keyring", FailKeyring)
160160

161161
assert auth.Resolver(config, auth.CredentialInput()).password == "entered pw"
162162

@@ -183,7 +183,7 @@ class FailKeyring:
183183
def get_credential(system, username):
184184
_raise_home_key_error()
185185

186-
monkeypatch.setattr(auth, "keyring", FailKeyring())
186+
monkeypatch.setattr(auth, "keyring", FailKeyring)
187187

188188
assert auth.Resolver(config, auth.CredentialInput()).username == "entered user"
189189

@@ -205,7 +205,7 @@ class FailKeyring:
205205
def get_password(system, username):
206206
_raise_home_key_error()
207207

208-
monkeypatch.setattr(auth, "keyring", FailKeyring())
208+
monkeypatch.setattr(auth, "keyring", FailKeyring)
209209

210210
assert auth.Resolver(config, auth.CredentialInput()).password == "entered pw"
211211

0 commit comments

Comments
 (0)