Fix Pylint: W0612(unused-variable)
This commit is contained in:
@@ -74,7 +74,7 @@ class Command(BaseCommand):
|
||||
else:
|
||||
user = User.objects.get(username=user_str)
|
||||
|
||||
cert_whitelist, created = \
|
||||
cert_whitelist, _created = \
|
||||
CertificateWhitelist.objects.get_or_create(
|
||||
user=user, course_id=course)
|
||||
if options['add']:
|
||||
|
||||
@@ -124,7 +124,7 @@ class Command(BaseCommand):
|
||||
diff = datetime.datetime.now(UTC) - start
|
||||
timeleft = diff * (total - count) / STATUS_INTERVAL
|
||||
hours, remainder = divmod(timeleft.seconds, 3600)
|
||||
minutes, seconds = divmod(remainder, 60)
|
||||
minutes, _seconds = divmod(remainder, 60)
|
||||
print "{0}/{1} completed ~{2:02}:{3:02}m remaining".format(
|
||||
count, total, hours, minutes)
|
||||
start = datetime.datetime.now(UTC)
|
||||
|
||||
@@ -92,7 +92,6 @@ class WikiRedirectTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
|
||||
course_wiki_page = referer.replace('progress', 'wiki/' + self.toy.wiki_slug + "/")
|
||||
|
||||
ending_location = resp.redirect_chain[-1][0]
|
||||
ending_status = resp.redirect_chain[-1][1]
|
||||
|
||||
self.assertEquals(ending_location, 'http://testserver' + course_wiki_page)
|
||||
self.assertEquals(resp.status_code, 200)
|
||||
|
||||
@@ -106,7 +106,7 @@ class BaseTestXmodule(ModuleStoreTestCase):
|
||||
# username = robot{0}, password = 'test'
|
||||
self.users = [
|
||||
UserFactory.create()
|
||||
for i in range(self.USER_COUNT)
|
||||
for dummy0 in range(self.USER_COUNT)
|
||||
]
|
||||
|
||||
for user in self.users:
|
||||
|
||||
@@ -1085,7 +1085,7 @@ class UserProfileTestCase(ModuleStoreTestCase):
|
||||
request = RequestFactory().get("dummy_url")
|
||||
request.user = self.student
|
||||
with self.assertRaises(Http404):
|
||||
response = views.user_profile(
|
||||
views.user_profile(
|
||||
request,
|
||||
self.course.id.to_deprecated_string(),
|
||||
-999
|
||||
@@ -1095,7 +1095,7 @@ class UserProfileTestCase(ModuleStoreTestCase):
|
||||
request = RequestFactory().get("dummy_url")
|
||||
request.user = self.student
|
||||
with self.assertRaises(Http404):
|
||||
response = views.user_profile(
|
||||
views.user_profile(
|
||||
request,
|
||||
"non/existent/course",
|
||||
self.profiled_user.id
|
||||
|
||||
@@ -188,7 +188,7 @@ class TestInstructorEnrollsStudent(ModuleStoreTestCase, LoginEnrollmentTestCase)
|
||||
"""
|
||||
|
||||
string = "abc@test.com, def@test.com ghi@test.com \n \n jkl@test.com \n mno@test.com "
|
||||
cleaned_string, cleaned_string_lc = get_and_clean_student_list(string)
|
||||
cleaned_string, _cleaned_string_lc = get_and_clean_student_list(string)
|
||||
self.assertEqual(cleaned_string, ['abc@test.com', 'def@test.com', 'ghi@test.com', 'jkl@test.com', 'mno@test.com'])
|
||||
|
||||
@ddt.data('http', 'https')
|
||||
|
||||
@@ -148,7 +148,7 @@ class TestGetUnitsWithDueDate(ModuleStoreTestCase):
|
||||
week1 = ItemFactory.create(due=due, parent=course)
|
||||
week2 = ItemFactory.create(due=due, parent=course)
|
||||
|
||||
homework = ItemFactory.create(
|
||||
ItemFactory.create(
|
||||
parent=week1,
|
||||
due=due
|
||||
)
|
||||
|
||||
@@ -82,7 +82,6 @@ class InstructorTaskModuleSubmitTest(InstructorTaskModuleTestCase):
|
||||
def test_submit_nonexistent_modules(self):
|
||||
# confirm that a rescore of a non-existent module returns an exception
|
||||
problem_url = InstructorTaskModuleTestCase.problem_location("NonexistentProblem")
|
||||
course_id = self.course.id
|
||||
request = None
|
||||
with self.assertRaises(ItemNotFoundError):
|
||||
submit_rescore_problem_for_student(request, problem_url, self.student)
|
||||
@@ -98,7 +97,6 @@ class InstructorTaskModuleSubmitTest(InstructorTaskModuleTestCase):
|
||||
# (Note that it is easier to test a scoreable but non-rescorable module in test_tasks,
|
||||
# where we are creating real modules.)
|
||||
problem_url = self.problem_section.location
|
||||
course_id = self.course.id
|
||||
request = None
|
||||
with self.assertRaises(NotImplementedError):
|
||||
submit_rescore_problem_for_student(request, problem_url, self.student)
|
||||
|
||||
@@ -31,7 +31,7 @@ def create_groups():
|
||||
cxfn = path(data_dir) / course_dir / 'course.xml'
|
||||
try:
|
||||
coursexml = etree.parse(cxfn)
|
||||
except Exception as err:
|
||||
except Exception:
|
||||
print "Oops, cannot read %s, skipping" % cxfn
|
||||
continue
|
||||
cxmlroot = coursexml.getroot()
|
||||
|
||||
@@ -44,7 +44,7 @@ class MyCompleter(object): # Custom completer
|
||||
|
||||
|
||||
def GenPasswd(length=8, chars=string.letters + string.digits):
|
||||
return ''.join([choice(chars) for i in range(length)])
|
||||
return ''.join([choice(chars) for dummy0 in range(length)])
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# main command
|
||||
|
||||
Reference in New Issue
Block a user