Skip to content

Commit 77490ee

Browse files
committed
MNT: fix pre-commit
1 parent 596001e commit 77490ee

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
lines changed

pandas/tests/io/formats/test_to_latex.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ def test_to_latex_to_file_utf8_with_encoding(self):
4141
df = DataFrame([["au\xdfgangen"]])
4242
with tm.ensure_clean("test.tex") as path:
4343
df.to_latex(path, encoding="utf-8")
44-
with open(path, "r", encoding="utf-8") as f:
44+
with open(path, encoding="utf-8") as f:
4545
assert df.to_latex() == f.read()
4646

4747
def test_to_latex_to_file_utf8_without_encoding(self):
4848
# test with utf-8 without encoding option
4949
df = DataFrame([["au\xdfgangen"]])
5050
with tm.ensure_clean("test.tex") as path:
5151
df.to_latex(path)
52-
with open(path, "r", encoding="utf-8") as f:
52+
with open(path, encoding="utf-8") as f:
5353
assert df.to_latex() == f.read()
5454

5555
def test_to_latex_tabular_with_index(self):

pandas/tests/io/parser/test_quoting.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
MSG1 = "a(n)? 1-character string"
3333
MSG2 = "string( or None)?"
3434

35+
3536
@pytest.mark.parametrize(
3637
"kwargs,msg",
3738
[

pandas/tests/io/test_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ def test_codecs_encoding(encoding, format):
525525
with tm.ensure_clean() as path:
526526
with open(path, mode="w", encoding=encoding) as handle:
527527
getattr(expected, f"to_{format}")(handle)
528-
with open(path, mode="r", encoding=encoding) as handle:
528+
with open(path, encoding=encoding) as handle:
529529
if format == "csv":
530530
df = pd.read_csv(handle, index_col=0)
531531
else:

pandas/tests/reshape/merge/test_merge.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2424,11 +2424,16 @@ def test_merge_suffix_raises(suffixes):
24242424

24252425
TWO_GOT_THREE = "2, got 3" if PY314 else "2"
24262426

2427+
24272428
@pytest.mark.parametrize(
24282429
"col1, col2, suffixes, msg",
24292430
[
2430-
("a", "a", ("a", "b", "c"), (
2431-
fr"too many values to unpack \(expected {TWO_GOT_THREE}\)")),
2431+
(
2432+
"a",
2433+
"a",
2434+
("a", "b", "c"),
2435+
(rf"too many values to unpack \(expected {TWO_GOT_THREE}\)"),
2436+
),
24322437
("a", "a", tuple("a"), r"not enough values to unpack \(expected 2, got 1\)"),
24332438
],
24342439
)

pandas/tests/tools/test_to_datetime.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@
6262

6363
if PY314:
6464
NOT_99 = ", not 99"
65-
DAY_IS_OUT_OF_RANGE = (r"day \d{1,2} must be in range 1\.\.\d{1,2} for "
66-
r"month \d{1,2} in year \d{4}")
65+
DAY_IS_OUT_OF_RANGE = (
66+
r"day \d{1,2} must be in range 1\.\.\d{1,2} for "
67+
r"month \d{1,2} in year \d{4}"
68+
)
6769
else:
6870
NOT_99 = ""
6971
DAY_IS_OUT_OF_RANGE = "day is out of range for month"
@@ -1383,7 +1385,7 @@ def test_datetime_invalid_scalar(self, value, format):
13831385
r'^Given date string "a" not likely a datetime$',
13841386
r'^unconverted data remains when parsing with format "%H:%M:%S": "9". '
13851387
f"{PARSING_ERR_MSG}$",
1386-
fr"^second must be in 0..59{NOT_99}: 00:01:99$",
1388+
rf"^second must be in 0..59{NOT_99}: 00:01:99$",
13871389
]
13881390
)
13891391
with pytest.raises(ValueError, match=msg):
@@ -1435,7 +1437,7 @@ def test_datetime_invalid_index(self, values, format):
14351437
f"{PARSING_ERR_MSG}$",
14361438
r'^unconverted data remains when parsing with format "%H:%M:%S": "9". '
14371439
f"{PARSING_ERR_MSG}$",
1438-
fr"^second must be in 0..59{NOT_99}: 00:01:99$",
1440+
rf"^second must be in 0..59{NOT_99}: 00:01:99$",
14391441
]
14401442
)
14411443
with pytest.raises(ValueError, match=msg):

0 commit comments

Comments
 (0)