Beispiel #1
0
def _add_tests_from_data(cls, name, func, data):
    for i, row in enumerate(data['rows']):
        value = tuple(row[x['name']] for x in data['parameters'])
        test_name = ddt.mk_test_name(name, value, i)
        ddt.add_test(cls, test_name, test_name, func, value)
        if i >= int(os.getenv('UP9_LIMIT_DATASET', sys.maxsize)):
            logging.info("Interrupting dataset because of limit")
            break
Beispiel #2
0
def _add_tests_from_data(cls, name, func, data):
    index_len = len(str(len(data['rows'])))
    for i, row in enumerate(data['rows']):
        value = tuple(row[x['name']] for x in data['parameters'])
        index = "{0:0{1}}".format(i + 1, index_len)
        test_name = "{0}_{1}".format(name, index)
        ddt.add_test(cls, test_name, test_name, func, value)
        if i >= int(os.getenv('UP9_LIMIT_DATASET', sys.maxsize)):
            logging.info("Interrupting dataset because of limit")
            break