types1590%python.module
fault.test

Test framework primitives.

builtins
import

operator0
import

functools0
import

contextlib0
import

enum0
import

FailureType0
class

The type of test failure that occurred.

FailureTypenever0
data

Test was not ran or the conclusion could not be integrated.

never     = -4

FailureTypelimit0
data

Resource limit exceeded.

limit     = -3

FailureTypeinterrupt0
data

Test was interrupted by administrator.

interrupt = -2

FailureTypeexplicit0
data

Test failure was directly concluded by the function.

explicit  = -1

FailureTypenone
data

Test did not fail. The failure of passed or skipped tests.

none      =  0

FailureTypeabsurdity0
data

Test contended absurdity.

absurdity = +1

FailureTypefault0
data

Fault detected or trapped during testing. Critical process signal(SIGSEGV), language exception, or even promoted application errors.

fault     = +2

FailureTypedescriptions0
data

descriptions = (
	"The test did not fail.", # none
	"The test contended an absurdity.",
	"The test could not be completed due to an exception or critical process signal.",
	"The test function never ran or the conclusion could not be recognized.", # -4
	"The test exceeded a harness imposed resource limit.", # -3, limit
	"The test was interrupted by an administrator.", # -2, interrupt
	"The test function directly concluded failure.", # -1, explicit
)

TestConclusion0
class

The possible results of a test.

TestConclusionfailed0
data

The test did not pass. An associated Failure should be non-zero describing what happened.

failed  = -1

TestConclusionskipped
data

The test was identified as not being applicable to the execution context.

skipped =  0

TestConclusionpassed0
data

The test executed without failure.

passed  = +1

TestConclusiondescriptions0
data

descriptions = (
	"The test was skipped.",
	"The test passed.",
	"The test failed.",
)

TestConclusionnot_failure10%
method

not_failure(self)

TestControl
class

TestControl__init__0
method

__init__(self, message)

Conclude0
class

Control exception for concluding a test.

Conclude__init__0
method

__init__(self, conclusion, failure, message)

Absurdity0
class

Exception raised by Contention instances designating a failed assertion.

Absurdityoperator_names_mapping0
data

operator_names_mapping = {
	'__eq__': '==',
	'__ne__': '!=',
	'__le__': '<=',
	'__ge__': '>=',
		'__mod__': 'is',
	'__lshift__': '<<',
}

Absurdity__init__0
method

__init__(self, operator, former, latter)

Absurdity__str__0
method

__str__(self)

Absurdity__repr__10%
method

__repr__(self)

Contention0
class

Contentions are objects used by Test objects to provide assertions. Usually, contention instances are made by the true division operator of Test instances passed into unit test subjects.

import featurelib

def test_feature(test):
	expectation = ...
	test/expectation == featurelib.functionality()

True division, "/", is used as it has high operator precedance that allows assertion expresssions to be constructed using minimal syntax that lends to readable failure conditions.

All of the comparison operations are supported by Contention and are passed on to the operands being examined.

Contention__slots__0
data

__slots__ = ('_operand', '_inverse', '_storage')

Contention__init__0
method

__init__(self, object)

Contention_override0
data

_override = {
	'__mod__' : ('is', lambda x,y: x is y)
}

Contention__enter__0
method

__enter__(self)

Contention__exit__185%
method

__exit__(self, typ, val, tb)

Contention__xor__0
method

__xor__(self, operand)

Contend that the operand raises the given exception when it is called.

test/Exception ^ (lambda: callabel())

Contention__lshift__0
method

__lshift__(self, operand)

Contend that the operand is contained by the object.

test/Container << operand

Test471%
class

An object that manages an individual test and its execution. Provides interfaces for constructing and checking Contention's using a simple syntax.

Test__slots__0
data

__slots__ = (
	'function', 'identifier', 'exits',
	'metrics', 'conclusion', 'failure',
	'exception', 'traceback',
	'_invert_contention',
)

TestClock0
data

Clock = system_time_clock

TestAbsurdity0
data

Absurdity = Absurdity

TestContention0
data

Contention = Contention

Testline10%
property

Test__init__0
method

__init__(self, identifier, function, *constraints)

Test_inverse0
method

_inverse(self)

Test_absurd0
method

_absurd(self, inverse, truth)

Testinvert0
property

Invert the next contention; absurdity is coherent and coherence is absurd.

Test__truediv__0
method

__truediv__(self, operand)

Test__rtruediv__0
method

__rtruediv__(self, operand)

Testisinstance0
method

isinstance(self, *args)

Testissubclass0
method

issubclass(self, *args)

Testitertimer0
method

itertimer(count, time, scale, cycle, identity, min, range)

Measure the relative performance of a loop's iterations.

TestitertimerParameters

count

The maximum number of iterations to perform.

time

The maximum duration of the timer in seconds.

scale

The factor to increase the cycle loop count by.

cycle

The maximum number of iterations to perform within a cycle. Used to limit the effects of the scale factor.

identity

Undocumented.

min

Undocumented.

range

Undocumented.

int

Undocumented.

Testtime0
method

time(self, callable, **kw)

Measure the relative performance of the given callable.

Testskip0
method

skip(self, condition)

Explicitly conclude that the test skipped when condition is True.

Testfail0
method

fail(self)

Explicitly conclude that the test failed.

Test_timeout10%
method

_timeout(self, *args)