Skip to content

Commit 1cd4ef0

Browse files
AaronCritchleyjreback
authored andcommitted
Fixing 3.6 Escape Sequence Deprecations in tests/io/parser/usecols.py (pandas-dev#18918)
1 parent e292a6b commit 1cd4ef0

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

pandas/tests/io/parser/usecols.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -492,16 +492,18 @@ def test_raise_on_usecols_names_mismatch(self):
492492
tm.assert_frame_equal(df, expected)
493493

494494
usecols = ['a', 'b', 'c', 'f']
495-
with tm.assert_raises_regex(ValueError, msg.format(missing="\['f'\]")):
495+
with tm.assert_raises_regex(
496+
ValueError, msg.format(missing=r"\['f'\]")):
496497
self.read_csv(StringIO(data), usecols=usecols)
497498

498499
usecols = ['a', 'b', 'f']
499-
with tm.assert_raises_regex(ValueError, msg.format(missing="\['f'\]")):
500+
with tm.assert_raises_regex(
501+
ValueError, msg.format(missing=r"\['f'\]")):
500502
self.read_csv(StringIO(data), usecols=usecols)
501503

502504
usecols = ['a', 'b', 'f', 'g']
503505
with tm.assert_raises_regex(
504-
ValueError, msg.format(missing="\[('f', 'g'|'g', 'f')\]")):
506+
ValueError, msg.format(missing=r"\[('f', 'g'|'g', 'f')\]")):
505507
self.read_csv(StringIO(data), usecols=usecols)
506508

507509
names = ['A', 'B', 'C', 'D']
@@ -525,9 +527,11 @@ def test_raise_on_usecols_names_mismatch(self):
525527
# tm.assert_frame_equal(df, expected)
526528

527529
usecols = ['A', 'B', 'C', 'f']
528-
with tm.assert_raises_regex(ValueError, msg.format(missing="\['f'\]")):
530+
with tm.assert_raises_regex(
531+
ValueError, msg.format(missing=r"\['f'\]")):
529532
self.read_csv(StringIO(data), header=0, names=names,
530533
usecols=usecols)
531534
usecols = ['A', 'B', 'f']
532-
with tm.assert_raises_regex(ValueError, msg.format(missing="\['f'\]")):
535+
with tm.assert_raises_regex(
536+
ValueError, msg.format(missing=r"\['f'\]")):
533537
self.read_csv(StringIO(data), names=names, usecols=usecols)

0 commit comments

Comments
 (0)