Applied pylint-amnesty

This commit is contained in:
usamasadiq
2021-02-02 15:29:41 +05:00
parent 712a6bcc0c
commit 8556d670a2
15 changed files with 27 additions and 27 deletions

View File

@@ -21,4 +21,4 @@ kombu.utils.entrypoints = lambda namespace: iter([])
# This will make sure the app is always imported when Django starts so
# that shared_task will use this app, and also ensures that the celery
# singleton is always configured for the CMS.
from .celery import APP as CELERY_APP
from .celery import APP as CELERY_APP # lint-amnesty, pylint: disable=wrong-import-position

View File

@@ -1,4 +1,4 @@
"""
""" # lint-amnesty, pylint: disable=django-not-configured
Import celery, load its settings from the django settings
and auto discover tasks in all installed django apps.

View File

@@ -53,7 +53,7 @@ def _django_clear_site_cache():
clearing mechanism actually works. So override this fixture to not mess
with what has been working for us so far.
"""
pass
pass # lint-amnesty, pylint: disable=unnecessary-pass
@pytest.fixture(autouse=True)

View File

@@ -107,7 +107,7 @@ DEBUG_TOOLBAR_CONFIG = {
}
def should_show_debug_toolbar(request):
def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing-function-docstring
# We always want the toolbar on devstack unless running tests from another Docker container
hostname = request.get_host()
if hostname.startswith('edx.devstack.studio:') or hostname.startswith('studio.devstack.edx:'):
@@ -195,7 +195,7 @@ JWT_AUTH.update({
),
})
# pylint: enable=unicode-format-string
# pylint: enable=unicode-format-string # lint-amnesty, pylint: disable=bad-option-value
IDA_LOGOUT_URI_LIST = [
'http://localhost:18130/logout/', # ecommerce

View File

@@ -150,7 +150,7 @@ JWT_AUTH.update({
),
})
# pylint: enable=unicode-format-string
# pylint: enable=unicode-format-string # lint-amnesty, pylint: disable=bad-option-value
IDA_LOGOUT_URI_LIST = [
'http://localhost:18130/logout/', # ecommerce

View File

@@ -19,7 +19,7 @@ invoked each time that changes have been made.
"""
import os
import os # lint-amnesty, pylint: disable=unused-import
########################## Devstack settings ###################################

View File

@@ -12,7 +12,7 @@ In two separate processes on devstack:
"""
import os
import os # lint-amnesty, pylint: disable=unused-import
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files

View File

@@ -22,9 +22,9 @@ from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType
from .common import *
from openedx.core.lib.derived import derive_settings
from openedx.core.lib.logsettings import get_logger_config
from xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed
from openedx.core.lib.derived import derive_settings # lint-amnesty, pylint: disable=wrong-import-order
from openedx.core.lib.logsettings import get_logger_config # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed # lint-amnesty, pylint: disable=wrong-import-order
def get_env_setting(setting):
@@ -33,7 +33,7 @@ def get_env_setting(setting):
return os.environ[setting]
except KeyError:
error_msg = u"Set the %s env variable" % setting
raise ImproperlyConfigured(error_msg)
raise ImproperlyConfigured(error_msg) # lint-amnesty, pylint: disable=raise-missing-from
############### ALWAYS THE SAME ################################

View File

@@ -75,7 +75,7 @@ COMMON_TEST_DATA_ROOT = COMMON_ROOT / "test" / "data"
FEATURES['ENABLE_EXPORT_GIT'] = True
GIT_REPO_EXPORT_DIR = TEST_ROOT / "export_course_repos"
# TODO (cpennington): We need to figure out how envs/test.py can inject things into common.py so that we don't have to repeat this sort of thing
# TODO (cpennington): We need to figure out how envs/test.py can inject things into common.py so that we don't have to repeat this sort of thing # lint-amnesty, pylint: disable=line-too-long
STATICFILES_DIRS = [
COMMON_ROOT / "static",
PROJECT_ROOT / "static",

View File

@@ -21,7 +21,7 @@ class CmsFieldData(SplitFieldData):
self._authored_data = authored_data
self._student_data = student_data
super(CmsFieldData, self).__init__({
super(CmsFieldData, self).__init__({ # lint-amnesty, pylint: disable=super-with-arguments
Scope.content: authored_data,
Scope.settings: authored_data,
Scope.parent: authored_data,

View File

@@ -77,7 +77,7 @@ class StructuredTagsAside(XBlockAside):
return Fragment(u'')
@XBlock.handler
def save_tags(self, request=None, suffix=None):
def save_tags(self, request=None, suffix=None): # lint-amnesty, pylint: disable=unused-argument
"""
Handler to save choosen tags with connected XBlock
"""

View File

@@ -39,7 +39,7 @@ class StructuredTagsAsideTestCase(ModuleStoreTestCase):
"""
Preparation for the test execution
"""
super(StructuredTagsAsideTestCase, self).setUp()
super(StructuredTagsAsideTestCase, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
self.aside_name = 'tagging_aside'
self.aside_tag_dif = 'difficulty'
self.aside_tag_dif_value = 'Hard'
@@ -113,7 +113,7 @@ class StructuredTagsAsideTestCase(ModuleStoreTestCase):
def tearDown(self):
TagAvailableValues.objects.all().delete()
TagCategories.objects.all().delete()
super(StructuredTagsAsideTestCase, self).tearDown()
super(StructuredTagsAsideTestCase, self).tearDown() # lint-amnesty, pylint: disable=super-with-arguments
def test_aside_contains_tags(self):
"""
@@ -181,11 +181,11 @@ class StructuredTagsAsideTestCase(ModuleStoreTestCase):
self.assertEqual(option_values2, ['Learned a few things', 'Learned everything', 'Learned nothing'])
# Now ensure the acid_aside is not in the result
self.assertNotRegexpMatches(problem_html, r"data-block-type=[\"\']acid_aside[\"\']")
self.assertNotRegexpMatches(problem_html, r"data-block-type=[\"\']acid_aside[\"\']") # lint-amnesty, pylint: disable=deprecated-method
# Ensure about video don't have asides
video_html = get_preview_fragment(request, self.video, context).content
self.assertNotRegexpMatches(video_html, "<select")
self.assertNotRegexpMatches(video_html, "<select") # lint-amnesty, pylint: disable=deprecated-method
@ddt.data(AsideUsageKeyV1, AsideUsageKeyV2)
def test_handle_requests(self, aside_key_class):

