mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-07 16:56:13 +02:00
fix another test that uses stdin
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
This commit is contained in:
parent
733aad07b9
commit
81bdf27d67
2 changed files with 8 additions and 4 deletions
|
@ -224,11 +224,12 @@ def should_not():
|
|||
def mock_user_input(request, is_tty):
|
||||
def _generator(target):
|
||||
def _mock_user_input():
|
||||
user_input = get_fixture(request, "user_input", "")
|
||||
user_input = user_input.splitlines() if is_tty else [user_input]
|
||||
user_input = get_fixture(request, "user_input", None)
|
||||
|
||||
if not user_input:
|
||||
if user_input is None:
|
||||
user_input = Exception("Unexpected call for user input")
|
||||
else:
|
||||
user_input = user_input.splitlines() if is_tty else [user_input]
|
||||
|
||||
return patch(target, side_effect=user_input)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue