| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Not all objects have a __dict__ attribute.
|
| | |
|
| |\ |
|
| | | |
|
| | | |
|
| |\ \
| |/ |
|
| | | |
|
| |/ |
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In unittest/unittest2 the skip/skipIf/skipUnless decorators can be used to
decorate either individual test methods or entire TestCase classes.
However, the testtools equivalents could previously only be used to
decorate test methods. If used on a TestCase the class would be replaced
with a function, resulting in the tests either not be discovered at all or
(if a custom test loader was used) potentially an error.
This change allows the skip decorators to be used on the TestCase subclass,
for equivalent functionality with unittest.
Fixes #205
Signed-off-by: Zane Bitter <zbitter@redhat.com>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
All of the python versions we support have functools.wraps(), so there is
no need to have a soft import for it any more (indeed, we use it
unconditionally elsewhere).
Also, avoid modifying the attributes of the function passed in and relying
on functools.wraps() to copy them to the function we're actually returning.
Just add the attributes to the substitute function and return it as the
user is probably expecting.
Signed-off-by: Zane Bitter <zbitter@redhat.com>
|
| | | |
|
| | | |
|
| | | |
|
| |/ |
|
| | |
|
| |
|
| |
https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior
|
| |
|
|
|
|
|
|
|
| |
This provides a way to make it easier to test with
unicode text strings. The value returned will be like
TestCase.getUniqueString but the value is six.text_type
and contains unicode.
Change-Id: I3f144e1294a801b23793f7a2520465e15f3a5222
|
| | |
|
| |
|
|
|
|
|
|
| |
* NEWS: 'during' -> 'within'
* `throw` -> `raise_`
Additionally, make `raise_` take a constructed exception, rather
than constructing it ourselves.
|
| |\ |
|
| | | |
|
| | |\ |
|
| | | | |
|
| | | |
| | |
| | |
| | | |
We get it just fine from unittest2
|
| | | | |
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The method assertRaisesRegexp was introduced in python 2.7.
This patch implements assertRaisesReagexp method to make possible
using it in python 2.6.
assertRaisesRegexp asserts that a method raises an exception
and given pattern matches on the string representation of the raised
exception.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| |/ |
|
| |
|
|
|
|
|
|
| |
``testtools.TestCase`` now inherits from unittest2.TestCase, which
provides a ``setUpClass`` for upcalls on Python 2.6.
(Robert Collins, #1393283)
Change-Id: Id56212e3d7d519c7b73d2e19d3e34013fac34544
|
| |
|
|
|
|
|
|
|
|
|
| |
Our tests currently import test_with_with into test_testcase so that
we could still run tests on python2.5. Since we no longer support
2.5, we don't need this hack. Its a hack because discovery will
import test_with_with directly itself, and thus we triggered
a duplicate test id error when attempting to use discover on the
testtools test base.
Change-Id: I027929ab4b0df350dd18ab01ffd5c493fe35e101
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
tearDown test methods.
|
| |
|
|
|
|
|
| |
TestCase.setUp and TestCase.tearDown are only meant to be called once.
Change-Id: If39046eed35257938062b07655b50d9bef0ea5ee
Closes-Bug: #882884
|
| |\
| |
| | |
Fix expected failure
|
| | | |
|
| |/
|
|
|
| |
Just like many other asserts, add an optional message to assertIn
and assertNotIn. This allows for more descriptive failures.
|
| |
|
|
| |
Change-Id: I387df10140fe76af03d2ec693b35e326b2da932e
|
| |
|
|
| |
Change-Id: Idb8c8d0c837ab2cb6ec53c84d144c29b5d6da8ea
|