Commit b1169eeb by Jeff LaJoie

Upgrades edx-lint to 0.5.5, disables non-sensical iterable warnings

parent df77af18
...@@ -190,7 +190,7 @@ class CatalogViewSetTests(ElasticsearchTestMixin, SerializationMixin, OAuth2Mixi ...@@ -190,7 +190,7 @@ class CatalogViewSetTests(ElasticsearchTestMixin, SerializationMixin, OAuth2Mixi
assert response.data['results'] == self.serialize_catalog_course([course], many=True) assert response.data['results'] == self.serialize_catalog_course([course], many=True)
# Any course appearing in the response must have at least one serialized run. # Any course appearing in the response must have at least one serialized run.
assert len(response.data['results'][0]['course_runs']) > 0 assert response.data['results'][0]['course_runs']
else: else:
response = self.client.get(url) response = self.client.get(url)
......
...@@ -595,7 +595,7 @@ class CourseMarketingSiteDataLoader(AbstractMarketingSiteDataLoader): ...@@ -595,7 +595,7 @@ class CourseMarketingSiteDataLoader(AbstractMarketingSiteDataLoader):
def set_subjects(self, course, data): def set_subjects(self, course, data):
subjects = self._get_objects_by_uuid(Subject, data['field_course_subject']) subjects = self._get_objects_by_uuid(Subject, data['field_course_subject'])
course.subjects.clear() course.subjects.clear()
course.subjects.add(*subjects) course.subjects.add(*subjects) # pylint: disable=not-an-iterable
def set_course_run_staff(self, course_run, data): def set_course_run_staff(self, course_run, data):
staff = self._get_objects_by_uuid(Person, data['field_course_staff']) staff = self._get_objects_by_uuid(Person, data['field_course_staff'])
......
...@@ -553,7 +553,7 @@ class CourseRun(TimeStampedModel): ...@@ -553,7 +553,7 @@ class CourseRun(TimeStampedModel):
None if the date is unknown or enrollable paid Seats are not available. None if the date is unknown or enrollable paid Seats are not available.
""" """
seats = list(self._enrollable_paid_seats().order_by('-upgrade_deadline')) seats = list(self._enrollable_paid_seats().order_by('-upgrade_deadline'))
if len(seats) == 0: if not seats:
# Enrollable paid seats are not available for this CourseRun. # Enrollable paid seats are not available for this CourseRun.
return None return None
......
...@@ -107,7 +107,7 @@ class BaseMarketingSitePublisher: ...@@ -107,7 +107,7 @@ class BaseMarketingSitePublisher:
if response.status_code == 200: if response.status_code == 200:
response_json = response.json() response_json = response.json()
if len(response_json['list']) > 0: if response_json['list']:
return response.json()['list'][0]['nid'] return response.json()['list'][0]['nid']
else: else:
return None return None
......
...@@ -163,7 +163,7 @@ class DistinctCountsElasticsearchBackendWrapper(object): ...@@ -163,7 +163,7 @@ class DistinctCountsElasticsearchBackendWrapper(object):
Re-implements ElasticsearchSearchBackend.search from: Re-implements ElasticsearchSearchBackend.search from:
https://github.com/django-haystack/django-haystack/blob/v2.5.0/haystack/backends/elasticsearch_backend.py#L495 https://github.com/django-haystack/django-haystack/blob/v2.5.0/haystack/backends/elasticsearch_backend.py#L495
""" """
if len(query_string) == 0: if not query_string:
return {'results': [], 'hits': 0, 'distinct_hits': 0} return {'results': [], 'hits': 0, 'distinct_hits': 0}
# NOTE (CCB): Haystack by default attempts to read/update the index mapping. Given that our mapping doesn't # NOTE (CCB): Haystack by default attempts to read/update the index mapping. Given that our mapping doesn't
......
...@@ -593,7 +593,7 @@ def send_email_for_seo_review(course, site): ...@@ -593,7 +593,7 @@ def send_email_for_seo_review(course, site):
try: try:
legal_team_users = User.objects.filter(groups__name=LEGAL_TEAM_GROUP_NAME) legal_team_users = User.objects.filter(groups__name=LEGAL_TEAM_GROUP_NAME)
project_coordinator = course.project_coordinator project_coordinator = course.project_coordinator
to_addresses = [user.email for user in legal_team_users] to_addresses = [user.email for user in legal_team_users] # pylint: disable=not-an-iterable
from_address = settings.PUBLISHER_FROM_EMAIL from_address = settings.PUBLISHER_FROM_EMAIL
course_page_path = reverse('publisher:publisher_course_detail', kwargs={'pk': course.id}) course_page_path = reverse('publisher:publisher_course_detail', kwargs={'pk': course.id})
......
...@@ -644,7 +644,7 @@ class SEOReviewEmailTests(SiteMixin, TestCase): ...@@ -644,7 +644,7 @@ class SEOReviewEmailTests(SiteMixin, TestCase):
self.assertEqual(len(mail.outbox), 1) self.assertEqual(len(mail.outbox), 1)
legal_team_users = User.objects.filter(groups__name=LEGAL_TEAM_GROUP_NAME) legal_team_users = User.objects.filter(groups__name=LEGAL_TEAM_GROUP_NAME)
expected_addresses = [user.email for user in legal_team_users] expected_addresses = [user.email for user in legal_team_users] # pylint: disable=not-an-iterable
self.assertEqual(expected_addresses, mail.outbox[0].to) self.assertEqual(expected_addresses, mail.outbox[0].to)
self.assertEqual(str(mail.outbox[0].subject), expected_subject) self.assertEqual(str(mail.outbox[0].subject), expected_subject)
body = mail.outbox[0].body.strip() body = mail.outbox[0].body.strip()
......
...@@ -154,6 +154,7 @@ enable = ...@@ -154,6 +154,7 @@ enable =
assert-on-tuple, assert-on-tuple,
attribute-defined-outside-init, attribute-defined-outside-init,
bad-staticmethod-argument, bad-staticmethod-argument,
arguments-differ,
signature-differs, signature-differs,
abstract-method, abstract-method,
super-init-not-called, super-init-not-called,
...@@ -261,22 +262,20 @@ enable = ...@@ -261,22 +262,20 @@ enable =
bad-option-value, bad-option-value,
unrecognized-inline-option, unrecognized-inline-option,
useless-suppression,
bad-inline-option, bad-inline-option,
deprecated-pragma, deprecated-pragma,
disable = disable =
arguments-differ,
bad-continuation, bad-continuation,
invalid-name, invalid-name,
misplaced-comparison-constant, misplaced-comparison-constant,
file-ignored, file-ignored,
bad-indentation, bad-indentation,
lowercase-l-suffix, lowercase-l-suffix,
len-as-condition,
unused-wildcard-import, unused-wildcard-import,
global-statement, global-statement,
no-else-return, no-else-return,
useless-suppression,
useless-super-delegation,
apply-builtin, apply-builtin,
backtick, backtick,
basestring-builtin, basestring-builtin,
...@@ -321,7 +320,6 @@ disable = ...@@ -321,7 +320,6 @@ disable =
raising-string, raising-string,
range-builtin-not-iterating, range-builtin-not-iterating,
raw_input-builtin, raw_input-builtin,
redefined-outer-name,
reduce-builtin, reduce-builtin,
reload-builtin, reload-builtin,
round-builtin, round-builtin,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
coverage==4.2 coverage==4.2
ddt==1.1.0 ddt==1.1.0
edx-lint==0.5.4 edx-lint==0.5.5
factory-boy==2.8.1 factory-boy==2.8.1
freezegun==0.3.7 freezegun==0.3.7
isort==4.2.5 isort==4.2.5
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment