MCPcopy Create free account
hub / github.com/celery/celery / test_sample

Function test_sample

t/unit/utils/test_debug.py:35–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33
34
35def test_sample():
36 x = list(range(100))
37 assert list(debug.sample(x, 10)) == [
38 0, 10, 20, 30, 40, 50, 60, 70, 80, 90,
39 ]
40 x = list(range(91))
41 assert list(debug.sample(x, 10)) == [
42 0, 9, 18, 27, 36, 45, 54, 63, 72, 81,
43 ]
44
45
46@pytest.mark.parametrize('f,precision,expected', [

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected