Skip to content

Commit

Permalink
Fix crash on test exit
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 1, 2021
1 parent 38a6cc0 commit a58a817
Showing 1 changed file with 9 additions and 52 deletions.
61 changes: 9 additions & 52 deletions tests/src/python/test_qgsvectorlayershapefile.py
Expand Up @@ -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

Expand All @@ -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')
Expand All @@ -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

Expand Down

0 comments on commit a58a817

Please sign in to comment.