Merge lp:~abentley/testtools/expected-exception into lp:~testtools-committers/testtools/trunk
Proposed by
Aaron Bentley
Status: | Merged |
---|---|
Merged at revision: | 170 |
Proposed branch: | lp:~abentley/testtools/expected-exception |
Merge into: | lp:~testtools-committers/testtools/trunk |
Diff against target: |
110 lines (+69/-0) 4 files modified
testtools/__init__.py (+1/-0) testtools/testcase.py (+22/-0) testtools/tests/test_testtools.py (+6/-0) testtools/tests/test_with_with.py (+40/-0) |
To merge this branch: | bzr merge lp:~abentley/testtools/expected-exception |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jonathan Lange | Pending | ||
Review via email: mp+46858@code.launchpad.net |
Description of the change
This introduces the ExpectedException context manager for nicer error handling.
The tests are split into a separate file because they use the with statement.
The exec line is used because future imports cannot be conditionally imported.
To post a comment you must log in.
This seems to reimplement the exception matching logic of
matches_exception etc from testtools.matchers. Did you consider
reusing that?