diff --git a/common/test/acceptance/fixtures/base.py b/common/test/acceptance/fixtures/base.py index 6979a6440b..f415e11f48 100644 --- a/common/test/acceptance/fixtures/base.py +++ b/common/test/acceptance/fixtures/base.py @@ -6,7 +6,7 @@ Common code shared by course and library fixtures. import json import requests -import six +import six # lint-amnesty, pylint: disable=unused-import from lazy import lazy from common.test.acceptance.fixtures import STUDIO_BASE_URL @@ -16,7 +16,7 @@ class StudioApiLoginError(Exception): """ Error occurred while logging in to the Studio API. """ - pass + pass # lint-amnesty, pylint: disable=unnecessary-pass class StudioApiFixture(object): @@ -57,7 +57,7 @@ class StudioApiFixture(object): Log in as a staff user, then return the cookies for the session (as a dict) Raises a `StudioApiLoginError` if the login fails. """ - return {key: val for key, val in self.session.cookies.items()} + return {key: val for key, val in self.session.cookies.items()} # lint-amnesty, pylint: disable=unnecessary-comprehension @lazy def headers(self): @@ -75,7 +75,7 @@ class FixtureError(Exception): """ Error occurred while installing a course or library fixture. """ - pass + pass # lint-amnesty, pylint: disable=unnecessary-pass class XBlockContainerFixture(StudioApiFixture): @@ -85,7 +85,7 @@ class XBlockContainerFixture(StudioApiFixture): def __init__(self): self.children = [] - super(XBlockContainerFixture, self).__init__() + super(XBlockContainerFixture, self).__init__() # lint-amnesty, pylint: disable=super-with-arguments def add_children(self, *args): """ @@ -133,7 +133,7 @@ class XBlockContainerFixture(StudioApiFixture): loc = response.json().get('locator') xblock_desc.locator = loc except ValueError: - raise FixtureError(u"Could not decode JSON from '{0}'".format(response.content)) + raise FixtureError(u"Could not decode JSON from '{0}'".format(response.content)) # lint-amnesty, pylint: disable=raise-missing-from # Configure the XBlock response = self.session.post( diff --git a/common/test/acceptance/fixtures/certificates.py b/common/test/acceptance/fixtures/certificates.py index b8e613a766..ff4ed291e5 100644 --- a/common/test/acceptance/fixtures/certificates.py +++ b/common/test/acceptance/fixtures/certificates.py @@ -13,14 +13,14 @@ class CertificateConfigFixtureError(Exception): """ Error occurred while installing certificate config fixture. """ - pass + pass # lint-amnesty, pylint: disable=unnecessary-pass class CertificateConfigUpdateFixtureError(Exception): """ Error occurred while updating certificate config fixture. """ - pass + pass # lint-amnesty, pylint: disable=unnecessary-pass class CertificateConfigFixture(StudioApiFixture): @@ -32,7 +32,7 @@ class CertificateConfigFixture(StudioApiFixture): def __init__(self, course_id, certificates_data): self.course_id = course_id self.certificates = certificates_data - super(CertificateConfigFixture, self).__init__() + super(CertificateConfigFixture, self).__init__() # lint-amnesty, pylint: disable=super-with-arguments def install(self): """ diff --git a/common/test/acceptance/fixtures/config.py b/common/test/acceptance/fixtures/config.py index ad6152be12..9ee545a98f 100644 --- a/common/test/acceptance/fixtures/config.py +++ b/common/test/acceptance/fixtures/config.py @@ -17,7 +17,7 @@ class ConfigModelFixtureError(Exception): """ Error occurred while configuring the stub XQueue. """ - pass + pass # lint-amnesty, pylint: disable=unnecessary-pass class ConfigModelFixture(object): @@ -62,7 +62,7 @@ class ConfigModelFixture(object): Log in as a staff user, then return the cookies for the session (as a dict) Raises a `ConfigModelFixtureError` if the login fails. """ - return {key: val for key, val in self.session.cookies.items()} + return {key: val for key, val in self.session.cookies.items()} # lint-amnesty, pylint: disable=unnecessary-comprehension @lazy def headers(self): diff --git a/common/test/acceptance/fixtures/course.py b/common/test/acceptance/fixtures/course.py index 5bc2ef728d..edc44e4e45 100644 --- a/common/test/acceptance/fixtures/course.py +++ b/common/test/acceptance/fixtures/course.py @@ -120,7 +120,7 @@ class CourseFixture(XBlockContainerFixture): to enable entrance exam settings would be a dict like this {"entrance_exam_enabled": "true"} These have the same meaning as in the Studio restful API /course end-point. """ - super(CourseFixture, self).__init__() + super(CourseFixture, self).__init__() # lint-amnesty, pylint: disable=super-with-arguments self._course_dict = { 'org': org, 'number': number, @@ -242,7 +242,7 @@ class CourseFixture(XBlockContainerFixture): try: course_outline_json = response.json() except ValueError: - raise FixtureError( + raise FixtureError( # lint-amnesty, pylint: disable=raise-missing-from u"Could not decode course outline as JSON: '{0}'".format(response) ) return course_outline_json @@ -290,7 +290,7 @@ class CourseFixture(XBlockContainerFixture): err = response.json().get('ErrMsg') except ValueError: - raise FixtureError( + raise FixtureError( # lint-amnesty, pylint: disable=raise-missing-from u"Could not parse response from course request as JSON: '{0}'".format( response.content)) @@ -322,7 +322,7 @@ class CourseFixture(XBlockContainerFixture): try: details = response.json() except ValueError: - raise FixtureError( + raise FixtureError( # lint-amnesty, pylint: disable=raise-missing-from u"Could not decode course details as JSON: '{0}'".format(details) ) @@ -397,7 +397,7 @@ class CourseFixture(XBlockContainerFixture): for asset_name in self._assets: asset_file_path = test_dir + '/data/uploads/' + asset_name - asset_file = open(asset_file_path, mode='rb') # pylint: disable=open-builtin + asset_file = open(asset_file_path, mode='rb') # lint-amnesty, pylint: disable=bad-option-value, open-builtin files = {'file': (asset_name, asset_file, mimetypes.guess_type(asset_file_path)[0])} headers = { @@ -447,5 +447,5 @@ class CourseFixture(XBlockContainerFixture): """ Recursively create XBlock children. """ - super(CourseFixture, self)._create_xblock_children(parent_loc, xblock_descriptions) + super(CourseFixture, self)._create_xblock_children(parent_loc, xblock_descriptions) # lint-amnesty, pylint: disable=super-with-arguments self._publish_xblock(parent_loc) diff --git a/common/test/acceptance/fixtures/discussion.py b/common/test/acceptance/fixtures/discussion.py index 3e507c0bec..1e1bf99ce8 100644 --- a/common/test/acceptance/fixtures/discussion.py +++ b/common/test/acceptance/fixtures/discussion.py @@ -13,7 +13,7 @@ from common.test.acceptance.fixtures import COMMENTS_STUB_URL from common.test.acceptance.fixtures.config import ConfigModelFixture -class ContentFactory(factory.Factory): +class ContentFactory(factory.Factory): # lint-amnesty, pylint: disable=missing-class-docstring class Meta(object): model = dict @@ -40,7 +40,7 @@ class ContentFactory(factory.Factory): return kwargs -class Thread(ContentFactory): +class Thread(ContentFactory): # lint-amnesty, pylint: disable=missing-class-docstring thread_type = "discussion" anonymous = False anonymous_to_peers = False @@ -67,7 +67,7 @@ class Response(Comment): body = "dummy response body" -class SearchResult(factory.Factory): +class SearchResult(factory.Factory): # lint-amnesty, pylint: disable=missing-class-docstring class Meta(object): model = dict @@ -78,7 +78,7 @@ class SearchResult(factory.Factory): corrected_text = None -class DiscussionContentFixture(object): +class DiscussionContentFixture(object): # lint-amnesty, pylint: disable=missing-class-docstring def push(self): """ @@ -96,12 +96,12 @@ class DiscussionContentFixture(object): raise NotImplementedError() -class SingleThreadViewFixture(DiscussionContentFixture): +class SingleThreadViewFixture(DiscussionContentFixture): # lint-amnesty, pylint: disable=missing-class-docstring def __init__(self, thread): self.thread = thread - def addResponse(self, response, comments=[]): + def addResponse(self, response, comments=[]): # lint-amnesty, pylint: disable=dangerous-default-value, missing-function-docstring response['children'] = comments if self.thread["thread_type"] == "discussion": responseListAttr = "children" @@ -133,7 +133,7 @@ class SingleThreadViewFixture(DiscussionContentFixture): } -class MultipleThreadFixture(DiscussionContentFixture): +class MultipleThreadFixture(DiscussionContentFixture): # lint-amnesty, pylint: disable=missing-class-docstring def __init__(self, threads): self.threads = threads @@ -157,7 +157,7 @@ class MultipleThreadFixture(DiscussionContentFixture): thread['comments_count'] += len(comments) + 1 -class UserProfileViewFixture(DiscussionContentFixture): +class UserProfileViewFixture(DiscussionContentFixture): # lint-amnesty, pylint: disable=missing-class-docstring def __init__(self, threads): self.threads = threads @@ -166,7 +166,7 @@ class UserProfileViewFixture(DiscussionContentFixture): return {"active_threads": json.dumps(self.threads)} -class SearchResultFixture(DiscussionContentFixture): +class SearchResultFixture(DiscussionContentFixture): # lint-amnesty, pylint: disable=missing-class-docstring def __init__(self, result): self.result = result diff --git a/common/test/acceptance/fixtures/library.py b/common/test/acceptance/fixtures/library.py index a00f972ef5..0fd4a4ea64 100644 --- a/common/test/acceptance/fixtures/library.py +++ b/common/test/acceptance/fixtures/library.py @@ -22,7 +22,7 @@ class LibraryFixture(XBlockContainerFixture): """ Configure the library fixture to create a library with """ - super(LibraryFixture, self).__init__() + super(LibraryFixture, self).__init__() # lint-amnesty, pylint: disable=super-with-arguments self.library_info = { 'org': org, 'number': number, @@ -31,7 +31,7 @@ class LibraryFixture(XBlockContainerFixture): self.display_name = display_name self._library_key = None - super(LibraryFixture, self).__init__() + super(LibraryFixture, self).__init__() # lint-amnesty, pylint: disable=super-with-arguments def __str__(self): """ @@ -92,4 +92,4 @@ class LibraryFixture(XBlockContainerFixture): # Disable publishing for library XBlocks: xblock_desc.publish = "not-applicable" - return super(LibraryFixture, self).create_xblock(parent_loc, xblock_desc) + return super(LibraryFixture, self).create_xblock(parent_loc, xblock_desc) # lint-amnesty, pylint: disable=super-with-arguments diff --git a/common/test/acceptance/pages/common/auto_auth.py b/common/test/acceptance/pages/common/auto_auth.py index 0e11d7d039..8a7b11d9e8 100644 --- a/common/test/acceptance/pages/common/auto_auth.py +++ b/common/test/acceptance/pages/common/auto_auth.py @@ -45,7 +45,7 @@ class AutoAuthPage(PageObject): Note that "global staff" is NOT the same as course staff. """ - super(AutoAuthPage, self).__init__(browser) + super(AutoAuthPage, self).__init__(browser) # lint-amnesty, pylint: disable=super-with-arguments # This will eventually hold the details about the user account self._user_info = None diff --git a/common/test/acceptance/pages/common/utils.py b/common/test/acceptance/pages/common/utils.py index beff6a78a1..4bdea6fb98 100644 --- a/common/test/acceptance/pages/common/utils.py +++ b/common/test/acceptance/pages/common/utils.py @@ -43,4 +43,4 @@ def confirm_prompt(page, cancel=False, require_notification=None): confirmation_button_css = '.prompt .action-' + ('secondary' if cancel else 'primary') page.wait_for_element_visibility(confirmation_button_css, 'Confirmation button is visible') require_notification = (not cancel) if require_notification is None else require_notification - click_css(page, confirmation_button_css, require_notification=require_notification) + click_css(page, confirmation_button_css, require_notification=require_notification) # lint-amnesty, pylint: disable=unexpected-keyword-arg diff --git a/common/test/acceptance/pages/lms/catalog.py b/common/test/acceptance/pages/lms/catalog.py index ad077f416b..1930b11261 100644 --- a/common/test/acceptance/pages/lms/catalog.py +++ b/common/test/acceptance/pages/lms/catalog.py @@ -24,4 +24,4 @@ class CacheProgramsPage(PageObject): body = self.q(css='body').text[0] match = re.search(r'programs cached', body, flags=re.IGNORECASE) - return True if match else False + return True if match else False # lint-amnesty, pylint: disable=simplifiable-if-expression diff --git a/common/test/acceptance/pages/lms/course_home.py b/common/test/acceptance/pages/lms/course_home.py index 08121cd057..20e024a877 100644 --- a/common/test/acceptance/pages/lms/course_home.py +++ b/common/test/acceptance/pages/lms/course_home.py @@ -20,7 +20,7 @@ class CourseHomePage(CoursePage): return self.q(css='.course-outline').present def __init__(self, browser, course_id): - super(CourseHomePage, self).__init__(browser, course_id) + super(CourseHomePage, self).__init__(browser, course_id) # lint-amnesty, pylint: disable=super-with-arguments self.course_id = course_id self.preview = StaffPreviewPage(browser, self) # TODO: TNL-6546: Remove the following diff --git a/common/test/acceptance/pages/lms/course_page.py b/common/test/acceptance/pages/lms/course_page.py index 737ed78b16..1b0b9a8b0e 100644 --- a/common/test/acceptance/pages/lms/course_page.py +++ b/common/test/acceptance/pages/lms/course_page.py @@ -9,7 +9,7 @@ from common.test.acceptance.pages.lms import BASE_URL from common.test.acceptance.pages.lms.tab_nav import TabNavPage -class CoursePage(PageObject): +class CoursePage(PageObject): # lint-amnesty, pylint: disable=abstract-method """ Abstract base class for page objects within a course. """ @@ -23,7 +23,7 @@ class CoursePage(PageObject): Course ID is currently of the form "edx/999/2013_Spring" but this format could change. """ - super(CoursePage, self).__init__(browser) + super(CoursePage, self).__init__(browser) # lint-amnesty, pylint: disable=super-with-arguments self.course_id = course_id @property diff --git a/common/test/acceptance/pages/lms/course_wiki.py b/common/test/acceptance/pages/lms/course_wiki.py index f15a67bc85..af675ba224 100644 --- a/common/test/acceptance/pages/lms/course_wiki.py +++ b/common/test/acceptance/pages/lms/course_wiki.py @@ -57,7 +57,7 @@ class CourseWikiSubviewPage(CoursePage): # pylint: disable=abstract-method Course ID is currently of the form "edx/999/2013_Spring" but this format could change. """ - super(CourseWikiSubviewPage, self).__init__(browser, course_id) + super(CourseWikiSubviewPage, self).__init__(browser, course_id) # lint-amnesty, pylint: disable=super-with-arguments self.course_id = course_id self.course_info = course_info self.article_name = "{org}.{course_number}.{course_run}".format( diff --git a/common/test/acceptance/pages/lms/courseware.py b/common/test/acceptance/pages/lms/courseware.py index 2b06f499d0..222d946b53 100644 --- a/common/test/acceptance/pages/lms/courseware.py +++ b/common/test/acceptance/pages/lms/courseware.py @@ -20,8 +20,8 @@ class CoursewarePage(CoursePage): section_selector = '.chapter' subsection_selector = '.chapter-content-container a' - def __init__(self, browser, course_id): - super(CoursewarePage, self).__init__(browser, course_id) + def __init__(self, browser, course_id): # lint-amnesty, pylint: disable=useless-super-delegation + super(CoursewarePage, self).__init__(browser, course_id) # lint-amnesty, pylint: disable=super-with-arguments # self.nav = CourseNavPage(browser, self) def is_browser_on_page(self): diff --git a/common/test/acceptance/pages/lms/discussion.py b/common/test/acceptance/pages/lms/discussion.py index 711b8eec5f..9ba7b6a12b 100644 --- a/common/test/acceptance/pages/lms/discussion.py +++ b/common/test/acceptance/pages/lms/discussion.py @@ -18,7 +18,7 @@ class DiscussionThreadPage(PageObject): url = None def __init__(self, browser, thread_selector): - super(DiscussionThreadPage, self).__init__(browser) + super(DiscussionThreadPage, self).__init__(browser) # lint-amnesty, pylint: disable=super-with-arguments self.thread_selector = thread_selector def _find_within(self, selector): @@ -74,9 +74,9 @@ class DiscussionThreadPage(PageObject): ).fulfill() -class DiscussionTabSingleThreadPage(CoursePage): +class DiscussionTabSingleThreadPage(CoursePage): # lint-amnesty, pylint: disable=missing-class-docstring def __init__(self, browser, course_id, discussion_id, thread_id): - super(DiscussionTabSingleThreadPage, self).__init__(browser, course_id) + super(DiscussionTabSingleThreadPage, self).__init__(browser, course_id) # lint-amnesty, pylint: disable=super-with-arguments self.thread_page = DiscussionThreadPage( browser, u"body.discussion .discussion-article[data-id='{thread_id}']".format(thread_id=thread_id) @@ -103,7 +103,7 @@ class DiscussionTabHomePage(CoursePage): ALERT_SELECTOR = ".discussion-body .forum-nav .search-alert" def __init__(self, browser, course_id): - super(DiscussionTabHomePage, self).__init__(browser, course_id) + super(DiscussionTabHomePage, self).__init__(browser, course_id) # lint-amnesty, pylint: disable=super-with-arguments self.url_path = "discussion/forum/" self.root_selector = None diff --git a/common/test/acceptance/pages/lms/fields.py b/common/test/acceptance/pages/lms/fields.py index 28dc541467..9369f4b375 100644 --- a/common/test/acceptance/pages/lms/fields.py +++ b/common/test/acceptance/pages/lms/fields.py @@ -245,7 +245,7 @@ class FieldsMixin(object): Returns bool based on the highlighted border for field. """ query = self.q(css=u'.u-field-{}.error'.format(field_id)) - return True if query.present else False + return True if query.present else False # lint-amnesty, pylint: disable=simplifiable-if-expression def get_social_first_element(self): """ diff --git a/common/test/acceptance/pages/lms/learner_profile.py b/common/test/acceptance/pages/lms/learner_profile.py index 1de4b84ca6..cc0de5759f 100644 --- a/common/test/acceptance/pages/lms/learner_profile.py +++ b/common/test/acceptance/pages/lms/learner_profile.py @@ -25,7 +25,7 @@ class Badge(PageObject): def __init__(self, element, browser): self.element = element - super(Badge, self).__init__(browser) + super(Badge, self).__init__(browser) # lint-amnesty, pylint: disable=super-with-arguments def is_browser_on_page(self): return BrowserQuery(self.element, css=".badge-details").visible @@ -84,7 +84,7 @@ class LearnerProfilePage(FieldsMixin, PageObject): browser (Browser): The browser instance. username (str): Profile username. """ - super(LearnerProfilePage, self).__init__(browser) + super(LearnerProfilePage, self).__init__(browser) # lint-amnesty, pylint: disable=super-with-arguments self.username = username @property diff --git a/common/test/acceptance/pages/lms/staff_view.py b/common/test/acceptance/pages/lms/staff_view.py index 630e00af93..c9b89b3a54 100644 --- a/common/test/acceptance/pages/lms/staff_view.py +++ b/common/test/acceptance/pages/lms/staff_view.py @@ -28,7 +28,7 @@ class StaffPreviewPage(PageObject): parent_page: None if this is being used as a subclass. Otherwise, the parent_page the contains this staff preview page fragment. """ - super(StaffPreviewPage, self).__init__(browser) + super(StaffPreviewPage, self).__init__(browser) # lint-amnesty, pylint: disable=super-with-arguments self.parent_page = parent_page def is_browser_on_page(self): diff --git a/common/test/acceptance/pages/lms/video/video.py b/common/test/acceptance/pages/lms/video/video.py index 34c7d04e06..55ce59e76f 100644 --- a/common/test/acceptance/pages/lms/video/video.py +++ b/common/test/acceptance/pages/lms/video/video.py @@ -7,7 +7,7 @@ import logging from bok_choy.javascript import js_defined, wait_for_js from bok_choy.page_object import PageObject -from bok_choy.promise import EmptyPromise, Promise +from bok_choy.promise import EmptyPromise, Promise # lint-amnesty, pylint: disable=unused-import log = logging.getLogger('VideoPage') @@ -220,7 +220,7 @@ class VideoPage(PageObject): # toggle captions visibility state if needed if self.is_captions_visible() != captions_new_state: - self.click_player_button('transcript_button') + self.click_player_button('transcript_button') # lint-amnesty, pylint: disable=no-member # Verify that captions state is toggled/changed EmptyPromise(lambda: self.is_captions_visible() == captions_new_state, diff --git a/common/test/acceptance/pages/studio/container.py b/common/test/acceptance/pages/studio/container.py index a0822788bd..82c3510da3 100644 --- a/common/test/acceptance/pages/studio/container.py +++ b/common/test/acceptance/pages/studio/container.py @@ -22,7 +22,7 @@ class ContainerPage(PageObject, HelpMixin): ADD_MISSING_GROUPS_SELECTOR = '.notification-action-button[data-notification-action="add-missing-groups"]' def __init__(self, browser, locator): - super(ContainerPage, self).__init__(browser) + super(ContainerPage, self).__init__(browser) # lint-amnesty, pylint: disable=super-with-arguments self.locator = locator @property @@ -31,7 +31,7 @@ class ContainerPage(PageObject, HelpMixin): return u"{}/container/{}".format(BASE_URL, self.locator) @property - def name(self): + def name(self): # lint-amnesty, pylint: disable=missing-function-docstring titles = self.q(css=self.NAME_SELECTOR).text if titles: return titles[0] @@ -51,7 +51,7 @@ class ContainerPage(PageObject, HelpMixin): if len(data_request_elements) > 0: request_token = data_request_elements.first.attrs('data-request-token')[0] # Then find the number of Studio xblock wrappers on the page with that request token. - num_wrappers = len(self.q(css=u'{} [data-request-token="{}"]'.format(XBlockWrapper.BODY_SELECTOR, request_token)).results) + num_wrappers = len(self.q(css=u'{} [data-request-token="{}"]'.format(XBlockWrapper.BODY_SELECTOR, request_token)).results) # lint-amnesty, pylint: disable=line-too-long # Wait until all components have been loaded and marked as either initialized or failed. # See: # - common/static/js/xblock/core.js which adds the class "xblock-initialized" @@ -159,9 +159,9 @@ class ContainerPage(PageObject, HelpMixin): if not warnings.is_present(): return False warning_text = warnings.first.text[0] - return warning_text == "Caution: The last published version of this unit is live. By publishing changes you will change the student experience." + return warning_text == "Caution: The last published version of this unit is live. By publishing changes you will change the student experience." # lint-amnesty, pylint: disable=line-too-long - def shows_inherited_staff_lock(self, parent_type=None, parent_name=None): + def shows_inherited_staff_lock(self, parent_type=None, parent_name=None): # lint-amnesty, pylint: disable=unused-argument """ Returns True if the unit inherits staff lock from a section or subsection. """ @@ -187,14 +187,14 @@ class ContainerPage(PageObject, HelpMixin): Publishes the container. """ self.scroll_to_element('.action-publish') - click_css(self, '.action-publish', 0, require_notification=False) + click_css(self, '.action-publish', 0, require_notification=False) # lint-amnesty, pylint: disable=unexpected-keyword-arg def discard_changes(self): """ Discards draft changes (which will then re-render the page). """ self.scroll_to_element('a.action-discard') - click_css(self, 'a.action-discard', 0, require_notification=False) + click_css(self, 'a.action-discard', 0, require_notification=False) # lint-amnesty, pylint: disable=unexpected-keyword-arg confirm_prompt(self) self.wait_for_ajax() @@ -237,7 +237,7 @@ class ContainerPage(PageObject, HelpMixin): if not was_locked_initially: self.q(css='a.action-staff-lock').first.click() else: - click_css(self, 'a.action-staff-lock', 0, require_notification=False) + click_css(self, 'a.action-staff-lock', 0, require_notification=False) # lint-amnesty, pylint: disable=unexpected-keyword-arg if not inherits_staff_lock: confirm_prompt(self) self.wait_for_ajax() @@ -299,7 +299,7 @@ class ContainerPage(PageObject, HelpMixin): The index of the first item is 0. """ # Click the delete button - click_css(self, '.delete-button', source_index, require_notification=False) + click_css(self, '.delete-button', source_index, require_notification=False) # lint-amnesty, pylint: disable=unexpected-keyword-arg # Click the confirmation dialog button confirm_prompt(self) @@ -338,7 +338,7 @@ class ContainerPage(PageObject, HelpMixin): """ Click take me there link. """ - click_css(self, '#page-alert .alert.confirmation .nav-actions .action-secondary', require_notification=False) + click_css(self, '#page-alert .alert.confirmation .nav-actions .action-secondary', require_notification=False) # lint-amnesty, pylint: disable=unexpected-keyword-arg def add_missing_groups(self): """ @@ -433,7 +433,7 @@ class XBlockWrapper(PageObject): } def __init__(self, browser, locator): - super(XBlockWrapper, self).__init__(browser) + super(XBlockWrapper, self).__init__(browser) # lint-amnesty, pylint: disable=super-with-arguments self.locator = locator def is_browser_on_page(self): @@ -465,7 +465,7 @@ class XBlockWrapper(PageObject): return self.q(css=self._bounded_selector('.xblock-author_view'))[0].text @property - def name(self): + def name(self): # lint-amnesty, pylint: disable=missing-function-docstring titles = self.q(css=self._bounded_selector(self.NAME_SELECTOR)).text if titles: return titles[0] @@ -618,7 +618,7 @@ class XBlockWrapper(PageObject): """ Opens the move modal. """ - click_css(self, '.move-button', require_notification=False) + click_css(self, '.move-button', require_notification=False) # lint-amnesty, pylint: disable=unexpected-keyword-arg self.wait_for( lambda: self.q(css='.modal-window.move-modal').visible, description='move modal is visible' ) diff --git a/common/test/acceptance/pages/studio/course_page.py b/common/test/acceptance/pages/studio/course_page.py index 370d78eb7b..0a23be3dc0 100644 --- a/common/test/acceptance/pages/studio/course_page.py +++ b/common/test/acceptance/pages/studio/course_page.py @@ -30,7 +30,7 @@ class CoursePage(PageObject, HelpMixin): Should be implemented in child classes. """ - pass + pass # lint-amnesty, pylint: disable=unnecessary-pass def __init__(self, browser, course_org, course_num, course_run): """ @@ -39,7 +39,7 @@ class CoursePage(PageObject, HelpMixin): These identifiers will likely change in the future. """ - super(CoursePage, self).__init__(browser) + super(CoursePage, self).__init__(browser) # lint-amnesty, pylint: disable=super-with-arguments self.course_info = { 'course_org': course_org, 'course_num': course_num, diff --git a/common/test/acceptance/pages/studio/library.py b/common/test/acceptance/pages/studio/library.py index 6a931dca22..c78b2da8bf 100644 --- a/common/test/acceptance/pages/studio/library.py +++ b/common/test/acceptance/pages/studio/library.py @@ -18,7 +18,7 @@ class LibraryPage(PageObject, HelpMixin): Base page for Library pages. Defaults URL to the edit page. """ def __init__(self, browser, locator): - super(LibraryPage, self).__init__(browser) + super(LibraryPage, self).__init__(browser) # lint-amnesty, pylint: disable=super-with-arguments self.locator = locator @property @@ -50,4 +50,4 @@ class LibraryEditPage(LibraryPage, PaginatedMixin, UsersPageMixin): for improved test reliability. """ self.wait_for_ajax() - super(LibraryEditPage, self).wait_until_ready() + super(LibraryEditPage, self).wait_until_ready() # lint-amnesty, pylint: disable=super-with-arguments diff --git a/common/test/acceptance/pages/studio/overview.py b/common/test/acceptance/pages/studio/overview.py index f897922700..409e5e12cb 100644 --- a/common/test/acceptance/pages/studio/overview.py +++ b/common/test/acceptance/pages/studio/overview.py @@ -3,7 +3,7 @@ Course Outline page in Studio. """ -from bok_choy.javascript import js_defined, wait_for_js +from bok_choy.javascript import js_defined, wait_for_js # lint-amnesty, pylint: disable=unused-import from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise from selenium.webdriver.support.ui import Select @@ -58,7 +58,7 @@ class CourseOutlineItem(object): Puts the item into editable form. """ self.q(css=self._bounded_selector(self.CONFIGURATION_BUTTON_SELECTOR)).first.click() # pylint: disable=no-member - if 'subsection' in self.BODY_SELECTOR: + if 'subsection' in self.BODY_SELECTOR: # lint-amnesty, pylint: disable=unsupported-membership-test modal = SubsectionOutlineModal(self) else: modal = CourseOutlineModal(self) @@ -105,7 +105,7 @@ class CourseOutlineChild(PageObject, CourseOutlineItem): BODY_SELECTOR = '.outline-item' def __init__(self, browser, locator): - super(CourseOutlineChild, self).__init__(browser) + super(CourseOutlineChild, self).__init__(browser) # lint-amnesty, pylint: disable=super-with-arguments self.locator = locator def is_browser_on_page(self): @@ -160,7 +160,7 @@ class CourseOutlineSubsection(CourseOutlineContainer, CourseOutlineChild): """ Return the :class:`.CourseOutlineUnit with the title `title`. """ - return self.child(title) + return self.child(title) # lint-amnesty, pylint: disable=no-member def units(self): """ @@ -195,7 +195,7 @@ class CourseOutlineSection(CourseOutlineContainer, CourseOutlineChild): """ Return the :class:`.CourseOutlineSubsection` with the title `title`. """ - return self.child(title) + return self.child(title) # lint-amnesty, pylint: disable=no-member def subsections(self): """ @@ -213,7 +213,7 @@ class CourseOutlineSection(CourseOutlineContainer, CourseOutlineChild): """ Adds a subsection to this section """ - self.add_child() + self.add_child() # lint-amnesty, pylint: disable=no-member class ExpandCollapseLinkState(object): @@ -251,7 +251,7 @@ class CourseOutlinePage(CoursePage, CourseOutlineContainer): """ Starts course reindex by clicking reindex button """ - self.reindex_button.click() + self.reindex_button.click() # lint-amnesty, pylint: disable=no-member def open_subsection_settings_dialog(self, index=0): """ @@ -363,7 +363,7 @@ class SubsectionOutlineModal(CourseOutlineModal): """ Returns the current visibility setting for a subsection """ - self.ensure_staff_lock_visible() + self.ensure_staff_lock_visible() # lint-amnesty, pylint: disable=no-member return self.find_css('input[name=content-visibility]:checked').first.attrs('value')[0] @is_explicitly_locked.setter @@ -380,7 +380,7 @@ class SubsectionOutlineModal(CourseOutlineModal): """ Sets the subsection visibility to the given value. """ - self.ensure_staff_lock_visible() + self.ensure_staff_lock_visible() # lint-amnesty, pylint: disable=no-member self.find_css('input[name=content-visibility][value=' + value + ']').click() EmptyPromise(lambda: value == self.subsection_visibility, "Subsection visibility is updated").fulfill() diff --git a/common/test/acceptance/pages/studio/users.py b/common/test/acceptance/pages/studio/users.py index cca2cf2329..b81d226a52 100644 --- a/common/test/acceptance/pages/studio/users.py +++ b/common/test/acceptance/pages/studio/users.py @@ -25,7 +25,7 @@ class UsersPageMixin(PageObject): """ Common functionality for course/library team pages """ new_user_form_selector = '.form-create.create-user .user-email-input' - def url(self): + def url(self): # lint-amnesty, pylint: disable=invalid-overridden-method """ URL to this page - override in subclass """ diff --git a/common/test/acceptance/pages/studio/utils.py b/common/test/acceptance/pages/studio/utils.py index 1da7868054..0dfc60fe66 100644 --- a/common/test/acceptance/pages/studio/utils.py +++ b/common/test/acceptance/pages/studio/utils.py @@ -15,7 +15,7 @@ SIDE_BAR_HELP_CSS = '.external-help a, .external-help-button' @js_defined('window.jQuery') -def type_in_codemirror(page, index, text, find_prefix="$"): +def type_in_codemirror(page, index, text, find_prefix="$"): # lint-amnesty, pylint: disable=missing-function-docstring script = u""" var cm = {find_prefix}('div.CodeMirror:eq({index})').get(0).CodeMirror; CodeMirror.signal(cm, "focus", cm); @@ -71,7 +71,7 @@ def verify_ordering(test_class, page, expected_orderings): expected_length = len(expected_ordering.get(parent)) test_class.assertEqual( expected_length, len(children), - u"Number of children incorrect for group {0}. Expected {1} but got {2}.".format(parent, expected_length, len(children))) + u"Number of children incorrect for group {0}. Expected {1} but got {2}.".format(parent, expected_length, len(children))) # lint-amnesty, pylint: disable=line-too-long for idx, expected in enumerate(expected_ordering.get(parent)): test_class.assertEqual(expected, children[idx].name) blocks_checked.add(expected) diff --git a/common/test/acceptance/pages/studio/video/video.py b/common/test/acceptance/pages/studio/video/video.py index 8f63464281..6b81382db3 100644 --- a/common/test/acceptance/pages/studio/video/video.py +++ b/common/test/acceptance/pages/studio/video/video.py @@ -14,7 +14,7 @@ from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.keys import Keys from six.moves import range -from common.test.acceptance.pages.common.utils import sync_on_notification +from common.test.acceptance.pages.common.utils import sync_on_notification # lint-amnesty, pylint: disable=no-name-in-module from common.test.acceptance.pages.lms.video.video import VideoPage from common.test.acceptance.tests.helpers import YouTubeStubConfig @@ -113,7 +113,7 @@ class VideoComponentPage(VideoPage): ) def get_element_selector(self, class_name, vertical=False): - return super(VideoComponentPage, self).get_element_selector(class_name, vertical=vertical) + return super(VideoComponentPage, self).get_element_selector(class_name, vertical=vertical) # lint-amnesty, pylint: disable=super-with-arguments def _wait_for(self, check_func, desc, result=False, timeout=30): """ @@ -549,7 +549,7 @@ class VideoComponentPage(VideoPage): mime_type = 'application/x-subrip' lang_code = '?language_code={}'.format(language_code) link = [link for link in self.q(css='.download-action').attrs('href') if lang_code in link] - result, headers, content = self._get_transcript(link[0]) + result, headers, content = self._get_transcript(link[0]) # lint-amnesty, pylint: disable=no-member return result is True and mime_type in headers['content-type'] and text_to_search in content.decode('utf-8') @@ -578,7 +578,7 @@ class VideoComponentPage(VideoPage): As all the captions lines are exactly same so only getting partial lines will work. """ - self.wait_for_captions() + self.wait_for_captions() # lint-amnesty, pylint: disable=no-member selector = u'.subtitles li:nth-child({})' return ' '.join([self.q(css=selector.format(i)).text[0] for i in range(1, 6)]) diff --git a/common/test/acceptance/tests/discussion/helpers.py b/common/test/acceptance/tests/discussion/helpers.py index b0d562ecd5..eabcdcae9a 100644 --- a/common/test/acceptance/tests/discussion/helpers.py +++ b/common/test/acceptance/tests/discussion/helpers.py @@ -51,7 +51,7 @@ class CohortTestMixin(object): Sets up the course to use cohorting with the given list of auto_cohort_groups. If auto_cohort_groups is None, no auto cohorts are set. """ - course_fixture._update_xblock(course_fixture._course_location, { + course_fixture._update_xblock(course_fixture._course_location, { # lint-amnesty, pylint: disable=protected-access "metadata": { u"cohort_config": { "auto_cohort_groups": auto_cohort_groups or [], @@ -65,7 +65,7 @@ class CohortTestMixin(object): """ Adds a cohort by name, returning its ID. """ - url = LMS_BASE_URL + "/courses/" + course_fixture._course_key + '/cohorts/' + url = LMS_BASE_URL + "/courses/" + course_fixture._course_key + '/cohorts/' # lint-amnesty, pylint: disable=protected-access data = json.dumps({"name": cohort_name, 'assignment_type': 'manual'}) response = course_fixture.session.post(url, data=data, headers=course_fixture.headers) self.assertTrue(response.ok, "Failed to create cohort") @@ -75,7 +75,7 @@ class CohortTestMixin(object): """ Adds a user to the specified cohort. """ - url = LMS_BASE_URL + "/courses/" + course_fixture._course_key + "/cohorts/{}/add".format(cohort_id) + url = LMS_BASE_URL + "/courses/" + course_fixture._course_key + "/cohorts/{}/add".format(cohort_id) # lint-amnesty, pylint: disable=protected-access data = {"users": username} course_fixture.headers['Content-type'] = 'application/x-www-form-urlencoded' response = course_fixture.session.post(url, data=data, headers=course_fixture.headers) @@ -85,7 +85,7 @@ class CohortTestMixin(object): class BaseDiscussionTestCase(UniqueCourseTest, ForumsConfigMixin): """Base test case class for all discussions-related tests.""" def setUp(self): - super(BaseDiscussionTestCase, self).setUp() + super(BaseDiscussionTestCase, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.discussion_id = "test_discussion_{}".format(uuid4().hex) self.course_fixture = CourseFixture(**self.course_info) diff --git a/common/test/acceptance/tests/discussion/test_cohort_management.py b/common/test/acceptance/tests/discussion/test_cohort_management.py index 50e07f97b1..8c408acaed 100644 --- a/common/test/acceptance/tests/discussion/test_cohort_management.py +++ b/common/test/acceptance/tests/discussion/test_cohort_management.py @@ -24,7 +24,7 @@ class CohortConfigurationTest(EventsTestMixin, UniqueCourseTest, CohortTestMixin """ Set up a cohorted course """ - super(CohortConfigurationTest, self).setUp() + super(CohortConfigurationTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments # create course with cohorts self.manual_cohort_name = "ManualCohort1" diff --git a/common/test/acceptance/tests/discussion/test_discussion.py b/common/test/acceptance/tests/discussion/test_discussion.py index 0400be395f..b37ae7180a 100644 --- a/common/test/acceptance/tests/discussion/test_discussion.py +++ b/common/test/acceptance/tests/discussion/test_discussion.py @@ -7,7 +7,7 @@ from uuid import uuid4 import pytest -from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc +from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc # lint-amnesty, pylint: disable=unused-import from common.test.acceptance.fixtures.discussion import ( Comment, Response, @@ -23,7 +23,7 @@ from common.test.acceptance.tests.discussion.helpers import BaseDiscussionMixin, from common.test.acceptance.tests.helpers import UniqueCourseTest from openedx.core.lib.tests import attr -THREAD_CONTENT_WITH_LATEX = u"""Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt +THREAD_CONTENT_WITH_LATEX = u"""Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt # lint-amnesty, pylint: disable=line-too-long ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit sse cillum dolore eu fugiat nulla pariatur. @@ -94,7 +94,7 @@ class DiscussionHomePageTest(BaseDiscussionTestCase): SEARCHED_USERNAME = "gizmo" def setUp(self): - super(DiscussionHomePageTest, self).setUp() + super(DiscussionHomePageTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments AutoAuthPage(self.browser, course_id=self.course_id).visit() self.page = DiscussionTabHomePage(self.browser, self.course_id) self.page.visit() @@ -117,7 +117,7 @@ class DiscussionTabMultipleThreadTest(BaseDiscussionTestCase, BaseDiscussionMixi Tests for the discussion page with multiple threads """ def setUp(self): - super(DiscussionTabMultipleThreadTest, self).setUp() + super(DiscussionTabMultipleThreadTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments AutoAuthPage(self.browser, course_id=self.course_id).visit() self.thread_count = 2 self.thread_ids = [] @@ -167,15 +167,15 @@ class DiscussionOpenClosedThreadTest(BaseDiscussionTestCase): """ def setUp(self): - super(DiscussionOpenClosedThreadTest, self).setUp() + super(DiscussionOpenClosedThreadTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.thread_id = "test_thread_{}".format(uuid4().hex) - def setup_user(self, roles=[]): + def setup_user(self, roles=[]): # lint-amnesty, pylint: disable=dangerous-default-value roles_str = ','.join(roles) - self.user_id = AutoAuthPage(self.browser, course_id=self.course_id, roles=roles_str).visit().get_user_id() + self.user_id = AutoAuthPage(self.browser, course_id=self.course_id, roles=roles_str).visit().get_user_id() # lint-amnesty, pylint: disable=attribute-defined-outside-init - def setup_view(self, **thread_kwargs): + def setup_view(self, **thread_kwargs): # lint-amnesty, pylint: disable=missing-function-docstring thread_kwargs.update({'commentable_id': self.discussion_id}) view = SingleThreadViewFixture( Thread(id=self.thread_id, **thread_kwargs) @@ -183,7 +183,7 @@ class DiscussionOpenClosedThreadTest(BaseDiscussionTestCase): view.addResponse(Response(id="response1")) view.push() - def setup_openclosed_thread_page(self, closed=False): + def setup_openclosed_thread_page(self, closed=False): # lint-amnesty, pylint: disable=missing-function-docstring self.setup_user(roles=['Moderator']) if closed: self.setup_view(closed=True) @@ -225,11 +225,11 @@ class DiscussionResponseEditTest(BaseDiscussionTestCase): """ Tests for editing responses displayed beneath thread in the single thread view. """ - def setup_user(self, roles=[]): + def setup_user(self, roles=[]): # lint-amnesty, pylint: disable=dangerous-default-value roles_str = ','.join(roles) - self.user_id = AutoAuthPage(self.browser, course_id=self.course_id, roles=roles_str).visit().get_user_id() + self.user_id = AutoAuthPage(self.browser, course_id=self.course_id, roles=roles_str).visit().get_user_id() # lint-amnesty, pylint: disable=attribute-defined-outside-init - def setup_view(self): + def setup_view(self): # lint-amnesty, pylint: disable=missing-function-docstring view = SingleThreadViewFixture(Thread(id="response_edit_test_thread", commentable_id=self.discussion_id)) view.addResponse( Response(id="response_other_author", user_id="other", thread_id="response_edit_test_thread"), @@ -260,15 +260,15 @@ class DiscussionCommentEditTest(BaseDiscussionTestCase): """ Tests for editing comments displayed beneath responses in the single thread view. """ - def setup_user(self, roles=[]): + def setup_user(self, roles=[]): # lint-amnesty, pylint: disable=dangerous-default-value roles_str = ','.join(roles) - self.user_id = AutoAuthPage(self.browser, course_id=self.course_id, roles=roles_str).visit().get_user_id() + self.user_id = AutoAuthPage(self.browser, course_id=self.course_id, roles=roles_str).visit().get_user_id() # lint-amnesty, pylint: disable=attribute-defined-outside-init - def setup_view(self): + def setup_view(self): # lint-amnesty, pylint: disable=missing-function-docstring view = SingleThreadViewFixture(Thread(id="comment_edit_test_thread", commentable_id=self.discussion_id)) view.addResponse( Response(id="response1"), - [Comment(id="comment_other_author", user_id="other"), Comment(id="comment_self_author", user_id=self.user_id)]) + [Comment(id="comment_other_author", user_id="other"), Comment(id="comment_self_author", user_id=self.user_id)]) # lint-amnesty, pylint: disable=line-too-long view.push() @attr('a11y') @@ -321,7 +321,7 @@ class DiscussionSearchAlertTest(UniqueCourseTest): SEARCHED_USERNAME = "gizmo" def setUp(self): - super(DiscussionSearchAlertTest, self).setUp() + super(DiscussionSearchAlertTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments CourseFixture(**self.course_info).install() # first auto auth call sets up a user that we will search for in some tests self.searched_user_id = AutoAuthPage( diff --git a/common/test/acceptance/tests/helpers.py b/common/test/acceptance/tests/helpers.py index 1a4f9312be..de03eef29d 100644 --- a/common/test/acceptance/tests/helpers.py +++ b/common/test/acceptance/tests/helpers.py @@ -19,12 +19,12 @@ from bok_choy.promise import EmptyPromise, Promise from bok_choy.web_app_test import WebAppTest from opaque_keys.edx.locator import CourseLocator from path import Path as path -from pymongo import ASCENDING, MongoClient +from pymongo import ASCENDING, MongoClient # lint-amnesty, pylint: disable=unused-import from selenium.common.exceptions import StaleElementReferenceException from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.select import Select from selenium.webdriver.support.ui import WebDriverWait -from six.moves import range, zip +from six.moves import range, zip # lint-amnesty, pylint: disable=unused-import from capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory from common.test.acceptance.fixtures.course import XBlockFixtureDesc @@ -342,7 +342,7 @@ class EventsTestMixin(TestCase): Helpers and setup for running tests that evaluate events emitted """ def setUp(self): - super(EventsTestMixin, self).setUp() + super(EventsTestMixin, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments mongo_host = 'edx.devstack.mongo' if 'BOK_CHOY_HOSTNAME' in os.environ else 'localhost' self.event_collection = MongoClient(mongo_host)["test"]["events"] self.start_time = datetime.now() @@ -354,14 +354,14 @@ class AcceptanceTest(WebAppTest): """ def __init__(self, *args, **kwargs): - super(AcceptanceTest, self).__init__(*args, **kwargs) + super(AcceptanceTest, self).__init__(*args, **kwargs) # lint-amnesty, pylint: disable=super-with-arguments # Use long messages so that failures show actual and expected values self.longMessage = True # pylint: disable=invalid-name def tearDown(self): self._save_console_log() - super(AcceptanceTest, self).tearDown() + super(AcceptanceTest, self).tearDown() # lint-amnesty, pylint: disable=super-with-arguments def _save_console_log(self): """ @@ -411,7 +411,7 @@ class UniqueCourseTest(AcceptanceTest): """ def setUp(self): - super(UniqueCourseTest, self).setUp() + super(UniqueCourseTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.course_info = { 'org': 'test_org', @@ -440,7 +440,7 @@ class YouTubeConfigError(Exception): """ Error occurred while configuring YouTube Stub Server. """ - pass + pass # lint-amnesty, pylint: disable=unnecessary-pass class YouTubeStubConfig(object): diff --git a/common/test/acceptance/tests/lms/test_lms.py b/common/test/acceptance/tests/lms/test_lms.py index 7f7de023f4..e9e502de66 100644 --- a/common/test/acceptance/tests/lms/test_lms.py +++ b/common/test/acceptance/tests/lms/test_lms.py @@ -30,7 +30,7 @@ class CourseWikiA11yTest(UniqueCourseTest): """ Initialize pages and install a course fixture. """ - super(CourseWikiA11yTest, self).setUp() + super(CourseWikiA11yTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments # self.course_info['number'] must be shorter since we are accessing the wiki. See TNL-1751 self.course_info['number'] = self.unique_id[0:6] diff --git a/common/test/acceptance/tests/lms/test_lms_course_home.py b/common/test/acceptance/tests/lms/test_lms_course_home.py index a161dbf37a..313d69d961 100644 --- a/common/test/acceptance/tests/lms/test_lms_course_home.py +++ b/common/test/acceptance/tests/lms/test_lms_course_home.py @@ -22,7 +22,7 @@ class CourseHomeBaseTest(UniqueCourseTest): """ Initialize pages and install a course fixture. """ - super(CourseHomeBaseTest, self).setUp() + super(CourseHomeBaseTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.course_home_page = CourseHomePage(self.browser, self.course_id) self.courseware_page = CoursewarePage(self.browser, self.course_id) diff --git a/common/test/acceptance/tests/lms/test_lms_dashboard.py b/common/test/acceptance/tests/lms/test_lms_dashboard.py index 2f254af733..7a30c52c91 100644 --- a/common/test/acceptance/tests/lms/test_lms_dashboard.py +++ b/common/test/acceptance/tests/lms/test_lms_dashboard.py @@ -23,7 +23,7 @@ class BaseLmsDashboardTestMultiple(UniqueCourseTest): """ # Some parameters are provided by the parent setUp() routine, such as the following: # self.course_id, self.course_info, self.unique_id - super(BaseLmsDashboardTestMultiple, self).setUp() + super(BaseLmsDashboardTestMultiple, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments # Load page objects for use by the tests self.dashboard_page = DashboardPage(self.browser) diff --git a/common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py b/common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py index 721d7ce82d..1553d96eb3 100644 --- a/common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py +++ b/common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py @@ -59,7 +59,7 @@ class LMSInstructorDashboardA11yTest(BaseInstructorDashboardTest): Instructor dashboard base accessibility test. """ def setUp(self): - super(LMSInstructorDashboardA11yTest, self).setUp() + super(LMSInstructorDashboardA11yTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.course_fixture = CourseFixture(**self.course_info).install() self.log_in_as_instructor() self.instructor_dashboard_page = self.visit_instructor_dashboard() @@ -82,7 +82,7 @@ class BulkEmailTest(BaseInstructorDashboardTest): shard = 23 def setUp(self): - super(BulkEmailTest, self).setUp() + super(BulkEmailTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.course_fixture = CourseFixture(**self.course_info).install() self.log_in_as_instructor() instructor_dashboard_page = self.visit_instructor_dashboard() @@ -114,7 +114,7 @@ class AutoEnrollmentWithCSVTest(BaseInstructorDashboardTest): """ def setUp(self): - super(AutoEnrollmentWithCSVTest, self).setUp() + super(AutoEnrollmentWithCSVTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.course_fixture = CourseFixture(**self.course_info).install() self.log_in_as_instructor() instructor_dashboard_page = self.visit_instructor_dashboard() @@ -141,7 +141,7 @@ class CertificatesTest(BaseInstructorDashboardTest): """ def setUp(self): - super(CertificatesTest, self).setUp() + super(CertificatesTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.test_certificate_config = { 'id': 1, 'name': 'Certificate name', @@ -194,7 +194,7 @@ class CertificateInvalidationTest(BaseInstructorDashboardTest): ).install() def setUp(self): - super(CertificateInvalidationTest, self).setUp() + super(CertificateInvalidationTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments # set same course number as we have in fixture json self.course_info['number'] = "335535897951379478207964576572017930000" diff --git a/common/test/acceptance/tests/lms/test_lms_problems.py b/common/test/acceptance/tests/lms/test_lms_problems.py index 6e49713deb..2220dbd4a5 100644 --- a/common/test/acceptance/tests/lms/test_lms_problems.py +++ b/common/test/acceptance/tests/lms/test_lms_problems.py @@ -20,7 +20,7 @@ class ProblemsTest(UniqueCourseTest): """ def setUp(self): - super(ProblemsTest, self).setUp() + super(ProblemsTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.username = "test_student_{uuid}".format(uuid=self.unique_id[0:8]) self.email = "{username}@example.com".format(username=self.username) diff --git a/common/test/acceptance/tests/lms/test_lms_user_preview.py b/common/test/acceptance/tests/lms/test_lms_user_preview.py index b2107eeb62..d69f58067c 100644 --- a/common/test/acceptance/tests/lms/test_lms_user_preview.py +++ b/common/test/acceptance/tests/lms/test_lms_user_preview.py @@ -24,7 +24,7 @@ class StaffViewTest(UniqueCourseTest): EMAIL = "johndoe@example.com" def setUp(self): - super(StaffViewTest, self).setUp() + super(StaffViewTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.courseware_page = CoursewarePage(self.browser, self.course_id) @@ -60,7 +60,7 @@ class CourseWithContentGroupsTest(StaffViewTest): """ def setUp(self): - super(CourseWithContentGroupsTest, self).setUp() + super(CourseWithContentGroupsTest, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments # pylint: disable=protected-access self.course_fixture._update_xblock(self.course_fixture._course_location, { "metadata": { @@ -96,10 +96,10 @@ class CourseWithContentGroupsTest(StaffViewTest): """) - self.alpha_text = "VISIBLE TO ALPHA" - self.beta_text = "VISIBLE TO BETA" - self.audit_text = "VISIBLE TO AUDIT" - self.everyone_text = "VISIBLE TO EVERYONE" + self.alpha_text = "VISIBLE TO ALPHA" # lint-amnesty, pylint: disable=attribute-defined-outside-init + self.beta_text = "VISIBLE TO BETA" # lint-amnesty, pylint: disable=attribute-defined-outside-init + self.audit_text = "VISIBLE TO AUDIT" # lint-amnesty, pylint: disable=attribute-defined-outside-init + self.everyone_text = "VISIBLE TO EVERYONE" # lint-amnesty, pylint: disable=attribute-defined-outside-init course_fixture.add_children( XBlockFixtureDesc('chapter', 'Test Section').add_children( diff --git a/common/test/acceptance/tests/lms/test_problem_types.py b/common/test/acceptance/tests/lms/test_problem_types.py index 9958b7b482..2195955732 100644 --- a/common/test/acceptance/tests/lms/test_problem_types.py +++ b/common/test/acceptance/tests/lms/test_problem_types.py @@ -57,7 +57,7 @@ class ProblemTypeTestBaseMeta(ABCMeta): if obj.__getattribute__(required_attr) is None: raise NotImplementedError(msg) except AttributeError: - raise NotImplementedError(msg) + raise NotImplementedError(msg) # lint-amnesty, pylint: disable=raise-missing-from return obj @@ -96,7 +96,7 @@ class ProblemTypeTestBase(six.with_metaclass(ProblemTypeTestBaseMeta, ProblemsTe """ Visits courseware_page and defines self.problem_page. """ - super(ProblemTypeTestBase, self).setUp() + super(ProblemTypeTestBase, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments self.courseware_page.visit() self.problem_page = ProblemPage(self.browser) @@ -215,7 +215,7 @@ class AnnotationProblemTypeBase(ProblemTypeTestBase): """ Additional setup for AnnotationProblemTypeBase """ - super(AnnotationProblemTypeBase, self).setUp(*args, **kwargs) + super(AnnotationProblemTypeBase, self).setUp(*args, **kwargs) # lint-amnesty, pylint: disable=super-with-arguments self.problem_page.a11y_audit.config.set_rules({ "ignore": [ @@ -247,7 +247,7 @@ class AnnotationProblemTypeTest(AnnotationProblemTypeBase, ProblemTypeA11yTestMi Standard tests for the Annotation Problem Type """ shard = 20 - pass + pass # lint-amnesty, pylint: disable=unnecessary-pass class CheckboxProblemTypeBase(ProblemTypeTestBase): @@ -445,7 +445,7 @@ class RadioProblemTypeTest(RadioProblemTypeBase, ProblemTypeA11yTestMixin): Standard tests for the Multiple Radio Problem Type """ shard = 24 - pass + pass # lint-amnesty, pylint: disable=unnecessary-pass class RadioProblemTypeTestNonRandomized(RadioProblemTypeBase, ProblemTypeA11yTestMixin): @@ -500,7 +500,7 @@ class DropdownProblemTypeTest(DropDownProblemTypeBase, ProblemTypeA11yTestMixin) Standard tests for the Dropdown Problem Type """ shard = 8 - pass + pass # lint-amnesty, pylint: disable=unnecessary-pass @ddt.ddt @@ -569,7 +569,7 @@ class StringProblemTypeBase(ProblemTypeTestBase): Answer string problem. """ textvalue = 'correct string' if correctness == 'correct' else 'incorrect string' - self.problem_page.fill_answer(textvalue) + self.problem_page.fill_answer(textvalue) # lint-amnesty, pylint: disable=no-member class StringProblemTypeTest(StringProblemTypeBase, ProblemTypeA11yTestMixin): @@ -577,7 +577,7 @@ class StringProblemTypeTest(StringProblemTypeBase, ProblemTypeA11yTestMixin): Standard tests for the String Problem Type """ shard = 8 - pass + pass # lint-amnesty, pylint: disable=unnecessary-pass class NumericalProblemTypeBase(ProblemTypeTestBase): @@ -633,7 +633,7 @@ class NumericalProblemTypeBase(ProblemTypeTestBase): textvalue = 'notNum' else: textvalue = str(random.randint(-2, 2)) - self.problem_page.fill_answer(textvalue) + self.problem_page.fill_answer(textvalue) # lint-amnesty, pylint: disable=no-member @ddt.ddt @@ -713,7 +713,7 @@ class FormulaProblemTypeBase(ProblemTypeTestBase): Answer formula problem. """ textvalue = "x^2+2*x+y" if correctness == 'correct' else 'x^2' - self.problem_page.fill_answer(textvalue) + self.problem_page.fill_answer(textvalue) # lint-amnesty, pylint: disable=no-member @ddt.ddt @@ -781,8 +781,8 @@ class ScriptProblemTypeBase(ProblemTypeTestBase): if not correctness == 'correct': second_addend += random.randint(1, 10) - self.problem_page.fill_answer(first_addend, input_num=0) - self.problem_page.fill_answer(second_addend, input_num=1) + self.problem_page.fill_answer(first_addend, input_num=0) # lint-amnesty, pylint: disable=no-member + self.problem_page.fill_answer(second_addend, input_num=1) # lint-amnesty, pylint: disable=no-member @ddt.ddt @@ -791,7 +791,7 @@ class ScriptProblemTypeTest(ScriptProblemTypeBase, ProblemTypeA11yTestMixin): Standard tests for the Script Problem Type """ shard = 20 - pass + pass # lint-amnesty, pylint: disable=unnecessary-pass class ScriptProblemTypeTestNonRandomized(ScriptProblemTypeBase, ProblemTypeA11yTestMixin): @@ -871,7 +871,7 @@ class CodeProblemTypeBase(ProblemTypeTestBase): # (there's not