Fix improper `re` escape pattern in `ssh_agent` tests
Marco Ricci

Marco Ricci commited on 2025-01-26 16:17:09
Zeige 1 geänderte Dateien mit 4 Einfügungen und 1 Löschungen.

... ...
@@ -9,6 +9,7 @@ from __future__ import annotations
9 9
 import base64
10 10
 import contextlib
11 11
 import io
12
+import re
12 13
 import socket
13 14
 from typing import TYPE_CHECKING
14 15
 
... ...
@@ -704,7 +705,9 @@ class TestAgentInteraction:
704 705
                 _types.SSH_AGENTC.REQUEST_IDENTITIES,
705 706
                 _types.SSH_AGENT.SUCCESS,
706 707
                 ssh_agent.SSHAgentFailedError,
707
-                f'[Code {_types.SSH_AGENT.IDENTITIES_ANSWER.value}]',
708
+                re.escape(
709
+                    f'[Code {_types.SSH_AGENT.IDENTITIES_ANSWER.value}]'
710
+                ),
708 711
                 id='REQUEST_IDENTITIES-expect-SUCCESS',
709 712
             ),
710 713
         ],
711 714