From f166e4a1c70d421d5c6b72a802a0edb64c524e54 Mon Sep 17 00:00:00 2001 From: Jawayria <39649635+Jawayria@users.noreply.github.com> Date: Tue, 21 Dec 2021 13:36:26 +0500 Subject: [PATCH] chore: Applied lint-amnesty on lms/{envs, lib} (#29392) --- lms/envs/bok_choy.py | 2 +- lms/envs/common.py | 10 ++++------ lms/envs/production.py | 2 +- lms/envs/test.py | 2 +- lms/lib/courseware_search/lms_result_processor.py | 2 +- .../test/test_lms_filter_generator.py | 4 ++-- .../test/test_lms_result_processor.py | 4 ++-- lms/lib/tests/test_utils.py | 6 +++--- lms/lib/xblock/test/test_mixin.py | 8 ++++---- 9 files changed, 19 insertions(+), 21 deletions(-) diff --git a/lms/envs/bok_choy.py b/lms/envs/bok_choy.py index 431feb6e31..f7bbfebc63 100644 --- a/lms/envs/bok_choy.py +++ b/lms/envs/bok_choy.py @@ -20,7 +20,7 @@ from django.utils.translation import gettext_lazy from path import Path as path from openedx.core.release import RELEASE_LINE -from xmodule.modulestore.modulestore_settings import update_module_store_settings +from xmodule.modulestore.modulestore_settings import update_module_store_settings # lint-amnesty, pylint: disable=wrong-import-order CONFIG_ROOT = path(__file__).abspath().dirname() TEST_ROOT = CONFIG_ROOT.dirname().dirname() / "test_root" diff --git a/lms/envs/common.py b/lms/envs/common.py index 2ce55290ed..a30fbb7f43 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -1453,12 +1453,10 @@ COURSE_LISTINGS = {} ############# XBlock Configuration ########## # Import after sys.path fixup -# pylint: disable=wrong-import-position -from xmodule.modulestore.edit_info import EditInfoMixin -from xmodule.modulestore.inheritance import InheritanceMixin -from xmodule.modulestore import prefer_xmodules -from xmodule.x_module import XModuleMixin -# pylint: enable=wrong-import-position +from xmodule.modulestore.edit_info import EditInfoMixin # lint-amnesty, pylint: disable=wrong-import-order, wrong-import-position +from xmodule.modulestore.inheritance import InheritanceMixin # lint-amnesty, pylint: disable=wrong-import-order, wrong-import-position +from xmodule.modulestore import prefer_xmodules # lint-amnesty, pylint: disable=wrong-import-order, wrong-import-position +from xmodule.x_module import XModuleMixin # lint-amnesty, pylint: disable=wrong-import-order, wrong-import-position # These are the Mixins that should be added to every XBlock. # This should be moved into an XBlock Runtime/Application object diff --git a/lms/envs/production.py b/lms/envs/production.py index ab21c8c29b..fbb6c45682 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -30,7 +30,7 @@ from path import Path as path from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType 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 xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed # lint-amnesty, pylint: disable=wrong-import-order from .common import * diff --git a/lms/envs/test.py b/lms/envs/test.py index 39f5476cf1..0e352c6bf5 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -25,7 +25,7 @@ from path import Path as path from openedx.core.djangoapps.plugins.constants import ProjectType, SettingsType from openedx.core.lib.derived import derive_settings from openedx.core.lib.tempdir import mkdtemp_clean -from xmodule.modulestore.modulestore_settings import update_module_store_settings +from xmodule.modulestore.modulestore_settings import update_module_store_settings # lint-amnesty, pylint: disable=wrong-import-order from .common import * diff --git a/lms/lib/courseware_search/lms_result_processor.py b/lms/lib/courseware_search/lms_result_processor.py index e05feadf5f..c48abe87c4 100644 --- a/lms/lib/courseware_search/lms_result_processor.py +++ b/lms/lib/courseware_search/lms_result_processor.py @@ -11,7 +11,7 @@ from search.result_processor import SearchResultProcessor from lms.djangoapps.course_blocks.api import get_course_blocks from lms.djangoapps.courseware.access import has_access -from xmodule.modulestore.django import modulestore +from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order class LmsSearchResultProcessor(SearchResultProcessor): diff --git a/lms/lib/courseware_search/test/test_lms_filter_generator.py b/lms/lib/courseware_search/test/test_lms_filter_generator.py index a7b76d1bfd..632f6c55e2 100644 --- a/lms/lib/courseware_search/test/test_lms_filter_generator.py +++ b/lms/lib/courseware_search/test/test_lms_filter_generator.py @@ -6,8 +6,8 @@ from unittest.mock import Mock, patch from lms.lib.courseware_search.lms_filter_generator import LmsSearchFilterGenerator from common.djangoapps.student.models import CourseEnrollment from common.djangoapps.student.tests.factories import UserFactory -from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory +from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory # lint-amnesty, pylint: disable=wrong-import-order class LmsSearchFilterGeneratorTestCase(ModuleStoreTestCase): diff --git a/lms/lib/courseware_search/test/test_lms_result_processor.py b/lms/lib/courseware_search/test/test_lms_result_processor.py index cc221952e8..d7f3484d42 100644 --- a/lms/lib/courseware_search/test/test_lms_result_processor.py +++ b/lms/lib/courseware_search/test/test_lms_result_processor.py @@ -5,8 +5,8 @@ import pytest from common.djangoapps.student.tests.factories import UserFactory from lms.lib.courseware_search.lms_result_processor import LmsSearchResultProcessor -from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory +from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory # lint-amnesty, pylint: disable=wrong-import-order class LmsSearchResultProcessorTestCase(ModuleStoreTestCase): diff --git a/lms/lib/tests/test_utils.py b/lms/lib/tests/test_utils.py index 01c2e00e2f..d907c9cc54 100644 --- a/lms/lib/tests/test_utils.py +++ b/lms/lib/tests/test_utils.py @@ -4,9 +4,9 @@ Tests for the LMS/lib utils from lms.lib import utils -from xmodule.modulestore import ModuleStoreEnum -from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory +from xmodule.modulestore import ModuleStoreEnum # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory # lint-amnesty, pylint: disable=wrong-import-order class LmsUtilsTest(ModuleStoreTestCase): diff --git a/lms/lib/xblock/test/test_mixin.py b/lms/lib/xblock/test/test_mixin.py index 8a3a005e0b..34ba5dc79c 100644 --- a/lms/lib/xblock/test/test_mixin.py +++ b/lms/lib/xblock/test/test_mixin.py @@ -13,10 +13,10 @@ from lms.djangoapps.lms_xblock.mixin import ( INVALID_USER_PARTITION_VALIDATION_UNIT, NONSENSICAL_ACCESS_RESTRICTION ) -from xmodule.modulestore import ModuleStoreEnum -from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_MODULESTORE, ModuleStoreTestCase -from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, ToyCourseFactory -from xmodule.partitions.partitions import Group, UserPartition +from xmodule.modulestore import ModuleStoreEnum # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_MODULESTORE, ModuleStoreTestCase # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, ToyCourseFactory # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.partitions.partitions import Group, UserPartition # lint-amnesty, pylint: disable=wrong-import-order class LmsXBlockMixinTestCase(ModuleStoreTestCase):