chore: add geth.log to allure

This commit is contained in:
Anastasiya Semenkevich 2024-06-28 15:49:47 +03:00 committed by Anastasiya
parent c88317d7ad
commit 8bf4199433
1 changed files with 8 additions and 3 deletions

View File

@ -24,9 +24,14 @@ def application_logs():
yield
if configs.testpath.STATUS_DATA.exists():
for app_data in configs.testpath.STATUS_DATA.iterdir():
for log in (app_data / 'logs').glob('*.log'):
allure.attach.file(log, name=str(log.name), attachment_type=allure.attachment_type.TEXT)
log.unlink() # FIXME: it does not work on Windows, permission error
for log_dir in ['logs', 'data']:
log_path = app_data / log_dir
for log in log_path.glob('*.log'):
allure.attach.file(log, name=str(log.name), attachment_type=allure.attachment_type.TEXT)
try:
log.unlink() # FIXME: it does not work on Windows, permission error
except PermissionError:
print(f"Permission error: {log} could not be deleted.")
@pytest.fixture