Skip to content

Commit 7afe97d

Browse files
committed
tests: rw: convert to more pytest infrastructure
Signed-off-by: Cole Robinson <crobinso@redhat.com>
1 parent f98adeb commit 7afe97d

3 files changed

Lines changed: 908 additions & 904 deletions

File tree

tests/test_api_misc.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from __future__ import print_function
1313

1414
import os
15+
import sys
1516
import tempfile
1617

1718
import pytest
@@ -263,14 +264,7 @@ def test_interactive_login(capsys, monkeypatch):
263264
user_get_args=None,
264265
user_get_return={})
265266

266-
import sys
267-
import getpass
268-
269-
if sys.version_info[0] >= 3:
270-
monkeypatch.setattr(getpass, "getpass", input)
271-
else:
272-
monkeypatch.setattr(getpass, "getpass",
273-
raw_input) # pylint: disable=undefined-variable
267+
tests.utils.monkeypatch_getpass(monkeypatch)
274268

275269
fakestdin = tests.utils.fake_stream("fakeuser\nfakepass\n")
276270
monkeypatch.setattr(sys, "stdin", fakestdin)

0 commit comments

Comments
 (0)