File tree Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -113,17 +113,8 @@ def get_parser(step_name):
113
113
:return: step parser object
114
114
:rtype: StepArgumentParser
115
115
"""
116
- if isinstance (step_name , RE_TYPE ):
117
- # backwards compartibility
118
- warn = (
119
- 'pytest-bdd [{0}]: Direct usage of regex is deprecated. Please use pytest_bdd.parsers.re instead.' .format (
120
- step_name .pattern )
121
- )
122
- warnings .warn (warn )
123
- print (warn )
124
- return re (step_name .pattern , flags = step_name .flags )
125
- elif isinstance (step_name , six .string_types ):
126
- if isinstance (step_name , six .binary_type ):
116
+ if isinstance (step_name , six .string_types ):
117
+ if isinstance (step_name , six .binary_type ): # Python 2 compatibility
127
118
step_name = step_name .decode ('utf-8' )
128
119
return string (step_name )
129
120
elif not hasattr (step_name , 'is_matching' ) or not hasattr (step_name , 'parse_arguments' ):
Original file line number Diff line number Diff line change @@ -58,8 +58,7 @@ def i_should_have(euro, values):
58
58
assert euro == values .pop (0 )
59
59
60
60
61
- # test backwards compartibility
62
- @given (re .compile (r'I have an argument (?P<arg>\d+)' ))
61
+ @given (parsers .re (r'I have an argument (?P<arg>\d+)' ))
63
62
def argument (arg ):
64
63
"""I have an argument."""
65
64
return dict (arg = arg )
You can’t perform that action at this time.
0 commit comments