Installation¶
๐ค AI-Generated Content
This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.
Prerequisites¶
Additional Requirements: - pytest 7.0 or later - Required for running tests
Installing UV¶
Python Version Setup¶
Virtual Environment¶
Installing Provide TestKit¶
Using UV (Recommended)¶
Using pip¶
From Source¶
For development or the latest features:
# Clone the repository
git clone https://github.com/provide-io/provide-testkit.git
cd provide-testkit
# Set up environment and install
uv sync
# Verify installation
python -c "import provide.testkit; print('โ
TestKit installed')"
Optional Dependencies¶
Provide TestKit offers several optional feature sets:
Quality Tools¶
Install all code quality analysis tools:
Includes: - Code coverage (coverage.py) - Security scanning (bandit) - Complexity analysis (radon) - Documentation coverage (interrogate) - Performance profiling (memray)
Specific Tool Sets¶
Install only the tools you need:
# Coverage and security only
pip install provide-testkit[coverage,security]
# All complexity tools
pip install provide-testkit[complexity]
All Features¶
Install everything:
Verify Installation¶
Confirm Provide TestKit is installed correctly:
In your tests:
from provide.testkit import fixtures
def test_installation(fixtures.temp_directory):
"""Test that fixtures work."""
assert fixtures.temp_directory.exists()
Troubleshooting¶
TestKit-Specific Issues¶
Problem: Fixtures not discovered by pytest
Solution: Ensure pytest is configured to find provide.testkit:
# Check if testkit is installed
python -c "import provide.testkit; print('โ
Found')"
# Run pytest with verbose fixture discovery
pytest --fixtures | grep provide
Problem: setproctitle warnings on macOS
Solution: This is normal - testkit blocks setproctitle to prevent macOS terminal freezing with pytest-xdist. The blocker is working correctly.
Next Steps¶
- Quick Start - Your first test with Provide TestKit
- API Reference - Complete API documentation
- Quality Guide - Code quality testing tools