Skip to content

Commit 04101c3

Browse files
committedNov 20, 2017
Add dummy canvas to test
1 parent 7b45e9d commit 04101c3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎tests/src/python/test_qgsrelationeditwidget.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
from qgis.gui import (
3030
QgsGui,
3131
QgsRelationWidgetWrapper,
32-
QgsAttributeEditorContext
32+
QgsAttributeEditorContext,
33+
QgsMapCanvas
3334
)
3435

3536
from qgis.PyQt.QtCore import QTimer
@@ -47,7 +48,8 @@ def setUpClass(cls):
4748
Setup the involved layers and relations for a n:m relation
4849
:return:
4950
"""
50-
QgsGui.editorWidgetRegistry().initEditors()
51+
cls.mapCanvas = QgsMapCanvas()
52+
QgsGui.editorWidgetRegistry().initEditors(cls.mapCanvas)
5153
cls.dbconn = 'service=\'qgis_test\''
5254
if 'QGIS_PGTEST_DB' in os.environ:
5355
cls.dbconn = os.environ['QGIS_PGTEST_DB']

0 commit comments

Comments
 (0)
Please sign in to comment.