Skip to content

fix: Allow for blob & timer unit testing#286

Merged
hallvictoria merged 6 commits into
devfrom
hallvictoria/abstract-timer
Jul 10, 2026
Merged

fix: Allow for blob & timer unit testing#286
hallvictoria merged 6 commits into
devfrom
hallvictoria/abstract-timer

Conversation

@hallvictoria

@hallvictoria hallvictoria commented May 28, 2025

Copy link
Copy Markdown
Contributor

Currently, Blob (InputStream) and Timer (TimerRequest) types cannot be unit tested.

Doing something like req = func.TimerRequest() results in an error saying TypeError: Can't instantiate abstract class TimerRequest with abstract methods past_due. This is because both Blob and Timer are missing the abstract layer that the other types have. This change adds the layer, allowing for unit testing, but not changing any other details.

This change is already covered through our unit tests & does not impact current functionality.

Fixes Azure/azure-functions-python-worker#737

@hallvictoria hallvictoria marked this pull request as ready for review May 28, 2025 18:16
@hallvictoria hallvictoria enabled auto-merge (squash) July 10, 2026 19:13
@hallvictoria hallvictoria merged commit 8199f47 into dev Jul 10, 2026
16 checks passed
@hallvictoria hallvictoria deleted the hallvictoria/abstract-timer branch July 10, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] It is not possible to unit test a Python timer function

2 participants