Skip to content

Running gherkin reporter on pytest-bdd unicode test raises UnicodeEncodeError #273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sliwinski-milosz opened this issue Nov 24, 2018 · 0 comments

Comments

@sliwinski-milosz
Copy link
Contributor

Running below test

pytest -k 'test_steps_in_feature_file_have_unicode' --gherkin-terminal-reporter --gherkin-terminal-reporter-expanded

Raises following error:

Feature: Юнікодні символи
    Scenario: Кроки в .feature файлі містять юнікод
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/main.py", line 96, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/main.py", line 131, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 724, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 596, in execute
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/main.py", line 152, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 724, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 595, in execute
INTERNALERROR>     return _wrapped_call(hook_impl.function(*args), self.execute)
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 253, in _wrapped_call
INTERNALERROR>     return call_outcome.get_result()
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 279, in get_result
INTERNALERROR>     _reraise(*ex)  # noqa
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 264, in __init__
INTERNALERROR>     self.result = func()
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 596, in execute
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/runner.py", line 66, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/runner.py", line 79, in runtestprotocol
INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/runner.py", line 137, in call_and_report
INTERNALERROR>     hook.pytest_runtest_logreport(report=report)
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 724, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/Users/milosz.sliwinski/.virtualenvs/pytest-bdd/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 596, in execute
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/Users/milosz.sliwinski/workspace/pytest-bdd/pytest_bdd/gherkin_terminal_reporter.py", line 108, in pytest_runtest_logreport
INTERNALERROR>     step_name), **scenario_markup)
INTERNALERROR> UnicodeEncodeError: 'ascii' codec can't encode character u'\u0443' in position 0: ordinal not in range(128)
sliwinski-milosz added a commit to sliwinski-milosz/pytest-bdd that referenced this issue Nov 24, 2018
@youtux youtux closed this as completed in fb44fc3 Dec 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant