conftest.py 587 B

1234567891011121314151617181920212223242526
  1. from datalad.conftest import setup_package
  2. import pytest
  3. from PySide6.QtWidgets import QApplication
  4. from .app import GooeyApp
  5. @pytest.fixture(scope="package", autouse=True)
  6. def get_headless_qtapp():
  7. qtapp = QApplication.instance()
  8. if not qtapp:
  9. QApplication(['test_app', '-platform', 'offscreen'])
  10. @pytest.fixture(scope="function")
  11. def gooey_app(tmp_path):
  12. try:
  13. gooey = GooeyApp(tmp_path)
  14. # maybe leave that to a caller?
  15. gooey.main_window.show()
  16. yield gooey
  17. finally:
  18. if gooey is not None:
  19. gooey.deinit()