Merge pull request #18776 from edx/jmbowman/TE-2526

TE-2526 Remove dependency on needle and nose
This commit is contained in:
Jeremy Bowman
2018-08-14 16:31:45 -04:00
committed by GitHub
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)'

View File

@@ -74,7 +74,7 @@ django-classy-tags==0.8.0 # via django-sekizai
django-config-models==0.2.0
django-cors-headers==2.1.0
django-countries==4.6.1
django-crum==0.7.2
django-crum==0.7.3
django-fernet-fields==0.5
django-filter==1.0.4
django-ipware==1.1.0

View File

@@ -57,12 +57,12 @@ atomicwrites==1.1.5
attrs==17.4.0
babel==1.3
backports.functools-lru-cache==1.5
beautifulsoup4==4.6.1
beautifulsoup4==4.6.3
beautifulsoup==3.2.1
before-after==1.0.1
billiard==3.3.0.23
bleach==1.4
bok-choy==0.8.1
bok-choy==0.9.0
boto3==1.4.8
boto==2.39.0
botocore==1.8.17
@@ -93,7 +93,7 @@ django-classy-tags==0.8.0
django-config-models==0.2.0
django-cors-headers==2.1.0
django-countries==4.6.1
django-crum==0.7.2
django-crum==0.7.3
django-debug-toolbar==1.8
django-fernet-fields==0.5
django-filter==1.0.4
@@ -157,7 +157,7 @@ event-tracking==0.2.4
execnet==1.5.0
extras==1.0.0
factory_boy==2.8.1
faker==0.8.17
faker==0.8.18
feedparser==5.1.3
firebase-token-generator==1.3.2
first==2.0.1
@@ -216,12 +216,10 @@ mongoengine==0.10.0
more-itertools==4.3.0
moto==0.3.1
mysql-python==1.2.5
needle==0.5.0
networkx==1.7
newrelic==4.2.0.100
nltk==3.3.0
nodeenv==1.1.1
nose==1.3.7
numpy==1.6.2
oauth2==1.9.0.post1
oauthlib==2.0.1

View File

@@ -29,7 +29,6 @@ freezegun # Allows tests to mock the output of assorted datetime
httpretty # Library for mocking HTTP requests, used in many tests
isort # For checking and fixing the order of imports
moto==0.3.1 # Lets tests mock AWS access via the boto library
nose # Former test runner, we're still using some utility functions from it
pa11ycrawler # Python crawler (using Scrapy) that uses Pa11y to check accessibility of pages as it crawls
pycodestyle # Checker for compliance with the Python style guide (PEP 8)
polib # Library for manipulating gettext translation files, used to test paver i18n commands

View File

@@ -54,12 +54,12 @@ atomicwrites==1.1.5 # via pytest
attrs==17.4.0
babel==1.3
backports.functools-lru-cache==1.5 # via astroid, pylint
beautifulsoup4==4.6.1
beautifulsoup4==4.6.3
beautifulsoup==3.2.1
before-after==1.0.1
billiard==3.3.0.23
bleach==1.4
bok-choy==0.8.1
bok-choy==0.9.0
boto3==1.4.8
boto==2.39.0
botocore==1.8.17
@@ -90,7 +90,7 @@ django-classy-tags==0.8.0
django-config-models==0.2.0
django-cors-headers==2.1.0
django-countries==4.6.1
django-crum==0.7.2
django-crum==0.7.3
django-fernet-fields==0.5
django-filter==1.0.4
django-ipware==1.1.0
@@ -151,7 +151,7 @@ event-tracking==0.2.4
execnet==1.5.0 # via pytest-xdist
extras==1.0.0 # via python-subunit, testtools
factory_boy==2.8.1
faker==0.8.17 # via factory-boy
faker==0.8.18 # via factory-boy
feedparser==5.1.3
firebase-token-generator==1.3.2
fixtures==3.0.0 # via testtools
@@ -207,12 +207,10 @@ mongoengine==0.10.0
more-itertools==4.3.0 # via pytest
moto==0.3.1
mysql-python==1.2.5
needle==0.5.0 # via bok-choy
networkx==1.7
newrelic==4.2.0.100
nltk==3.3.0
nodeenv==1.1.1
nose==1.3.7
numpy==1.6.2
oauth2==1.9.0.post1
oauthlib==2.0.1

View File

@@ -2,6 +2,6 @@
set -e
export LOWER_PYLINT_THRESHOLD=1000
export UPPER_PYLINT_THRESHOLD=3800
export UPPER_PYLINT_THRESHOLD=3310
export ESLINT_THRESHOLD=5590
export STYLELINT_THRESHOLD=973