diff --git a/cms/djangoapps/contentstore/features/advanced_settings.py b/cms/djangoapps/contentstore/features/advanced_settings.py index 76c4a3f2e0..f85659bfa9 100644 --- a/cms/djangoapps/contentstore/features/advanced_settings.py +++ b/cms/djangoapps/contentstore/features/advanced_settings.py @@ -1,8 +1,8 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step -from nose.tools import assert_false, assert_equal, assert_regexp_matches # pylint: disable=E0611 +from nose.tools import assert_false, assert_equal, assert_regexp_matches # pylint: disable=no-name-in-module from common import type_in_codemirror, press_the_notification_button, get_codemirror_value KEY_CSS = '.key h3.title' diff --git a/cms/djangoapps/contentstore/features/checklists.py b/cms/djangoapps/contentstore/features/checklists.py index 6053f7085f..aad13a3120 100644 --- a/cms/djangoapps/contentstore/features/checklists.py +++ b/cms/djangoapps/contentstore/features/checklists.py @@ -1,8 +1,8 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step -from nose.tools import assert_true, assert_equal # pylint: disable=E0611 +from nose.tools import assert_true, assert_equal # pylint: disable=no-name-in-module from terrain.steps import reload_the_page from selenium.common.exceptions import StaleElementReferenceException diff --git a/cms/djangoapps/contentstore/features/common.py b/cms/djangoapps/contentstore/features/common.py index 6a83fd35eb..b0681433b0 100644 --- a/cms/djangoapps/contentstore/features/common.py +++ b/cms/djangoapps/contentstore/features/common.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name import os from lettuce import world, step diff --git a/cms/djangoapps/contentstore/features/component.py b/cms/djangoapps/contentstore/features/component.py index bc37e8fd41..24223cbb42 100644 --- a/cms/djangoapps/contentstore/features/component.py +++ b/cms/djangoapps/contentstore/features/component.py @@ -1,12 +1,12 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name # Lettuce formats proposed definitions for unimplemented steps with the # argument name "step" instead of "_step" and pylint does not like that. -# pylint: disable=W0613 +# pylint: disable=unused-argument from lettuce import world, step -from nose.tools import assert_true, assert_in, assert_equal # pylint: disable=E0611 +from nose.tools import assert_true, assert_in, assert_equal # pylint: disable=no-name-in-module DISPLAY_NAME = "Display Name" diff --git a/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py b/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py index 749f611469..743f54f829 100644 --- a/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py +++ b/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py @@ -1,8 +1,8 @@ # disable missing docstring -# pylint: disable=C0111 +# pylint: disable=missing-docstring from lettuce import world -from nose.tools import assert_equal, assert_in # pylint: disable=E0611 +from nose.tools import assert_equal, assert_in # pylint: disable=no-name-in-module from terrain.steps import reload_the_page from common import type_in_codemirror from selenium.webdriver.common.keys import Keys diff --git a/cms/djangoapps/contentstore/features/course-export.py b/cms/djangoapps/contentstore/features/course-export.py index d8ab58a6d5..a3312cc09e 100644 --- a/cms/djangoapps/contentstore/features/course-export.py +++ b/cms/djangoapps/contentstore/features/course-export.py @@ -1,6 +1,6 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 -# pylint: disable=W0613 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name +# pylint: disable=unused-argument from lettuce import world, step from component_settings_editor_helpers import enter_xml_in_advanced_problem diff --git a/cms/djangoapps/contentstore/features/course-outline.py b/cms/djangoapps/contentstore/features/course-outline.py index a5f4da0731..17c71b85e5 100644 --- a/cms/djangoapps/contentstore/features/course-outline.py +++ b/cms/djangoapps/contentstore/features/course-outline.py @@ -1,9 +1,9 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step from common import * -from nose.tools import assert_true, assert_false, assert_equal # pylint: disable=E0611 +from nose.tools import assert_true, assert_false, assert_equal # pylint: disable=no-name-in-module from logging import getLogger logger = getLogger(__name__) diff --git a/cms/djangoapps/contentstore/features/course-settings.py b/cms/djangoapps/contentstore/features/course-settings.py index 4896ffddb1..c2aaae4989 100644 --- a/cms/djangoapps/contentstore/features/course-settings.py +++ b/cms/djangoapps/contentstore/features/course-settings.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step from terrain.steps import reload_the_page @@ -7,7 +7,7 @@ from selenium.webdriver.common.keys import Keys from common import type_in_codemirror, upload_file from django.conf import settings -from nose.tools import assert_true, assert_false, assert_equal # pylint: disable=E0611 +from nose.tools import assert_true, assert_false, assert_equal # pylint: disable=no-name-in-module TEST_ROOT = settings.COMMON_TEST_DATA_ROOT diff --git a/cms/djangoapps/contentstore/features/course-team.py b/cms/djangoapps/contentstore/features/course-team.py index d080de275a..130f05b0f5 100644 --- a/cms/djangoapps/contentstore/features/course-team.py +++ b/cms/djangoapps/contentstore/features/course-team.py @@ -1,8 +1,8 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step -from nose.tools import assert_in # pylint: disable=E0611 +from nose.tools import assert_in # pylint: disable=no-name-in-module @step(u'(I am viewing|s?he views) the course team settings$') diff --git a/cms/djangoapps/contentstore/features/course-updates.py b/cms/djangoapps/contentstore/features/course-updates.py index ca4d884590..6a39a29fee 100644 --- a/cms/djangoapps/contentstore/features/course-updates.py +++ b/cms/djangoapps/contentstore/features/course-updates.py @@ -1,10 +1,10 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step from selenium.webdriver.common.keys import Keys from common import type_in_codemirror, get_codemirror_value -from nose.tools import assert_in # pylint: disable=E0611 +from nose.tools import assert_in # pylint: disable=no-name-in-module @step(u'I go to the course updates page') diff --git a/cms/djangoapps/contentstore/features/course_import.py b/cms/djangoapps/contentstore/features/course_import.py index 42131f097e..c8293c5d11 100644 --- a/cms/djangoapps/contentstore/features/course_import.py +++ b/cms/djangoapps/contentstore/features/course_import.py @@ -1,6 +1,6 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 -# pylint: disable=W0613 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name +# pylint: disable=unused-argument import os from lettuce import world, step diff --git a/cms/djangoapps/contentstore/features/courses.py b/cms/djangoapps/contentstore/features/courses.py index 8f8bc2a1e8..7b3ccbcbd2 100644 --- a/cms/djangoapps/contentstore/features/courses.py +++ b/cms/djangoapps/contentstore/features/courses.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step from common import * diff --git a/cms/djangoapps/contentstore/features/discussion-editor.py b/cms/djangoapps/contentstore/features/discussion-editor.py index bca91f1a74..1a04ec0e09 100644 --- a/cms/djangoapps/contentstore/features/discussion-editor.py +++ b/cms/djangoapps/contentstore/features/discussion-editor.py @@ -1,5 +1,5 @@ # disable missing docstring -# pylint: disable=C0111 +# pylint: disable=missing-docstring from lettuce import world, step diff --git a/cms/djangoapps/contentstore/features/grading.py b/cms/djangoapps/contentstore/features/grading.py index 3c2d9c4495..10ea72b794 100644 --- a/cms/djangoapps/contentstore/features/grading.py +++ b/cms/djangoapps/contentstore/features/grading.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step from common import * @@ -7,7 +7,7 @@ from terrain.steps import reload_the_page from selenium.common.exceptions import InvalidElementStateException from opaque_keys.edx.locations import SlashSeparatedCourseKey from contentstore.utils import reverse_course_url -from nose.tools import assert_in, assert_not_in, assert_equal, assert_not_equal # pylint: disable=E0611 +from nose.tools import assert_in, assert_not_in, assert_equal, assert_not_equal # pylint: disable=no-name-in-module @step(u'I am viewing the grading settings') diff --git a/cms/djangoapps/contentstore/features/help.py b/cms/djangoapps/contentstore/features/help.py index 639aad9c01..f169e72057 100644 --- a/cms/djangoapps/contentstore/features/help.py +++ b/cms/djangoapps/contentstore/features/help.py @@ -1,6 +1,6 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 -# pylint: disable=W0613 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name +# pylint: disable=unused-argument from nose.tools import assert_false # pylint: disable=no-name-in-module from lettuce import step, world diff --git a/cms/djangoapps/contentstore/features/html-editor.py b/cms/djangoapps/contentstore/features/html-editor.py index 978487533e..98d57f477d 100644 --- a/cms/djangoapps/contentstore/features/html-editor.py +++ b/cms/djangoapps/contentstore/features/html-editor.py @@ -1,5 +1,5 @@ # disable missing docstring -# pylint: disable=C0111 +# pylint: disable=missing-docstring from collections import OrderedDict diff --git a/cms/djangoapps/contentstore/features/pages.py b/cms/djangoapps/contentstore/features/pages.py index bd2defc69b..5558f20390 100644 --- a/cms/djangoapps/contentstore/features/pages.py +++ b/cms/djangoapps/contentstore/features/pages.py @@ -1,9 +1,9 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 -# pylint: disable=W0613 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name +# pylint: disable=unused-argument from lettuce import world, step -from nose.tools import assert_equal, assert_in # pylint: disable=E0611 +from nose.tools import assert_equal, assert_in # pylint: disable=no-name-in-module CSS_FOR_TAB_ELEMENT = "li[data-tab-id='{0}'] input.toggle-checkbox" diff --git a/cms/djangoapps/contentstore/features/problem-editor.py b/cms/djangoapps/contentstore/features/problem-editor.py index 7ad4675f6f..a1135d06c7 100644 --- a/cms/djangoapps/contentstore/features/problem-editor.py +++ b/cms/djangoapps/contentstore/features/problem-editor.py @@ -1,9 +1,9 @@ # disable missing docstring -# pylint: disable=C0111 +# pylint: disable=missing-docstring import json from lettuce import world, step -from nose.tools import assert_equal, assert_true # pylint: disable=E0611 +from nose.tools import assert_equal, assert_true # pylint: disable=no-name-in-module from common import type_in_codemirror, open_new_course from advanced_settings import change_value, ADVANCED_MODULES_KEY from course_import import import_file diff --git a/cms/djangoapps/contentstore/features/signup.py b/cms/djangoapps/contentstore/features/signup.py index 1aa8d4b298..26374fe963 100644 --- a/cms/djangoapps/contentstore/features/signup.py +++ b/cms/djangoapps/contentstore/features/signup.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step diff --git a/cms/djangoapps/contentstore/features/textbooks.py b/cms/djangoapps/contentstore/features/textbooks.py index 1dfcea3b57..4cfba5dca5 100644 --- a/cms/djangoapps/contentstore/features/textbooks.py +++ b/cms/djangoapps/contentstore/features/textbooks.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step from django.conf import settings diff --git a/cms/djangoapps/contentstore/features/transcripts.py b/cms/djangoapps/contentstore/features/transcripts.py index 11e815c155..8047252417 100644 --- a/cms/djangoapps/contentstore/features/transcripts.py +++ b/cms/djangoapps/contentstore/features/transcripts.py @@ -1,5 +1,5 @@ # disable missing docstring -# pylint: disable=C0111 +# pylint: disable=missing-docstring import os from lettuce import world, step diff --git a/cms/djangoapps/contentstore/features/upload.py b/cms/djangoapps/contentstore/features/upload.py index e99296da49..5ae85ddb19 100644 --- a/cms/djangoapps/contentstore/features/upload.py +++ b/cms/djangoapps/contentstore/features/upload.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step from lettuce.django import django_url @@ -10,7 +10,7 @@ import random import os from django.contrib.auth.models import User from student.models import CourseEnrollment -from nose.tools import assert_equal, assert_not_equal # pylint: disable=E0611 +from nose.tools import assert_equal, assert_not_equal # pylint: disable=no-name-in-module TEST_ROOT = settings.COMMON_TEST_DATA_ROOT ASSET_NAMES_CSS = 'td.name-col > span.title > a.filename' diff --git a/cms/djangoapps/contentstore/features/video_editor.py b/cms/djangoapps/contentstore/features/video_editor.py index a515f63ec6..8cac89b598 100644 --- a/cms/djangoapps/contentstore/features/video_editor.py +++ b/cms/djangoapps/contentstore/features/video_editor.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- # disable missing docstring -# pylint: disable=C0111 +# pylint: disable=missing-docstring import requests from lettuce import world, step -from nose.tools import assert_true, assert_equal, assert_in, assert_not_equal # pylint: disable=E0611 +from nose.tools import assert_true, assert_equal, assert_in, assert_not_equal # pylint: disable=no-name-in-module from terrain.steps import reload_the_page from django.conf import settings from common import upload_file, attach_file diff --git a/cms/djangoapps/contentstore/features/video_handout.py b/cms/djangoapps/contentstore/features/video_handout.py index 63a9e42c9e..ccf74680d7 100644 --- a/cms/djangoapps/contentstore/features/video_handout.py +++ b/cms/djangoapps/contentstore/features/video_handout.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- # disable missing docstring -# pylint: disable=C0111 +# pylint: disable=missing-docstring from lettuce import world, step -from nose.tools import assert_true # pylint: disable=E0611 +from nose.tools import assert_true # pylint: disable=no-name-in-module from video_editor import RequestHandlerWithSessionId, success_upload_file diff --git a/cms/djangoapps/contentstore/git_export_utils.py b/cms/djangoapps/contentstore/git_export_utils.py index 14debdbcd4..f2752737d2 100644 --- a/cms/djangoapps/contentstore/git_export_utils.py +++ b/cms/djangoapps/contentstore/git_export_utils.py @@ -65,7 +65,7 @@ def cmd_log(cmd, cwd): def export_to_git(course_id, repo, user='', rdir=None): """Export a course to git.""" - # pylint: disable=R0915 + # pylint: disable=too-many-statements if not GIT_REPO_EXPORT_DIR: raise GitExportError(GitExportError.NO_EXPORT_DIR) diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index 6834132159..b753bbe130 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- -# pylint: disable=E1101 -# pylint: disable=W0212 import copy import mock diff --git a/cms/djangoapps/contentstore/tests/test_import.py b/cms/djangoapps/contentstore/tests/test_import.py index fe81ce05ea..daf48cea87 100644 --- a/cms/djangoapps/contentstore/tests/test_import.py +++ b/cms/djangoapps/contentstore/tests/test_import.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# pylint: disable=E1101 +# pylint: disable=no-member # pylint: disable=protected-access """ Tests for import_from_xml using the mongo modulestore. diff --git a/cms/djangoapps/contentstore/tests/utils.py b/cms/djangoapps/contentstore/tests/utils.py index 2d878cd4bc..439eccad98 100644 --- a/cms/djangoapps/contentstore/tests/utils.py +++ b/cms/djangoapps/contentstore/tests/utils.py @@ -1,4 +1,4 @@ -# pylint: disable=E1101 +# pylint: disable=no-member ''' Utilities for contentstore tests ''' diff --git a/cms/djangoapps/contentstore/utils.py b/cms/djangoapps/contentstore/utils.py index 2f61345f9a..914ad1ec65 100644 --- a/cms/djangoapps/contentstore/utils.py +++ b/cms/djangoapps/contentstore/utils.py @@ -1,4 +1,7 @@ -# pylint: disable=E1103, E1101 +""" +Common utility functions useful throughout the contentstore +""" +# pylint: disable=no-member import copy import logging diff --git a/cms/djangoapps/contentstore/views/__init__.py b/cms/djangoapps/contentstore/views/__init__.py index 5e644468fd..48ff107f11 100644 --- a/cms/djangoapps/contentstore/views/__init__.py +++ b/cms/djangoapps/contentstore/views/__init__.py @@ -1,4 +1,4 @@ -# pylint: disable=W0401, W0511 +# pylint: disable=wildcard-import, fixme "All view functions for contentstore, broken out into submodules" diff --git a/cms/djangoapps/contentstore/views/course.py b/cms/djangoapps/contentstore/views/course.py index 7f62d1ac42..318e3f9f3f 100644 --- a/cms/djangoapps/contentstore/views/course.py +++ b/cms/djangoapps/contentstore/views/course.py @@ -3,7 +3,7 @@ Views related to operations on course objects """ import json import random -import string # pylint: disable=W0402 +import string # pylint: disable=deprecated-module import logging from django.utils.translation import ugettext as _ import django.utils diff --git a/cms/djangoapps/contentstore/views/dev.py b/cms/djangoapps/contentstore/views/dev.py index 2a6ee3ae07..dd03998c30 100644 --- a/cms/djangoapps/contentstore/views/dev.py +++ b/cms/djangoapps/contentstore/views/dev.py @@ -3,7 +3,7 @@ Views that are only activated when the project is running in development mode. These views will NOT be shown on production: trying to access them will result in a 404 error. """ -# pylint: disable=W0613 +# pylint: disable=unused-argument from edxmako.shortcuts import render_to_response from mako.exceptions import TopLevelLookupException from django.http import HttpResponseNotFound diff --git a/cms/djangoapps/contentstore/views/error.py b/cms/djangoapps/contentstore/views/error.py index 40e117fc18..c67a559175 100644 --- a/cms/djangoapps/contentstore/views/error.py +++ b/cms/djangoapps/contentstore/views/error.py @@ -1,4 +1,4 @@ -# pylint: disable=C0111,W0613 +# pylint: disable=missing-docstring,unused-argument from django.http import (HttpResponse, HttpResponseServerError, HttpResponseNotFound) diff --git a/cms/djangoapps/contentstore/views/import_export.py b/cms/djangoapps/contentstore/views/import_export.py index 91dc1f8d3c..a71140cbc1 100644 --- a/cms/djangoapps/contentstore/views/import_export.py +++ b/cms/djangoapps/contentstore/views/import_export.py @@ -152,7 +152,7 @@ def import_handler(request, course_key_string): }] }) # Send errors to client with stage at which error occurred. - except Exception as exception: # pylint: disable=W0703 + except Exception as exception: # pylint: disable=broad-except _save_request_status(request, key, -1) if course_dir.isdir(): shutil.rmtree(course_dir) @@ -251,7 +251,7 @@ def import_handler(request, course_key_string): _save_request_status(request, key, 4) # Send errors to client with stage at which error occurred. - except Exception as exception: # pylint: disable=W0703 + except Exception as exception: # pylint: disable=broad-except log.exception( "error importing course" ) diff --git a/cms/djangoapps/contentstore/views/item.py b/cms/djangoapps/contentstore/views/item.py index e09db7a4e4..4428d7c087 100644 --- a/cms/djangoapps/contentstore/views/item.py +++ b/cms/djangoapps/contentstore/views/item.py @@ -221,7 +221,7 @@ def xblock_view_handler(request, usage_key_string, view_name): # catch exceptions indiscriminately, since after this point they escape the # dungeon and surface as uneditable, unsaveable, and undeletable # component-goblins. - except Exception as exc: # pylint: disable=w0703 + except Exception as exc: # pylint: disable=broad-except log.debug("unable to render studio_view for %r", xblock, exc_info=True) fragment = Fragment(render_to_string('html_error.html', {'message': str(exc)})) @@ -585,7 +585,7 @@ def _delete_item(usage_key, user): store.delete_item(usage_key, user.id) -# pylint: disable=W0613 +# pylint: disable=unused-argument @login_required @require_http_methods(("GET", "DELETE")) def orphan_handler(request, course_key_string): diff --git a/cms/djangoapps/contentstore/views/preview.py b/cms/djangoapps/contentstore/views/preview.py index 3e292827b1..772fc4c264 100644 --- a/cms/djangoapps/contentstore/views/preview.py +++ b/cms/djangoapps/contentstore/views/preview.py @@ -227,7 +227,7 @@ def get_preview_fragment(request, descriptor, context): try: fragment = module.render(preview_view, context) - except Exception as exc: # pylint: disable=W0703 + except Exception as exc: # pylint: disable=broad-except log.warning("Unable to render %s for %r", preview_view, module, exc_info=True) fragment = Fragment(render_to_string('html_error.html', {'message': str(exc)})) return fragment diff --git a/cms/djangoapps/course_creators/migrations/0001_initial.py b/cms/djangoapps/course_creators/migrations/0001_initial.py index ec7fd9ad9d..a1d2c8d08a 100644 --- a/cms/djangoapps/course_creators/migrations/0001_initial.py +++ b/cms/djangoapps/course_creators/migrations/0001_initial.py @@ -71,4 +71,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['course_creators'] \ No newline at end of file + complete_apps = ['course_creators'] diff --git a/cms/envs/acceptance.py b/cms/envs/acceptance.py index 5e596783cd..62a42cb3f6 100644 --- a/cms/envs/acceptance.py +++ b/cms/envs/acceptance.py @@ -5,7 +5,7 @@ so that we can run the lettuce acceptance tests. # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from .test import * from lms.envs.sauce import * @@ -113,7 +113,7 @@ SELENIUM_GRID = { ##################################################################### # Lastly, see if the developer has any local overrides. try: - from .private import * # pylint: disable=F0401 + from .private import * # pylint: disable=import-error except ImportError: pass diff --git a/cms/envs/aws.py b/cms/envs/aws.py index 2c6b730833..c73f8d0472 100644 --- a/cms/envs/aws.py +++ b/cms/envs/aws.py @@ -4,7 +4,7 @@ This is the default template for our main set of AWS servers. # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import import json diff --git a/cms/envs/aws_migrate.py b/cms/envs/aws_migrate.py index a8617d2fa0..e14834ec2d 100644 --- a/cms/envs/aws_migrate.py +++ b/cms/envs/aws_migrate.py @@ -6,7 +6,7 @@ LMS with enough privileges to modify the database schema. # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import # Import everything from .aws so that our settings are based on those. from .aws import * diff --git a/cms/envs/bok_choy.py b/cms/envs/bok_choy.py index a7c54076e9..f623571533 100644 --- a/cms/envs/bok_choy.py +++ b/cms/envs/bok_choy.py @@ -13,9 +13,9 @@ from path import path # This is a convenience for ensuring (a) that we can consistently find the files # and (b) that the files are the same in Jenkins as in local dev. os.environ['SERVICE_VARIANT'] = 'bok_choy' -os.environ['CONFIG_ROOT'] = path(__file__).abspath().dirname() # pylint: disable=E1120 +os.environ['CONFIG_ROOT'] = path(__file__).abspath().dirname() # pylint: disable=no-value-for-parameter -from .aws import * # pylint: disable=W0401, W0614 +from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import ######################### Testing overrides #################################### @@ -23,7 +23,7 @@ from .aws import * # pylint: disable=W0401, W0614 INSTALLED_APPS += ('django_extensions',) # Redirect to the test_root folder within the repo -TEST_ROOT = CONFIG_ROOT.dirname().dirname() / "test_root" # pylint: disable=E1120 +TEST_ROOT = CONFIG_ROOT.dirname().dirname() / "test_root" # pylint: disable=no-value-for-parameter GITHUB_REPO_ROOT = (TEST_ROOT / "data").abspath() LOG_DIR = (TEST_ROOT / "log").abspath() @@ -31,7 +31,7 @@ LOG_DIR = (TEST_ROOT / "log").abspath() update_module_store_settings( MODULESTORE, module_store_options={ - 'fs_root': (TEST_ROOT / "data").abspath(), # pylint: disable=E1120 + 'fs_root': (TEST_ROOT / "data").abspath(), # pylint: disable=no-value-for-parameter }, xml_store_options={ 'data_dir': (TEST_ROOT / "data").abspath(), @@ -66,6 +66,6 @@ YOUTUBE['TEXT_API']['url'] = "127.0.0.1:{0}/test_transcripts_youtube/".format(YO ##################################################################### # Lastly, see if the developer has any local overrides. try: - from .private import * # pylint: disable=F0401 + from .private import * # pylint: disable=import-error except ImportError: pass diff --git a/cms/envs/common.py b/cms/envs/common.py index 8c2c38028b..4055c5c944 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -22,7 +22,7 @@ Longer TODO: # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0611, W0614 +# pylint: disable=wildcard-import, unused-import, unused-wildcard-import import imp import os diff --git a/cms/envs/debug_upload.py b/cms/envs/debug_upload.py index 58f31a99e0..e9282c6888 100644 --- a/cms/envs/debug_upload.py +++ b/cms/envs/debug_upload.py @@ -1,5 +1,9 @@ -# pylint: disable=W0614, W0401 -from .dev import * +""" +A new cms ENV configuration to use a slow upload file handler to help test +progress bars in uploads +""" +# pylint: disable=unused-wildcard-import +from .dev import * # pylint: disable=wildcard-import FILE_UPLOAD_HANDLERS = ( 'contentstore.debug_file_uploader.DebugFileUploader', diff --git a/cms/envs/dev.py b/cms/envs/dev.py index edfe8fe8eb..a82da4cfcd 100644 --- a/cms/envs/dev.py +++ b/cms/envs/dev.py @@ -3,7 +3,7 @@ This config file runs the simplest dev environment""" # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from .common import * from logsettings import get_logger_config @@ -180,6 +180,6 @@ if SEGMENT_IO_KEY: ##################################################################### # Lastly, see if the developer has any local overrides. try: - from .private import * # pylint: disable=F0401 + from .private import * # pylint: disable=import-error except ImportError: pass diff --git a/cms/envs/dev_dbperf.py b/cms/envs/dev_dbperf.py index 2ea131b69e..610a974e3f 100644 --- a/cms/envs/dev_dbperf.py +++ b/cms/envs/dev_dbperf.py @@ -4,7 +4,7 @@ This configuration is to turn on the Django Toolbar stats for DB access stats, f # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from .dev import * diff --git a/cms/envs/dev_ike.py b/cms/envs/dev_ike.py index 108a36510a..c593bdcdeb 100644 --- a/cms/envs/dev_ike.py +++ b/cms/envs/dev_ike.py @@ -1,6 +1,6 @@ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import # dev environment for ichuang/mit diff --git a/cms/envs/dev_shared_preview.py b/cms/envs/dev_shared_preview.py index ec488a68ba..98c8fa7b15 100644 --- a/cms/envs/dev_shared_preview.py +++ b/cms/envs/dev_shared_preview.py @@ -5,7 +5,7 @@ the same process between preview and published # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from .dev import * diff --git a/cms/envs/dev_with_worker.py b/cms/envs/dev_with_worker.py index 078567c493..40f6ed4e1f 100644 --- a/cms/envs/dev_with_worker.py +++ b/cms/envs/dev_with_worker.py @@ -10,7 +10,7 @@ django_admin.py celery worker # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from dev import * diff --git a/cms/envs/devstack.py b/cms/envs/devstack.py index f45e601e6e..50fc0a1b37 100644 --- a/cms/envs/devstack.py +++ b/cms/envs/devstack.py @@ -78,7 +78,7 @@ DEBUG_TOOLBAR_MONGO_STACKTRACES = False ############################################################################### # See if the developer has any local overrides. try: - from .private import * # pylint: disable=F0401 + from .private import * # pylint: disable=import-error except ImportError: pass diff --git a/cms/envs/microsite_test.py b/cms/envs/microsite_test.py index b79e295226..f84d587613 100644 --- a/cms/envs/microsite_test.py +++ b/cms/envs/microsite_test.py @@ -3,7 +3,7 @@ This is a localdev test for the Microsite processing pipeline """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from .dev import * diff --git a/cms/envs/test.py b/cms/envs/test.py index 36b9e54e29..8ee1bcb625 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -10,7 +10,7 @@ sessions. Assumes structure: # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from .common import * import os diff --git a/cms/startup.py b/cms/startup.py index 815b03ecea..b754847204 100644 --- a/cms/startup.py +++ b/cms/startup.py @@ -5,7 +5,7 @@ Module with code executed during Studio startup from django.conf import settings # Force settings to run so that the python path is modified -settings.INSTALLED_APPS # pylint: disable=W0104 +settings.INSTALLED_APPS # pylint: disable=pointless-statement from django_startup import autostartup from monkey_patch import django_utils_translation diff --git a/cms/urls.py b/cms/urls.py index 6548044b96..afdec0eec8 100644 --- a/cms/urls.py +++ b/cms/urls.py @@ -148,7 +148,7 @@ if settings.DEBUG: pass # Custom error pages -# pylint: disable=C0103 +# pylint: disable=invalid-name handler404 = 'contentstore.views.render_404' handler500 = 'contentstore.views.render_500' diff --git a/common/djangoapps/contentserver/tests/test.py b/common/djangoapps/contentserver/tests/test.py index 872dea3af8..9aa5204920 100644 --- a/common/djangoapps/contentserver/tests/test.py +++ b/common/djangoapps/contentserver/tests/test.py @@ -69,7 +69,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): """ self.client.logout() resp = self.client.get(self.url_unlocked) - self.assertEqual(resp.status_code, 200) # pylint: disable=E1103 + self.assertEqual(resp.status_code, 200) def test_locked_asset_not_logged_in(self): """ @@ -78,7 +78,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): """ self.client.logout() resp = self.client.get(self.url_locked) - self.assertEqual(resp.status_code, 403) # pylint: disable=E1103 + self.assertEqual(resp.status_code, 403) def test_locked_asset_not_registered(self): """ @@ -87,7 +87,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): """ self.client.login(username=self.non_staff_usr, password=self.non_staff_pwd) resp = self.client.get(self.url_locked) - self.assertEqual(resp.status_code, 403) # pylint: disable=E1103 + self.assertEqual(resp.status_code, 403) def test_locked_asset_registered(self): """ @@ -99,7 +99,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): self.client.login(username=self.non_staff_usr, password=self.non_staff_pwd) resp = self.client.get(self.url_locked) - self.assertEqual(resp.status_code, 200) # pylint: disable=E1103 + self.assertEqual(resp.status_code, 200) def test_locked_asset_staff(self): """ @@ -107,7 +107,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): """ self.client.login(username=self.staff_usr, password=self.staff_pwd) resp = self.client.get(self.url_locked) - self.assertEqual(resp.status_code, 200) # pylint: disable=E1103 + self.assertEqual(resp.status_code, 200) def test_range_request_full_file(self): """ diff --git a/common/djangoapps/course_action_state/migrations/0001_initial.py b/common/djangoapps/course_action_state/migrations/0001_initial.py index f222bcb25a..a8ab6c7db3 100644 --- a/common/djangoapps/course_action_state/migrations/0001_initial.py +++ b/common/djangoapps/course_action_state/migrations/0001_initial.py @@ -89,4 +89,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['course_action_state'] \ No newline at end of file + complete_apps = ['course_action_state'] diff --git a/common/djangoapps/course_groups/tests/helpers.py b/common/djangoapps/course_groups/tests/helpers.py index 94925132e3..cd7b6c9eee 100644 --- a/common/djangoapps/course_groups/tests/helpers.py +++ b/common/djangoapps/course_groups/tests/helpers.py @@ -20,7 +20,7 @@ class CohortFactory(DjangoModelFactory): group_type = CourseUserGroup.COHORT @post_generation - def users(self, create, extracted, **kwargs): # pylint: disable=W0613 + def users(self, create, extracted, **kwargs): # pylint: disable=unused-argument """ Returns the users associated with the cohort. """ diff --git a/common/djangoapps/course_modes/migrations/0001_initial.py b/common/djangoapps/course_modes/migrations/0001_initial.py index 83e53769a2..1818b8abea 100644 --- a/common/djangoapps/course_modes/migrations/0001_initial.py +++ b/common/djangoapps/course_modes/migrations/0001_initial.py @@ -37,4 +37,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['course_modes'] \ No newline at end of file + complete_apps = ['course_modes'] diff --git a/common/djangoapps/course_modes/migrations/0002_auto__add_field_coursemode_currency.py b/common/djangoapps/course_modes/migrations/0002_auto__add_field_coursemode_currency.py index 7a25ef2256..78bb5bf4fa 100644 --- a/common/djangoapps/course_modes/migrations/0002_auto__add_field_coursemode_currency.py +++ b/common/djangoapps/course_modes/migrations/0002_auto__add_field_coursemode_currency.py @@ -32,4 +32,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['course_modes'] \ No newline at end of file + complete_apps = ['course_modes'] diff --git a/common/djangoapps/course_modes/migrations/0003_auto__add_unique_coursemode_course_id_currency_mode_slug.py b/common/djangoapps/course_modes/migrations/0003_auto__add_unique_coursemode_course_id_currency_mode_slug.py index 56a4f28c57..7e6bc1bd40 100644 --- a/common/djangoapps/course_modes/migrations/0003_auto__add_unique_coursemode_course_id_currency_mode_slug.py +++ b/common/djangoapps/course_modes/migrations/0003_auto__add_unique_coursemode_course_id_currency_mode_slug.py @@ -30,4 +30,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['course_modes'] \ No newline at end of file + complete_apps = ['course_modes'] diff --git a/common/djangoapps/course_modes/migrations/0004_auto__add_field_coursemode_expiration_date.py b/common/djangoapps/course_modes/migrations/0004_auto__add_field_coursemode_expiration_date.py index afd8207388..19851446c4 100644 --- a/common/djangoapps/course_modes/migrations/0004_auto__add_field_coursemode_expiration_date.py +++ b/common/djangoapps/course_modes/migrations/0004_auto__add_field_coursemode_expiration_date.py @@ -33,4 +33,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['course_modes'] \ No newline at end of file + complete_apps = ['course_modes'] diff --git a/common/djangoapps/course_modes/migrations/0005_auto__add_field_coursemode_expiration_datetime.py b/common/djangoapps/course_modes/migrations/0005_auto__add_field_coursemode_expiration_datetime.py index b293efa23f..101c3b919b 100644 --- a/common/djangoapps/course_modes/migrations/0005_auto__add_field_coursemode_expiration_datetime.py +++ b/common/djangoapps/course_modes/migrations/0005_auto__add_field_coursemode_expiration_datetime.py @@ -34,4 +34,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['course_modes'] \ No newline at end of file + complete_apps = ['course_modes'] diff --git a/common/djangoapps/course_modes/migrations/0007_add_description.py b/common/djangoapps/course_modes/migrations/0007_add_description.py index 2828d2ad9f..98386e4bcf 100644 --- a/common/djangoapps/course_modes/migrations/0007_add_description.py +++ b/common/djangoapps/course_modes/migrations/0007_add_description.py @@ -41,4 +41,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['course_modes'] \ No newline at end of file + complete_apps = ['course_modes'] diff --git a/common/djangoapps/course_modes/migrations/0007_auto__add_coursemodesarchive__chg_field_coursemode_course_id.py b/common/djangoapps/course_modes/migrations/0007_auto__add_coursemodesarchive__chg_field_coursemode_course_id.py index c76b8745cb..d73b6b5e48 100644 --- a/common/djangoapps/course_modes/migrations/0007_auto__add_coursemodesarchive__chg_field_coursemode_course_id.py +++ b/common/djangoapps/course_modes/migrations/0007_auto__add_coursemodesarchive__chg_field_coursemode_course_id.py @@ -61,4 +61,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['course_modes'] \ No newline at end of file + complete_apps = ['course_modes'] diff --git a/common/djangoapps/course_modes/tests/factories.py b/common/djangoapps/course_modes/tests/factories.py index 5ca0153db1..bbe1ca5c2b 100644 --- a/common/djangoapps/course_modes/tests/factories.py +++ b/common/djangoapps/course_modes/tests/factories.py @@ -3,8 +3,8 @@ from factory.django import DjangoModelFactory from opaque_keys.edx.locations import SlashSeparatedCourseKey -# Factories don't have __init__ methods, and are self documenting -# pylint: disable=W0232 +# Factories are self documenting +# pylint: disable=missing-docstring class CourseModeFactory(DjangoModelFactory): FACTORY_FOR = CourseMode diff --git a/common/djangoapps/dark_lang/migrations/0001_initial.py b/common/djangoapps/dark_lang/migrations/0001_initial.py index cc715fe8e5..b2f856ac43 100644 --- a/common/djangoapps/dark_lang/migrations/0001_initial.py +++ b/common/djangoapps/dark_lang/migrations/0001_initial.py @@ -71,4 +71,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['dark_lang'] \ No newline at end of file + complete_apps = ['dark_lang'] diff --git a/common/djangoapps/embargo/migrations/0001_initial.py b/common/djangoapps/embargo/migrations/0001_initial.py index 9516b8985e..ce3a6198a0 100644 --- a/common/djangoapps/embargo/migrations/0001_initial.py +++ b/common/djangoapps/embargo/migrations/0001_initial.py @@ -111,4 +111,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['embargo'] \ No newline at end of file + complete_apps = ['embargo'] diff --git a/common/djangoapps/enrollment/serializers.py b/common/djangoapps/enrollment/serializers.py index 7ec8b6bc16..e95df0943a 100644 --- a/common/djangoapps/enrollment/serializers.py +++ b/common/djangoapps/enrollment/serializers.py @@ -60,7 +60,7 @@ class CourseEnrollmentSerializer(serializers.ModelSerializer): """Retrieves the username from the associated model.""" return model.username - class Meta: # pylint: disable=C0111 + class Meta: # pylint: disable=missing-docstring model = CourseEnrollment fields = ('created', 'mode', 'is_active', 'course', 'student') lookup_field = 'username' diff --git a/common/djangoapps/external_auth/migrations/0001_initial.py b/common/djangoapps/external_auth/migrations/0001_initial.py index a5ebf023df..cf93c99d6b 100644 --- a/common/djangoapps/external_auth/migrations/0001_initial.py +++ b/common/djangoapps/external_auth/migrations/0001_initial.py @@ -87,4 +87,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['external_auth'] \ No newline at end of file + complete_apps = ['external_auth'] diff --git a/common/djangoapps/external_auth/tests/test_helper.py b/common/djangoapps/external_auth/tests/test_helper.py index ff463e3355..b7cacae207 100644 --- a/common/djangoapps/external_auth/tests/test_helper.py +++ b/common/djangoapps/external_auth/tests/test_helper.py @@ -13,11 +13,11 @@ class ExternalAuthHelperFnTest(TestCase): """ Tests the _safe_postlogin_redirect function with different values of next """ - HOST = 'testserver' # pylint: disable=C0103 - ONSITE1 = '/dashboard' # pylint: disable=C0103 - ONSITE2 = '/courses/org/num/name/courseware' # pylint: disable=C0103 - ONSITE3 = 'http://{}/my/custom/url'.format(HOST) # pylint: disable=C0103 - OFFSITE1 = 'http://www.attacker.com' # pylint: disable=C0103 + HOST = 'testserver' # pylint: disable=invalid-name + ONSITE1 = '/dashboard' # pylint: disable=invalid-name + ONSITE2 = '/courses/org/num/name/courseware' # pylint: disable=invalid-name + ONSITE3 = 'http://{}/my/custom/url'.format(HOST) # pylint: disable=invalid-name + OFFSITE1 = 'http://www.attacker.com' # pylint: disable=invalid-name for redirect_to in [ONSITE1, ONSITE2, ONSITE3]: redir = _safe_postlogin_redirect(redirect_to, HOST) diff --git a/common/djangoapps/external_auth/tests/test_shib.py b/common/djangoapps/external_auth/tests/test_shib.py index fa09501e41..ac2f49c3d2 100644 --- a/common/djangoapps/external_auth/tests/test_shib.py +++ b/common/djangoapps/external_auth/tests/test_shib.py @@ -582,9 +582,9 @@ class ShibUtilFnTest(TestCase): Tests util functions in shib module """ def test__flatten_to_ascii(self): - DIACRITIC = u"àèìòùÀÈÌÒÙáéíóúýÁÉÍÓÚÝâêîôûÂÊÎÔÛãñõÃÑÕäëïöüÿÄËÏÖÜŸåÅçÇ" # pylint: disable=C0103 - STR_DIACRI = "àèìòùÀÈÌÒÙáéíóúýÁÉÍÓÚÝâêîôûÂÊÎÔÛãñõÃÑÕäëïöüÿÄËÏÖÜŸåÅçÇ" # pylint: disable=C0103 - FLATTENED = u"aeiouAEIOUaeiouyAEIOUYaeiouAEIOUanoANOaeiouyAEIOUYaAcC" # pylint: disable=C0103 + DIACRITIC = u"àèìòùÀÈÌÒÙáéíóúýÁÉÍÓÚÝâêîôûÂÊÎÔÛãñõÃÑÕäëïöüÿÄËÏÖÜŸåÅçÇ" # pylint: disable=invalid-name + STR_DIACRI = "àèìòùÀÈÌÒÙáéíóúýÁÉÍÓÚÝâêîôûÂÊÎÔÛãñõÃÑÕäëïöüÿÄËÏÖÜŸåÅçÇ" # pylint: disable=invalid-name + FLATTENED = u"aeiouAEIOUaeiouyAEIOUYaeiouAEIOUanoANOaeiouyAEIOUYaAcC" # pylint: disable=invalid-name self.assertEqual(_flatten_to_ascii('jasön'), 'jason') # umlaut self.assertEqual(_flatten_to_ascii('Jason包'), 'Jason') # mandarin, so it just gets dropped self.assertEqual(_flatten_to_ascii('abc'), 'abc') # pass through diff --git a/common/djangoapps/external_auth/views.py b/common/djangoapps/external_auth/views.py index b0f64303a1..8e28b47ef0 100644 --- a/common/djangoapps/external_auth/views.py +++ b/common/djangoapps/external_auth/views.py @@ -3,7 +3,7 @@ import json import logging import random import re -import string # pylint: disable=W0402 +import string # pylint: disable=deprecated-module import fnmatch import unicodedata import urllib diff --git a/common/djangoapps/reverification/migrations/0001_initial.py b/common/djangoapps/reverification/migrations/0001_initial.py index 89ad801879..b68f411893 100644 --- a/common/djangoapps/reverification/migrations/0001_initial.py +++ b/common/djangoapps/reverification/migrations/0001_initial.py @@ -33,4 +33,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['reverification'] \ No newline at end of file + complete_apps = ['reverification'] diff --git a/common/djangoapps/reverification/tests/factories.py b/common/djangoapps/reverification/tests/factories.py index 58684d97f0..4416875243 100644 --- a/common/djangoapps/reverification/tests/factories.py +++ b/common/djangoapps/reverification/tests/factories.py @@ -8,8 +8,8 @@ from datetime import timedelta, datetime from opaque_keys.edx.locations import SlashSeparatedCourseKey -# Factories don't have __init__ methods, and are self documenting -# pylint: disable=W0232 +# Factories are self documenting +# pylint: disable=missing-docstring class MidcourseReverificationWindowFactory(DjangoModelFactory): """ Creates a generic MidcourseReverificationWindow. """ FACTORY_FOR = MidcourseReverificationWindow diff --git a/common/djangoapps/static_replace/test/test_static_replace.py b/common/djangoapps/static_replace/test/test_static_replace.py index 7dc3d7f3cb..b74965277f 100644 --- a/common/djangoapps/static_replace/test/test_static_replace.py +++ b/common/djangoapps/static_replace/test/test_static_replace.py @@ -1,6 +1,6 @@ import re -from nose.tools import assert_equals, assert_true, assert_false # pylint: disable=E0611 +from nose.tools import assert_equals, assert_true, assert_false # pylint: disable=no-name-in-module from static_replace import (replace_static_urls, replace_course_urls, _url_replace_regex) from mock import patch, Mock diff --git a/common/djangoapps/student/helpers.py b/common/djangoapps/student/helpers.py index 23bba3d0dd..32ed5f9363 100644 --- a/common/djangoapps/student/helpers.py +++ b/common/djangoapps/student/helpers.py @@ -5,7 +5,7 @@ from django.conf import settings from django.core.urlresolvers import reverse from opaque_keys.edx.keys import CourseKey from course_modes.models import CourseMode -from third_party_auth import ( # pylint: disable=W0611 +from third_party_auth import ( # pylint: disable=unused-import pipeline, provider, is_enabled as third_party_auth_enabled ) diff --git a/common/djangoapps/student/management/tests/test_transfer_students.py b/common/djangoapps/student/management/tests/test_transfer_students.py index 45376eb148..89be5f167f 100644 --- a/common/djangoapps/student/management/tests/test_transfer_students.py +++ b/common/djangoapps/student/management/tests/test_transfer_students.py @@ -7,7 +7,7 @@ from opaque_keys.edx import locator import unittest import ddt -from shoppingcart.models import Order, CertificateItem # pylint: disable=F0401 +from shoppingcart.models import Order, CertificateItem # pylint: disable=import-error from course_modes.models import CourseMode from student.management.commands import transfer_students from student.models import CourseEnrollment, UNENROLL_DONE, EVENT_NAME_ENROLLMENT_DEACTIVATED, \ @@ -36,7 +36,7 @@ class TestTransferStudents(ModuleStoreTestCase): """Disconnects the UNENROLL stub receiver.""" UNENROLL_DONE.disconnect(self.assert_unenroll_signal) - def assert_unenroll_signal(self, skip_refund=False, **kwargs): # pylint: disable=W0613 + def assert_unenroll_signal(self, skip_refund=False, **kwargs): # pylint: disable=unused-argument """ Signal Receiver stub for testing that the unenroll signal was fired. """ self.assertFalse(self.signal_fired) self.assertTrue(skip_refund) @@ -45,8 +45,8 @@ class TestTransferStudents(ModuleStoreTestCase): def test_transfer_students(self): """ Verify the transfer student command works as intended. """ student = UserFactory.create() - student.set_password(self.PASSWORD) # pylint: disable=E1101 - student.save() # pylint: disable=E1101 + student.set_password(self.PASSWORD) # pylint: disable=no-member + student.save() # pylint: disable=no-member mode = 'verified' # Original Course original_course_location = locator.CourseLocator('Org0', 'Course0', 'Run0') @@ -75,7 +75,7 @@ class TestTransferStudents(ModuleStoreTestCase): self.assertTrue(self.signal_fired) # Confirm the analytics event was emitted. - self.mock_tracker.emit.assert_has_calls( # pylint: disable=E1103 + self.mock_tracker.emit.assert_has_calls( # pylint: disable=maybe-no-member [ call( EVENT_NAME_ENROLLMENT_ACTIVATED, diff --git a/common/djangoapps/student/migrations/0025_auto__add_field_courseenrollmentallowed_auto_enroll.py b/common/djangoapps/student/migrations/0025_auto__add_field_courseenrollmentallowed_auto_enroll.py index 1cb21e9b33..a60d121de8 100644 --- a/common/djangoapps/student/migrations/0025_auto__add_field_courseenrollmentallowed_auto_enroll.py +++ b/common/djangoapps/student/migrations/0025_auto__add_field_courseenrollmentallowed_auto_enroll.py @@ -170,4 +170,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['student'] \ No newline at end of file + complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0027_add_active_flag_and_mode_to_courseware_enrollment.py b/common/djangoapps/student/migrations/0027_add_active_flag_and_mode_to_courseware_enrollment.py index bba8cc6e34..112dccfe51 100644 --- a/common/djangoapps/student/migrations/0027_add_active_flag_and_mode_to_courseware_enrollment.py +++ b/common/djangoapps/student/migrations/0027_add_active_flag_and_mode_to_courseware_enrollment.py @@ -180,4 +180,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['student'] \ No newline at end of file + complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0028_auto__add_userstanding.py b/common/djangoapps/student/migrations/0028_auto__add_userstanding.py index d26699448a..ae66b86963 100644 --- a/common/djangoapps/student/migrations/0028_auto__add_userstanding.py +++ b/common/djangoapps/student/migrations/0028_auto__add_userstanding.py @@ -185,4 +185,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['student'] \ No newline at end of file + complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0029_add_lookup_table_between_user_and_anonymous_student_id.py b/common/djangoapps/student/migrations/0029_add_lookup_table_between_user_and_anonymous_student_id.py index e086496bfc..4975598157 100644 --- a/common/djangoapps/student/migrations/0029_add_lookup_table_between_user_and_anonymous_student_id.py +++ b/common/djangoapps/student/migrations/0029_add_lookup_table_between_user_and_anonymous_student_id.py @@ -191,4 +191,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['student'] \ No newline at end of file + complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0029_remove_pearson.py b/common/djangoapps/student/migrations/0029_remove_pearson.py index b92b27017f..4e1cb09b4c 100644 --- a/common/djangoapps/student/migrations/0029_remove_pearson.py +++ b/common/djangoapps/student/migrations/0029_remove_pearson.py @@ -182,4 +182,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['student'] \ No newline at end of file + complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0032_add_field_UserProfile_country_add_field_UserProfile_city.py b/common/djangoapps/student/migrations/0032_add_field_UserProfile_country_add_field_UserProfile_city.py index bf35f208ed..a4d323e498 100644 --- a/common/djangoapps/student/migrations/0032_add_field_UserProfile_country_add_field_UserProfile_city.py +++ b/common/djangoapps/student/migrations/0032_add_field_UserProfile_country_add_field_UserProfile_city.py @@ -143,4 +143,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['student'] \ No newline at end of file + complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0033_auto__add_passwordhistory.py b/common/djangoapps/student/migrations/0033_auto__add_passwordhistory.py index f46fd07894..c03a45f3f2 100644 --- a/common/djangoapps/student/migrations/0033_auto__add_passwordhistory.py +++ b/common/djangoapps/student/migrations/0033_auto__add_passwordhistory.py @@ -153,4 +153,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['student'] \ No newline at end of file + complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0034_auto__add_courseaccessrole.py b/common/djangoapps/student/migrations/0034_auto__add_courseaccessrole.py index d6267ecb01..bf9ce5e9db 100644 --- a/common/djangoapps/student/migrations/0034_auto__add_courseaccessrole.py +++ b/common/djangoapps/student/migrations/0034_auto__add_courseaccessrole.py @@ -186,4 +186,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['student'] \ No newline at end of file + complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0037_auto__add_courseregistrationcode.py b/common/djangoapps/student/migrations/0037_auto__add_courseregistrationcode.py index 5853fcdd34..c60425df8a 100644 --- a/common/djangoapps/student/migrations/0037_auto__add_courseregistrationcode.py +++ b/common/djangoapps/student/migrations/0037_auto__add_courseregistrationcode.py @@ -176,4 +176,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['student'] \ No newline at end of file + complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0038_auto__add_usersignupsource.py b/common/djangoapps/student/migrations/0038_auto__add_usersignupsource.py index fd6c7a883c..faa725b794 100644 --- a/common/djangoapps/student/migrations/0038_auto__add_usersignupsource.py +++ b/common/djangoapps/student/migrations/0038_auto__add_usersignupsource.py @@ -177,4 +177,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['student'] \ No newline at end of file + complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0039_auto__del_courseregistrationcode.py b/common/djangoapps/student/migrations/0039_auto__del_courseregistrationcode.py index 4960e2cbc4..441b52ea2c 100644 --- a/common/djangoapps/student/migrations/0039_auto__del_courseregistrationcode.py +++ b/common/djangoapps/student/migrations/0039_auto__del_courseregistrationcode.py @@ -171,4 +171,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['student'] \ No newline at end of file + complete_apps = ['student'] diff --git a/common/djangoapps/student/migrations/0040_auto__del_field_usersignupsource_user_id__add_field_usersignupsource_u.py b/common/djangoapps/student/migrations/0040_auto__del_field_usersignupsource_user_id__add_field_usersignupsource_u.py index 19afe45ad8..cabacf8de7 100644 --- a/common/djangoapps/student/migrations/0040_auto__del_field_usersignupsource_user_id__add_field_usersignupsource_u.py +++ b/common/djangoapps/student/migrations/0040_auto__del_field_usersignupsource_user_id__add_field_usersignupsource_u.py @@ -169,4 +169,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['student'] \ No newline at end of file + complete_apps = ['student'] diff --git a/common/djangoapps/student/models.py b/common/djangoapps/student/models.py index 08d5c0ffb7..2a373afb68 100644 --- a/common/djangoapps/student/models.py +++ b/common/djangoapps/student/models.py @@ -1164,7 +1164,7 @@ class CourseEnrollment(models.Model): if GeneratedCertificate.certificate_for_student(self.user, self.course_id) is not None: return False - #TODO - When Course administrators to define a refund period for paid courses then refundable will be supported. # pylint: disable=W0511 + #TODO - When Course administrators to define a refund period for paid courses then refundable will be supported. # pylint: disable=fixme course_mode = CourseMode.mode_for_course(self.course_id, 'verified') if course_mode is None: diff --git a/common/djangoapps/student/tests/factories.py b/common/djangoapps/student/tests/factories.py index e419b56ea3..880beac7da 100644 --- a/common/djangoapps/student/tests/factories.py +++ b/common/djangoapps/student/tests/factories.py @@ -12,8 +12,8 @@ from uuid import uuid4 from pytz import UTC from opaque_keys.edx.locations import SlashSeparatedCourseKey -# Factories don't have __init__ methods, and are self documenting -# pylint: disable=W0232, C0111 +# Factories are self documenting +# pylint: disable=missing-docstring class GroupFactory(DjangoModelFactory): diff --git a/common/djangoapps/student/tests/test_auto_auth.py b/common/djangoapps/student/tests/test_auto_auth.py index fd6a8b4092..d94e89d097 100644 --- a/common/djangoapps/student/tests/test_auto_auth.py +++ b/common/djangoapps/student/tests/test_auto_auth.py @@ -163,8 +163,8 @@ class AutoAuthEnabledTestCase(UrlResetMixin, TestCase): # Check that session and CSRF are set in the response for cookie in ['csrftoken', 'sessionid']: - self.assertIn(cookie, response.cookies) # pylint: disable=E1103 - self.assertTrue(response.cookies[cookie].value) # pylint: disable=E1103 + self.assertIn(cookie, response.cookies) # pylint: disable=maybe-no-member + self.assertTrue(response.cookies[cookie].value) # pylint: disable=maybe-no-member class AutoAuthDisabledTestCase(UrlResetMixin, TestCase): diff --git a/common/djangoapps/student/tests/test_login.py b/common/djangoapps/student/tests/test_login.py index eb3183a4a6..5b51587362 100644 --- a/common/djangoapps/student/tests/test_login.py +++ b/common/djangoapps/student/tests/test_login.py @@ -335,9 +335,9 @@ class UtilFnTest(TestCase): """ Tests the _parse_course_id_from_string util function """ - COURSE_ID = u'org/num/run' # pylint: disable=C0103 - COURSE_URL = u'/courses/{}/otherstuff'.format(COURSE_ID) # pylint: disable=C0103 - NON_COURSE_URL = u'/blahblah' # pylint: disable=C0103 + COURSE_ID = u'org/num/run' # pylint: disable=invalid-name + COURSE_URL = u'/courses/{}/otherstuff'.format(COURSE_ID) # pylint: disable=invalid-name + NON_COURSE_URL = u'/blahblah' # pylint: disable=invalid-name self.assertEqual( _parse_course_id_from_string(COURSE_URL), SlashSeparatedCourseKey.from_deprecated_string(COURSE_ID) @@ -415,7 +415,7 @@ class ExternalAuthShibTest(ModuleStoreTestCase): Tests the redirects when visiting course-specific URL with @login_required. Should vary by course depending on its enrollment_domain """ - TARGET_URL = reverse('courseware', args=[self.course.id.to_deprecated_string()]) # pylint: disable=C0103 + TARGET_URL = reverse('courseware', args=[self.course.id.to_deprecated_string()]) # pylint: disable=invalid-name noshib_response = self.client.get(TARGET_URL, follow=True) self.assertEqual(noshib_response.redirect_chain[-1], ('http://testserver/accounts/login?next={url}'.format(url=TARGET_URL), 302)) @@ -423,7 +423,7 @@ class ExternalAuthShibTest(ModuleStoreTestCase): .format(platform_name=settings.PLATFORM_NAME))) self.assertEqual(noshib_response.status_code, 200) - TARGET_URL_SHIB = reverse('courseware', args=[self.shib_course.id.to_deprecated_string()]) # pylint: disable=C0103 + TARGET_URL_SHIB = reverse('courseware', args=[self.shib_course.id.to_deprecated_string()]) # pylint: disable=invalid-name shib_response = self.client.get(**{'path': TARGET_URL_SHIB, 'follow': True, 'REMOTE_USER': self.extauth.external_id, diff --git a/common/djangoapps/student/tests/test_microsite.py b/common/djangoapps/student/tests/test_microsite.py index 4574c429a8..4564647302 100644 --- a/common/djangoapps/student/tests/test_microsite.py +++ b/common/djangoapps/student/tests/test_microsite.py @@ -26,7 +26,7 @@ FAKE_MICROSITE = { } -def fake_site_name(name, default=None): # pylint: disable=W0613 +def fake_site_name(name, default=None): # pylint: disable=unused-argument """ create a fake microsite site name """ @@ -36,7 +36,7 @@ def fake_site_name(name, default=None): # pylint: disable=W0613 return default -def fake_microsite_get_value(name, default=None): # pylint: disable=W0613 +def fake_microsite_get_value(name, default=None): # pylint: disable=unused-argument """ create a fake microsite site name """ diff --git a/common/djangoapps/student/tests/tests.py b/common/djangoapps/student/tests/tests.py index 3bf2fde715..4c4177d18b 100644 --- a/common/djangoapps/student/tests/tests.py +++ b/common/djangoapps/student/tests/tests.py @@ -322,7 +322,7 @@ class DashboardTest(ModuleStoreTestCase): ) enrollment = CourseEnrollment.enroll(self.user, self.course.id, mode='honor') - # TODO: Until we can allow course administrators to define a refund period for paid for courses show_refund_option should be False. # pylint: disable=W0511 + # TODO: Until we can allow course administrators to define a refund period for paid for courses show_refund_option should be False. # pylint: disable=fixme self.assertFalse(enrollment.refundable()) resp = self.client.post(reverse('student.views.dashboard', args=[])) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index 9429502cae..3ac08d4d6f 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -110,7 +110,7 @@ from eventtracking import tracker log = logging.getLogger("edx.student") AUDIT_LOG = logging.getLogger("audit") -ReverifyInfo = namedtuple('ReverifyInfo', 'course_id course_name course_number date status display') # pylint: disable=C0103 +ReverifyInfo = namedtuple('ReverifyInfo', 'course_id course_name course_number date status display') # pylint: disable=invalid-name def csrf_token(context): @@ -1268,7 +1268,7 @@ class AccountValidationError(Exception): @receiver(post_save, sender=User) -def user_signup_handler(sender, **kwargs): # pylint: disable=W0613 +def user_signup_handler(sender, **kwargs): # pylint: disable=unused-argument """ handler that saves the user Signup Source when the user is created diff --git a/common/djangoapps/terrain/__init__.py b/common/djangoapps/terrain/__init__.py index ee3c154101..a99980ec95 100644 --- a/common/djangoapps/terrain/__init__.py +++ b/common/djangoapps/terrain/__init__.py @@ -2,7 +2,7 @@ # across all lms apps can be put in terrain/common # See https://groups.google.com/forum/?fromgroups=#!msg/lettuce-users/5VyU9B4HcX8/USgbGIJdS5QJ -from terrain.browser import * # pylint: disable=W0401 -from terrain.steps import * # pylint: disable=W0401 -from terrain.factories import * # pylint: disable=W0401 -from terrain.setup_prereqs import * # pylint: disable=W0401 +from terrain.browser import * # pylint: disable=wildcard-import +from terrain.steps import * # pylint: disable=wildcard-import +from terrain.factories import * # pylint: disable=wildcard-import +from terrain.setup_prereqs import * # pylint: disable=wildcard-import diff --git a/common/djangoapps/terrain/browser.py b/common/djangoapps/terrain/browser.py index 75ad8aa984..e603c90b02 100644 --- a/common/djangoapps/terrain/browser.py +++ b/common/djangoapps/terrain/browser.py @@ -2,8 +2,8 @@ Browser set up for acceptance tests. """ -# pylint: disable=E1101 -# pylint: disable=W0613 +# pylint: disable=no-member +# pylint: disable=unused-argument from lettuce import before, after, world from splinter.browser import Browser diff --git a/common/djangoapps/terrain/course_helpers.py b/common/djangoapps/terrain/course_helpers.py index ab3004a810..f13f10b0b9 100644 --- a/common/djangoapps/terrain/course_helpers.py +++ b/common/djangoapps/terrain/course_helpers.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name import urllib from lettuce import world diff --git a/common/djangoapps/terrain/setup_prereqs.py b/common/djangoapps/terrain/setup_prereqs.py index c39b1cb9a7..98f5c67983 100644 --- a/common/djangoapps/terrain/setup_prereqs.py +++ b/common/djangoapps/terrain/setup_prereqs.py @@ -36,7 +36,7 @@ YOUTUBE_API_URLS = { } -@before.all # pylint: disable=E1101 +@before.all # pylint: disable=no-member def start_video_server(): """ Serve the HTML5 Video Sources from a local port @@ -47,7 +47,7 @@ def start_video_server(): setattr(world, 'video_source', video_server) -@after.all # pylint: disable=E1101 +@after.all # pylint: disable=no-member def stop_video_server(_total): """ Stop the HTML5 Video Source server after all tests have executed @@ -57,7 +57,7 @@ def stop_video_server(_total): video_server.shutdown() -@before.each_scenario # pylint: disable=E1101 +@before.each_scenario # pylint: disable=no-member def process_requires_tags(scenario): """ Process the scenario tags to make sure that any @@ -125,7 +125,7 @@ def is_youtube_available(urls): return True -@after.each_scenario # pylint: disable=E1101 +@after.each_scenario # pylint: disable=no-member def stop_stubs(_scenario): """ Shut down any stub services that were started up for the scenario. @@ -136,7 +136,7 @@ def stop_stubs(_scenario): stub_server.shutdown() -@after.each_scenario # pylint: disable=E1101 +@after.each_scenario # pylint: disable=no-member def clear_alerts(_scenario): """ Clear any alerts that might still exist, so that diff --git a/common/djangoapps/terrain/steps.py b/common/djangoapps/terrain/steps.py index 5f51315de8..5ea05ddec2 100644 --- a/common/djangoapps/terrain/steps.py +++ b/common/djangoapps/terrain/steps.py @@ -1,15 +1,15 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name # Disable the "wildcard import" warning so we can bring in all methods from # course helpers and ui helpers -# pylint: disable=W0401 +# pylint: disable=wildcard-import # Disable the "Unused import %s from wildcard import" warning -# pylint: disable=W0614 +# pylint: disable=unused-wildcard-import # Disable the "unused argument" warning because lettuce uses "step" -# pylint: disable=W0613 +# pylint: disable=unused-argument # django_url is assigned late in the process of loading lettuce, # so we import this as a module, and then read django_url from @@ -19,7 +19,7 @@ import lettuce.django from lettuce import world, step from .course_helpers import * from .ui_helpers import * -from nose.tools import assert_equals # pylint: disable=E0611 +from nose.tools import assert_equals # pylint: disable=no-name-in-module from opaque_keys.edx.locations import SlashSeparatedCourseKey diff --git a/common/djangoapps/terrain/stubs/youtube.py b/common/djangoapps/terrain/stubs/youtube.py index 823b78fd02..688fe0ed1e 100644 --- a/common/djangoapps/terrain/stubs/youtube.py +++ b/common/djangoapps/terrain/stubs/youtube.py @@ -35,7 +35,7 @@ class StubYouTubeHandler(StubHttpRequestHandler): # Default number of seconds to delay the response to simulate network latency. DEFAULT_DELAY_SEC = 0.5 - def do_DELETE(self): # pylint: disable=C0103 + def do_DELETE(self): # pylint: disable=invalid-name """ Allow callers to delete all the server configurations using the /del_config URL. """ @@ -52,7 +52,7 @@ class StubYouTubeHandler(StubHttpRequestHandler): """ # Initialize only once if IFRAME_API_RESPONSE is none. - global IFRAME_API_RESPONSE # pylint: disable=W0603 + global IFRAME_API_RESPONSE # pylint: disable=global-statement if IFRAME_API_RESPONSE is None: IFRAME_API_RESPONSE = requests.get('https://www.youtube.com/iframe_api').content.strip("\n") diff --git a/common/djangoapps/terrain/ui_helpers.py b/common/djangoapps/terrain/ui_helpers.py index 09028a7fc5..b26b311326 100644 --- a/common/djangoapps/terrain/ui_helpers.py +++ b/common/djangoapps/terrain/ui_helpers.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world diff --git a/common/djangoapps/third_party_auth/pipeline.py b/common/djangoapps/third_party_auth/pipeline.py index d1fd527fef..4564f5533a 100644 --- a/common/djangoapps/third_party_auth/pipeline.py +++ b/common/djangoapps/third_party_auth/pipeline.py @@ -73,8 +73,8 @@ from social.exceptions import AuthException from social.pipeline import partial import student -from shoppingcart.models import Order, PaidCourseRegistration # pylint: disable=F0401 -from shoppingcart.exceptions import ( # pylint: disable=F0401 +from shoppingcart.models import Order, PaidCourseRegistration # pylint: disable=import-error +from shoppingcart.exceptions import ( # pylint: disable=import-error CourseDoesNotExistException, ItemAlreadyInCartException, AlreadyEnrolledInCourseException diff --git a/common/djangoapps/third_party_auth/tests/specs/base.py b/common/djangoapps/third_party_auth/tests/specs/base.py index da29b9b9a3..3c34754931 100644 --- a/common/djangoapps/third_party_auth/tests/specs/base.py +++ b/common/djangoapps/third_party_auth/tests/specs/base.py @@ -654,7 +654,7 @@ class IntegrationTest(testutil.TestCase, test.TestCase): pipeline.get_login_url(self.PROVIDER_CLASS.NAME, pipeline.AUTH_ENTRY_LOGIN))) # Next, the provider makes a request against /auth/complete/. - # pylint:disable-msg=protected-access + # pylint: disable-msg=protected-access self.assert_redirect_to_register_looks_correct(actions.do_complete(strategy, social_views._do_login)) mako_middleware_process_request(strategy.request) @@ -716,7 +716,7 @@ class IntegrationTest(testutil.TestCase, test.TestCase): # assignment via pipeline to make sure a distinct username is created. strategy.storage.user.create_user(username=self.get_username(), email='user@email.com', password='password') strategy.backend.auth_complete = mock.MagicMock(return_value=self.fake_auth_complete(strategy)) - # pylint:disable-msg=protected-access + # pylint: disable-msg=protected-access self.assert_redirect_to_register_looks_correct(actions.do_complete(strategy, social_views._do_login)) distinct_username = pipeline.get(request)['kwargs']['username'] self.assertNotEqual(original_username, distinct_username) @@ -725,7 +725,7 @@ class IntegrationTest(testutil.TestCase, test.TestCase): request, strategy = self.get_request_and_strategy( auth_entry=pipeline.AUTH_ENTRY_REGISTER, redirect_uri='social:complete') strategy.backend.auth_complete = mock.MagicMock(return_value=self.fake_auth_complete(strategy)) - # pylint:disable-msg=protected-access + # pylint: disable-msg=protected-access self.assert_redirect_to_register_looks_correct(actions.do_complete(strategy, social_views._do_login)) mako_middleware_process_request(strategy.request) diff --git a/common/djangoapps/third_party_auth/tests/test_change_enrollment.py b/common/djangoapps/third_party_auth/tests/test_change_enrollment.py index 73ecd1022b..f85ae38d48 100644 --- a/common/djangoapps/third_party_auth/tests/test_change_enrollment.py +++ b/common/djangoapps/third_party_auth/tests/test_change_enrollment.py @@ -5,7 +5,7 @@ import unittest import ddt import pytz from third_party_auth import pipeline -from shoppingcart.models import Order, PaidCourseRegistration # pylint: disable=F0401 +from shoppingcart.models import Order, PaidCourseRegistration # pylint: disable=import-error from social.apps.django_app import utils as social_utils from django.conf import settings from django.contrib.sessions.backends import cache @@ -62,7 +62,7 @@ class PipelineEnrollmentTest(ModuleStoreTestCase): strategy = self._fake_strategy() strategy.session_set('enroll_course_id', unicode(self.course.id)) - result = pipeline.change_enrollment(strategy, 1, user=self.user) # pylint: disable=E1111,E1124 + result = pipeline.change_enrollment(strategy, 1, user=self.user) # pylint: disable=assignment-from-no-return,redundant-keyword-arg self.assertEqual(result, {}) # Check that the user was or was not enrolled @@ -86,7 +86,7 @@ class PipelineEnrollmentTest(ModuleStoreTestCase): # Simulate the pipeline step for enrolling in this course strategy = self._fake_strategy() strategy.session_set('enroll_course_id', unicode(self.course.id)) - result = pipeline.change_enrollment(strategy, 1, user=self.user) # pylint: disable=E1111,E1124 + result = pipeline.change_enrollment(strategy, 1, user=self.user) # pylint: disable=assignment-from-no-return,redundant-keyword-arg self.assertEqual(result, {}) # Expect that the uesr is NOT enrolled in the course @@ -109,7 +109,7 @@ class PipelineEnrollmentTest(ModuleStoreTestCase): # This should fail silently, with no exception strategy = self._fake_strategy() strategy.session_set('enroll_course_id', unicode(self.course.id)) - result = pipeline.change_enrollment(strategy, 1, user=self.user) # pylint: disable=E1111,E1124 + result = pipeline.change_enrollment(strategy, 1, user=self.user) # pylint: disable=assignment-from-no-return,redundant-keyword-arg self.assertEqual(result, {}) # Verify that we were NOT enrolled @@ -117,7 +117,7 @@ class PipelineEnrollmentTest(ModuleStoreTestCase): def test_no_course_id_skips_enroll(self): strategy = self._fake_strategy() - result = pipeline.change_enrollment(strategy, 1, user=self.user) # pylint: disable=E1111,E1124 + result = pipeline.change_enrollment(strategy, 1, user=self.user) # pylint: disable=assignment-from-no-return,redundant-keyword-arg self.assertEqual(result, {}) self.assertFalse(CourseEnrollment.is_enrolled(self.user, self.course.id)) diff --git a/common/djangoapps/user_api/api/course_tag.py b/common/djangoapps/user_api/api/course_tag.py index 43907fbe72..89e7f49b85 100644 --- a/common/djangoapps/user_api/api/course_tag.py +++ b/common/djangoapps/user_api/api/course_tag.py @@ -53,7 +53,7 @@ def set_course_tag(user, course_id, key, value): key: arbitrary (<=255 char string) value: arbitrary string """ - # pylint: disable=W0511 + # pylint: disable=fixme # TODO: There is a risk of IntegrityErrors being thrown here given # simultaneous calls from many processes. Handle by retrying after # a short delay? diff --git a/common/djangoapps/user_api/migrations/0001_initial.py b/common/djangoapps/user_api/migrations/0001_initial.py index 754960e36d..3a5e3c0ab5 100644 --- a/common/djangoapps/user_api/migrations/0001_initial.py +++ b/common/djangoapps/user_api/migrations/0001_initial.py @@ -75,4 +75,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['user_api'] \ No newline at end of file + complete_apps = ['user_api'] diff --git a/common/djangoapps/user_api/migrations/0002_auto__add_usercoursetags__add_unique_usercoursetags_user_course_id_key.py b/common/djangoapps/user_api/migrations/0002_auto__add_usercoursetags__add_unique_usercoursetags_user_course_id_key.py index cc7e27cc4d..639fb83e9c 100644 --- a/common/djangoapps/user_api/migrations/0002_auto__add_usercoursetags__add_unique_usercoursetags_user_course_id_key.py +++ b/common/djangoapps/user_api/migrations/0002_auto__add_usercoursetags__add_unique_usercoursetags_user_course_id_key.py @@ -84,4 +84,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['user_api'] \ No newline at end of file + complete_apps = ['user_api'] diff --git a/common/djangoapps/user_api/migrations/0003_rename_usercoursetags.py b/common/djangoapps/user_api/migrations/0003_rename_usercoursetags.py index dc448817e3..9c9afc3044 100644 --- a/common/djangoapps/user_api/migrations/0003_rename_usercoursetags.py +++ b/common/djangoapps/user_api/migrations/0003_rename_usercoursetags.py @@ -69,4 +69,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['user_api'] \ No newline at end of file + complete_apps = ['user_api'] diff --git a/common/djangoapps/user_api/models.py b/common/djangoapps/user_api/models.py index b9675c83c5..e71437214b 100644 --- a/common/djangoapps/user_api/models.py +++ b/common/djangoapps/user_api/models.py @@ -11,7 +11,7 @@ from xmodule_django.models import CourseKeyField # but currently the rest of the system assumes that "student" defines # certain models. For now we will leave the models in "student" and # create an alias in "user_api". -from student.models import UserProfile, Registration, PendingEmailChange # pylint:disable=unused-import +from student.models import UserProfile, Registration, PendingEmailChange # pylint: disable=unused-import class UserPreference(models.Model): diff --git a/common/djangoapps/user_api/tests/factories.py b/common/djangoapps/user_api/tests/factories.py index 3308c2f2ab..60ee7c2ddc 100644 --- a/common/djangoapps/user_api/tests/factories.py +++ b/common/djangoapps/user_api/tests/factories.py @@ -6,8 +6,8 @@ from user_api.models import UserPreference, UserCourseTag, UserOrgTag from opaque_keys.edx.locations import SlashSeparatedCourseKey -# Factories don't have __init__ methods, and are self documenting -# pylint: disable=W0232, C0111 +# Factories are self documenting +# pylint: disable=missing-docstring class UserPreferenceFactory(DjangoModelFactory): FACTORY_FOR = UserPreference diff --git a/common/djangoapps/util/password_policy_validators.py b/common/djangoapps/util/password_policy_validators.py index 987ec30a02..6541c4b90d 100644 --- a/common/djangoapps/util/password_policy_validators.py +++ b/common/djangoapps/util/password_policy_validators.py @@ -1,4 +1,4 @@ -# pylint: disable=E1101 +# pylint: disable=no-member """ This file exposes a number of password complexity validators which can be optionally added to account creation @@ -7,7 +7,7 @@ This file was inspired by the django-passwords project at https://github.com/dst authored by dstufft (https://github.com/dstufft) """ from __future__ import division -import string # pylint: disable=W0402 +import string # pylint: disable=deprecated-module from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ diff --git a/common/djangoapps/util/tests/test_date_utils.py b/common/djangoapps/util/tests/test_date_utils.py index 0bf52b8ac6..de3308658e 100644 --- a/common/djangoapps/util/tests/test_date_utils.py +++ b/common/djangoapps/util/tests/test_date_utils.py @@ -8,7 +8,7 @@ import unittest import ddt from mock import patch -from nose.tools import assert_equals, assert_false # pylint: disable=E0611 +from nose.tools import assert_equals, assert_false # pylint: disable=no-name-in-module from pytz import UTC from util.date_utils import ( @@ -70,7 +70,6 @@ def test_get_time_display_coerce(): get_time_display(test_time_daylight, '%b %d %H:%M', coerce_tz="US/Pacific")) -# pylint: disable=W0232 class NamelessTZ(tzinfo): """Static timezone for testing""" diff --git a/common/lib/calc/calc/calc.py b/common/lib/calc/calc/calc.py index 0d283d3966..7d50c8e38e 100644 --- a/common/lib/calc/calc/calc.py +++ b/common/lib/calc/calc/calc.py @@ -356,7 +356,7 @@ class ParseAugmenter(object): sum_term = Group(sum_term)("sum") # Finish the recursion. - expr << sum_term # pylint: disable=W0104 + expr << sum_term # pylint: disable=pointless-statement self.tree = (expr + stringEnd).parseString(self.math_expr)[0] def reduce_tree(self, handle_actions, terminal_converter=None): diff --git a/common/lib/capa/capa/capa_problem.py b/common/lib/capa/capa/capa_problem.py index 7b3dbbe79f..699db9aaf3 100644 --- a/common/lib/capa/capa/capa_problem.py +++ b/common/lib/capa/capa/capa_problem.py @@ -439,7 +439,7 @@ class LoncapaProblem(object): # Note that the modifications has been done, avoiding problems if called twice. if hasattr(self, 'has_targeted'): return - self.has_targeted = True # pylint: disable=W0201 + self.has_targeted = True # pylint: disable=attribute-defined-outside-init for mult_choice_response in tree.xpath('//multiplechoiceresponse[@targeted-feedback]'): show_explanation = mult_choice_response.get('targeted-feedback') == 'alwaysShowCorrectChoiceExplanation' diff --git a/common/lib/capa/capa/inputtypes.py b/common/lib/capa/capa/inputtypes.py index f54a02ca03..9b7d3af9c9 100644 --- a/common/lib/capa/capa/inputtypes.py +++ b/common/lib/capa/capa/inputtypes.py @@ -63,7 +63,7 @@ log = logging.getLogger(__name__) ######################################################################### -registry = TagRegistry() # pylint: disable=C0103 +registry = TagRegistry() # pylint: disable=invalid-name class Status(object): diff --git a/common/lib/capa/capa/responsetypes.py b/common/lib/capa/capa/responsetypes.py index 87137039ea..a0b74372e2 100644 --- a/common/lib/capa/capa/responsetypes.py +++ b/common/lib/capa/capa/responsetypes.py @@ -55,7 +55,7 @@ log = logging.getLogger(__name__) registry = TagRegistry() -CorrectMap = correctmap.CorrectMap # pylint: disable=C0103 +CorrectMap = correctmap.CorrectMap # pylint: disable=invalid-name CORRECTMAP_PY = None @@ -874,7 +874,7 @@ class MultipleChoiceResponse(LoncapaResponse): # Both to avoid double-processing, and to feed the logs. if self.has_shuffle(): return - self._has_shuffle = True # pylint: disable=W0201 + self._has_shuffle = True # pylint: disable=attribute-defined-outside-init # Move elements from tree to list for shuffling, then put them back. ordering = list(choicegroup.getchildren()) for choice in ordering: @@ -958,7 +958,7 @@ class MultipleChoiceResponse(LoncapaResponse): # Both to avoid double-processing, and to feed the logs. if self.has_answerpool(): return - self._has_answerpool = True # pylint: disable=W0201 + self._has_answerpool = True # pylint: disable=attribute-defined-outside-init choices_list = list(choicegroup.getchildren()) @@ -2229,7 +2229,7 @@ class ExternalResponse(LoncapaResponse): cmap = CorrectMap() try: submission = [student_answers[k] for k in idset] - except Exception as err: # pylint: disable=W0703 + except Exception as err: # pylint: disable=broad-except log.error( 'Error %s: cannot get student answer for %s; student_answers=%s', err, @@ -2244,7 +2244,7 @@ class ExternalResponse(LoncapaResponse): try: rxml = self.do_external_request('get_score', extra_payload) - except Exception as err: # pylint: disable=W0703 + except Exception as err: # pylint: disable=broad-except log.error('Error %s', err) if self.capa_system.DEBUG: cmap.set_dict(dict(zip(sorted( @@ -2276,7 +2276,7 @@ class ExternalResponse(LoncapaResponse): try: rxml = self.do_external_request('get_answers', {}) exans = json.loads(rxml.find('expected').text) - except Exception as err: # pylint: disable=W0703 + except Exception as err: # pylint: disable=broad-except log.error('Error %s', err) if self.capa_system.DEBUG: msg = '%s' % str( @@ -2486,7 +2486,7 @@ class FormulaResponse(LoncapaResponse): name = hxml.get('name') correct_answer = contextualize_text( hxml.get('answer'), self.context) - # pylint: disable=W0703 + # pylint: disable=broad-except try: correctness = self.check_formula( correct_answer, @@ -3161,20 +3161,23 @@ class ChoiceTextResponse(LoncapaResponse): # TEMPORARY: List of all response subclasses # FIXME: To be replaced by auto-registration -# pylint: disable=E0604 -__all__ = [CodeResponse, - NumericalResponse, - FormulaResponse, - CustomResponse, - SchematicResponse, - ExternalResponse, - ImageResponse, - OptionResponse, - SymbolicResponse, - StringResponse, - ChoiceResponse, - MultipleChoiceResponse, - TrueFalseResponse, - JavascriptResponse, - AnnotationResponse, - ChoiceTextResponse] +# pylint: disable=invalid-all-object +__all__ = [ + CodeResponse, + NumericalResponse, + FormulaResponse, + CustomResponse, + SchematicResponse, + ExternalResponse, + ImageResponse, + OptionResponse, + SymbolicResponse, + StringResponse, + ChoiceResponse, + MultipleChoiceResponse, + TrueFalseResponse, + JavascriptResponse, + AnnotationResponse, + ChoiceTextResponse, +] +# pylint: enable=invalid-all-object diff --git a/common/lib/capa/capa/tests/test_inputtypes.py b/common/lib/capa/capa/tests/test_inputtypes.py index b53ce496f4..632ae5dcb9 100644 --- a/common/lib/capa/capa/tests/test_inputtypes.py +++ b/common/lib/capa/capa/tests/test_inputtypes.py @@ -54,7 +54,7 @@ class OptionInputTest(unittest.TestCase): 'status': 'answered'} option_input = lookup_tag('optioninput')(test_capa_system(), element, state) - context = option_input._get_render_context() # pylint: disable=W0212 + context = option_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', @@ -114,7 +114,7 @@ class ChoiceGroupTest(unittest.TestCase): the_input = lookup_tag(tag)(test_capa_system(), element, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', @@ -168,7 +168,7 @@ class JavascriptInputTest(unittest.TestCase): state = {'value': '3', } the_input = lookup_tag('javascriptinput')(test_capa_system(), element, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', @@ -200,7 +200,7 @@ class TextLineTest(unittest.TestCase): state = {'value': 'BumbleBee', } the_input = lookup_tag('textline')(test_capa_system(), element, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', @@ -232,7 +232,7 @@ class TextLineTest(unittest.TestCase): state = {'value': 'BumbleBee', } the_input = lookup_tag('textline')(test_capa_system(), element, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', @@ -276,7 +276,7 @@ class TextLineTest(unittest.TestCase): state = {'value': 'BumbleBee', } the_input = lookup_tag('textline')(test_capa_system(), element, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', @@ -318,7 +318,7 @@ class FileSubmissionTest(unittest.TestCase): input_class = lookup_tag('filesubmission') the_input = input_class(test_capa_system(), element, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', @@ -367,7 +367,7 @@ class CodeInputTest(unittest.TestCase): input_class = lookup_tag('codeinput') the_input = input_class(test_capa_system(), element, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', @@ -421,7 +421,7 @@ class MatlabTest(unittest.TestCase): self.the_input = self.input_class(test_capa_system(), elt, state) def test_rendering(self): - context = self.the_input._get_render_context() # pylint: disable=W0212 + context = self.the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', @@ -452,7 +452,7 @@ class MatlabTest(unittest.TestCase): elt = etree.fromstring(self.xml) the_input = self.input_class(test_capa_system(), elt, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', @@ -484,7 +484,7 @@ class MatlabTest(unittest.TestCase): elt = etree.fromstring(self.xml) the_input = self.input_class(test_capa_system(), elt, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', 'id': 'prob_1_2', @@ -515,7 +515,7 @@ class MatlabTest(unittest.TestCase): elt = etree.fromstring(self.xml) the_input = self.input_class(test_capa_system(), elt, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', 'id': 'prob_1_2', @@ -721,7 +721,7 @@ class MatlabTest(unittest.TestCase): elt = etree.fromstring(self.xml) the_input = self.input_class(test_capa_system(), elt, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access self.maxDiff = None expected = fromstring(u'\n
if Conditionally execute statements.\nThe general form of the if statement is\n\n if expression\n statements\n ELSEIF expression\n statements\n ELSE\n statements\n END\n\nThe statements are executed if the real part of the expression \nhas all non-zero elements. The ELSE and ELSEIF parts are optional.\nZero or more ELSEIF parts can be used as well as nested if\'s.\nThe expression is usually of the form expr rop expr where \nrop is ==, <, >, <=, >=, or ~=.\n\n\nExample\n if I == J\n A(I,J) = 2;\n elseif abs(I-J) == 1\n A(I,J) = -1;\n else\n A(I,J) = 0;\n end\n\nSee also relop, else, elseif, end, for, while, switch.\n\nReference page in Help browser\n doc if\n\n
\n') received = fromstring(context['queue_msg']) @@ -792,7 +792,7 @@ class MatlabTest(unittest.TestCase): not_allowed_tag = 'script' self.the_input.msg = "<{0}>Test message".format(not_allowed_tag) expected = "<script>Test message</script>" - self.assertEqual(self.the_input._get_render_context()['msg'], expected) + self.assertEqual(self.the_input._get_render_context()['msg'], expected) # pylint: disable=protected-access def html_tree_equal(received, expected): @@ -840,7 +840,7 @@ class SchematicTest(unittest.TestCase): the_input = lookup_tag('schematic')(test_capa_system(), element, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', @@ -884,7 +884,7 @@ class ImageInputTest(unittest.TestCase): the_input = lookup_tag('imageinput')(test_capa_system(), element, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', @@ -939,7 +939,7 @@ class CrystallographyTest(unittest.TestCase): the_input = lookup_tag('crystallography')(test_capa_system(), element, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', @@ -981,7 +981,7 @@ class VseprTest(unittest.TestCase): the_input = lookup_tag('vsepr_input')(test_capa_system(), element, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', @@ -1013,7 +1013,7 @@ class ChemicalEquationTest(unittest.TestCase): def test_rendering(self): ''' Verify that the render context matches the expected render context''' - context = self.the_input._get_render_context() # pylint: disable=W0212 + context = self.the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', @@ -1101,7 +1101,7 @@ class FormulaEquationTest(unittest.TestCase): """ Verify that the render context matches the expected render context """ - context = self.the_input._get_render_context() # pylint: disable=W0212 + context = self.the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', @@ -1231,7 +1231,7 @@ class DragAndDropTest(unittest.TestCase): the_input = lookup_tag('drag_and_drop_input')(test_capa_system(), element, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', 'id': 'prob_1_2', @@ -1283,7 +1283,7 @@ class AnnotationInputTest(unittest.TestCase): the_input = lookup_tag(tag)(test_capa_system(), element, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access expected = { 'STATIC_URL': '/dummy-static/', @@ -1373,7 +1373,7 @@ class TestChoiceText(unittest.TestCase): } expected.update(state) the_input = lookup_tag(tag)(test_capa_system(), element, state) - context = the_input._get_render_context() # pylint: disable=W0212 + context = the_input._get_render_context() # pylint: disable=protected-access self.assertEqual(context, expected) def test_radiotextgroup(self): diff --git a/common/lib/symmath/symmath/formula.py b/common/lib/symmath/symmath/formula.py index 4da7cdc71c..0c6aa05a24 100644 --- a/common/lib/symmath/symmath/formula.py +++ b/common/lib/symmath/symmath/formula.py @@ -12,7 +12,7 @@ Provides sympy representation. # import os -import string # pylint: disable=W0402 +import string # pylint: disable=deprecated-module import re import logging import operator diff --git a/common/lib/xmodule/xmodule/contentstore/mongo.py b/common/lib/xmodule/xmodule/contentstore/mongo.py index aad0c57d19..08b77132d5 100644 --- a/common/lib/xmodule/xmodule/contentstore/mongo.py +++ b/common/lib/xmodule/xmodule/contentstore/mongo.py @@ -18,7 +18,7 @@ from xmodule.modulestore.django import ASSET_IGNORE_REGEX class MongoContentStore(ContentStore): - # pylint: disable=W0613 + # pylint: disable=unused-argument def __init__(self, host, db, port=27017, user=None, password=None, bucket='fs', collection=None, **kwargs): """ Establish the connection with the mongo backend and connect to the collections diff --git a/common/lib/xmodule/xmodule/modulestore/mongo/base.py b/common/lib/xmodule/xmodule/modulestore/mongo/base.py index dfd63fbc24..9f5a09aee3 100644 --- a/common/lib/xmodule/xmodule/modulestore/mongo/base.py +++ b/common/lib/xmodule/xmodule/modulestore/mongo/base.py @@ -441,8 +441,8 @@ class MongoModuleStore(ModuleStoreDraftAndPublished, ModuleStoreWriteBase, Mongo DEFAULT_ASSET_COLLECTION_NAME = 'assetstore' # TODO (cpennington): Enable non-filesystem filestores - # pylint: disable=C0103 - # pylint: disable=W0201 + # pylint: disable=invalid-name + # pylint: disable=attribute-defined-outside-init def __init__(self, contentstore, doc_store_config, fs_root, render_template, default_class=None, error_tracker=null_error_tracker, diff --git a/common/lib/xmodule/xmodule/modulestore/tests/persistent_factories.py b/common/lib/xmodule/xmodule/modulestore/tests/persistent_factories.py index a292212a1a..2eee09740f 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/persistent_factories.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/persistent_factories.py @@ -5,8 +5,8 @@ from xmodule.x_module import XModuleDescriptor import factory from factory.helpers import lazy_attribute from opaque_keys.edx.keys import UsageKey -# Factories don't have __init__ methods, and are self documenting -# pylint: disable=W0232, C0111 +# Factories are self documenting +# pylint: disable=missing-docstring class SplitFactory(factory.Factory): @@ -35,7 +35,7 @@ class PersistentCourseFactory(SplitFactory): """ FACTORY_FOR = CourseDescriptor - # pylint: disable=W0613 + # pylint: disable=unused-argument @classmethod def _create(cls, target_class, course='999', run='run', org='testX', user_id=ModuleStoreEnum.UserID.test, master_branch=ModuleStoreEnum.BranchName.draft, **kwargs): @@ -60,7 +60,7 @@ class ItemFactory(SplitFactory): display_name = factory.LazyAttributeSequence(lambda o, n: "{} {}".format(o.category, n)) - # pylint: disable=W0613 + # pylint: disable=unused-argument @classmethod def _create(cls, target_class, parent_location, category='chapter', user_id=ModuleStoreEnum.UserID.test, definition_locator=None, force=False, diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_modulestore.py b/common/lib/xmodule/xmodule/modulestore/tests/test_modulestore.py index 0b428ca333..ba3d54bfc0 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_modulestore.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_modulestore.py @@ -1,4 +1,9 @@ -from nose.tools import assert_equals, assert_true, assert_false # pylint: disable=E0611 +""" +Defines a test function, check_has_course_method, useful in various modulestore tests. + +This file should potentially be renamed "utilties" since this file contains no tests. +""" +from nose.tools import assert_equals, assert_true, assert_false # pylint: disable=no-name-in-module def check_has_course_method(modulestore, locator, locator_key_fields): diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py b/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py index ab2afc1bc8..b08031252a 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py @@ -1,6 +1,9 @@ -# pylint: disable=E1101 -# pylint: disable=W0212 -# pylint: disable=E0611 +""" +Unit tests for the Mongo modulestore +""" +# pylint: disable=no-member +# pylint: disable=protected-access +# pylint: disable=no-name-in-module from nose.tools import assert_equals, assert_raises, \ assert_not_equals, assert_false, assert_true, assert_greater, assert_is_instance, assert_is_none # pylint: enable=E0611 diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py b/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py index 8ea9d26c81..f41ec6acad 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py @@ -865,7 +865,7 @@ class SplitModuleItemTests(SplitModuleTest): with self.assertRaises(ItemNotFoundError): modulestore().get_item(locator) - # pylint: disable=W0212 + # pylint: disable=protected-access def test_matching(self): ''' test the block and value matches help functions @@ -1304,7 +1304,7 @@ class TestItemCrud(SplitModuleTest): fields={'display_name': 'problem 2', 'data': another_payload}, definition_locator=original.definition_locator, ) - # pylint: disable=W0212 + # pylint: disable=protected-access modulestore()._clear_cache() # now begin the test @@ -1846,7 +1846,7 @@ def modulestore(): options.update(SplitModuleTest.MODULESTORE['OPTIONS']) options['render_template'] = render_to_template_mock - # pylint: disable=W0142 + # pylint: disable=star-args SplitModuleTest.modulestore = class_( None, # contentstore SplitModuleTest.MODULESTORE['DOC_STORE_CONFIG'], diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_xml_importer.py b/common/lib/xmodule/xmodule/modulestore/tests/test_xml_importer.py index e98095b596..a6b227b03b 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_xml_importer.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_xml_importer.py @@ -84,7 +84,7 @@ def modulestore(): options.update(ModuleStoreNoSettings.MODULESTORE['OPTIONS']) options['render_template'] = render_to_template_mock - # pylint: disable=W0142 + # pylint: disable=star-args ModuleStoreNoSettings.modulestore = class_( None, # contentstore ModuleStoreNoSettings.MODULESTORE['DOC_STORE_CONFIG'], @@ -95,7 +95,7 @@ def modulestore(): return ModuleStoreNoSettings.modulestore -# pylint: disable=W0613 +# pylint: disable=unused-argument def render_to_template_mock(*args): pass diff --git a/common/lib/xmodule/xmodule/modulestore/xml_importer.py b/common/lib/xmodule/xmodule/modulestore/xml_importer.py index 92a0bb28bd..4f89249415 100644 --- a/common/lib/xmodule/xmodule/modulestore/xml_importer.py +++ b/common/lib/xmodule/xmodule/modulestore/xml_importer.py @@ -605,7 +605,7 @@ def _import_course_draft( drafts.append(draft) - except Exception: # pylint: disable=W0703 + except Exception: # pylint: disable=broad-except logging.exception('Error while parsing course xml.') # sort drafts by `index_in_children_list` attribute @@ -614,7 +614,7 @@ def _import_course_draft( for draft in get_draft_subtree_roots(drafts): try: _import_module(draft.module) - except Exception: # pylint: disable=W0703 + except Exception: # pylint: disable=broad-except logging.exception('while importing draft descriptor %s', draft.module) diff --git a/common/lib/xmodule/xmodule/static_content.py b/common/lib/xmodule/xmodule/static_content.py index aabddf721a..a9b4512b0d 100755 --- a/common/lib/xmodule/xmodule/static_content.py +++ b/common/lib/xmodule/xmodule/static_content.py @@ -171,7 +171,7 @@ def _write_files(output_root, contents, generated_suffix_map=None): # not_file is included to short-circuit this check, because # read_md5 depends on the file already existing - write_file = not_file or output_file.read_md5() != hashlib.md5(file_content).digest() # pylint: disable=E1121 + write_file = not_file or output_file.read_md5() != hashlib.md5(file_content).digest() # pylint: disable=too-many-function-args if write_file: LOG.debug("Writing %s", output_file) output_file.write_bytes(file_content) diff --git a/common/lib/xmodule/xmodule/studio_editable.py b/common/lib/xmodule/xmodule/studio_editable.py index da29b19c6a..5b173ecbab 100644 --- a/common/lib/xmodule/xmodule/studio_editable.py +++ b/common/lib/xmodule/xmodule/studio_editable.py @@ -19,10 +19,10 @@ class StudioEditableModule(object): """ contents = [] - for child in self.descriptor.get_children(): # pylint: disable=E1101 + for child in self.descriptor.get_children(): # pylint: disable=no-member if can_reorder: context['reorderable_items'].add(child.location) - child_module = self.system.get_module(child) # pylint: disable=E1101 + child_module = self.system.get_module(child) # pylint: disable=no-member rendered_child = child_module.render(StudioEditableModule.get_preview_view_name(child_module), context) fragment.add_frag_resources(rendered_child) @@ -31,7 +31,7 @@ class StudioEditableModule(object): 'content': rendered_child.content }) - fragment.add_content(self.system.render_template("studio_render_children_view.html", { # pylint: disable=E1101 + fragment.add_content(self.system.render_template("studio_render_children_view.html", { # pylint: disable=no-member 'items': contents, 'xblock_context': context, 'can_add': can_add, diff --git a/common/lib/xmodule/xmodule/tests/test_capa_module.py b/common/lib/xmodule/xmodule/tests/test_capa_module.py index 045af6d390..65213e58f0 100644 --- a/common/lib/xmodule/xmodule/tests/test_capa_module.py +++ b/common/lib/xmodule/xmodule/tests/test_capa_module.py @@ -2,10 +2,8 @@ """ Tests of the Capa XModule """ -# pylint: disable=C0111 -# pylint: disable=R0904 -# pylint: disable=C0103 -# pylint: disable=C0302 +# pylint: disable=missing-docstring +# pylint: disable=invalid-name import datetime import json @@ -603,7 +601,7 @@ class CapaModuleTest(unittest.TestCase): def test_check_problem_with_files(self): # Check a problem with uploaded files, using the check_problem API. - # pylint: disable=W0212 + # pylint: disable=protected-access # The files we'll be uploading. fnames = ["prog1.py", "prog2.py", "prog3.py"] @@ -652,7 +650,7 @@ class CapaModuleTest(unittest.TestCase): def test_check_problem_with_files_as_xblock(self): # Check a problem with uploaded files, using the XBlock API. - # pylint: disable=W0212 + # pylint: disable=protected-access # The files we'll be uploading. fnames = ["prog1.py", "prog2.py", "prog3.py"] diff --git a/common/lib/xmodule/xmodule/tests/test_import.py b/common/lib/xmodule/xmodule/tests/test_import.py index 2d7518b1c6..079b73f81c 100644 --- a/common/lib/xmodule/xmodule/tests/test_import.py +++ b/common/lib/xmodule/xmodule/tests/test_import.py @@ -206,7 +206,7 @@ class ImportTestCase(BaseCourseTestCase): descriptor = system.process_xml(start_xml) compute_inherited_metadata(descriptor) - # pylint: disable=W0212 + # pylint: disable=protected-access print(descriptor, descriptor._field_data) self.assertEqual(descriptor.due, ImportTestCase.date.from_json(v)) @@ -296,7 +296,7 @@ class ImportTestCase(BaseCourseTestCase): '''.format(due=course_due, org=ORG, course=COURSE, url_name=url_name) descriptor = system.process_xml(start_xml) child = descriptor.get_children()[0] - # pylint: disable=W0212 + # pylint: disable=protected-access child._field_data.set(child, 'due', child_due) compute_inherited_metadata(descriptor) diff --git a/common/lib/xmodule/xmodule/tests/test_progress.py b/common/lib/xmodule/xmodule/tests/test_progress.py index 74835ffc97..d821f557ad 100644 --- a/common/lib/xmodule/xmodule/tests/test_progress.py +++ b/common/lib/xmodule/xmodule/tests/test_progress.py @@ -23,12 +23,12 @@ class ProgressTest(unittest.TestCase): def test_create_object(self): # These should work: - prg1 = Progress(0, 2) # pylint: disable=W0612 - prg2 = Progress(1, 2) # pylint: disable=W0612 - prg3 = Progress(2, 2) # pylint: disable=W0612 + prg1 = Progress(0, 2) # pylint: disable=unused-variable + prg2 = Progress(1, 2) # pylint: disable=unused-variable + prg3 = Progress(2, 2) # pylint: disable=unused-variable - prg4 = Progress(2.5, 5.0) # pylint: disable=W0612 - prg5 = Progress(3.7, 12.3333) # pylint: disable=W0612 + prg4 = Progress(2.5, 5.0) # pylint: disable=unused-variable + prg5 = Progress(3.7, 12.3333) # pylint: disable=unused-variable # These shouldn't self.assertRaises(ValueError, Progress, 0, 0) diff --git a/common/lib/xmodule/xmodule/tests/test_stringify.py b/common/lib/xmodule/xmodule/tests/test_stringify.py index 10abaf72f5..1aacfc0dc9 100644 --- a/common/lib/xmodule/xmodule/tests/test_stringify.py +++ b/common/lib/xmodule/xmodule/tests/test_stringify.py @@ -1,4 +1,7 @@ -from nose.tools import assert_equals # pylint: disable=E0611 +""" +Tests stringify functions used in xmodule html +""" +from nose.tools import assert_equals # pylint: disable=no-name-in-module from lxml import etree from xmodule.stringify import stringify_children diff --git a/common/lib/xmodule/xmodule/tests/test_textannotation.py b/common/lib/xmodule/xmodule/tests/test_textannotation.py index 23d41a659b..7d0e664cdc 100644 --- a/common/lib/xmodule/xmodule/tests/test_textannotation.py +++ b/common/lib/xmodule/xmodule/tests/test_textannotation.py @@ -60,12 +60,12 @@ class TextAnnotationModuleTestCase(unittest.TestCase): xmltree = etree.fromstring(self.sample_xml) expected_xml = u"

Test Instructions.

" - actual_xml = self.mod._extract_instructions(xmltree) # pylint: disable=W0212 + actual_xml = self.mod._extract_instructions(xmltree) # pylint: disable=protected-access self.assertIsNotNone(actual_xml) self.assertEqual(expected_xml.strip(), actual_xml.strip()) xmltree = etree.fromstring('foo') - actual = self.mod._extract_instructions(xmltree) # pylint: disable=W0212 + actual = self.mod._extract_instructions(xmltree) # pylint: disable=protected-access self.assertIsNone(actual) def test_student_view(self): diff --git a/common/lib/xmodule/xmodule/tests/test_video.py b/common/lib/xmodule/xmodule/tests/test_video.py index f27cb6c2dc..f92c3f9cb1 100644 --- a/common/lib/xmodule/xmodule/tests/test_video.py +++ b/common/lib/xmodule/xmodule/tests/test_video.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# pylint: disable=W0212 +# pylint: disable=protected-access """Test for Video Xmodule functional logic. These test data read from xml, not from mongo. diff --git a/common/lib/xmodule/xmodule/tests/test_videoannotation.py b/common/lib/xmodule/xmodule/tests/test_videoannotation.py index 18630344b6..075cee71df 100644 --- a/common/lib/xmodule/xmodule/tests/test_videoannotation.py +++ b/common/lib/xmodule/xmodule/tests/test_videoannotation.py @@ -56,12 +56,12 @@ class VideoAnnotationModuleTestCase(unittest.TestCase): xmltree = etree.fromstring(self.sample_xml) expected_xml = u"

Video Test Instructions.

" - actual_xml = self.mod._extract_instructions(xmltree) # pylint: disable=W0212 + actual_xml = self.mod._extract_instructions(xmltree) # pylint: disable=protected-access self.assertIsNotNone(actual_xml) self.assertEqual(expected_xml.strip(), actual_xml.strip()) xmltree = etree.fromstring('foo') - actual = self.mod._extract_instructions(xmltree) # pylint: disable=W0212 + actual = self.mod._extract_instructions(xmltree) # pylint: disable=protected-access self.assertIsNone(actual) def test_get_extension(self): @@ -71,8 +71,8 @@ class VideoAnnotationModuleTestCase(unittest.TestCase): """ expectedyoutube = 'video/youtube' expectednotyoutube = 'video/mp4' - result1 = self.mod._get_extension(self.sample_sourceurl) # pylint: disable=W0212 - result2 = self.mod._get_extension(self.sample_youtubeurl) # pylint: disable=W0212 + result1 = self.mod._get_extension(self.sample_sourceurl) # pylint: disable=protected-access + result2 = self.mod._get_extension(self.sample_youtubeurl) # pylint: disable=protected-access self.assertEqual(expectedyoutube, result2) self.assertEqual(expectednotyoutube, result1) diff --git a/common/lib/xmodule/xmodule/tests/test_xml_module.py b/common/lib/xmodule/xmodule/tests/test_xml_module.py index dcdabcf433..1d85d428b0 100644 --- a/common/lib/xmodule/xmodule/tests/test_xml_module.py +++ b/common/lib/xmodule/xmodule/tests/test_xml_module.py @@ -1,10 +1,10 @@ # disable missing docstring -# pylint: disable=C0111 +# pylint: disable=missing-docstring import unittest from mock import Mock -from nose.tools import assert_equals, assert_not_equals, assert_true, assert_false, assert_in, assert_not_in # pylint: disable=E0611 +from nose.tools import assert_equals, assert_not_equals, assert_true, assert_false, assert_in, assert_not_in # pylint: disable=no-name-in-module from xblock.field_data import DictFieldData from xblock.fields import Scope, String, Dict, Boolean, Integer, Float, Any, List diff --git a/common/lib/xmodule/xmodule/video_module/__init__.py b/common/lib/xmodule/xmodule/video_module/__init__.py index 3fba59844a..9aa96ecee9 100644 --- a/common/lib/xmodule/xmodule/video_module/__init__.py +++ b/common/lib/xmodule/xmodule/video_module/__init__.py @@ -3,7 +3,7 @@ Container for video module and it's utils. """ # Disable wildcard-import warnings. -# pylint: disable=W0401 +# pylint: disable=wildcard-import from .transcripts_utils import * from .video_utils import * diff --git a/common/lib/xmodule/xmodule/video_module/transcripts_utils.py b/common/lib/xmodule/xmodule/video_module/transcripts_utils.py index 857cc6b5d2..e38dcd9fec 100644 --- a/common/lib/xmodule/xmodule/video_module/transcripts_utils.py +++ b/common/lib/xmodule/xmodule/video_module/transcripts_utils.py @@ -19,19 +19,19 @@ from xmodule.contentstore.django import contentstore log = logging.getLogger(__name__) -class TranscriptException(Exception): # pylint disable=C0111 +class TranscriptException(Exception): # pylint: disable=missing-docstring pass -class TranscriptsGenerationException(Exception): # pylint disable=C0111 +class TranscriptsGenerationException(Exception): # pylint: disable=missing-docstring pass -class GetTranscriptsFromYouTubeException(Exception): # pylint disable=C0111 +class GetTranscriptsFromYouTubeException(Exception): # pylint: disable=missing-docstring pass -class TranscriptsRequestValidationException(Exception): # pylint disable=C0111 +class TranscriptsRequestValidationException(Exception): # pylint: disable=missing-docstring pass diff --git a/common/lib/xmodule/xmodule/video_module/video_handlers.py b/common/lib/xmodule/xmodule/video_module/video_handlers.py index 27e81a3ad9..8ee66581ae 100644 --- a/common/lib/xmodule/xmodule/video_module/video_handlers.py +++ b/common/lib/xmodule/xmodule/video_module/video_handlers.py @@ -30,7 +30,7 @@ log = logging.getLogger(__name__) # Disable no-member warning: -# pylint: disable=E1101 +# pylint: disable=no-member class VideoStudentViewHandlers(object): diff --git a/common/lib/xmodule/xmodule/video_module/video_module.py b/common/lib/xmodule/xmodule/video_module/video_module.py index c05cf4ec16..a9b093590d 100644 --- a/common/lib/xmodule/xmodule/video_module/video_module.py +++ b/common/lib/xmodule/xmodule/video_module/video_module.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# pylint: disable=W0223 +# pylint: disable=abstract-method """Video is ungraded Xmodule for support video content. It's new improved video module, which support additional feature: diff --git a/common/test/acceptance/tests/discussion/test_cohorts.py b/common/test/acceptance/tests/discussion/test_cohorts.py index 482a35e34d..0fed9573a6 100644 --- a/common/test/acceptance/tests/discussion/test_cohorts.py +++ b/common/test/acceptance/tests/discussion/test_cohorts.py @@ -70,10 +70,10 @@ class DiscussionTabSingleThreadTest(UniqueCourseTest): AutoAuthPage(self.browser, course_id=self.course_id).visit() def setup_thread_page(self, thread_id): - self.thread_page = DiscussionTabSingleThreadPage(self.browser, self.course_id, thread_id) # pylint:disable=W0201 + self.thread_page = DiscussionTabSingleThreadPage(self.browser, self.course_id, thread_id) # pylint: disable=attribute-defined-outside-init self.thread_page.visit() - # pylint:disable=W0613 + # pylint: disable=unused-argument def refresh_thread_page(self, thread_id): self.browser.refresh() self.thread_page.wait_for_page() @@ -129,7 +129,7 @@ class InlineDiscussionTest(UniqueCourseTest): discussion_page = InlineDiscussionPage(self.browser, self.discussion_id) discussion_page.expand_discussion() self.assertEqual(discussion_page.get_num_displayed_threads(), 1) - self.thread_page = InlineDiscussionThreadPage(self.browser, thread_id) # pylint:disable=W0201 + self.thread_page = InlineDiscussionThreadPage(self.browser, thread_id) # pylint: disable=attribute-defined-outside-init self.thread_page.expand() def refresh_thread_page(self, thread_id): diff --git a/common/test/acceptance/tests/discussion/test_discussion.py b/common/test/acceptance/tests/discussion/test_discussion.py index c4dae8872a..7d8f188f6a 100644 --- a/common/test/acceptance/tests/discussion/test_discussion.py +++ b/common/test/acceptance/tests/discussion/test_discussion.py @@ -127,7 +127,7 @@ class DiscussionTabSingleThreadTest(UniqueCourseTest, DiscussionResponsePaginati AutoAuthPage(self.browser, course_id=self.course_id).visit() def setup_thread_page(self, thread_id): - self.thread_page = DiscussionTabSingleThreadPage(self.browser, self.course_id, thread_id) # pylint:disable=W0201 + self.thread_page = DiscussionTabSingleThreadPage(self.browser, self.course_id, thread_id) # pylint: disable=attribute-defined-outside-init self.thread_page.visit() def test_marked_answer_comments(self): @@ -318,7 +318,7 @@ class InlineDiscussionTest(UniqueCourseTest, DiscussionResponsePaginationTestMix def setup_thread_page(self, thread_id): self.discussion_page.expand_discussion() self.assertEqual(self.discussion_page.get_num_displayed_threads(), 1) - self.thread_page = InlineDiscussionThreadPage(self.browser, thread_id) # pylint:disable=W0201 + self.thread_page = InlineDiscussionThreadPage(self.browser, thread_id) # pylint: disable=attribute-defined-outside-init self.thread_page.expand() def test_initial_render(self): diff --git a/common/test/acceptance/tests/helpers.py b/common/test/acceptance/tests/helpers.py index 2fe931be96..7b833dde22 100644 --- a/common/test/acceptance/tests/helpers.py +++ b/common/test/acceptance/tests/helpers.py @@ -69,7 +69,7 @@ def load_data_str(rel_path): Load a file from the "data" directory as a string. `rel_path` is the path relative to the data directory. """ - full_path = path(__file__).abspath().dirname() / "data" / rel_path # pylint: disable=E1120 + full_path = path(__file__).abspath().dirname() / "data" / rel_path # pylint: disable=no-value-for-parameter with open(full_path) as data_file: return data_file.read() diff --git a/docs/en_us/developers/source/conf.py b/docs/en_us/developers/source/conf.py index ebe923d233..8751e46de1 100644 --- a/docs/en_us/developers/source/conf.py +++ b/docs/en_us/developers/source/conf.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# pylint: disable=C0103 -# pylint: disable=W0622 -# pylint: disable=W0212 -# pylint: disable=W0613 +# pylint: disable=invalid-name +# pylint: disable=redefined-builtin +# pylint: disable=protected-access +# pylint: disable=unused-argument import os from path import path diff --git a/docs/en_us/platform_api/source/conf.py b/docs/en_us/platform_api/source/conf.py index 9f24a19ae1..f2951c453f 100644 --- a/docs/en_us/platform_api/source/conf.py +++ b/docs/en_us/platform_api/source/conf.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -# pylint: disable=C0103 -# pylint: disable=W0622 -# pylint: disable=W0212 -# pylint: disable=W0613 +# pylint: disable=invalid-name +# pylint: disable=redefined-builtin +# pylint: disable=protected-access +# pylint: disable=unused-argument import os from path import path diff --git a/lms/djangoapps/bulk_email/forms.py b/lms/djangoapps/bulk_email/forms.py index 815df5d3a6..49fb840560 100644 --- a/lms/djangoapps/bulk_email/forms.py +++ b/lms/djangoapps/bulk_email/forms.py @@ -17,12 +17,12 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey log = logging.getLogger(__name__) -class CourseEmailTemplateForm(forms.ModelForm): # pylint: disable=R0924 +class CourseEmailTemplateForm(forms.ModelForm): # pylint: disable=incomplete-protocol """Form providing validation of CourseEmail templates.""" name = forms.CharField(required=False) - class Meta: # pylint: disable=C0111 + class Meta: # pylint: disable=missing-docstring model = CourseEmailTemplate fields = ('html_template', 'plain_template', 'name') @@ -73,10 +73,10 @@ class CourseEmailTemplateForm(forms.ModelForm): # pylint: disable=R0924 return name -class CourseAuthorizationAdminForm(forms.ModelForm): # pylint: disable=R0924 +class CourseAuthorizationAdminForm(forms.ModelForm): # pylint: disable=incomplete-protocol """Input form for email enabling, allowing us to verify data.""" - class Meta: # pylint: disable=C0111 + class Meta: # pylint: disable=missing-docstring model = CourseAuthorization def clean_course_id(self): diff --git a/lms/djangoapps/bulk_email/migrations/0008_add_course_authorizations.py b/lms/djangoapps/bulk_email/migrations/0008_add_course_authorizations.py index b200ea2bde..a24e48d6e5 100644 --- a/lms/djangoapps/bulk_email/migrations/0008_add_course_authorizations.py +++ b/lms/djangoapps/bulk_email/migrations/0008_add_course_authorizations.py @@ -92,4 +92,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['bulk_email'] \ No newline at end of file + complete_apps = ['bulk_email'] diff --git a/lms/djangoapps/bulk_email/migrations/0009_force_unique_course_ids.py b/lms/djangoapps/bulk_email/migrations/0009_force_unique_course_ids.py index 23b1dbb2a3..d4a329b727 100644 --- a/lms/djangoapps/bulk_email/migrations/0009_force_unique_course_ids.py +++ b/lms/djangoapps/bulk_email/migrations/0009_force_unique_course_ids.py @@ -87,4 +87,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['bulk_email'] \ No newline at end of file + complete_apps = ['bulk_email'] diff --git a/lms/djangoapps/bulk_email/models.py b/lms/djangoapps/bulk_email/models.py index d3ce60d750..045edd99bb 100644 --- a/lms/djangoapps/bulk_email/models.py +++ b/lms/djangoapps/bulk_email/models.py @@ -43,7 +43,7 @@ class Email(models.Model): created = models.DateTimeField(auto_now_add=True) modified = models.DateTimeField(auto_now=True) - class Meta: # pylint: disable=C0111 + class Meta: # pylint: disable=missing-docstring abstract = True @@ -141,7 +141,7 @@ class Optout(models.Model): user = models.ForeignKey(User, db_index=True, null=True) course_id = CourseKeyField(max_length=255, db_index=True) - class Meta: # pylint: disable=C0111 + class Meta: # pylint: disable=missing-docstring unique_together = ('user', 'course_id') diff --git a/lms/djangoapps/bulk_email/tasks.py b/lms/djangoapps/bulk_email/tasks.py index 3820a9be1f..c3b17339c3 100644 --- a/lms/djangoapps/bulk_email/tasks.py +++ b/lms/djangoapps/bulk_email/tasks.py @@ -252,7 +252,7 @@ def perform_delegate_email_batches(entry_id, course_id, task_input, action_name) return progress -@task(default_retry_delay=settings.BULK_EMAIL_DEFAULT_RETRY_DELAY, max_retries=settings.BULK_EMAIL_MAX_RETRIES) # pylint: disable=E1102 +@task(default_retry_delay=settings.BULK_EMAIL_DEFAULT_RETRY_DELAY, max_retries=settings.BULK_EMAIL_MAX_RETRIES) # pylint: disable=not-callable def send_course_email(entry_id, email_id, to_list, global_email_context, subtask_status_dict): """ Sends an email to a list of recipients. @@ -336,11 +336,11 @@ def send_course_email(entry_id, email_id, to_list, global_email_context, subtask # was encountered has already been updated before the retry call was made, # so we only log here. log.warning("Send-email task %s for email %s: being retried", current_task_id, email_id) - raise send_exception # pylint: disable=E0702 + raise send_exception # pylint: disable=raising-bad-type else: log.error("Send-email task %s for email %s: failed: %s", current_task_id, email_id, send_exception) update_subtask_status(entry_id, current_task_id, new_subtask_status) - raise send_exception # pylint: disable=E0702 + raise send_exception # pylint: disable=raising-bad-type # return status in a form that can be serialized by Celery into JSON: log.info("Send-email task %s for email %s: returning status %s", current_task_id, email_id, new_subtask_status) diff --git a/lms/djangoapps/bulk_email/tests/test_email.py b/lms/djangoapps/bulk_email/tests/test_email.py index 560d2c431d..0231449ceb 100644 --- a/lms/djangoapps/bulk_email/tests/test_email.py +++ b/lms/djangoapps/bulk_email/tests/test_email.py @@ -37,7 +37,7 @@ class MockCourseEmailResult(object): def get_mock_update_subtask_status(self): """Wrapper for mock email function.""" - def mock_update_subtask_status(entry_id, current_task_id, new_subtask_status): # pylint: disable=W0613 + def mock_update_subtask_status(entry_id, current_task_id, new_subtask_status): # pylint: disable=unused-argument """Increments count of number of emails sent.""" self.emails_sent += new_subtask_status.succeeded return update_subtask_status(entry_id, current_task_id, new_subtask_status) diff --git a/lms/djangoapps/bulk_email/tests/test_err_handling.py b/lms/djangoapps/bulk_email/tests/test_err_handling.py index 8dd68cf252..6734fbc9d5 100644 --- a/lms/djangoapps/bulk_email/tests/test_err_handling.py +++ b/lms/djangoapps/bulk_email/tests/test_err_handling.py @@ -173,7 +173,7 @@ class TestEmailErrors(ModuleStoreTestCase): entry = InstructorTask.create(course_id, "task_type", "task_key", "task_input", self.instructor) task_input = {"email_id": -1} with self.assertRaises(CourseEmail.DoesNotExist): - perform_delegate_email_batches(entry.id, course_id, task_input, "action_name") # pylint: disable=E1101 + perform_delegate_email_batches(entry.id, course_id, task_input, "action_name") # pylint: disable=no-member ((log_str, __, email_id), __) = mock_log.warning.call_args self.assertTrue(mock_log.warning.called) self.assertIn('Failed to get CourseEmail with id', log_str) @@ -188,10 +188,10 @@ class TestEmailErrors(ModuleStoreTestCase): email = CourseEmail(course_id=course_id) email.save() entry = InstructorTask.create(course_id, "task_type", "task_key", "task_input", self.instructor) - task_input = {"email_id": email.id} # pylint: disable=E1101 + task_input = {"email_id": email.id} # pylint: disable=no-member # (?i) is a regex for ignore case with self.assertRaisesRegexp(ValueError, r"(?i)course not found"): - perform_delegate_email_batches(entry.id, course_id, task_input, "action_name") # pylint: disable=E1101 + perform_delegate_email_batches(entry.id, course_id, task_input, "action_name") # pylint: disable=no-member def test_nonexistent_to_option(self): """ @@ -200,9 +200,9 @@ class TestEmailErrors(ModuleStoreTestCase): email = CourseEmail(course_id=self.course.id, to_option="IDONTEXIST") email.save() entry = InstructorTask.create(self.course.id, "task_type", "task_key", "task_input", self.instructor) - task_input = {"email_id": email.id} # pylint: disable=E1101 + task_input = {"email_id": email.id} # pylint: disable=no-member with self.assertRaisesRegexp(Exception, 'Unexpected bulk email TO_OPTION found: IDONTEXIST'): - perform_delegate_email_batches(entry.id, self.course.id, task_input, "action_name") # pylint: disable=E1101 + perform_delegate_email_batches(entry.id, self.course.id, task_input, "action_name") # pylint: disable=no-member def test_wrong_course_id_in_task(self): """ @@ -211,9 +211,9 @@ class TestEmailErrors(ModuleStoreTestCase): email = CourseEmail(course_id=self.course.id, to_option=SEND_TO_ALL) email.save() entry = InstructorTask.create("bogus/task/id", "task_type", "task_key", "task_input", self.instructor) - task_input = {"email_id": email.id} # pylint: disable=E1101 + task_input = {"email_id": email.id} # pylint: disable=no-member with self.assertRaisesRegexp(ValueError, 'does not match task value'): - perform_delegate_email_batches(entry.id, self.course.id, task_input, "action_name") # pylint: disable=E1101 + perform_delegate_email_batches(entry.id, self.course.id, task_input, "action_name") # pylint: disable=no-member def test_wrong_course_id_in_email(self): """ @@ -222,14 +222,14 @@ class TestEmailErrors(ModuleStoreTestCase): email = CourseEmail(course_id=SlashSeparatedCourseKey("bogus", "course", "id"), to_option=SEND_TO_ALL) email.save() entry = InstructorTask.create(self.course.id, "task_type", "task_key", "task_input", self.instructor) - task_input = {"email_id": email.id} # pylint: disable=E1101 + task_input = {"email_id": email.id} # pylint: disable=no-member with self.assertRaisesRegexp(ValueError, 'does not match email value'): - perform_delegate_email_batches(entry.id, self.course.id, task_input, "action_name") # pylint: disable=E1101 + perform_delegate_email_batches(entry.id, self.course.id, task_input, "action_name") # pylint: disable=no-member def test_send_email_undefined_subtask(self): # test at a lower level, to ensure that the course gets checked down below too. entry = InstructorTask.create(self.course.id, "task_type", "task_key", "task_input", self.instructor) - entry_id = entry.id # pylint: disable=E1101 + entry_id = entry.id # pylint: disable=no-member to_list = ['test@test.com'] global_email_context = {'course_title': 'dummy course'} subtask_id = "subtask-id-value" @@ -241,7 +241,7 @@ class TestEmailErrors(ModuleStoreTestCase): def test_send_email_missing_subtask(self): # test at a lower level, to ensure that the course gets checked down below too. entry = InstructorTask.create(self.course.id, "task_type", "task_key", "task_input", self.instructor) - entry_id = entry.id # pylint: disable=E1101 + entry_id = entry.id # pylint: disable=no-member to_list = ['test@test.com'] global_email_context = {'course_title': 'dummy course'} subtask_id = "subtask-id-value" @@ -255,7 +255,7 @@ class TestEmailErrors(ModuleStoreTestCase): def test_send_email_completed_subtask(self): # test at a lower level, to ensure that the course gets checked down below too. entry = InstructorTask.create(self.course.id, "task_type", "task_key", "task_input", self.instructor) - entry_id = entry.id # pylint: disable=E1101 + entry_id = entry.id # pylint: disable=no-member subtask_id = "subtask-id-value" initialize_subtask_info(entry, "emailed", 100, [subtask_id]) subtask_status = SubtaskStatus.create(subtask_id, state=SUCCESS) @@ -270,7 +270,7 @@ class TestEmailErrors(ModuleStoreTestCase): def test_send_email_running_subtask(self): # test at a lower level, to ensure that the course gets checked down below too. entry = InstructorTask.create(self.course.id, "task_type", "task_key", "task_input", self.instructor) - entry_id = entry.id # pylint: disable=E1101 + entry_id = entry.id # pylint: disable=no-member subtask_id = "subtask-id-value" initialize_subtask_info(entry, "emailed", 100, [subtask_id]) subtask_status = SubtaskStatus.create(subtask_id) @@ -285,7 +285,7 @@ class TestEmailErrors(ModuleStoreTestCase): def test_send_email_retried_subtask(self): # test at a lower level, to ensure that the course gets checked down below too. entry = InstructorTask.create(self.course.id, "task_type", "task_key", "task_input", self.instructor) - entry_id = entry.id # pylint: disable=E1101 + entry_id = entry.id # pylint: disable=no-member subtask_id = "subtask-id-value" initialize_subtask_info(entry, "emailed", 100, [subtask_id]) subtask_status = SubtaskStatus.create(subtask_id, state=RETRY, retried_nomax=2) @@ -305,7 +305,7 @@ class TestEmailErrors(ModuleStoreTestCase): def test_send_email_with_locked_instructor_task(self): # test at a lower level, to ensure that the course gets checked down below too. entry = InstructorTask.create(self.course.id, "task_type", "task_key", "task_input", self.instructor) - entry_id = entry.id # pylint: disable=E1101 + entry_id = entry.id # pylint: disable=no-member subtask_id = "subtask-id-locked-model" initialize_subtask_info(entry, "emailed", 100, [subtask_id]) subtask_status = SubtaskStatus.create(subtask_id) @@ -321,7 +321,7 @@ class TestEmailErrors(ModuleStoreTestCase): def test_send_email_undefined_email(self): # test at a lower level, to ensure that the course gets checked down below too. entry = InstructorTask.create(self.course.id, "task_type", "task_key", "task_input", self.instructor) - entry_id = entry.id # pylint: disable=E1101 + entry_id = entry.id # pylint: disable=no-member to_list = ['test@test.com'] global_email_context = {'course_title': 'dummy course'} subtask_id = "subtask-id-undefined-email" diff --git a/lms/djangoapps/bulk_email/tests/test_tasks.py b/lms/djangoapps/bulk_email/tests/test_tasks.py index dbc61fcec1..d2b00e0327 100644 --- a/lms/djangoapps/bulk_email/tests/test_tasks.py +++ b/lms/djangoapps/bulk_email/tests/test_tasks.py @@ -91,7 +91,7 @@ class TestBulkEmailInstructorTask(InstructorTaskCourseTestCase): to_option = SEND_TO_ALL course_id = course_id or self.course.id course_email = CourseEmail.create(course_id, self.instructor, to_option, "Test Subject", "

This is a test message

") - task_input = {'email_id': course_email.id} # pylint: disable=E1101 + task_input = {'email_id': course_email.id} # pylint: disable=no-member task_id = str(uuid4()) instructor_task = InstructorTaskFactory.create( course_id=course_id, @@ -134,7 +134,7 @@ class TestBulkEmailInstructorTask(InstructorTaskCourseTestCase): with self.assertRaises(ValueError): with patch('bulk_email.tasks.update_subtask_status', dummy_update_subtask_status): - send_bulk_course_email(task_entry.id, {}) # pylint: disable=E1101 + send_bulk_course_email(task_entry.id, {}) # pylint: disable=no-member def _create_students(self, num_students): """Create students for testing""" diff --git a/lms/djangoapps/certificates/migrations/0015_adding_mode_for_verified_certs.py b/lms/djangoapps/certificates/migrations/0015_adding_mode_for_verified_certs.py index c16d51b8ee..4423f4e226 100644 --- a/lms/djangoapps/certificates/migrations/0015_adding_mode_for_verified_certs.py +++ b/lms/djangoapps/certificates/migrations/0015_adding_mode_for_verified_certs.py @@ -83,4 +83,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['certificates'] \ No newline at end of file + complete_apps = ['certificates'] diff --git a/lms/djangoapps/certificates/tests/factories.py b/lms/djangoapps/certificates/tests/factories.py index 38527f92c4..d800032f66 100644 --- a/lms/djangoapps/certificates/tests/factories.py +++ b/lms/djangoapps/certificates/tests/factories.py @@ -5,8 +5,8 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey from certificates.models import GeneratedCertificate, CertificateStatuses -# Factories don't have __init__ methods, and are self documenting -# pylint: disable=W0232 +# Factories are self documenting +# pylint: disable=missing-docstring class GeneratedCertificateFactory(DjangoModelFactory): FACTORY_FOR = GeneratedCertificate diff --git a/lms/djangoapps/course_wiki/middleware.py b/lms/djangoapps/course_wiki/middleware.py index 0d276e1cfc..ba824f305f 100644 --- a/lms/djangoapps/course_wiki/middleware.py +++ b/lms/djangoapps/course_wiki/middleware.py @@ -35,7 +35,7 @@ class WikiAccessMiddleware(object): # Even though we came from the course, we can't see it. So don't worry about it. pass - def process_view(self, request, view_func, view_args, view_kwargs): # pylint: disable=W0613 + def process_view(self, request, view_func, view_args, view_kwargs): # pylint: disable=unused-argument """ This function handles authentication logic for wiki urls and redirects from the "root wiki" to the "course wiki" if the user accesses the wiki from a course url @@ -98,5 +98,5 @@ class WikiAccessMiddleware(object): response = self._redirect_from_referrer(request, wiki_path) or response # END HACK: _transform_url must be set to a no-op function after it's done its work - reverse._transform_url = lambda url: url # pylint: disable=W0212 + reverse._transform_url = lambda url: url # pylint: disable=protected-access return response diff --git a/lms/djangoapps/course_wiki/tests/test_access.py b/lms/djangoapps/course_wiki/tests/test_access.py index c4bf9e5091..04cbe0e62c 100644 --- a/lms/djangoapps/course_wiki/tests/test_access.py +++ b/lms/djangoapps/course_wiki/tests/test_access.py @@ -141,7 +141,7 @@ class TestWikiAccessForNumericalCourseNumber(TestWikiAccessBase): wiki_200_page_page = self.create_urlpath(wiki_200_page, 'Grandchild') self.wiki_200_pages = [wiki_200, wiki_200_page, wiki_200_page_page] - def test_course_staff_is_course_wiki_staff_for_numerical_course_number(self): # pylint: disable=C0103 + def test_course_staff_is_course_wiki_staff_for_numerical_course_number(self): # pylint: disable=invalid-name for page in self.wiki_200_pages: for course_staff in self.course_200_staff: self.assertTrue(user_is_article_course_staff(course_staff, page.article)) diff --git a/lms/djangoapps/course_wiki/views.py b/lms/djangoapps/course_wiki/views.py index c7a97fd077..3bcdfa1fe6 100644 --- a/lms/djangoapps/course_wiki/views.py +++ b/lms/djangoapps/course_wiki/views.py @@ -21,7 +21,7 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey log = logging.getLogger(__name__) -def root_create(request): # pylint: disable=W0613 +def root_create(request): # pylint: disable=unused-argument """ In the edX wiki, we don't show the root_create view. Instead, we just create the root automatically if it doesn't exist. @@ -30,7 +30,7 @@ def root_create(request): # pylint: disable=W0613 return redirect('wiki:get', path=root.path) -def course_wiki_redirect(request, course_id): # pylint: disable=W0613 +def course_wiki_redirect(request, course_id): # pylint: disable=unused-argument """ This redirects to whatever page on the wiki that the course designates as it's home page. A course's wiki must be an article on the root (for @@ -58,7 +58,7 @@ def course_wiki_redirect(request, course_id): # pylint: disable=W0613 new_site.domain = settings.SITE_NAME new_site.name = "edX" new_site.save() - site_id = str(new_site.id) # pylint: disable=E1101 + site_id = str(new_site.id) # pylint: disable=no-member if site_id != str(settings.SITE_ID): raise ImproperlyConfigured("No site object was created and the SITE_ID doesn't match the newly created one. {} != {}".format(site_id, settings.SITE_ID)) diff --git a/lms/djangoapps/courseware/features/certificates.py b/lms/djangoapps/courseware/features/certificates.py index ed283587cf..5c65225b14 100644 --- a/lms/djangoapps/courseware/features/certificates.py +++ b/lms/djangoapps/courseware/features/certificates.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step from lettuce.django import django_url diff --git a/lms/djangoapps/courseware/features/common.py b/lms/djangoapps/courseware/features/common.py index dde91c69b5..b6eebe7b9e 100644 --- a/lms/djangoapps/courseware/features/common.py +++ b/lms/djangoapps/courseware/features/common.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from __future__ import absolute_import diff --git a/lms/djangoapps/courseware/features/conditional.py b/lms/djangoapps/courseware/features/conditional.py index de7d5fb7a5..2fab88f253 100644 --- a/lms/djangoapps/courseware/features/conditional.py +++ b/lms/djangoapps/courseware/features/conditional.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, steps from nose.tools import assert_in, assert_true # pylint: disable=no-name-in-module diff --git a/lms/djangoapps/courseware/features/courseware.py b/lms/djangoapps/courseware/features/courseware.py index b169095a6e..91de6ffe70 100644 --- a/lms/djangoapps/courseware/features/courseware.py +++ b/lms/djangoapps/courseware/features/courseware.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step from lettuce.django import django_url diff --git a/lms/djangoapps/courseware/features/courseware_common.py b/lms/djangoapps/courseware/features/courseware_common.py index fdc6dd2617..fb6dff6aa6 100644 --- a/lms/djangoapps/courseware/features/courseware_common.py +++ b/lms/djangoapps/courseware/features/courseware_common.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name # pylint: disable=unused-argument from lettuce import world, step diff --git a/lms/djangoapps/courseware/features/events.py b/lms/djangoapps/courseware/features/events.py index 4f0d9adccf..eefd0e1b92 100644 --- a/lms/djangoapps/courseware/features/events.py +++ b/lms/djangoapps/courseware/features/events.py @@ -1,4 +1,4 @@ -# pylint: disable=C0111 +# pylint: disable=missing-docstring from lettuce import step from lettuce import world diff --git a/lms/djangoapps/courseware/features/homepage.py b/lms/djangoapps/courseware/features/homepage.py index 3c17ed4f3c..d10ec77f25 100644 --- a/lms/djangoapps/courseware/features/homepage.py +++ b/lms/djangoapps/courseware/features/homepage.py @@ -1,8 +1,8 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step -from nose.tools import assert_equals, assert_greater # pylint: disable=E0611 +from nose.tools import assert_equals, assert_greater # pylint: disable=no-name-in-module @step(u'I should see the following links and ids') diff --git a/lms/djangoapps/courseware/features/login.py b/lms/djangoapps/courseware/features/login.py index 6d4ed75f54..0881a81eea 100644 --- a/lms/djangoapps/courseware/features/login.py +++ b/lms/djangoapps/courseware/features/login.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import step, world from django.contrib.auth.models import User diff --git a/lms/djangoapps/courseware/features/lti.py b/lms/djangoapps/courseware/features/lti.py index d64f734bc9..2df7ea3de1 100644 --- a/lms/djangoapps/courseware/features/lti.py +++ b/lms/djangoapps/courseware/features/lti.py @@ -1,4 +1,4 @@ -# pylint: disable=C0111 +# pylint: disable=missing-docstring import datetime import os import pytz diff --git a/lms/djangoapps/courseware/features/navigation.py b/lms/djangoapps/courseware/features/navigation.py index 5c7f18c412..72eb109a7a 100644 --- a/lms/djangoapps/courseware/features/navigation.py +++ b/lms/djangoapps/courseware/features/navigation.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step from common import course_location diff --git a/lms/djangoapps/courseware/features/openended.py b/lms/djangoapps/courseware/features/openended.py index 15122b7855..2b517c40fe 100644 --- a/lms/djangoapps/courseware/features/openended.py +++ b/lms/djangoapps/courseware/features/openended.py @@ -1,9 +1,9 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step from lettuce.django import django_url -from nose.tools import assert_equals, assert_in # pylint: disable=E0611 +from nose.tools import assert_equals, assert_in # pylint: disable=no-name-in-module from logging import getLogger logger = getLogger(__name__) diff --git a/lms/djangoapps/courseware/features/problems.py b/lms/djangoapps/courseware/features/problems.py index 3d578044ff..40ac5f790e 100644 --- a/lms/djangoapps/courseware/features/problems.py +++ b/lms/djangoapps/courseware/features/problems.py @@ -2,8 +2,8 @@ Steps for problem.feature lettuce tests ''' -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step from common import i_am_registered_for_the_course, visit_scenario_item diff --git a/lms/djangoapps/courseware/features/problems_setup.py b/lms/djangoapps/courseware/features/problems_setup.py index 15dfbb29f7..1036eaa2c1 100644 --- a/lms/djangoapps/courseware/features/problems_setup.py +++ b/lms/djangoapps/courseware/features/problems_setup.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name # EVERY PROBLEM TYPE MUST HAVE THE FOLLOWING: # -Section in Dictionary containing: diff --git a/lms/djangoapps/courseware/features/registration.py b/lms/djangoapps/courseware/features/registration.py index 12bbe26ee5..5b8f3c6250 100644 --- a/lms/djangoapps/courseware/features/registration.py +++ b/lms/djangoapps/courseware/features/registration.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step from lettuce.django import django_url diff --git a/lms/djangoapps/courseware/features/signup.py b/lms/djangoapps/courseware/features/signup.py index 0113662327..5f35a40e9a 100644 --- a/lms/djangoapps/courseware/features/signup.py +++ b/lms/djangoapps/courseware/features/signup.py @@ -1,5 +1,5 @@ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step diff --git a/lms/djangoapps/courseware/features/video.py b/lms/djangoapps/courseware/features/video.py index 889a77b9d1..672c6648cb 100644 --- a/lms/djangoapps/courseware/features/video.py +++ b/lms/djangoapps/courseware/features/video.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# pylint: disable=C0111 +# pylint: disable=missing-docstring from lettuce import world, step, before, after import json diff --git a/lms/djangoapps/courseware/features/word_cloud.py b/lms/djangoapps/courseware/features/word_cloud.py index 90f6f6e8b5..fa0ea081a8 100644 --- a/lms/djangoapps/courseware/features/word_cloud.py +++ b/lms/djangoapps/courseware/features/word_cloud.py @@ -1,4 +1,4 @@ -# pylint: disable=C0111 +# pylint: disable=missing-docstring from time import sleep diff --git a/lms/djangoapps/courseware/management/commands/clean_history.py b/lms/djangoapps/courseware/management/commands/clean_history.py index 2a3a28592f..6478c07568 100644 --- a/lms/djangoapps/courseware/management/commands/clean_history.py +++ b/lms/djangoapps/courseware/management/commands/clean_history.py @@ -81,7 +81,7 @@ class StudentModuleHistoryCleaner(object): for smid in self.module_ids_to_check(batch_size): try: self.clean_one_student_module(smid) - except Exception: # pylint: disable=W0703 + except Exception: # pylint: disable=broad-except trace = traceback.format_exc() self.say("Couldn't clean student_module_id {}:\n{}".format(smid, trace)) if not self.dry_run: diff --git a/lms/djangoapps/courseware/migrations/0006_create_student_module_history.py b/lms/djangoapps/courseware/migrations/0006_create_student_module_history.py index 8bf40cfb20..c1243510b7 100644 --- a/lms/djangoapps/courseware/migrations/0006_create_student_module_history.py +++ b/lms/djangoapps/courseware/migrations/0006_create_student_module_history.py @@ -106,4 +106,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['courseware'] \ No newline at end of file + complete_apps = ['courseware'] diff --git a/lms/djangoapps/courseware/migrations/0007_allow_null_version_in_history.py b/lms/djangoapps/courseware/migrations/0007_allow_null_version_in_history.py index f6204294c4..4b459c1655 100644 --- a/lms/djangoapps/courseware/migrations/0007_allow_null_version_in_history.py +++ b/lms/djangoapps/courseware/migrations/0007_allow_null_version_in_history.py @@ -97,4 +97,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['courseware'] \ No newline at end of file + complete_apps = ['courseware'] diff --git a/lms/djangoapps/courseware/migrations/0008_add_xmodule_storage.py b/lms/djangoapps/courseware/migrations/0008_add_xmodule_storage.py index 0d89471fff..edbbc42753 100644 --- a/lms/djangoapps/courseware/migrations/0008_add_xmodule_storage.py +++ b/lms/djangoapps/courseware/migrations/0008_add_xmodule_storage.py @@ -182,4 +182,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['courseware'] \ No newline at end of file + complete_apps = ['courseware'] diff --git a/lms/djangoapps/courseware/migrations/0009_add_field_default.py b/lms/djangoapps/courseware/migrations/0009_add_field_default.py index cd885ee7a6..50be9f343b 100644 --- a/lms/djangoapps/courseware/migrations/0009_add_field_default.py +++ b/lms/djangoapps/courseware/migrations/0009_add_field_default.py @@ -125,4 +125,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['courseware'] \ No newline at end of file + complete_apps = ['courseware'] diff --git a/lms/djangoapps/courseware/migrations/0010_rename_xblock_field_content_to_user_state_summary.py b/lms/djangoapps/courseware/migrations/0010_rename_xblock_field_content_to_user_state_summary.py index 8975cb1072..d2025c36ec 100644 --- a/lms/djangoapps/courseware/migrations/0010_rename_xblock_field_content_to_user_state_summary.py +++ b/lms/djangoapps/courseware/migrations/0010_rename_xblock_field_content_to_user_state_summary.py @@ -145,4 +145,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['courseware'] \ No newline at end of file + complete_apps = ['courseware'] diff --git a/lms/djangoapps/courseware/tests/factories.py b/lms/djangoapps/courseware/tests/factories.py index 073d0085c8..c47fc54f41 100644 --- a/lms/djangoapps/courseware/tests/factories.py +++ b/lms/djangoapps/courseware/tests/factories.py @@ -1,5 +1,5 @@ -# Factories don't have __init__ methods, and are self documenting -# pylint: disable=W0232, C0111 +# Factories are self documenting +# pylint: disable=missing-docstring import json from functools import partial import factory diff --git a/lms/djangoapps/courseware/tests/test_access.py b/lms/djangoapps/courseware/tests/test_access.py index c2f6ea2b81..0963b74489 100644 --- a/lms/djangoapps/courseware/tests/test_access.py +++ b/lms/djangoapps/courseware/tests/test_access.py @@ -15,8 +15,8 @@ from xmodule.course_module import ( CATALOG_VISIBILITY_CATALOG_AND_ABOUT, CATALOG_VISIBILITY_ABOUT, CATALOG_VISIBILITY_NONE) -# pylint: disable=C0111 -# pylint: disable=W0212 +# pylint: disable=missing-docstring +# pylint: disable=protected-access class AccessTestCase(TestCase): diff --git a/lms/djangoapps/courseware/tests/test_model_data.py b/lms/djangoapps/courseware/tests/test_model_data.py index f2f3fe532b..f1a680da96 100644 --- a/lms/djangoapps/courseware/tests/test_model_data.py +++ b/lms/djangoapps/courseware/tests/test_model_data.py @@ -219,7 +219,7 @@ class StorageTestBase(object): """ # Disable pylint warnings that arise because of the way the child classes call # this base class -- pylint's static analysis can't keep up with it. - # pylint: disable=E1101, E1102 + # pylint: disable=no-member, not-callable factory = None scope = None diff --git a/lms/djangoapps/courseware/tests/test_module_render.py b/lms/djangoapps/courseware/tests/test_module_render.py index 7de4d93108..a08902eb50 100644 --- a/lms/djangoapps/courseware/tests/test_module_render.py +++ b/lms/djangoapps/courseware/tests/test_module_render.py @@ -608,7 +608,7 @@ class ViewInStudioTest(ModuleStoreTestCase): self.module = self._get_module(course.id, descriptor, descriptor.location) - # pylint: disable=W0201 + # pylint: disable=attribute-defined-outside-init self.child_module = self._get_module(course.id, child_descriptor, child_descriptor.location) def setup_xml_course(self): diff --git a/lms/djangoapps/courseware/tests/test_video_xml.py b/lms/djangoapps/courseware/tests/test_video_xml.py index 5f9c87be16..508c261c5c 100644 --- a/lms/djangoapps/courseware/tests/test_video_xml.py +++ b/lms/djangoapps/courseware/tests/test_video_xml.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# pylint: disable=W0212 +# pylint: disable=protected-access """Test for Video Xmodule functional logic. These test data read from xml, not from mongo. diff --git a/lms/djangoapps/dashboard/git_import.py b/lms/djangoapps/dashboard/git_import.py index 0e4b27bb23..d6935d2254 100644 --- a/lms/djangoapps/dashboard/git_import.py +++ b/lms/djangoapps/dashboard/git_import.py @@ -124,7 +124,7 @@ def add_repo(repo, rdir_in, branch=None): If branch is left as None, it will fetch the most recent version of the current branch. """ - # pylint: disable=R0915 + # pylint: disable=too-many-statements # Set defaults even if it isn't defined in settings mongo_db = { diff --git a/lms/djangoapps/dashboard/models.py b/lms/djangoapps/dashboard/models.py index 988214287d..2fa3e17678 100644 --- a/lms/djangoapps/dashboard/models.py +++ b/lms/djangoapps/dashboard/models.py @@ -6,7 +6,7 @@ from xmodule.modulestore.mongoengine_fields import CourseKeyField class CourseImportLog(mongoengine.Document): """Mongoengine model for git log""" - # pylint: disable=R0924 + # pylint: disable=incomplete-protocol course_id = CourseKeyField(max_length=128) # NOTE: this location is not a Location object but a pathname diff --git a/lms/djangoapps/dashboard/support.py b/lms/djangoapps/dashboard/support.py index 7ec4cb6628..02fcf6d4cd 100644 --- a/lms/djangoapps/dashboard/support.py +++ b/lms/djangoapps/dashboard/support.py @@ -18,7 +18,7 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey log = logging.getLogger(__name__) -class RefundForm(forms.Form): # pylint: disable=R0924 +class RefundForm(forms.Form): # pylint: disable=incomplete-protocol """ Form for manual refunds """ diff --git a/lms/djangoapps/dashboard/sysadmin_urls.py b/lms/djangoapps/dashboard/sysadmin_urls.py index e543537415..a762e97562 100644 --- a/lms/djangoapps/dashboard/sysadmin_urls.py +++ b/lms/djangoapps/dashboard/sysadmin_urls.py @@ -1,7 +1,7 @@ """ Urls for sysadmin dashboard feature """ -# pylint: disable=E1120 +# pylint: disable=no-value-for-parameter from django.conf.urls import patterns, url diff --git a/lms/djangoapps/dashboard/tests/test_support.py b/lms/djangoapps/dashboard/tests/test_support.py index 24a2a78890..a2173879cf 100644 --- a/lms/djangoapps/dashboard/tests/test_support.py +++ b/lms/djangoapps/dashboard/tests/test_support.py @@ -49,7 +49,7 @@ class RefundTests(ModuleStoreTestCase): Order.objects.filter(user=self.student).delete() def _enroll(self, purchase=True): - # pylint: disable=C0111 + # pylint: disable=missing-docstring CourseEnrollment.enroll(self.student, self.course_id, self.course_mode.mode_slug) if purchase: self.order = Order.get_cart_for_user(self.student) @@ -106,7 +106,7 @@ class RefundTests(ModuleStoreTestCase): pars['confirmed'] = 'true' response = self.client.post('/support/refund/', pars) self.assertTrue(response.status_code, 302) - response = self.client.get(response.get('location')) # pylint: disable=E1103 + response = self.client.get(response.get('location')) # pylint: disable=maybe-no-member self.assertContains(response, "Unenrolled %s from" % self.student) self.assertContains(response, "Refunded 1 for order id") diff --git a/lms/djangoapps/django_comment_client/base/tests.py b/lms/djangoapps/django_comment_client/base/tests.py index bf4c0fe872..3595eef348 100644 --- a/lms/djangoapps/django_comment_client/base/tests.py +++ b/lms/djangoapps/django_comment_client/base/tests.py @@ -7,7 +7,7 @@ from django.contrib.auth.models import User from django.core.management import call_command from django.core.urlresolvers import reverse from mock import patch, ANY, Mock -from nose.tools import assert_true, assert_equal # pylint: disable=E0611 +from nose.tools import assert_true, assert_equal # pylint: disable=no-name-in-module from opaque_keys.edx.locations import SlashSeparatedCourseKey from courseware.tests.modulestore_config import TEST_DATA_MONGO_MODULESTORE @@ -27,7 +27,7 @@ log = logging.getLogger(__name__) CS_PREFIX = "http://localhost:4567/api/v1" -# pylint: disable=C0111 +# pylint: disable=missing-docstring class MockRequestSetupMixin(object): diff --git a/lms/djangoapps/django_comment_client/forum/tests.py b/lms/djangoapps/django_comment_client/forum/tests.py index 2bec1572ed..9a2d3b54c0 100644 --- a/lms/djangoapps/django_comment_client/forum/tests.py +++ b/lms/djangoapps/django_comment_client/forum/tests.py @@ -21,7 +21,7 @@ from django_comment_client.utils import strip_none from courseware.tests.modulestore_config import TEST_DATA_DIR from courseware.courses import UserNotEnrolled -from nose.tools import assert_true # pylint: disable=E0611 +from nose.tools import assert_true # pylint: disable=no-name-in-module from mock import patch, Mock, ANY, call from course_groups.models import CourseUserGroup @@ -30,7 +30,7 @@ TEST_DATA_MONGO_MODULESTORE = mixed_store_config(TEST_DATA_DIR, {}, include_xml= log = logging.getLogger(__name__) -# pylint: disable=C0111 +# pylint: disable=missing-docstring @override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE) diff --git a/lms/djangoapps/django_comment_client/tests.py b/lms/djangoapps/django_comment_client/tests.py index d9f601ad0b..e5d95c7f17 100644 --- a/lms/djangoapps/django_comment_client/tests.py +++ b/lms/djangoapps/django_comment_client/tests.py @@ -1,4 +1,7 @@ -import string # pylint: disable=W0402 +""" +Tests of various permissions levels for the comment client +""" +import string # pylint: disable=deprecated-module import random from django.contrib.auth.models import User diff --git a/lms/djangoapps/django_comment_client/tests/test_utils.py b/lms/djangoapps/django_comment_client/tests/test_utils.py index 9fd36cfae5..50ffbe6381 100644 --- a/lms/djangoapps/django_comment_client/tests/test_utils.py +++ b/lms/djangoapps/django_comment_client/tests/test_utils.py @@ -113,7 +113,8 @@ class CoursewareContextTestCase(ModuleStoreTestCase): ] utils.add_courseware_context(threads, self.course) - def assertThreadCorrect(thread, discussion, expected_title): # pylint: disable=C0103 + def assertThreadCorrect(thread, discussion, expected_title): # pylint: disable=invalid-name + """Asserts that the given thread has the expected set of properties""" self.assertEqual( set(thread.keys()), set(["commentable_id", "courseware_url", "courseware_title"]) @@ -148,7 +149,7 @@ class CategoryMapTestCase(ModuleStoreTestCase): self.course.discussion_topics = {} self.course.save() self.discussion_num = 0 - self.maxDiff = None # pylint: disable=C0103 + self.maxDiff = None # pylint: disable=invalid-name def create_discussion(self, discussion_category, discussion_target, **kwargs): self.discussion_num += 1 diff --git a/lms/djangoapps/foldit/migrations/0001_initial.py b/lms/djangoapps/foldit/migrations/0001_initial.py index 6c9edfeaa4..d288e51742 100644 --- a/lms/djangoapps/foldit/migrations/0001_initial.py +++ b/lms/djangoapps/foldit/migrations/0001_initial.py @@ -108,4 +108,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['foldit'] \ No newline at end of file + complete_apps = ['foldit'] diff --git a/lms/djangoapps/instructor/features/bulk_email.py b/lms/djangoapps/instructor/features/bulk_email.py index 473851022f..90eed1ebd9 100644 --- a/lms/djangoapps/instructor/features/bulk_email.py +++ b/lms/djangoapps/instructor/features/bulk_email.py @@ -2,12 +2,12 @@ Define steps for bulk email acceptance test. """ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step from lettuce.django import mail -from nose.tools import assert_in, assert_equal # pylint: disable=E0611 +from nose.tools import assert_in, assert_equal # pylint: disable=no-name-in-module from django.core.management import call_command from django.conf import settings @@ -106,8 +106,8 @@ def when_i_send_an_email(step, recipient): # pylint: disable=unused-argument ) # Clear the queue of existing emails - while not mail.queue.empty(): # pylint: disable=E1101 - mail.queue.get() # pylint: disable=E1101 + while not mail.queue.empty(): # pylint: disable=no-member + mail.queue.get() # pylint: disable=no-member # Because we flush the database before each run, # we need to ensure that the email template fixture @@ -156,8 +156,8 @@ def then_the_email_is_sent(step, recipient): # pylint: disable=unused-argument # Retrieve messages. Because we are using celery in "always eager" # mode, we expect all messages to be sent by this point. messages = [] - while not mail.queue.empty(): # pylint: disable=E1101 - messages.append(mail.queue.get()) # pylint: disable=E1101 + while not mail.queue.empty(): # pylint: disable=no-member + messages.append(mail.queue.get()) # pylint: disable=no-member # Check that we got the right number of messages assert_equal( diff --git a/lms/djangoapps/instructor/features/common.py b/lms/djangoapps/instructor/features/common.py index 3d511b2b9b..92402d3842 100644 --- a/lms/djangoapps/instructor/features/common.py +++ b/lms/djangoapps/instructor/features/common.py @@ -2,14 +2,14 @@ Define common steps for instructor dashboard acceptance tests. """ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from __future__ import absolute_import from lettuce import world, step from mock import patch -from nose.tools import assert_in # pylint: disable=E0611 +from nose.tools import assert_in # pylint: disable=no-name-in-module from courseware.tests.factories import StaffFactory, InstructorFactory diff --git a/lms/djangoapps/instructor/features/data_download.py b/lms/djangoapps/instructor/features/data_download.py index 93aedec5ec..a8734621c6 100644 --- a/lms/djangoapps/instructor/features/data_download.py +++ b/lms/djangoapps/instructor/features/data_download.py @@ -3,11 +3,11 @@ Define steps for instructor dashboard - data download tab acceptance tests. """ -# pylint: disable=C0111 -# pylint: disable=W0621 +# pylint: disable=missing-docstring +# pylint: disable=redefined-outer-name from lettuce import world, step -from nose.tools import assert_in, assert_regexp_matches # pylint: disable=E0611 +from nose.tools import assert_in, assert_regexp_matches # pylint: disable=no-name-in-module from terrain.steps import reload_the_page from django.utils import http diff --git a/lms/djangoapps/instructor/tests/test_api.py b/lms/djangoapps/instructor/tests/test_api.py index 1ca5bba6ac..c2fc7c465e 100644 --- a/lms/djangoapps/instructor/tests/test_api.py +++ b/lms/djangoapps/instructor/tests/test_api.py @@ -2,7 +2,7 @@ """ Unit tests for instructor.api methods. """ -# pylint: disable=E1111 + import unittest import json import requests @@ -79,19 +79,19 @@ REPORTS_DATA = ( @common_exceptions_400 -def view_success(request): # pylint: disable=W0613 +def view_success(request): # pylint: disable=unused-argument "A dummy view for testing that returns a simple HTTP response" return HttpResponse('success') @common_exceptions_400 -def view_user_doesnotexist(request): # pylint: disable=W0613 +def view_user_doesnotexist(request): # pylint: disable=unused-argument "A dummy view that raises a User.DoesNotExist exception" raise User.DoesNotExist() @common_exceptions_400 -def view_alreadyrunningerror(request): # pylint: disable=W0613 +def view_alreadyrunningerror(request): # pylint: disable=unused-argument "A dummy view that raises an AlreadyRunningError exception" raise AlreadyRunningError() @@ -111,26 +111,26 @@ class TestCommonExceptions400(unittest.TestCase): def test_user_doesnotexist(self): self.request.is_ajax.return_value = False - resp = view_user_doesnotexist(self.request) + resp = view_user_doesnotexist(self.request) # pylint: disable=assignment-from-no-return self.assertEqual(resp.status_code, 400) self.assertIn("User does not exist", resp.content) def test_user_doesnotexist_ajax(self): self.request.is_ajax.return_value = True - resp = view_user_doesnotexist(self.request) + resp = view_user_doesnotexist(self.request) # pylint: disable=assignment-from-no-return self.assertEqual(resp.status_code, 400) result = json.loads(resp.content) self.assertIn("User does not exist", result["error"]) def test_alreadyrunningerror(self): self.request.is_ajax.return_value = False - resp = view_alreadyrunningerror(self.request) + resp = view_alreadyrunningerror(self.request) # pylint: disable=assignment-from-no-return self.assertEqual(resp.status_code, 400) self.assertIn("Task is already running", resp.content) def test_alreadyrunningerror_ajax(self): self.request.is_ajax.return_value = True - resp = view_alreadyrunningerror(self.request) + resp = view_alreadyrunningerror(self.request) # pylint: disable=assignment-from-no-return self.assertEqual(resp.status_code, 400) result = json.loads(resp.content) self.assertIn("Task is already running", result["error"]) @@ -569,7 +569,7 @@ class TestInstructorAPIEnrollment(ModuleStoreTestCase, LoginEnrollmentTestCase): # uncomment to enable enable printing of large diffs # from failed assertions in the event of a test failure. - # (comment because pylint C0103) + # (comment because pylint C0103(invalid-name)) # self.maxDiff = None def tearDown(self): @@ -1119,7 +1119,7 @@ class TestInstructorAPIBulkBetaEnrollment(ModuleStoreTestCase, LoginEnrollmentTe # uncomment to enable enable printing of large diffs # from failed assertions in the event of a test failure. - # (comment because pylint C0103) + # (comment because pylint C0103(invalid-name)) # self.maxDiff = None def test_missing_params(self): diff --git a/lms/djangoapps/instructor/tests/test_ecommerce.py b/lms/djangoapps/instructor/tests/test_ecommerce.py index d51e62e926..cb0dba3493 100644 --- a/lms/djangoapps/instructor/tests/test_ecommerce.py +++ b/lms/djangoapps/instructor/tests/test_ecommerce.py @@ -253,7 +253,7 @@ class TestECommerceDashboardViews(ModuleStoreTestCase): response = self.client.post(self.url) self.assertTrue('AS452' in response.content) data = { - 'coupon_id': coupon.id, 'code': 'AS452', 'discount': '10', 'description': 'updated_description', # pylint: disable=E1101 + 'coupon_id': coupon.id, 'code': 'AS452', 'discount': '10', 'description': 'updated_description', # pylint: disable=no-member 'course_id': coupon.course_id.to_deprecated_string() } # URL for update_coupon diff --git a/lms/djangoapps/instructor/tests/test_enrollment.py b/lms/djangoapps/instructor/tests/test_enrollment.py index 505d1de45f..5484912564 100644 --- a/lms/djangoapps/instructor/tests/test_enrollment.py +++ b/lms/djangoapps/instructor/tests/test_enrollment.py @@ -371,7 +371,7 @@ class SettableEnrollmentState(EmailEnrollmentState): a call to create_user will make objects which correspond to the state represented in the SettableEnrollmentState. """ - def __init__(self, user=False, enrollment=False, allowed=False, auto_enroll=False): # pylint: disable=W0231 + def __init__(self, user=False, enrollment=False, allowed=False, auto_enroll=False): # pylint: disable=super-init-not-called self.user = user self.enrollment = enrollment self.allowed = allowed diff --git a/lms/djangoapps/instructor/tests/test_hint_manager.py b/lms/djangoapps/instructor/tests/test_hint_manager.py index a3446646f7..fb35f75ab9 100644 --- a/lms/djangoapps/instructor/tests/test_hint_manager.py +++ b/lms/djangoapps/instructor/tests/test_hint_manager.py @@ -12,7 +12,7 @@ from student.tests.factories import UserFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory -# pylint: disable=C0111 +# pylint: disable=missing-docstring @override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE) diff --git a/lms/djangoapps/instructor/tests/test_legacy_xss.py b/lms/djangoapps/instructor/tests/test_legacy_xss.py index 310e9c3eb9..58bbf90765 100644 --- a/lms/djangoapps/instructor/tests/test_legacy_xss.py +++ b/lms/djangoapps/instructor/tests/test_legacy_xss.py @@ -15,7 +15,7 @@ from xmodule.modulestore.tests.factories import CourseFactory from instructor.views import legacy -# pylint: disable=C0111 +# pylint: disable=missing-docstring @override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE) diff --git a/lms/djangoapps/instructor/tests/test_tools.py b/lms/djangoapps/instructor/tests/test_tools.py index edebd19c40..b8cdc0b7bd 100644 --- a/lms/djangoapps/instructor/tests/test_tools.py +++ b/lms/djangoapps/instructor/tests/test_tools.py @@ -39,7 +39,7 @@ class TestHandleDashboardError(unittest.TestCase): Test handle_dashboard_error decorator. """ def test_error(self): - # pylint: disable=W0613 + # pylint: disable=unused-argument @tools.handle_dashboard_error def view(request, course_id): """ @@ -51,7 +51,7 @@ class TestHandleDashboardError(unittest.TestCase): self.assertEqual(response, {'error': 'Oh noes!'}) def test_no_error(self): - # pylint: disable=W0613 + # pylint: disable=unused-argument @tools.handle_dashboard_error def view(request, course_id): """ diff --git a/lms/djangoapps/instructor/views/api.py b/lms/djangoapps/instructor/views/api.py index 1f6429d28e..dfb862cf2b 100644 --- a/lms/djangoapps/instructor/views/api.py +++ b/lms/djangoapps/instructor/views/api.py @@ -23,7 +23,7 @@ from django.core.validators import validate_email from django.utils.translation import ugettext as _ from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden, HttpResponseNotFound from django.utils.html import strip_tags -import string # pylint: disable=W0402 +import string # pylint: disable=deprecated-module import random import urllib from util.json_request import JsonResponse @@ -95,7 +95,7 @@ def common_exceptions_400(func): Catches common exceptions and renders matching 400 errors. (decorator without arguments) """ - def wrapped(request, *args, **kwargs): # pylint: disable=C0111 + def wrapped(request, *args, **kwargs): # pylint: disable=missing-docstring use_json = (request.is_ajax() or request.META.get("HTTP_ACCEPT", "").startswith("application/json")) try: @@ -129,8 +129,8 @@ def require_query_params(*args, **kwargs): required_params += [(key, kwargs[key]) for key in kwargs] # required_params = e.g. [('action', 'enroll or unenroll'), ['emails', None]] - def decorator(func): # pylint: disable=C0111 - def wrapped(*args, **kwargs): # pylint: disable=C0111 + def decorator(func): # pylint: disable=missing-docstring + def wrapped(*args, **kwargs): # pylint: disable=missing-docstring request = args[0] error_response_data = { @@ -166,8 +166,8 @@ def require_post_params(*args, **kwargs): required_params += [(key, kwargs[key]) for key in kwargs] # required_params = e.g. [('action', 'enroll or unenroll'), ['emails', None]] - def decorator(func): # pylint: disable=C0111 - def wrapped(*args, **kwargs): # pylint: disable=C0111 + def decorator(func): # pylint: disable=missing-docstring + def wrapped(*args, **kwargs): # pylint: disable=missing-docstring request = args[0] error_response_data = { @@ -206,8 +206,8 @@ def require_level(level): if level not in ['instructor', 'staff']: raise ValueError("unrecognized level '{}'".format(level)) - def decorator(func): # pylint: disable=C0111 - def wrapped(*args, **kwargs): # pylint: disable=C0111 + def decorator(func): # pylint: disable=missing-docstring + def wrapped(*args, **kwargs): # pylint: disable=missing-docstring request = args[0] course = get_course_by_id(SlashSeparatedCourseKey.from_deprecated_string(kwargs['course_id'])) @@ -228,7 +228,7 @@ COUNTRY_INDEX = 3 @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') -def register_and_enroll_students(request, course_id): # pylint: disable=R0915 +def register_and_enroll_students(request, course_id): # pylint: disable=too-many-statements """ Create new account and Enroll students in this course. Passing a csv file that contains a list of students. @@ -261,7 +261,7 @@ def register_and_enroll_students(request, course_id): # pylint: disable=R0915 try: upload_file = request.FILES.get('students_list') students = [row for row in csv.reader(upload_file.read().splitlines())] - except Exception: # pylint: disable=W0703 + except Exception: # pylint: disable=broad-except general_errors.append({ 'username': '', 'email': '', 'response': _('Could not read uploaded file.') }) @@ -488,7 +488,7 @@ def students_update_enrollment(request, course_id): 'invalidIdentifier': True, }) - except Exception as exc: # pylint: disable=W0703 + except Exception as exc: # pylint: disable=broad-except # catch and log any exceptions # so that one error doesn't cause a 500. log.exception("Error while #{}ing student") @@ -747,7 +747,7 @@ def get_grading_config(request, course_id): @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') -def get_sale_records(request, course_id, csv=False): # pylint: disable=W0613, W0621 +def get_sale_records(request, course_id, csv=False): # pylint: disable=unused-argument, redefined-outer-name """ return the summary of all sales records for a particular course """ @@ -778,7 +778,7 @@ def get_sale_records(request, course_id, csv=False): # pylint: disable=W0613, W @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') -def get_sale_order_records(request, course_id): # pylint: disable=W0613, W0621 +def get_sale_order_records(request, course_id): # pylint: disable=unused-argument, redefined-outer-name """ return the summary of all sales records for a particular course """ @@ -811,7 +811,7 @@ def get_sale_order_records(request, course_id): # pylint: disable=W0613, W0621 db_columns = [x[0] for x in query_features] csv_columns = [x[1] for x in query_features] sale_data = instructor_analytics.basic.sale_order_record_features(course_id, db_columns) - header, datarows = instructor_analytics.csvs.format_dictlist(sale_data, db_columns) # pylint: disable=W0612 + header, datarows = instructor_analytics.csvs.format_dictlist(sale_data, db_columns) # pylint: disable=unused-variable return instructor_analytics.csvs.create_csv_response("e-commerce_sale_order_records.csv", csv_columns, datarows) @@ -878,7 +878,7 @@ def re_validate_invoice(obj_invoice): @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') -def get_purchase_transaction(request, course_id, csv=False): # pylint: disable=W0613, W0621 +def get_purchase_transaction(request, course_id, csv=False): # pylint: disable=unused-argument, redefined-outer-name """ return the summary of all purchased transactions for a particular course """ @@ -906,7 +906,7 @@ def get_purchase_transaction(request, course_id, csv=False): # pylint: disable= @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') -def get_students_features(request, course_id, csv=False): # pylint: disable=W0613, W0621 +def get_students_features(request, course_id, csv=False): # pylint: disable=redefined-outer-name """ Respond with json which contains a summary of all enrolled students profile information. @@ -976,7 +976,7 @@ def get_students_features(request, course_id, csv=False): # pylint: disable=W06 @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') -def get_coupon_codes(request, course_id): # pylint: disable=W0613 +def get_coupon_codes(request, course_id): # pylint: disable=unused-argument """ Respond with csv which contains a summary of all Active Coupons. """ @@ -1044,7 +1044,7 @@ def random_code_generator(): @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') @require_POST -def get_registration_codes(request, course_id): # pylint: disable=W0613 +def get_registration_codes(request, course_id): # pylint: disable=unused-argument """ Respond with csv which contains a summary of all Registration Codes. """ @@ -1107,7 +1107,7 @@ def generate_registration_codes(request, course_id): internal_reference=internal_reference, customer_reference_number=customer_reference_number ) registration_codes = [] - for _ in range(course_code_number): # pylint: disable=W0621 + for _ in range(course_code_number): # pylint: disable=redefined-outer-name generated_registration_code = save_registration_code(request.user, course_id, sale_invoice, order=None) registration_codes.append(generated_registration_code) @@ -1181,7 +1181,7 @@ def generate_registration_codes(request, course_id): @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') @require_POST -def active_registration_codes(request, course_id): # pylint: disable=W0613 +def active_registration_codes(request, course_id): # pylint: disable=unused-argument """ Respond with csv which contains a summary of all Active Registration Codes. """ @@ -1208,7 +1208,7 @@ def active_registration_codes(request, course_id): # pylint: disable=W0613 @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') @require_POST -def spent_registration_codes(request, course_id): # pylint: disable=W0613 +def spent_registration_codes(request, course_id): # pylint: disable=unused-argument """ Respond with csv which contains a summary of all Spent(used) Registration Codes. """ @@ -1229,7 +1229,7 @@ def spent_registration_codes(request, course_id): # pylint: disable=W0613 company_name = request.POST['spent_company_name'] if company_name: - spent_codes_list = spent_codes_list.filter(invoice__company_name=company_name) # pylint: disable=E1103 + spent_codes_list = spent_codes_list.filter(invoice__company_name=company_name) # pylint: disable=maybe-no-member csv_type = 'spent' return registration_codes_csv("Spent_Registration_Codes.csv", spent_codes_list, csv_type) @@ -1238,7 +1238,7 @@ def spent_registration_codes(request, course_id): # pylint: disable=W0613 @ensure_csrf_cookie @cache_control(no_cache=True, no_store=True, must_revalidate=True) @require_level('staff') -def get_anon_ids(request, course_id): # pylint: disable=W0613 +def get_anon_ids(request, course_id): # pylint: disable=unused-argument """ Respond with 2-column CSV output of user-id, anonymized-user-id """ @@ -1709,7 +1709,7 @@ def send_email(request, course_id): ) # Submit the task, so that the correct InstructorTask object gets created (for monitoring purposes) - instructor_task.api.submit_bulk_course_email(request, course_id, email.id) # pylint: disable=E1101 + instructor_task.api.submit_bulk_course_email(request, course_id, email.id) # pylint: disable=no-member response_payload = { 'course_id': course_id.to_deprecated_string(), @@ -1839,7 +1839,7 @@ def proxy_legacy_analytics(request, course_id): @require_POST -def get_user_invoice_preference(request, course_id): # pylint: disable=W0613 +def get_user_invoice_preference(request, course_id): # pylint: disable=unused-argument """ Gets invoice copy user's preferences. """ diff --git a/lms/djangoapps/instructor/views/coupons.py b/lms/djangoapps/instructor/views/coupons.py index c4ec58d9d2..d18eb1c1d3 100644 --- a/lms/djangoapps/instructor/views/coupons.py +++ b/lms/djangoapps/instructor/views/coupons.py @@ -18,7 +18,7 @@ log = logging.getLogger(__name__) @require_POST @login_required -def remove_coupon(request, course_id): # pylint: disable=W0613 +def remove_coupon(request, course_id): # pylint: disable=unused-argument """ remove the coupon against the coupon id set the coupon is_active flag to false @@ -48,7 +48,7 @@ def remove_coupon(request, course_id): # pylint: disable=W0613 @require_POST @login_required -def add_coupon(request, course_id): # pylint: disable=W0613 +def add_coupon(request, course_id): # pylint: disable=unused-argument """ add coupon in the Coupons Table """ @@ -96,7 +96,7 @@ def add_coupon(request, course_id): # pylint: disable=W0613 @require_POST @login_required -def update_coupon(request, course_id): # pylint: disable=W0613 +def update_coupon(request, course_id): # pylint: disable=unused-argument """ update the coupon object in the database """ @@ -121,7 +121,7 @@ def update_coupon(request, course_id): # pylint: disable=W0613 @require_POST @login_required -def get_coupon_info(request, course_id): # pylint: disable=W0613 +def get_coupon_info(request, course_id): # pylint: disable=unused-argument """ get the coupon information to display in the pop up form """ diff --git a/lms/djangoapps/instructor/views/instructor_dashboard.py b/lms/djangoapps/instructor/views/instructor_dashboard.py index 95a9b116ea..73aa8e839e 100644 --- a/lms/djangoapps/instructor/views/instructor_dashboard.py +++ b/lms/djangoapps/instructor/views/instructor_dashboard.py @@ -114,17 +114,15 @@ def instructor_dashboard_2(request, course_id): return render_to_response('instructor/instructor_dashboard_2/instructor_dashboard_2.html', context) -""" -Section functions starting with _section return a dictionary of section data. +## Section functions starting with _section return a dictionary of section data. -The dictionary must include at least { - 'section_key': 'circus_expo' - 'section_display_name': 'Circus Expo' -} +## The dictionary must include at least { +## 'section_key': 'circus_expo' +## 'section_display_name': 'Circus Expo' +## } -section_key will be used as a css attribute, javascript tie-in, and template import filename. -section_display_name will be used to generate link titles in the nav bar. -""" # pylint: disable=W0105 +## section_key will be used as a css attribute, javascript tie-in, and template import filename. +## section_display_name will be used to generate link titles in the nav bar. def _section_e_commerce(course, access): diff --git a/lms/djangoapps/instructor/views/legacy.py b/lms/djangoapps/instructor/views/legacy.py index 262983de8e..8e8a48513a 100644 --- a/lms/djangoapps/instructor/views/legacy.py +++ b/lms/djangoapps/instructor/views/legacy.py @@ -860,7 +860,7 @@ def instructor_dashboard(request, course_id): ) # Submit the task, so that the correct InstructorTask object gets created (for monitoring purposes) - submit_bulk_course_email(request, course_key, email.id) # pylint: disable=E1101 + submit_bulk_course_email(request, course_key, email.id) # pylint: disable=no-member except Exception as err: # pylint: disable=broad-except # Catch any errors and deliver a message to the user diff --git a/lms/djangoapps/instructor_task/api_helper.py b/lms/djangoapps/instructor_task/api_helper.py index 3ac28890e6..344ef2dc43 100644 --- a/lms/djangoapps/instructor_task/api_helper.py +++ b/lms/djangoapps/instructor_task/api_helper.py @@ -301,7 +301,7 @@ def submit_task(request, task_type, task_class, course_key, task_input, task_key # submit task: task_id = instructor_task.task_id - task_args = [instructor_task.id, _get_xmodule_instance_args(request, task_id)] # pylint: disable=E1101 + task_args = [instructor_task.id, _get_xmodule_instance_args(request, task_id)] # pylint: disable=no-member task_class.apply_async(task_args, task_id=task_id) return instructor_task diff --git a/lms/djangoapps/instructor_task/migrations/0001_initial.py b/lms/djangoapps/instructor_task/migrations/0001_initial.py index 4e12f292c1..add6f0b7f1 100644 --- a/lms/djangoapps/instructor_task/migrations/0001_initial.py +++ b/lms/djangoapps/instructor_task/migrations/0001_initial.py @@ -83,4 +83,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['instructor_task'] \ No newline at end of file + complete_apps = ['instructor_task'] diff --git a/lms/djangoapps/instructor_task/migrations/0002_add_subtask_field.py b/lms/djangoapps/instructor_task/migrations/0002_add_subtask_field.py index 845dffd856..81e55c6e16 100644 --- a/lms/djangoapps/instructor_task/migrations/0002_add_subtask_field.py +++ b/lms/djangoapps/instructor_task/migrations/0002_add_subtask_field.py @@ -73,4 +73,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['instructor_task'] \ No newline at end of file + complete_apps = ['instructor_task'] diff --git a/lms/djangoapps/instructor_task/subtasks.py b/lms/djangoapps/instructor_task/subtasks.py index 32c0b06f2d..093eddce98 100644 --- a/lms/djangoapps/instructor_task/subtasks.py +++ b/lms/djangoapps/instructor_task/subtasks.py @@ -307,7 +307,7 @@ def queue_subtasks_for_query(entry, action_name, create_subtask_fcn, item_querys entry.id, total_num_subtasks, total_num_items, - ) # pylint: disable=E1101 + ) # pylint: disable=no-member progress = initialize_subtask_info(entry, action_name, total_num_items, subtask_id_list) # Construct a generator that will return the recipients to use for each subtask. diff --git a/lms/djangoapps/instructor_task/tasks.py b/lms/djangoapps/instructor_task/tasks.py index 7e62ba929a..518d71da0a 100644 --- a/lms/djangoapps/instructor_task/tasks.py +++ b/lms/djangoapps/instructor_task/tasks.py @@ -36,7 +36,7 @@ from instructor_task.tasks_helper import ( from bulk_email.tasks import perform_delegate_email_batches -@task(base=BaseInstructorTask) # pylint: disable=E1102 +@task(base=BaseInstructorTask) # pylint: disable=not-callable def rescore_problem(entry_id, xmodule_instance_args): """Rescores a problem in a course, for all students or one specific student. @@ -67,7 +67,7 @@ def rescore_problem(entry_id, xmodule_instance_args): return run_main_task(entry_id, visit_fcn, action_name) -@task(base=BaseInstructorTask) # pylint: disable=E1102 +@task(base=BaseInstructorTask) # pylint: disable=not-callable def reset_problem_attempts(entry_id, xmodule_instance_args): """Resets problem attempts to zero for a particular problem for all students in a course. @@ -89,7 +89,7 @@ def reset_problem_attempts(entry_id, xmodule_instance_args): return run_main_task(entry_id, visit_fcn, action_name) -@task(base=BaseInstructorTask) # pylint: disable=E1102 +@task(base=BaseInstructorTask) # pylint: disable=not-callable def delete_problem_state(entry_id, xmodule_instance_args): """Deletes problem state entirely for all students on a particular problem in a course. @@ -111,7 +111,7 @@ def delete_problem_state(entry_id, xmodule_instance_args): return run_main_task(entry_id, visit_fcn, action_name) -@task(base=BaseInstructorTask) # pylint: disable=E1102 +@task(base=BaseInstructorTask) # pylint: disable=not-callable def send_bulk_course_email(entry_id, _xmodule_instance_args): """Sends emails to recipients enrolled in a course. @@ -132,7 +132,7 @@ def send_bulk_course_email(entry_id, _xmodule_instance_args): return run_main_task(entry_id, visit_fcn, action_name) -@task(base=BaseInstructorTask, routing_key=settings.GRADES_DOWNLOAD_ROUTING_KEY) # pylint: disable=E1102 +@task(base=BaseInstructorTask, routing_key=settings.GRADES_DOWNLOAD_ROUTING_KEY) # pylint: disable=not-callable def calculate_grades_csv(entry_id, xmodule_instance_args): """ Grade a course and push the results to an S3 bucket for download. @@ -143,7 +143,7 @@ def calculate_grades_csv(entry_id, xmodule_instance_args): return run_main_task(entry_id, task_fn, action_name) -@task(base=BaseInstructorTask, routing_key=settings.GRADES_DOWNLOAD_ROUTING_KEY) # pylint: disable=E1102 +@task(base=BaseInstructorTask, routing_key=settings.GRADES_DOWNLOAD_ROUTING_KEY) # pylint: disable=not-callable def calculate_students_features_csv(entry_id, xmodule_instance_args): """ Compute student profile information for a course and upload the diff --git a/lms/djangoapps/instructor_task/tests/test_api.py b/lms/djangoapps/instructor_task/tests/test_api.py index 2d83091f38..e70d9650be 100644 --- a/lms/djangoapps/instructor_task/tests/test_api.py +++ b/lms/djangoapps/instructor_task/tests/test_api.py @@ -170,7 +170,7 @@ class InstructorTaskCourseSubmitTest(TestReportMixin, InstructorTaskCourseTestCa def _define_course_email(self): """Create CourseEmail object for testing.""" course_email = CourseEmail.create(self.course.id, self.instructor, SEND_TO_ALL, "Test Subject", "

This is a test message

") - return course_email.id # pylint: disable=E1101 + return course_email.id # pylint: disable=no-member def _test_resubmission(self, api_call): """ @@ -181,7 +181,7 @@ class InstructorTaskCourseSubmitTest(TestReportMixin, InstructorTaskCourseTestCa `AlreadyRunningError`. """ instructor_task = api_call() - instructor_task = InstructorTask.objects.get(id=instructor_task.id) # pylint: disable=E1101 + instructor_task = InstructorTask.objects.get(id=instructor_task.id) # pylint: disable=no-member instructor_task.task_state = PROGRESS instructor_task.save() with self.assertRaises(AlreadyRunningError): diff --git a/lms/djangoapps/licenses/tests.py b/lms/djangoapps/licenses/tests.py index c3bb8ca7a3..ef99ff501b 100644 --- a/lms/djangoapps/licenses/tests.py +++ b/lms/djangoapps/licenses/tests.py @@ -13,7 +13,7 @@ from django.test.client import Client from django.test.utils import override_settings from django.core.management import call_command from django.core.urlresolvers import reverse -from nose.tools import assert_true # pylint: disable=E0611 +from nose.tools import assert_true # pylint: disable=no-name-in-module from courseware.tests.modulestore_config import TEST_DATA_MONGO_MODULESTORE from licenses.models import CourseSoftware, UserLicense diff --git a/lms/djangoapps/linkedin/migrations/0001_initial.py b/lms/djangoapps/linkedin/migrations/0001_initial.py index b6ceeef7d7..d8dee9089d 100644 --- a/lms/djangoapps/linkedin/migrations/0001_initial.py +++ b/lms/djangoapps/linkedin/migrations/0001_initial.py @@ -67,4 +67,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['linkedin'] \ No newline at end of file + complete_apps = ['linkedin'] diff --git a/lms/djangoapps/lms_migration/management/commands/create_user.py b/lms/djangoapps/lms_migration/management/commands/create_user.py index 327a597166..20e5e045bf 100644 --- a/lms/djangoapps/lms_migration/management/commands/create_user.py +++ b/lms/djangoapps/lms_migration/management/commands/create_user.py @@ -6,7 +6,7 @@ import os import sys -import string # pylint: disable=W0402 +import string # pylint: disable=deprecated-module import datetime from getpass import getpass import json diff --git a/lms/djangoapps/mobile_api/course_info/tests.py b/lms/djangoapps/mobile_api/course_info/tests.py index a470e7df75..e46d8f0ee6 100644 --- a/lms/djangoapps/mobile_api/course_info/tests.py +++ b/lms/djangoapps/mobile_api/course_info/tests.py @@ -25,7 +25,7 @@ class TestVideoOutline(ModuleStoreTestCase, APITestCase): url = reverse('course-about-detail', kwargs={'course_id': unicode(self.course.id)}) response = self.client.get(url) self.assertEqual(response.status_code, 200) - self.assertTrue('overview' in response.data) # pylint: disable=E1103 + self.assertTrue('overview' in response.data) # pylint: disable=maybe-no-member def test_handouts(self): url = reverse('course-handouts-list', kwargs={'course_id': unicode(self.course.id)}) @@ -36,5 +36,5 @@ class TestVideoOutline(ModuleStoreTestCase, APITestCase): url = reverse('course-updates-list', kwargs={'course_id': unicode(self.course.id)}) response = self.client.get(url) self.assertEqual(response.status_code, 200) - self.assertEqual(response.data, []) # pylint: disable=E1103 + self.assertEqual(response.data, []) # pylint: disable=maybe-no-member # TODO: add handouts and updates, somehow diff --git a/lms/djangoapps/mobile_api/users/serializers.py b/lms/djangoapps/mobile_api/users/serializers.py index b0ae321a3c..267378f674 100644 --- a/lms/djangoapps/mobile_api/users/serializers.py +++ b/lms/djangoapps/mobile_api/users/serializers.py @@ -65,7 +65,7 @@ class CourseEnrollmentSerializer(serializers.ModelSerializer): """ course = CourseField() - class Meta: # pylint: disable=C0111 + class Meta: # pylint: disable=missing-docstring model = CourseEnrollment fields = ('created', 'mode', 'is_active', 'course') lookup_field = 'username' @@ -81,7 +81,7 @@ class UserSerializer(serializers.HyperlinkedModelSerializer): lookup_field='username' ) - class Meta: # pylint: disable=C0111 + class Meta: # pylint: disable=missing-docstring model = User fields = ('id', 'username', 'email', 'name', 'course_enrollments') lookup_field = 'username' diff --git a/lms/djangoapps/mobile_api/users/tests.py b/lms/djangoapps/mobile_api/users/tests.py index ccb93aeb5e..62d1d1f677 100644 --- a/lms/djangoapps/mobile_api/users/tests.py +++ b/lms/djangoapps/mobile_api/users/tests.py @@ -122,7 +122,7 @@ class TestUserApi(ModuleStoreTestCase, APITestCase): def test_course_serializer(self): self.client.login(username=self.username, password=self.password) self._enroll(self.course) - serialized = CourseEnrollmentSerializer(CourseEnrollment.enrollments_for_user(self.user)[0]).data # pylint: disable=E1101 + serialized = CourseEnrollmentSerializer(CourseEnrollment.enrollments_for_user(self.user)[0]).data # pylint: disable=no-member self.assertEqual(serialized['course']['video_outline'], None) self.assertEqual(serialized['course']['name'], self.course.display_name) self.assertEqual(serialized['course']['number'], self.course.id.course) @@ -135,7 +135,7 @@ class TestUserApi(ModuleStoreTestCase, APITestCase): self.client.login(username=self.username, password=self.password) self._enroll(self.course) - serialized = CourseEnrollmentSerializer(CourseEnrollment.enrollments_for_user(self.user)[0]).data # pylint: disable=E1101 + serialized = CourseEnrollmentSerializer(CourseEnrollment.enrollments_for_user(self.user)[0]).data # pylint: disable=no-member self.assertEqual(serialized['course']['number'], self.course.display_coursenumber) self.assertEqual(serialized['course']['org'], self.course.display_organization) diff --git a/lms/djangoapps/mobile_api/video_outlines/tests.py b/lms/djangoapps/mobile_api/video_outlines/tests.py index 15ab7b4ab8..ddbc547c5e 100644 --- a/lms/djangoapps/mobile_api/video_outlines/tests.py +++ b/lms/djangoapps/mobile_api/video_outlines/tests.py @@ -127,7 +127,7 @@ class TestVideoOutline(ModuleStoreTestCase, APITestCase): url = reverse('video-summary-list', kwargs={'course_id': unicode(self.course.id)}) response = self.client.get(url) self.assertEqual(response.status_code, 200) - return response.data # pylint: disable=E1103 + return response.data # pylint: disable=maybe-no-member def _create_video_with_subs(self): """ diff --git a/lms/djangoapps/notes/migrations/0001_initial.py b/lms/djangoapps/notes/migrations/0001_initial.py index 1629b2355d..6b0a071212 100644 --- a/lms/djangoapps/notes/migrations/0001_initial.py +++ b/lms/djangoapps/notes/migrations/0001_initial.py @@ -87,4 +87,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['notes'] \ No newline at end of file + complete_apps = ['notes'] diff --git a/lms/djangoapps/shoppingcart/admin.py b/lms/djangoapps/shoppingcart/admin.py index d2d9195777..8f68b098c2 100644 --- a/lms/djangoapps/shoppingcart/admin.py +++ b/lms/djangoapps/shoppingcart/admin.py @@ -22,7 +22,7 @@ class SoftDeleteCouponAdmin(admin.ModelAdmin): admin site. This is used by changelist_view. """ # Default: qs = self.model._default_manager.get_active_coupons_query_set() # Queryset with all the coupons including the soft-deletes: qs = self.model._default_manager.get_query_set() - query_string = self.model._default_manager.get_active_coupons_query_set() # pylint: disable=W0212 + query_string = self.model._default_manager.get_active_coupons_query_set() # pylint: disable=protected-access return query_string def get_actions(self, request): diff --git a/lms/djangoapps/shoppingcart/exceptions.py b/lms/djangoapps/shoppingcart/exceptions.py index 6253c3bc46..12358deef6 100644 --- a/lms/djangoapps/shoppingcart/exceptions.py +++ b/lms/djangoapps/shoppingcart/exceptions.py @@ -2,7 +2,7 @@ Exceptions for the shoppingcart app """ # (Exception Class Names are sort of self-explanatory, so skipping docstring requirement) -# pylint: disable=C0111 +# pylint: disable=missing-docstring class PaymentException(Exception): diff --git a/lms/djangoapps/shoppingcart/migrations/0004_auto__add_field_orderitem_fulfilled_time.py b/lms/djangoapps/shoppingcart/migrations/0004_auto__add_field_orderitem_fulfilled_time.py index bbaf185184..4271a24840 100644 --- a/lms/djangoapps/shoppingcart/migrations/0004_auto__add_field_orderitem_fulfilled_time.py +++ b/lms/djangoapps/shoppingcart/migrations/0004_auto__add_field_orderitem_fulfilled_time.py @@ -111,4 +111,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['shoppingcart'] \ No newline at end of file + complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0005_auto__add_paidcourseregistrationannotation__add_field_orderitem_report.py b/lms/djangoapps/shoppingcart/migrations/0005_auto__add_paidcourseregistrationannotation__add_field_orderitem_report.py index 04d37c730a..1e92306140 100644 --- a/lms/djangoapps/shoppingcart/migrations/0005_auto__add_paidcourseregistrationannotation__add_field_orderitem_report.py +++ b/lms/djangoapps/shoppingcart/migrations/0005_auto__add_paidcourseregistrationannotation__add_field_orderitem_report.py @@ -129,4 +129,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['shoppingcart'] \ No newline at end of file + complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0006_auto__add_field_order_refunded_time__add_field_orderitem_refund_reques.py b/lms/djangoapps/shoppingcart/migrations/0006_auto__add_field_order_refunded_time__add_field_orderitem_refund_reques.py index 13e001cfd0..cd8ee5b198 100644 --- a/lms/djangoapps/shoppingcart/migrations/0006_auto__add_field_order_refunded_time__add_field_orderitem_refund_reques.py +++ b/lms/djangoapps/shoppingcart/migrations/0006_auto__add_field_order_refunded_time__add_field_orderitem_refund_reques.py @@ -128,4 +128,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['shoppingcart'] \ No newline at end of file + complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0007_auto__add_field_orderitem_service_fee.py b/lms/djangoapps/shoppingcart/migrations/0007_auto__add_field_orderitem_service_fee.py index 227b8ccc0f..bc086c05c2 100644 --- a/lms/djangoapps/shoppingcart/migrations/0007_auto__add_field_orderitem_service_fee.py +++ b/lms/djangoapps/shoppingcart/migrations/0007_auto__add_field_orderitem_service_fee.py @@ -139,4 +139,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['shoppingcart'] \ No newline at end of file + complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0008_auto__add_coupons__add_couponredemption__chg_field_certificateitem_cou.py b/lms/djangoapps/shoppingcart/migrations/0008_auto__add_coupons__add_couponredemption__chg_field_certificateitem_cou.py index 8ff9a0d7ae..f64f20edd7 100644 --- a/lms/djangoapps/shoppingcart/migrations/0008_auto__add_coupons__add_couponredemption__chg_field_certificateitem_cou.py +++ b/lms/djangoapps/shoppingcart/migrations/0008_auto__add_coupons__add_couponredemption__chg_field_certificateitem_cou.py @@ -186,4 +186,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['shoppingcart'] \ No newline at end of file + complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0009_auto__del_coupons__add_courseregistrationcode__add_coupon__chg_field_c.py b/lms/djangoapps/shoppingcart/migrations/0009_auto__del_coupons__add_courseregistrationcode__add_coupon__chg_field_c.py index 3850c10499..f17db05296 100644 --- a/lms/djangoapps/shoppingcart/migrations/0009_auto__del_coupons__add_courseregistrationcode__add_coupon__chg_field_c.py +++ b/lms/djangoapps/shoppingcart/migrations/0009_auto__del_coupons__add_courseregistrationcode__add_coupon__chg_field_c.py @@ -213,4 +213,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['shoppingcart'] \ No newline at end of file + complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0010_auto__add_registrationcoderedemption__del_field_courseregistrationcode.py b/lms/djangoapps/shoppingcart/migrations/0010_auto__add_registrationcoderedemption__del_field_courseregistrationcode.py index 0dca784fd6..fd740f9fff 100644 --- a/lms/djangoapps/shoppingcart/migrations/0010_auto__add_registrationcoderedemption__del_field_courseregistrationcode.py +++ b/lms/djangoapps/shoppingcart/migrations/0010_auto__add_registrationcoderedemption__del_field_courseregistrationcode.py @@ -184,4 +184,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['shoppingcart'] \ No newline at end of file + complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0011_auto__add_invoice__add_field_courseregistrationcode_invoice.py b/lms/djangoapps/shoppingcart/migrations/0011_auto__add_invoice__add_field_courseregistrationcode_invoice.py index d67d48e426..75ecf4b321 100644 --- a/lms/djangoapps/shoppingcart/migrations/0011_auto__add_invoice__add_field_courseregistrationcode_invoice.py +++ b/lms/djangoapps/shoppingcart/migrations/0011_auto__add_invoice__add_field_courseregistrationcode_invoice.py @@ -183,4 +183,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['shoppingcart'] \ No newline at end of file + complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0012_auto__del_field_courseregistrationcode_transaction_group_name__del_fie.py b/lms/djangoapps/shoppingcart/migrations/0012_auto__del_field_courseregistrationcode_transaction_group_name__del_fie.py index 77c7635538..0c5c72edd4 100644 --- a/lms/djangoapps/shoppingcart/migrations/0012_auto__del_field_courseregistrationcode_transaction_group_name__del_fie.py +++ b/lms/djangoapps/shoppingcart/migrations/0012_auto__del_field_courseregistrationcode_transaction_group_name__del_fie.py @@ -249,4 +249,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['shoppingcart'] \ No newline at end of file + complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0013_auto__add_field_invoice_is_valid.py b/lms/djangoapps/shoppingcart/migrations/0013_auto__add_field_invoice_is_valid.py index 2520a8b182..a898be5e75 100644 --- a/lms/djangoapps/shoppingcart/migrations/0013_auto__add_field_invoice_is_valid.py +++ b/lms/djangoapps/shoppingcart/migrations/0013_auto__add_field_invoice_is_valid.py @@ -170,4 +170,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['shoppingcart'] \ No newline at end of file + complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0014_auto__del_field_invoice_tax_id__add_field_invoice_address_line_1__add_.py b/lms/djangoapps/shoppingcart/migrations/0014_auto__del_field_invoice_tax_id__add_field_invoice_address_line_1__add_.py index fe727666cb..13ee149ff3 100644 --- a/lms/djangoapps/shoppingcart/migrations/0014_auto__del_field_invoice_tax_id__add_field_invoice_address_line_1__add_.py +++ b/lms/djangoapps/shoppingcart/migrations/0014_auto__del_field_invoice_tax_id__add_field_invoice_address_line_1__add_.py @@ -241,4 +241,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['shoppingcart'] \ No newline at end of file + complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0015_auto__del_field_invoice_purchase_order_number__del_field_invoice_compa.py b/lms/djangoapps/shoppingcart/migrations/0015_auto__del_field_invoice_purchase_order_number__del_field_invoice_compa.py index 3d30974e15..a934b1344b 100644 --- a/lms/djangoapps/shoppingcart/migrations/0015_auto__del_field_invoice_purchase_order_number__del_field_invoice_compa.py +++ b/lms/djangoapps/shoppingcart/migrations/0015_auto__del_field_invoice_purchase_order_number__del_field_invoice_compa.py @@ -226,4 +226,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['shoppingcart'] \ No newline at end of file + complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0016_auto__del_field_invoice_company_email__del_field_invoice_company_refer.py b/lms/djangoapps/shoppingcart/migrations/0016_auto__del_field_invoice_company_email__del_field_invoice_company_refer.py index ae9e50d87e..f5baab13b6 100644 --- a/lms/djangoapps/shoppingcart/migrations/0016_auto__del_field_invoice_company_email__del_field_invoice_company_refer.py +++ b/lms/djangoapps/shoppingcart/migrations/0016_auto__del_field_invoice_company_email__del_field_invoice_company_refer.py @@ -202,4 +202,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['shoppingcart'] \ No newline at end of file + complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/migrations/0017_auto__add_field_courseregistrationcode_order__chg_field_registrationco.py b/lms/djangoapps/shoppingcart/migrations/0017_auto__add_field_courseregistrationcode_order__chg_field_registrationco.py index 35f00e2af6..5e6ae048cc 100644 --- a/lms/djangoapps/shoppingcart/migrations/0017_auto__add_field_courseregistrationcode_order__chg_field_registrationco.py +++ b/lms/djangoapps/shoppingcart/migrations/0017_auto__add_field_courseregistrationcode_order__chg_field_registrationco.py @@ -185,4 +185,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['shoppingcart'] \ No newline at end of file + complete_apps = ['shoppingcart'] diff --git a/lms/djangoapps/shoppingcart/models.py b/lms/djangoapps/shoppingcart/models.py index 360bcb8a25..fd87f70081 100644 --- a/lms/djangoapps/shoppingcart/models.py +++ b/lms/djangoapps/shoppingcart/models.py @@ -65,7 +65,7 @@ ORDER_STATUSES = ( ) # we need a tuple to represent the primary key of various OrderItem subclasses -OrderItemSubclassPK = namedtuple('OrderItemSubclassPK', ['cls', 'pk']) # pylint: disable=C0103 +OrderItemSubclassPK = namedtuple('OrderItemSubclassPK', ['cls', 'pk']) # pylint: disable=invalid-name class OrderTypes(object): @@ -158,7 +158,7 @@ class Order(models.Model): Return the total cost of the cart. If the order has been purchased, returns total of all purchased and not refunded items. """ - return sum(i.line_cost for i in self.orderitem_set.filter(status=self.status)) # pylint: disable=E1101 + return sum(i.line_cost for i in self.orderitem_set.filter(status=self.status)) # pylint: disable=no-member def has_items(self, item_type=None): """ @@ -166,9 +166,9 @@ class Order(models.Model): If an item_type is passed in then we check to see if there are any items of that class type """ if not item_type: - return self.orderitem_set.exists() # pylint: disable=E1101 + return self.orderitem_set.exists() # pylint: disable=no-member else: - items = self.orderitem_set.all().select_subclasses() # pylint: disable=E1101 + items = self.orderitem_set.all().select_subclasses() # pylint: disable=no-member for item in items: if isinstance(item, item_type): return True @@ -178,7 +178,7 @@ class Order(models.Model): """ Reset the items price state in the user cart """ - for item in self.orderitem_set.all(): # pylint: disable=E1101 + for item in self.orderitem_set.all(): # pylint: disable=no-member if item.list_price: item.unit_cost = item.list_price item.list_price = None @@ -188,7 +188,7 @@ class Order(models.Model): """ Clear out all the items in the cart """ - self.orderitem_set.all().delete() # pylint: disable=E1101 + self.orderitem_set.all().delete() # pylint: disable=no-member @transaction.commit_on_success def start_purchase(self): @@ -216,7 +216,7 @@ class Order(models.Model): The UI/UX may change in the future to make the switching between PaidCourseRegistration and CourseRegCodeItems a more explicit UI gesture from the purchaser """ - cart_items = self.orderitem_set.all() # pylint: disable=E1101 + cart_items = self.orderitem_set.all() # pylint: disable=no-member is_order_type_business = False for cart_item in cart_items: if cart_item.qty > 1: @@ -272,7 +272,7 @@ class Order(models.Model): """ send confirmation e-mail """ - recipient_list = [(self.user.username, getattr(self.user, 'email'), 'user')] # pylint: disable=E1101 + recipient_list = [(self.user.username, getattr(self.user, 'email'), 'user')] # pylint: disable=no-member if self.company_contact_email: recipient_list.append((self.company_contact_name, self.company_contact_email, 'company_contact')) joined_course_names = "" @@ -310,7 +310,7 @@ class Order(models.Model): 'course_names': ", ".join([course_info[0] for course_info in courses_info]), 'dashboard_url': dashboard_url, 'currency_symbol': settings.PAID_COURSE_REGISTRATION_CURRENCY[1], - 'order_placed_by': '{username} ({email})'.format(username=self.user.username, email=getattr(self.user, 'email')), # pylint: disable=E1101 + 'order_placed_by': '{username} ({email})'.format(username=self.user.username, email=getattr(self.user, 'email')), # pylint: disable=no-member 'has_billing_info': settings.FEATURES['STORE_BILLING_INFO'], 'platform_name': microsite.get_value('platform_name', settings.PLATFORM_NAME), 'payment_support_email': microsite.get_value('payment_support_email', settings.PAYMENT_SUPPORT_EMAIL), @@ -333,7 +333,7 @@ class Order(models.Model): email.attach(u'RegistrationCodesRedemptionUrls.csv', csv_file.getvalue(), 'text/csv') email.send() except (smtplib.SMTPException, BotoServerError): # sadly need to handle diff. mail backends individually - log.error('Failed sending confirmation e-mail for order %d', self.id) # pylint: disable=E1101 + log.error('Failed sending confirmation e-mail for order %d', self.id) # pylint: disable=no-member def purchase(self, first='', last='', street1='', street2='', city='', state='', postalcode='', country='', ccnum='', cardtype='', processor_reply_dump=''): @@ -356,7 +356,7 @@ class Order(models.Model): """ if self.status == 'purchased': log.error( - u"`purchase` method called on order {}, but order is already purchased.".format(self.id) # pylint: disable=E1101 + u"`purchase` method called on order {}, but order is already purchased.".format(self.id) # pylint: disable=no-member ) return self.status = 'purchased' @@ -410,8 +410,8 @@ class Order(models.Model): try: if settings.FEATURES.get('SEGMENT_IO_LMS') and settings.SEGMENT_IO_LMS_KEY: tracking_context = tracker.get_tracker().resolve_context() - analytics.track(self.user.id, event_name, { # pylint: disable=E1101 - 'orderId': self.id, # pylint: disable=E1101 + analytics.track(self.user.id, event_name, { # pylint: disable=no-member + 'orderId': self.id, # pylint: disable=no-member 'total': str(self.total_cost), 'currency': self.currency, 'products': [item.analytics_data() for item in orderitems] @@ -421,13 +421,13 @@ class Order(models.Model): } }) - except Exception: # pylint: disable=W0703 + except Exception: # pylint: disable=broad-except # Capturing all exceptions thrown while tracking analytics events. We do not want # an operation to fail because of an analytics event, so we will capture these # errors in the logs. log.exception( u'Unable to emit {event} event for user {user} and order {order}'.format( - event=event_name, user=self.user.id, order=self.id) # pylint: disable=E1101 + event=event_name, user=self.user.id, order=self.id) # pylint: disable=no-member ) def add_billing_details(self, company_name='', company_contact_name='', company_contact_email='', recipient_name='', @@ -595,7 +595,7 @@ class OrderItem(TimeStampedModel): """ return { - 'id': self.id, # pylint: disable=E1101 + 'id': self.id, # pylint: disable=no-member 'sku': type(self).__name__, 'name': 'N/A', 'price': str(self.unit_cost), @@ -652,7 +652,7 @@ class CourseRegistrationCode(models.Model): for item in cart_items: CourseEnrollment.enroll(cart.user, item.course_id) log.info("Enrolled '{0}' in free course '{1}'" - .format(cart.user.email, item.course_id)) # pylint: disable=E1101 + .format(cart.user.email, item.course_id)) # pylint: disable=no-member item.status = 'purchased' item.save() @@ -834,7 +834,7 @@ class PaidCourseRegistration(OrderItem): This will return the total amount of money that a purchased course generated """ total_cost = 0 - result = cls.objects.filter(course_id=course_key, status='purchased').aggregate(total=Sum('unit_cost', field='qty * unit_cost')) # pylint: disable=E1101 + result = cls.objects.filter(course_id=course_key, status='purchased').aggregate(total=Sum('unit_cost', field='qty * unit_cost')) # pylint: disable=no-member if result['total'] is not None: total_cost = result['total'] @@ -911,7 +911,7 @@ class PaidCourseRegistration(OrderItem): CourseEnrollment.enroll(user=self.user, course_key=self.course_id, mode=self.mode) log.info("Enrolled {0} in paid course {1}, paid ${2}" - .format(self.user.email, self.course_id, self.line_cost)) # pylint: disable=E1101 + .format(self.user.email, self.course_id, self.line_cost)) # pylint: disable=no-member def generate_receipt_instructions(self): """ @@ -948,7 +948,7 @@ class PaidCourseRegistration(OrderItem): sku = data['sku'] if self.course_id != CourseKeyField.Empty: data['name'] = unicode(self.course_id) - data['category'] = unicode(self.course_id.org) # pylint: disable=E1101 + data['category'] = unicode(self.course_id.org) # pylint: disable=no-member if self.mode: data['sku'] = sku + u'.' + unicode(self.mode) return data @@ -979,7 +979,7 @@ class CourseRegCodeItem(OrderItem): This will return the total amount of money that a purchased course generated """ total_cost = 0 - result = cls.objects.filter(course_id=course_key, status='purchased').aggregate(total=Sum('unit_cost', field='qty * unit_cost')) # pylint: disable=E1101 + result = cls.objects.filter(course_id=course_key, status='purchased').aggregate(total=Sum('unit_cost', field='qty * unit_cost')) # pylint: disable=no-member if result['total'] is not None: total_cost = result['total'] @@ -988,7 +988,7 @@ class CourseRegCodeItem(OrderItem): @classmethod @transaction.commit_on_success - def add_to_order(cls, order, course_id, qty, mode_slug=CourseMode.DEFAULT_MODE_SLUG, cost=None, currency=None): # pylint: disable=W0221 + def add_to_order(cls, order, course_id, qty, mode_slug=CourseMode.DEFAULT_MODE_SLUG, cost=None, currency=None): # pylint: disable=arguments-differ """ A standardized way to create these objects, with sensible defaults filled in. Will update the cost if called on an order that already carries the course. @@ -1026,7 +1026,7 @@ class CourseRegCodeItem(OrderItem): super(CourseRegCodeItem, cls).add_to_order(order, course_id, cost, currency=currency) - item, created = cls.objects.get_or_create(order=order, user=order.user, course_id=course_id) # pylint: disable=W0612 + item, created = cls.objects.get_or_create(order=order, user=order.user, course_id=course_id) # pylint: disable=unused-variable item.status = order.status item.mode = course_mode.slug item.unit_cost = cost @@ -1057,11 +1057,11 @@ class CourseRegCodeItem(OrderItem): # file, but there's also a shared dependency on a random string generator which # is in another PR (for another feature) from instructor.views.api import save_registration_code - for i in range(total_registration_codes): # pylint: disable=W0612 + for i in range(total_registration_codes): # pylint: disable=unused-variable save_registration_code(self.user, self.course_id, invoice=None, order=self.order) log.info("Enrolled {0} in paid course {1}, paid ${2}" - .format(self.user.email, self.course_id, self.line_cost)) # pylint: disable=E1101 + .format(self.user.email, self.course_id, self.line_cost)) # pylint: disable=no-member @property def csv_report_comments(self): @@ -1088,7 +1088,7 @@ class CourseRegCodeItem(OrderItem): sku = data['sku'] if self.course_id != CourseKeyField.Empty: data['name'] = unicode(self.course_id) - data['category'] = unicode(self.course_id.org) # pylint: disable=E1101 + data['category'] = unicode(self.course_id.org) # pylint: disable=no-member if self.mode: data['sku'] = sku + u'.' + unicode(self.mode) return data @@ -1133,7 +1133,7 @@ class CertificateItem(OrderItem): mode = models.SlugField() @receiver(UNENROLL_DONE) - def refund_cert_callback(sender, course_enrollment=None, skip_refund=False, **kwargs): # pylint: disable=E0213,W0613 + def refund_cert_callback(sender, course_enrollment=None, skip_refund=False, **kwargs): # pylint: disable=no-self-argument,unused-argument """ When a CourseEnrollment object calls its unenroll method, this function checks to see if that unenrollment occurred in a verified certificate that was within the refund deadline. If so, it actually performs the @@ -1328,7 +1328,7 @@ class CertificateItem(OrderItem): sku = data['sku'] if self.course_id != CourseKeyField.Empty: data['name'] = unicode(self.course_id) - data['category'] = unicode(self.course_id.org) # pylint: disable=E1101 + data['category'] = unicode(self.course_id.org) # pylint: disable=no-member if self.mode: data['sku'] = sku + u'.' + unicode(self.mode) return data @@ -1496,7 +1496,7 @@ class Donation(OrderItem): data = super(Donation, self).analytics_data() if self.course_id != CourseKeyField.Empty: data['name'] = unicode(self.course_id) - data['category'] = unicode(self.course_id.org) # pylint: disable=E1101 + data['category'] = unicode(self.course_id.org) # pylint: disable=no-member else: data['name'] = settings.PLATFORM_NAME data['category'] = settings.PLATFORM_NAME diff --git a/lms/djangoapps/shoppingcart/tests/test_models.py b/lms/djangoapps/shoppingcart/tests/test_models.py index 809c717961..0fa9f6cf72 100644 --- a/lms/djangoapps/shoppingcart/tests/test_models.py +++ b/lms/djangoapps/shoppingcart/tests/test_models.py @@ -180,7 +180,7 @@ class OrderTest(ModuleStoreTestCase): self.assertIn(item.additional_instruction_text, mail.outbox[0].body) # Assert Google Analytics event fired for purchase. - self.mock_tracker.track.assert_called_once_with( # pylint: disable=E1103 + self.mock_tracker.track.assert_called_once_with( # pylint: disable=maybe-no-member 1, 'Completed Order', { diff --git a/lms/djangoapps/shoppingcart/tests/test_views.py b/lms/djangoapps/shoppingcart/tests/test_views.py index f61080981f..ea453e77fb 100644 --- a/lms/djangoapps/shoppingcart/tests/test_views.py +++ b/lms/djangoapps/shoppingcart/tests/test_views.py @@ -151,7 +151,7 @@ class ShoppingCartViewsTests(ModuleStoreTestCase): resp = self.client.get(billing_url) self.assertEqual(resp.status_code, 200) - ((template, context), _) = render_mock.call_args # pylint: disable=W0621 + ((template, context), _) = render_mock.call_args # pylint: disable=redefined-outer-name self.assertEqual(template, 'shoppingcart/billing_details.html') # check for the default currency in the context self.assertEqual(context['currency'], 'usd') @@ -179,7 +179,7 @@ class ShoppingCartViewsTests(ModuleStoreTestCase): resp = self.client.get(billing_url) self.assertEqual(resp.status_code, 200) - ((template, context), _) = render_mock.call_args # pylint: disable=W0621 + ((template, context), _) = render_mock.call_args # pylint: disable=redefined-outer-name self.assertEqual(template, 'shoppingcart/billing_details.html') # check for the override currency settings in the context self.assertEqual(context['currency'], 'PKR') @@ -405,7 +405,7 @@ class ShoppingCartViewsTests(ModuleStoreTestCase): item = self.cart.orderitem_set.all().select_subclasses()[1] self.assertEquals(item.unit_cost, self.get_discount(self.testing_cost)) - def test_soft_delete_coupon(self): # pylint: disable=E1101 + def test_soft_delete_coupon(self): # pylint: disable=no-member self.add_coupon(self.course_key, True, self.coupon_code) coupon = Coupon(code='TestCode', description='testing', course_id=self.course_key, percentage_discount=12, created_by=self.user, is_active=True) @@ -416,25 +416,25 @@ class ShoppingCartViewsTests(ModuleStoreTestCase): get_coupon = Coupon.objects.get(id=1) request = HttpRequest() request.user = admin - setattr(request, 'session', 'session') # pylint: disable=E1101 - messages = FallbackStorage(request) # pylint: disable=E1101 - setattr(request, '_messages', messages) # pylint: disable=E1101 + setattr(request, 'session', 'session') # pylint: disable=no-member + messages = FallbackStorage(request) # pylint: disable=no-member + setattr(request, '_messages', messages) # pylint: disable=no-member coupon_admin = SoftDeleteCouponAdmin(Coupon, AdminSite()) test_query_set = coupon_admin.queryset(request) test_actions = coupon_admin.get_actions(request) self.assertTrue('really_delete_selected' in test_actions['really_delete_selected']) self.assertEqual(get_coupon.is_active, True) - coupon_admin.really_delete_selected(request, test_query_set) # pylint: disable=E1101 + coupon_admin.really_delete_selected(request, test_query_set) # pylint: disable=no-member for coupon in test_query_set: self.assertEqual(coupon.is_active, False) - coupon_admin.delete_model(request, get_coupon) # pylint: disable=E1101 + coupon_admin.delete_model(request, get_coupon) # pylint: disable=no-member self.assertEqual(get_coupon.is_active, False) coupon = Coupon(code='TestCode123', description='testing123', course_id=self.course_key, percentage_discount=22, created_by=self.user, is_active=True) coupon.save() test_query_set = coupon_admin.queryset(request) - coupon_admin.really_delete_selected(request, test_query_set) # pylint: disable=E1101 + coupon_admin.really_delete_selected(request, test_query_set) # pylint: disable=no-member for coupon in test_query_set: self.assertEqual(coupon.is_active, False) @@ -669,7 +669,7 @@ class ShoppingCartViewsTests(ModuleStoreTestCase): resp = self.client.get(reverse('shoppingcart.views.show_cart', args=[])) self.assertEqual(resp.status_code, 200) - ((purchase_form_arg_cart,), _) = form_mock.call_args # pylint: disable=W0621 + ((purchase_form_arg_cart,), _) = form_mock.call_args # pylint: disable=redefined-outer-name purchase_form_arg_cart_items = purchase_form_arg_cart.orderitem_set.all().select_subclasses() self.assertIn(reg_item, purchase_form_arg_cart_items) self.assertIn(cert_item, purchase_form_arg_cart_items) @@ -693,7 +693,7 @@ class ShoppingCartViewsTests(ModuleStoreTestCase): resp = self.client.get(reverse('shoppingcart.views.show_cart', args=[])) self.assertEqual(resp.status_code, 200) - ((purchase_form_arg_cart,), _) = form_mock.call_args # pylint: disable=W0621 + ((purchase_form_arg_cart,), _) = form_mock.call_args # pylint: disable=redefined-outer-name purchase_form_arg_cart_items = purchase_form_arg_cart.orderitem_set.all().select_subclasses() self.assertIn(reg_item, purchase_form_arg_cart_items) @@ -849,7 +849,7 @@ class ShoppingCartViewsTests(ModuleStoreTestCase): resp = self.client.get(reverse('shoppingcart.views.show_receipt', args=[self.cart.id])) self.assertEqual(resp.status_code, 200) - ((template, context), _) = render_mock.call_args # pylint: disable=W0621 + ((template, context), _) = render_mock.call_args # pylint: disable=redefined-outer-name self.assertEqual(template, 'shoppingcart/receipt.html') self.assertEqual(context['order'], self.cart) self.assertEqual(context['order'].total_cost, self.testing_cost) @@ -882,7 +882,7 @@ class ShoppingCartViewsTests(ModuleStoreTestCase): self.assertIn('FirstNameTesting123', resp.content) self.assertIn('80.00', resp.content) - ((template, context), _) = render_mock.call_args # pylint: disable=W0621 + ((template, context), _) = render_mock.call_args # pylint: disable=redefined-outer-name self.assertEqual(template, 'shoppingcart/receipt.html') self.assertEqual(context['order'], self.cart) self.assertIn(reg_item, context['shoppingcart_items'][0]) @@ -903,7 +903,7 @@ class ShoppingCartViewsTests(ModuleStoreTestCase): resp = self.client.get(reverse('shoppingcart.views.show_receipt', args=[self.cart.id])) self.assertEqual(resp.status_code, 200) - ((template, context), _) = render_mock.call_args # pylint: disable=W0621 + ((template, context), _) = render_mock.call_args # pylint: disable=redefined-outer-name self.assertEqual(template, 'shoppingcart/receipt.html') self.assertIn(reg_item, context['shoppingcart_items'][0]) self.assertIn(cert_item, context['shoppingcart_items'][1]) @@ -944,7 +944,7 @@ class ShoppingCartViewsTests(ModuleStoreTestCase): # check for the enrollment codes content self.assertIn('Please send each professional one of these unique registration codes to enroll into the course.', resp.content) - ((template, context), _) = render_mock.call_args # pylint: disable=W0621 + ((template, context), _) = render_mock.call_args # pylint: disable=redefined-outer-name self.assertEqual(template, 'shoppingcart/receipt.html') self.assertEqual(context['order'], self.cart) self.assertIn(reg_item, context['shoppingcart_items'][0]) @@ -1095,7 +1095,7 @@ class RegistrationCodeRedemptionCourseEnrollment(ModuleStoreTestCase): cache.clear() url = reverse('register_code_redemption', args=['asdasd']) self.login_user() - for i in xrange(30): # pylint: disable=W0612 + for i in xrange(30): # pylint: disable=unused-variable response = self.client.post(url, **{'HTTP_HOST': 'localhost'}) self.assertEquals(response.status_code, 404) @@ -1119,7 +1119,7 @@ class RegistrationCodeRedemptionCourseEnrollment(ModuleStoreTestCase): cache.clear() url = reverse('register_code_redemption', args=['asdasd']) self.login_user() - for i in xrange(30): # pylint: disable=W0612 + for i in xrange(30): # pylint: disable=unused-variable response = self.client.get(url, **{'HTTP_HOST': 'localhost'}) self.assertEquals(response.status_code, 404) diff --git a/lms/djangoapps/survey/admin.py b/lms/djangoapps/survey/admin.py index 3095c97001..26b0cfd71b 100644 --- a/lms/djangoapps/survey/admin.py +++ b/lms/djangoapps/survey/admin.py @@ -7,10 +7,10 @@ from django.contrib import admin from survey.models import SurveyForm -class SurveyFormAdminForm(forms.ModelForm): # pylint: disable=R0924 +class SurveyFormAdminForm(forms.ModelForm): # pylint: disable=incomplete-protocol """Form providing validation of SurveyForm content.""" - class Meta: # pylint: disable=C0111 + class Meta: # pylint: disable=missing-docstring model = SurveyForm fields = ('name', 'form') diff --git a/lms/djangoapps/verify_student/exceptions.py b/lms/djangoapps/verify_student/exceptions.py index d31fdb6a6d..d8634987ef 100644 --- a/lms/djangoapps/verify_student/exceptions.py +++ b/lms/djangoapps/verify_student/exceptions.py @@ -2,7 +2,7 @@ Exceptions for the verify student app """ # (Exception Class Names are sort of self-explanatory, so skipping docstring requirement) -# pylint: disable=C0111 +# pylint: disable=missing-docstring class WindowExpiredException(Exception): diff --git a/lms/djangoapps/verify_student/migrations/0001_initial.py b/lms/djangoapps/verify_student/migrations/0001_initial.py index 65ffafc49b..31068d9dd5 100644 --- a/lms/djangoapps/verify_student/migrations/0001_initial.py +++ b/lms/djangoapps/verify_student/migrations/0001_initial.py @@ -93,4 +93,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['verify_student'] \ No newline at end of file + complete_apps = ['verify_student'] diff --git a/lms/djangoapps/verify_student/migrations/0002_auto__add_field_softwaresecurephotoverification_window.py b/lms/djangoapps/verify_student/migrations/0002_auto__add_field_softwaresecurephotoverification_window.py index 0672427d31..38ced7fe98 100644 --- a/lms/djangoapps/verify_student/migrations/0002_auto__add_field_softwaresecurephotoverification_window.py +++ b/lms/djangoapps/verify_student/migrations/0002_auto__add_field_softwaresecurephotoverification_window.py @@ -85,4 +85,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['verify_student'] \ No newline at end of file + complete_apps = ['verify_student'] diff --git a/lms/djangoapps/verify_student/migrations/0003_auto__add_field_softwaresecurephotoverification_display.py b/lms/djangoapps/verify_student/migrations/0003_auto__add_field_softwaresecurephotoverification_display.py index 3c41289180..c91f7797a1 100644 --- a/lms/djangoapps/verify_student/migrations/0003_auto__add_field_softwaresecurephotoverification_display.py +++ b/lms/djangoapps/verify_student/migrations/0003_auto__add_field_softwaresecurephotoverification_display.py @@ -86,4 +86,4 @@ class Migration(SchemaMigration): } } - complete_apps = ['verify_student'] \ No newline at end of file + complete_apps = ['verify_student'] diff --git a/lms/djangoapps/verify_student/models.py b/lms/djangoapps/verify_student/models.py index f7c2a2b17d..6362057849 100644 --- a/lms/djangoapps/verify_student/models.py +++ b/lms/djangoapps/verify_student/models.py @@ -38,7 +38,7 @@ from reverification.models import MidcourseReverificationWindow log = logging.getLogger(__name__) -def generateUUID(): # pylint: disable=C0103 +def generateUUID(): # pylint: disable=invalid-name """ Utility function; generates UUIDs """ return str(uuid.uuid4()) @@ -552,7 +552,7 @@ class SoftwareSecurePhotoVerification(PhotoVerification): attempt = attempts[0] if attempt.status != "approved": return False - except Exception: # pylint: disable=W0703 + except Exception: # pylint: disable=broad-except return False return True diff --git a/lms/djangoapps/verify_student/views.py b/lms/djangoapps/verify_student/views.py index e181687edd..b59d425153 100644 --- a/lms/djangoapps/verify_student/views.py +++ b/lms/djangoapps/verify_student/views.py @@ -535,7 +535,7 @@ def reverification_submission_confirmation(_request): @login_required -def midcourse_reverification_confirmation(_request): # pylint: disable=C0103 +def midcourse_reverification_confirmation(_request): # pylint: disable=invalid-name """ Shows the user a confirmation page if the submission to SoftwareSecure was successful """ diff --git a/lms/envs/acceptance.py b/lms/envs/acceptance.py index e4361ebacc..60509a12bf 100644 --- a/lms/envs/acceptance.py +++ b/lms/envs/acceptance.py @@ -5,7 +5,7 @@ so that we can run the lettuce acceptance tests. # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from .test import * from .sauce import * @@ -159,7 +159,7 @@ SELENIUM_GRID = { ##################################################################### # See if the developer has any local overrides. try: - from .private import * # pylint: disable=F0401 + from .private import * # pylint: disable=import-error except ImportError: pass diff --git a/lms/envs/aws.py b/lms/envs/aws.py index b6f351c9bb..bacd50a31e 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -9,7 +9,7 @@ Common traits: # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import import json diff --git a/lms/envs/aws_migrate.py b/lms/envs/aws_migrate.py index a8617d2fa0..e14834ec2d 100644 --- a/lms/envs/aws_migrate.py +++ b/lms/envs/aws_migrate.py @@ -6,7 +6,7 @@ LMS with enough privileges to modify the database schema. # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import # Import everything from .aws so that our settings are based on those. from .aws import * diff --git a/lms/envs/bok_choy.py b/lms/envs/bok_choy.py index b67c3ac36f..fbb2d6ef70 100644 --- a/lms/envs/bok_choy.py +++ b/lms/envs/bok_choy.py @@ -6,7 +6,7 @@ import os from path import path from tempfile import mkdtemp -CONFIG_ROOT = path(__file__).abspath().dirname() # pylint: disable=E1120 +CONFIG_ROOT = path(__file__).abspath().dirname() # pylint: disable=no-value-for-parameter TEST_ROOT = CONFIG_ROOT.dirname().dirname() / "test_root" ########################## Prod-like settings ################################### @@ -18,7 +18,7 @@ TEST_ROOT = CONFIG_ROOT.dirname().dirname() / "test_root" os.environ['SERVICE_VARIANT'] = 'bok_choy' os.environ['CONFIG_ROOT'] = CONFIG_ROOT -from .aws import * # pylint: disable=W0401, W0614 +from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import ######################### Testing overrides #################################### @@ -34,7 +34,7 @@ LOG_DIR = (TEST_ROOT / "log").abspath() update_module_store_settings( MODULESTORE, module_store_options={ - 'fs_root': (TEST_ROOT / "data").abspath(), # pylint: disable=E1120 + 'fs_root': (TEST_ROOT / "data").abspath(), # pylint: disable=no-value-for-parameter }, xml_store_options={ 'data_dir': (TEST_ROOT / "data").abspath(), @@ -81,6 +81,6 @@ YOUTUBE['TEXT_API']['url'] = "127.0.0.1:{0}/test_transcripts_youtube/".format(YO ##################################################################### # Lastly, see if the developer has any local overrides. try: - from .private import * # pylint: disable=F0401 + from .private import * # pylint: disable=import-error except ImportError: pass diff --git a/lms/envs/cms/aws.py b/lms/envs/cms/aws.py index baeaebca1c..fa93670f00 100644 --- a/lms/envs/cms/aws.py +++ b/lms/envs/cms/aws.py @@ -4,7 +4,7 @@ Settings for the LMS that runs alongside the CMS on AWS # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from ..aws import * diff --git a/lms/envs/cms/dev.py b/lms/envs/cms/dev.py index 260d9e269a..0669147d0f 100644 --- a/lms/envs/cms/dev.py +++ b/lms/envs/cms/dev.py @@ -4,7 +4,7 @@ Settings for the LMS that runs alongside the CMS on AWS # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from ..dev import * diff --git a/lms/envs/cms/microsite_test.py b/lms/envs/cms/microsite_test.py index 09ea6aa3dd..586e357e85 100644 --- a/lms/envs/cms/microsite_test.py +++ b/lms/envs/cms/microsite_test.py @@ -3,7 +3,7 @@ This is a localdev test for the Microsite processing pipeline """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from .dev import * from ..dev import ENV_ROOT, FEATURES diff --git a/lms/envs/common.py b/lms/envs/common.py index 8e167c0074..fda0901581 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -22,7 +22,7 @@ Longer TODO: # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0611, W0614, C0103 +# pylint: disable=wildcard-import, unused-import, unused-wildcard-import, invalid-name import sys import os diff --git a/lms/envs/content.py b/lms/envs/content.py index e00ad4d7f3..90c9f8a0fb 100644 --- a/lms/envs/content.py +++ b/lms/envs/content.py @@ -5,7 +5,7 @@ between dev machines and AWS machines. # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from .aws import * diff --git a/lms/envs/dev.py b/lms/envs/dev.py index 8318cc26be..85ce3e3906 100644 --- a/lms/envs/dev.py +++ b/lms/envs/dev.py @@ -10,7 +10,7 @@ sessions. Assumes structure: # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from .common import * from logsettings import get_logger_config @@ -308,6 +308,6 @@ REGISTRATION_CODE_LENGTH = 8 ##################################################################### # Lastly, see if the developer has any local overrides. try: - from .private import * # pylint: disable=F0401 + from .private import * # pylint: disable=import-error except ImportError: pass diff --git a/lms/envs/dev_ike.py b/lms/envs/dev_ike.py index 92dac61765..9aea2f0e10 100644 --- a/lms/envs/dev_ike.py +++ b/lms/envs/dev_ike.py @@ -10,7 +10,7 @@ sessions. Assumes structure: # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from .common import * from .dev import * diff --git a/lms/envs/dev_int.py b/lms/envs/dev_int.py index c66bdb47d2..f6e5ef028e 100644 --- a/lms/envs/dev_int.py +++ b/lms/envs/dev_int.py @@ -12,7 +12,7 @@ use *.dev domains instead for local testing. # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from .dev import * diff --git a/lms/envs/dev_with_worker.py b/lms/envs/dev_with_worker.py index 078567c493..40f6ed4e1f 100644 --- a/lms/envs/dev_with_worker.py +++ b/lms/envs/dev_with_worker.py @@ -10,7 +10,7 @@ django_admin.py celery worker # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from dev import * diff --git a/lms/envs/devgroups/courses.py b/lms/envs/devgroups/courses.py index d353c87dec..edf7484bbf 100644 --- a/lms/envs/devgroups/courses.py +++ b/lms/envs/devgroups/courses.py @@ -1,7 +1,7 @@ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from ..dev import * diff --git a/lms/envs/devgroups/h_cs50.py b/lms/envs/devgroups/h_cs50.py index 21c959f5ce..2c64946a3f 100644 --- a/lms/envs/devgroups/h_cs50.py +++ b/lms/envs/devgroups/h_cs50.py @@ -1,7 +1,7 @@ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from .courses import * diff --git a/lms/envs/devgroups/m_6002.py b/lms/envs/devgroups/m_6002.py index d3c10fcd04..5df2a33440 100644 --- a/lms/envs/devgroups/m_6002.py +++ b/lms/envs/devgroups/m_6002.py @@ -1,7 +1,7 @@ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from .courses import * diff --git a/lms/envs/devgroups/portal.py b/lms/envs/devgroups/portal.py index 8e4635cc66..e972d9f36c 100644 --- a/lms/envs/devgroups/portal.py +++ b/lms/envs/devgroups/portal.py @@ -5,7 +5,7 @@ get shared sessions) # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from courses import * diff --git a/lms/envs/devstack.py b/lms/envs/devstack.py index cdd02fb329..255d180e8b 100644 --- a/lms/envs/devstack.py +++ b/lms/envs/devstack.py @@ -98,7 +98,7 @@ FEATURES['ENABLE_VIDEO_ABSTRACTION_LAYER_API'] = True ##################################################################### # See if the developer has any local overrides. try: - from .private import * # pylint: disable=F0401 + from .private import * # pylint: disable=import-error except ImportError: pass diff --git a/lms/envs/discussionsettings.py b/lms/envs/discussionsettings.py index 1ac4c23af8..f32fb43e44 100644 --- a/lms/envs/discussionsettings.py +++ b/lms/envs/discussionsettings.py @@ -1,5 +1,5 @@ # We intentionally define variables that aren't used -# pylint: disable=W0614 +# pylint: disable=unused-wildcard-import DISCUSSION_ALLOWED_UPLOAD_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff') diff --git a/lms/envs/edx4edx_aws.py b/lms/envs/edx4edx_aws.py index af60e906f8..4ff2133e7b 100644 --- a/lms/envs/edx4edx_aws.py +++ b/lms/envs/edx4edx_aws.py @@ -1,6 +1,6 @@ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import # Settings for edx4edx production instance from .aws import * diff --git a/lms/envs/load_test.py b/lms/envs/load_test.py index f23ddbe066..c21e226527 100644 --- a/lms/envs/load_test.py +++ b/lms/envs/load_test.py @@ -4,7 +4,7 @@ Settings for load testing. # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from .aws import * diff --git a/lms/envs/sauce.py b/lms/envs/sauce.py index 0ab56a1004..c8c7577ed5 100644 --- a/lms/envs/sauce.py +++ b/lms/envs/sauce.py @@ -5,7 +5,7 @@ so that we can run the lettuce acceptance tests on SauceLabs. # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from selenium.webdriver.common.desired_capabilities import DesiredCapabilities import os diff --git a/lms/envs/static.py b/lms/envs/static.py index ce3d8d610f..101d790420 100644 --- a/lms/envs/static.py +++ b/lms/envs/static.py @@ -10,7 +10,7 @@ sessions. Assumes structure: # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from .common import * from logsettings import get_logger_config diff --git a/lms/envs/test.py b/lms/envs/test.py index 8682477044..de74f29c0f 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -10,7 +10,7 @@ sessions. Assumes structure: # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files -# pylint: disable=W0401, W0614 +# pylint: disable=wildcard-import, unused-wildcard-import from .common import * import os diff --git a/lms/startup.py b/lms/startup.py index f0e3777e53..1e02c56144 100644 --- a/lms/startup.py +++ b/lms/startup.py @@ -5,7 +5,7 @@ Module for code that should run during LMS startup from django.conf import settings # Force settings to run so that the python path is modified -settings.INSTALLED_APPS # pylint: disable=W0104 +settings.INSTALLED_APPS # pylint: disable=pointless-statement from django_startup import autostartup import edxmako diff --git a/pavelib/assets.py b/pavelib/assets.py index 5e8e6045fb..a27aa2d164 100644 --- a/pavelib/assets.py +++ b/pavelib/assets.py @@ -60,7 +60,7 @@ class CoffeeScriptWatcher(PatternMatchingEventHandler): print('\tCHANGED:', event.src_path) try: compile_coffeescript(event.src_path) - except Exception: # pylint: disable=W0703 + except Exception: # pylint: disable=broad-except traceback.print_exc() @@ -89,7 +89,7 @@ class SassWatcher(PatternMatchingEventHandler): print('\tCHANGED:', event.src_path) try: compile_sass() - except Exception: # pylint: disable=W0703 + except Exception: # pylint: disable=broad-except traceback.print_exc() @@ -110,7 +110,7 @@ class XModuleSassWatcher(SassWatcher): print('\tCHANGED:', event.src_path) try: process_xmodule_assets() - except Exception: # pylint: disable=W0703 + except Exception: # pylint: disable=broad-except traceback.print_exc() diff --git a/pavelib/paver_tests/test_prereqs.py b/pavelib/paver_tests/test_prereqs.py index cf08ddde35..e4586d1843 100644 --- a/pavelib/paver_tests/test_prereqs.py +++ b/pavelib/paver_tests/test_prereqs.py @@ -37,4 +37,3 @@ class TestPaverPrereqInstall(unittest.TestCase): def test_no_prereq_install_1(self): self.check_val('1', True) -