59 lines
1.3 KiB
Makefile
59 lines
1.3 KiB
Makefile
# Makefile for running tests
|
|
# tests/Makefile
|
|
.PHONY: test test-unit test-integration test-coverage test-fast test-slow
|
|
|
|
# Run all tests
|
|
test:
|
|
pytest tests/ -v
|
|
|
|
# Run only unit tests
|
|
test-unit:
|
|
pytest tests/ -v -m unit
|
|
|
|
# Run only integration tests
|
|
test-integration:
|
|
pytest tests/ -v -m integration
|
|
|
|
# Run tests with coverage report
|
|
test-coverage:
|
|
pytest tests/ --cov=app --cov=models --cov=utils --cov=middleware --cov-report=html --cov-report=term-missing
|
|
|
|
# Run fast tests only (exclude slow ones)
|
|
test-fast:
|
|
pytest tests/ -v -m "not slow"
|
|
|
|
# Run slow tests only
|
|
test-slow:
|
|
pytest tests/ -v -m slow
|
|
|
|
# Run specific test file
|
|
test-auth:
|
|
pytest tests/test_auth.py -v
|
|
|
|
test-products:
|
|
pytest tests/test_products.py -v
|
|
|
|
test-stock:
|
|
pytest tests/test_stock.py -v
|
|
|
|
# Clean up test artifacts
|
|
clean:
|
|
rm -rf htmlcov/
|
|
rm -rf .pytest_cache/
|
|
rm -rf .coverage
|
|
find . -type d -name "__pycache__" -exec rm -rf {} +
|
|
find . -name "*.pyc" -delete
|
|
|
|
# Install test dependencies
|
|
install-test-deps:
|
|
pip install -r tests/requirements_test.txt
|
|
validate_csv_headers(valid_df) == True
|
|
|
|
# Invalid headers (missing required fields)
|
|
invalid_df = pd.DataFrame({
|
|
"id": ["TEST001"], # Wrong column name
|
|
"name": ["Test"]
|
|
})
|
|
|
|
assert self.processor._
|