From 7db2848474546910ed6b5fcf543e5744fc2fa9b8 Mon Sep 17 00:00:00 2001 From: Olivier Keshavjee Date: Sun, 19 Nov 2017 17:54:04 +0100 Subject: [PATCH] This should build with SemaphoreCI --- manuskript/tests/__init__.py | 17 +++++++++++------ manuskript/tests/conftest.py | 21 +++++---------------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/manuskript/tests/__init__.py b/manuskript/tests/__init__.py index b63773ce..96981ad1 100644 --- a/manuskript/tests/__init__.py +++ b/manuskript/tests/__init__.py @@ -5,12 +5,17 @@ import pytest +## Don't know why, this causes seg fault on SemaphoreCI +## Seg fault in app = QApplication(...) +# from manuskript import main +# app, MW = main.prepare() + # 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([]) -# app.setOrganizationName("manuskript_tests") -# app.setApplicationName("manuskript_tests") +from PyQt5.QtWidgets import QApplication +app = QApplication([]) +app.setOrganizationName("manuskript_tests") +app.setApplicationName("manuskript_tests") -from manuskript import main -app, MW = main.prepare() +from manuskript.mainWindow import MainWindow +MW = MainWindow() diff --git a/manuskript/tests/conftest.py b/manuskript/tests/conftest.py index 5f825e48..e6c0eebe 100644 --- a/manuskript/tests/conftest.py +++ b/manuskript/tests/conftest.py @@ -5,22 +5,7 @@ import pytest -# @pytest.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() - -@pytest.fixture +@pytest.fixture(scope='session', autouse=True) def MWEmptyProject(): """ Sets the mainWindow to load an empty project. @@ -34,3 +19,7 @@ def MWEmptyProject(): assert MW.currentProject is not None return MW + + # yield MW + # # Properly destructed after. Otherwise: seg fault. + # MW.deleteLater()