pytest plugin for testing Revit API code via RevitDevTool Named Pipe bridge
Project description
RevitDevTool.PyTest
pytest plugin for testing Revit API code via RevitDevTool Named Pipe bridge. Tests run inside a live Revit process — write standard pytest, execute remotely.
Installation
pip install revitdevtool_pytest
Recommended package name for manifests and package managers such as Pixi:
revitdevtool_pytest
pip normalizes package names, so the following forms are equivalent when installing from PyPI:
pip install revitdevtool_pytest
pip install revitdevtool-pytest
pip install RevitDevTool.PyTest
The Python import/module name used by the package is:
import revitdevtool_pytest
Dependencies
| Package | Version |
|---|---|
| Python | >= 3.10 |
| pytest | >= 9.0 |
| pywin32 | >= 311 |
Requirements
- Windows (Named Pipes)
- Revit with RevitDevTool add-in installed
Usage
def test_revit_version():
app = __revit__.Application
assert "2025" in app.VersionName
# Auto-detect running Revit 2025
pytest --revit-version=2025 -v
# Auto-launch Revit 2025 if not running
pytest --revit-launch --revit-version=2025 -v
CLI Options
| Option | Description |
|---|---|
--revit-version |
Revit version year (e.g. 2025). Required with --revit-launch. |
--revit-launch |
Auto-launch Revit if no running instance found. |
--revit-timeout |
Per-test timeout in seconds (default: 60). |
--revit-launch-timeout |
Revit startup timeout in seconds (default: 120). |
--revit-pipe |
Explicit pipe name (bypasses auto-discovery). |
How It Works
- pytest discovers tests locally as usual
- The plugin intercepts test execution via
pytest_pyfunc_call - Test source code is serialized and sent over Named Pipe to Revit
- RevitDevTool add-in executes the test inside Revit's Python (pythonnet) environment
- Results are mapped back to pytest pass/fail/skip
VSCode Integration
Add to .vscode/settings.json:
{
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": [
"--revit-launch",
"--revit-version=2025",
"tests"
]
}
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file revitdevtool_pytest-0.0.2.tar.gz.
File metadata
- Download URL: revitdevtool_pytest-0.0.2.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4990d8a5af6933346e7582cc24eb76e9eeb8e9ff642f60f6a80ddc687412b675
|
|
| MD5 |
e805a2dad3b399f98ccd78744d869305
|
|
| BLAKE2b-256 |
a424cb47aea59d30d24e720ce02f3b115e2d31a499049a6d44bf03e8d31730c8
|
Provenance
The following attestation bundles were made for revitdevtool_pytest-0.0.2.tar.gz:
Publisher:
publish.yml on trgiangv/RevitDevTool.PyTest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
revitdevtool_pytest-0.0.2.tar.gz -
Subject digest:
4990d8a5af6933346e7582cc24eb76e9eeb8e9ff642f60f6a80ddc687412b675 - Sigstore transparency entry: 1267997373
- Sigstore integration time:
-
Permalink:
trgiangv/RevitDevTool.PyTest@f98335ddfa5086eb3345b669d6d458f56ea32b8c -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/trgiangv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f98335ddfa5086eb3345b669d6d458f56ea32b8c -
Trigger Event:
release
-
Statement type:
File details
Details for the file revitdevtool_pytest-0.0.2-py3-none-any.whl.
File metadata
- Download URL: revitdevtool_pytest-0.0.2-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10b5932e58991aa8cb5dc6f3e08f5b688c90a300a389c1af154c038abfa86e0f
|
|
| MD5 |
53646b935796e41ebcebb813ea6711df
|
|
| BLAKE2b-256 |
1ad77c9a34e9ea2cf84b2bee4fc2bd094a4cffcbed49a9123710ef794d58c751
|
Provenance
The following attestation bundles were made for revitdevtool_pytest-0.0.2-py3-none-any.whl:
Publisher:
publish.yml on trgiangv/RevitDevTool.PyTest
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
revitdevtool_pytest-0.0.2-py3-none-any.whl -
Subject digest:
10b5932e58991aa8cb5dc6f3e08f5b688c90a300a389c1af154c038abfa86e0f - Sigstore transparency entry: 1267997463
- Sigstore integration time:
-
Permalink:
trgiangv/RevitDevTool.PyTest@f98335ddfa5086eb3345b669d6d458f56ea32b8c -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/trgiangv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f98335ddfa5086eb3345b669d6d458f56ea32b8c -
Trigger Event:
release
-
Statement type: