'Check that the reported numbers of tests are in the
(minsize, maxsize) range, or are equal to minsize if maxsize is None.'

def check_testsuite_size(self, args, minsize, maxsize=None):

    cmd = (['python', '-m', 'numba.runtests', '-l'] + list(args))
    lines = subprocess.check_output(cmd).decode().splitlines()
    lines = [line for line in lines if line.strip()]
    last_line = lines[(-1)]
    self.assertTrue(last_line.endswith('tests    found'))
    number = int(last_line.split('    ')[0])
    self.assertIn(len(lines), range((number + 1), (number + 10)))
    if (maxsize is None):
        self.assertEqual(number, minsize)
    else:
        self.assertGreaterEqual(number, minsize)
        self.assertLessEqual(number, maxsize)
    return lines
