pytest-dev / unittest2pytest

helps rewriting Python `unittest` test-cases into `pytest` test-cases
GNU General Public License v3.0
128 stars 27 forks source link

Make assertRaises / assertWarns context managers work #5

Closed adamchainz closed 8 years ago

adamchainz commented 8 years ago

Fixes #4. Note that since the semantics of what e.g. assertRaises captures is different to what pytest.raises captures, they can't easily be converted. It's recommended users manually fix up any cases after the fact - added a note to the README to indicate this.

Also fixed the link to pytest in the README, it was pointing to PEP8.

RonnyPfannschmidt commented 8 years ago

please add a xfail mark with a reason that links to the issue

adamchainz commented 8 years ago

Actually I'm hoping to have a look later on and turn this PR into a bugfix as well 😄

RonnyPfannschmidt commented 8 years ago

that can work, i should note that if we add this to master, then anyone can take a look at fixing later

thanks for getting that started in any case

adamchainz commented 8 years ago

Just realized this is a duplicate of #2

adamchainz commented 8 years ago

Thx! Guess you might want to close #2 now