Skip to content

Commit

Permalink
Revert "Enable PyContracts during tests"
Browse files Browse the repository at this point in the history
This reverts commit 4312c0e.
  • Loading branch information
Ben Patterson committed May 22, 2015
1 parent 796541a commit 176770e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 24 deletions.
15 changes: 7 additions & 8 deletions cms/djangoapps/contentstore/views/tests/test_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,13 @@ def test_download_not_found_throw(self):
def test_metadata_found_in_modulestore(self):
# Insert asset metadata into the modulestore (with no accompanying asset).
asset_key = self.course.id.make_asset_key(AssetMetadata.GENERAL_ASSET_TYPE, 'pic1.jpg')
asset_md = AssetMetadata(
asset_key,
internal_name='EKMND332DDBK',
pathname='pix/archive',
locked=False,
curr_version='14',
prev_version='13',
)
asset_md = AssetMetadata(asset_key, {
'internal_name': 'EKMND332DDBK',
'basename': 'pix/archive',
'locked': False,
'curr_version': '14',
'prev_version': '13'
})
modulestore().save_asset_metadata(asset_md, 15)
# Get the asset metadata and have it be found in the modulestore.
# Currently, no asset metadata should be found in the modulestore. The code is not yet storing it there.
Expand Down
4 changes: 2 additions & 2 deletions lms/djangoapps/courseware/tests/test_module_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import ItemFactory, CourseFactory, check_mongo_calls
from xmodule.x_module import XModuleDescriptor, XModule, STUDENT_VIEW, CombinedSystem, DescriptorSystem
from xmodule.x_module import XModuleDescriptor, XModule, STUDENT_VIEW, CombinedSystem

TEST_DATA_DIR = settings.COMMON_TEST_DATA_ROOT

Expand Down Expand Up @@ -1108,7 +1108,7 @@ def _get_anonymous_id(self, course_id, xblock_class):
location=location,
static_asset_path=None,
_runtime=Mock(
spec=DescriptorSystem,
spec=Runtime,
resources_fs=None,
mixologist=Mock(_mixins=(), name='mixologist'),
name='runtime',
Expand Down
17 changes: 8 additions & 9 deletions lms/djangoapps/lms_xblock/test/test_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from lms.djangoapps.lms_xblock.runtime import quote_slashes, unquote_slashes, LmsModuleSystem
from xblock.fields import ScopeIds
from xmodule.x_module import DescriptorSystem

TEST_STRINGS = [
'',
Expand Down Expand Up @@ -49,12 +48,12 @@ def setUp(self):
self.course_key = SlashSeparatedCourseKey("org", "course", "run")
self.runtime = LmsModuleSystem(
static_url='/static',
track_function=Mock(name='track_function'),
get_module=Mock(name='get_module'),
render_template=Mock(name='render_template'),
track_function=Mock(),
get_module=Mock(),
render_template=Mock(),
replace_urls=str,
course_id=self.course_key,
descriptor_runtime=Mock(spec=DescriptorSystem, name='descriptor_runtime'),
descriptor_runtime=Mock(),
)

def test_trailing_characters(self):
Expand Down Expand Up @@ -121,13 +120,13 @@ def mock_get_real_user(_anon_id):

self.runtime = LmsModuleSystem(
static_url='/static',
track_function=Mock(name="track_function"),
get_module=Mock(name="get_module"),
render_template=Mock(name="render_template"),
track_function=Mock(),
get_module=Mock(),
render_template=Mock(),
replace_urls=str,
course_id=self.course_id,
get_real_user=mock_get_real_user,
descriptor_runtime=Mock(spec=DescriptorSystem, name="descriptor_runtime"),
descriptor_runtime=Mock(),
)
self.scope = 'course'
self.key = 'key1'
Expand Down
3 changes: 1 addition & 2 deletions lms/djangoapps/open_ended_grading/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from student.roles import CourseStaffRole
from student.models import unique_id_for_user
from xmodule import peer_grading_module
from xmodule.x_module import DescriptorSystem
from xmodule.error_module import ErrorDescriptor
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
Expand Down Expand Up @@ -289,7 +288,7 @@ def setUp(self):
open_ended_grading_interface=test_util_open_ended.OPEN_ENDED_GRADING_INTERFACE,
mixins=settings.XBLOCK_MIXINS,
error_descriptor_class=ErrorDescriptor,
descriptor_runtime=Mock(spec=DescriptorSystem, name="descriptor_runtime"),
descriptor_runtime=None,
)
self.descriptor = peer_grading_module.PeerGradingDescriptor(self.system, field_data, ScopeIds(None, None, None, None))
self.descriptor.xmodule_runtime = self.system
Expand Down
3 changes: 1 addition & 2 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,4 @@ def parse_args():

from django.core.management import execute_from_command_line

sys.argv[1:] = django_args
execute_from_command_line(sys.argv)
execute_from_command_line([sys.argv[0]] + django_args)
2 changes: 1 addition & 1 deletion pavelib/utils/test/suites/nose_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __enter__(self):
@property
def cmd(self):
cmd = (
'./manage.py {system} --contracts test --verbosity={verbosity} '
'./manage.py {system} test --verbosity={verbosity} '
'{test_id} {test_opts} --traceback --settings=test {extra} '
'--with-xunit --xunit-file={xunit_report}'.format(
system=self.root,
Expand Down

0 comments on commit 176770e

Please sign in to comment.