Tests: skip_alert() converted to the fixture.

This commit is contained in:
Andrei Zeliankou
2020-12-08 14:37:33 +00:00
parent 8f91628563
commit b2e767819f
15 changed files with 32 additions and 39 deletions

View File

@@ -74,10 +74,6 @@ def pytest_configure(config):
fcntl.fcntl(sys.stdout.fileno(), fcntl.F_SETFL, 0)
def skip_alert(*alerts):
option.skip_alerts.extend(alerts)
def pytest_generate_tests(metafunc):
cls = metafunc.cls
if (not hasattr(cls, 'application_type')
@@ -314,7 +310,7 @@ def _check_alerts(path=None):
alerts = re.findall(r'.+\[alert\].+', log)
if alerts:
print('All alerts/sanitizer errors found in log:')
print('\nAll alerts/sanitizer errors found in log:')
[print(alert) for alert in alerts]
found = True
@@ -378,6 +374,14 @@ def stop_processes():
return 'Fail to stop process(es)'
@pytest.fixture()
def skip_alert():
def _skip(*alerts):
option.skip_alerts.extend(alerts)
return _skip
@pytest.fixture
def temp_dir(request):
return unit_instance['temp_dir']