From c3d2611405b896f6b7cd324b827dd15b6da6ec28 Mon Sep 17 00:00:00 2001 From: Yason Khaburzaniya Date: Sat, 18 Jan 2025 22:33:15 -0800 Subject: [PATCH 1/4] add timer to slow down the test --- tests/test_interactive_process.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_interactive_process.py b/tests/test_interactive_process.py index 7ed7d7c..5167b7b 100644 --- a/tests/test_interactive_process.py +++ b/tests/test_interactive_process.py @@ -31,6 +31,7 @@ def process(self): def test_stream_nonblocking(self): self.process.send_command("echo Hello") + time.sleep(1) output = self.process.read_nonblocking() assert output.strip() == "Hello" # newline is part of echo command From 099d864357536ed5fc71ed86b36a25ed2bb616a4 Mon Sep 17 00:00:00 2001 From: Yason Khaburzaniya Date: Sat, 18 Jan 2025 22:36:21 -0800 Subject: [PATCH 2/4] just increase timeout --- tests/test_interactive_process.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_interactive_process.py b/tests/test_interactive_process.py index 5167b7b..3cbfd42 100644 --- a/tests/test_interactive_process.py +++ b/tests/test_interactive_process.py @@ -31,8 +31,7 @@ def process(self): def test_stream_nonblocking(self): self.process.send_command("echo Hello") - time.sleep(1) - output = self.process.read_nonblocking() + output = self.process.read_nonblocking(2) assert output.strip() == "Hello" # newline is part of echo command From dbce61745e2d855cb7f90af0f02539399e974551 Mon Sep 17 00:00:00 2001 From: Yason Khaburzaniya Date: Sat, 18 Jan 2025 22:41:54 -0800 Subject: [PATCH 3/4] try not loading profile or .rc file --- interactive_process/interactive_process.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interactive_process/interactive_process.py b/interactive_process/interactive_process.py index 761a1fa..a8d6253 100644 --- a/interactive_process/interactive_process.py +++ b/interactive_process/interactive_process.py @@ -15,7 +15,7 @@ def __init__(self, env={"PS1": "", "TERM": "dumb"}, echo=False): shell = 'cmd.exe' else: shell = '/bin/bash' - self.process = PtyProcessUnicode.spawn([shell], env=env, echo=echo) + self.process = PtyProcessUnicode.spawn([shell, '--noprofile', '--norc'], env=env, echo=echo) def send_command(self, command): try: From 34150ff1d22f16c9686d10bc6e3b80db2b572848 Mon Sep 17 00:00:00 2001 From: Yason Khaburzaniya Date: Sat, 18 Jan 2025 22:45:01 -0800 Subject: [PATCH 4/4] remove windows from tests matrix --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 567eeb4..59f05b4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-latest", "macos-latest", "windows-latest"] + os: ["ubuntu-latest", "macos-latest"] python-version: ["3.11", "3.12"] steps: - uses: actions/checkout@v4