tests._utils module

Test utilities.

tests._utils.build_base(max_base)

Builds a base.

Parameters:max_base (int) – the maximum base
tests._utils.build_nat(base, max_len)

Build a well-formed nat strategy from base.

tests._utils.build_nat_with_base(max_base, max_len)

Builds a nat and its base. :param int max_base: the maximum base :param int max_len: the maximum number of digits in the nat

Returns:a strategy from which can be drawn a pair, a nat and its base
tests._utils.build_nat_with_base_and_carry(max_base, max_len)

Build a nat with a base and also a valid carry in value. :param int max_base: the maximum base :param int max_len: the maximum number of digits in the nat

Returns:a strategy from which is drawn a triple, nat, base, carry-in
tests._utils.build_precision(min_value, max_value)

Build a precision value.

Parameters:
  • min_value (int) – the minimum allowable precision, may be negative
  • max_value (int) – the maximum allowable precision, may be negative

May return None, which means no precision specified.

tests._utils.build_radix(max_base, max_len)

Build a well-formed Radix strategy.

Parameters:
  • max_base (int) – maximum value for a numeric base
  • max_len (int) – the maximum length for the component lists
tests._utils.build_relation()

Build a sign value.

tests._utils.build_sign()

Build a sign value.

Previous topic

tests package

Next topic

tests.test_constants module

This Page