param(
[string]$Path = "tests/RevitDevTool.PyServer.Tests"
)
$ErrorActionPreference = "Stop"
. (Join-Path $PSScriptRoot '_lib.ps1')
Assert-RepoRoot
$testPath = Join-RepoPath $Path
if (-not (Test-Path -LiteralPath $testPath)) {
throw "Test path not found: $testPath"
}
if (-not (Get-Command pixi -ErrorAction SilentlyContinue)) {
throw "pixi is required for scripts/test-python.ps1. Install pixi or run from a pixi-enabled shell."
}
Push-Location $RepoRoot
try {
pixi run pytest $testPath
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
}
finally {
Pop-Location
}