diff options
author | Tiago Natel de Moura <t.nateldemoura@f5.com> | 2021-01-08 10:38:46 +0000 |
---|---|---|
committer | Tiago Natel de Moura <t.nateldemoura@f5.com> | 2021-01-08 10:38:46 +0000 |
commit | a0bc946db306b921fd2db909377e72bf6671e843 (patch) | |
tree | 85db5abbf1926889812681389c2b2af0d5adfcfb /test/conftest.py | |
parent | 13a06497def68d8157dfe2b6e0a7f7edcc2ef477 (diff) | |
download | unit-a0bc946db306b921fd2db909377e72bf6671e843.tar.gz unit-a0bc946db306b921fd2db909377e72bf6671e843.tar.bz2 |
Tests: fixed test_respawn.py to act upon test processes.
Running `test_respawn_` test cases on a machine with Unit
daemon in background would fail tests because `ps ax` was
used without filtering out other unit instances.
This patch also prevents from tests killing other Unit
processes not related to tests.
Diffstat (limited to 'test/conftest.py')
-rw-r--r-- | test/conftest.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/conftest.py b/test/conftest.py index d87e648b..0a4b541d 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -443,6 +443,10 @@ def is_unsafe(request): def is_su(request): return os.geteuid() == 0 +@pytest.fixture +def unit_pid(request): + return unit_instance['process'].pid + def pytest_sessionfinish(session): unit_stop() shutil.rmtree(option.cache_dir) |