Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import unittest
  2.  
  3. class TestStatisticalFunctions(unittest.TestCase):
  4.  
  5.     def test_durchschnitt(self):
  6.         self.assertEqual(durchschnitt([20, 30, 70]), 40.0)
  7.         self.assertEqual(round(durchschnitt([1, 5, 7]), 1), 4.3)
  8.         self.assertRaises(ZeroDivisionError, durchschnitt, [])
  9.         self.assertRaises(TypeError, durchschnitt, 20, 30, 70)
  10.  
  11. unittest.main() # Calling from the command line invokes all tests
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement