Skip to content

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

Open
Azure/azure-functions-python-library
#286
@davidmytton

Description

@davidmytton

Azure provides documentation for unit testing HTTP and Queue Python functions. This is done by creating a mock QueueMessage or HTTPRequest. However, there is no documentation for creating a unit test for Timer functions.

There is a TimerRequest class, but creating a new instance of it fails with the following error:

req = func.TimerRequest()

TypeError: Can't instantiate abstract class TimerRequest with abstract methods past_due

Having posted on StackOverflow to ask about the correct approach for this e.g. if I want to test behaviour of a function which has past_due set, but had no answers, I'm opening this bug to request that Python functions allow unit testing.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions