mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-09-21 03:51:26 +12:00
25 lines
599 B
Python
25 lines
599 B
Python
#!/usr/bin/env python
|
|
# --!-- coding: utf8 --!--
|
|
|
|
"""Tests."""
|
|
|
|
import pytest
|
|
|
|
# We need a qApplication to be running, or all the calls to qApp
|
|
# will throw a seg fault.
|
|
from PyQt5.QtWidgets import QApplication
|
|
app = QApplication([])
|
|
|
|
@pytest.yield_fixture(scope='session', autouse=True)
|
|
def MW():
|
|
|
|
# Creates a mainWindow that can be used for the tests
|
|
# Either with functions.mainWindow or by passing argument
|
|
# MW to the test
|
|
from manuskript.mainWindow import MainWindow
|
|
mw = MainWindow()
|
|
|
|
yield
|
|
|
|
# Properly destructed after. Otherwise: seg fault.
|
|
mw.deleteLater()
|