From 917dfdcb6f10efa933b2415dfb70f06010af8851 Mon Sep 17 00:00:00 2001 From: Bart Feenstra Date: Thu, 3 Nov 2022 16:43:54 +0000 Subject: [PATCH] Fix test failures caused by changes in recent releases of our dependencies, and enable periodic testing to discover regressions early. --- .github/workflows/test.yml | 9 +++------ betty/model/__init__.py | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef5085379..4bfc6c60b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,15 +1,12 @@ name: Test on: + schedule: + - cron: '0 * * * *' pull_request: - types: - - opened - - reopened - - synchronize push: branches: - - main - - master + - '*.*.x' tags: - '*' diff --git a/betty/model/__init__.py b/betty/model/__init__.py index 3c4f49c61..bd7edabe9 100644 --- a/betty/model/__init__.py +++ b/betty/model/__init__.py @@ -428,8 +428,8 @@ def _getitem_by_entity_type(self, entity_type: Type[EntityT]) -> SingleTypeEntit def _getitem_by_entity_type_name(self, entity_type_name: str) -> SingleTypeEntityCollection[Entity]: return self._get_collection(get_entity_type(entity_type_name)) - def _getitem_by_index(self, index: int) -> EntityT: - return cast(EntityT, reduce(operator.add, self._collections.values(), SingleTypeEntityCollection(Entity))[index]) + def _getitem_by_index(self, index: int) -> Entity: + return reduce(operator.add, self._collections.values(), SingleTypeEntityCollection(Entity))[index] def _getitem_by_indices(self, indices: slice) -> SingleTypeEntityCollection[Entity]: return reduce(operator.add, self._collections.values(), SingleTypeEntityCollection(Entity))[indices]