From e6cdd315d10da43899cea593c2b927618decae04 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Fri, 13 Nov 2020 15:20:37 +0100 Subject: [PATCH] tests/generic: Check for a literal match MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I *think* this might sometimes (on CI) be eating the prompt, so that the actual `prompt` part of `expect_prompt` doesn't find anything. On Github Actions we see things like: ``` Testing file pexpects/generic.py ... Failed to match pattern: prompt 5 generic.py:35: timeout from expect_prompt("echo .history.*") [...] OUTPUT +1.08 ms (Line 31): \rprompt 4> INPUT +0.35 ms (Line 34): echo $history[1]\n OUTPUT +1.58 ms (Line 35): echo $history[1]\r\necho $history[1]\r\n⏎ \r⏎ \r\rprompt 5> ``` so the prompt *is* printed, it's just not correctly matched. --- tests/pexpects/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pexpects/generic.py b/tests/pexpects/generic.py index 28d1ce8cc..030e2e230 100644 --- a/tests/pexpects/generic.py +++ b/tests/pexpects/generic.py @@ -32,7 +32,7 @@ expect_prompt("echo stuff") # last history command should be the one that printed the history sendline("echo $history[1]") -expect_prompt("echo .history.*") +expect_prompt("echo \$history\[1\]") # Backslashes at end of comments (#1255) # This backslash should NOT cause the line to continue