Skip to content

Commit 87c004f

Browse files
committed
revert test_build_tasks
1 parent 154b630 commit 87c004f

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

readthedocs/projects/tests/test_build_tasks.py

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -301,15 +301,9 @@ def test_build_updates_documentation_type(self, load_yaml_config):
301301
self._trigger_update_docs_task()
302302

303303
# Update version state
304-
patch_request = None
305-
for req in self.requests_mock.request_history[7:]:
306-
if req._request.method == "PATCH" and req.path == "/api/v2/version/1/":
307-
patch_request = req
308-
break
309-
310-
assert patch_request._request.method == "PATCH"
311-
assert patch_request.path == "/api/v2/version/1/"
312-
assert patch_request.json() == {
304+
assert self.requests_mock.request_history[8]._request.method == "PATCH"
305+
assert self.requests_mock.request_history[8].path == "/api/v2/version/1/"
306+
assert self.requests_mock.request_history[8].json() == {
313307
"addons": False,
314308
"build_data": None,
315309
"built": True,
@@ -2012,19 +2006,23 @@ def test_mkdocs_fail_on_warning(self, load_yaml_config):
20122006

20132007
self._trigger_update_docs_task()
20142008

2015-
self.mocker.mocks["environment.run"].assert_any_call(
2016-
mock.ANY,
2017-
"-m",
2018-
"mkdocs",
2019-
"build",
2020-
"--clean",
2021-
"--site-dir",
2022-
"$READTHEDOCS_OUTPUT/html",
2023-
"--config-file",
2024-
"docs/mkdocs.yaml",
2025-
"--strict",
2026-
cwd=mock.ANY,
2027-
bin_path=mock.ANY,
2009+
self.mocker.mocks["environment.run"].assert_has_calls(
2010+
[
2011+
mock.call(
2012+
mock.ANY,
2013+
"-m",
2014+
"mkdocs",
2015+
"build",
2016+
"--clean",
2017+
"--site-dir",
2018+
"$READTHEDOCS_OUTPUT/html",
2019+
"--config-file",
2020+
"docs/mkdocs.yaml",
2021+
"--strict", # fail on warning flag
2022+
cwd=mock.ANY,
2023+
bin_path=mock.ANY,
2024+
)
2025+
]
20282026
)
20292027

20302028
@mock.patch("readthedocs.doc_builder.director.load_yaml_config")

0 commit comments

Comments
 (0)