Skip to content

Commit

Permalink
Fix flake8 lint for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xylar committed Dec 21, 2024
1 parent b21faad commit a669340
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
15 changes: 7 additions & 8 deletions geometric_features/test/test_aggregation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import pytest

from geometric_features import GeometricFeatures
from geometric_features.aggregation import (antarctic, arctic_ocean,
arctic_seaice, arctic_transport,
Expand All @@ -8,18 +6,19 @@
ismip6_greenland, moc,
nasa_greenland, qgreenland_seaice,
subbasins, transport)
from geometric_features.test import TestCase, loaddatadir
from geometric_features.test import TestCase


@pytest.mark.usefixtures('loaddatadir')
class TestAggregation(TestCase):

def test_get_aggregator_by_name(self):
gf = GeometricFeatures()
names = ['Antarctic Regions', 'Arctic Ocean Regions', 'ISMIP6 Greenland Regions',
'NASA Greenland Regions', 'Arctic Sea Ice Regions', 'Ocean Basins',
'Ice Shelves', 'Ocean Subbasins', 'ISMIP6 Regions', 'MOC Basins', 'Historical Sea Ice',
'Transport Transects', 'Arctic Transport Transects']
names = ['Antarctic Regions', 'Arctic Ocean Regions',
'ISMIP6 Greenland Regions', 'NASA Greenland Regions',
'Arctic Sea Ice Regions', 'Ocean Basins', 'Ice Shelves',
'Ocean Subbasins', 'ISMIP6 Regions', 'MOC Basins',
'Historical Sea Ice', 'Transport Transects',
'Arctic Transport Transects']

for name in names:
function, prefix, date = get_aggregator_by_name(name)
Expand Down
4 changes: 2 additions & 2 deletions geometric_features/test/test_feature_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from geometric_features import (FeatureCollection, GeometricFeatures,
read_feature_collection)
from geometric_features.test import TestCase, loaddatadir
from geometric_features.test import TestCase, loaddatadir # noqa: F401


@pytest.mark.usefixtures('loaddatadir')
Expand Down Expand Up @@ -393,7 +393,7 @@ def test_plot(self):

projection = 'cyl'

fig = fc.plot(projection, maxLength=4.0, figsize=(12,12),
fig = fc.plot(projection, maxLength=4.0, figsize=(12, 12),
colors=colors, dpi=200)

dest_filename = str(self.datadir.join('plot.png'))
Expand Down
9 changes: 3 additions & 6 deletions geometric_features/test/test_features_and_tags.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import difflib
import os

import pytest

from geometric_features.test import TestCase, loaddatadir
from geometric_features.test import TestCase
from geometric_features.utils import write_feature_names_and_tags


@pytest.mark.usefixtures('loaddatadir')
class TestFeaturesAndTags(TestCase):

def test_features_and_tags(self):
Expand Down Expand Up @@ -36,5 +33,5 @@ def test_features_and_tags(self):

if count != 0:
raise ValueError(
'Unexpected differences in geometric_features/features_and_tags.json '
'compared with the results of geometric_features.utils.write_feature_names_and_tags()')
'Unexpected differences in geometric_features/features_and_tags.json ' # noqa: E501
'compared with the results of geometric_features.utils.write_feature_names_and_tags()') # noqa: E501
4 changes: 2 additions & 2 deletions geometric_features/test/test_geometric_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest

from geometric_features import GeometricFeatures
from geometric_features.test import TestCase, loaddatadir
from geometric_features.test import TestCase, loaddatadir # noqa: F401


@pytest.mark.usefixtures('loaddatadir')
Expand Down Expand Up @@ -138,5 +138,5 @@ def test_split(self, component='ocean', object_type='region',
for feature in fc.features:
name = feature['properties']['name']
subdir = name.replace(' ', '_')
path = f'{self.datadir}/{component}/{object_type}/{subdir}/{object_type}.geojson'
path = f'{self.datadir}/{component}/{object_type}/{subdir}/{object_type}.geojson' # noqa: E501
assert os.path.exists(path)

0 comments on commit a669340

Please sign in to comment.