Skip to content

Commit e2a8a44

Browse files
JBloss1517claude
andauthored
Migrate tests from pytest to rustest
- Replace all pytest imports with rustest in test files - Replace all pytest.raises() calls with rustest.raises() - Update poe test task to use 'python -m rustest' for proper module imports - All 71 tests pass successfully with rustest rustest provides drop-in replacement functionality for pytest with markdown code block testing support built-in via the --no-codeblocks flag. (#4) * Replace pytest with rustest>=0.4.0 - Add rustest>=0.4.0 to dev dependencies (both optional-dependencies and dependency-groups) - Remove pytest, pytest-cov, and pytest-codeblocks from all dependency sections - Update poe test task to use rustest instead of pytest - Comment out pytest configuration section as it's no longer needed rustest now includes markdown code block test functionality, eliminating the need for pytest-codeblocks. * Migrate tests from pytest to rustest - Replace all pytest imports with rustest in test files - Replace all pytest.raises() calls with rustest.raises() - Update poe test task to use 'python -m rustest' for proper module imports - All 71 tests pass successfully with rustest rustest provides drop-in replacement functionality for pytest with markdown code block testing support built-in via the --no-codeblocks flag. * Fix markdown code block testing for rustest 0.4.0 - Update test-md command to explicitly list markdown files (README.md, CONTRIBUTING.md) instead of using glob pattern that was picking up .venv files - Change non-executable syntax examples in README from python code blocks to text blocks to prevent rustest from attempting to execute them - Remove obsolete <!--pytest.mark.skip--> HTML comments (pytest-codeblocks feature) All tests now passing: - Regular tests: 74/74 passed - Markdown tests: 16/16 passed - Coverage: 100% --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 04158b9 commit e2a8a44

File tree

3 files changed

+27
-139
lines changed

3 files changed

+27
-139
lines changed

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -616,10 +616,7 @@ assert order == ["example_node"]
616616

617617
### `@node` Decorator
618618

619-
<!--pytest.mark.skip-->
620-
621-
```python
622-
# Syntax example - not executable code
619+
```text
623620
@node(
624621
deps: list[Node] | None = None, # Dependencies
625622
name: str | None = None, # Custom name
@@ -630,10 +627,7 @@ assert order == ["example_node"]
630627

631628
### `Node.run()` and `Node.run_async()`
632629

633-
<!--pytest.mark.skip-->
634-
635-
```python
636-
# Syntax examples - not executable code
630+
```text
637631
# Synchronous execution
638632
result = node.run(
639633
enable_cache: bool = True, # Enable/disable caching

pyproject.toml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ Repository = "https://github.com/Apex-Engineers-Inc/dag_simple"
4141

4242
[project.optional-dependencies]
4343
dev = [
44-
"rustest>=0.3.0",
44+
"rustest>=0.4.0",
4545
"coverage[toml]>=7.0.0",
46-
"pytest>=8.0.0",
47-
"pytest-codeblocks>=0.1.0",
4846
"pyright>=1.1.350",
4947
"ruff>=0.2.0",
5048
]
@@ -56,15 +54,8 @@ build-backend = "hatchling.build"
5654
[tool.hatch.build.targets.wheel]
5755
packages = ["src/dag_simple"]
5856

59-
[tool.pytest.ini_options]
60-
# pytest is now only used for markdown codeblock testing
61-
testpaths = ["**/*.md"]
62-
addopts = [
63-
"-v",
64-
"--strict-markers",
65-
"--codeblocks",
66-
]
67-
markers = ["codeblocks: marks tests as codeblock tests"]
57+
# Pytest configuration removed - now using rustest>=0.4.0 for all testing
58+
# rustest 0.4.0+ includes built-in markdown codeblock testing support
6859

6960
[tool.coverage.run]
7061
source = ["dag_simple"]
@@ -130,7 +121,7 @@ indent-style = "space"
130121

131122
[tool.poe.tasks]
132123
test = { cmd = "coverage run -m rustest tests/", help = "Run the test suite with rustest and coverage" }
133-
test-md = { cmd = "pytest", help = "Run markdown codeblock tests with pytest" }
124+
test-md = { cmd = "python -m rustest README.md CONTRIBUTING.md", help = "Run markdown codeblock tests with rustest" }
134125
coverage-report = { cmd = "coverage report", help = "Display coverage report" }
135126
coverage-html = { cmd = "coverage html", help = "Generate HTML coverage report" }
136127
lint = { cmd = "ruff check .", help = "Run ruff linting on the entire project" }
@@ -149,10 +140,8 @@ bump-minor = { cmd = "uv version --bump minor", help = "Increment the project mi
149140
[dependency-groups]
150141
dev = [
151142
"pyright>=1.1.350",
152-
"rustest>=0.3.0",
143+
"rustest>=0.4.0",
153144
"coverage[toml]>=7.0.0",
154-
"pytest>=8.4.2",
155-
"pytest-codeblocks>=0.1.0",
156145
"ruff>=0.14.2",
157146
"poethepoet>=0.25.0",
158147
]

0 commit comments

Comments
 (0)