Skip to content

Commit

Permalink
STY: E721 - Do not compare types, use isinstance()
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuehlbauer committed Aug 18, 2023
1 parent c1f8cf4 commit 2670a5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/georeference/test_projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_get_crs():
"false_northing": 0.0,
}
for key, value in crs.items():
if type(value) == float:
if isinstance(value, float):
assert proj_crs_cf[key] == pytest.approx(value)
else:
assert proj_crs_cf[key] == value
Expand Down Expand Up @@ -78,7 +78,7 @@ def test_write_crs():
"false_northing": 0.0,
}
for key, value in crs.items():
if type(value) == float:
if isinstance(value, float):
assert ds.spatial_ref.attrs[key] == pytest.approx(value)
else:
assert ds.spatial_ref.attrs[key] == value
2 changes: 1 addition & 1 deletion tests/georeference/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_get_x_y_z():
"false_northing": 0.0,
}
for key, value in crs.items():
if type(value) == float:
if isinstance(value, float):
assert ds.spatial_ref.attrs[key] == pytest.approx(value)
else:
assert ds.spatial_ref.attrs[key] == value

0 comments on commit 2670a5e

Please sign in to comment.