From 51cc817f8e2bab01ee028fbc1a0029a3f314d576 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 4 Jul 2022 09:59:01 +0200 Subject: Merging upstream version 1.12.0. Signed-off-by: Daniel Baumann --- tests/conftest.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/conftest.py') diff --git a/tests/conftest.py b/tests/conftest.py index 4d7d643..b70bf95 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ import os +import re import tempfile from textwrap import dedent @@ -17,6 +18,22 @@ TIMEOUT = 2 HISTORY_FILE = ".iredis_history" +@pytest.fixture +def token_should_match(): + def match_func(token, tomatch): + assert re.fullmatch(token, tomatch) is not None + + return match_func + + +@pytest.fixture +def token_should_not_match(): + def match_func(token, tomatch): + assert re.fullmatch(token, tomatch) is None + + return match_func + + @pytest.fixture def judge_command(): def judge_command_func(input_text, expect): -- cgit v1.2.3