From 178b0c693dea0d7104e3593f99150e00446ba18b Mon Sep 17 00:00:00 2001 From: Pierrick HYMBERT Date: Sat, 2 Mar 2024 18:57:57 +0100 Subject: [PATCH] server: tests: fix regex content matching --- examples/server/tests/features/steps/steps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/server/tests/features/steps/steps.py b/examples/server/tests/features/steps/steps.py index af097fa61..ae7289f1e 100644 --- a/examples/server/tests/features/steps/steps.py +++ b/examples/server/tests/features/steps/steps.py @@ -813,7 +813,7 @@ def assert_n_tokens_predicted(completion_response, expected_predicted_n=None, re re_content = f'^(.*)({re_content})(.*)$' p = re.compile(re_content, flags=RegexFlag.IGNORECASE | RegexFlag.MULTILINE | RegexFlag.DOTALL) match = p.match(content) - assert match and len(match.groups()) == 3, f'/{re_content}/g must match ```{content}```' + assert match and len(match.groups()) >= 3, f'/{re_content}/g must match ```{content}```' if 'DEBUG' in os.environ and os.environ['DEBUG'] == 'ON': highlighted = p.sub(r"\1\2\3", content).replace('', '\x1b[33m').replace('', '\x1b[0m') print(f"Checking completion response: {highlighted}\n")