Testing Guide ============= CuBIE uses ``pytest`` with several custom markers and conventions. Running Tests ------------- .. code-block:: bash # Full suite (requires CUDA GPU) python -m pytest # CPU-only tests (CUDASIM mode) export NUMBA_ENABLE_CUDASIM=1 python -m pytest -m "not nocudasim" # Specific module python -m pytest tests/integrators/ # Specific test pattern python -m pytest -k test_solver Test Markers ------------ ``nocudasim`` Test requires a real GPU; skip in CUDASIM mode. ``slow`` Long-running test; useful with ``-m "not slow"`` for quick iterations. ``sim_only`` Test only runs in CUDASIM mode. ``specific_algos`` Test targets a specific algorithm and may be skipped in broad sweeps. CUDASIM Mode ------------ Setting ``NUMBA_ENABLE_CUDASIM=1`` before import runs cubie in a simulated CUDA environment on the CPU. CI pipelines without GPUs use this mode. CUDASIM is single-threaded and much slower than GPU execution, so keep CUDASIM- compatible tests lightweight. Fixture Patterns ---------------- ``tests/conftest.py`` provides shared fixtures for ODE systems, solver instances, and common parameter sets. Prefer using these fixtures over constructing test objects manually. Key fixtures include pre-built ODE systems (Lotka--Volterra, van der Pol, linear test systems) and solver factories parameterised by algorithm.