Skip to content

Commit 701d61b

Browse files
authored
TYP: clean unreachable code and duplicate test #27396 (#36935)
1 parent e9ac7af commit 701d61b

File tree

1 file changed

+25
-55
lines changed

1 file changed

+25
-55
lines changed

pandas/tests/frame/test_to_csv.py

+25-55
Original file line numberDiff line numberDiff line change
@@ -358,63 +358,33 @@ def _to_uni(x):
358358

359359
N = 100
360360
chunksize = 1000
361-
362-
for ncols in [4]:
363-
base = int((chunksize // ncols or 1) or 1)
364-
for nrows in [
365-
2,
366-
10,
367-
N - 1,
368-
N,
369-
N + 1,
370-
N + 2,
371-
2 * N - 2,
372-
2 * N - 1,
373-
2 * N,
374-
2 * N + 1,
375-
2 * N + 2,
376-
base - 1,
377-
base,
378-
base + 1,
379-
]:
380-
_do_test(
381-
tm.makeCustomDataframe(
382-
nrows, ncols, r_idx_type="dt", c_idx_type="s"
383-
),
384-
"dt",
385-
"s",
386-
)
387-
388-
for ncols in [4]:
389-
base = int((chunksize // ncols or 1) or 1)
390-
for nrows in [
391-
2,
392-
10,
393-
N - 1,
394-
N,
395-
N + 1,
396-
N + 2,
397-
2 * N - 2,
398-
2 * N - 1,
399-
2 * N,
400-
2 * N + 1,
401-
2 * N + 2,
402-
base - 1,
403-
base,
404-
base + 1,
405-
]:
406-
_do_test(
407-
tm.makeCustomDataframe(
408-
nrows, ncols, r_idx_type="dt", c_idx_type="s"
409-
),
410-
"dt",
411-
"s",
412-
)
413-
pass
361+
ncols = 4
362+
base = chunksize // ncols
363+
for nrows in [
364+
2,
365+
10,
366+
N - 1,
367+
N,
368+
N + 1,
369+
N + 2,
370+
2 * N - 2,
371+
2 * N - 1,
372+
2 * N,
373+
2 * N + 1,
374+
2 * N + 2,
375+
base - 1,
376+
base,
377+
base + 1,
378+
]:
379+
_do_test(
380+
tm.makeCustomDataframe(nrows, ncols, r_idx_type="dt", c_idx_type="s"),
381+
"dt",
382+
"s",
383+
)
414384

415385
for r_idx_type, c_idx_type in [("i", "i"), ("s", "s"), ("u", "dt"), ("p", "p")]:
416386
for ncols in [1, 2, 3, 4]:
417-
base = int((chunksize // ncols or 1) or 1)
387+
base = chunksize // ncols
418388
for nrows in [
419389
2,
420390
10,
@@ -440,7 +410,7 @@ def _to_uni(x):
440410
)
441411

442412
for ncols in [1, 2, 3, 4]:
443-
base = int((chunksize // ncols or 1) or 1)
413+
base = chunksize // ncols
444414
for nrows in [
445415
10,
446416
N - 2,

0 commit comments

Comments
 (0)