From 772f8cbe90b1399d7bef2b7ce7e16f3a95f91e5f Mon Sep 17 00:00:00 2001 From: Jawayria Date: Thu, 11 Feb 2021 14:05:48 +0500 Subject: [PATCH] refactor: Removed unused imports Removed unused imports from cms using 'unimport' --- .../management/commands/tests/test_reindex_courses.py | 1 - cms/djangoapps/contentstore/tests/test_contentstore.py | 1 - cms/djangoapps/contentstore/tests/test_courseware_index.py | 1 - cms/djangoapps/contentstore/views/item.py | 1 - cms/djangoapps/contentstore/views/tests/test_course_updates.py | 3 --- cms/envs/common.py | 1 - cms/envs/devstack_optimized.py | 3 --- cms/envs/devstack_with_worker.py | 3 --- cms/envs/test.py | 2 +- 9 files changed, 1 insertion(+), 15 deletions(-) diff --git a/cms/djangoapps/contentstore/management/commands/tests/test_reindex_courses.py b/cms/djangoapps/contentstore/management/commands/tests/test_reindex_courses.py index 31834d6210..abc6c31fbc 100644 --- a/cms/djangoapps/contentstore/management/commands/tests/test_reindex_courses.py +++ b/cms/djangoapps/contentstore/management/commands/tests/test_reindex_courses.py @@ -5,7 +5,6 @@ from unittest import mock import ddt from django.core.management import CommandError, call_command - from cms.djangoapps.contentstore.management.commands.reindex_course import Command as ReindexCommand from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index dbdb978a8b..21a71b3f2f 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -14,7 +14,6 @@ import ddt import lxml.html from django.conf import settings from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user -from django.middleware.csrf import _compare_salted_tokens # lint-amnesty, pylint: disable=unused-import from django.test import TestCase from django.test.utils import override_settings from edxval.api import create_video, get_videos_for_course diff --git a/cms/djangoapps/contentstore/tests/test_courseware_index.py b/cms/djangoapps/contentstore/tests/test_courseware_index.py index 661f75b391..c8d637f0af 100644 --- a/cms/djangoapps/contentstore/tests/test_courseware_index.py +++ b/cms/djangoapps/contentstore/tests/test_courseware_index.py @@ -16,7 +16,6 @@ from django.conf import settings from lazy.lazy import lazy from pytz import UTC from search.search_engine_base import SearchEngine -from xblock.core import XBlock # lint-amnesty, pylint: disable=unused-import from cms.djangoapps.contentstore.courseware_index import ( CourseAboutSearchIndexer, diff --git a/cms/djangoapps/contentstore/views/item.py b/cms/djangoapps/contentstore/views/item.py index 3dd7678c19..22542848f4 100644 --- a/cms/djangoapps/contentstore/views/item.py +++ b/cms/djangoapps/contentstore/views/item.py @@ -1,6 +1,5 @@ """Views for items (modules).""" - import logging from collections import OrderedDict from datetime import datetime diff --git a/cms/djangoapps/contentstore/views/tests/test_course_updates.py b/cms/djangoapps/contentstore/views/tests/test_course_updates.py index 59bb245b03..d60f3f4cbc 100644 --- a/cms/djangoapps/contentstore/views/tests/test_course_updates.py +++ b/cms/djangoapps/contentstore/views/tests/test_course_updates.py @@ -4,9 +4,6 @@ unit tests for course_info views and models. import json -from unittest.mock import patch # lint-amnesty, pylint: disable=unused-import - -from django.test.utils import override_settings # lint-amnesty, pylint: disable=unused-import from opaque_keys.edx.keys import UsageKey from cms.djangoapps.contentstore.tests.test_course_settings import CourseTestCase diff --git a/cms/envs/common.py b/cms/envs/common.py index 7dd7939d50..7391088d12 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -36,7 +36,6 @@ When refering to XBlocks, we use the entry-point name. For example, # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files - # pylint: disable=unused-import, useless-suppression, wrong-import-order, wrong-import-position import importlib.util diff --git a/cms/envs/devstack_optimized.py b/cms/envs/devstack_optimized.py index d81ef1502f..f4c55b7b8b 100644 --- a/cms/envs/devstack_optimized.py +++ b/cms/envs/devstack_optimized.py @@ -18,9 +18,6 @@ as they are for non-optimized devstack. Instead, update_assets must be invoked each time that changes have been made. """ - -import os # lint-amnesty, pylint: disable=unused-import - ########################## Devstack settings ################################### from .devstack import * # pylint: disable=wildcard-import diff --git a/cms/envs/devstack_with_worker.py b/cms/envs/devstack_with_worker.py index 193c2a8075..ea4ba857a2 100644 --- a/cms/envs/devstack_with_worker.py +++ b/cms/envs/devstack_with_worker.py @@ -11,9 +11,6 @@ In two separate processes on devstack: DJANGO_SETTINGS_MODULE=cms.envs.devstack_with_worker celery worker --app=cms.celery:APP """ - -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 # pylint: disable=wildcard-import, unused-wildcard-import diff --git a/cms/envs/test.py b/cms/envs/test.py index 593132784b..ad72181852 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -27,7 +27,7 @@ from .common import * # import settings from LMS for consistent behavior with CMS from lms.envs.test import ( # pylint: disable=wrong-import-order - COMPREHENSIVE_THEME_DIRS, + COMPREHENSIVE_THEME_DIRS, # unimport:skip DEFAULT_FILE_STORAGE, ECOMMERCE_API_URL, ENABLE_COMPREHENSIVE_THEMING,