2017-11-19 12:20:49 +13:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# --!-- coding: utf8 --!--
|
|
|
|
|
|
|
|
"""Fixtures."""
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
|
2017-11-20 05:54:04 +13:00
|
|
|
@pytest.fixture(scope='session', autouse=True)
|
2017-11-20 03:29:38 +13:00
|
|
|
def MWEmptyProject():
|
2017-11-19 12:20:49 +13:00
|
|
|
"""
|
2017-11-20 03:29:38 +13:00
|
|
|
Sets the mainWindow to load an empty project.
|
2017-11-19 12:20:49 +13:00
|
|
|
"""
|
2017-11-20 03:29:38 +13:00
|
|
|
from manuskript.functions import mainWindow
|
|
|
|
MW = mainWindow()
|
2017-11-19 12:20:49 +13:00
|
|
|
|
2017-11-20 03:29:38 +13:00
|
|
|
import tempfile
|
|
|
|
tf = tempfile.NamedTemporaryFile(suffix=".msk")
|
|
|
|
MW.welcome.createFile(tf.name, overwrite=True)
|
|
|
|
assert MW.currentProject is not None
|
2017-11-19 12:20:49 +13:00
|
|
|
|
2017-11-20 03:29:38 +13:00
|
|
|
return MW
|
2017-11-20 05:54:04 +13:00
|
|
|
|
|
|
|
# yield MW
|
|
|
|
# # Properly destructed after. Otherwise: seg fault.
|
|
|
|
# MW.deleteLater()
|