Implicitly decode step definitions to unicode with utf-8

This commit is contained in:
Alessio Bogon 2019-02-19 11:48:33 +01:00 committed by Oleg Pidsadnyi
parent 3a7a5c4eb2
commit 51fa93e9e1
2 changed files with 6 additions and 0 deletions

4
pytest.ini Normal file
View File

@ -0,0 +1,4 @@
[pytest]
filterwarnings =
error
ignore::DeprecationWarning

View File

@ -123,6 +123,8 @@ def get_parser(step_name):
print(warn)
return re(step_name.pattern, flags=step_name.flags)
elif isinstance(step_name, six.string_types):
if isinstance(step_name, six.binary_type):
step_name = step_name.decode('utf-8')
return string(step_name)
elif not hasattr(step_name, 'is_matching') or not hasattr(step_name, 'parse_arguments'):
raise InvalidStepParserError(step_name)