Compare commits

...

4 Commits

Author SHA1 Message Date
Pim van Pelt
cf6d8712fb Simplify gitignore 2025-08-04 11:35:16 +02:00
Pim van Pelt
17c31ce6c9 Remove redundant pytest.ini 2025-08-04 11:33:37 +02:00
Pim van Pelt
d6ecb9e4c9 Simplify clean target 2025-08-04 11:27:02 +02:00
Pim van Pelt
65f732e497 Move run_tests.py directly to 'make test' 2025-08-04 11:24:46 +02:00
4 changed files with 3 additions and 73 deletions

6
.gitignore vendored
View File

@@ -1,8 +1,4 @@
bin
include
lib
lib64
pyvenv.cfg
__pycache__
dist/
kumacli.egg-info
.pytest_cache

View File

@@ -13,9 +13,7 @@ help:
# Clean build artifacts
clean:
@echo "Cleaning build artifacts..."
rm -rf build/
rm -rf dist/
rm -rf src/kumacli.egg-info/
rm -rf build/ dist/ src/kumacli.egg-info/
find . -name "*.pyc" -o -name "*.pyo" -delete
find . -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true
@echo "Clean complete."
@@ -39,7 +37,7 @@ test-deps:
# Test the package
test:
@echo "Running tests..."
python3 run_tests.py
python3 -m pytest tests/ -v --tb=short
# Rebuild and reinstall (useful during development)
dev: clean build

View File

@@ -1,14 +0,0 @@
[tool:pytest]
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
pythonpath = src
addopts =
-v
--tb=short
--strict-markers
--disable-warnings
filterwarnings =
ignore::DeprecationWarning
ignore::PendingDeprecationWarning

View File

@@ -1,50 +0,0 @@
#!/usr/bin/env python3
"""
Test runner script for kumacli
Usage:
python run_tests.py # Run all tests
python run_tests.py --cov # Run tests with coverage
python run_tests.py tests/test_info.py # Run specific test file
"""
import sys
import subprocess
def run_tests(args=None):
"""Run pytest with optional arguments"""
# Use python3 explicitly for compatibility
cmd = ["python3", "-m", "pytest"]
if args:
cmd.extend(args)
else:
cmd.extend(["tests/", "-v", "--tb=short"])
try:
result = subprocess.run(cmd, check=True)
return result.returncode
except subprocess.CalledProcessError as e:
print(f"Tests failed with exit code: {e.returncode}")
return e.returncode
except FileNotFoundError:
print("pytest not found. Install with: pip install pytest")
return 1
def main():
"""Main entry point"""
if len(sys.argv) > 1:
# Pass through command line arguments
args = sys.argv[1:]
else:
args = None
exit_code = run_tests(args)
sys.exit(exit_code)
if __name__ == "__main__":
main()