Skip to content

Commit 9094503

Browse files
committed
Release v0.1.15: Update testing framework and improve CI compatibility
- Added a README in the `tests/` directory detailing how to run tests and outlining testing conventions. - Updated test performance thresholds to be more CI-friendly. - Integration tests now utilize the working Promptix implementation by default. - Ensured all tests pass consistently against the source code when using `PYTHONPATH=src`. - Bumped version to 0.1.15 in `pyproject.toml` and `__init__.py`. - Introduced new markers for slow tests to facilitate selective test execution. This release enhances the testing framework and ensures better compatibility with continuous integration environments.
1 parent 5e47fb9 commit 9094503

14 files changed

+3270
-41
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## [0.1.15] - 2025-09-10
4+
5+
### Added
6+
- README in `tests/` directory detailing how to run tests and testing conventions
7+
8+
### Changed
9+
- Test performance thresholds updated to be CI-friendly
10+
- Integration tests use working Promptix implementation by default
11+
12+
### Fixed
13+
- All tests passing consistently against source code (via `PYTHONPATH=src`)
14+
15+
316
## [0.1.14] - 2025-09-10
417

518
### 🧹 **Code Quality & Architecture Enhancements**

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "promptix"
7-
version = "0.1.14"
7+
version = "0.1.15"
88
description = "A simple library for managing and using prompts locally with Promptix Studio"
99
readme = "README.md"
1010
requires-python = ">=3.9"
@@ -59,6 +59,9 @@ include-package-data = true
5959
testpaths = ["tests"]
6060
python_files = ["test_*.py"]
6161
addopts = "--cov=promptix --cov-report=term-missing"
62+
markers = [
63+
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
64+
]
6265

6366
[tool.black]
6467
line-length = 88

src/promptix/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323

2424
from .core.base_refactored import Promptix
2525

26-
__version__ = "0.1.14"
26+
__version__ = "0.1.15"
2727
__all__ = ["Promptix"]

src/promptix/core/storage/loaders.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ def validate_loaded(self, data: Dict[str, Any]) -> None:
5656

5757
class PromptLoaderFactory:
5858
@staticmethod
59-
def get_loader(file_path: Path) -> PromptLoader:
59+
def get_loader(file_path) -> PromptLoader:
60+
# Convert string to Path if needed
61+
if isinstance(file_path, str):
62+
from pathlib import Path
63+
file_path = Path(file_path)
64+
6065
if file_path.suffix.lower() in ['.yml', '.yaml']:
6166
return YAMLPromptLoader()
6267
elif file_path.suffix.lower() == '.json':

tests/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Tests Directory
2+
3+
This folder contains all pytest test files for the `promptix` library.
4+
5+
## Running Tests
6+
7+
To run all tests against the **source code** and gather coverage:
8+
9+
```bash
10+
# Activate virtual environment
11+
source venv/bin/activate
12+
13+
# Run tests with source path in PYTHONPATH
14+
PYTHONPATH=src python3 -m pytest --cov=promptix --cov-report=html tests/ -v
15+
```
16+
17+
To run tests against the **installed package**:
18+
19+
```bash
20+
pytest --cov=promptix --cov-report=html tests/ -v
21+
```
22+
23+
## Test Organization
24+
25+
- `test_01_basic.py`: Basic prompt retrieval tests
26+
- `test_02_builder.py`: Builder pattern tests
27+
- `test_03_template_features.py`: Template rendering tests
28+
- `test_04_complex.py`: Complex prompt scenarios
29+
- `test_05_api_integration.py`: OpenAI & Anthropic integration
30+
- `test_06_conditional_tools.py`: Conditional tools tests
31+
- `test_07_architecture_refactor.py`: Tests for future architecture (skipped)
32+
- `test_components.py`: Component-level tests (storage, config, adapters, utils)
33+
- `test_edge_cases.py`: Edge case and error condition tests
34+
- `test_integration_advanced.py`: Advanced end-to-end integration tests
35+
- `test_performance.py`: Performance benchmarks
36+
37+
## Markers and Skips
38+
39+
- Tests marked `@pytest.mark.skip` are for future features or components not yet implemented.
40+
- Use `-v` for verbose output and `--tb=line` for concise tracebacks.
41+
- Slow tests can be deselected with:
42+
```bash
43+
pytest -m "not slow"
44+
```

0 commit comments

Comments
 (0)