From 52a035d217a18d854985fed3f3788038799f5a02 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sun, 2 Dec 2018 00:28:25 +0100 Subject: [PATCH] flake8: Fix new warnings from flake8 2.4.0 --- mopidy/mpd/protocol/__init__.py | 4 ++-- tasks.py | 4 ++-- tests/__init__.py | 2 +- tests/mpd/protocol/test_regression.py | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mopidy/mpd/protocol/__init__.py b/mopidy/mpd/protocol/__init__.py index 99294f4d..aab8ed8d 100644 --- a/mopidy/mpd/protocol/__init__.py +++ b/mopidy/mpd/protocol/__init__.py @@ -38,7 +38,7 @@ def load_protocol_modules(): def INT(value): # noqa: N802 - """Converts a value that matches [+-]?\d+ into and integer.""" + r"""Converts a value that matches [+-]?\d+ into and integer.""" if value is None: raise ValueError('None is not a valid integer') # TODO: check for whitespace via value != value.strip()? @@ -46,7 +46,7 @@ def INT(value): # noqa: N802 def UINT(value): # noqa: N802 - """Converts a value that matches \d+ into an integer.""" + r"""Converts a value that matches \d+ into an integer.""" if value is None: raise ValueError('None is not a valid integer') if not value.isdigit(): diff --git a/tasks.py b/tasks.py index db7143a5..cc4f71b2 100644 --- a/tasks.py +++ b/tasks.py @@ -42,7 +42,7 @@ def watcher(task, *args, **kwargs): task(*args, **kwargs) try: run( - 'inotifywait -q -e create -e modify -e delete ' - '--exclude ".*\.(pyc|sw.)" -r docs/ mopidy/ tests/') + r'inotifywait -q -e create -e modify -e delete ' + r'--exclude ".*\.(pyc|sw.)" -r docs/ mopidy/ tests/') except KeyboardInterrupt: sys.exit() diff --git a/tests/__init__.py b/tests/__init__.py index 99806e97..c121a947 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -23,7 +23,7 @@ class IsA(object): try: return isinstance(rhs, self.klass) except TypeError: - return type(rhs) == type(self.klass) # flake8: noqa + return type(rhs) == type(self.klass) # noqa def __ne__(self, rhs): return not self.__eq__(rhs) diff --git a/tests/mpd/protocol/test_regression.py b/tests/mpd/protocol/test_regression.py index 40a3f103..156db777 100644 --- a/tests/mpd/protocol/test_regression.py +++ b/tests/mpd/protocol/test_regression.py @@ -161,7 +161,7 @@ class IssueGH69RegressionTest(protocol.BaseTestCase): class IssueGH113RegressionTest(protocol.BaseTestCase): - """ + r""" The issue: https://github.com/mopidy/mopidy/issues/113 How to reproduce: @@ -174,11 +174,11 @@ class IssueGH113RegressionTest(protocol.BaseTestCase): def test(self): self.core.playlists.create( - u'all lart spotify:track:\w\{22\} pastes') + r'all lart spotify:track:\w\{22\} pastes') self.send_request('lsinfo "/"') self.assertInResponse( - u'playlist: all lart spotify:track:\w\{22\} pastes') + r'playlist: all lart spotify:track:\w\{22\} pastes') self.send_request( r'listplaylistinfo "all lart spotify:track:\\w\\{22\\} pastes"')