Install & Compatibility
Where this runs
tested against v1.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 21.5MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.7s · import 0.000s · 23MB
21MB installed
● package 21MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ResourceGroupPreparer
✓ from azure_devtools.scenario_tests.preparers import ResourceGroupPreparer
✗ from azure_devtools.scenario_tests.preparers import ResourceGroupPreparer
Example of using ResourceGroupPreparer in a test to create and clean up a resource group.
from azure_devtools.scenario_tests.preparers import ResourceGroupPreparer
from azure.mgmt.resource import ResourceManagementClient
from azure.identity import DefaultAzureCredential
import os
credential = DefaultAzureCredential()
subscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', '')
@ResourceGroupPreparer()
def test_resource_group(resource_group, **kwargs):
client = ResourceManagementClient(credential, subscription_id)
rg = client.resource_groups.get(resource_group.name)
print(f"Resource group {rg.name} exists in {rg.location}")
Debug
Known issues
gotchaResourceGroupPreparer only works with positional arguments. If you change the function signature and the resource_group parameter is not the first argument, the preparer will fail silently.fixEnsure resource_group is the first parameter of your test function after self if using pytest or unittest method.
affects: <=1.2.0
deprecatedThe ci_tools module (Git helpers, GitHub REST API wrapper) is no longer actively maintained and may be removed in future versions. Prefer dedicated GitHub Actions or Azure DevOps tasks.fixMigrate to GitHub CLI (`gh`) or Azure DevOps REST API directly.
affects: 1.1.0 - 1.2.0
breakingIn version 1.0.0, the resource removal sequence was reversed. Tests that relied on a specific deletion order may fail or leave resources behind.fixCheck your resource cleanup logic; use ResourceGroupPreparer with 'random_name' setting to avoid dependency on deletion order.
affects: <=0.5.5 -> 1.0.0
Upgrade
Version history
1.2.0latest on PyPI · released Jul 28, 2020
Audit
Dependencies
configparserrequiredUsed by config management module
vcrpyoptionalUsed for recording/playback in scenario tests
azure-mgmt-resourceoptionalResource management for test cleanup