forked from FAForever/client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conftest.py
46 lines (34 loc) · 1022 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
39
40
41
42
43
44
45
46
import os
import sys
import pytest
sys.path.insert(
0,
os.path.abspath(
os.path.join(
os.path.dirname(os.path.realpath(__file__)), "src",
),
),
)
__all__ = ('application', 'signal_receiver')
@pytest.fixture(scope="module")
def application(qapp, request):
return qapp
@pytest.fixture(scope="function")
def signal_receiver(application):
from PyQt5 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)