setUpClassAndTestData is tricker than pylint understands

This commit is contained in:
Ned Batchelder
2018-11-02 07:22:44 -04:00
parent 59d78031d8
commit 8acea435cf
10 changed files with 26 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ class TestCourseBookmarksTool(SharedModuleStoreTestCase):
"""
Set up a course to be used for testing.
"""
# pylint: disable=super-method-not-called
with super(TestCourseBookmarksTool, cls).setUpClassAndTestData():
with cls.store.default_store(ModuleStoreEnum.Type.split):
cls.course = CourseFactory.create()

View File

@@ -92,6 +92,7 @@ class CourseHomePageTestCase(SharedModuleStoreTestCase):
"""
Set up a course to be used for testing.
"""
# pylint: disable=super-method-not-called
with super(CourseHomePageTestCase, cls).setUpClassAndTestData():
with cls.store.default_store(ModuleStoreEnum.Type.split):
cls.course = CourseFactory.create(

View File

@@ -49,6 +49,7 @@ class TestCourseOutlinePage(SharedModuleStoreTestCase):
Set up an array of various courses to be tested.
"""
# setUpClassAndTestData() already calls setUpClass on SharedModuleStoreTestCase
# pylint: disable=super-method-not-called
with super(TestCourseOutlinePage, cls).setUpClassAndTestData():
cls.courses = []
course = CourseFactory.create()
@@ -145,6 +146,7 @@ class TestCourseOutlinePageWithPrerequisites(SharedModuleStoreTestCase, Mileston
"""
Creates a test course that can be used for non-destructive tests
"""
# pylint: disable=super-method-not-called
cls.PREREQ_REQUIRED = '(Prerequisite required)'
cls.UNLOCKED = 'Unlocked'
@@ -297,6 +299,7 @@ class TestCourseOutlineResumeCourse(SharedModuleStoreTestCase, CompletionWaffleT
Creates a test course that can be used for non-destructive tests
"""
# setUpClassAndTestData() already calls setUpClass on SharedModuleStoreTestCase
# pylint: disable=super-method-not-called
with super(TestCourseOutlineResumeCourse, cls).setUpClassAndTestData():
cls.course = cls.create_test_course()

View File

@@ -83,6 +83,7 @@ class TestCourseUpdatesPage(SharedModuleStoreTestCase):
@classmethod
def setUpClass(cls):
"""Set up the simplest course possible."""
# pylint: disable=super-method-not-called
with super(TestCourseUpdatesPage, cls).setUpClassAndTestData():
with cls.store.default_store(ModuleStoreEnum.Type.split):
cls.course = CourseFactory.create()