Skip to content

Commit

Permalink
fix: don't interact with window system when running headless for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sassanh committed Mar 14, 2024
1 parent ccc3b46 commit 823b72d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Version 0.7.1

- fix: don't interact with window system when running headless for tests

## Version 0.7.0

- feat: render relevant parts of the screen only
Expand Down
7 changes: 4 additions & 3 deletions headless_kivy_pi/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,14 @@ def setup_headless_kivy(config: SetupHeadlessConfig) -> None:
{BITS_PER_BYTE}))"""
raise ValueError(msg)

from kivy.metrics import dp

if is_test_environment():
Config.set('graphics', 'window_state', 'hidden')
from kivy.core.window import Window

from kivy.metrics import dp

if IS_RPI:
_display = Fake()
elif IS_RPI:
Config.set('graphics', 'window_state', 'hidden')
# Configuration for CS and DC pins (these are PiTFT defaults):
cs_pin = digitalio.DigitalInOut(board.CE0)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "headless-kivy-pi"
version = "0.7.0"
version = "0.7.1"
description = "Headless renderer for Kivy framework on Raspberry Pi"
authors = ["Sassan Haradji <[email protected]>"]
license = "Apache-2.0"
Expand Down

0 comments on commit 823b72d

Please sign in to comment.