mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 09:52:37 +02:00
tests: Restore previously mocked function
Restore the `isolation_provider.base.kill_process_group()` function, which was previously mocked, at the end of the `test_linger_unkillable()` test. This function is initially mocked, in order to simulate a hang process. After the mocking completes, the test needs the original function once more, in order to actually kill the spawned process.
This commit is contained in:
parent
59e1666c28
commit
d561878e03
1 changed files with 2 additions and 0 deletions
|
@ -164,6 +164,7 @@ class IsolationProviderTermination:
|
|||
terminate_proc_mock = mocker.patch.object(
|
||||
provider, "terminate_doc_to_pixels_proc", return_value=None
|
||||
)
|
||||
kill_pg_orig = base.kill_process_group
|
||||
kill_pg_mock = mocker.patch(
|
||||
"dangerzone.isolation_provider.base.kill_process_group", return_value=None
|
||||
)
|
||||
|
@ -178,6 +179,7 @@ class IsolationProviderTermination:
|
|||
|
||||
# Reset the function to the original state.
|
||||
provider.terminate_doc_to_pixels_proc = terminate_proc_orig # type: ignore [method-assign]
|
||||
base.kill_process_group = kill_pg_orig
|
||||
|
||||
# Really kill the spawned process, so that it doesn't linger after the tests
|
||||
# complete.
|
||||
|
|
Loading…
Reference in a new issue