betamaxpy / betamax

A VCR imitation designed only for python-requests.
https://betamax.readthedocs.io/en/latest/
Other
565 stars 62 forks source link

Fix exception repr() in Python 3 #141

Closed jwodder closed 6 years ago

jwodder commented 7 years ago

Exceptions in Python 3 don't have a message attribute, and so calling repr() on a BetamaxError in Python 3 fails. This patch fixes that.

jwodder commented 7 years ago

(That failing TestRecordOnce.test_replays_response_from_cassette test was like that when I got here.)

hroncok commented 6 years ago

I've managed to send https://github.com/betamaxpy/betamax/pull/144 before I realized this one exists. Sorry about that @jwodder. I think that always repr-ing with BetamaxError(...) is not that good as the default, so I'd rather just remove the repr, but I'd be happy to discuss.

jwodder commented 6 years ago

As long as the repr of a BetamaxError or subclass thereof shows the message within, I don't really care which implementation gets used. This bug has been causing issues when trying to test my click application.

hroncok commented 6 years ago

Also got problems with click app testing. Thanks for your reply. Closing this than in favor of https://github.com/betamaxpy/betamax/pull/144