Skip to content

Commit 4f2b90b

Browse files
committed
Correct the test
1 parent 17f3cd6 commit 4f2b90b

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

readthedocs/rtd_tests/tests/test_celery.py

+6-10
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,10 @@ def test_update_docs_unexpected_build_exception(self, mock_build_docs):
120120

121121
@patch('readthedocs.projects.tasks.UpdateDocsTaskStep.setup_python_environment', new=MagicMock)
122122
@patch('readthedocs.projects.tasks.UpdateDocsTaskStep.build_docs', new=MagicMock)
123-
@patch('readthedocs.projects.tasks.UpdateDocsTaskStep.setup_vcs', new=MagicMock)
124-
@patch('readthedocs.projects.tasks.LocalBuildEnvironment')
125-
def test_no_notification_on_version_locked_error(self, mock_cls):
126-
x = VersionLockedError
127-
y = VersionLockedError()
128-
z = None
129-
130-
mock_cls.handle_exception.return_value = False
131-
mock_cls.failure = VersionLockedError()
132-
mock_cls.__exit__.side_effect = lambda x, y, z: False
123+
@patch('readthedocs.projects.tasks.UpdateDocsTaskStep.send_notifications')
124+
@patch('readthedocs.projects.tasks.UpdateDocsTaskStep.setup_vcs')
125+
def test_no_notification_on_version_locked_error(self, mock_setup_vcs, mock_send_notifications):
126+
mock_setup_vcs.side_effect = VersionLockedError()
133127

134128
build = get(Build, project=self.project,
135129
version=self.project.versions.first())
@@ -139,6 +133,8 @@ def test_no_notification_on_version_locked_error(self, mock_cls):
139133
build_pk=build.pk,
140134
record=False,
141135
intersphinx=False)
136+
137+
mock_send_notifications.assert_not_called()
142138
self.assertTrue(result.successful())
143139

144140
def test_sync_repository(self):

0 commit comments

Comments
 (0)