authentik setup and tracing #2

Merged
dan merged 69 commits from working-setup into dev 2023-11-27 17:01:47 +01:00
Showing only changes of commit ab8f068a5e - Show all commits

View file

@ -5,12 +5,12 @@
# sys.path. It is thus good practise for projects to either put conftest.py under
# a package scope or to never import anything from a conftest.py file.
import os.path
from pathlib import Path
import pytest
from dirmanager import DirManager
from dotenv import dotenv_values
from icecream import ic
from playwright.sync_api import BrowserContext
pytest_plugins = [
@ -79,8 +79,12 @@ def pytest_runtest_makereport(item, call):
# we only look at actual failing test calls, not setup/teardown
if rep.when == "call" and rep.failed:
mode = "a" if os.path.exists("failures") else "w"
with open("failures", mode) as f:
# saves traceback as .txt for failed test
filename = f"failed-{item.nodeid}.txt"
filename = filename.replace("/", "-")
filename = filename.replace("::", "-")
filepath = item.funcargs["RESULTS"] / filename
with open(filepath, "a") as f:
f.write(rep.longreprtext + "\n")