Skip to content

Commit 2992d6d

Browse files
committedApr 9, 2018
Don't use hardcoded paths in test
(cherry-picked from 8b04188)
1 parent 1c2103d commit 2992d6d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎python/plugins/processing/tests/Grass7AlgorithmsVectorTest.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import nose2
3131
import shutil
3232
import os
33+
import tempfile
3334

3435
from qgis.core import (QgsVectorLayer,
3536
QgsApplication,
@@ -56,6 +57,9 @@ def setUpClass(cls):
5657
Processing.initialize()
5758
cls.cleanup_paths = []
5859

60+
cls.temp_dir = tempfile.mkdtemp()
61+
cls.cleanup_paths.append(cls.temp_dir)
62+
5963
assert Grass7Utils.installedVersion()
6064

6165
@classmethod
@@ -88,7 +92,8 @@ def testMemoryLayerInput(self):
8892

8993
alg = QgsApplication.processingRegistry().createAlgorithmById('grass7:v.buffer')
9094
self.assertIsNotNone(alg)
91-
temp_file = '/tmp/grass_output.shp'
95+
96+
temp_file = os.path.join(self.temp_dir,'grass_output.shp')
9297
parameters ={'input':'testmem',
9398
'type':[0,1,4],
9499
'distance':1,
@@ -138,7 +143,7 @@ def testFeatureSourceInput(self):
138143

139144
alg = QgsApplication.processingRegistry().createAlgorithmById('grass7:v.buffer')
140145
self.assertIsNotNone(alg)
141-
temp_file = '/tmp/grass_output.shp'
146+
temp_file = os.path.join(self.temp_dir,'grass_output_sel.shp')
142147
parameters = {'input': QgsProcessingFeatureSourceDefinition('testmem', True),
143148
'type': [0, 1, 4],
144149
'distance': 1,

0 commit comments

Comments
 (0)
Please sign in to comment.