You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In two words: I have failed test (expected), but instead of description of AssertError (I am expecting it), I got Internal PyTest error (unexpected 💥 )
I have one enough complex test, and the last assert instruction compares a string variable with a unicode constant. I have created tiny test, which have the same behavior:
classTestUnicode(object):
deftest_x(self):
x=u'текст'# it is russian textassertx==u'ПРОСТО РУССКИЙ ТЕКСТ'
This test should tell me, that x have unexpected value, but here is what I got:
myproject/translators/unicode_test.py ...
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "./libs/_pytest/main.py", line 96, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "./libs/_pytest/main.py", line 131, in _main
INTERNALERROR> config.hook.pytest_runtestloop(session=session)
INTERNALERROR> File "./libs/_pytest/vendored_packages/pluggy.py", line 724, in __call__
INTERNALERROR>return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR> File "./libs/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR>return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "./libs/_pytest/vendored_packages/pluggy.py", line 333, in<lambda>
INTERNALERROR> _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR> File "./libs/_pytest/vendored_packages/pluggy.py", line 595, in execute
INTERNALERROR>return _wrapped_call(hook_impl.function(*args), self.execute)
INTERNALERROR> File "./libs/_pytest/vendored_packages/pluggy.py", line 249, in _wrapped_call
INTERNALERROR> wrap_controller.send(call_outcome)
INTERNALERROR> File "./libs/_pytest/vendored_packages/pluggy.py", line 279, in get_result
INTERNALERROR> _reraise(*ex) # noqa
INTERNALERROR> File "./libs/_pytest/vendored_packages/pluggy.py", line 264, in __init__
INTERNALERROR> self.result = func()
INTERNALERROR> File "./libs/_pytest/vendored_packages/pluggy.py", line 596, in execute
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "./libs/_pytest/main.py", line 152, in pytest_runtestloop
INTERNALERROR> item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR> File "./libs/_pytest/vendored_packages/pluggy.py", line 724, in __call__
INTERNALERROR>return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR> File "./libs/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR>return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "./libs/_pytest/vendored_packages/pluggy.py", line 333, in<lambda>
INTERNALERROR> _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR> File "./libs/_pytest/vendored_packages/pluggy.py", line 595, in execute
INTERNALERROR>return _wrapped_call(hook_impl.function(*args), self.execute)
INTERNALERROR> File "./libs/_pytest/vendored_packages/pluggy.py", line 253, in _wrapped_call
INTERNALERROR>returncall_outcome.get_result()
INTERNALERROR> File "./libs/_pytest/vendored_packages/pluggy.py", line 279, in get_result
INTERNALERROR> _reraise(*ex) # noqa
INTERNALERROR> File "./libs/_pytest/vendored_packages/pluggy.py", line 264, in __init__
INTERNALERROR> self.result = func()
INTERNALERROR> File "./libs/_pytest/vendored_packages/pluggy.py", line 596, in execute
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "./libs/_pytest/runner.py", line 66, in pytest_runtest_protocol
INTERNALERROR> runtestprotocol(item, nextitem=nextitem)
INTERNALERROR> File "./libs/_pytest/runner.py", line 79, in runtestprotocol
INTERNALERROR> reports.append(call_and_report(item, "call", log))
INTERNALERROR> File "./libs/_pytest/runner.py", line 133, in call_and_report
INTERNALERROR> call = call_runtest_hook(item, when, **kwds)
INTERNALERROR> File "./libs/_pytest/runner.py", line 151, in call_runtest_hook
INTERNALERROR>return CallInfo(lambda: ihook(item=item, **kwds), when=when)
INTERNALERROR> File "./libs/_pytest/runner.py", line 168, in __init__
INTERNALERROR> self.excinfo = ExceptionInfo()
INTERNALERROR> File "./libs/_pytest/_code/code.py", line 357, in __init__
INTERNALERROR> exprinfo = str(tup[1])
INTERNALERROR> UnicodeEncodeError: 'ascii' codec can't encode characters in position 8-12: ordinal not in range(128)
My environment
I don't have any specific libs in the environment, just one thing: all libs are installed to the ./libs folder, and it is added to the PYTHONPATH. I think, this have no meaning for this bug..
pytest
user@host ~/myproject $ PYTHONPATH=libs pytest --version
This is pytest version 3.0.1, imported from ~/myproject/libs/pytest.pyc
setuptools registered plugins:
pytest-cov-2.3.1 at ~/myproject/libs/pytest_cov/plugin.py
os
linux mint 17, 3.19.0-32-generic
Include a detailed description of the bug or suggestion
pip list of the virtual environment you are using
pytest and operating system versions
Minimal example if possible
fix bug 🍰
The text was updated successfully, but these errors were encountered:
maxkoryukov
changed the title
Tests, failed on comparing unicoded values, cause to internal errors (instead of Assertions)
Tests, failed on comparing unicoded values, cause an internal error (instead of Assertion)
Sep 1, 2016
Quick tip: to serach for internal errors with a traceback like this, I usually remove the is:open filter and search for a relevant line of code that appears in the traceback, like this. 😉
Hello!
In two words: I have failed test (expected), but instead of description of AssertError (I am expecting it), I got
Internal PyTest error
(unexpected 💥 )I have one enough complex test, and the last
assert
instruction compares a string variable with a unicode constant. I have created tiny test, which have the same behavior:This test should tell me, that
x
have unexpected value, but here is what I got:My environment
I don't have any specific libs in the environment, just one thing: all libs are installed to the
./libs
folder, and it is added to thePYTHONPATH
. I think, this have no meaning for this bug..pytest
os
linux mint 17, 3.19.0-32-generic
pip list
of the virtual environment you are usingThe text was updated successfully, but these errors were encountered: