Exemplo n.º 1
0
 def test_empty(self):
     assert avg([]) is None
Exemplo n.º 2
0
 def test_iterator(self):
     it = iter([7, 8, 9])
     assert avg(it) == 8
Exemplo n.º 3
0
 def test_float_result(self):
     assert avg([5, 6, 8]) == 19.0 / 3
Exemplo n.º 4
0
 def test_float_input(self):
     assert avg([5.5, 6.5]) == 6
Exemplo n.º 5
0
 def test_basic(self):
     assert avg([1, 2, 3]) == 2