File: test_is_process_dead.py

package info (click to toggle)
python-briefcase 0.3.22-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,300 kB
  • sloc: python: 59,405; makefile: 57
file content (10 lines) | stat: -rw-r--r-- 389 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
import pytest

from briefcase.integrations.subprocess import is_process_dead


@pytest.mark.parametrize("is_pid_exists, is_dead", [(True, False), (False, True)])
def test_is_process_dead(is_pid_exists, is_dead, monkeypatch):
    """Returns inverse of whether PID exists."""
    monkeypatch.setattr("psutil.pid_exists", lambda pid: is_pid_exists)
    assert is_process_dead(100) is is_dead