Skip to content

Commit

Permalink
tests: handle pexpect on macos
Browse files Browse the repository at this point in the history
Signed-off-by: Evgeniy Zayats <[email protected]>
  • Loading branch information
Evgeniy Zayats committed Apr 26, 2024
1 parent 80d724a commit 23f8023
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pytest_tests/lib/s3/s3_gate_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import os
import re
import sys
import uuid
from typing import Any, Optional

Expand Down Expand Up @@ -39,8 +40,12 @@ def _run_with_passwd(cmd: str, password: str) -> str:
child.delaybeforesend = 1
child.expect(".*")
child.sendline(f"{password}\r")
child.wait()
cmd = child.read()
if sys.platform == "darwin":
child.expect(pexpect.EOF)
cmd = child.before
else:
child.wait()
cmd = child.read()
return cmd.decode()


Expand Down

0 comments on commit 23f8023

Please sign in to comment.