Skip to content

Commit

Permalink
Better logic for sql layer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Jul 9, 2021
1 parent 3cac2e7 commit a94e089
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tests/src/python/test_qgsproviderconnection_base.py
Expand Up @@ -529,22 +529,19 @@ def testCreateSqlVectorLayer(self):
print(f"FIXME: {self.providerKey} data provider does not support query layers!")
return

try:
schema = getattr(self, 'sqlVectorLayerSchema')
except: # noqa: E722
schema = getattr(self, 'sqlVectorLayerSchema', None)
if schema is None:
print(f"FIXME: {self.providerKey} data provider test case does not define self.sqlVectorLayerSchema for query layers test!")
return

try:
table = getattr(self, 'sqlVectorLayerTable')
except: # noqa: E722
table = getattr(self, 'sqlVectorLayerTable', None)
if table is None:
print(f"FIXME: {self.providerKey} data provider test case does not define self.sqlVectorLayerTable for query layers test!")
return

sql_layer_capabilities = conn.sqlLayerDefinitionCapabilities()

# Try a simple select first

table_info = conn.table(schema, table)

options = QgsAbstractDatabaseProviderConnection.SqlVectorLayerOptions()
Expand Down

0 comments on commit a94e089

Please sign in to comment.