View File

@@ -23,8 +23,8 @@ class AuthoringMixinTestCase(ModuleStoreTestCase):
"""
GROUP_NO_LONGER_EXISTS = "This group no longer exists"
NO_CONTENT_OR_ENROLLMENT_GROUPS = "Access to this component is not restricted"
NO_CONTENT_ENROLLMENT_TRACK_ENABLED = "You can restrict access to this component to learners in specific enrollment tracks or content groups"
NO_CONTENT_ENROLLMENT_TRACK_DISABLED = "You can restrict access to this component to learners in specific content groups"
NO_CONTENT_ENROLLMENT_TRACK_ENABLED = "You can restrict access to this component to learners in specific enrollment tracks or content groups" # lint-amnesty, pylint: disable=line-too-long
NO_CONTENT_ENROLLMENT_TRACK_DISABLED = "You can restrict access to this component to learners in specific content groups" # lint-amnesty, pylint: disable=line-too-long
CONTENT_GROUPS_TITLE = "Content Groups"
ENROLLMENT_GROUPS_TITLE = "Enrollment Track Groups"
STAFF_LOCKED = 'The unit that contains this component is hidden from learners'
@@ -36,7 +36,7 @@ class AuthoringMixinTestCase(ModuleStoreTestCase):
"""
Create a simple course with a video component.
"""
super(AuthoringMixinTestCase, self).setUp()
super(AuthoringMixinTestCase, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
self.course = CourseFactory.create()
chapter = ItemFactory.create(
category='chapter',

View File

@@ -15,7 +15,7 @@ class TestHandlerUrl(TestCase):
"""Test the LMS handler_url"""
def setUp(self):
super(TestHandlerUrl, self).setUp()
super(TestHandlerUrl, self).setUp() # lint-amnesty, pylint: disable=super-with-arguments
self.block = Mock()
def test_trailing_characters(self):

View File

@@ -16,16 +16,16 @@ from safe_lxml import defuse_xml_libs
defuse_xml_libs()
# Disable PyContract contract checking when running as a webserver
import contracts
import contracts # lint-amnesty, pylint: disable=wrong-import-order, wrong-import-position
contracts.disable_all()
import os
import os # lint-amnesty, pylint: disable=wrong-import-order, wrong-import-position
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cms.envs.aws")
import cms.startup as startup
import cms.startup as startup # lint-amnesty, pylint: disable=wrong-import-position
startup.run()
# This application object is used by the development server
# as well as any WSGI server configured to use this file.
from django.core.wsgi import get_wsgi_application
from django.core.wsgi import get_wsgi_application # lint-amnesty, pylint: disable=wrong-import-order, wrong-import-position
application = get_wsgi_application()