summaryrefslogtreecommitdiffhomepage
path: root/test/unit/main.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2020-12-09 16:15:50 +0000
committerAndrei Zeliankou <zelenkov@nginx.com>2020-12-09 16:15:50 +0000
commit4c846ae69308983050a55f6467c2d53e78120e0b (patch)
treee3554147a322a883fb63cdfd7d1740980da12589 /test/unit/main.py
parent783cdc2a3d99bd9fb8d75218d679ddb571420e98 (diff)
downloadunit-4c846ae69308983050a55f6467c2d53e78120e0b.tar.gz
unit-4c846ae69308983050a55f6467c2d53e78120e0b.tar.bz2
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.
Diffstat (limited to '')
-rw-r--r--test/unit/main.py46
1 files changed, 20 insertions, 26 deletions
diff --git a/test/unit/main.py b/test/unit/main.py
index fce6a322..749ff3ab 100644
--- a/test/unit/main.py
+++ b/test/unit/main.py
@@ -4,39 +4,33 @@ from unit.option import option
class TestUnit():
@classmethod
- def setup_class(cls, complete_check=True):
- def check():
- missed = []
+ def setup_class(cls):
+ missed = []
- # check modules
+ # check modules
- if 'modules' in cls.prerequisites:
- available_modules = list(option.available['modules'].keys())
+ if 'modules' in cls.prerequisites:
+ available_modules = list(option.available['modules'].keys())
- for module in cls.prerequisites['modules']:
- if module in available_modules:
- continue
+ for module in cls.prerequisites['modules']:
+ if module in available_modules:
+ continue
- missed.append(module)
+ missed.append(module)
- if missed:
- pytest.skip('Unit has no ' + ', '.join(missed) + ' module(s)')
+ if missed:
+ pytest.skip('Unit has no ' + ', '.join(missed) + ' module(s)')
- # check features
+ # check features
- if 'features' in cls.prerequisites:
- available_features = list(option.available['features'].keys())
+ if 'features' in cls.prerequisites:
+ available_features = list(option.available['features'].keys())
- for feature in cls.prerequisites['features']:
- if feature in available_features:
- continue
+ for feature in cls.prerequisites['features']:
+ if feature in available_features:
+ continue
- missed.append(feature)
+ missed.append(feature)
- if missed:
- pytest.skip(', '.join(missed) + ' feature(s) not supported')
-
- if complete_check:
- check()
- else:
- return check
+ if missed:
+ pytest.skip(', '.join(missed) + ' feature(s) not supported')