TE-2526 Remove dependency on needle and nose

This commit is contained in:
Jeremy Bowman
2018-08-13 11:08:31 -04:00
parent 19ba450b1d
commit fda571fedb
7 changed files with 23 additions and 28 deletions

View File

@@ -9,13 +9,13 @@ import itertools
import mimetypes
from uuid import uuid4
from contextlib import contextmanager
import pytest
from mock import patch, Mock, call
# Mixed modulestore depends on django, so we'll manually configure some django settings
# before importing the module
# TODO remove this import and the configuration -- xmodule should not depend on django!
from django.conf import settings
from nose import SkipTest
import pymongo
from pytz import UTC
from shutil import rmtree
@@ -3278,7 +3278,7 @@ class TestPublishOverExportImport(CommonMixedModuleStoreSetup):
Check that asides could be imported from XML and the modulestores handle asides crud
"""
if default_store == ModuleStoreEnum.Type.mongo:
raise SkipTest("asides not supported in old mongo")
pytest.skip("asides not supported in old mongo")
with MongoContentstoreBuilder().build() as contentstore:
self.store = MixedModuleStore(
contentstore=contentstore,
@@ -3353,7 +3353,7 @@ class TestPublishOverExportImport(CommonMixedModuleStoreSetup):
lambda self, block: ['test_aside'])
def test_export_course_with_asides(self, default_store):
if default_store == ModuleStoreEnum.Type.mongo:
raise SkipTest("asides not supported in old mongo")
pytest.skip("asides not supported in old mongo")
with MongoContentstoreBuilder().build() as contentstore:
self.store = MixedModuleStore(
contentstore=contentstore,
@@ -3440,7 +3440,7 @@ class TestPublishOverExportImport(CommonMixedModuleStoreSetup):
lambda self, block: ['test_aside'])
def test_export_course_after_creating_new_items_with_asides(self, default_store): # pylint: disable=too-many-statements
if default_store == ModuleStoreEnum.Type.mongo:
raise SkipTest("asides not supported in old mongo")
pytest.skip("asides not supported in old mongo")
with MongoContentstoreBuilder().build() as contentstore:
self.store = MixedModuleStore(
contentstore=contentstore,
@@ -3577,7 +3577,7 @@ class TestAsidesWithMixedModuleStore(CommonMixedModuleStoreSetup):
Tests that connected asides could be stored, received and updated along with connected course items
"""
if default_store == ModuleStoreEnum.Type.mongo:
raise SkipTest("asides not supported in old mongo")
pytest.skip("asides not supported in old mongo")
self.initdb(default_store)
@@ -3641,7 +3641,7 @@ class TestAsidesWithMixedModuleStore(CommonMixedModuleStoreSetup):
Tests that connected asides will be cloned together with the parent courses
"""
if default_store == ModuleStoreEnum.Type.mongo:
raise SkipTest("asides not supported in old mongo")
pytest.skip("asides not supported in old mongo")
with MongoContentstoreBuilder().build() as contentstore:
# initialize the mixed modulestore
@@ -3689,7 +3689,7 @@ class TestAsidesWithMixedModuleStore(CommonMixedModuleStoreSetup):
Tests that connected asides will be removed together with the connected items
"""
if default_store == ModuleStoreEnum.Type.mongo:
raise SkipTest("asides not supported in old mongo")
pytest.skip("asides not supported in old mongo")
self.initdb(default_store)
@@ -3739,7 +3739,7 @@ class TestAsidesWithMixedModuleStore(CommonMixedModuleStoreSetup):
Tests that public/unpublish doesn't affect connected stored asides
"""
if default_store == ModuleStoreEnum.Type.mongo:
raise SkipTest("asides not supported in old mongo")
pytest.skip("asides not supported in old mongo")
self.initdb(default_store)

View File

@@ -8,7 +8,7 @@ import textwrap
from abc import ABCMeta, abstractmethod
import ddt
from nose import SkipTest
import pytest
from selenium.webdriver import ActionChains
from capa.tests.response_xml_factory import (
@@ -243,7 +243,7 @@ class ProblemTypeTestMixin(ProblemTypeA11yTestMixin):
And The "<ProblemType>" problem displays a "blank" answer
"""
if not self.can_submit_blank:
raise SkipTest("Test incompatible with the current problem type")
pytest.skip("Test incompatible with the current problem type")
self.problem_page.wait_for(
lambda: self.problem_page.problem_name == self.problem_name,
@@ -263,7 +263,7 @@ class ProblemTypeTestMixin(ProblemTypeA11yTestMixin):
Then I can't submit a problem
"""
if self.can_submit_blank:
raise SkipTest("Test incompatible with the current problem type")
pytest.skip("Test incompatible with the current problem type")
self.problem_page.wait_for(
lambda: self.problem_page.problem_name == self.problem_name,
@@ -372,7 +372,7 @@ class ProblemTypeTestMixin(ProblemTypeA11yTestMixin):
# Not all problems have partially correct solutions configured
if not self.partially_correct:
raise SkipTest("Test incompatible with the current problem type")
pytest.skip("Test incompatible with the current problem type")
self.problem_page.wait_for(
lambda: self.problem_page.problem_name == self.problem_name,
@@ -412,7 +412,7 @@ class ProblemNeverShowCorrectnessMixin(object):
# Not all problems have partially correct solutions configured
if correctness == 'partially-correct' and not self.partially_correct:
raise SkipTest("Test incompatible with the current problem type")
pytest.skip("Test incompatible with the current problem type")
# Problem progress text depends on points possible
possible = 'possible (ungraded, results hidden)'