Skip to content

Commit

Permalink
Add dummy canvas to test
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Nov 20, 2017
1 parent 7b45e9d commit 04101c3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/src/python/test_qgsrelationeditwidget.py
Expand Up @@ -29,7 +29,8 @@
from qgis.gui import (
QgsGui,
QgsRelationWidgetWrapper,
QgsAttributeEditorContext
QgsAttributeEditorContext,
QgsMapCanvas
)

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

0 comments on commit 04101c3

Please sign in to comment.