File: test_demos.py

package info (click to toggle)
app-model 0.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 688 kB
  • sloc: python: 5,471; makefile: 4
file content (14 lines) | stat: -rw-r--r-- 436 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import runpy
from pathlib import Path

import pytest
from qtpy.QtWidgets import QApplication

DEMO = Path(__file__).parent.parent.parent / "demo"


@pytest.mark.needs_network
@pytest.mark.parametrize("fname", ["qapplication.py", "model_app.py", "multi_file"])
def test_qapp(qapp, fname, monkeypatch) -> None:
    monkeypatch.setattr(QApplication, "exec", lambda *a, **k: None)
    runpy.run_path(str(DEMO / fname), run_name="__main__")