quixote.inspection.check package

Module contents

quixote.inspection.check.fail(message: str, error_kind: Type = <class 'quixote.inspection._errors.KOError'>) NoReturn[source]

Fail unconditionally

Parameters
  • message – a contextual message providing information about the failure

  • error_kind – the type of exception to raise (must be of or inherit from KOError and InternalError)

quixote.inspection.check.assert_true(condition: bool, message: str, *, error_kind: Type = <class 'quixote.inspection._errors.KOError'>)[source]

Assert that a given condition is True (or raise an exception)

Parameters
  • condition – the condition expected to be True

  • message – a contextual message providing information about how / why the assertion failed

  • error_kind – the type of exception to raise if the assertion fails (must be of or inherit from KOError and InternalError)

quixote.inspection.check.assert_false(condition: bool, message: str, *, error_kind: Type = <class 'quixote.inspection._errors.KOError'>)[source]

Assert that a given condition is False (or raise an exception)

Parameters
  • condition – the condition expected to be False

  • message – a contextual message providing information about how / why the assertion failed

  • error_kind – the type of exception to raise if the assertion fails (must be of or inherit from KOError and InternalError)

quixote.inspection.check.assert_equal(a, b, message: str, *, error_kind: Type = <class 'quixote.inspection._errors.KOError'>)[source]

Assert that a == b is True (or raise an exception)

Parameters
  • a – the first object to consider

  • b – the second object to consider

  • message – a contextual message providing information about how / why the assertion failed

  • error_kind – the type of exception to raise if the assertion fails (must be of or inherit from KOError and InternalError)

quixote.inspection.check.assert_not_equal(a, b, message: str, *, error_kind: Type = <class 'quixote.inspection._errors.KOError'>)[source]

Assert that a != b is True (or raise an exception)

Parameters
  • a – the first object to consider

  • b – the second object to consider

  • message – a contextual message providing information about how / why the assertion failed

  • error_kind – the type of exception to raise if the assertion fails (must be of or inherit from KOError and InternalError)

quixote.inspection.check.assert_greater_than(a, b, message: str, *, error_kind: Type = <class 'quixote.inspection._errors.KOError'>)[source]

Assert that a > b is True (or raise an exception)

Parameters
  • a – the first object to consider

  • b – the second object to consider

  • message – a contextual message providing information about how / why the assertion failed

  • error_kind – the type of exception to raise if the assertion fails (must be of or inherit from KOError and InternalError)

quixote.inspection.check.assert_greater_or_equal(a, b, message: str, *, error_kind: Type = <class 'quixote.inspection._errors.KOError'>)[source]

Assert that a >= b is True (or raise an exception)

Parameters
  • a – the first object to consider

  • b – the second object to consider

  • message – a contextual message providing information about how / why the assertion failed

  • error_kind – the type of exception to raise if the assertion fails (must be of or inherit from KOError and InternalError)

quixote.inspection.check.assert_less_than(a, b, message: str, *, error_kind: Type = <class 'quixote.inspection._errors.KOError'>)[source]

Assert that a < b is True (or raise an exception)

Parameters
  • a – the first object to consider

  • b – the second object to consider

  • message – a contextual message providing information about how / why the assertion failed

  • error_kind – the type of exception to raise if the assertion fails (must be of or inherit from KOError and InternalError)

quixote.inspection.check.assert_less_or_equal(a, b, message: str, *, error_kind: Type = <class 'quixote.inspection._errors.KOError'>)[source]

Assert that a <= b is True (or raise an exception)

Parameters
  • a – the first object to consider

  • b – the second object to consider

  • message – a contextual message providing information about how / why the assertion failed

  • error_kind – the type of exception to raise if the assertion fails (must be of or inherit from KOError and InternalError)

quixote.inspection.check.fail_expectation(message: str)[source]

Fail an expectation unconditionally

Parameters

message – a contextual message describing the requirement and (optionally) providing feedback

quixote.inspection.check.expect_true(condition: bool, message: str) bool[source]

Expect that a given condition is True to grant a given number of points

Parameters
  • condition – if not True the requirement is considered failed

  • message – a contextual message describing the requirement and (optionally) providing feedback

quixote.inspection.check.expect_false(condition: bool, message: str) bool[source]

Expect that a given condition is False to grant a given number of points

Parameters
  • condition – if not True the requirement is considered failed

  • message – a contextual message describing the expectation and (optionally) providing feedback

quixote.inspection.check.expect_equal(a, b, message: str) bool[source]

Expect that a == b is True to grant a given number of points

Parameters
  • a – the first object to consider

  • b – the second object to consider

  • message – a contextual message describing the expectation and (optionally) providing feedback

quixote.inspection.check.expect_not_equal(a, b, message: str) bool[source]

Expect that a != b is True to grant a given number of points

Parameters
  • a – the first object to consider

  • b – the second object to consider

  • message – a contextual message describing the expectation and (optionally) providing feedback

quixote.inspection.check.expect_greater_than(a, b, message: str) bool[source]

Expect that a > b is True to grant a given number of points

Parameters
  • a – the first object to consider

  • b – the second object to consider

  • message – a contextual message describing the expectation and (optionally) providing feedback

quixote.inspection.check.expect_greater_or_equal(a, b, message: str) bool[source]

Expect that a >= b is True to grant a given number of points

Parameters
  • a – the first object to consider

  • b – the second object to consider

  • message – a contextual message describing the expectation and (optionally) providing feedback

quixote.inspection.check.expect_less_than(a, b, message: str) bool[source]

Expect that a < b is True to grant a given number of points

Parameters
  • a – the first object to consider

  • b – the second object to consider

  • message – a contextual message describing the expectation and (optionally) providing feedback

quixote.inspection.check.expect_less_or_equal(a, b, message: str) bool[source]

Expect that a <= b is True to grant a given number of points

Parameters
  • a – the first object to consider

  • b – the second object to consider

  • message – a contextual message describing the requirement and (optionally) providing feedback

quixote.inspection.check.testing(description: str, *, hidden: bool = False)[source]

Create a scope to test a given feature

Parameters
  • description – a description of the feature

  • hidden – whether or not the scope is marked as hidden

quixote.inspection.check.using(description: str, *, hidden: bool = False)[source]

Create a scope for a given test case

Parameters
  • description – a description of the test case

  • hidden – whether or not the scope is marked as hidden

quixote.inspection.check.test_case(description: str, *, hidden: bool = False)

Create a scope for a given test case

Parameters
  • description – a description of the test case

  • hidden – whether or not the scope is marked as hidden

quixote.inspection.check.inform(message: str)[source]

Add a neutral, informational message to the current scope

Parameters

message – the message to add