# Decide to which set the test belongs. heavy = type_ in heavy_types or op in heavy_operators if heavy: testfmt = TableDataTestCase._testfmt_heavy numfmt = ' [#H%d]' else: testfmt = TableDataTestCase._testfmt_light numfmt = ' [#L%d]' for extracond in extra_conditions: # for extracond in ['']: tmethod = create_test_method(type_, op, extracond) # The test number is appended to the docstring to help # identify failing methods in non-verbose mode. tmethod.__name__ = testfmt % testn # tmethod.__doc__ += numfmt % testn tmethod.__doc__ += testfmt % testn ptmethod = common.pyTablesTest(tmethod) if sys.version_info[0] < 3: imethod = types.MethodType(ptmethod, None, TableDataTestCase) else: imethod = ptmethod setattr(TableDataTestCase, tmethod.__name__, imethod) testn += 1 # Base classes for non-indexed queries. NX_BLOCK_SIZE1 = 128 # from ``interpreter.c`` in Numexpr NX_BLOCK_SIZE2 = 8 # from ``interpreter.c`` in Numexpr class SmallNITableMixin: nrows = row_period * 2
# Decide to which set the test belongs. heavy = type_ in heavy_types or op in heavy_operators if heavy: testfmt = TableDataTestCase._testfmt_heavy numfmt = ' [#H%d]' else: testfmt = TableDataTestCase._testfmt_light numfmt = ' [#L%d]' for extracond in extra_conditions: # for extracond in ['']: tmethod = create_test_method(type_, op, extracond) # The test number is appended to the docstring to help # identify failing methods in non-verbose mode. tmethod.__name__ = testfmt % testn #tmethod.__doc__ += numfmt % testn tmethod.__doc__ += testfmt % testn ptmethod = common.pyTablesTest(tmethod) imethod = new.instancemethod(ptmethod, None, TableDataTestCase) setattr(TableDataTestCase, tmethod.__name__, imethod) testn += 1 # Base classes for non-indexed queries. NX_BLOCK_SIZE1 = 128 # from ``interpreter.c`` in Numexpr NX_BLOCK_SIZE2 = 8 # from ``interpreter.c`` in Numexpr class SmallNITableMixin: nrows = row_period * 2 assert NX_BLOCK_SIZE2 < nrows < NX_BLOCK_SIZE1 assert nrows % NX_BLOCK_SIZE2 != 0 # to have some residual rows