You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/durable/durable-functions-unit-testing-python.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,9 @@ Unit testing Durable Functions is essential to ensure the correctness of individ
5
5
6
6
This guide provides an overview of unit testing Durable Functions in Python, covering the key components: starter functions, orchestrators, activity functions, and entity functions. It includes best practices and sample test cases to help you write robust and maintainable tests for your Durable Functions.
7
7
8
+
[!NOTE]
9
+
This guide applies only to Durable Functions apps written in the [Python v2 programming model](../functions-reference-python.md).
10
+
8
11
## Prerequisites
9
12
The examples in this article require knowledge of the following concepts and frameworks:
10
13
@@ -14,7 +17,7 @@ The examples in this article require knowledge of the following concepts and fra
To test Durable Functions, it's crucial to set up a proper test environment. This includes creating a test directory and installing unittest into your Python environment. For more info, see the Azure Functions Python unit testing overview[here](https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-python?tabs=get-started%2Casgi%2Capplication-level&pivots=python-mode-decorators#unit-testing).
20
+
To test Durable Functions, it's crucial to set up a proper test environment. This includes creating a test directory and installing unittest into your Python environment. For more info, see the [Azure Functions Python unit testing overview](../functions-reference-python.md#unit-testing).
18
21
19
22
## Testing Durable Clients
20
23
Durable Client functions initiate orchestrations and external events. To test a client function:
@@ -145,7 +148,7 @@ class TestEntityFunction(unittest.TestCase):
145
148
```
146
149
147
150
## Testing Activity Functions
148
-
Activity functions require no Durable-specific modifications to be tested. The guidance found in the Azure Functions Python unit testing overview[here](https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-python?tabs=get-started%2Casgi%2Capplication-level&pivots=python-mode-decorators#unit-testing) is sufficient for testing these functions.
151
+
Activity functions require no Durable-specific modifications to be tested. The guidance found in the [Azure Functions Python unit testing overview](../functions-reference-python.md#unit-testing) is sufficient for testing these functions.
149
152
150
153
## Summary
151
154
Testing Durable Functions effectively requires simulating their unique runtime behaviors while keeping tests isolated and deterministic. Here are some best practices to keep in mind:
@@ -165,6 +168,6 @@ By applying these practices, you can build a comprehensive test suite for your D
165
168
166
169
For deeper insights into Durable Functions in Python, explore these resources:
0 commit comments