Skip to content

Commit aa0b9fa

Browse files
committed
Test PyQgsRelationEditWidget updates
* QApplication is in QtWidgets, not QtGui * Expected failure only affects the travis Qt4 platform
1 parent 129ff7c commit aa0b9fa

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/src/python/test_qgsrelationeditwidget.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
)
3535

3636
from PyQt.QtCore import QTimer
37-
from PyQt.QtWidgets import QToolButton, QTableView
38-
from PyQt.QtGui import QApplication
37+
from PyQt.QtWidgets import QToolButton, QTableView, QApplication
3938
from qgis.testing import start_app, unittest
4039

4140
start_app()
@@ -103,7 +102,7 @@ def test_delete_feature(self):
103102

104103
self.assertEquals(1, len([f for f in self.vl_b.getFeatures()]))
105104

106-
fid = self.vl_b.getFeatures(QgsFeatureRequest().setFilterExpression('"name"=\'Design Patterns. Elements of Reusable Object-Oriented Software\'')).next().id()
105+
fid = next(self.vl_b.getFeatures(QgsFeatureRequest().setFilterExpression('"name"=\'Design Patterns. Elements of Reusable Object-Oriented Software\''))).id()
107106

108107
self.widget.featureSelectionManager().select([fid])
109108

@@ -126,7 +125,7 @@ def test_list(self):
126125

127126
self.assertEquals(self.table_view.model().rowCount(), 4)
128127

129-
@unittest.expectedFailure
128+
@unittest.expectedFailure(os.environ['QT_VERSION'] == '4' and os.environ['TRAVIS_OS_NAME'] == 'linux') # It's probably not related to this variables at all, but that's the closest we can get to the real source of this problem at the moment...
130129
def test_add_feature(self):
131130
"""
132131
Check if a new related feature is added

0 commit comments

Comments
 (0)