Add support for State type in scenes methods (#1685)
Some checks are pending
Tests / tests (macos-latest, 3.10) (push) Waiting to run
Tests / tests (macos-latest, 3.11) (push) Waiting to run
Tests / tests (macos-latest, 3.12) (push) Waiting to run
Tests / tests (macos-latest, 3.13) (push) Waiting to run
Tests / tests (macos-latest, 3.9) (push) Waiting to run
Tests / tests (ubuntu-latest, 3.10) (push) Waiting to run
Tests / tests (ubuntu-latest, 3.11) (push) Waiting to run
Tests / tests (ubuntu-latest, 3.12) (push) Waiting to run
Tests / tests (ubuntu-latest, 3.13) (push) Waiting to run
Tests / tests (ubuntu-latest, 3.9) (push) Waiting to run
Tests / tests (windows-latest, 3.10) (push) Waiting to run
Tests / tests (windows-latest, 3.11) (push) Waiting to run
Tests / tests (windows-latest, 3.12) (push) Waiting to run
Tests / tests (windows-latest, 3.13) (push) Waiting to run
Tests / tests (windows-latest, 3.9) (push) Waiting to run
Tests / pypy-tests (macos-latest, pypy3.10) (push) Waiting to run
Tests / pypy-tests (macos-latest, pypy3.9) (push) Waiting to run
Tests / pypy-tests (ubuntu-latest, pypy3.10) (push) Waiting to run
Tests / pypy-tests (ubuntu-latest, pypy3.9) (push) Waiting to run

* Add support for `State` type to scenes methods like `goto`, `enter`, `get`

Calm down MyPy

* Add 1685.feature.rst
This commit is contained in:
Andrew 2025-05-09 21:25:41 +03:00 committed by GitHub
parent 3812157913
commit 72dd709717
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 14 deletions

View file

@ -1490,7 +1490,9 @@ class TestSceneRegistry:
registry = SceneRegistry(router, register_on_add)
registry.add(MyScene)
with pytest.raises(SceneException, match="Scene must be a subclass of Scene or a string"):
with pytest.raises(
SceneException, match="Scene must be a subclass of Scene, State or a string"
):
registry.get(MyScene)
def test_scene_registry_get_scene_not_registered(self):