def test_fib(self): self.assertEqual(sample.fib(0),0) self.assertEqual(sample.fib(1),1) self.assertEqual(sample.fib(2),1) self.assertEqual(sample.fib(6),8)
import pyximport pyximport.install() import sample sample.fib(10)
import bitey import sample for n in range(1, 10): print sample.fact(n), sample.fib(n)
import bitey import sample for n in range(1,10): print sample.fact(n), sample.fib(n)
def test_average(): f = islice(fib(), 1, 10) assert average(f) == 15.777