MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_choices_infinite_total

Method test_choices_infinite_total

Lib/test/test_random.py:354–364  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

352 self.gen.choices('ABC', [3, -5, 1])
353
354 def test_choices_infinite_total(self):
355 with self.assertRaises(ValueError):
356 self.gen.choices('A', [float('inf')])
357 with self.assertRaises(ValueError):
358 self.gen.choices('AB', [0.0, float('inf')])
359 with self.assertRaises(ValueError):
360 self.gen.choices('AB', [-float('inf'), 123])
361 with self.assertRaises(ValueError):
362 self.gen.choices('AB', [0.0, float('nan')])
363 with self.assertRaises(ValueError):
364 self.gen.choices('AB', [float('-inf'), float('inf')])
365
366 def test_gauss(self):
367 # Ensure that the seed() method initializes all the hidden state. In

Callers

nothing calls this directly

Calls 2

choicesMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected