Skip to content

Commit 154b630

Browse files
committed
more lax asser for call
1 parent bdbc55d commit 154b630

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

readthedocs/projects/tests/test_build_tasks.py

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,13 @@ def test_build_updates_documentation_type(self, load_yaml_config):
302302

303303
# Update version state
304304
patch_request = None
305-
for req in self.requests_mock.request_history:
305+
for req in self.requests_mock.request_history[7:]:
306306
if req._request.method == "PATCH" and req.path == "/api/v2/version/1/":
307307
patch_request = req
308308
break
309309

310310
assert patch_request._request.method == "PATCH"
311-
assert patch_request == "/api/v2/version/1/"
311+
assert patch_request.path == "/api/v2/version/1/"
312312
assert patch_request.json() == {
313313
"addons": False,
314314
"build_data": None,
@@ -2012,24 +2012,19 @@ def test_mkdocs_fail_on_warning(self, load_yaml_config):
20122012

20132013
self._trigger_update_docs_task()
20142014

2015-
self.mocker.mocks["environment.run"].assert_has_calls(
2016-
[
2017-
mock.call(
2018-
mock.ANY,
2019-
"-m",
2020-
"mkdocs",
2021-
"build",
2022-
"--clean",
2023-
"--site-dir",
2024-
"$READTHEDOCS_OUTPUT/html",
2025-
"--config-file",
2026-
"docs/mkdocs.yaml",
2027-
"--strict", # fail on warning flag
2028-
cwd=mock.ANY,
2029-
bin_path=mock.ANY,
2030-
)
2031-
],
2032-
any_order=True,
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,
20332028
)
20342029

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

0 commit comments

Comments
 (0)