Skip to content

Commit c7402f6

Browse files
jbrockmendelvictor
authored and
victor
committed
remove unused cimport, parametrize test (pandas-dev#21710)
1 parent 5b2bdbf commit c7402f6

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

pandas/_libs/internals.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -435,4 +435,4 @@ def get_blkno_indexers(int64_t[:] blknos, bint group=True):
435435
res_view[i] = diff
436436
i += 1
437437

438-
yield blkno, result
438+
yield blkno, result

pandas/_libs/writers.pyx

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ cimport numpy as cnp
1616
from numpy cimport ndarray, uint8_t
1717
cnp.import_array()
1818

19-
cimport util
20-
2119

2220
ctypedef fused pandas_string:
2321
str

pandas/tests/sparse/test_libsparse.py

+5-18
Original file line numberDiff line numberDiff line change
@@ -596,22 +596,9 @@ def _check_case(xloc, xlen, yloc, ylen, eloc, elen):
596596

597597
check_cases(_check_case)
598598

599-
600-
# too cute? oh but how I abhor code duplication
601-
check_ops = ['add', 'sub', 'mul', 'truediv', 'floordiv']
602-
603-
604-
def make_optestf(op):
605-
def f(self):
606-
sparse_op = getattr(splib, 'sparse_%s_float64' % op)
607-
python_op = getattr(operator, op)
599+
@pytest.mark.parametrize('opname',
600+
['add', 'sub', 'mul', 'truediv', 'floordiv'])
601+
def test_op(self, opname):
602+
sparse_op = getattr(splib, 'sparse_%s_float64' % opname)
603+
python_op = getattr(operator, opname)
608604
self._op_tests(sparse_op, python_op)
609-
610-
f.__name__ = 'test_%s' % op
611-
return f
612-
613-
614-
for op in check_ops:
615-
g = make_optestf(op)
616-
setattr(TestSparseOperators, g.__name__, g)
617-
del g

0 commit comments

Comments
 (0)