From ee0f4b259430c7af5be913d0f6ecd39fa8475cc9 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 3 Aug 2015 15:44:29 -0400 Subject: [PATCH] Remove 'pylint: disable=no-value-for-parameter' that we no longer need. --- cms/djangoapps/contentstore/features/component.py | 2 +- cms/envs/bok_choy.py | 8 ++++---- cms/envs/devstack_optimized.py | 2 +- cms/envs/test_static_optimized.py | 2 +- common/djangoapps/course_modes/urls.py | 2 +- .../xmodule/xmodule/modulestore/tests/test_mongo.py | 10 +++++----- common/test/acceptance/tests/helpers.py | 2 +- lms/djangoapps/courseware/features/lti.py | 2 +- lms/djangoapps/dashboard/sysadmin_urls.py | 1 - lms/djangoapps/verify_student/urls.py | 10 +++++----- lms/envs/bok_choy.py | 6 +++--- lms/envs/devstack_optimized.py | 2 +- lms/envs/test_static_optimized.py | 2 +- 13 files changed, 25 insertions(+), 26 deletions(-) diff --git a/cms/djangoapps/contentstore/features/component.py b/cms/djangoapps/contentstore/features/component.py index f30ede9030..1d3f7e3a47 100644 --- a/cms/djangoapps/contentstore/features/component.py +++ b/cms/djangoapps/contentstore/features/component.py @@ -76,7 +76,7 @@ def see_a_problem_component(step, category): problem_css = 'li.studio-xblock-wrapper div.xblock-student_view' # This view presents the given problem component in uppercase. Assert that the text matches # the component selected (in uppercase) - assert_true(world.css_contains_text(problem_css, category.upper())) # pylint: disable=no-value-for-parameter + assert_true(world.css_contains_text(problem_css, category.upper())) @step(u'I add a "([^"]*)" "([^"]*)" component$') diff --git a/cms/envs/bok_choy.py b/cms/envs/bok_choy.py index 51a4a5179b..90187a7a44 100644 --- a/cms/envs/bok_choy.py +++ b/cms/envs/bok_choy.py @@ -26,7 +26,7 @@ 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=no-value-for-parameter +os.environ['CONFIG_ROOT'] = path(__file__).abspath().dirname() from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import @@ -36,7 +36,7 @@ from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import INSTALLED_APPS += ('django_extensions',) # Redirect to the test_root folder within the repo -TEST_ROOT = REPO_ROOT / "test_root" # pylint: disable=no-value-for-parameter +TEST_ROOT = REPO_ROOT / "test_root" GITHUB_REPO_ROOT = (TEST_ROOT / "data").abspath() LOG_DIR = (TEST_ROOT / "log").abspath() DATA_DIR = TEST_ROOT / "data" @@ -45,7 +45,7 @@ DATA_DIR = TEST_ROOT / "data" update_module_store_settings( MODULESTORE, module_store_options={ - 'fs_root': (TEST_ROOT / "data").abspath(), # pylint: disable=no-value-for-parameter + 'fs_root': (TEST_ROOT / "data").abspath(), }, xml_store_options={ 'data_dir': (TEST_ROOT / "data").abspath(), @@ -112,7 +112,7 @@ FEATURES['ENABLE_LIBRARY_INDEX'] = True SEARCH_ENGINE = "search.tests.mock_search_engine.MockSearchEngine" # Path at which to store the mock index MOCK_SEARCH_BACKING_FILE = ( - TEST_ROOT / "index_file.dat" # pylint: disable=no-value-for-parameter + TEST_ROOT / "index_file.dat" ).abspath() # Generate a random UUID so that different runs of acceptance tests don't break each other diff --git a/cms/envs/devstack_optimized.py b/cms/envs/devstack_optimized.py index 7e1cc2c792..ae2cdd541b 100644 --- a/cms/envs/devstack_optimized.py +++ b/cms/envs/devstack_optimized.py @@ -22,7 +22,7 @@ invoked each time that changes have been made. from .devstack import * # pylint: disable=wildcard-import, unused-wildcard-import -TEST_ROOT = REPO_ROOT / "test_root" # pylint: disable=no-value-for-parameter +TEST_ROOT = REPO_ROOT / "test_root" ############################ STATIC FILES ############################# diff --git a/cms/envs/test_static_optimized.py b/cms/envs/test_static_optimized.py index 9d7a8fc63d..61cca130c1 100644 --- a/cms/envs/test_static_optimized.py +++ b/cms/envs/test_static_optimized.py @@ -23,7 +23,7 @@ DATABASES = { ######################### Static file overrides #################################### # Redirect to the test_root folder within the repo -TEST_ROOT = REPO_ROOT / "test_root" # pylint: disable=no-value-for-parameter +TEST_ROOT = REPO_ROOT / "test_root" LOG_DIR = (TEST_ROOT / "log").abspath() # Store the static files under test root so that they don't overwrite existing static assets diff --git a/common/djangoapps/course_modes/urls.py b/common/djangoapps/course_modes/urls.py index 2f5c7a7cf3..4d21362575 100644 --- a/common/djangoapps/course_modes/urls.py +++ b/common/djangoapps/course_modes/urls.py @@ -6,7 +6,7 @@ from course_modes import views urlpatterns = patterns( '', # pylint seems to dislike as_view() calls because it's a `classonlymethod` instead of `classmethod`, so we disable the warning - url(r'^choose/{}/$'.format(settings.COURSE_ID_PATTERN), views.ChooseModeView.as_view(), name='course_modes_choose'), # pylint: disable=no-value-for-parameter + url(r'^choose/{}/$'.format(settings.COURSE_ID_PATTERN), views.ChooseModeView.as_view(), name='course_modes_choose'), ) # Enable verified mode creation diff --git a/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py b/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py index 4397312c2f..523286eb8f 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_mongo.py @@ -217,7 +217,7 @@ class TestMongoModuleStore(TestMongoModuleStoreBase): # When we fix the caching issue, we should reduce this # to 6 and remove the 'treexport_peer_component' course_id # from the list below - assert_equals(len(courses), 7) # pylint: disable=no-value-for-parameter + assert_equals(len(courses), 7) course_ids = [course.id for course in courses] for course_key in [ @@ -252,7 +252,7 @@ class TestMongoModuleStore(TestMongoModuleStoreBase): """ courses = self.draft_store.get_courses(org='guestx') - assert_equals(len(courses), 1) # pylint: disable=no-value-for-parameter + assert_equals(len(courses), 1) course_ids = [course.id for course in courses] for course_key in [ @@ -261,7 +261,7 @@ class TestMongoModuleStore(TestMongoModuleStoreBase): ['guestx', 'foo', 'bar'] ] ]: - assert_in(course_key, course_ids) # pylint: disable=no-value-for-parameter + assert_in(course_key, course_ids) courses = self.draft_store.get_courses(org='edX') # note, the number of courses expected is really @@ -270,7 +270,7 @@ class TestMongoModuleStore(TestMongoModuleStoreBase): # When we fix the caching issue, we should reduce this # to 6 and remove the 'treexport_peer_component' course_id # from the list below - assert_equals(len(courses), 6) # pylint: disable=no-value-for-parameter + assert_equals(len(courses), 6) course_ids = [course.id for course in courses] for course_key in [ @@ -286,7 +286,7 @@ class TestMongoModuleStore(TestMongoModuleStoreBase): ['edX', 'treeexport_peer_component', 'export_peer_component'], ] ]: - assert_in(course_key, course_ids) # pylint: disable=no-value-for-parameter + assert_in(course_key, course_ids) def test_no_such_course(self): """ diff --git a/common/test/acceptance/tests/helpers.py b/common/test/acceptance/tests/helpers.py index b521ddfca0..a3e9031a58 100644 --- a/common/test/acceptance/tests/helpers.py +++ b/common/test/acceptance/tests/helpers.py @@ -90,7 +90,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=no-value-for-parameter + full_path = path(__file__).abspath().dirname() / "data" / rel_path with open(full_path) as data_file: return data_file.read() diff --git a/lms/djangoapps/courseware/features/lti.py b/lms/djangoapps/courseware/features/lti.py index 670c3014a8..75f9950e94 100644 --- a/lms/djangoapps/courseware/features/lti.py +++ b/lms/djangoapps/courseware/features/lti.py @@ -277,7 +277,7 @@ def check_lti_popup(parent_window): for window in windows: world.browser.switch_to_window(window) tabs.append(world.browser.title) - assert_equal(tabs, expected_tabs) # pylint: disable=no-value-for-parameter + assert_equal(tabs, expected_tabs) # Now verify the contents of the LTI window (which is the 2nd window/tab) # Note: The LTI opens in a new browser window, but Selenium sticks with the diff --git a/lms/djangoapps/dashboard/sysadmin_urls.py b/lms/djangoapps/dashboard/sysadmin_urls.py index a762e97562..489cf877cf 100644 --- a/lms/djangoapps/dashboard/sysadmin_urls.py +++ b/lms/djangoapps/dashboard/sysadmin_urls.py @@ -1,7 +1,6 @@ """ Urls for sysadmin dashboard feature """ -# pylint: disable=no-value-for-parameter from django.conf.urls import patterns, url diff --git a/lms/djangoapps/verify_student/urls.py b/lms/djangoapps/verify_student/urls.py index 764ac34311..755b31652c 100644 --- a/lms/djangoapps/verify_student/urls.py +++ b/lms/djangoapps/verify_student/urls.py @@ -16,7 +16,7 @@ urlpatterns = patterns( r'^start-flow/{course}/$'.format(course=settings.COURSE_ID_PATTERN), # Pylint seems to dislike the as_view() method because as_view() is # decorated with `classonlymethod` instead of `classmethod`. - views.PayAndVerifyView.as_view(), # pylint: disable=no-value-for-parameter + views.PayAndVerifyView.as_view(), name="verify_student_start_flow", kwargs={ 'message': views.PayAndVerifyView.FIRST_TIME_VERIFY_MSG @@ -28,7 +28,7 @@ urlpatterns = patterns( # except with slight messaging changes. url( r'^upgrade/{course}/$'.format(course=settings.COURSE_ID_PATTERN), - views.PayAndVerifyView.as_view(), # pylint: disable=no-value-for-parameter + views.PayAndVerifyView.as_view(), name="verify_student_upgrade_and_verify", kwargs={ 'message': views.PayAndVerifyView.UPGRADE_MSG @@ -43,7 +43,7 @@ urlpatterns = patterns( # to the dashboard. url( r'^verify-now/{course}/$'.format(course=settings.COURSE_ID_PATTERN), - views.PayAndVerifyView.as_view(), # pylint: disable=no-value-for-parameter + views.PayAndVerifyView.as_view(), name="verify_student_verify_now", kwargs={ 'always_show_payment': True, @@ -59,7 +59,7 @@ urlpatterns = patterns( # (since the user already paid). url( r'^verify-later/{course}/$'.format(course=settings.COURSE_ID_PATTERN), - views.VerifyLaterView.as_view(), # pylint: disable=no-value-for-parameter + views.VerifyLaterView.as_view(), name="verify_student_verify_later" ), @@ -68,7 +68,7 @@ urlpatterns = patterns( # once the order has been fulfilled. url( r'^payment-confirmation/{course}/$'.format(course=settings.COURSE_ID_PATTERN), - views.PayAndVerifyView.as_view(), # pylint: disable=no-value-for-parameter + views.PayAndVerifyView.as_view(), name="verify_student_payment_confirmation", kwargs={ 'always_show_payment': True, diff --git a/lms/envs/bok_choy.py b/lms/envs/bok_choy.py index cbbc1f21ab..5dba353e7d 100644 --- a/lms/envs/bok_choy.py +++ b/lms/envs/bok_choy.py @@ -19,7 +19,7 @@ from tempfile import mkdtemp # and throws spurious errors. Therefore, we disable invalid-name checking. # pylint: disable=invalid-name -CONFIG_ROOT = path(__file__).abspath().dirname() # pylint: disable=no-value-for-parameter +CONFIG_ROOT = path(__file__).abspath().dirname() TEST_ROOT = CONFIG_ROOT.dirname().dirname() / "test_root" ########################## Prod-like settings ################################### @@ -47,7 +47,7 @@ LOG_DIR = (TEST_ROOT / "log").abspath() update_module_store_settings( MODULESTORE, module_store_options={ - 'fs_root': (TEST_ROOT / "data").abspath(), # pylint: disable=no-value-for-parameter + 'fs_root': (TEST_ROOT / "data").abspath(), }, xml_store_options={ 'data_dir': (TEST_ROOT / "data").abspath(), @@ -161,7 +161,7 @@ FEATURES['ENABLE_DASHBOARD_SEARCH'] = True SEARCH_ENGINE = "search.tests.mock_search_engine.MockSearchEngine" # Path at which to store the mock index MOCK_SEARCH_BACKING_FILE = ( - TEST_ROOT / "index_file.dat" # pylint: disable=no-value-for-parameter + TEST_ROOT / "index_file.dat" ).abspath() # Generate a random UUID so that different runs of acceptance tests don't break each other diff --git a/lms/envs/devstack_optimized.py b/lms/envs/devstack_optimized.py index 71778a32f9..813916c7eb 100644 --- a/lms/envs/devstack_optimized.py +++ b/lms/envs/devstack_optimized.py @@ -22,7 +22,7 @@ invoked each time that changes have been made. from .devstack import * # pylint: disable=wildcard-import, unused-wildcard-import -TEST_ROOT = REPO_ROOT / "test_root" # pylint: disable=no-value-for-parameter +TEST_ROOT = REPO_ROOT / "test_root" ############################ STATIC FILES ############################# diff --git a/lms/envs/test_static_optimized.py b/lms/envs/test_static_optimized.py index 223724ee16..339189b566 100644 --- a/lms/envs/test_static_optimized.py +++ b/lms/envs/test_static_optimized.py @@ -35,7 +35,7 @@ XQUEUE_INTERFACE = { ######################### Static file overrides #################################### # Redirect to the test_root folder within the repo -TEST_ROOT = REPO_ROOT / "test_root" # pylint: disable=no-value-for-parameter +TEST_ROOT = REPO_ROOT / "test_root" LOG_DIR = (TEST_ROOT / "log").abspath() # Store the static files under test root so that they don't overwrite existing static assets