Skip to content

Commit e7df793

Browse files
committedJun 9, 2018
Set locale in the tests
1 parent ec20ff7 commit e7df793

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎tests/src/python/test_qgsfieldformatters.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,14 @@ def setUpClass(cls):
266266
QCoreApplication.setOrganizationDomain("QGIS_TestPyQgsColorScheme.com")
267267
QCoreApplication.setApplicationName("QGIS_TestPyQgsColorScheme")
268268
QgsSettings().clear()
269+
QLocale.setDefault(QLocale.c())
269270
start_app()
270271

272+
@classmethod
273+
def tearDownClass(cls):
274+
"""Reset locale"""
275+
QLocale.setDefault(QLocale.c())
276+
271277
def test_representValue(self):
272278

273279
layer = QgsVectorLayer("point?field=int:integer&field=double:double&field=long:long",
@@ -277,8 +283,6 @@ def test_representValue(self):
277283

278284
fieldFormatter = QgsRangeFieldFormatter()
279285

280-
QLocale.setDefault(QLocale.c())
281-
282286
# Precision is ignored for integers and longlongs
283287
self.assertEqual(fieldFormatter.representValue(layer, 0, {'Precision': 1}, None, '123'), '123')
284288
self.assertEqual(fieldFormatter.representValue(layer, 0, {'Precision': 1}, None, '123000'), '123000')

0 commit comments

Comments
 (0)