Skip to content
Permalink
Browse files

Fix crash on test exit

  • Loading branch information
nyalldawson committed Feb 8, 2021
1 parent 9fd3b20 commit a5e6e08fc5e01794a10af7743d426bd2df19def3
Showing with 9 additions and 52 deletions.
  1. +9 −52 tests/src/python/test_qgsvectorlayershapefile.py
@@ -10,60 +10,13 @@
__date__ = '20/08/2012'
__copyright__ = 'Copyright 2012, The QGIS Project'

import qgis # NOQA

import os
import tempfile
import shutil

from qgis.PyQt.QtCore import QDate, QDateTime, QVariant, Qt, QDateTime, QDate, QTime
from qgis.PyQt.QtGui import QPainter, QColor
from qgis.PyQt.QtXml import QDomDocument

from qgis.core import (QgsWkbTypes,
QgsAction,
QgsCoordinateTransformContext,
QgsDataProvider,
QgsDefaultValue,
QgsEditorWidgetSetup,
QgsVectorLayer,
QgsRectangle,
QgsFeature,
QgsFeatureRequest,
QgsGeometry,
QgsPointXY,
QgsField,
QgsFieldConstraints,
QgsFields,
QgsVectorLayerJoinInfo,
QgsSymbol,
QgsSingleSymbolRenderer,
QgsCoordinateReferenceSystem,
QgsVectorLayerCache,
QgsReadWriteContext,
QgsProject,
QgsUnitTypes,
QgsAggregateCalculator,
QgsPoint,
QgsExpressionContext,
QgsExpressionContextScope,
QgsExpressionContextUtils,
QgsLineSymbol,
QgsMapLayerStyle,
QgsMapLayerDependency,
QgsPalLayerSettings,
QgsVectorLayerSimpleLabeling,
QgsSingleCategoryDiagramRenderer,
QgsDiagramLayerSettings,
QgsTextFormat,
QgsVectorLayerSelectedFeatureSource,
QgsExpression,
NULL)
from qgis.gui import (QgsAttributeTableModel,
QgsGui
)
from qgis.PyQt.QtTest import QSignalSpy
import qgis # NOQA
from qgis.core import QgsVectorLayer
from qgis.gui import QgsGui
from qgis.testing import start_app, unittest

from featuresourcetestbase import FeatureSourceTestCase
from utilities import unitTestDataPath

@@ -73,10 +26,10 @@


class TestQgsVectorLayerShapefile(unittest.TestCase, FeatureSourceTestCase):

"""
Tests a vector layer against the feature source tests, using a real layer source (not a memory layer)
"""

@classmethod
def getSource(cls):
vl = QgsVectorLayer(os.path.join(TEST_DATA_DIR, 'provider', 'shapefile.shp'), 'test')
@@ -90,6 +43,10 @@ def setUpClass(cls):
# Create test layer for FeatureSourceTestCase
cls.source = cls.getSource()

@classmethod
def tearDownClass(cls):
cls.source = None

def treat_time_as_string(self):
return True

0 comments on commit a5e6e08

Please sign in to comment.