Cheetah.Tests.xmlrunner module

XML Test Runner for PyUnit

class Cheetah.Tests.xmlrunner.XMLTestProgram(module='__main__', defaultTest=None, argv=None, testRunner=None, testLoader=<unittest.loader.TestLoader object>, exit=True, verbosity=1, failfast=None, catchbreak=None, buffer=None)

Bases: unittest.main.TestProgram

runTests()
class Cheetah.Tests.xmlrunner.XMLTestRunner(*args, **kwargs)

Bases: object

A test runner that stores results in XML format compatible with JUnit.

XMLTestRunner(stream=None) -> XML test runner

The XML file is written to the supplied stream. If stream is None, the results are stored in a file called TEST-<module>.<class>.xml in the current working directory (if not overridden with the path property), where <module> and <class> are the module and class name of the test class.

path

The path where the XML files are stored

This property is ignored when the XML file is written to a file stream.

run(test)

Run the given test case or test suite.

class Cheetah.Tests.xmlrunner.XMLTestRunnerTest(methodName='runTest')

Bases: unittest.case.TestCase

class NullStream

Bases: object

A file-like object that discards everything written to it.

write(buffer)
setUp()

Hook method for setting up the test fixture before exercising it.

test_error()

Regression test: Check whether a test run with a erroneous test matches a previous run.

test_failure()

Regression test: Check whether a test run with a failing test matches a previous run.

test_no_tests()

Regression test: Check whether a test run without any tests matches a previous run.

test_stderr_capture()

Regression test: Check whether a test run with output to stderr matches a previous run.

test_stdout_capture()

Regression test: Check whether a test run with output to stdout matches a previous run.

test_success()

Regression test: Check whether a test run with a successful test matches a previous run.

test_unittests_changing_stderr()

Check whether the XMLTestRunner recovers gracefully from unit tests that change stderr, but don’t change it back properly.

test_unittests_changing_stdout()

Check whether the XMLTestRunner recovers gracefully from unit tests that change stdout, but don’t change it back properly.

Cheetah.Tests.xmlrunner.create_error(test, time, error)

Create a _TestInfo instance for an erroneous test.

Cheetah.Tests.xmlrunner.create_failure(test, time, failure)

Create a _TestInfo instance for a failed test.

Cheetah.Tests.xmlrunner.create_success(test, time)

Create a _TestInfo instance for a successful test.

Cheetah.Tests.xmlrunner.main

alias of Cheetah.Tests.xmlrunner.XMLTestProgram