Commit 4e7885a2 by Jay Zoldak

Merge pull request #747 from edx/zoldak/fix-pylint-nose-tools

Disable pylint violation E0611 when importing assert_* from nose.tools
parents e3810b75 c8949b99
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#pylint: disable=W0621 #pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from nose.tools import assert_false, assert_equal, assert_regexp_matches from nose.tools import assert_false, assert_equal, assert_regexp_matches # pylint: disable=E0611
from common import type_in_codemirror, press_the_notification_button from common import type_in_codemirror, press_the_notification_button
KEY_CSS = '.key input.policy-key' KEY_CSS = '.key input.policy-key'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#pylint: disable=W0621 #pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from nose.tools import assert_true, assert_equal, assert_in from nose.tools import assert_true, assert_equal, assert_in # pylint: disable=E0611
from terrain.steps import reload_the_page from terrain.steps import reload_the_page
from selenium.common.exceptions import StaleElementReferenceException from selenium.common.exceptions import StaleElementReferenceException
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# pylint: disable=W0621 # pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from nose.tools import assert_true from nose.tools import assert_true # pylint: disable=E0611
from auth.authz import get_user_by_email, get_course_groupname_for_role from auth.authz import get_user_by_email, get_course_groupname_for_role
from django.conf import settings from django.conf import settings
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#pylint: disable=W0621 #pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from nose.tools import assert_true from nose.tools import assert_true # pylint: disable=E0611
DATA_LOCATION = 'i4x://edx/templates' DATA_LOCATION = 'i4x://edx/templates'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#pylint: disable=C0111 #pylint: disable=C0111
from lettuce import world from lettuce import world
from nose.tools import assert_equal from nose.tools import assert_equal # pylint: disable=E0611
from terrain.steps import reload_the_page from terrain.steps import reload_the_page
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
from lettuce import world, step from lettuce import world, step
from common import * from common import *
from nose.tools import assert_true, assert_false, assert_equal from nose.tools import assert_true, assert_false, assert_equal # pylint: disable=E0611
from logging import getLogger from logging import getLogger
logger = getLogger(__name__) logger = getLogger(__name__)
......
...@@ -7,7 +7,7 @@ from selenium.webdriver.common.keys import Keys ...@@ -7,7 +7,7 @@ from selenium.webdriver.common.keys import Keys
from common import type_in_codemirror, upload_file from common import type_in_codemirror, upload_file
from django.conf import settings from django.conf import settings
from nose.tools import assert_true, assert_false, assert_equal from nose.tools import assert_true, assert_false, assert_equal # pylint: disable=E0611
TEST_ROOT = settings.COMMON_TEST_DATA_ROOT TEST_ROOT = settings.COMMON_TEST_DATA_ROOT
......
...@@ -5,7 +5,7 @@ from lettuce import world, step ...@@ -5,7 +5,7 @@ from lettuce import world, step
from common import create_studio_user from common import create_studio_user
from django.contrib.auth.models import Group from django.contrib.auth.models import Group
from auth.authz import get_course_groupname_for_role, get_user_by_email from auth.authz import get_course_groupname_for_role, get_user_by_email
from nose.tools import assert_true from nose.tools import assert_true # pylint: disable=E0611
PASSWORD = 'test' PASSWORD = 'test'
EMAIL_EXTENSION = '@edx.org' EMAIL_EXTENSION = '@edx.org'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#pylint: disable=C0111 #pylint: disable=C0111
from lettuce import world, step from lettuce import world, step
from nose.tools import assert_equal from nose.tools import assert_equal # pylint: disable=E0611
from common import type_in_codemirror from common import type_in_codemirror
DISPLAY_NAME = "Display Name" DISPLAY_NAME = "Display Name"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
from lettuce import world, step from lettuce import world, step
from common import * from common import *
from nose.tools import assert_equal from nose.tools import assert_equal # pylint: disable=E0611
############### ACTIONS #################### ############### ACTIONS ####################
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
from lettuce import world, step from lettuce import world, step
from common import * from common import *
from nose.tools import assert_equal from nose.tools import assert_equal # pylint: disable=E0611
############### ACTIONS #################### ############### ACTIONS ####################
......
import re import re
from nose.tools import assert_equals, assert_true, assert_false from nose.tools import assert_equals, assert_true, assert_false # pylint: disable=E0611
from static_replace import (replace_static_urls, replace_course_urls, from static_replace import (replace_static_urls, replace_course_urls,
_url_replace_regex) _url_replace_regex)
from mock import patch, Mock from mock import patch, Mock
......
...@@ -15,7 +15,7 @@ from lettuce import world, step ...@@ -15,7 +15,7 @@ from lettuce import world, step
from .course_helpers import * from .course_helpers import *
from .ui_helpers import * from .ui_helpers import *
from lettuce.django import django_url from lettuce.django import django_url
from nose.tools import assert_equals from nose.tools import assert_equals # pylint: disable=E0611
from logging import getLogger from logging import getLogger
logger = getLogger(__name__) logger = getLogger(__name__)
......
...@@ -10,7 +10,7 @@ from selenium.webdriver.support import expected_conditions as EC ...@@ -10,7 +10,7 @@ from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import WebDriverWait
from lettuce.django import django_url from lettuce.django import django_url
from nose.tools import assert_true from nose.tools import assert_true # pylint: disable=E0611
@world.absorb @world.absorb
......
from nose.tools import assert_equals, assert_raises, assert_not_equals from nose.tools import assert_equals, assert_raises, assert_not_equals # pylint: disable=E0611
from xmodule.modulestore import Location from xmodule.modulestore import Location
from xmodule.modulestore.exceptions import InvalidLocationError from xmodule.modulestore.exceptions import InvalidLocationError
......
from nose.tools import assert_equals, assert_raises, assert_false, assert_true, assert_not_equals # pylint: disable=E0611
from nose.tools import assert_equals, assert_raises, assert_false, \
assert_true, assert_not_equals
# pylint: enable=E0611
import pymongo import pymongo
from uuid import uuid4 from uuid import uuid4
......
from nose.tools import assert_equals, assert_raises from nose.tools import assert_equals, assert_raises # pylint: disable=E0611
from xmodule.modulestore.exceptions import ItemNotFoundError from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.modulestore.search import path_to_location from xmodule.modulestore.search import path_to_location
......
from pprint import pprint from pprint import pprint
# pylint: disable=E0611
from nose.tools import assert_equals, assert_raises, assert_not_equals, assert_false from nose.tools import assert_equals, assert_raises, \
assert_not_equals, assert_false
# pylint: enable=E0611
import pymongo import pymongo
from uuid import uuid4 from uuid import uuid4
......
import os.path import os.path
from nose.tools import assert_raises, assert_equals from nose.tools import assert_raises, assert_equals # pylint: disable=E0611
from xmodule.course_module import CourseDescriptor from xmodule.course_module import CourseDescriptor
from xmodule.modulestore.xml import XMLModuleStore from xmodule.modulestore.xml import XMLModuleStore
......
...@@ -729,7 +729,6 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore): ...@@ -729,7 +729,6 @@ class OpenEndedModuleXmlTest(unittest.TestCase, DummyModulestore):
#Mock a student submitting an assessment #Mock a student submitting an assessment
assessment_dict = MockQueryDict() assessment_dict = MockQueryDict()
assessment_dict.update({'assessment': sum(assessment), 'score_list[]': assessment}) assessment_dict.update({'assessment': sum(assessment), 'score_list[]': assessment})
#from nose.tools import set_trace; set_trace()
module.handle_ajax("save_assessment", assessment_dict) module.handle_ajax("save_assessment", assessment_dict)
task_one_json = json.loads(module.task_states[0]) task_one_json = json.loads(module.task_states[0])
self.assertEqual(json.loads(task_one_json['child_history'][0]['post_assessment']), assessment) self.assertEqual(json.loads(task_one_json['child_history'][0]['post_assessment']), assessment)
...@@ -836,4 +835,4 @@ class OpenEndedModuleXmlAttemptTest(unittest.TestCase, DummyModulestore): ...@@ -836,4 +835,4 @@ class OpenEndedModuleXmlAttemptTest(unittest.TestCase, DummyModulestore):
#Try to reset, should fail because only 1 attempt is allowed #Try to reset, should fail because only 1 attempt is allowed
reset_data = json.loads(module.handle_ajax("reset", {})) reset_data = json.loads(module.handle_ajax("reset", {}))
self.assertEqual(reset_data['success'], False) self.assertEqual(reset_data['success'], False)
\ No newline at end of file
"""Tests for xmodule.util.date_utils""" """Tests for xmodule.util.date_utils"""
from nose.tools import assert_equals, assert_false from nose.tools import assert_equals, assert_false # pylint: disable=E0611
from xmodule.util.date_utils import get_default_time_display, almost_same_datetime from xmodule.util.date_utils import get_default_time_display, almost_same_datetime
from datetime import datetime, timedelta, tzinfo from datetime import datetime, timedelta, tzinfo
from pytz import UTC from pytz import UTC
......
from nose.tools import assert_equals from nose.tools import assert_equals # pylint: disable=E0611
from lxml import etree from lxml import etree
from xmodule.stringify import stringify_children from xmodule.stringify import stringify_children
......
...@@ -3,7 +3,7 @@ Tests for the wrapping layer that provides the XBlock API using XModule/Descript ...@@ -3,7 +3,7 @@ Tests for the wrapping layer that provides the XBlock API using XModule/Descript
functionality functionality
""" """
from nose.tools import assert_equal from nose.tools import assert_equal # pylint: disable=E0611
from unittest.case import SkipTest from unittest.case import SkipTest
from mock import Mock from mock import Mock
......
...@@ -7,7 +7,7 @@ from xmodule.fields import Date, Timedelta ...@@ -7,7 +7,7 @@ from xmodule.fields import Date, Timedelta
from xmodule.xml_module import XmlDescriptor, serialize_field, deserialize_field from xmodule.xml_module import XmlDescriptor, serialize_field, deserialize_field
import unittest import unittest
from .import get_test_system from .import get_test_system
from nose.tools import assert_equals from nose.tools import assert_equals # pylint: disable=E0611
from mock import Mock from mock import Mock
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
from __future__ import absolute_import from __future__ import absolute_import
from lettuce import world, step from lettuce import world, step
from nose.tools import assert_equals, assert_in
from django.contrib.auth.models import User from django.contrib.auth.models import User
from student.models import CourseEnrollment from student.models import CourseEnrollment
from xmodule.modulestore import Location from xmodule.modulestore import Location
......
from lettuce import world, step from lettuce import world, step
from nose.tools import assert_equals
@step(u'I click on the tabs then the page title should contain the following titles:') @step(u'I click on the tabs then the page title should contain the following titles:')
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#pylint: disable=W0621 #pylint: disable=W0621
from lettuce import world, step from lettuce import world, step
from nose.tools import assert_in, assert_equals from nose.tools import assert_in, assert_equals # pylint: disable=E0611
@step(u'I should see the following Partners in the Partners section') @step(u'I should see the following Partners in the Partners section')
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
from lettuce import step, world from lettuce import step, world
from django.contrib.auth.models import User from django.contrib.auth.models import User
from nose.tools import assert_true
@step('I am an unactivated user$') @step('I am an unactivated user$')
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
from lettuce import world, step from lettuce import world, step
from lettuce.django import django_url from lettuce.django import django_url
from nose.tools import assert_equals, assert_in from nose.tools import assert_equals, assert_in # pylint: disable=E0611
from logging import getLogger from logging import getLogger
logger = getLogger(__name__) logger = getLogger(__name__)
......
...@@ -9,7 +9,6 @@ from lettuce import world, step ...@@ -9,7 +9,6 @@ from lettuce import world, step
from lettuce.django import django_url from lettuce.django import django_url
from common import i_am_registered_for_the_course from common import i_am_registered_for_the_course
from problems_setup import PROBLEM_DICT, answer_problem, problem_has_answer, add_problem_to_course from problems_setup import PROBLEM_DICT, answer_problem, problem_has_answer, add_problem_to_course
from nose.tools import assert_equal
@step(u'I am viewing a "([^"]*)" problem with "([^"]*)" attempt') @step(u'I am viewing a "([^"]*)" problem with "([^"]*)" attempt')
......
...@@ -19,7 +19,6 @@ from capa.tests.response_xml_factory import OptionResponseXMLFactory, \ ...@@ -19,7 +19,6 @@ from capa.tests.response_xml_factory import OptionResponseXMLFactory, \
StringResponseXMLFactory, NumericalResponseXMLFactory, \ StringResponseXMLFactory, NumericalResponseXMLFactory, \
FormulaResponseXMLFactory, CustomResponseXMLFactory, \ FormulaResponseXMLFactory, CustomResponseXMLFactory, \
CodeResponseXMLFactory, ChoiceTextResponseXMLFactory CodeResponseXMLFactory, ChoiceTextResponseXMLFactory
from nose.tools import assert_true
# Factories from capa.tests.response_xml_factory that we will use # Factories from capa.tests.response_xml_factory that we will use
......
...@@ -11,7 +11,7 @@ from django.core.management import call_command ...@@ -11,7 +11,7 @@ from django.core.management import call_command
from util.testing import UrlResetMixin from util.testing import UrlResetMixin
from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE
from nose.tools import assert_true, assert_equal from nose.tools import assert_true, assert_equal # pylint: disable=E0611
from mock import patch from mock import patch
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
......
...@@ -7,7 +7,7 @@ from django.core.urlresolvers import reverse ...@@ -7,7 +7,7 @@ from django.core.urlresolvers import reverse
from util.testing import UrlResetMixin from util.testing import UrlResetMixin
from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE
from nose.tools import assert_true from nose.tools import assert_true # pylint: disable=E0611
from mock import patch, Mock from mock import patch, Mock
import logging import logging
......
...@@ -12,7 +12,7 @@ from django.test.client import Client ...@@ -12,7 +12,7 @@ from django.test.client import Client
from django.test.utils import override_settings from django.test.utils import override_settings
from django.core.management import call_command from django.core.management import call_command
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from nose.tools import assert_true from nose.tools import assert_true # pylint: disable=E0611
from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE from courseware.tests.modulestore_config import TEST_DATA_MIXED_MODULESTORE
from licenses.models import CourseSoftware, UserLicense from licenses.models import CourseSoftware, UserLicense
......
...@@ -100,11 +100,6 @@ ignore-mixin-members=yes ...@@ -100,11 +100,6 @@ ignore-mixin-members=yes
# (useful for classes with attributes dynamically set). # (useful for classes with attributes dynamically set).
ignored-classes=SQLObject ignored-classes=SQLObject
# See http://stackoverflow.com/questions/17156240/nose-tools-and-pylint
# Pylint does not like the way that nose tools inspects and makes available
# the assert classes
ignored-classes=nose.tools,nose.tools.trivial
# When zope mode is activated, add a predefined set of Zope acquired attributes # When zope mode is activated, add a predefined set of Zope acquired attributes
# to generated-members. # to generated-members.
zope=no zope=no
......
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