tests/integrations/subprocess/test_is_process_dead.py
raw| 1 | import pytest |
| 2 | |
| 3 | from briefcase.integrations.subprocess import is_process_dead |
| 4 | |
| 5 | |
| 6 | @pytest.mark.parametrize(("is_pid_exists", "is_dead"), [(True, False), (False, True)]) |
| 7 | def test_is_process_dead(is_pid_exists, is_dead, monkeypatch): |
| 8 | """Returns inverse of whether PID exists.""" |
| 9 | monkeypatch.setattr("psutil.pid_exists", lambda pid: is_pid_exists) |
| 10 | assert is_process_dead(100) is is_dead |