Skip to content

Commit bfe18bd

Browse files
committed
Fix invalid escape deprecation warnings
1 parent dd44845 commit bfe18bd

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/reader_test.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ def test_broken_database(self):
134134
'tests/data/test-data/'
135135
'GeoIP2-City-Test-Broken-Double-Format.mmdb', self.mode)
136136
with self.assertRaisesRegex(
137-
InvalidDatabaseError, "The MaxMind DB file's data "
138-
"section contains bad data \(unknown data "
139-
"type or corrupt data\)"):
137+
InvalidDatabaseError, r"The MaxMind DB file's data "
138+
r"section contains bad data \(unknown data "
139+
r"type or corrupt data\)"):
140140
reader.get('2001:220::')
141141
reader.close()
142142

@@ -156,8 +156,8 @@ def test_missing_database(self):
156156
def test_nondatabase(self):
157157
self.assertRaisesRegex(
158158
InvalidDatabaseError,
159-
'Error opening database file \(README.rst\). '
160-
'Is this a valid MaxMind DB file\?', open_database, 'README.rst',
159+
r'Error opening database file \(README.rst\). '
160+
r'Is this a valid MaxMind DB file\?', open_database, 'README.rst',
161161
self.mode)
162162

163163
def test_too_many_constructor_args(self):
@@ -168,18 +168,18 @@ def test_bad_constructor_mode(self):
168168
cls = self.readerClass[0]
169169
self.assertRaisesRegex(
170170
ValueError,
171-
'Unsupported open mode \(100\)',
171+
r'Unsupported open mode \(100\)',
172172
cls,
173173
'README.md',
174174
mode=100)
175175

176176
def test_no_constructor_args(self):
177177
cls = self.readerClass[0]
178178
self.assertRaisesRegex(
179-
TypeError, ' 1 required positional argument|'
180-
'\(pos 1\) not found|'
181-
'takes at least 2 arguments|'
182-
'function missing required argument \'database\' \(pos 1\)', cls)
179+
TypeError, r' 1 required positional argument|'
180+
r'\(pos 1\) not found|'
181+
r'takes at least 2 arguments|'
182+
r'function missing required argument \'database\' \(pos 1\)', cls)
183183

184184
def test_too_many_get_args(self):
185185
reader = open_database(

0 commit comments

Comments
 (0)