Repository: geopy/geopy
Pull request #297 (2018-05-15 08:27:35)

Introduce Flake8, remove pylint
pylint hasn't been actually used in the test pipeline. I find it too noisy compared with flake8, so as a matter of preference, I introduced flake8, which is now present in Travis test pipeline.

This might cause a bunch of merge conflicts for PRs. I hate to scare off the PR authors, but I expect this to be the last large changeset for now, so I hope things like that won't happen in the near future again.


Patch:
diff --git a/.pylintrc b/.pylintrc
deleted file mode 100644
index 3aa403e..0000000
--- a/.pylintrc
+++ /dev/null
@@ -1,11 +0,0 @@
-[MASTER]
-
-[MESSAGES CONTROL]
-disable=C0103,R0401,W0142,I0011,I0012,R0801
-
-[REPORTS]
-output-format=colorized
-
-[FORMAT]
-indent-string='    '
-max-line-length=79
diff --git a/.travis.yml b/.travis.yml
index 81a333b..416bd2a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,3 +16,4 @@ install:
 script:
     - coverage run -m py.test
     - coverage report
+    - flake8
diff --git a/Makefile b/Makefile
index 495d6bb..8e667d7 100644
--- a/Makefile
+++ b/Makefile
@@ -11,10 +11,7 @@ develop:
 	python setup.py develop && python setup.py test
 
 lint:
-	pylint --rcfile=.pylintrc --reports=n geopy
-
-pylint:
-	pylint --rcfile .pylintrc geopy
+	flake8
 
 test:
 	coverage run -m py.test
diff --git a/geopy/__init__.py b/geopy/__init__.py
index 1d30d68..533fbaa 100644
--- a/geopy/__init__.py
+++ b/geopy/__init__.py
@@ -9,9 +9,9 @@ geopy is tested against CPython (versions 2.7, 3.4, 3.5, 3.6), PyPy, and
 PyPy3. geopy does not and will not support CPython 2.6.
 """
 
-from geopy.location import Location
-from geopy.point import Point
-from geopy.util import __version__
+from geopy.location import Location  # noqa
+from geopy.point import Point  # noqa
+from geopy.util import __version__  # noqa
 
 from geopy.geocoders import *  # noqa
 # geopy.geocoders.options must not be importable as `geopy.options`,
diff --git a/geopy/compat.py b/geopy/compat.py
index 36f33fd..6f7594f 100644
--- a/geopy/compat.py
+++ b/geopy/compat.py
@@ -8,34 +8,34 @@ import warnings
 
 py3k = sys.version_info >= (3, 0)
 
-if py3k: # pragma: no cover
+if py3k:  # pragma: no cover
     string_compare = str
-else: # pragma: no cover
-    string_compare = (str, unicode)
+else:  # pragma: no cover
+    string_compare = (str, unicode)  # noqa
 
 if py3k:  # pragma: no cover
     text_type = str
 else:  # pragma: no cover
-    text_type = unicode
+    text_type = unicode  # noqa
 
 # Unicode compatibility, borrowed from 'six'
-if py3k: # pragma: no cover
+if py3k:  # pragma: no cover
     def u(s):
         """
         Convert to Unicode with py3k
         """
         return s
-else: # pragma: no cover
+else:  # pragma: no cover
     def u(s):
         """
         Convert to Unicode with unicode escaping
         """
-        return unicode(s.replace(r'\\', r'\\\\'), 'unicode_escape')
+        return unicode(s.replace(r'\\', r'\\\\'), 'unicode_escape')  # noqa
 
-if py3k:
+if py3k:  # pragma: no cover
     def cmp(a, b):
         return (a > b) - (a < b)
-else:
+else:  # pragma: no cover
     cmp = cmp  # builtin in py2
 
 
@@ -48,15 +48,12 @@ else:
         return not isinf(x) and not isnan(x)
 
 
-if py3k: # pragma: no cover
-    from urllib.parse import (urlencode, quote, # pylint: disable=W0611,F0401,W0611,E0611
-                              urlparse, parse_qs)
-    from urllib.request import (Request, urlopen, # pylint: disable=W0611,F0401,W0611,E0611
-                                build_opener, ProxyHandler, HTTPSHandler,
-                                URLError,
-                                HTTPPasswordMgrWithDefaultRealm,
-                                HTTPBasicAuthHandler)
-    from urllib.error import HTTPError # pylint: disable=W0611,F0401,W0611,E0611
+if py3k:  # pragma: no cover
+    from urllib.error import HTTPError
+    from urllib.parse import parse_qs, quote, urlencode, urlparse
+    from urllib.request import (HTTPBasicAuthHandler, HTTPPasswordMgrWithDefaultRealm,
+                                HTTPSHandler, ProxyHandler, Request, URLError,
+                                build_opener, urlopen)
 
     def itervalues(d):
         """
@@ -65,6 +62,7 @@ if py3k: # pragma: no cover
         For Python2
         """
         return iter(d.values())
+
     def iteritems(d):
         """
         Function for iterating on items due to methods
@@ -73,20 +71,19 @@ if py3k: # pragma: no cover
         """
         return iter(d.items())
 
-else: # pragma: no cover
-    from urllib import urlencode as original_urlencode, quote # pylint: disable=W0611,F0401,W0611,E0611
-    from urllib2 import (Request, HTTPError,   # pylint: disable=W0611,F0401,W0611,E0611
-                         ProxyHandler, HTTPSHandler, URLError, urlopen,
-                         build_opener,
-                         HTTPPasswordMgrWithDefaultRealm,
-                         HTTPBasicAuthHandler)
-    from urlparse import urlparse, parse_qs
+else:  # pragma: no cover
+    from urllib import quote  # noqa
+    from urllib import urlencode as original_urlencode
+    from urllib2 import (HTTPBasicAuthHandler, HTTPError,  # noqa
+                         HTTPPasswordMgrWithDefaultRealm, HTTPSHandler, ProxyHandler,
+                         Request, URLError, build_opener, urlopen)
+    from urlparse import parse_qs, urlparse  # noqa
 
     def force_str(str_or_unicode):
         """
         Python2-only, ensures that a string is encoding to a str.
         """
-        if isinstance(str_or_unicode, unicode):
+        if isinstance(str_or_unicode, unicode):  # noqa
             return str_or_unicode.encode('utf-8')
         else:
             return str_or_unicode
@@ -115,6 +112,7 @@ else: # pragma: no cover
         For Python3
         """
         return d.itervalues()
+
     def iteritems(d):
         """
         Function for iterating on items due to methods
diff --git a/geopy/distance.py b/geopy/distance.py
index afe6dbd..175bdda 100644
--- a/geopy/distance.py
+++ b/geopy/distance.py
@@ -89,12 +89,14 @@ calculate the length of a path::
 from __future__ import division
 
 import warnings
-from math import atan, tan, sin, cos, pi, sqrt, atan2, asin
-from geopy.units import radians
+from math import asin, atan, atan2, cos, pi, sin, sqrt, tan
+
+from geographiclib.geodesic import Geodesic
+
 from geopy import units, util
+from geopy.compat import cmp, py3k, string_compare
 from geopy.point import Point
-from geopy.compat import string_compare, py3k, cmp
-from geographiclib.geodesic import Geodesic
+from geopy.units import radians
 
 # IUGG mean earth radius in kilometers, from
 # https://en.wikipedia.org/wiki/Earth_radius#Mean_radius.  Using a
@@ -203,10 +205,10 @@ class Distance(object):
         """
         raise NotImplementedError()
 
