Skip to content
Permalink
Browse files
Fix failing tests
  • Loading branch information
nyalldawson committed May 2, 2017
1 parent 348c886 commit f81971daa40731c390ac7d692163adc1d34ca379
Showing with 4 additions and 3 deletions.
  1. +3 −3 python/plugins/processing/tools/vector.py
  2. +1 −0 tests/src/python/test_qgsproject.py
@@ -478,7 +478,7 @@ def createVectorWriter(destination, encoding, fields, geometryType, crs, context

layer = QgsVectorLayer(uri, destination, 'memory')
sink = layer.dataProvider()
context.temporaryLayerStore().addMapLayer(layer, False)
context.temporaryLayerStore().addMapLayer(layer)
destination = layer.id()
elif destination.startswith(POSTGIS_LAYER_PREFIX):
uri = QgsDataSourceUri(destination[len(POSTGIS_LAYER_PREFIX):])
@@ -515,7 +515,7 @@ def _runSQL(sql):

layer = QgsVectorLayer(uri.uri(), uri.table(), "postgres")
sink = layer.dataProvider()
context.temporaryLayerStore().addMapLayer(layer, False)
context.temporaryLayerStore().addMapLayer(layer)
elif destination.startswith(SPATIALITE_LAYER_PREFIX):
uri = QgsDataSourceUri(destination[len(SPATIALITE_LAYER_PREFIX):])
try:
@@ -545,7 +545,7 @@ def _runSQL(sql):

layer = QgsVectorLayer(uri.uri(), uri.table(), "spatialite")
sink = layer.dataProvider()
context.temporaryLayerStore().addMapLayer(layer, False)
context.temporaryLayerStore().addMapLayer(layer)
else:
formats = QgsVectorFileWriter.supportedFiltersAndFormats()
OGRCodes = {}
@@ -684,5 +684,6 @@ def testTakeLayer(self):
p = None
self.assertTrue(l1.isValid())


if __name__ == '__main__':
unittest.main()

0 comments on commit f81971d

Please sign in to comment.