-
-
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
pytest cannot deal with utf-8 encoded __repr__ of a custom object #678
Comments
Any update, @nex2hex? A PR would be much appreciated! If you have any trouble, let us know and we'll be happy to help. |
this is fixed in #878 |
@RonnyPfannschmidt is this fixed? Can we close this? |
not yet, git destroyed my updated pr, its on my agenda for today |
the merge was done before |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Originally reported by: Roman Bolshakov (BitBucket: roolebo, GitHub: roolebo)
I have a test module which does use beautiful soup to parse some test data. I added an assertion to check that a variable (I assigned result of parsing to) is an instance of unicode type. I had a bug in my code, a list with various objects got returned instead of the expected unicode string so the assertion fired. Besides, I got a totally unexpected UnicodeDecodeError in pytest.
Here's how it could be reproduced: https://gist.github.com/roolebo/ca816a26cdc0a8b17226
It turned out that beautiful soup returns utf-8 encoded string as a result of repr invocation on Tag object. The gist above could be nailed down without beautiful soup dependency:
The text was updated successfully, but these errors were encountered: