Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import unittest
- class TestStatisticalFunctions(unittest.TestCase):
- def test_durchschnitt(self):
- self.assertEqual(durchschnitt([20, 30, 70]), 40.0)
- self.assertEqual(round(durchschnitt([1, 5, 7]), 1), 4.3)
- self.assertRaises(ZeroDivisionError, durchschnitt, [])
- self.assertRaises(TypeError, durchschnitt, 20, 30, 70)
- unittest.main() # Calling from the command line invokes all tests
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement