From 07789a23e9c513dba87b020fae2989a57955e8a6 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Sun, 6 Dec 2020 16:01:59 +0000 Subject: Tests: options moved to the separate class. This change is necessary to separate the logic and prevent possible circular dependency. --- test/test_php_isolation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/test_php_isolation.py') diff --git a/test/test_php_isolation.py b/test/test_php_isolation.py index cc660e04..1d0b0614 100644 --- a/test/test_php_isolation.py +++ b/test/test_php_isolation.py @@ -2,11 +2,11 @@ import shutil import pytest -from conftest import option from conftest import unit_run from conftest import unit_stop from unit.applications.lang.php import TestApplicationPHP from unit.feature.isolation import TestFeatureIsolation +from unit.option import option class TestPHPIsolation(TestApplicationPHP): -- cgit From 4c846ae69308983050a55f6467c2d53e78120e0b Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Wed, 9 Dec 2020 16:15:50 +0000 Subject: Tests: isolation check moved to the pytest_sessionstart(). This change eliminates the need for some classes to run Unit one more time before running tests. --- test/test_php_isolation.py | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'test/test_php_isolation.py') diff --git a/test/test_php_isolation.py b/test/test_php_isolation.py index 1d0b0614..b0fea383 100644 --- a/test/test_php_isolation.py +++ b/test/test_php_isolation.py @@ -2,30 +2,13 @@ import shutil import pytest -from conftest import unit_run -from conftest import unit_stop from unit.applications.lang.php import TestApplicationPHP -from unit.feature.isolation import TestFeatureIsolation from unit.option import option class TestPHPIsolation(TestApplicationPHP): prerequisites = {'modules': {'php': 'any'}, 'features': ['isolation']} - @classmethod - def setup_class(cls, complete_check=True): - check = super().setup_class(complete_check=False) - - unit = unit_run() - option.temp_dir = unit['temp_dir'] - - TestFeatureIsolation().check(option.available, unit['temp_dir']) - - assert unit_stop() is None - shutil.rmtree(unit['temp_dir']) - - return check if not complete_check else check() - def test_php_isolation_rootfs(self, is_su, temp_dir): isolation_features = option.available['features']['isolation'].keys() -- cgit From 6dc9c47ccd26b23b61b7522803a667c2e515e260 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Wed, 13 Jan 2021 06:22:43 +0000 Subject: Tests: style. --- test/test_php_isolation.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'test/test_php_isolation.py') diff --git a/test/test_php_isolation.py b/test/test_php_isolation.py index b0fea383..2e458023 100644 --- a/test/test_php_isolation.py +++ b/test/test_php_isolation.py @@ -1,7 +1,4 @@ -import shutil - import pytest - from unit.applications.lang.php import TestApplicationPHP from unit.option import option -- cgit