MCPcopy Create free account
hub / github.com/PyVRP/PyVRP / test_randint

Function test_randint

tests/test_RandomNumberGenerator.py:33–41  ·  view source on GitHub ↗

The ``randint(high)`` function returns a random integer between ``[0, high]``. Internally, this relies on ``__call__`` (see previous test).

()

Source from the content-addressed store, hash-verified

31
32
33def test_randint():
34 """
35 The ``randint(high)`` function returns a random integer between
36 ``[0, high]``. Internally, this relies on ``__call__`` (see previous test).
37 """
38 rng = RandomNumberGenerator(seed=42)
39
40 assert_equal(rng.randint(100), 2386648076 % 100)
41 assert_equal(rng.randint(100), 1236469084 % 100)
42
43
44@mark.parametrize("seed", [2, 10, 42])

Callers

nothing calls this directly

Calls 2

randintMethod · 0.95

Tested by

no test coverage detected