Add conftest.py
Run Pytest with Allure and Coverage Reports / tests (push) Successful in 38s

This commit is contained in:
2025-07-15 13:20:22 +02:00
parent cdeb7e1dc2
commit bc0fe8b029
+19
View File
@@ -0,0 +1,19 @@
import json
def pytest_runtest_makereport(item, call):
try:
# Récupère tout ce qui est intéressant dans item
info = {
'nodeid': item.nodeid,
'name': getattr(item, 'name', None),
'keywords': list(getattr(item, 'keywords', {}).keys()),
'callspec': dict(item.callspec.params) if hasattr(item, "callspec") else None,
'user_properties': getattr(item, 'user_properties', None),
'fixtureinfo': str(getattr(item, 'fixturenames', None)),
# Ajoute d'autres attributs ici si tu veux
}
with open("ci-reports/markdown/pytest_item_dump.txt", "a") as f:
f.write(json.dumps(info, indent=2, default=str) + "\n\n")
except Exception as e:
with open("ci-reports/markdown/pytest_item_dump.txt", "a") as f:
f.write(f"ERROR in pytest_runtest_makereport for {getattr(item, 'nodeid', '??')}: {e}\n")