Skip to content

Commit 55069df

Browse files
blaise-ioyoutux
authored andcommitted
Allow unicode type in given step names in Py 2
Allows the given step name to be unicode in Py2. Py 3 is not affected. It still does not allow non-ascii characters as they're not allowed in Py 2 `__name__`s.
1 parent 2a10da1 commit 55069df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytest_bdd/steps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def step_func(request):
8585

8686
step_func.step_type = GIVEN
8787
step_func.converters = converters
88-
step_func.__name__ = name
88+
step_func.__name__ = force_encode(name, 'ascii')
8989
step_func.fixture = fixture
9090
func = pytest.fixture(scope=scope)(lambda: step_func)
9191
func.__doc__ = 'Alias for the "{0}" fixture.'.format(fixture)

0 commit comments

Comments
 (0)