diff --git a/tests/pexpects/history.py b/tests/pexpects/history.py index e62b262c8..dd0be4289 100644 --- a/tests/pexpects/history.py +++ b/tests/pexpects/history.py @@ -14,9 +14,10 @@ from pexpect_helper import SpawnedProc import os -os.environ["PAGER"] = "cat" +env = os.environ.copy() +env["PAGER"] = "cat" -sp = SpawnedProc(env=os.environ.copy()) +sp = SpawnedProc(env=env) send, sendline, sleep, expect_prompt, expect_re, expect_str = ( sp.send, @@ -108,8 +109,8 @@ expect_prompt("count hello 0\r\n") # sent above that matches). sendline("history delete -p 'echo hello'") expect_re("history delete -p 'echo hello'\r\n") -expect_re("\[1\] echo hello AGAIN\r\n") -expect_re("\[2\] echo hello again\r\n\r\n") +expect_re(r"\[1\] echo hello AGAIN\r\n") +expect_re(r"\[2\] echo hello again\r\n\r\n") expect_re( "Enter nothing to cancel the delete, or\r\nEnter one or more of the entry IDs or ranges like '5..12', separated by a space.\r\nFor example '7 10..15 35 788..812'.\r\nEnter 'all' to delete all the matching entries.\r\n" )