Skip to content

Commit db19bd2

Browse files
Mock out lock file call in build tests
1 parent c7077d9 commit db19bd2

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

readthedocs/rtd_tests/tests/test_builds.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,14 @@ class BuildTests(TestCase):
3737
@mock.patch('slumber.Resource')
3838
@mock.patch('os.chdir')
3939
@mock.patch('readthedocs.projects.models.Project.api_versions')
40+
@mock.patch('readthedocs.vcs_support.utils.NonBlockingLock.__enter__')
4041
@mock.patch('subprocess.Popen')
41-
def test_build(self, mock_Popen, mock_api_versions, mock_chdir, mock_apiv2_downloads):
42+
def test_build(self,
43+
mock_Popen,
44+
mock_NonBlockingLock_enter,
45+
mock_api_versions,
46+
mock_chdir,
47+
mock_apiv2_downloads):
4248

4349
# subprocess mock logic
4450

@@ -107,13 +113,15 @@ def test_builder_no_comments(self):
107113
@mock.patch('slumber.Resource')
108114
@mock.patch('os.chdir')
109115
@mock.patch('subprocess.Popen')
116+
@mock.patch('readthedocs.vcs_support.utils.NonBlockingLock.__enter__')
110117
@mock.patch('readthedocs.doc_builder.backends.sphinx.HtmlBuilder.build')
111118
@mock.patch('readthedocs.doc_builder.backends.sphinx.PdfBuilder.build')
112119
@mock.patch('readthedocs.doc_builder.backends.sphinx.EpubBuilder.build')
113120
def test_build_respects_pdf_flag(self,
114121
EpubBuilder_build,
115122
PdfBuilder_build,
116123
HtmlBuilder_build,
124+
mock_NonBlockingLock_enter,
117125
mock_Popen,
118126
mock_chdir,
119127
mock_apiv2_downloads):
@@ -155,13 +163,15 @@ def test_build_respects_pdf_flag(self,
155163
@mock.patch('slumber.Resource')
156164
@mock.patch('os.chdir')
157165
@mock.patch('subprocess.Popen')
166+
@mock.patch('readthedocs.vcs_support.utils.NonBlockingLock.__enter__')
158167
@mock.patch('readthedocs.doc_builder.backends.sphinx.HtmlBuilder.build')
159168
@mock.patch('readthedocs.doc_builder.backends.sphinx.PdfBuilder.build')
160169
@mock.patch('readthedocs.doc_builder.backends.sphinx.EpubBuilder.build')
161170
def test_build_respects_epub_flag(self,
162171
EpubBuilder_build,
163172
PdfBuilder_build,
164173
HtmlBuilder_build,
174+
mock_NonBlockingLock_enter,
165175
mock_Popen,
166176
mock_chdir,
167177
mock_apiv2_downloads):

0 commit comments

Comments
 (0)