Skip to content

Commit 44823b0

Browse files
committed
Fix invalid escape sequence deprecation warnings
When running tests with warnings enabled, appear as: DeprecationWarning: invalid escape sequence \d Starting with Python 3.6, invalid escape sequences are deprecated. In a future Python versions they will be a syntax error. For more details, see: https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior > A backslash-character pair that is not a valid escape sequence now > generates a DeprecationWarning. Although this will eventually become a > SyntaxError, that will not be for several Python releases.
1 parent 5f9faab commit 44823b0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/test_schemas.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ def get(self, *args, **kwargs):
313313
class TestSchemaGenerator(TestCase):
314314
def setUp(self):
315315
self.patterns = [
316-
url('^example/?$', ExampleListView.as_view()),
317-
url('^example/(?P<pk>\d+)/?$', ExampleDetailView.as_view()),
318-
url('^example/(?P<pk>\d+)/sub/?$', ExampleDetailView.as_view()),
316+
url(r'^example/?$', ExampleListView.as_view()),
317+
url(r'^example/(?P<pk>\d+)/?$', ExampleDetailView.as_view()),
318+
url(r'^example/(?P<pk>\d+)/sub/?$', ExampleDetailView.as_view()),
319319
]
320320

321321
def test_schema_for_regular_views(self):
@@ -365,9 +365,9 @@ def test_schema_for_regular_views(self):
365365
class TestSchemaGeneratorNotAtRoot(TestCase):
366366
def setUp(self):
367367
self.patterns = [
368-
url('^api/v1/example/?$', ExampleListView.as_view()),
369-
url('^api/v1/example/(?P<pk>\d+)/?$', ExampleDetailView.as_view()),
370-
url('^api/v1/example/(?P<pk>\d+)/sub/?$', ExampleDetailView.as_view()),
368+
url(r'^api/v1/example/?$', ExampleListView.as_view()),
369+
url(r'^api/v1/example/(?P<pk>\d+)/?$', ExampleDetailView.as_view()),
370+
url(r'^api/v1/example/(?P<pk>\d+)/sub/?$', ExampleDetailView.as_view()),
371371
]
372372

373373
def test_schema_for_regular_views(self):

0 commit comments

Comments
 (0)