Skip to content

Commit 51fa93e

Browse files
youtuxolegpidsadnyi
authored andcommitted
Implicitly decode step definitions to unicode with utf-8
1 parent 3a7a5c4 commit 51fa93e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pytest.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[pytest]
2+
filterwarnings =
3+
error
4+
ignore::DeprecationWarning

pytest_bdd/parsers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ def get_parser(step_name):
123123
print(warn)
124124
return re(step_name.pattern, flags=step_name.flags)
125125
elif isinstance(step_name, six.string_types):
126+
if isinstance(step_name, six.binary_type):
127+
step_name = step_name.decode('utf-8')
126128
return string(step_name)
127129
elif not hasattr(step_name, 'is_matching') or not hasattr(step_name, 'parse_arguments'):
128130
raise InvalidStepParserError(step_name)

0 commit comments

Comments
 (0)