-    def __repr__(self): # pragma: no cover
+    def __repr__(self):  # pragma: no cover
         return 'Distance(%s)' % self.kilometers
 
-    def __str__(self): # pragma: no cover
+    def __str__(self):  # pragma: no cover
         return '%s km' % self.__kilometers
 
     def __cmp__(self, other):  # py2 only
@@ -235,45 +237,46 @@ class Distance(object):
             return self.__cmp__(other) <= 0
 
     @property
-    def kilometers(self): # pylint: disable=C0111
+    def kilometers(self):
         return self.__kilometers
 
     @property
-    def km(self): # pylint: disable=C0111
+    def km(self):
         return self.kilometers
 
     @property
-    def meters(self): # pylint: disable=C0111
+    def meters(self):
         return units.meters(kilometers=self.kilometers)
 
     @property
-    def m(self): # pylint: disable=C0111
+    def m(self):
         return self.meters
 
     @property
-    def miles(self): # pylint: disable=C0111
+    def miles(self):
         return units.miles(kilometers=self.kilometers)
 
     @property
-    def mi(self): # pylint: disable=C0111
+    def mi(self):
         return self.miles
 
     @property
-    def feet(self): # pylint: disable=C0111
+    def feet(self):
         return units.feet(kilometers=self.kilometers)
 
     @property
-    def ft(self): # pylint: disable=C0111
+    def ft(self):
         return self.feet
 
     @property
-    def nautical(self): # pylint: disable=C0111
+    def nautical(self):
         return units.nautical(kilometers=self.kilometers)
 
     @property
-    def nm(self): # pylint: disable=C0111
+    def nm(self):
         return self.nautical
 
+
 class great_circle(Distance):
     """
     Use spherical geometry to calculate the surface distance between two
@@ -316,7 +319,7 @@ class great_circle(Distance):
 
         return self.RADIUS * d
 
-    def destination(self, point, bearing, distance=None): # pylint: disable=W0621
+    def destination(self, point, bearing, distance=None):
         """
         TODO docs.
         """
@@ -344,8 +347,10 @@ class great_circle(Distance):
 
         return Point(units.degrees(radians=lat2), units.degrees(radians=lng2))
 
+
 GreatCircleDistance = great_circle
 
+
 class geodesic(Distance):
     """
     Calculate the geodesic distance between two points.
@@ -380,7 +385,7 @@ class geodesic(Distance):
             warnings.warn('Ignoring unused `iterations` kwarg for geodesic '
                           'distance.', UserWarning)
         kwargs.pop('iterations', 0)
-        major, minor, f = self.ELLIPSOID # pylint: disable=W0612
+        major, minor, f = self.ELLIPSOID
         super(geodesic, self).__init__(*args, **kwargs)
 
     def set_ellipsoid(self, ellipsoid):
@@ -411,12 +416,12 @@ class geodesic(Distance):
                 self.geod.f == self.ELLIPSOID[2]):
             self.geod = Geodesic(self.ELLIPSOID[0], self.ELLIPSOID[2])
 
-        s12 =  self.geod.Inverse(lat1, lon1, lat2, lon2,
-                                 Geodesic.DISTANCE)['s12']
+        s12 = self.geod.Inverse(lat1, lon1, lat2, lon2,
+                                Geodesic.DISTANCE)['s12']
 
         return s12
 
-    def destination(self, point, bearing, distance=None): # pylint: disable=W0621
+    def destination(self, point, bearing, distance=None):
         """
         TODO docs.
         """
@@ -440,8 +445,10 @@ class geodesic(Distance):
 
         return Point(r['lat2'], r['lon2'])
 
+
 GeodesicDistance = geodesic
 
+
 class vincenty(Distance):
     """
     .. deprecated:: 1.13
@@ -485,7 +492,7 @@ class vincenty(Distance):
                           DeprecationWarning)
         self.set_ellipsoid(kwargs.pop('ellipsoid', 'WGS-84'))
         self.iterations = kwargs.pop('iterations', 20)
-        major, minor, f = self.ELLIPSOID # pylint: disable=W0612
+        major, minor, f = self.ELLIPSOID
         super(vincenty, self).__init__(*args, **kwargs)
 
     def set_ellipsoid(self, ellipsoid):
@@ -543,7 +550,7 @@ class vincenty(Distance):
             )
 
             if sin_sigma == 0:
-                return 0 # Coincident points
+                return 0  # Coincident points
 
             cos_sigma = (
                 sin_reduced1 * sin_reduced2 +
@@ -562,7 +569,7 @@ class vincenty(Distance):
                     sin_reduced1 * sin_reduced2 / cos_sq_alpha
                 )
             else:
-                cos2_sigma_m = 0.0 # Equatorial line
+                cos2_sigma_m = 0.0  # Equatorial line
 
             C = f / 16. * cos_sq_alpha * (4 + f * (4 - 3 * cos_sq_alpha))
 
@@ -605,7 +612,7 @@ class vincenty(Distance):
         s = minor * A * (sigma - delta_sigma)
         return s
 
-    def destination(self, point, bearing, distance=None): # pylint: disable=W0621
+    def destination(self, point, bearing, distance=None):
         """
         TODO docs.
         """
@@ -692,6 +699,7 @@ class vincenty(Distance):
 
         return Point(units.degrees(radians=lat2), units.degrees(radians=lng2))
 
+
 VincentyDistance = vincenty
 
 # Set the default distance formula
diff --git a/geopy/format.py b/geopy/format.py
index 63b1e94..97b7a51 100644
--- a/geopy/format.py
+++ b/geopy/format.py
@@ -6,7 +6,7 @@ from geopy import units
 from geopy.compat import py3k
 
 if py3k:
-    unichr = chr # pylint: disable=W0622
+    unichr = chr
 
 # Unicode characters for symbols that appear in coordinate strings.
 DEGREE = unichr(176)
@@ -64,6 +64,7 @@ ABBR_SYMBOLS = {
     'arcsec': ABBR_ARCSEC
 }
 
+
 def format_degrees(degrees, fmt=DEGREES_FORMAT, symbols=None):
     """
     TODO docs.
@@ -79,6 +80,7 @@ def format_degrees(degrees, fmt=DEGREES_FORMAT, symbols=None):
     )
     return fmt % format_dict
 
