Merge pull request #18464 from edx/jmbowman/TE-2584
TE-2584 Upgrade XBlock to fix edx-sga warning
This commit is contained in:
@@ -3,7 +3,8 @@ Test xblock/validation.py
|
||||
"""
|
||||
|
||||
import unittest
|
||||
from xblock.test.tools import assert_raises
|
||||
|
||||
import pytest
|
||||
|
||||
from xmodule.validation import StudioValidationMessage, StudioValidation
|
||||
from xblock.validation import Validation, ValidationMessage
|
||||
@@ -19,16 +20,16 @@ class StudioValidationMessageTest(unittest.TestCase):
|
||||
"""
|
||||
Test that `TypeError`s are thrown for bad input parameters.
|
||||
"""
|
||||
with assert_raises(TypeError):
|
||||
with pytest.raises(TypeError):
|
||||
StudioValidationMessage("unknown type", u"Unknown type info")
|
||||
|
||||
with assert_raises(TypeError):
|
||||
with pytest.raises(TypeError):
|
||||
StudioValidationMessage(StudioValidationMessage.WARNING, u"bad warning", action_class=0)
|
||||
|
||||
with assert_raises(TypeError):
|
||||
with pytest.raises(TypeError):
|
||||
StudioValidationMessage(StudioValidationMessage.WARNING, u"bad warning", action_runtime_event=0)
|
||||
|
||||
with assert_raises(TypeError):
|
||||
with pytest.raises(TypeError):
|
||||
StudioValidationMessage(StudioValidationMessage.WARNING, u"bad warning", action_label="Non-unicode string")
|
||||
|
||||
def test_to_json(self):
|
||||
@@ -107,7 +108,7 @@ class StudioValidationTest(unittest.TestCase):
|
||||
self.assertEqual(expected, validation_copy.messages[0].to_json())
|
||||
|
||||
def test_copy_errors(self):
|
||||
with assert_raises(TypeError):
|
||||
with pytest.raises(TypeError):
|
||||
StudioValidation.copy("foo")
|
||||
|
||||
def test_empty(self):
|
||||
@@ -167,7 +168,7 @@ class StudioValidationTest(unittest.TestCase):
|
||||
"""
|
||||
Test that `set_summary` errors if argument is not a ValidationMessage.
|
||||
"""
|
||||
with assert_raises(TypeError):
|
||||
with pytest.raises(TypeError):
|
||||
StudioValidation("id").set_summary("foo")
|
||||
|
||||
def test_to_json(self):
|
||||
|
||||
23
pavelib/paver_tests/conftest.py
Normal file
23
pavelib/paver_tests/conftest.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
Pytest fixtures for the pavelib unit tests.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
|
||||
import os
|
||||
from shutil import rmtree
|
||||
|
||||
import pytest
|
||||
|
||||
from pavelib.utils.envs import Env
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True, scope='session')
|
||||
def delete_quality_junit_xml():
|
||||
"""
|
||||
Delete the JUnit XML results files for quality check tasks run during the
|
||||
unit tests.
|
||||
"""
|
||||
yield
|
||||
if os.path.exists(Env.QUALITY_DIR):
|
||||
rmtree(Env.QUALITY_DIR)
|
||||
@@ -4,7 +4,7 @@ Tests for Paver's Stylelint tasks.
|
||||
import unittest
|
||||
|
||||
from mock import patch
|
||||
from paver.easy import BuildFailure
|
||||
from paver.easy import BuildFailure, call_task
|
||||
|
||||
import pavelib.quality
|
||||
|
||||
@@ -38,7 +38,7 @@ class TestPaverESLint(unittest.TestCase):
|
||||
"""
|
||||
mock_count.return_value = None
|
||||
with self.assertRaises(BuildFailure):
|
||||
pavelib.quality.run_eslint("")
|
||||
call_task('pavelib.quality.run_eslint', args=[''])
|
||||
|
||||
@patch.object(pavelib.quality, '_write_metric')
|
||||
@patch.object(pavelib.quality, '_prepare_report_dir')
|
||||
|
||||
@@ -143,6 +143,6 @@ stevedore # Support for runtime plugins, used for XBlo
|
||||
unicodecsv # Easier support for CSV files with unicode text
|
||||
user-util # Functionality for retiring users (GDPR compliance)
|
||||
web-fragments # Provides the ability to render fragments of web pages
|
||||
XBlock==1.1.1 # Courseware component architecture
|
||||
XBlock # Courseware component architecture
|
||||
xblock-review # XBlock which displays problems from earlier in the course for ungraded retries
|
||||
zendesk # Python API for the Zendesk customer support system
|
||||
|
||||
@@ -237,5 +237,5 @@ web-fragments==0.2.2
|
||||
webob==1.8.2 # via xblock
|
||||
wrapt==1.10.5
|
||||
xblock-review==1.1.5
|
||||
xblock==1.1.1
|
||||
xblock==1.2.1
|
||||
zendesk==1.1.1
|
||||
|
||||
@@ -136,7 +136,7 @@ edx-django-oauth2-provider==1.2.5
|
||||
edx-django-release-util==0.3.1
|
||||
edx-django-sites-extensions==2.3.1
|
||||
edx-drf-extensions==1.5.1
|
||||
edx-enterprise==0.69.5
|
||||
edx-enterprise==0.70.0
|
||||
edx-i18n-tools==0.4.5
|
||||
edx-lint==0.5.5
|
||||
edx-milestones==0.1.13
|
||||
@@ -345,7 +345,7 @@ webob==1.8.2
|
||||
werkzeug==0.14.1
|
||||
wrapt==1.10.5
|
||||
xblock-review==1.1.5
|
||||
xblock==1.1.1
|
||||
xblock==1.2.1
|
||||
xmltodict==0.11.0
|
||||
zendesk==1.1.1
|
||||
zope.interface==4.5.0
|
||||
|
||||
@@ -131,7 +131,7 @@ edx-django-oauth2-provider==1.2.5
|
||||
edx-django-release-util==0.3.1
|
||||
edx-django-sites-extensions==2.3.1
|
||||
edx-drf-extensions==1.5.1
|
||||
edx-enterprise==0.69.5
|
||||
edx-enterprise==0.70.0
|
||||
edx-i18n-tools==0.4.5
|
||||
edx-lint==0.5.5
|
||||
edx-milestones==0.1.13
|
||||
@@ -326,7 +326,7 @@ webob==1.8.2
|
||||
werkzeug==0.14.1 # via flask
|
||||
wrapt==1.10.5
|
||||
xblock-review==1.1.5
|
||||
xblock==1.1.1
|
||||
xblock==1.2.1
|
||||
xmltodict==0.11.0 # via moto
|
||||
zendesk==1.1.1
|
||||
zope.interface==4.5.0 # via twisted
|
||||
|
||||
Reference in New Issue
Block a user