diff --git a/pandas/_libs/internals.pyx b/pandas/_libs/internals.pyx index b46a05a0842c3..2179999859dbb 100644 --- a/pandas/_libs/internals.pyx +++ b/pandas/_libs/internals.pyx @@ -435,4 +435,4 @@ def get_blkno_indexers(int64_t[:] blknos, bint group=True): res_view[i] = diff i += 1 - yield blkno, result \ No newline at end of file + yield blkno, result diff --git a/pandas/_libs/writers.pyx b/pandas/_libs/writers.pyx index 6f07d04b3fad3..77d8ca81258a0 100644 --- a/pandas/_libs/writers.pyx +++ b/pandas/_libs/writers.pyx @@ -16,8 +16,6 @@ cimport numpy as cnp from numpy cimport ndarray, uint8_t cnp.import_array() -cimport util - ctypedef fused pandas_string: str diff --git a/pandas/tests/sparse/test_libsparse.py b/pandas/tests/sparse/test_libsparse.py index 7719ea46503fd..3b90d93cee7a4 100644 --- a/pandas/tests/sparse/test_libsparse.py +++ b/pandas/tests/sparse/test_libsparse.py @@ -596,22 +596,9 @@ def _check_case(xloc, xlen, yloc, ylen, eloc, elen): check_cases(_check_case) - -# too cute? oh but how I abhor code duplication -check_ops = ['add', 'sub', 'mul', 'truediv', 'floordiv'] - - -def make_optestf(op): - def f(self): - sparse_op = getattr(splib, 'sparse_%s_float64' % op) - python_op = getattr(operator, op) + @pytest.mark.parametrize('opname', + ['add', 'sub', 'mul', 'truediv', 'floordiv']) + def test_op(self, opname): + sparse_op = getattr(splib, 'sparse_%s_float64' % opname) + python_op = getattr(operator, opname) self._op_tests(sparse_op, python_op) - - f.__name__ = 'test_%s' % op - return f - - -for op in check_ops: - g = make_optestf(op) - setattr(TestSparseOperators, g.__name__, g) - del g