Navigation Menu

Skip to content

Commit

Permalink
Copy test file before running the test
Browse files Browse the repository at this point in the history
and make make check happy
  • Loading branch information
elpaso committed May 30, 2019
1 parent 1d1d2ca commit 2a2a4cd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/src/python/test_qgsfieldvalidator.py
Expand Up @@ -11,6 +11,9 @@
__copyright__ = 'Copyright 2018, The QGIS Project'

import qgis # NOQA
import tempfile
import os
import shutil

from qgis.PyQt.QtCore import QVariant, QLocale
from qgis.PyQt.QtGui import QValidator
Expand All @@ -29,8 +32,12 @@ class TestQgsFieldValidator(unittest.TestCase):

def setUp(self):
"""Run before each test."""
testPath = TEST_DATA_DIR + '/' + 'bug_17878.gpkg|layername=bug_17878'
self.vl = QgsVectorLayer(testPath, "test_data", "ogr")
testPath = TEST_DATA_DIR + '/' + 'bug_17878.gpkg'
# Copy it
tempdir = tempfile.mkdtemp()
testPathCopy = os.path.join(tempdir, 'bug_17878.gpkg')
shutil.copy(testPath, testPathCopy)
self.vl = QgsVectorLayer(testPathCopy + '|layername=bug_17878', "test_data", "ogr")
assert self.vl.isValid()

def tearDown(self):
Expand Down

0 comments on commit 2a2a4cd

Please sign in to comment.