Skip to content
Permalink
Browse files

Fix crash in selective masking test due to early python garbage colle…

…ction
  • Loading branch information
nyalldawson committed Jan 29, 2020
1 parent 195576e commit 3faeccf63820cf5575320dc4175023dc14964485
Showing with 12 additions and 6 deletions.
  1. +12 −6 tests/src/python/test_selective_masking.py
@@ -194,7 +194,8 @@ def test_label_mask(self):
label_settings.setFormat(fmt)
self.polys_layer.labeling().setSettings(label_settings)

self.assertTrue(self.polys_layer.labeling().settings().format().mask().enabled())
format = self.polys_layer.labeling().settings().format()
self.assertTrue(format.mask().enabled())

self.check_renderings(self.map_settings, "label_mask")

@@ -216,7 +217,8 @@ def test_multiple_label_masks_different_sets(self):
label_settings.setFormat(fmt)
self.polys_layer.labeling().setSettings(label_settings)

self.assertTrue(self.polys_layer.labeling().settings().format().mask().enabled())
format = self.polys_layer.labeling().settings().format()
self.assertTrue(format.mask().enabled())

# modify labeling settings of the lines layer
label_settings = self.lines_with_labels.labeling().settings()
@@ -254,7 +256,8 @@ def test_multiple_label_masks_same_set(self):
label_settings.setFormat(fmt)
self.polys_layer.labeling().setSettings(label_settings)

self.assertTrue(self.polys_layer.labeling().settings().format().mask().enabled())
format = self.polys_layer.labeling().settings().format()
self.assertTrue(format.mask().enabled())

# modify labeling settings of the lines layer
label_settings = self.lines_with_labels.labeling().settings()
@@ -297,7 +300,8 @@ def test_label_mask_subsymbol(self):
label_settings.setFormat(fmt)
self.polys_layer.labeling().setSettings(label_settings)

self.assertTrue(self.polys_layer.labeling().settings().format().mask().enabled())
format = self.polys_layer.labeling().settings().format()
self.assertTrue(format.mask().enabled())

self.check_renderings(self.map_settings, "label_mask_subsymbol")

@@ -401,7 +405,8 @@ def test_label_mask_symbol_levels(self):
label_settings.setFormat(fmt)
self.polys_layer.labeling().setSettings(label_settings)

self.assertTrue(self.polys_layer.labeling().settings().format().mask().enabled())
format = self.polys_layer.labeling().settings().format()
self.assertTrue(format.mask().enabled())

# enable symbol levels
self.lines_layer.renderer().setUsingSymbolLevels(True)
@@ -624,7 +629,8 @@ def test_label_mask_with_effect(self):
label_settings.setFormat(fmt)
self.polys_layer.labeling().setSettings(label_settings)

self.assertTrue(self.polys_layer.labeling().settings().format().mask().enabled())
format = self.polys_layer.labeling().settings().format()
self.assertTrue(format.mask().enabled())

self.check_renderings(self.map_settings, "label_mask_with_effect")

0 comments on commit 3faeccf

Please sign in to comment.
You can’t perform that action at this time.