mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Refine statistics.NormalDist documentation and improve test coverage (GH-12208)
This commit is contained in:
parent
318d537daa
commit
1f58f4fa6a
2 changed files with 26 additions and 29 deletions
|
@ -2123,6 +2123,7 @@ class TestNormalDist(unittest.TestCase):
|
|||
0.3605, 0.3589, 0.3572, 0.3555, 0.3538,
|
||||
]):
|
||||
self.assertAlmostEqual(Z.pdf(x / 100.0), px, places=4)
|
||||
self.assertAlmostEqual(Z.pdf(-x / 100.0), px, places=4)
|
||||
# Error case: variance is zero
|
||||
Y = NormalDist(100, 0)
|
||||
with self.assertRaises(statistics.StatisticsError):
|
||||
|
@ -2262,7 +2263,7 @@ class TestNormalDist(unittest.TestCase):
|
|||
self.assertEqual(X * y, NormalDist(1000, 150)) # __mul__
|
||||
self.assertEqual(y * X, NormalDist(1000, 150)) # __rmul__
|
||||
self.assertEqual(X / y, NormalDist(10, 1.5)) # __truediv__
|
||||
with self.assertRaises(TypeError):
|
||||
with self.assertRaises(TypeError): # __rtruediv__
|
||||
y / X
|
||||
|
||||
def test_equality(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue