manuskript/manuskript/tests/__init__.py

42 lines
1.5 KiB
Python
Raw Normal View History

2017-11-19 10:07:10 +13:00
#!/usr/bin/env python
# --!-- coding: utf8 --!--
"""Tests."""
2017-11-19 12:20:49 +13:00
2017-11-21 03:42:30 +13:00
# METHOD 1
# ========
# Don't know why, this causes seg fault on SemaphoreCI
# Seg fault in app = QApplication(...)
# Workaround: create and discard an app first...
from PyQt5.QtWidgets import QApplication
QApplication([])
# Create app and mainWindow
from manuskript import main
app, MW = main.prepare(tests=True)
2017-11-19 12:20:49 +13:00
2017-11-21 03:42:30 +13:00
# FIXME: Again, don't know why, but when closing a project and then reopening
# one, we get a `TypeError: connection is not unique` in MainWindow:
# self.btnAddSubPlot.clicked.connect(self.updateSubPlotView, F.AUC)
# Yet the disconnectAll() function has been called.
# Workaround: we remove the necessity for connection to be unique. This
# works for now, but could create issues later on when we want to test
# this specific functionality. Maybe it will be called several times?
2017-11-21 03:42:30 +13:00
# At that moment, we will need to catch the exception in the MainWindow,
# or better: understand why it happens at all, and only on some signals.
from manuskript import functions as F
from PyQt5.QtCore import Qt
F.AUC = Qt.AutoConnection
2017-11-20 05:54:04 +13:00
2017-11-21 03:42:30 +13:00
# METHOD 2
# ========
2017-11-19 12:20:49 +13:00
# We need a qApplication to be running, or all the calls to qApp
# will throw a seg fault.
2017-11-21 03:42:30 +13:00
# from PyQt5.QtWidgets import QApplication
# app = QApplication([])
# app.setOrganizationName("manuskript_tests")
# app.setApplicationName("manuskript_tests")
2017-11-20 03:29:38 +13:00
2017-11-21 03:42:30 +13:00
# from manuskript.mainWindow import MainWindow
# MW = MainWindow()