Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Set size for layout check
  • Loading branch information
m-kuhn committed May 13, 2023
1 parent da075fa commit c8dd71e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
11 changes: 3 additions & 8 deletions python/testing/__init__.py
Expand Up @@ -52,7 +52,7 @@
QgsMultiRenderChecker,
QgsMapSettings,
QgsLayout,
QgsLayoutChecker
QgsLayoutChecker,
)

import unittest
Expand Down Expand Up @@ -156,14 +156,9 @@ def render_map_settings_check(cls,
return result

@classmethod
def render_layout_check(cls,
name: str,
layout: QgsLayout,
size: QSize,
dpi: Optional[float] = 192) -> bool:
def render_layout_check(cls, name: str, layout: QgsLayout, size: QSize):
checker = QgsLayoutChecker(name, layout)
checker.dots_per_meter = dpi / 25.4 * 1000
checker.size = size
checker.setSize(size)
if cls.control_path_prefix():
checker.setControlPathPrefix(cls.control_path_prefix())
result, message = checker.testLayout()
Expand Down
3 changes: 1 addition & 2 deletions tests/src/python/test_qgsannotation.py
Expand Up @@ -309,8 +309,7 @@ def renderAnnotationInLayout(self, test_name, annotation):
return self.render_layout_check(
test_name,
layout=l,
size=QSize(1122 * 2, 794 * 2),
dpi=192
size=QSize(1122 * 2, 794 * 2)
)


Expand Down

0 comments on commit c8dd71e

Please sign in to comment.