Skip to content

Commit e660f2c

Browse files
authored
STYLE enable pylint: confusing-with-statement (#49789)
* STYLE enable pylint: confusing-with-statement * STYLE enable pylint: confusing-with-statement II
1 parent cbade64 commit e660f2c

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

pandas/tests/io/test_pickle.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,9 @@ def compress_file(self, src_path, dest_path, compression):
283283
raise ValueError(msg)
284284

285285
if compression not in ["zip", "tar"]:
286-
with open(src_path, "rb") as fh, f:
287-
f.write(fh.read())
286+
with open(src_path, "rb") as fh:
287+
with f:
288+
f.write(fh.read())
288289

289290
def test_write_explicit(self, compression, get_random_path):
290291
base = get_random_path
@@ -352,7 +353,6 @@ def test_read_explicit(self, compression, get_random_path):
352353

353354
# read compressed file
354355
df2 = pd.read_pickle(p2, compression=compression)
355-
356356
tm.assert_frame_equal(df, df2)
357357

358358
def test_read_infer(self, compression_ext, get_random_path):
@@ -372,7 +372,6 @@ def test_read_infer(self, compression_ext, get_random_path):
372372

373373
# read compressed file by inferred compression method
374374
df2 = pd.read_pickle(p2)
375-
376375
tm.assert_frame_equal(df, df2)
377376

378377

pyproject.toml

-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ disable = [
124124
"attribute-defined-outside-init",
125125
"broad-except",
126126
"comparison-with-callable",
127-
"confusing-with-statement",
128127
"dangerous-default-value",
129128
"deprecated-module",
130129
"eval-used",

0 commit comments

Comments
 (0)