Developer Testing Guide#
This page describes how we use pytest markers and how to quarantine legacy tests while keeping visibility.
Marker conventions#
Use the following markers consistently:
@pytest.mark.integrationFor tests that exercise multiple layers together (for example writing/reading.pbmfiles plus mesh export).@pytest.mark.slowFor expensive tests that are valuable but too costly for the default unit test lane.@pytest.mark.guiFor tests that require an interactive display, browser, or rendering backend.
Keep unit tests (fast, deterministic, no external dependencies) unmarked.
Example usage:
import pytest
@pytest.mark.integration
def test_pbm_mesh_roundtrip(...):
...
@pytest.mark.slow
def test_large_spatial_encoding_stress(...):
...
@pytest.mark.gui
def test_interactive_plot(...):
...
How to run subsets#
Default fast lane:
pytest -m "not slow and not gui"
Include integration tests:
pytest -m "integration and not gui"
Run only GUI tests locally:
pytest -m "gui"
Run everything:
pytest
Quarantining legacy tests#
If a test is currently valuable for visibility but not ready for the default lane, quarantine it rather than deleting it.
Recommended approach:
Keep the test under
tests/but mark it clearly (for exampleskipor a dedicated marker when introduced).Add a short reason and an issue/work item reference in the decorator or comment.
Define an explicit exit condition (what must be implemented to unquarantine it).
Current quarantine candidates include:
tests/blockmodel/test_dxf_export.py(pending DXF workflow completion)GUI-heavy cases in
tests/blockmodel/test_toy_blockmodel.pyskipped structured-grid accessor case in
tests/pyvista/test_accessor.py
Guideline#
Prefer a small number of focused test files by concern (ingest, indexing, visualization, integration) and avoid single monolithic files.