+
 DISTANCE_FORMAT = "%(magnitude)s%(unit)s"
 DISTANCE_UNITS = {
     'km': lambda d: d,
@@ -89,6 +91,7 @@ DISTANCE_UNITS = {
     'nmi': lambda d: units.nautical(kilometers=d)
 }
 
+
 def format_distance(kilometers, fmt=DISTANCE_FORMAT, unit='km'):
     """
     TODO docs.
@@ -96,6 +99,7 @@ def format_distance(kilometers, fmt=DISTANCE_FORMAT, unit='km'):
     magnitude = DISTANCE_UNITS[unit](kilometers)
     return fmt % {'magnitude': magnitude, 'unit': unit}
 
+
 _DIRECTIONS = [
     ('north', 'N'),
     ('north by east', 'NbE'),
diff --git a/geopy/geocoders/__init__.py b/geopy/geocoders/__init__.py
index 2faf20e..5a3f9a9 100644
--- a/geopy/geocoders/__init__.py
+++ b/geopy/geocoders/__init__.py
@@ -68,7 +68,8 @@ need to geocode locations in `Cleveland, Ohio`, you could do::
     >>> geolocator = GoogleV3(format_string="%s, Cleveland OH")
     >>> address, (latitude, longitude) = geolocator.geocode("11111 Euclid Ave")
     >>> print(address, latitude, longitude)
-    Thwing Center, 11111 Euclid Ave, Cleveland, OH 44106, USA 41.5074066 -81.60832649999999
+    Thwing Center, 11111 Euclid Ave, Cleveland, OH 44106, USA \
+41.5074066 -81.60832649999999
 
 """
 
diff --git a/geopy/geocoders/arcgis.py b/geopy/geocoders/arcgis.py
index 5be02b8..ba4876e 100644
--- a/geopy/geocoders/arcgis.py
+++ b/geopy/geocoders/arcgis.py
@@ -21,7 +21,7 @@ __all__ = ("ArcGIS", )
 DEFAULT_WKID = 4326
 
 
-class ArcGIS(Geocoder):  # pylint: disable=R0921,R0902,W0223
+class ArcGIS(Geocoder):
     """Geocoder using the ERSI ArcGIS API.
 
     Documentation at:
diff --git a/geopy/geocoders/base.py b/geopy/geocoders/base.py
index a0e4b52..c4502f5 100644
--- a/geopy/geocoders/base.py
+++ b/geopy/geocoders/base.py
@@ -31,7 +31,6 @@ from geopy.exc import (
 )
 from geopy.util import decode_page, __version__
 
-
 __all__ = (
     "Geocoder",
     "options",
@@ -205,10 +204,10 @@ class Geocoder(object):
         if isinstance(point, Point):
             return ",".join((str(point.latitude), str(point.longitude)))
         elif isinstance(point, (list, tuple)):
-            return ",".join((str(point[0]), str(point[1]))) # -altitude
+            return ",".join((str(point[0]), str(point[1])))  # -altitude
         elif isinstance(point, string_compare):
             return point
-        else: # pragma: no cover
+        else:
             raise ValueError("Invalid point")
 
     def _geocoder_exception_handler(self, error, message):
@@ -270,7 +269,7 @@ class Geocoder(object):
 
         try:
             page = requester(req, timeout=timeout, **kwargs)
-        except Exception as error: # pylint: disable=W0703
+        except Exception as error:
             message = (
                 str(error) if not py3k
                 else (
diff --git a/geopy/geocoders/bing.py b/geopy/geocoders/bing.py
index 7c45b36..da0f6a0 100644
--- a/geopy/geocoders/bing.py
+++ b/geopy/geocoders/bing.py
@@ -215,7 +215,7 @@ class Bing(Geocoder):
         )
 
     @staticmethod
-    def _parse_json(doc, exactly_one=True):  # pylint: disable=W0221
+    def _parse_json(doc, exactly_one=True):
         """
         Parse a location name, latitude, and longitude from an JSON response.
         """
diff --git a/geopy/geocoders/geonames.py b/geopy/geocoders/geonames.py
index 3205854..f4d3f2f 100644
--- a/geopy/geocoders/geonames.py
+++ b/geopy/geocoders/geonames.py
@@ -16,7 +16,7 @@ from geopy.util import logger
 __all__ = ("GeoNames", )
 
 
-class GeoNames(Geocoder): # pylint: disable=W0223
+class GeoNames(Geocoder):
     """GeoNames geocoder.
 
     Documentation at:
diff --git a/geopy/geocoders/googlev3.py b/geopy/geocoders/googlev3.py
index f43f854..73ed416 100644
--- a/geopy/geocoders/googlev3.py
+++ b/geopy/geocoders/googlev3.py
@@ -31,7 +31,7 @@ except ImportError:
 __all__ = ("GoogleV3", )
 
 
-class GoogleV3(Geocoder):  # pylint: disable=R0902
+class GoogleV3(Geocoder):
     """Geocoder using the Google Maps v3 API.
 
     Documentation at:
@@ -154,9 +154,7 @@ class GoogleV3(Geocoder):  # pylint: disable=R0902
         Format the components dict to something Google understands.
         """
         return "|".join(
-            (":".join(item)
-             for item in components.items()
-            )
+            (":".join(item) for item in components.items())
         )
 
     @staticmethod
diff --git a/geopy/geocoders/ignfrance.py b/geopy/geocoders/ignfrance.py
index 1ab4a91..4525d6d 100644
--- a/geopy/geocoders/ignfrance.py
+++ b/geopy/geocoders/ignfrance.py
@@ -14,7 +14,7 @@ from geopy.util import logger
 __all__ = ("IGNFrance", )
 
 
-class IGNFrance(Geocoder):   # pylint: disable=W0223
+class IGNFrance(Geocoder):
     """Geocoder using the IGN France GeoCoder OpenLS API.
 
     Documentation at:
@@ -109,8 +109,7 @@ class IGNFrance(Geocoder):   # pylint: disable=W0223
 
         # Catch if no api key with username and password
         # or no api key with referer
-        if not (api_key and username and password) \
-            and not (api_key and referer):
+        if not ((api_key and username and password) or (api_key and referer)):
             raise ConfigurationError('You should provide an api key and a '
                                      'username with a password or an api '
                                      'key with a referer depending on '
diff --git a/geopy/geocoders/openmapquest.py b/geopy/geocoders/openmapquest.py
index d9d2681..8bcc64a 100644
--- a/geopy/geocoders/openmapquest.py
+++ b/geopy/geocoders/openmapquest.py
@@ -11,7 +11,7 @@ from geopy.util import logger
 __all__ = ("OpenMapQuest", )
 
 
-class OpenMapQuest(Geocoder): # pylint: disable=W0223
+class OpenMapQuest(Geocoder):
     """Geocoder using MapQuest Open Platform Web Services.
 
     Documentation at:
@@ -70,8 +70,8 @@ class OpenMapQuest(Geocoder): # pylint: disable=W0223
         if not api_key:
             raise ConfigurationError('OpenMapQuest requires an API key')
         self.api_key = api_key
-        self.api = "%s://open.mapquestapi.com/nominatim/v1/search" \
-                    "?format=json" % self.scheme
+        self.api = ("%s://open.mapquestapi.com/nominatim/v1/search"
+                    "?format=json" % self.scheme)
 
     def geocode(self, query, exactly_one=True, timeout=DEFAULT_SENTINEL):
         """
diff --git a/geopy/geocoders/photon.py b/geopy/geocoders/photon.py
index 121bc37..f8d6777 100644
--- a/geopy/geocoders/photon.py
+++ b/geopy/geocoders/photon.py
@@ -10,7 +10,7 @@ from geopy.util import logger
 __all__ = ("Photon", )
 
 
-class Photon(Geocoder):  # pylint: disable=W0223
+class Photon(Geocoder):
     """Geocoder using Photon geocoding service (data based on OpenStreetMap
     and service provided by Komoot on https://photon.komoot.de).
 
diff --git a/geopy/geocoders/pickpoint.py b/geopy/geocoders/pickpoint.py
index 168d540..8c5dbb8 100644
--- a/geopy/geocoders/pickpoint.py
+++ b/geopy/geocoders/pickpoint.py
@@ -2,7 +2,6 @@
 PickPoint geocoder
 """
 
-from geopy.compat import urlencode
 from geopy.geocoders import Nominatim
 from geopy.geocoders.base import DEFAULT_SENTINEL
 
diff --git a/geopy/geocoders/smartystreets.py b/geopy/geocoders/smartystreets.py
index 2b1941a..a84cec3 100644
--- a/geopy/geocoders/smartystreets.py
+++ b/geopy/geocoders/smartystreets.py
@@ -11,7 +11,7 @@ from geopy.util import logger
 __all__ = ("LiveAddress", )
 
 
-class LiveAddress(Geocoder):  # pylint: disable=W0223
+class LiveAddress(Geocoder):
     """Geocoder using the LiveAddress API provided by SmartyStreets.
 
     Documentation at:
diff --git a/geopy/geocoders/yandex.py b/geopy/geocoders/yandex.py
index 2e39383..6b707fb 100644
--- a/geopy/geocoders/yandex.py
+++ b/geopy/geocoders/yandex.py
@@ -12,7 +12,7 @@ from geopy.util import logger
 __all__ = ("Yandex", )
 
 
-class Yandex(Geocoder): # pylint: disable=W0223
+class Yandex(Geocoder):
     """Yandex geocoder.
 
     Documentation at:
diff --git a/geopy/location.py b/geopy/location.py
index 41600ba..d176376 100644
--- a/geopy/location.py
+++ b/geopy/location.py
@@ -10,7 +10,7 @@ def _location_tuple(location):
     return location._address, (location._point[0], location._point[1])
 
 
-class Location(object): # pylint: disable=R0903,R0921
+class Location(object):
     """
     Contains a parsed geocoder response. Can be iterated over as
     ``(location<String>, (latitude<float>, longitude<Float))``.
@@ -132,14 +132,13 @@ class Location(object): # pylint: disable=R0903,R0921
     def __eq__(self, other):
         return (
             isinstance(other, Location) and
-            self._address == other._address and  # pylint: disable=W0212
-            self._point == other._point and  # pylint: disable=W0212
+            self._address == other._address and
+            self._point == other._point and
             self.raw == other.raw
         )
 
     def __ne__(self, other):
         return not (self == other)
 
-    def __len__(self):  # pragma: no cover
+    def __len__(self):
         return len(self._tuple)
-
diff --git a/geopy/point.py b/geopy/point.py
index 2c2d127..1c74812 100644
--- a/geopy/point.py
+++ b/geopy/point.py
@@ -6,8 +6,9 @@
 import collections
 import re
 import warnings
-from math import fmod
 from itertools import islice
+from math import fmod
+
 from geopy import util, units
 from geopy.format import (
     DEGREE,
@@ -18,7 +19,6 @@ from geopy.format import (
 )
 from geopy.compat import string_compare, isfinite
 
-
 POINT_PATTERN = re.compile(r"""
     .*?
     (?P<latitude>
@@ -163,7 +163,7 @@ class Point(object):
             else:
                 try:
                     seq = iter(arg)
-                except TypeError: # pragma: no cover
+                except TypeError:
                     raise TypeError(
                         "Failed to create Point instance from %r." % (arg,)
                     )
@@ -314,7 +314,7 @@ class Point(object):
             }
             try:
                 return CONVERTERS[unit](distance)
-            except KeyError: # pragma: no cover
+            except KeyError:
                 raise NotImplementedError(
                     'Bad distance unit specified, valid are: %r' %
                     CONVERTERS.keys()
diff --git a/geopy/units.py b/geopy/units.py
index 9517777..ae5b42b 100644
--- a/geopy/units.py
+++ b/geopy/units.py
@@ -4,10 +4,10 @@ Convert units.
 
 import math
 
-
 # Angles
 
-def degrees(radians=0, arcminutes=0, arcseconds=0): # pylint: disable=W0621
+
+def degrees(radians=0, arcminutes=0, arcseconds=0):
     """
     TODO docs.
     """
@@ -20,7 +20,8 @@ def degrees(radians=0, arcminutes=0, arcseconds=0): # pylint: disable=W0621
         deg += arcseconds / arcsec(degrees=1.)
     return deg
 
-def radians(degrees=0, arcminutes=0, arcseconds=0): # pylint: disable=W0621
+
+def radians(degrees=0, arcminutes=0, arcseconds=0):
     """
     TODO docs.
     """
@@ -30,7 +31,8 @@ def radians(degrees=0, arcminutes=0, arcseconds=0): # pylint: disable=W0621
         degrees += arcseconds / arcsec(degrees=1.)
     return math.radians(degrees)
 
-def arcminutes(degrees=0, radians=0, arcseconds=0): # pylint: disable=W0621
+
+def arcminutes(degrees=0, radians=0, arcseconds=0):
     """
     TODO docs.
     """
@@ -40,7 +42,8 @@ def arcminutes(degrees=0, radians=0, arcseconds=0): # pylint: disable=W0621
         degrees += arcseconds / arcsec(degrees=1.)
     return degrees * 60.
 
-def arcseconds(degrees=0, radians=0, arcminutes=0): # pylint: disable=W0621
+
+def arcseconds(degrees=0, radians=0, arcminutes=0):
     """
     TODO docs.
     """
@@ -53,7 +56,7 @@ def arcseconds(degrees=0, radians=0, arcminutes=0): # pylint: disable=W0621
 
 # Lengths
 
-def kilometers(meters=0, miles=0, feet=0, nautical=0): # pylint: disable=W0621
+def kilometers(meters=0, miles=0, feet=0, nautical=0):
     """
     TODO docs.
     """
@@ -67,13 +70,15 @@ def kilometers(meters=0, miles=0, feet=0, nautical=0): # pylint: disable=W0621
     ret += miles * 1.609344
     return ret
 
-def meters(kilometers=0, miles=0, feet=0, nautical=0): # pylint: disable=W0621
+
+def meters(kilometers=0, miles=0, feet=0, nautical=0):
     """
     TODO docs.
     """
     return (kilometers + km(nautical=nautical, miles=miles, feet=feet)) * 1000
 
-def miles(kilometers=0, meters=0, feet=0, nautical=0): # pylint: disable=W0621
+
+def miles(kilometers=0, meters=0, feet=0, nautical=0):
     """
     TODO docs.
     """
@@ -87,7 +92,8 @@ def miles(kilometers=0, meters=0, feet=0, nautical=0): # pylint: disable=W0621
     ret += kilometers / 1.609344
     return ret
 
-def feet(kilometers=0, meters=0, miles=0, nautical=0): # pylint: disable=W0621
+
+def feet(kilometers=0, meters=0, miles=0, nautical=0):
     """
     TODO docs.
     """
@@ -101,7 +107,8 @@ def feet(kilometers=0, meters=0, miles=0, nautical=0): # pylint: disable=W0621
     ret += miles * 5280
     return ret
 
-def nautical(kilometers=0, meters=0, miles=0, feet=0): # pylint: disable=W0621
+
+def nautical(kilometers=0, meters=0, miles=0, feet=0):
     """
     TODO docs.
     """
@@ -118,11 +125,11 @@ def nautical(kilometers=0, meters=0, miles=0, feet=0): # pylint: disable=W0621
 
 # Compatible names
 
-rad = radians # pylint: disable=C0103
-arcmin = arcminutes # pylint: disable=C0103
-arcsec = arcseconds # pylint: disable=C0103
-km = kilometers # pylint: disable=C0103
-m = meters # pylint: disable=C0103
-mi = miles # pylint: disable=C0103
-ft = feet # pylint: disable=C0103
-nm = nautical # pylint: disable=C0103
+rad = radians
+arcmin = arcminutes
+arcsec = arcseconds
+km = kilometers
+m = meters
+mi = miles
+ft = feet
+nm = nautical
diff --git a/geopy/util.py b/geopy/util.py
index e296afb..fe36b65 100644
--- a/geopy/util.py
+++ b/geopy/util.py
@@ -3,22 +3,23 @@ Utils.
 """
 
 import logging
+
 from geopy.compat import py3k, text_type
 
-if not py3k: # pragma: no cover
-    NUMBER_TYPES = (int, long, float)
-else: # pragma: no cover
-    NUMBER_TYPES = (int, float) # long -> int in Py3k
+if not py3k:  # pragma: no cover
+    NUMBER_TYPES = (int, long, float)  # noqa
+else:  # pragma: no cover
+    NUMBER_TYPES = (int, float)  # long -> int in Py3k
 try:
     from decimal import Decimal
     NUMBER_TYPES = NUMBER_TYPES + (Decimal, )
-except ImportError: # pragma: no cover
+except ImportError:  # pragma: no cover
     pass
 
 
 __version__ = "1.14.0"
 
-logger = logging.getLogger('geopy') # pylint: disable=C0103
+logger = logging.getLogger('geopy')
 
 
 def pairwise(seq):
@@ -43,18 +44,16 @@ def decode_page(page):
     Nearly all services use JSON, so assume UTF8 encoding unless the
     response specifies otherwise.
     """
-    if hasattr(page, 'read'): # urllib
+    if hasattr(page, 'read'):  # urllib
         if py3k:
             encoding = page.headers.get_param("charset") or "utf-8"
         else:
             encoding = page.headers.getparam("charset") or "utf-8"
         return text_type(page.read(), encoding=encoding)
-    else: # requests?
+    else:  # requests?
         encoding = page.headers.get("charset") or "utf-8"
         return text_type(page.content, encoding=encoding)
 
 
 def get_version():
     return __version__
-
-
diff --git a/setup.cfg b/setup.cfg
index 5e40900..920cb24 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,2 +1,15 @@
 [wheel]
 universal = 1
+
+[flake8]
+max-complexity = 22
+max-line-length = 90
+exclude =
+    .git,
+    .tox,
+    __pycache__,
+    build,
+    dist,
+    docs,
+    geopy.egg-info
+
diff --git a/setup.py b/setup.py
index 0ceac51..483e5f6 100755
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,8 @@
 geopy
 """
 
-from setuptools import setup, find_packages
+from setuptools import find_packages, setup
+
 from geopy import __version__ as version
 
 INSTALL_REQUIRES = [
@@ -27,8 +28,9 @@ setup(
     extras_require={
         "dev": [
             "coverage",
-            "pytest>=3",
+            "flake8>=3.5.0,<3.6.0",
             "mock",
+            "pytest>=3",
             "sphinx",
         ],
         "timezone": ["pytz"],
diff --git a/tox.ini b/tox.ini
index e94c490..b2eaadc 100644
--- a/tox.ini
+++ b/tox.ini
@@ -9,5 +9,7 @@ extras =
 commands = pytest
 
 [testenv:lint]
-deps = pylint
-commands = pylint --rcfile=.pylintrc --reports=n geopy
+basepython = python3
+extras =
+    dev
+commands = flake8


Test patch:
diff --git a/test/geocoders/arcgis.py b/test/geocoders/arcgis.py
index 9be3a6d..108e9c1 100644
--- a/test/geocoders/arcgis.py
+++ b/test/geocoders/arcgis.py
@@ -7,6 +7,7 @@ from geopy.point import Point
 from geopy.geocoders import ArcGIS
 from test.geocoders.util import GeocoderTestBase, env
 
+
 class ArcGISTestCaseUnitTest(GeocoderTestBase):
 
     def test_user_agent_custom(self):
@@ -127,10 +128,10 @@ class ArcGISTestCase(GeocoderTestBase):
             self.assertEqual(1, len(w))
 
 
-@unittest.skipUnless(  # pylint: disable=R0904,C0111
-    env.get('ARCGIS_USERNAME') is not None \
-    or env.get('ARCGIS_PASSWORD') is not None\
-    or env.get('ARCGIS_REFERER') is not None,
+@unittest.skipUnless(
+    (env.get('ARCGIS_USERNAME') is not None
+     or env.get('ARCGIS_PASSWORD') is not None
+     or env.get('ARCGIS_REFERER') is not None),
     "No ARCGIS_USERNAME or ARCGIS_PASSWORD or ARCGIS_REFERER env variable set"
 )
 class ArcGISAuthenticatedTestCase(GeocoderTestBase):
diff --git a/test/geocoders/baidu.py b/test/geocoders/baidu.py
index 3ec39ce..f6c554c 100644
--- a/test/geocoders/baidu.py
+++ b/test/geocoders/baidu.py
@@ -17,7 +17,7 @@ class BaiduTestCaseUnitTest(GeocoderTestBase):
         self.assertEqual(geocoder.headers['User-Agent'], 'my_user_agent/1.0')
 
 
-@unittest.skipUnless(  # pylint: disable=R0904,C0111
+@unittest.skipUnless(
     bool(env.get('BAIDU_KEY')),
     "No BAIDU_KEY env variable set"
 )
diff --git a/test/geocoders/base.py b/test/geocoders/base.py
index 4bf0371..c894fce 100644
--- a/test/geocoders/base.py
+++ b/test/geocoders/base.py
@@ -84,7 +84,8 @@ class GeocoderTestCase(unittest.TestCase):
         self.assertIsNone(geocoder.timeout)
         self.assertIsNone(geocoder.ssl_context)
 
-    @patch.object(geopy.geocoders.options, 'default_user_agent', 'mocked_user_agent/0.0.0')
+    @patch.object(geopy.geocoders.options, 'default_user_agent',
+                  'mocked_user_agent/0.0.0')
     def test_user_agent_default(self):
         geocoder = Geocoder()
         self.assertEqual(geocoder.headers['User-Agent'],
diff --git a/test/geocoders/bing.py b/test/geocoders/bing.py
index e2268fd..330f567 100644
--- a/test/geocoders/bing.py
+++ b/test/geocoders/bing.py
@@ -17,7 +17,7 @@ class BingTestCaseUnitTest(GeocoderTestBase):
         self.assertEqual(geocoder.headers['User-Agent'], 'my_user_agent/1.0')
 
 
-@unittest.skipUnless(  # pylint: disable=R0904,C0111
+@unittest.skipUnless(
     bool(env.get('BING_KEY')),
     "No BING_KEY env variable set"
 )
@@ -124,10 +124,8 @@ class BingTestCase(GeocoderTestBase):
 
         pennsylvania_bias = (40.922351, -75.096562)
         colorado_bias = (39.914231, -105.070104)
-        for expected, bias in (
-                (pennsylvania, pennsylvania_bias),
-                (colorado, colorado_bias)
-            ):
+        for expected, bias in ((pennsylvania, pennsylvania_bias),
+                               (colorado, colorado_bias)):
             res = self._make_request(
                 self.geocoder.geocode,
                 "20 Main Street",
diff --git a/test/geocoders/databc.py b/test/geocoders/databc.py
index 88351ef..83525c5 100644
--- a/test/geocoders/databc.py
+++ b/test/geocoders/databc.py
@@ -1,11 +1,7 @@
-
-import unittest
-
 from geopy.compat import u
-from geopy.point import Point
 from geopy.exc import GeocoderQueryError
 from geopy.geocoders import DataBC
-from test.geocoders.util import GeocoderTestBase, env
+from test.geocoders.util import GeocoderTestBase
 
 
 class DataBCTestCase(GeocoderTestBase):
@@ -73,8 +69,8 @@ class DataBCTestCase(GeocoderTestBase):
         DataBC.geocode with bad query parameters
         """
         with self.assertRaises(GeocoderQueryError):
-          res = self._make_request(
-              self.geocoder.geocode,
-              "1 Main St, Vancouver",
-              location_descriptor="access_Point",
-          )
+            self._make_request(
+                self.geocoder.geocode,
+                "1 Main St, Vancouver",
+                location_descriptor="access_Point",
+            )
diff --git a/test/geocoders/geonames.py b/test/geocoders/geonames.py
index 7a0a128..7b33f35 100644
--- a/test/geocoders/geonames.py
+++ b/test/geocoders/geonames.py
@@ -16,7 +16,7 @@ class GeoNamesTestCaseUnitTest(GeocoderTestBase):
         self.assertEqual(geocoder.headers['User-Agent'], 'my_user_agent/1.0')
 
 
-@unittest.skipUnless(  # pylint: disable=R0904,C0111
+@unittest.skipUnless(
     bool(env.get('GEONAMES_USERNAME')),
     "No GEONAMES_USERNAME env variable set"
 )
diff --git a/test/geocoders/googlev3.py b/test/geocoders/googlev3.py
index f161b72..903015f 100644
--- a/test/geocoders/googlev3.py
+++ b/test/geocoders/googlev3.py
@@ -9,7 +9,7 @@ from geopy.geocoders import GoogleV3
 from test.geocoders.util import GeocoderTestBase
 
 
-class GoogleV3TestCase(GeocoderTestBase): # pylint: disable=R0904,C0111
+class GoogleV3TestCase(GeocoderTestBase):
 
     @classmethod
     def setUpClass(cls):
diff --git a/test/geocoders/ignfrance.py b/test/geocoders/ignfrance.py
index 077e199..e8c9f85 100644
--- a/test/geocoders/ignfrance.py
+++ b/test/geocoders/ignfrance.py
@@ -5,11 +5,11 @@ from geopy.exc import ConfigurationError, GeocoderQueryError
 from geopy.geocoders import IGNFrance
 from test.geocoders.util import GeocoderTestBase, env
 
-credentials = bool((env.get('IGNFRANCE_KEY') and
-          env.get('IGNFRANCE_USERNAME') and
-          env.get('IGNFRANCE_PASSWORD')) or
-         (env.get('IGNFRANCE_KEY') and
-          env.get('IGNFRANCE_REFERER')))
+credentials = bool(
+    (env.get('IGNFRANCE_KEY') and env.get('IGNFRANCE_USERNAME')
+     and env.get('IGNFRANCE_PASSWORD')) or (
+         env.get('IGNFRANCE_KEY') and env.get('IGNFRANCE_REFERER'))
+)
 
 
 class IGNFranceTestCaseUnitTest(GeocoderTestBase):
@@ -23,10 +23,11 @@ class IGNFranceTestCaseUnitTest(GeocoderTestBase):
         )
         self.assertEqual(geocoder.headers['User-Agent'], 'my_user_agent/1.0')
 
-@unittest.skipUnless(  # pylint: disable=R0904,C0111
+
+@unittest.skipUnless(
     credentials,
-    "One or more of the env variables IGNFRANCE_KEY, IGNFRANCE_USERNAME \
-    and IGNFRANCE_PASSWORD is not set"
+    "One or more of the env variables IGNFRANCE_KEY, IGNFRANCE_USERNAME "
+    "and IGNFRANCE_PASSWORD is not set"
 )
 class IGNFranceTestCase(GeocoderTestBase):
 
@@ -102,8 +103,7 @@ class IGNFranceTestCase(GeocoderTestBase):
              "exactly_one": True},
             {"latitude": 47.293048,
              "longitude": 1.718985,
-             "address": "le camp des landes, 41200 Villefranche-sur-Cher"
-            },
+             "address": "le camp des landes, 41200 Villefranche-sur-Cher"},
         )
 
     def test_geocode_freeform(self):
@@ -193,12 +193,8 @@ class IGNFranceTestCase(GeocoderTestBase):
             exactly_one=False
         )
 
-
         departements_spatial = list(
-            set([
-                i.raw['departement']
-                for i in res_spatial_filter
-            ])
+            {i.raw['departement'] for i in res_spatial_filter}
         )
 
         res_no_spatial_filter = self._make_request(
diff --git a/test/geocoders/mapzen.py b/test/geocoders/mapzen.py
index 1161341..6b19977 100644
--- a/test/geocoders/mapzen.py
+++ b/test/geocoders/mapzen.py
@@ -2,15 +2,13 @@
 from __future__ import unicode_literals
 import unittest
 
-from mock import patch
-from geopy.compat import u
 from geopy.point import Point
 from geopy.geocoders import Mapzen
 from test.geocoders.util import GeocoderTestBase
 
 
 @unittest.skip("Mapzen has shut down their API")
-class MapzenTestCase(GeocoderTestBase): # pylint: disable=R0904,C0111
+class MapzenTestCase(GeocoderTestBase):
 
     delta = 0.04
 
diff --git a/test/geocoders/nominatim.py b/test/geocoders/nominatim.py
index 5a0b6d6..14bc74a 100644
--- a/test/geocoders/nominatim.py
+++ b/test/geocoders/nominatim.py
@@ -7,7 +7,7 @@ from geopy.point import Point
 from test.geocoders.util import GeocoderTestBase
 
 
-class NominatimTestCase(GeocoderTestBase): # pylint: disable=R0904,C0111
+class NominatimTestCase(GeocoderTestBase):
 
     delta = 0.04
 
@@ -110,7 +110,7 @@ class NominatimTestCase(GeocoderTestBase): # pylint: disable=R0904,C0111
         """
         result_reverse_de = self._make_request(
             self.geocoder.reverse,
-             "52.51693903613385, 13.3859332733135",
+            "52.51693903613385, 13.3859332733135",
             exactly_one=True,
             language="de",
         )
diff --git a/test/geocoders/opencage.py b/test/geocoders/opencage.py
index 5faab7e..717a12a 100644
--- a/test/geocoders/opencage.py
+++ b/test/geocoders/opencage.py
@@ -16,7 +16,7 @@ class OpenCageTestCaseUnitTest(GeocoderTestBase):
         self.assertEqual(geocoder.headers['User-Agent'], 'my_user_agent/1.0')
 
 
-@unittest.skipUnless(  # pylint: disable=R0904,C0111
+@unittest.skipUnless(
     bool(env.get('OPENCAGE_KEY')),
     "No OPENCAGE_KEY env variables set"
 )
diff --git a/test/geocoders/openmapquest.py b/test/geocoders/openmapquest.py
index 5e770f0..65dafeb 100644
--- a/test/geocoders/openmapquest.py
+++ b/test/geocoders/openmapquest.py
@@ -5,7 +5,7 @@ from test.geocoders.util import GeocoderTestBase, env
 import unittest
 
 
-class OpenMapQuestNoNetTestCase(GeocoderTestBase):  # pylint: disable=R0904,C0111
+class OpenMapQuestNoNetTestCase(GeocoderTestBase):
 
     def test_user_agent_custom(self):
         geocoder = OpenMapQuest(
@@ -15,11 +15,11 @@ class OpenMapQuestNoNetTestCase(GeocoderTestBase):  # pylint: disable=R0904,C011
         self.assertEqual(geocoder.headers['User-Agent'], 'my_user_agent/1.0')
 
 
-@unittest.skipUnless(  # pylint: disable=R0904,C0111
+@unittest.skipUnless(
     bool(env.get('OPENMAPQUEST_APIKEY')),
     "No OPENMAPQUEST_APIKEY env variable set"
 )
-class OpenMapQuestTestCase(GeocoderTestBase):  # pylint: disable=R0904,C0111
+class OpenMapQuestTestCase(GeocoderTestBase):
 
     @classmethod
     def setUpClass(cls):
diff --git a/test/geocoders/photon.py b/test/geocoders/photon.py
index dc953bc..efe12ec 100644
--- a/test/geocoders/photon.py
+++ b/test/geocoders/photon.py
@@ -1,13 +1,12 @@
 # coding: utf8
 from __future__ import unicode_literals
 
-from geopy.compat import u
 from geopy.point import Point
 from geopy.geocoders import Photon
 from test.geocoders.util import GeocoderTestBase
 
 
-class PhotonTestCase(GeocoderTestBase):  # pylint: disable=R0904,C0111
+class PhotonTestCase(GeocoderTestBase):
 
     @classmethod
     def setUpClass(cls):
@@ -25,11 +24,11 @@ class PhotonTestCase(GeocoderTestBase):  # pylint: disable=R0904,C0111
         """
         Photon.geocode
         """
-        self.geocode_run(
+        location = self.geocode_run(
             {"query": "14 rue pelisson villeurbanne"},
-            {"address": "Rue du 14 Juillet 1789, 69003, Villeurbanne, Auvergne-Rhône-Alpes, France",
-             "latitude": 45.7733963, "longitude": 4.88612369},
+            {"latitude": 45.7733963, "longitude": 4.88612369},
         )
+        self.assertIn("France", location.address)
 
     def test_osm_tag(self):
         """
diff --git a/test/geocoders/pickpoint.py b/test/geocoders/pickpoint.py
index afd3b01..0acde50 100644
--- a/test/geocoders/pickpoint.py
+++ b/test/geocoders/pickpoint.py
@@ -6,8 +6,9 @@ from geopy.geocoders import PickPoint
 from test.geocoders.util import GeocoderTestBase, env
 
 
-@unittest.skipUnless(bool(env['PICKPOINT_KEY']),
-                     "No PICKPOINT_KEY env variable set"
+@unittest.skipUnless(
+    bool(env['PICKPOINT_KEY']),
+    "No PICKPOINT_KEY env variable set"
 )
 class PickPointTestCase(GeocoderTestBase):
 
@@ -101,7 +102,7 @@ class PickPointTestCase(GeocoderTestBase):
         """
         result_reverse_de = self._make_request(
             self.geocoder.reverse,
-             "52.51693903613385, 13.3859332733135",
+            "52.51693903613385, 13.3859332733135",
             exactly_one=True,
             language="de",
         )
diff --git a/test/geocoders/smartystreets.py b/test/geocoders/smartystreets.py
index afc7e2f..7d5ec1d 100644
--- a/test/geocoders/smartystreets.py
+++ b/test/geocoders/smartystreets.py
@@ -3,7 +3,7 @@ from mock import patch
 
 import geopy.geocoders
 from geopy.geocoders import LiveAddress
-from geopy.exc import ConfigurationError, GeocoderAuthenticationFailure
+from geopy.exc import ConfigurationError
 from test.geocoders.util import GeocoderTestBase, env
 
 
diff --git a/test/geocoders/util.py b/test/geocoders/util.py
index 81a1f89..27abf12 100644
--- a/test/geocoders/util.py
+++ b/test/geocoders/util.py
@@ -3,7 +3,6 @@ import os
 import json
 import unittest
 from collections import defaultdict
-from geopy.compat import string_compare, py3k
 
 from geopy import exc
 
@@ -38,7 +37,7 @@ except IOError:
 EMPTY = object()
 
 
-class GeocoderTestBase(unittest.TestCase): # pylint: disable=R0904
+class GeocoderTestBase(unittest.TestCase):
     """
     Base for geocoder-specific test cases.
     """
diff --git a/test/geocoders/what3words.py b/test/geocoders/what3words.py
index 28d4a95..6772ab6 100644
--- a/test/geocoders/what3words.py
+++ b/test/geocoders/what3words.py
@@ -16,8 +16,9 @@ class What3WordsTestCaseUnitTest(GeocoderTestBase):
         self.assertEqual(geocoder.headers['User-Agent'], 'my_user_agent/1.0')
 
 
-@unittest.skipUnless(bool(env.get('WHAT3WORDS_KEY')),
-                     "No WHAT3WORDS_KEY env variable set"
+@unittest.skipUnless(
+    bool(env.get('WHAT3WORDS_KEY')),
+    "No WHAT3WORDS_KEY env variable set"
 )
 class What3WordsTestCase(GeocoderTestBase):
     @classmethod
diff --git a/test/geocoders/yandex.py b/test/geocoders/yandex.py
index 5764fd3..d320586 100644
--- a/test/geocoders/yandex.py
+++ b/test/geocoders/yandex.py
@@ -29,7 +29,7 @@ class YandexTestCase(GeocoderTestBase):
             {"latitude": 48.002104, "longitude": 37.805186},
         )
 
-    @unittest.skipUnless(  # pylint: disable=R0904,C0111
+    @unittest.skipUnless(
         bool(env.get('YANDEX_KEY')),
         "No YANDEX_KEY env variable set"
     )
@@ -77,7 +77,8 @@ class YandexTestCase(GeocoderTestBase):
         )
         self.geocode_run(
             {"query": "площа Леніна Донецьк"},
-            {"address": "площа Леніна, Донецьк, Україна", "latitude": 48.002104, "longitude": 37.805186},
+            {"address": "площа Леніна, Донецьк, Україна",
+             "latitude": 48.002104, "longitude": 37.805186},
         )
 
     def test_reverse_kind_param(self):
diff --git a/test/test_distance.py b/test/test_distance.py
index 4c72c8a..7be175e 100644
--- a/test/test_distance.py
+++ b/test/test_distance.py
@@ -20,7 +20,7 @@ from geopy.distance import (Distance,
 EARTH_CIRCUMFERENCE = 2 * math.pi * EARTH_RADIUS
 NORTH_POLE = Point(90, 0)
 SOUTH_POLE = Point(-90, 0)
-FIJI = Point(-16.1333333, 180.0) # Vunikondi, Fiji
+FIJI = Point(-16.1333333, 180.0)  # Vunikondi, Fiji
 
 
 class CommonDistanceComputationCases(object):
@@ -297,6 +297,7 @@ class TestDefaultDistanceClass(unittest.TestCase):
             VincentyDistance((0, 0), (10, 10))
             self.assertEqual(1, len(w))
 
+
 class TestWhenComputingGreatCircleDistance(CommonDistanceCases,
                                            unittest.TestCase):
     cls = GreatCircleDistance
@@ -427,16 +428,16 @@ class TestWhenComputingGeodesicDistance(CommonDistanceCases,
           [-29.47124, 95.14681, -163.779130441688382,
            -27.46601, -69.15955, -15.909335945554969,
            13487015.8381145492]]
-        d = self.cls(ellipsoid = 'WGS-84')
+        d = self.cls(ellipsoid='WGS-84')
         km = 1000
         for l in testcases:
             (lat1, lon1, azi1, lat2, lon2, azi2, s12) = l
             p1, p2 = Point(lat1, lon1), Point(lat2, lon2)
             s12a = d.measure(p1, p2) * km
-            self.assertAlmostEqual(s12a, s12, delta = 1e-8)
+            self.assertAlmostEqual(s12a, s12, delta=1e-8)
             p = d.destination(p1, azi1, s12/km)
-            self.assertAlmostEqual(p.latitude, p2.latitude, delta = 1e-13)
-            self.assertAlmostEqual(p.longitude, p2.longitude, delta = 1e-12)
+            self.assertAlmostEqual(p.latitude, p2.latitude, delta=1e-13)
+            self.assertAlmostEqual(p.longitude, p2.longitude, delta=1e-12)
             p = d.destination(p2, azi2, -s12/km)
-            self.assertAlmostEqual(p.latitude, p1.latitude, delta = 1e-13)
-            self.assertAlmostEqual(p.longitude, p1.longitude, delta = 1e-12)
+            self.assertAlmostEqual(p.latitude, p1.latitude, delta=1e-13)
+            self.assertAlmostEqual(p.longitude, p1.longitude, delta=1e-12)
diff --git a/test/test_format.py b/test/test_format.py
index d97defe..a3fc9ad 100644
--- a/test/test_format.py
+++ b/test/test_format.py
@@ -1,7 +1,8 @@
 
 import unittest
-from geopy.point import Point
+
 from geopy.format import format_degrees
+from geopy.point import Point
 
 
 class TestFormat(unittest.TestCase):
diff --git a/test/test_location.py b/test/test_location.py
index 9ff013a..8edaf15 100644
--- a/test/test_location.py
+++ b/test/test_location.py
@@ -27,17 +27,18 @@ GRAND_CENTRAL_RAW = {
 }
 
 
-class LocationTestCase(unittest.TestCase): # pylint: disable=R0904
+class LocationTestCase(unittest.TestCase):
     """
     Test :class:`geopy.location.Location`.
     """
 
-    def _location_iter_test(self,
+    def _location_iter_test(
+            self,
             loc,
             ref_address=GRAND_CENTRAL_STR,
             ref_longitude=GRAND_CENTRAL_COORDS_TUPLE[0],
             ref_latitude=GRAND_CENTRAL_COORDS_TUPLE[1]
-        ):
+    ):
         """
         Helper for equality tests on Location's __iter__.
         """
@@ -186,7 +187,7 @@ class LocationTestCase(unittest.TestCase): # pylint: disable=R0904
         raw_unpicklable = dict(missing=some_class())
         del some_class
         loc_unpicklable = Location(GRAND_CENTRAL_STR, GRAND_CENTRAL_POINT,
-                                    raw_unpicklable)
+                                   raw_unpicklable)
         for protocol in (0, 1, 2, -1):
             with self.assertRaises((AttributeError, pickle.PicklingError)):
                 pickle.dumps(loc_unpicklable, protocol=protocol)
diff --git a/test/test_point.py b/test/test_point.py
index 9ae4ec5..92227ba 100644
--- a/test/test_point.py
+++ b/test/test_point.py
@@ -2,10 +2,10 @@
 Test Point.
 """
 
-import pickle
-import unittest
 import math
+import pickle
 import sys
+import unittest
 import warnings
 
 from geopy.compat import u
@@ -154,10 +154,12 @@ class PointTestCase(unittest.TestCase):
             point = Point(85, -185, 375)
             self.assertEqual((85, 175, 375), tuple(point))
 
+            # note that the zeros might be negative
             point = Point(-0.0, -0.0, 375)
-            self.assertEqual((0.0, 0.0, 375.0), tuple(point))  # note that the zeros might be negative
+            self.assertEqual((0.0, 0.0, 375.0), tuple(point))
             # ensure that negative zeros are normalized to the positive ones
             self.assertEqual((1.0, 1.0, 1.0), tuple(math.copysign(1.0, x) for x in point))
+
             point = Point(90, 180, 375)
             self.assertEqual((90, 180, 375), tuple(point))
             point = Point(-90, -180, 375)
diff --git a/test/test_proxy.py b/test/test_proxy.py
index 5756223..cb2bfc4 100644
--- a/test/test_proxy.py
+++ b/test/test_proxy.py
@@ -20,7 +20,7 @@ class DummyGeocoder(Geocoder):
         return geo_html if geo_html else None
 
 
-class ProxyTestCase(unittest.TestCase): # pylint: disable=R0904,C0111
+class ProxyTestCase(unittest.TestCase):
     remote_website_http = "http://example.org/"
     remote_website_https = "https://example.org/"
     timeout = 5