File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -75,11 +75,10 @@ def __escaped_split(inp_str, split_char):
75
75
:param split_char: Split character
76
76
:return: List of splits
77
77
"""
78
+ split_colon_fn = lambda x : re .sub (r'\\' + split_char , split_char , x )
78
79
if len (split_char ) > 1 :
79
80
raise ValueError ('Expected split character. Found string!' )
80
- out = re .sub (r'(\\.)|' + split_char ,
81
- lambda m : m .group (1 ) or '\n ' , inp_str ,
82
- len (inp_str )).split ('\n ' )
81
+ out = map (split_colon_fn , re .split (r'(?<!\\)' + split_char , inp_str ))
83
82
out = [x for x in out if x ]
84
83
return out
85
84
@@ -112,8 +111,8 @@ def __parse(self, data_f):
112
111
args = parts [1 :]
113
112
args_count = len (args )
114
113
if args_count % 2 != 0 :
115
- raise TestDataParserError ( "Number of test arguments should "
116
- "be even: %s" % line )
114
+ err_str_fmt = "Number of test arguments({}) should be even: {} "
115
+ raise TestDataParserError ( err_str_fmt . format ( args_count , line ) )
117
116
grouped_args = [(args [i * 2 ], args [(i * 2 ) + 1 ])
118
117
for i in range (len (args )/ 2 )]
119
118
self .tests .append ((name , function_name , dependencies ,
You can’t perform that action at this time.
0 commit comments