Skip to content

Commit d5dacf1

Browse files
committed
[dist] Fix error with test_bootstraps
Caused by the latest changes to `Distribution.save_info`
1 parent aa8afe9 commit d5dacf1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/test_bootstrap.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ def bootstrap_name(self):
370370
@mock.patch("pythonforandroid.bootstraps.service_only.open", create=True)
371371
@mock.patch("pythonforandroid.bootstraps.webview.open", create=True)
372372
@mock.patch("pythonforandroid.bootstraps.sdl2.open", create=True)
373-
@mock.patch("pythonforandroid.distribution.open", create=True)
374373
@mock.patch(
375374
"pythonforandroid.python.GuestPythonRecipe.create_python_bundle"
376375
)
@@ -389,7 +388,6 @@ def test_run_distribute(
389388
mock_ensure_dir,
390389
mock_strip_libraries,
391390
mock_create_python_bundle,
392-
mock_open_dist_files,
393391
mock_open_sdl2_files,
394392
mock_open_webview_files,
395393
mock_open_service_only_files,
@@ -423,9 +421,12 @@ def test_run_distribute(
423421
self.ctx.python_modules = ["requests"]
424422
self.ctx.archs = [ArchARMv7_a(self.ctx)]
425423

426-
bs.run_distribute()
424+
with mock.patch(
425+
'pythonforandroid.distribution.Distribution.save_info',
426+
) as mock_open_save_info:
427+
bs.run_distribute()
427428

428-
mock_open_dist_files.assert_called_once_with("dist_info.json", "w")
429+
mock_open_save_info.assert_called()
429430
mock_open_bootstraps = {
430431
"sdl2": mock_open_sdl2_files,
431432
"webview": mock_open_webview_files,

0 commit comments

Comments
 (0)