summaryrefslogtreecommitdiff
path: root/testtools/testcase.py
Commit message (Collapse)AuthorAgeFilesLines
* More RunTest related interfacesJonathan Lange2015-12-101-5/+5
|
* Sketch of interfacesJonathan Lange2015-12-101-1/+5
|
* Overhaul exception reporting.Robert Collins2015-03-101-2/+6
| | | | | | | | | | | unittest2 recently added the ability to show local variables in tracebacks as https://github.com/testing-cabal/testtools/issues/111 requested for us. Reusing that requires some refactoring of our code, in particular where we were reimplementing bits of the traceback module. Now we can just hard-depend on traceback2 and linecache2 which are brought in by unittest2 1.0.0. Change-Id: Ieb3268029d26b48ed4fcd25ed644bd339f6aa3fb
* Fix setUpClass upcalls on Python 2.6.Robert Collins2014-11-171-1/+1
| | | | | | | | ``testtools.TestCase`` now inherits from unittest2.TestCase, which provides a ``setUpClass`` for upcalls on Python 2.6. (Robert Collins, #1393283) Change-Id: Id56212e3d7d519c7b73d2e19d3e34013fac34544
* Fix skipping setUpClass with self.skipExceptionRobert Collins2014-11-161-5/+5
| | | | Change-Id: I1f314c91c4e852edafabc7cf3d2b01abe8a62fa3
* Fix masking of fixture.setUp errors.Robert Collins2014-09-121-2/+12
| | | | | | | | Exceptions in a ``fixture.getDetails`` method will no longer mask errors raised from the same fixture's ``setUp`` method. (Robert Collins, #1368440) Change-Id: I39da334ba57683fd71a5d7af16c32d9170f6e626
* Fix handling of uncatchable exceptions.Robert Collins2014-09-021-4/+21
| | | | | | | | | | | | | | | | | Fix a long-standing bug where tearDown and cleanUps would not be called if the test run was interrupted. This should fix leaking external resources from interrupted tests. (Robert Collins, #1364188) Fix a long-standing bug where calling sys.exit(0) from within a test would cause the test suite to exit with 0, without reporting a failure of that test. We still allow the test suite to be exited (since catching higher order exceptions requires exceptional circumstances) but we now call a last-resort handler on the TestCase, resulting in an error being reported for the test. (Robert Collins, #1364188) Change-Id: I0700f33fe7ed01416b37c21eb3f3fd0a7ea917eb
* Fix issue where using the skip* family of decorators still ran the setUp and ↵Thomi Richards2014-09-011-0/+6
| | | | tearDown test methods.
* Error if setUp or tearDown are called twice.Robert Collins2014-08-221-1/+14
| | | | | | | TestCase.setUp and TestCase.tearDown are only meant to be called once. Change-Id: If39046eed35257938062b07655b50d9bef0ea5ee Closes-Bug: #882884
* Merge pull request #82 from thomir/fix-expectedFailureJonathan Lange2014-05-261-0/+17
|\ | | | | Fix expected failure
| * Added failing test for python 3.4 unittest.expectedFailure decorator changes.Thomi Richards2014-03-101-0/+17
| |
* | Add optional message to assert(Not)InJoe Gordon2014-02-141-4/+4
|/ | | | | Just like many other asserts, add an optional message to assertIn and assertNotIn. This allows for more descriptive failures.
* Add expectThat method to testtools.TestCase.Thomi Richards2013-12-091-8/+35
| | | | Change-Id: I387df10140fe76af03d2ec693b35e326b2da932e
* Remove documentation suggestion that we support anything older than 2.6.Daniel Watkins2013-12-031-2/+0
|
* Don't support Python 2.4 test method naming.Daniel Watkins2013-12-031-6/+1
|
* We no longer need to handle string exceptions in TestCase.Daniel Watkins2013-12-031-3/+0
|
* Add 'force_failure' feature to testtools.TestCase.Thomi Richards2013-11-281-1/+3
| | | | Change-Id: Idb8c8d0c837ab2cb6ec53c84d144c29b5d6da8ea
* Add the 'addDetailUniqueName' method to TestCase.Thomi Richards2013-10-181-6/+22
|
* Fix TestSkipped importing with unittest2.Robert Collins2013-06-161-1/+1
| | | | | Fixes compat with 'raise TestSkipped' when running on Python2.6 with unittest2 - bug #1190951.
* Clarify docstrings for skipIf and skipUnless.Clint Byrum2013-05-071-2/+2
|
* Teach ExpectedException how to annotate errors.Robert Collins2013-04-181-2/+9
|
* DecorateTestCaseResult was missing some used attributes in its exclusion ofRobert Collins2013-04-041-2/+2
| | | | forwarded attributes.
* Add a helper for decorating the result object given toRobert Collins2013-03-071-0/+49
| | | | ``case.(__call__/run)`` - DecorateTestCaseResult.
* Add support for timestamp events to Placeholder objects.Robert Collins2013-03-071-1/+8
|
* Placeholder couldn't hold tags, which limits its use.Robert Collins2013-03-071-1/+6
|
* The error message for setUp and tearDown upcall errors was broken onRobert Collins2013-03-051-2/+4
| | | | Python 3.4. (Monty Taylor, Robert Collins, #1140688)
* Report filenames in upcall errors.Monty Taylor2013-02-071-2/+4
| | | | | | Match other errors, which report filenames due to having exceptions associated with them. Since these errors don't stem from exceptions, it's harder to directly follow where the problem came from.
* Fix epytext for *argsJonathan Lange2013-01-311-1/+1
| | | | | http://epydoc.sourceforge.net/fields.html#fields intimates that 'args' is the correct way of spelling '*args'
* Add a nosetests attr-like extension to enable more ways of filtering tests.Robert Collins2013-01-311-4/+59
|
* Delete Python 2.4 only code.Robert Collins2013-01-311-5/+0
|
* * Testtools will no longer override test code registered details calledRobert Collins2013-01-191-3/+6
| | | | | 'traceback' when reporting caught exceptions from test code. (Robert Collins, #812793)
* * Testtools now depends on extras, a small library split out from it to containRobert Collins2013-01-181-1/+2
| | | | | | | | | generally useful non-testing facilities. Since extras has been around for a couple of testtools releases now, we're making this into a hard dependency of testtools. (Robert Collins) * Testtools now uses setuptools rather than distutils so that we can document the extras dependency. (Robert Collins)
* Simplify _add_reason a little.Robert Collins2012-04-031-3/+1
|
* * ``PlaceHolder`` and ``ErrorHolder`` now support being given result details.Robert Collins2012-04-031-36/+35
| | | | | | | (Robert Collins) * ``ErrorHolder`` is now just a function - all the logic is in ``PlaceHolder``. (Robert Collins)
* Move to testcase so it doesn't appear in stack traces.Jonathan Lange2012-01-291-1/+19
|
* Extract Nullary and move it into helpers.Jonathan Lange2012-01-291-7/+3
|
* Make sure the repr of the callable passed to assertRaises is included in theJonathan Lange2012-01-281-2/+7
| | | | error message generated when assertRaises fails.
* More doc tweaksJonathan Lange2011-12-051-5/+5
|
* Merge trunk.Jonathan Lange2011-09-141-40/+42
|\
| * Review changes.Jonathan Lange2011-08-151-5/+6
| |
| * * ``MatchesException`` now permits a tuple of types rather than a single typeRobert Collins2011-08-151-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | (when using the type matching mode). (Robert Collins) And finished off migrating the API exposed assert* functions via matches. Other than assertRaises, all copacetic. assertRaises is a little fugly, which I think mainly points at the awkwardness of its preexisting interface. We may want to leave it not implemented via matches (though actually I think it is better to migrate it even with the awkwardness.
| * Port assertIsInstance to matchers.Robert Collins2011-08-141-6/+6
| |
| * assertNotIn using assertThat.Robert Collins2011-08-141-3/+2
| |
| * Reduce spelling of assert* functions which call assertThat.Robert Collins2011-08-141-10/+10
| |
| * * assertThat accepts a message which will be used to annotate the matcher. ThisRobert Collins2011-08-141-1/+2
| | | | | | | | can be given as a third parameter or as a keyword parameter. (Robert Collins)
| * More convert-to-matchers tweaks.Robert Collins2011-08-141-10/+4
| |
| * Migrate assertIn to be matcher based.Robert Collins2011-08-141-3/+2
| |
* | assertThat docs & NEWS update for changeJonathan Lange2011-08-051-1/+1
| |
* | Add MismatchError, with tests. Change assertThat to raise MismatchErrorJonathan Lange2011-08-051-7/+2
|/ | | | rather than AssertionError. Fixes bug 804127, I hope.
* ExpectedException will now match any exception of the type by default,Jonathan Lange2011-07-271-5/+7
| | | | and can take any kind of matcher.