I am new to Python and trying to do something I do often in Ruby. Namely, iterating over a set of indices, using them as argument to function and comparing its results with an a
Starting from python 3.4, you can do it like this:
def test_output(self): for i in range(1,11): with self.subTest(i=i): .... self.assertEqual(fn(i),output[i])
https://docs.python.org/3.4/library/unittest.html?highlight=subtest#distinguishing-test-iterations-using-subtests