diff --git a/pandas/tests/frame/test_to_csv.py b/pandas/tests/frame/test_to_csv.py index db7347bb863a5..b085704e8b06f 100644 --- a/pandas/tests/frame/test_to_csv.py +++ b/pandas/tests/frame/test_to_csv.py @@ -358,63 +358,33 @@ def _to_uni(x): N = 100 chunksize = 1000 - - for ncols in [4]: - base = int((chunksize // ncols or 1) or 1) - for nrows in [ - 2, - 10, - N - 1, - N, - N + 1, - N + 2, - 2 * N - 2, - 2 * N - 1, - 2 * N, - 2 * N + 1, - 2 * N + 2, - base - 1, - base, - base + 1, - ]: - _do_test( - tm.makeCustomDataframe( - nrows, ncols, r_idx_type="dt", c_idx_type="s" - ), - "dt", - "s", - ) - - for ncols in [4]: - base = int((chunksize // ncols or 1) or 1) - for nrows in [ - 2, - 10, - N - 1, - N, - N + 1, - N + 2, - 2 * N - 2, - 2 * N - 1, - 2 * N, - 2 * N + 1, - 2 * N + 2, - base - 1, - base, - base + 1, - ]: - _do_test( - tm.makeCustomDataframe( - nrows, ncols, r_idx_type="dt", c_idx_type="s" - ), - "dt", - "s", - ) - pass + ncols = 4 + base = chunksize // ncols + for nrows in [ + 2, + 10, + N - 1, + N, + N + 1, + N + 2, + 2 * N - 2, + 2 * N - 1, + 2 * N, + 2 * N + 1, + 2 * N + 2, + base - 1, + base, + base + 1, + ]: + _do_test( + tm.makeCustomDataframe(nrows, ncols, r_idx_type="dt", c_idx_type="s"), + "dt", + "s", + ) for r_idx_type, c_idx_type in [("i", "i"), ("s", "s"), ("u", "dt"), ("p", "p")]: for ncols in [1, 2, 3, 4]: - base = int((chunksize // ncols or 1) or 1) + base = chunksize // ncols for nrows in [ 2, 10, @@ -440,7 +410,7 @@ def _to_uni(x): ) for ncols in [1, 2, 3, 4]: - base = int((chunksize // ncols or 1) or 1) + base = chunksize // ncols for nrows in [ 10, N - 2,