20 lines
935 B
Python
20 lines
935 B
Python
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")
|