MCPcopy Create free account
hub / github.com/boostorg/histogram / test_out_of_range

Method test_out_of_range

test/python_suite_test.py:637–650  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

635 h.at(*range(50)).value
636
637 def test_out_of_range(self):
638 h = histogram(regular(3, 0, 1))
639 h(-1)
640 h(2)
641 self.assertEqual(h.at(-1).value, 1)
642 self.assertEqual(h.at(3).value, 1)
643 with self.assertRaises(IndexError):
644 h.at(-2).value
645 with self.assertRaises(IndexError):
646 h.at(4).value
647 with self.assertRaises(IndexError):
648 h.at(-2).variance
649 with self.assertRaises(IndexError):
650 h.at(4).variance
651
652 def test_operators(self):
653 h = histogram(integer(0, 2))

Callers

nothing calls this directly

Calls 3

regularClass · 0.90
atMethod · 0.80
histogramClass · 0.50

Tested by

no test coverage detected