-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Error importing module is not properly treated in pytest (fails with UnicodeEncodeError from pytest) #2336
Labels
status: critical
grave problem or usability issue that affects lots of users
type: bug
problem that needs to be addressed
type: regression
indicates a problem that was introduced in a release which was working previously
Comments
fabioz
changed the title
Error importing module is not properly treated in pytest
Error importing module is not properly treated in pytest (fails with UnicodeEncodeError from pytest)
Mar 29, 2017
RonnyPfannschmidt
added
type: bug
problem that needs to be addressed
status: critical
grave problem or usability issue that affects lots of users
type: regression
indicates a problem that was introduced in a release which was working previously
labels
Mar 29, 2017
@fabioz thanks for reporting this one so swiftly and detailed, this one has to be fixed before doing the 3.1 release |
Can you try with 3.0.7? |
at first glance, master is the same |
I'm on it 👍 |
nicoddemus
added a commit
to nicoddemus/pytest
that referenced
this issue
Mar 29, 2017
nicoddemus
added a commit
to nicoddemus/pytest
that referenced
this issue
Mar 29, 2017
This was referenced May 22, 2017
This was referenced Mar 6, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
status: critical
grave problem or usability issue that affects lots of users
type: bug
problem that needs to be addressed
type: regression
indicates a problem that was introduced in a release which was working previously
pytest version: 3.0.5, OS: Windows 10, python: 2.7.12
We have an intermittent issue when running pytest in that a module won't be properly loaded when imported by pytest. I still don't know the real reason for the issue (could be pytest related or not, still unsure as it's flaky on our ci)... anyways, the known problem on pytest is that pytest hides the real error by giving an UnicodeEncodeError instead of printing the original message (the error is below).
It seems that the problem is that it's mixing bytes and unicode on python 2:
formatted_tb = py._builtin._totext(exc_repr) # unicode on python 2, and the .format() call is made on a bytes array.
Exception given by pytest:
The text was updated successfully, but these errors were encountered: