11# Running Unit Tests for Agent365-Python SDK
22
3- This guide covers setting up and running tests in Visual Studio Code .
3+ This guide covers setting up and running tests.
44
55---
66
77## Prerequisites
88
9- - ** Python 3.11+** installed
10- - ** Visual Studio Code** with Python extension
11- - ** Git** repository cloned locally
9+ ### 1. Create Virtual Environment
10+
11+ ``` powershell
12+ # Create virtual environment using uv
13+ uv venv
14+
15+ # Activate the virtual environment
16+ .\.venv\Scripts\Activate.ps1
17+ ```
18+
19+ ### 2. Configure Python Environment
20+
21+ 1 . Press ` Ctrl+Shift+P `
22+ 2 . Type "Python: Select Interpreter"
23+ 3 . Choose the ` .venv ` interpreter from the list
24+
25+ ### 3. Install Dependencies
26+
27+ ``` powershell
28+ # Test framework and reporting
29+ uv pip install pytest pytest-asyncio pytest-mock pytest-cov pytest-html wrapt
30+
31+ # SDK core libraries
32+ uv pip install -e libraries/microsoft-agents-a365-runtime -e libraries/microsoft-agents-a365-notifications -e libraries/microsoft-agents-a365-observability-core -e libraries/microsoft-agents-a365-tooling
33+
34+ # Framework extension libraries
35+ uv pip install -e libraries/microsoft-agents-a365-observability-extensions-langchain -e libraries/microsoft-agents-a365-observability-extensions-openai -e libraries/microsoft-agents-a365-observability-extensions-semantickernel -e libraries/microsoft-agents-a365-observability-extensions-agentframework -e libraries/microsoft-agents-a365-tooling-extensions-agentframework -e libraries/microsoft-agents-a365-tooling-extensions-azureaifoundry -e libraries/microsoft-agents-a365-tooling-extensions-openai -e libraries/microsoft-agents-a365-tooling-extensions-semantickernel
36+ ```
1237
1338---
1439
@@ -26,27 +51,7 @@ tests/
2651
2752---
2853
29- ## Initial Setup
30-
31- ### 1. Configure Python Environment
32-
33- 1 . Press ` Ctrl+Shift+P `
34- 2 . Type "Python: Select Interpreter"
35- 3 . Choose your Python 3.11+ interpreter
36-
37- ### 2. Install Dependencies
38-
39- ``` powershell
40- # Install test dependencies
41- uv pip install pytest pytest-asyncio pytest-mock pytest-cov pytest-html
42-
43- # Install workspace packages
44- uv pip install -e .
45- ```
46-
47- ---
48-
49- ## Running Tests in VS Code
54+ ## Running Tests in VS Code (Optional)
5055
5156### Test Explorer
5257
@@ -87,22 +92,33 @@ python -m pytest --lf # Re-run failed tests
8792
8893``` powershell
8994# Coverage report
90- python -m pytest tests/ --cov=libraries --cov-report=html
91- Invoke-Item htmlcov\index.html
95+ python -m pytest tests/ --cov=libraries --cov-report=html -v
96+
97+ # View reports
98+ start htmlcov\index.html
9299
93- # Test report
100+ # Test report (requires: uv pip install pytest-html)
94101python -m pytest tests/ --html=test-report.html --self-contained-html
95- Invoke-Item test-report.html
96102
97- # Combined
103+ # View reports
104+ start test-report.html
105+
106+ # Combined (requires: uv pip install pytest-html)
98107python -m pytest tests/ --cov=libraries --cov-report=html --html=test-report.html --self-contained-html -v
108+
109+ # View reports
110+ start htmlcov\index.html
99111```
100112
101113### CI/CD Reports
102114
103115``` powershell
104116# XML reports for CI/CD pipelines
105117python -m pytest tests/ --cov=libraries --cov-report=xml --junitxml=test-results.xml
118+
119+ # View reports
120+ start test-results.xml
121+ start coverage.xml
106122```
107123
108124---
0 commit comments