Skip to content

Fix flake failures #59184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/core/additions/qgssettingsentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, key, pluginName, defaultValue, description=str(), options=Qgi
defaultValueStr = self.__metaEnum.valueToKey(defaultValue)
self.__enumFlagClass = defaultValue.__class__

if type(pluginName) == str:
if isinstance(pluginName, str):
parent = QgsSettingsTree.createPluginTreeNode(pluginName)
else:
parent = pluginName
Expand Down Expand Up @@ -127,7 +127,7 @@ def setValue(self, value, dynamicKeyPart: (list, str) = None):
QgsLogger.debug("Invalid enum/flag value '{0}'.".format(value))
return False

if type(dynamicKeyPart) == str:
if isinstance(dynamicKeyPart, str):
dynamicKeyPart = [dynamicKeyPart]
elif dynamicKeyPart is None:
dynamicKeyPart = []
Expand Down
2 changes: 1 addition & 1 deletion python/pyplugin_installer/version_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def compareVersions(a, b):

def splitVersion(s):
""" split string into 2 or 3 numerical segments """
if not s or type(s) != str:
if not s or not isinstance(s, str):
return None
l = str(s).split('.')
for c in l:
Expand Down
6 changes: 3 additions & 3 deletions tests/src/python/test_qgsgeometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2638,14 +2638,14 @@ def circle_curvepolygon():
message += ' failed'
message_with_wkt = message + f'\nOriginal geom: {geoms[t].asWkt()}'
if type(parts[t]) is list:
if type(parts[t][0]) == QgsPointXY:
if isinstance(parts[t][0], QgsPointXY):
self.assertEqual(geoms[t].addPointsXY(parts[t], geom_type), expected_result, message_with_wkt)
elif type(parts[t][0]) == QgsPoint:
elif isinstance(parts[t][0], QgsPoint):
self.assertEqual(geoms[t].addPoints(parts[t]), expected_result, message_with_wkt)
else:
self.fail(message_with_wkt + '\n could not detect what Python method to use for add part')
else:
if type(parts[t]) == QgsGeometry:
if isinstance(parts[t], QgsGeometry):
self.assertEqual(geoms[t].addPartGeometry(parts[t]), expected_result, message)
else:
self.assertEqual(geoms[t].addPart(parts[t], geom_type), expected_result, message_with_wkt)
Expand Down
Loading