@@ -232,7 +232,6 @@ def test_requirements_file(self, load_config):
232
232
self .assertEqual (config .python .requirements , '__init__.py' )
233
233
234
234
235
- @pytest .mark .skip
236
235
@pytest .mark .django_db
237
236
@mock .patch ('readthedocs.projects.models.Project.checkout_path' )
238
237
class TestLoadConfigV2 (object ):
@@ -290,12 +289,10 @@ def test_report_using_invalid_version(self, checkout_path, tmpdir):
290
289
291
290
@pytest .mark .parametrize ('config' , [{}, {'formats' : []}])
292
291
@patch ('readthedocs.projects.models.Project.repo_nonblockinglock' , new = MagicMock ())
293
- @patch ('readthedocs.doc_builder.backends.sphinx.SearchBuilder.build' )
294
292
@patch ('readthedocs.doc_builder.backends.sphinx.HtmlBuilder.build' )
295
293
@patch ('readthedocs.doc_builder.backends.sphinx.HtmlBuilder.append_conf' )
296
294
def test_build_formats_default_empty (
297
- self , append_conf , html_build , search_build ,
298
- checkout_path , config , tmpdir ):
295
+ self , append_conf , html_build , checkout_path , config , tmpdir ):
299
296
"""
300
297
The default value for formats is [], which means no extra
301
298
formats are build.
@@ -304,22 +301,26 @@ def test_build_formats_default_empty(
304
301
self .create_config_file (tmpdir , config )
305
302
306
303
update_docs = self .get_update_docs_task ()
304
+ python_env = Virtualenv (
305
+ version = self .version ,
306
+ build_env = update_docs .build_env ,
307
+ config = update_docs .config
308
+ )
309
+ update_docs .python_env = python_env
307
310
outcomes = update_docs .build_docs ()
308
311
309
312
# No extra formats were triggered
310
313
assert outcomes ['html' ]
311
- assert outcomes ['search' ]
312
314
assert not outcomes ['localmedia' ]
313
315
assert not outcomes ['pdf' ]
314
316
assert not outcomes ['epub' ]
315
317
316
318
@patch ('readthedocs.projects.models.Project.repo_nonblockinglock' , new = MagicMock ())
317
319
@patch ('readthedocs.projects.tasks.UpdateDocsTaskStep.build_docs_class' )
318
- @patch ('readthedocs.doc_builder.backends.sphinx.SearchBuilder.build' )
319
320
@patch ('readthedocs.doc_builder.backends.sphinx.HtmlBuilder.build' )
320
321
@patch ('readthedocs.doc_builder.backends.sphinx.HtmlBuilder.append_conf' )
321
322
def test_build_formats_only_pdf (
322
- self , append_conf , html_build , search_build , build_docs_class ,
323
+ self , append_conf , html_build , build_docs_class ,
323
324
checkout_path , tmpdir ):
324
325
"""
325
326
Only the pdf format is build.
@@ -328,11 +329,17 @@ def test_build_formats_only_pdf(
328
329
self .create_config_file (tmpdir , {'formats' : ['pdf' ]})
329
330
330
331
update_docs = self .get_update_docs_task ()
332
+ python_env = Virtualenv (
333
+ version = self .version ,
334
+ build_env = update_docs .build_env ,
335
+ config = update_docs .config
336
+ )
337
+ update_docs .python_env = python_env
338
+
331
339
outcomes = update_docs .build_docs ()
332
340
333
341
# Only pdf extra format was triggered
334
342
assert outcomes ['html' ]
335
- assert outcomes ['search' ]
336
343
build_docs_class .assert_called_with ('sphinx_pdf' )
337
344
assert outcomes ['pdf' ]
338
345
assert not outcomes ['localmedia' ]
@@ -642,6 +649,35 @@ def test_sphinx_configuration_default(
642
649
append_conf .assert_called_once ()
643
650
move .assert_called_once ()
644
651
652
+ @patch ('readthedocs.doc_builder.backends.sphinx.BaseSphinx.move' )
653
+ @patch ('readthedocs.doc_builder.backends.sphinx.BaseSphinx.append_conf' )
654
+ @patch ('readthedocs.doc_builder.backends.sphinx.BaseSphinx.run' )
655
+ def test_sphinx_configuration_default (
656
+ self , run , append_conf , move , checkout_path , tmpdir ):
657
+ """Should be default to find a conf.py file."""
658
+ checkout_path .return_value = str (tmpdir )
659
+
660
+ apply_fs (tmpdir , {'conf.py' : '' })
661
+ self .create_config_file (tmpdir , {})
662
+ self .project .conf_py_file = ''
663
+ self .project .save ()
664
+
665
+ update_docs = self .get_update_docs_task ()
666
+ config = update_docs .config
667
+ python_env = Virtualenv (
668
+ version = self .version ,
669
+ build_env = update_docs .build_env ,
670
+ config = config
671
+ )
672
+ update_docs .python_env = python_env
673
+
674
+ update_docs .build_docs_html ()
675
+
676
+ args , kwargs = run .call_args
677
+ assert kwargs ['cwd' ] == str (tmpdir )
678
+ append_conf .assert_called_once ()
679
+ move .assert_called_once ()
680
+
645
681
@patch ('readthedocs.doc_builder.backends.sphinx.BaseSphinx.move' )
646
682
@patch ('readthedocs.doc_builder.backends.sphinx.BaseSphinx.append_conf' )
647
683
@patch ('readthedocs.doc_builder.backends.sphinx.BaseSphinx.run' )
@@ -716,6 +752,7 @@ def test_sphinx_fail_on_warning(
716
752
append_conf .assert_called_once ()
717
753
move .assert_called_once ()
718
754
755
+ @pytest .mark .skip
719
756
@patch ('readthedocs.doc_builder.backends.mkdocs.BaseMkdocs.move' )
720
757
@patch ('readthedocs.doc_builder.backends.mkdocs.BaseMkdocs.append_conf' )
721
758
@patch ('readthedocs.doc_builder.backends.mkdocs.BaseMkdocs.run' )
@@ -754,6 +791,7 @@ def test_mkdocs_configuration(
754
791
append_conf .assert_called_once ()
755
792
move .assert_called_once ()
756
793
794
+ @pytest .mark .skip
757
795
@patch ('readthedocs.doc_builder.backends.mkdocs.BaseMkdocs.move' )
758
796
@patch ('readthedocs.doc_builder.backends.mkdocs.BaseMkdocs.append_conf' )
759
797
@patch ('readthedocs.doc_builder.backends.mkdocs.BaseMkdocs.run' )
0 commit comments