Files
031-flash-card/tests/e2e/conftest.py
T
Tirsvad f45d6036e4 MIL-008: Choose level
Review record RC-041 (Go, autonomous mode, not independent).

Task: MIL-008#1
Task: MIL-008#2
Task: MIL-008#3
Task: MIL-008#4
Task: MIL-008#5
Task: MIL-008#6
Task: MIL-008#7
Task: MIL-008#8
2026-10-14 23:58:31 +08:00

23 lines
623 B
Python

"""Fixtures shared by the end-to-end tests."""
import tkinter as tk
from collections.abc import Iterator
import pytest
@pytest.fixture(scope="session")
def tk_root() -> Iterator[tk.Tk]:
"""The one Tk root of the process, shared by every e2e module.
A second interpreter right after destroying the first fails to find
init.tcl on some Windows Python installs, so there is only one. Each test
builds its views on it and destroys their widgets afterwards.
"""
try:
root = tk.Tk()
except tk.TclError:
pytest.skip("no display available for Tk")
yield root
root.destroy()