You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# All tests with coverage
pytest --cov=pymultiwfn
# Parallel tests (auto-detect CPU cores)
pytest -n auto --cov=pymultiwfn
# Unit tests only
pytest -m "unit" -n auto
# Skip slow tests
pytest -m "not slow" -n auto
# Specific test file
pytest tests/unit/test_core_data.py -v
# Verbose with local variables
pytest -v -l --tb=short
Code Quality
# Code style (Flake8)
flake8 pymultiwfn/
# Type checking (MyPy)
mypy pymultiwfn/
# Coverage report
pytest --cov=pymultiwfn --cov-report=html
open htmlcov/index.html
Available Fixtures
deftest_something(
test_data_dir, # Path to test data directorysample_atom, # Sample Atom objectsample_atoms, # Sample molecule (H2O)sample_shell, # Sample Shell objectsample_wavefunction, # Sample Wavefunction objecttemp_output_dir, # Temporary output directorynumpy_rng, # Seeded random number generatorparallel_safe, # Parallel testing utilitiesisolated_environment, # Test isolationperformance_timer, # Performance timingassert_allclose_tolerance, # Tolerance-aware assertionmock_wavefunction_file, # Mock WFN file path
):
pass
Test Markers
@pytest.mark.unit# Fast, isolated tests@pytest.mark.integration# Requires external resources@pytest.mark.slow# Long-running tests@pytest.mark.requires_data# Requires test data files@pytest.mark.benchmark# Performance tests@pytest.mark.expensive# Heavy computational tests