Skip to content

Commit

Permalink
Avoid unnecessary selective rendering test
Browse files Browse the repository at this point in the history
Skip the parallel renderer check when the force vector flag is
set, as that flag is incompatible with parallel rendering and
we end up running a duplicate raster check anyway. Also avoids
some console warnings when running the test.
  • Loading branch information
nyalldawson committed Jun 27, 2024
1 parent 133522b commit 5ac2172
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/src/python/test_selective_masking.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,19 @@ def get_symbollayer_ref(self, layer, ruleId, symbollayer_ids):
symbollayer = self.get_symbollayer(layer, ruleId, symbollayer_ids)
return QgsSymbolLayerReference(layer.id(), symbollayer.id())

def check_renderings(self, map_settings, control_name):
def check_renderings(self, map_settings, control_name, test_parallel_rendering: bool = True):
"""Test a rendering with different configurations:
- parallel rendering, no cache
- sequential rendering, no cache
- parallel rendering, with cache (rendered two times)
- sequential rendering, with cache (rendered two times)
"""
for do_parallel in [False, True]:
if test_parallel_rendering:
parallel_tests = [False, True]
else:
parallel_tests = [False]

for do_parallel in parallel_tests:
for use_cache in [False, True]:
print("=== parallel", do_parallel, "cache", use_cache)
cache = None
Expand Down Expand Up @@ -823,7 +828,9 @@ def test_label_mask_with_effect(self):

# test that force vector output has no impact on the result
self.map_settings.setFlag(Qgis.MapSettingsFlag.ForceVectorOutput, True)
self.check_renderings(self.map_settings, "label_mask_with_effect")
# skip parallel rendering for this check, as force vector output is ignored when parallel rendering
# is used
self.check_renderings(self.map_settings, "label_mask_with_effect", test_parallel_rendering=False)

def test_different_dpi_target(self):
"""Test with raster layer and a target dpi"""
Expand Down

0 comments on commit 5ac2172

Please sign in to comment.