class documentation

Tests for our test decoration features.

Method assertSuitesEqual Assert that the given test suites with decorated tests are equal.
Method assertTestsEqual Assert that the given decorated tests are equal.
Method test_decorateDecoratedSuite Calling decorate on a test suite with already-decorated tests decorates all of the tests in the suite again.
Method test_decorateInPlaceMutatesOriginal Calling decorate on a test suite will mutate the original suite.
Method test_decorateNestedTestSuite Calling decorate on a test suite with nested suites will return a test suite that maintains the same structure, but with all tests decorated.
Method test_decoratePreservesSuite Tests can be in non-standard suites. decorate preserves the non-standard suites when it decorates the tests.
Method test_decorateSingleTest Calling decorate on a single test case returns the test case decorated with the provided decorator.
Method test_decorateTestSuite Calling decorate on a test suite will return a test suite with each test decorated with the provided decorator.
Method test_decorateTestSuiteReferences When decorating a test suite in-place, the number of references to the test objects in that test suite should stay the same.
Method test_usesAdaptedReporterWithCall For decorated tests, __call__ uses a result adapter that preserves the test decoration for calls to addError, startTest and the like.
Method test_usesAdaptedReporterWithRun For decorated tests, run uses a result adapter that preserves the test decoration for calls to addError, startTest and the like.
def assertSuitesEqual(self, observed, expected): (source)

Assert that the given test suites with decorated tests are equal.

def assertTestsEqual(self, observed, expected): (source)

Assert that the given decorated tests are equal.

def test_decorateDecoratedSuite(self): (source)

Calling decorate on a test suite with already-decorated tests decorates all of the tests in the suite again.

def test_decorateInPlaceMutatesOriginal(self): (source)

Calling decorate on a test suite will mutate the original suite.

def test_decorateNestedTestSuite(self): (source)

Calling decorate on a test suite with nested suites will return a test suite that maintains the same structure, but with all tests decorated.

def test_decoratePreservesSuite(self): (source)

Tests can be in non-standard suites. decorate preserves the non-standard suites when it decorates the tests.

def test_decorateSingleTest(self): (source)

Calling decorate on a single test case returns the test case decorated with the provided decorator.

def test_decorateTestSuite(self): (source)

Calling decorate on a test suite will return a test suite with each test decorated with the provided decorator.

def test_decorateTestSuiteReferences(self): (source)

When decorating a test suite in-place, the number of references to the test objects in that test suite should stay the same.

Previously, unittest.decorate recreated a test suite, so the original suite kept references to the test objects. This test is here to ensure the problem doesn't reappear again.

def test_usesAdaptedReporterWithCall(self): (source)

For decorated tests, __call__ uses a result adapter that preserves the test decoration for calls to addError, startTest and the like.

See reporter._AdaptedReporter.

def test_usesAdaptedReporterWithRun(self): (source)

For decorated tests, run uses a result adapter that preserves the test decoration for calls to addError, startTest and the like.

See reporter._AdaptedReporter.