Commit f03b943b by stv

Fix Pylint: W0612(unused-variable)

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