@@ -54,6 +54,42 @@ def test_selector_to_pytest_with_datadrive(self):
5454 "/data/tests/tests/test_data_drive_with_backslash.py::test_backslash[\\ n]" ,
5555 )
5656
57+ def test_selector_to_pytest_with_equal_sign_in_datadrive (self ):
58+ # 回归场景:参数化数据中包含 "=" 时,不能被误判为属性筛选而退化为整个文件执行
59+ re = selector_to_pytest (
60+ "tests/test_asr_websocket.py?TestAsrWebSocket/test_sample_rate_parametrized/[0-default-sample_rate=0-False]"
61+ )
62+ self .assertEqual (
63+ re ,
64+ "tests/test_asr_websocket.py::TestAsrWebSocket::test_sample_rate_parametrized[0-default-sample_rate=0-False]" ,
65+ )
66+
67+ # 参数化数据同时包含 "=" 和中文全角括号
68+ re = selector_to_pytest (
69+ "tests/test_asr_websocket.py?TestAsrWebSocket/test_asr_context_type_parametrized/[no_context-type=no_context(无上下文)-False]"
70+ )
71+ self .assertEqual (
72+ re ,
73+ "tests/test_asr_websocket.py::TestAsrWebSocket::test_asr_context_type_parametrized[no_context-type=no_context\\ uff08\\ u65e0\\ u4e0a\\ u4e0b\\ u6587\\ uff09-False]" ,
74+ )
75+
76+ re = selector_to_pytest (
77+ "tests/test_asr_websocket.py?TestAsrWebSocket/test_voice_id_parametrized/[aaaaaaaa-voice_id=129位(超限)-True]"
78+ )
79+ self .assertEqual (
80+ re ,
81+ "tests/test_asr_websocket.py::TestAsrWebSocket::test_voice_id_parametrized[aaaaaaaa-voice_id=129\\ u4f4d\\ uff08\\ u8d85\\ u9650\\ uff09-True]" ,
82+ )
83+
84+ def test_selector_to_pytest_with_equal_sign_in_http_datadrive (self ):
85+ re = selector_to_pytest (
86+ "tests/test_asr_http.py?TestASRRecognize/test_recognize_audio_format/[summary_context-base64-pcm]"
87+ )
88+ self .assertEqual (
89+ re ,
90+ "tests/test_asr_http.py::TestASRRecognize::test_recognize_audio_format[summary_context-base64-pcm]" ,
91+ )
92+
5793 def test_selector_to_pytest_with_utf8_string (self ):
5894 re = selector_to_pytest (
5995 "/data/tests/tests/test_data_drive_zh_cn.py?aa/bb/test_include/[中文-中文汉字]"
0 commit comments