Skip to content

Commit 832b25c

Browse files
committed
Use del
1 parent 4513ced commit 832b25c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

integrations/server/test_covidcast_endpoints.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,11 @@ def test_compatibility(self):
118118
with self.subTest("same contents sans excluded columns"):
119119
compat = self._fetch("/", signal=first.signal_pair(), geo=first.geo_pair(), time="day:*", is_compatibility=True)
120120
regular = self._fetch("/", signal=first.signal_pair(), geo=first.geo_pair(), time="day:*")
121-
regular_sans_excluded = [{k: v for k, v in row.items() if k not in ["source", "geo_type", "time_type"]} for row in regular["epidata"]]
122-
self.assertEqual(compat["epidata"], regular_sans_excluded)
121+
# Remove keys from the regular row which are excluded in the compat rows
122+
for row in regular['epidata']:
123+
for key in ['source', 'geo_type', 'time_type']:
124+
del row[key]
125+
self.assertEqual(compat, regular)
123126

124127
def test_compatibility_restricted_source(self):
125128
"""Restricted request at the /api.php endpoint."""

0 commit comments

Comments
 (0)