File utils1 (#1)
Tests / test_and_lint (push) Successful in 7s

Reviewed-on: #1
Co-authored-by: Mathias Scheider <mathias2784@web.de>
This commit was merged in pull request #1.
This commit is contained in:
2026-10-01 19:13:45 +00:00
committed by mathias2784
parent 59faa596d5
commit 9d13c6ec14
12 changed files with 452 additions and 15 deletions
+30
View File
@@ -0,0 +1,30 @@
"""Live dialog tests for ``utils.filedialogs``.
These tests open a real OS dialog and require a working display.
They are excluded from the default (and pipeline) runs by the
``live`` marker configured in ``pyproject.toml`` and only run when
explicitly requested, e.g.::
uv run pytest -m live
Choose a path in the dialog (or cancel it) — either outcome passes,
as long as the dialog returns consistently.
"""
import os
import pytest
from utils.filedialogs import get_dir_path_from_dialog, get_file_path_from_dialog
@pytest.mark.live
def test_get_dir_path_from_dialog_live():
result = get_dir_path_from_dialog(title="Test: pick a directory")
assert result == "" or os.path.isdir(result)
@pytest.mark.live
def test_get_file_path_from_dialog_live():
result = get_file_path_from_dialog(title="Test: pick a file")
assert result == "" or os.path.isfile(result)