forked from FAForever/client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conftest.py
38 lines (30 loc) · 988 Bytes
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import os
import pytest
import sys
if os.path.isdir("src"):
sys.path.insert(0, os.path.abspath("src"))
elif os.path.isdir("../src"):
sys.path.insert(0, os.path.abspath("../src"))
import config
@pytest.fixture(scope="module")
def application(qapp, request):
return qapp
@pytest.fixture(scope="function")
def signal_receiver(application):
from PyQt4 import QtCore
class SignalReceiver(QtCore.QObject):
def __init__(self, parent=None):
QtCore.QObject.__init__(self, parent)
self.int_values = []
self.generic_values = []
self.string_values = []
@QtCore.pyqtSlot()
def generic_slot(self):
self.generic_values.append(None)
@QtCore.pyqtSlot(str)
def string_slot(self, value):
self.string_values.append(value)
@QtCore.pyqtSlot(int)
def int_slot(self, value):
self.int_values.append(value)
return SignalReceiver(application)