Package csb :: Package test :: Class CustomTestBuilder

[frames] | no frames]

# Class CustomTestBuilder

source code

             object --+
                      |
    AbstractTestBuilder --+
                          |
                         CustomTestBuilder

Build a test suite of cases, marked as custom tests. CustomTestBuilder will search for functions, marked with the 'custom' test decorator, which return a dynamically built `unittest.TestSuite` object when called without parameters. This is convenient when doing data-related tests, e.g. instantiating a single type of a test case many times iteratively, for each entry in a database.

For detailed documentation see AbstractTestBuilder.

Nested Classes
Inherited from `AbstractTestBuilder`: `__metaclass__`

Instance Methods

`unittest.TestSuite`

loadFromFile(self, file) Load csb.test.Cases from a module file. | source code

`unittest.TestSuite`

loadTests(self, namespace) Load csb.test.Cases from the given CSB `namespace`. | source code

Inherited from `AbstractTestBuilder`: `loadAllTests`, `loadMultipleTests` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__init__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables
| __abstractmethods__ = ``frozenset([``])``

Properties
| labels
Inherited from `object`: `__class__`

Method Details

### loadFromFile(self, file)

source code

Load csb.test.Cases from a module file.

Parameters:
  - `file` - test module file name
Returns: `unittest.TestSuite`
  a `unittest.TestSuite` ready for the test runner
Overrides: AbstractTestBuilder.loadFromFile
  (inherited documentation)

### loadTests(self, namespace)

source code

Load csb.test.Cases from the given CSB `namespace`. If the namespace ends with a wildcard, tests from sub-packages will be loaded as well. If the namespace is '__main__' or '.', tests are loaded from __main__.

Parameters:
  - `namespace` - test module namespace, e.g. 'csb.test.cases.bio' will load tests from '/csb/test/cases/bio/__init__.py'
Returns: `unittest.TestSuite`
  a `unittest.TestSuite` ready for the test runner
Overrides: AbstractTestBuilder.loadTests
  (inherited documentation)

Property Details

### labels

Get Method:
  unreachable.labels(self)