summaryrefslogtreecommitdiffhomepage
path: root/test/conftest.py
diff options
context:
space:
mode:
authorTiago Natel de Moura <t.nateldemoura@f5.com>2021-01-08 10:38:46 +0000
committerTiago Natel de Moura <t.nateldemoura@f5.com>2021-01-08 10:38:46 +0000
commita0bc946db306b921fd2db909377e72bf6671e843 (patch)
tree85db5abbf1926889812681389c2b2af0d5adfcfb /test/conftest.py
parent13a06497def68d8157dfe2b6e0a7f7edcc2ef477 (diff)
downloadunit-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.py4
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)